1
0
Fork 0
forked from fte/fteqw

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3479 fc73d0e0-1445-4013-8a0c-d673dee63da5

This commit is contained in:
Magnus 2009-11-25 08:02:54 +00:00
parent 7a5f49e879
commit f3350239fc
5 changed files with 107 additions and 76 deletions

View file

@ -628,6 +628,7 @@ void() PutClientInServer =
self.islot1 = SlotVal(IID_WP_KNIFE, 1);
self.islot2 = 0;
self.islot3 = SlotVal(IID_ARM_LEATHER, 1);
self.islot4 = SlotVal(IID_EQUIP_CLIMBINGGEAR, 1);
self.islot5 = SlotVal(IID_CHEM_STIMPACK, 5);
self.islot7 = 0;
self.islot8 = SlotVal(IID_MONEY, 100);
@ -2216,6 +2217,7 @@ void() ClientConnect =
stuffcmd(self, "alias perk2 impulse 62\n");
stuffcmd(self, "alias stimpack impulse 225\n");
stuffcmd(self, "alias radx impulse 228\n");
stuffcmd(self, "alias equip \"cmd invuse 4\"\n");
stuffcmd(self, "alias q1 \"cmd invuse 5\"\n");
stuffcmd(self, "alias q2 \"cmd invuse 11\"\n");
@ -2224,28 +2226,6 @@ void() ClientConnect =
stuffcmd(self, "alias toolkit \"cmd invswap toolkit 2;impulse 2\"\n");
stuffcmd (self, "alias radio1 impulse 212\n");
stuffcmd (self, "alias radio2 impulse 213\n");
stuffcmd (self, "alias radio3 impulse 214\n");
stuffcmd (self, "alias radio4 impulse 215\n");
stuffcmd (self, "alias radio5 impulse 216\n");
stuffcmd (self, "alias radio6 impulse 217\n");
stuffcmd (self, "alias radio7 impulse 218\n");
stuffcmd (self, "alias radio8 impulse 219\n");
stuffcmd (self, "alias radio9 impulse 220\n");
stuffcmd (self, "alias radio10 impulse 221\n");
stuffcmd (self, "alias radio11 impulse 222\n");
stuffcmd (self, "bind f1 radio1\n");
stuffcmd (self, "bind f2 radio2\n");
stuffcmd (self, "bind f3 radio3\n");
stuffcmd (self, "bind f4 radio4\n");
stuffcmd (self, "bind f5 radio5\n");
stuffcmd (self, "bind f6 radio6\n");
stuffcmd (self, "bind f7 radio7\n");
stuffcmd (self, "bind f8 radio8\n");
stuffcmd (self, "bind f9 radio9\n");
stuffcmd (self, "bind f10 radio10\n");
stuffcmd (self, "bind f11 radio11\n");
stuffcmd(self, "bind 9 impulse 9\n");
stuffcmd(self, "bind 0 impulse 10\n");

View file

@ -142,6 +142,12 @@ void(string arg1) Cmd_InvUse =
return;
}
if (iid == IID_CHEM_RADX)
{
UseRadX();
return;
}
if (iid == IID_GREN_FLARE)
{
ToggleFlare();
@ -156,7 +162,6 @@ void(string arg1) Cmd_InvUse =
if (iid == IID_CHEM_ADRENALINE ||
iid == IID_CHEM_PSYCHO ||
iid == IID_CHEM_RADX ||
iid == IID_CHEM_BESERK)
{
if (UseBoostingChem(iid))

View file

@ -62,11 +62,10 @@ local float ldmg;
if (vlen(delta) > (100))
return;
ldmg = 5+random()*5;
ldmg = 7+random()*5;
T_Damage (self.enemy, self, self, ldmg);
self.enemy.attack_finished = time + 0.25;
};

View file

@ -1087,7 +1087,7 @@ void() brotherhood_doctor =
self.xslot17 = SlotVal(IID_CHEM_MEDICALBAG, 25);
self.xslot18 = SlotVal(IID_CHEM_SUPERSTIM, 1);
self.xslot19 = SlotVal(IID_CHEM_ADRENALINE, 1);
self.xslot20 = SlotVal(IID_CHEM_PSYCHO, 1);
self.xslot20 = SlotVal(IID_CHEM_RADX, 1);
};

View file

