*** empty log message ***

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1832 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Magnus 2006-01-09 03:02:05 +00:00
parent 2a29a31c81
commit cfb40163b2
5 changed files with 94 additions and 64 deletions

View file

@ -8,6 +8,8 @@ void (vector org) spawn_tfog;
void (vector org, entity death_owner) spawn_tdeath; void (vector org, entity death_owner) spawn_tdeath;
void(float slot) WeaponAmmo; void(float slot) WeaponAmmo;
void() Identify; void() Identify;
void(entity to, float iid, float amount) AddStackable;
void(entity to, float iid, float amount) AddNonStackable;
float modelindex_dead, modelindex_sneak, modelindex_prone, modelindex_eyes, modelindex_player, modelindex_gone; float modelindex_dead, modelindex_sneak, modelindex_prone, modelindex_eyes, modelindex_player, modelindex_gone;
@ -107,18 +109,18 @@ void() SetNewParms =
parm16 = 1; parm16 = 1;
parm17 = SlotVal(IID_WP_AK74, 30); parm17 = SlotVal(IID_WP_USP, 12);
parm18 = SlotVal(IID_GREN_SMOKE, 5); parm18 = 0;
parm19 = SlotVal(IID_ARM_LEATHER, 1); parm19 = SlotVal(IID_ARM_SHIRT, 1);
parm20 = SlotVal(IID_AM_5MMHIGHVEL, 120); parm20 = SlotVal(IID_CHEM_STIMPACK, 3);
parm21 = SlotVal(IID_AM_556MM, 120); parm21 = SlotVal(IID_AM_10MM, 24);
parm22 = 0; parm22 = 0;
parm23 = SlotVal(IID_WP_TOOLKIT, 1); parm23 = 0;
parm24 = SlotVal(IID_WP_MOONLIGHT, 30); parm24 = 0;
parm25 = 0; parm25 = 0;
parm26 = SlotVal(IID_CHEM_STIMPACK, 3); parm26 = 0;
parm27 = SlotVal(IID_BUILD_MRAMMO, 3); parm27 = 0;
parm28 = SlotVal(IID_BUILD_AUTODOC, 3); parm28 = 0;
parm29 = 0; parm29 = 0;
parm30 = 0; parm30 = 0;
parm31 = 0; parm31 = 0;
@ -483,8 +485,8 @@ called each time a player enters a new level
*/ */
void() PutClientInServer = void() PutClientInServer =
{ {
local entity spot; local entity spot;
local float x;
if (self.class == 0 || self.team == 0) if (self.class == 0 || self.team == 0)
{ {
self.deadflag = DEAD_NO; self.deadflag = DEAD_NO;
@ -530,6 +532,25 @@ void() PutClientInServer =
DecodeLevelParms (); DecodeLevelParms ();
if (self.class == 1)
{
x = SlotOfItem(self, IID_CHEM_MEDICALBAG);
if (x == 0)
AddNonStackable(self, IID_CHEM_MEDICALBAG, 1);
}
if (self.class == 2)
{
x = SlotOfItem(self, IID_EQUIP_STEALTHBOY);
if (x == 0)
AddNonStackable(self, IID_EQUIP_STEALTHBOY, 1);
}
if (self.class == 4)
{
x = SlotOfItem(self, IID_WP_TOOLKIT);
if (x == 0)
AddNonStackable(self, IID_WP_TOOLKIT, 1);
}
self.attack_finished = time; self.attack_finished = time;
self.th_pain = player_pain; self.th_pain = player_pain;
self.th_die = PlayerDie; self.th_die = PlayerDie;

View file

@ -80,6 +80,7 @@ float IID_BUILD_TESLA = 354;
//float IID_BUILD_TELEPAD = 355; //float IID_BUILD_TELEPAD = 355;
float IID_EQUIP_CLIMBINGGEAR = 375; float IID_EQUIP_CLIMBINGGEAR = 375;
float IID_EQUIP_STEALTHBOY = 376;
#define IsShootable(iid) (IsMelee(iid) || IsRanged(iid) || IsGrenade(iid)) #define IsShootable(iid) (IsMelee(iid) || IsRanged(iid) || IsGrenade(iid))
@ -875,6 +876,8 @@ string(float iid) GetItemName =
if (iid == IID_EQUIP_CLIMBINGGEAR) if (iid == IID_EQUIP_CLIMBINGGEAR)
return "climbing gear"; return "climbing gear";
if (iid == IID_EQUIP_STEALTHBOY)
return "stealthboy";
bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n"); bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n");
return strcat("unknown", ftos(iid)); return strcat("unknown", ftos(iid));
@ -1030,6 +1033,8 @@ string(float iid) GetItemImage =
if (iid == IID_EQUIP_CLIMBINGGEAR) if (iid == IID_EQUIP_CLIMBINGGEAR)
return "robofang.jpg"; return "robofang.jpg";
if (iid == IID_EQUIP_STEALTHBOY)
return "stealthboy.jpg";
bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n"); bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n");
return strcat("unknown.jpg", ftos(iid)); return strcat("unknown.jpg", ftos(iid));
@ -1150,6 +1155,9 @@ float(string itname) ItemIDOfName =
return IID_EQUIP_CLIMBINGGEAR; return IID_EQUIP_CLIMBINGGEAR;
if (itname == "gear") if (itname == "gear")
return IID_EQUIP_CLIMBINGGEAR; return IID_EQUIP_CLIMBINGGEAR;
if (itname == "stealthboy")
return IID_EQUIP_STEALTHBOY;
return 0; return 0;
}; };