@ -1,6 +1,7 @@
void () player_use1;
void() show_light_level;
void() UseStimpack;
void() UseRadX;
void() UseSuperStim;
void() UseMedicalBag;
void (entity chest, float iid, float num) DropFromChest;
@ -2518,6 +2519,8 @@ void() ImpulseCommands =
UseSuperStim();
if (self.impulse == 227)
UseMedicalBag();
if (self.impulse == 228)
UseRadX();
if (self.impulse == 255)
self.ammo_shells = 200;
@ -4509,6 +4512,8 @@ void () UseStimpack =
if (self.attack_finished > time)
return;
/*
te = findradius (self.origin, 100);
while (te)
{
@ -4536,7 +4541,7 @@ void () UseStimpack =
}
if (found == 1)
return;
return;*/
self.attack_finished = time + 1;
self.rtime = time + 1;
@ -4563,7 +4568,9 @@ void () UseStimpack =
x = SlotOfItem(self, IID_CHEM_STIMPACK);
if (x > 0)
DecreaseDestroySlot(x);//take away a stimpack
else if (x == 0)
else if (x == 0 && !trace_ent.deadflag)
sprint(self, PRINT_MEDIUM, "no stims!\n");
else if (x == 0 && trace_ent.deadflag)
{
sprint(self, PRINT_MEDIUM, "no stims! searching ");
sprint(self, PRINT_MEDIUM, trace_ent.netname);
@ -4573,13 +4580,13 @@ void () UseStimpack =
if (x == 0)
{
sprint(self, PRINT_MEDIUM, trace_ent.netname);
sprint(self, PRINT_MEDIUM, " had no stims!\n");
sprint(self, PRINT_MEDIUM, " had no stimpacks!\n");
}
if (x >= 1)
{
self.score = self.score + 5;
sprint(self, PRINT_MEDIUM, trace_ent.netname);
sprint(self, PRINT_MEDIUM, " had a stim. using it to heal.\n");
sprint(self, PRINT_MEDIUM, " had a stimpack. using it to heal.\n");
DecreaseDestroySlotOther(trace_ent, x);//take away a stimpack
return;
}
@ -4587,13 +4594,13 @@ void () UseStimpack =
if (x == 0)
{
sprint(self, PRINT_MEDIUM, trace_ent.netname);
sprint(self, PRINT_MEDIUM, " had no medical bag!\n");
sprint(self, PRINT_MEDIUM, " had no medkit!\n");
}
if (x >= 1)
{
self.score = self.score + 5;
sprint(self, PRINT_MEDIUM, trace_ent.netname);
sprint(self, PRINT_MEDIUM, " had a stim. using it to heal.\n");
sprint(self, PRINT_MEDIUM, " had a medkit. using it to heal.\n");
DecreaseDestroySlotOther(trace_ent, x);//take away a stimpack
return;
}
@ -4651,6 +4658,84 @@ void () UseStimpack =
}
};
void () UseRadX =
{
local float x, found;
local vector source;
local entity thing, te;
if (self.attack_finished > time)
return;
self.attack_finished = time + 1;
self.rtime = time + 1;
makevectors (self.v_angle);
source = self.origin + '0 0 0';
traceline (source, source + v_forward*64, FALSE, self);
if (trace_ent.classname == "player")//healing another team-mate
{
if (trace_ent.radiation <= 0)
{
sprint(self, PRINT_MEDIUM, trace_ent.netname);
sprint(self, PRINT_MEDIUM, " is not irradiated.\n");
}
else if (trace_ent.radiation > 0)
{
x = SlotOfItem(self, IID_CHEM_RADX);
if (x > 0)
DecreaseDestroySlot(x);//take away radx
else if (x == 0 && !trace_ent.deadflag)
sprint(self, PRINT_MEDIUM, "you don't have any radx\n");
else
{
sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM);
self.score = self.score + 1;
sprint(trace_ent, PRINT_MEDIUM, self.netname);
sprint(trace_ent, PRINT_MEDIUM, " gives you some Rad-X.\n");
sprint(self, PRINT_MEDIUM, "Your radiation levels decrease.\n");
trace_ent.radiation = trace_ent.radiation - (5 + (self.skill_doctor*2));
if (self.radiation < 0)
self.radiation = 0;
}
}
}
else
{
x = SlotOfItem(self, IID_CHEM_RADX);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "You don't have any Rad-X.\n");
return;
}
else if (self.radiation <= 0)
sprint(self, PRINT_MEDIUM, "You are not irradiated.\n");
else if (self.radiation > 0)
{
DecreaseDestroySlot(x);//take away a stimpack
sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM);
sprint(self, PRINT_MEDIUM, "You take some Rad-X.\n");
sprint(self, PRINT_MEDIUM, "Your radiation levels decrease.\n");
self.radiation = self.radiation - (5 + (self.skill_doctor*2));
if (self.radiation < 0)
self.radiation = 0;
}
}
};
void () UseSuperStim =
{
local float x;
@ -5989,58 +6074,20 @@ void () CharacterSheet =
void () UseEquipment =
{
if (self.equipment == 0)
if (self.equipment_slot == 0)
{
centerprint(self, "<EFBFBD> no extra equipment <20>\n");
return;
}
if (self.equipment == 1)
{
centerprint(self, "<EFBFBD> medic's bag <20>\nlets you carry more stimpacks\n");
return;
}
if (self.equipment == 4)
{
centerprint(self, "<EFBFBD> belt pouch <20>\ngives you room for two extra grenades\n");
return;
}
if (self.equipment == 5)
{
centerprint(self, "<EFBFBD> backpack <20>\nlets you carry more ammunition\n");
return;
}
if (self.equipment == 6)
{
centerprint(self, "<EFBFBD> toolkit mark ii <20>\nbuild, defuse and open doors faster\n");
return;
}
/*
if (self.equipment == 7 && self.equipment_slot == 0)
{
sprint (self, PRINT_HIGH, "climbing gear in place.\n");
sprint (self, PRINT_HIGH, "you are now attempting to climb.\n");
sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM);
self.maxspeed = 100;
self.velocity_z = 0;
self.equipment_state = 1;
self.equipment_slot = 1;
}
if (self.equipment == 7 && self.equipment_state == 1)
else if (self.equipment_slot == 1)
{
sprint (self, PRINT_HIGH, "climbing gear retrieved.\n");
sprint (self, PRINT_HIGH, "no longer attempting to climb.\n");
sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM);
self.grab = 0;
self.equipment_state = 0;
return;
}
*/
if (self.equipment == 8)
{
centerprint(self, "<EFBFBD> enhanced battery <20>\nallows longer cloaking\n");
return;
}
if (self.equipment == 9)
{
Sneak();
self.equipment_slot = 0;
return;
}