View file

@ -806,27 +806,55 @@ float() GetRandomAmmo =
if (r <= 2) if (r <= 2)
return IID_AM_NEEDLER; return IID_AM_NEEDLER;
else if (r <= 4)
return IID_AM_10MM;
else if (r <= 6) else if (r <= 6)
return IID_AM_556MM; return IID_AM_10MM;
else if (r <= 8) else if (r <= 8)
return IID_AM_5MMHIGHVEL; return IID_AM_556MM;
else if (r <= 10) else if (r <= 10)
return IID_AM_5MMHIGHVEL;
else if (r <= 13)
return IID_AM_12GAUGESHELLS; return IID_AM_12GAUGESHELLS;
else if (r <= 12)
return IID_AM_ENERGYCELL;
else if (r <= 14) else if (r <= 14)
return IID_AM_ENERGYCELL;
else if (r <= 15)
return IID_AM_2MMEC; return IID_AM_2MMEC;
else if (r <= 16) else if (r <= 16)
return IID_AM_762MM; return IID_AM_762MM;
else if (r <= 18) else if (r <= 18)
return IID_AM_44MAGNUM; return IID_AM_44MAGNUM;
else else
return IID_AM_45ACP; return IID_AM_10MM;
}; };
float(float ammotype) GetAmmoCount =
{
local float ammocount;
if (ammotype == IID_AM_NEEDLER)
ammocount = 2 + random()*7;
if (ammotype == IID_AM_10MM)
ammocount = 5 + random()*10;
if (ammotype == IID_AM_556MM)
ammocount = 3 + random()*8;
if (ammotype == IID_AM_5MMHIGHVEL)
ammocount = 5 + random()*10;
if (ammotype == IID_AM_12GAUGESHELLS)
ammocount = 2 + random()*6;
if (ammotype == IID_AM_ENERGYCELL)
ammocount = 2 + random()*6;
if (ammotype == IID_AM_2MMEC)
ammocount = 1 + random()*2;
if (ammotype == IID_AM_762MM)
ammocount = 2 + random()*4;
if (ammotype == IID_AM_44MAGNUM)
ammocount = 2 + random()*4;
if (ammotype == IID_AM_45ACP)
ammocount = 5 + random()*10;
return ammocount;
};
void() ammo_touch = void() ammo_touch =
{ {
local entity stemp; local entity stemp;
@ -849,36 +877,16 @@ void() ammo_touch =
ammotype = GetRandomAmmo(); ammotype = GetRandomAmmo();
if (ammotype == IID_AM_NEEDLER) ammocount = GetAmmoCount(ammotype);
ammocount = 2 + random()*7;
if (ammotype == IID_AM_10MM)
ammocount = 5 + random()*10;
if (ammotype == IID_AM_556MM)
ammocount = 3 + random()*8;
if (ammotype == IID_AM_5MMHIGHVEL)
ammocount = 5 + random()*10;
if (ammotype == IID_AM_12GAUGESHELLS)
ammocount = 2 + random()*6;
if (ammotype == IID_AM_ENERGYCELL)
ammocount = 2 + random()*6;
if (ammotype == IID_AM_2MMEC)
ammocount = 1 + random()*2;
if (ammotype == IID_AM_762MM)
ammocount = 2 + random()*4;
if (ammotype == IID_AM_44MAGNUM)
ammocount = 2 + random()*4;
if (ammotype == IID_AM_45ACP)
ammocount = 5 + random()*10;
ammocount = ceil(ammocount); ammocount = ceil(ammocount);
if (coop == 1 && total_players == 1) if (coop == 1 && total_players == 1)
ammocount = ammocount * 2; ammocount = ammocount * 2;
ammoname = GetItemName(ammotype); ammoname = GetItemName(ammotype);
ammocountftos = ftos(ammocount); ammocountftos = ftos(ammocount);
// shotgun // shotgun
if (self.weapon == 1) if (self.weapon == 1)
{ {
@ -1518,6 +1526,8 @@ PLAYER BACKPACKS
void() BackpackTouch = void() BackpackTouch =
{ {
local float ammotype, ammocount;
if (other.classname != "player") if (other.classname != "player")
return; return;
@ -1528,21 +1538,27 @@ void() BackpackTouch =
AddStackable(other, IID_AM_10MM, floor(9+random()*9)); AddStackable(other, IID_AM_10MM, floor(9+random()*9));
sprint(other, 2, " 10mm ammo"); sprint(other, 2, " 10mm ammo");
} }
if (self.weapon == 2) else if (self.weapon == 2)
{ {
AddStackable(other, IID_AM_556MM, floor(5+random()*5)); AddStackable(other, IID_AM_556MM, floor(5+random()*5));
sprint(other, 2, " 5mm ammo"); sprint(other, 2, " 5mm ammo");
} }
if (self.weapon == 3) else if (self.weapon == 3)
{ {
AddStackable(other, IID_AM_12GAUGESHELLS, floor(3+random()*3)); AddStackable(other, IID_AM_12GAUGESHELLS, floor(3+random()*3));
sprint(other, 2, " 12 gauge ammo"); sprint(other, 2, " 12 gauge ammo");
} }
if (self.weapon == 4) else if (self.weapon == 4)
{ {
AddStackable(other, IID_AM_10MM, floor(9+random()*9)); AddStackable(other, IID_AM_10MM, floor(9+random()*9));
sprint(other, 2, " 10mm ammo"); sprint(other, 2, " 10mm ammo");
} }
else
{
ammotype = GetRandomAmmo();
ammocount = GetAmmoCount(ammotype);
}
if (random()*4 <= 2) if (random()*4 <= 2)
{ {

View file

@ -986,6 +986,7 @@ void (float slotno) ReloadWeapon =
sound (self, CHAN_WEAPON, "weapons/shell.wav", TRUE, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/shell.wav", TRUE, ATTN_NORM);
else else
sound (self, CHAN_WEAPON, "weapons/reload.wav", TRUE, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/reload.wav", TRUE, ATTN_NORM);
sprint(self, 2, "reloading...\n"); sprint(self, 2, "reloading...\n");
if (self.perk == 3) if (self.perk == 3)
@ -3858,7 +3859,7 @@ void (float rec, float number, float dam, float spread, float ran, float auto) W
} }
}; };
void () PTouch2 = void () PlasmaBolt =
{ {
local float dam; local float dam;
local float zdif; local float zdif;
@ -3877,23 +3878,7 @@ void () PTouch2 =
if (other.takedamage) if (other.takedamage)
{ {
zdif = self.origin_z - other.origin_z; dam = 30 + (random () * 30);
ydif = self.origin_y - other.origin_y;
xdif = self.origin_x - other.origin_x;
tru = 0;
if (ydif >= -6 && ydif <= 6)
{
tru = 1;
}
if (xdif >= -6 && xdif <= 6)
{
tru = 1;
}
dam = 60 + (random () * 90);
if (other.classname == "ighoul")
{
dam = 120 + (random () * 120);
}
T_Damage (other, self, self.owner, dam); T_Damage (other, self, self.owner, dam);
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
@ -3938,7 +3923,6 @@ void () FireAlienBlaster =
newmis.velocity = (newmis.velocity * 3000); newmis.velocity = (newmis.velocity * 3000);
newmis.angles = vectoangles (newmis.velocity); newmis.angles = vectoangles (newmis.velocity);
// newmis.touch = PTouch;
newmis.nextthink = (time + IDLE3A); newmis.nextthink = (time + IDLE3A);
newmis.think = SUB_Remove; newmis.think = SUB_Remove;
setmodel (newmis, "progs/plasma.mdl"); setmodel (newmis, "progs/plasma.mdl");
@ -3951,7 +3935,7 @@ void () FireAlienBlaster =
newmis.angles = vectoangles (newmis.velocity); newmis.angles = vectoangles (newmis.velocity);
newmis.nextthink = time + 1.4; newmis.nextthink = time + 1.4;
sound (self, CHAN_WEAPON, "weapons/blaster.wav", WEAPON_SHOTGUN, ATTN_NORM); sound (self, CHAN_WEAPON, "weapons/blaster.wav", WEAPON_SHOTGUN, ATTN_NORM);
newmis.touch = PTouch2; newmis.touch = PlasmaBolt;
setmodel (newmis, "progs/ray.mdl"); setmodel (newmis, "progs/ray.mdl");
tmp = 90 + self.velocity_y + self.velocity_x; tmp = 90 + self.velocity_y + self.velocity_x;
} }

View file

@ -579,6 +579,7 @@ void() worldspawn =
precache_sound ("weapons/tink1.wav"); precache_sound ("weapons/tink1.wav");
precache_sound ("weapons/sa80-1.wav"); precache_sound ("weapons/sa80-1.wav");
precache_sound ("weapons/shell.wav"); precache_sound ("weapons/shell.wav");
precache_sound ("weapons/reload.wav");
precache_sound ("misc/build1.wav"); precache_sound ("misc/build1.wav");
precache_sound ("misc/build2.wav"); precache_sound ("misc/build2.wav");
precache_sound ("misc/build3.wav"); precache_sound ("misc/build3.wav");