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

This commit is contained in:
Magnus 2009-11-05 03:40:39 +00:00
parent 483b971185
commit a9debe4b20
34 changed files with 14220 additions and 2636 deletions

View file

@ -149,7 +149,7 @@ local float r;
spot2 = targ.origin + targ.view_ofs;
r = vlen (spot1 - spot2);
if (r < 120)
if (r < 80)
return RANGE_MELEE;
if (r < 500)
return RANGE_NEAR;
@ -349,7 +349,8 @@ slower noticing monsters.
float() FindTarget =
{
local entity client;
local float r;
local float r, x;
local string y;
// if the first spawnflag bit is set, the monster will only wake up on
// really seeing the player, not another monster getting angry
@ -378,15 +379,18 @@ float() FindTarget =
return FALSE;
if (client.items & IT_INVISIBILITY)
return FALSE;
if ((client.sneak > 75) && (client.velocity == '0 0 0'))//if you are standing still, hiding, there's no chance
return FALSE; //they will see you, unless they turn into you
r = range (client);
if (r == RANGE_FAR)
return FALSE;
if (!visible (client))
return FALSE;
if (client.sneak != 0)//sneaking players are invisible
if (client.team == 0)//client connecting
return FALSE;
if (client.class == 0)//client connecting
return FALSE;
@ -397,10 +401,47 @@ float() FindTarget =
}
else if (r == RANGE_MID)
{
if ( /* client.show_hostile < time || */ !infront (client))
if (!infront (client))
return FALSE;
}
if ((self.search_time < time))
{
if (self.alert == 0 && client.sneak > 5)
self.search_time = time + 2;
else if (self.alert == 0 && client.sneak <= 5)
self.search_time = time + 1;
else if (self.alert > 0)
{
self.search_time = time + 2;
self.alert = self.alert - 1;
}
//if your sneak level is 70% or higher you will never get caught
//alert guards get the full 100% random roll, otherwise 90%
if (self.alert == 0)
x = random()*80;
else
x = random()*100;
if (client.sneak >= 70 && client.velocity == '0 0 0')
{
sprint(client, 2, self.netname);
sprint(client, 2, " failed to detect you.\n");
}
else if (client.sneak > 0 && (x > client.sneak + 15))
{
sprint(client, 2, "you've been detected!\n");
client.sneak = 0;
}
else if (client.sneak > 0)
{
sprint(client, 2, self.netname);
sprint(client, 2, " failed to detect you.\n");
}
}
if (client.sneak > 0)//sneaking players are invisible
return FALSE;
//
// got one
//
@ -477,11 +518,6 @@ void(float dist) ai_walk =
{
movedist = dist;
if (self.classname == "monster_dragon")
{
movetogoal (dist);
return;
}
// check for noticing a player
if (FindTarget ())
return;

File diff suppressed because it is too large Load diff

View file

@ -39,6 +39,35 @@ float(string desc) itemtoslot =
}
};
float(entity x, float slotno) DecreaseDestroySlotOther =
{
local float it;
local float iid;
local float num;
local entity oself;
oself = self;
self = x;
it = ItemInSlot(self, slotno);
if (ToStatus(it) <= 1)
{
SetItemSlot(self, slotno, 0);
return true;
}
else
{
iid = ToIID(it);
num = ToStatus(it);
num = num - 1;
it = SlotVal(iid, num);
SetItemSlot(self, slotno, it);
return false;
}
self = oself;
};
float(float slotno) DecreaseDestroySlot =
{
local float it;
@ -64,21 +93,33 @@ float(float slotno) DecreaseDestroySlot =
void(string arg1) Cmd_InvUse =
{
local float it, iid;
local float slotno;
local float slotno, w;
slotno = itemtoslot(arg1);
if (!slotno)
{
sprint(self, PRINT_MEDIUM, "Can't use - you don't have one\n");
sprint(self, PRINT_MEDIUM, "can't use - you don't have one\n");
return;
}
it = ItemInSlot(self, slotno);
iid = ToIID(it);
w = SlotOfItem(self, iid);
if (iid == 0)
return;
if (iid >= IID_GREN_FRAG && iid <= IID_GREN_STUN)
{
if (w != 5 && w != 6)
return;
self.rtime = time + 1;
self.grenslot = w;
player_pull1();
return;
}
if (WeaponAmmoType(iid))
{
//weapons are reloaded
@ -86,17 +127,34 @@ void(string arg1) Cmd_InvUse =
return;
}
if (iid == IID_CHEM_STIMPACK ||
iid == IID_CHEM_MEDICALBAG ||
iid == IID_CHEM_SUPERSTIM)
if (iid == IID_CHEM_MEDICALBAG)
{
if (UseHealingChem(iid))
DecreaseDestroySlot(slotno);
UseMedicalBag();
return;
}
if (iid == IID_CHEM_STIMPACK)
{
UseStimpack();
return;
}
if (iid == IID_GREN_FLARE)
{
ToggleFlare();
return;
}
if (iid == IID_CHEM_SUPERSTIM)
{
UseSuperStim();
return;
}
if (iid == IID_CHEM_ADRENALINE ||
iid == IID_CHEM_PSYCHO ||
iid == IID_CHEM_RADX ||
iid == IID_CHEM_BESERK)
{
if (UseBoostingChem(iid))
@ -147,16 +205,17 @@ void(string arg1) Cmd_InvUse =
}
if (iid == IID_EQUIP_STEALTHBOY)
{
if (self.equipment_slot == slotno)
{
self.equipment_slot = 0;
sprint(self, PRINT_HIGH, "stealthboy deactivated\n");
}
else
{
self.equipment_slot = slotno;
sprint(self, PRINT_HIGH, "stealthboy activated, fading into the shadows\n");
}
Sneak();
return;
}
if (iid == IID_EQUIP_SILENCER)
{
AttachSilencer();
return;
}
if (iid == IID_WP_WRENCH)
{
FireToolkit();
return;
}
if (iid == IID_EQUIP_HOVERBOOTS)
@ -198,6 +257,519 @@ void(string arg1) Cmd_InvDrop =
DropFromSlot(slotno, true, false);
};
void(string arg1) Cmd_InvSell =
{
local float it, iid, x;
local float slotno;
local string y, z;
slotno = itemtoslot(arg1);
if (!slotno)
{
sprint(self, 2, "can't sell - you don't have one\n");
return;
}
if (slotno <= 4)
{
sprint(self, 2, "put it in your inventory first!\n");
return;
}
it = ItemInSlot(self, slotno);
iid = ToIID(it);
if (iid == 0)
return;
self.missionbrief = 0;
SetItemSlot(self, slotno, 0);
x = GetBaseValue(iid);
y = ftos(x);
z = GetItemName(iid);
self.ammo_shells += x;
sprint(self, 2, "you sell ");
sprint(self, 2, z);
sprint(self, 2, " for $");
sprint(self, 2, y);
sprint(self, 2, ".\n");
};
void(string arg1) Cmd_InvMix =
{
local float it, iid;
local float slotno, x;
slotno = itemtoslot(arg1);
if (!slotno)
{
sprint(self, PRINT_MEDIUM, "Can't drop - you don't have one\n");
return;
}
it = ItemInSlot(self, slotno);
iid = ToIID(it);
if (iid == 0)
return;
if (iid == IID_MISC_NUKACOLA)
{
x = SlotOfItem(self, IID_MISC_CHEMICALS);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need (1) nukacola and (1) chemicals\n");
return;
}
DecreaseDestroySlot(slotno);
DecreaseDestroySlot(x);
TryGiveStackable(self, IID_CHEM_STIMPACK, 1);
sprint(self, PRINT_MEDIUM, "stimpack created\n");
}
if (iid == IID_MISC_AEROSOL)
{
x = SlotOfItem(self, IID_MISC_CHEMICALS);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need (1) aerosol can and (1) chemicals\n");
return;
}
DecreaseDestroySlot(slotno);
DecreaseDestroySlot(x);
TryGiveStackable(self, IID_CHEM_RADX, 3);
sprint(self, PRINT_MEDIUM, "rad-x created\n");
}
if (iid == IID_MISC_RDXCRYSTAL)
{
x = SlotOfItem(self, IID_MISC_CHEMICALS);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need (1) rdx crystal and (1) chemicals\n");
return;
}
DecreaseDestroySlot(slotno);
DecreaseDestroySlot(x);
TryGiveStackable(self, IID_CHEM_PSYCHO, 2);
sprint(self, PRINT_MEDIUM, "psycho created\n");
}
if (iid == IID_CHEM_STIMPACK)
{
if (ToStatus(slotno) <= 1)
{
sprint(self, PRINT_MEDIUM, "you need (2) stimpacks and (1) chemicals\n");
return;
}
x = SlotOfItem(self, IID_MISC_CHEMICALS);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need (2) stimpacks and (1) chemicals\n");
return;
}
DecreaseDestroySlot(slotno);
DecreaseDestroySlot(slotno);
DecreaseDestroySlot(x);
TryGiveStackable(self, IID_CHEM_SUPERSTIM, 1);
sprint(self, PRINT_MEDIUM, "superstim created.\n");
}
};
void(string arg1) Cmd_InvCreate =
{
local float it, iid;
local float slotno, q, w, x, y, z;
local float weap;
if (arg1 == "flash")
{
x = SlotOfItem(self, IID_MISC_NUKACOLA);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals + aerosol can\n");
return;
}
y = SlotOfItem(self, IID_MISC_CHEMICALS);
if (y == 0)
{
sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals + aerosol can\n");
return;
}
z = SlotOfItem(self, IID_MISC_AEROSOL);
if (z == 0)
{
sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals + aerosol can\n");
return;
}
DecreaseDestroySlot(x);
DecreaseDestroySlot(y);
DecreaseDestroySlot(z);
if ((random()<0.50) && (self.class == 1))
{
sprint(self, PRINT_MEDIUM, "you failed to create a flash bomb.\n");
return;
}
if ((random()<0.25) && (self.class == 2))
{
sprint(self, PRINT_MEDIUM, "you failed to create a flash bomb.\n");
return;
}
if ((random()<0.75) && (self.class == 3))
{
sprint(self, PRINT_MEDIUM, "you failed to create a flash bomb.\n");
return;
}
TryGiveStackable(self, IID_GREN_FLASH, 1);
sprint(self, PRINT_MEDIUM, "flash bomb created.\n");
}
if (arg1 == "grenade")
{
x = SlotOfItem(self, IID_MISC_RDXCRYSTAL);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need rdx crystals, chemicals, aerosol can\n");
return;
}
y = SlotOfItem(self, IID_MISC_CHEMICALS);
if (y == 0)
{
sprint(self, PRINT_MEDIUM, "you need rdx crystals, chemicals, aerosol can\n");
return;
}
z = SlotOfItem(self, IID_MISC_AEROSOL);
if (z == 0)
{
sprint(self, PRINT_MEDIUM, "you need rdx crystals, chemicals, aerosol can\n");
return;
}
DecreaseDestroySlot(x);
DecreaseDestroySlot(y);
DecreaseDestroySlot(z);
if ((random()<0.75) && (self.class == 1))
{
sprint(self, PRINT_MEDIUM, "you failed to create a grenade.\n");
return;
}
if ((random()<0.75) && (self.class == 2))
{
sprint(self, PRINT_MEDIUM, "you failed to create a grenade.\n");
return;
}
if ((random()<0.75) && (self.class == 3))
{
sprint(self, PRINT_MEDIUM, "you failed to create a grenade.\n");
return;
}
TryGiveStackable(self, IID_GREN_FRAG, 1);
sprint(self, PRINT_MEDIUM, "homemade bomb created.\n");
}
if (arg1 == "silencer")
{
x = SlotOfItem(self, IID_MISC_DUCKTAPE);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need junk + aerosol can + duck tape\n");
return;
}
y = SlotOfItem(self, IID_MISC_JUNK);
if (y == 0)
{
sprint(self, PRINT_MEDIUM, "you need junk + aerosol can + duck tape\n");
return;
}
z = SlotOfItem(self, IID_MISC_AEROSOL);
if (z == 0)
{
sprint(self, PRINT_MEDIUM, "you need junk + aerosol can + duck tape\n");
return;
}
DecreaseDestroySlot(x);
DecreaseDestroySlot(y);
DecreaseDestroySlot(z);
if ((random()<0.25) && (self.class == 1))
{
sprint(self, PRINT_MEDIUM, "you failed to create a silencer.\n");
return;
}
if ((random()<0.10) && (self.class == 2))
{
sprint(self, PRINT_MEDIUM, "you failed to create a silencer.\n");
return;
}
if ((random()<0.50) && (self.class == 3))
{
sprint(self, PRINT_MEDIUM, "you failed to create a silencer.\n");
return;
}
AddNonStackable(self, IID_EQUIP_SILENCER, 1);
sprint(self, PRINT_MEDIUM, "silencer created.\n");
}
if (arg1 == "stun")
{
x = SlotOfItem(self, IID_MISC_NUKACOLA);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals\n");
return;
}
y = SlotOfItem(self, IID_MISC_CHEMICALS);
if (y == 0)
{
sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals\n");
return;
}
DecreaseDestroySlot(x);
DecreaseDestroySlot(y);
if ((random()<0.40) && (self.class < 4))
{
sprint(self, PRINT_MEDIUM, "you failed to create a stun grenade.\n");
return;
}
TryGiveStackable(self, IID_GREN_STUN, 1);
sprint(self, PRINT_MEDIUM, "stun grenade created.\n");
}
if (arg1 == "extender")
{
y = SlotOfItem(self, IID_MISC_STEELPIPE);
if (y == 0)
{
sprint(self, PRINT_MEDIUM, "you need steel pipe + duck tape\n");
return;
}
z = SlotOfItem(self, IID_MISC_DUCKTAPE);
if (z == 0)
{
sprint(self, PRINT_MEDIUM, "you need junk, aerosol can\n");
return;
}
DecreaseDestroySlot(y);
DecreaseDestroySlot(z);
AddNonStackable(self, IID_EQUIP_EXTENDER, 1);
sprint(self, PRINT_MEDIUM, "barrel extender created.\n");
}
if (arg1 == "xray")
{
y = SlotOfItem(self, IID_MISC_LCD);
if (y == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
y = SlotOfItem(self, IID_MISC_CIRCUITBOARD);
if (y == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
z = SlotOfItem(self, IID_MISC_GUM);
if (z == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
q = SlotOfItem(self, IID_MISC_XRAYTUBE);
if (q == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
w = SlotOfItem(self, IID_MISC_COPPERWIRE);
if (w == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
DecreaseDestroySlot(q);
DecreaseDestroySlot(w);
DecreaseDestroySlot(x);
DecreaseDestroySlot(y);
DecreaseDestroySlot(z);
if ((random()<0.90) && (self.class < 4))
{
sprint(self, PRINT_MEDIUM, "you failed to create an x-ray device.\n");
return;
}
AddNonStackable(self, IID_EQUIP_XRAY, 1);
sprint(self, PRINT_MEDIUM, "x-ray device created!\n");
}
if (arg1 == "modify")
{
weap = ToIID(self.(SlotField(self.current_slot)));
if (weap == IID_WP_PULSERIFLE)
{
y = SlotOfItem(self, IID_MISC_DUCKTAPE);
if (y == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
x = SlotOfItem(self, IID_MISC_CIRCUITBOARD);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
z = SlotOfItem(self, IID_MISC_NUKACOLA);
if (z == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
q = SlotOfItem(self, IID_MISC_XRAYTUBE);
if (q == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
w = SlotOfItem(self, IID_MISC_COPPERWIRE);
if (w == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
DecreaseDestroySlot(q);
DecreaseDestroySlot(w);
DecreaseDestroySlot(x);
DecreaseDestroySlot(y);
DecreaseDestroySlot(z);
if (ToIID(self.islot1) == IID_WP_PULSERIFLE)
SetItemSlot(self, 1, SlotVal(IID_WP_TURBOPLASMA, 40));
else if (ToIID(self.islot2) == IID_WP_PULSERIFLE)
SetItemSlot(self, 2, SlotVal(IID_WP_TURBOPLASMA, 40));
if ((random()<0.25))
{
sprint(self, PRINT_MEDIUM, "you try to modify your plasma rifle by hotwiring\n");
sprint(self, PRINT_MEDIUM, "the bolt carrier and venting off excess gasses \n");
sprint(self, PRINT_MEDIUM, "but you end up destroying it...\n");
return;
}
AddNonStackable(self, IID_WP_TURBOPLASMA, 1);
sprint(self, PRINT_MEDIUM, "turbo plasma rifle created\n");
}
if (weap == IID_WP_AK112)
{
y = SlotOfItem(self, IID_MISC_DUCKTAPE);
if (y == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
x = SlotOfItem(self, IID_MISC_JUNK);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
z = SlotOfItem(self, IID_MISC_AEROSOL);
if (z == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
w = SlotOfItem(self, IID_MISC_COPPERWIRE);
if (w == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
DecreaseDestroySlot(y);
DecreaseDestroySlot(w);
DecreaseDestroySlot(x);
DecreaseDestroySlot(z);
if (ToIID(self.islot1) == IID_WP_AK112)
SetItemSlot(self, 1, SlotVal(IID_WP_AK112_M, 50));
else if (ToIID(self.islot2) == IID_WP_AK112)
SetItemSlot(self, 2, SlotVal(IID_WP_AK112_M, 50));
sprint(self, PRINT_MEDIUM, "created expanded magazine for ak-112\n");
}
if (weap == IID_WP_DEAGLE)
{
y = SlotOfItem(self, IID_MISC_DUCKTAPE);
if (y == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
x = SlotOfItem(self, IID_MISC_JUNK);
if (x == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
z = SlotOfItem(self, IID_MISC_AEROSOL);
if (z == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
w = SlotOfItem(self, IID_MISC_COPPERWIRE);
if (w == 0)
{
sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n");
return;
}
DecreaseDestroySlot(y);
DecreaseDestroySlot(w);
DecreaseDestroySlot(x);
DecreaseDestroySlot(z);
if (ToIID(self.islot1) == IID_WP_DEAGLE)
SetItemSlot(self, 1, SlotVal(IID_WP_DEAGLE_M, 10));
else if (ToIID(self.islot2) == IID_WP_DEAGLE)
SetItemSlot(self, 2, SlotVal(IID_WP_DEAGLE_M, 10));
sprint(self, PRINT_MEDIUM, "created expanded magazine for deagle\n");
}
else
{
sprint(self, PRINT_MEDIUM, "can't modify currently held weapon.\n");
return;
}
}
};
void(string arg1, string arg2) Cmd_InvSwap =
{
local float old1, old2;
@ -288,6 +860,24 @@ void(string line) SV_ParseClientCommand =
return;
Cmd_InvDrop(argv(1));
}
else if (cmd == "invsell")
{
if (self.deadflag || self.current_slot==0)
return;
Cmd_InvSell(argv(1));
}
else if (cmd == "invmix")
{
if (self.deadflag)
return;
Cmd_InvMix(argv(1));
}
else if (cmd == "create")
{
if (self.deadflag)
return;
Cmd_InvCreate(argv(1));
}
else if (cmd == "invswap")
{
if (self.deadflag || self.current_slot==0)

View file

@ -3,7 +3,7 @@ void() T_MissileTouch;
void() info_player_start;
void(entity targ, entity attacker) ClientObituary;
void(entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage;
float (float int) getperk;
void() monster_death_use;
//============================================================================
@ -115,7 +115,7 @@ This should be the only function that ever reduces health.
void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
{
local entity oldself;
local float save;
local float save, dm;
local float take, severity, helm;
local string attackerteam, targteam;
@ -123,47 +123,230 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
if (!targ.takedamage)
return;
damage = floor(damage);
targ.health = floor(targ.health);
if (attacker.classname == "player" && total_players == 4)
damage = floor(damage * 0.75);
if (attacker.classname == "player" && total_players == 3)
damage = floor(damage * 0.80);
else if (attacker.classname == "player" && total_players == 2)
damage = floor(damage * 0.90);
if (attacker.classname == "monster" && total_players == 4)
damage = floor(damage * 1.30);
if (attacker.classname == "monster" && total_players == 3)
damage = floor(damage * 1.20);
else if (attacker.classname == "monster" && total_players == 2)
damage = floor(damage * 1.10);
//getting hurt is slightly painful to the score, play cautiously!
if (attacker.classname == "monster" && targ.classname == "player")
targ.score = targ.score - 6;
//flanking monsters awards points
if (attacker.classname == "player" && targ.classname == "monster" && targ.enemy != attacker)
attacker.score = attacker.score + 5;
//aimed shots awards points
if (attacker.classname == "player" && targ.classname == "monster" && attacker.recoil <= 5)
attacker.score = attacker.score + 1;
//attacker a monster from behind awards points
local vector vec;
local float dot;
if (attacker.classname == "player" && targ.classname == "monster")
{
makevectors (targ.angles);
vec = normalize (attacker.origin - targ.origin);
dot = (vec * v_forward);
if (dot > 0.3)
attacker.score = attacker.score + 5;
}
//attacking a team-mate is a HUGE penalty
if (attacker.classname == "player" && targ.classname == "player")
{
attacker.score = attacker.score - 25;
sprint(attacker, 2, "you just shot a teammate! be careful!\n");
}
//attacking a hostage is a HUGE penalty
if (attacker.classname == "player" && targ.classname == "hostage")
{
attacker.score = attacker.score - 25;
sprint(attacker, 2, "you just shot a hostage! be careful!\n");
}
//using cover awards points
if (targ.classname == "monster" && attacker.classname == "player" && attacker.rage == 777)
attacker.score = attacker.score + 1;
//dodge chance
if (targ.position == 0 && random()<0.05)
{
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return;
}
else if (targ.position == 1 && random()<0.05)
{
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return;
}
else if (targ.position == 2 && random()<0.10)
{
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return;
}
damage = damage * 1.25;
//nintendo gamer: going into the zone gives a 50% miss chance
if (targ.rage == 255)
{
if (random()<0.50)
{
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return;
}
}
//paranoia: if taking cover, 25% miss chance (others get 10% bonus)
if (targ.rage == 777)
{
if (targ.perk1 == 10 || targ.perk2 == 10)
{
if (random()<0.20)
{
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return;
}
}
else
{
if (random()<0.05)
{
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return;
}
}
}
//master blaster: the more you burst, the higher the damage bonus
if (attacker.perk1 == 18 || attacker.perk2 == 18)
{
if (self.recoil > 10)
{
sprint(self, 2, "!MASTER BLASTER\n");
damage = damage * (1 + (self.recoil * 0.01));
}
}
//sneak attack: if you attack a creature who isn't fighting you, bonus damage
if (attacker.perk1 == 7 || attacker.perk2 == 7)
{
if (targ.enemy != attacker)
{
sprint(attacker, 2, "!SNEAK ATTACK\n");
if (damage <= 10)
damage = damage * 3;
else if (damage <= 20)
damage = damage * 2;
else if (damage <= 30)
damage = damage * 1.5;
else
damage = damage * 1.25;
}
}
//death wish: 20% damage bonus to targ, 10% to attacker
if (targ.perk1 == 19 || targ.perk2 == 19)
damage = damage * 1.10;
//death wish: 20% damage bonus to targ, 10% to attacker
if (attacker.perk1 == 19 || attacker.perk2 == 19)
damage = damage * 1.20;
//die hard: if below 50% health, 25% damage resistance
if (targ.perk1 == 1 || targ.perk2 == 1)
{
if (targ.health < (targ.max_health*0.5))
damage = damage * 0.75;
}
if ((targ.perk1 == 17 || targ.perk2 == 17) && random()<0.02)
{
damage = damage * 0.10;
sprint(self, 2, "!ONE IN A MILLION\n");
}
// used by buttons and triggers to set activator for target firing
damage_attacker = attacker;
if (attacker.classname == "monster")
{
if (random()*100>= 98)
attacker.critical = 3;
else
attacker.critical = 0;
}
// check for quad damage powerup on the attacker
if (attacker.super_damage_finished > time && inflictor.classname != "door")
if (deathmatch == 4)
damage = damage * 8;
else
damage = damage * 4;
if (attacker.critical == 3)//attacker scored a headshot/critical
if (attacker.critical == 3 && targ.classname != "car")//attacker scored a headshot/critical
{
if (attacker.critical == 3)
{
if (random()<0.005)
severity = 64;
severity = 0 + random()*20;
if (attacker.perk == 7)
severity = severity + 4;
if (attacker.class == 3)
severity = severity + 2;
if ((attacker.perk1 == 17 || attacker.perk2 == 17) && random()<0.05)
{
severity = severity + 15;
sprint(self, 2, "!ONE IN A MILLION\n");
}
if (severity >= 19)
if (attacker.class == 2)
severity = severity + 5;
if (targ.classname == "player")
damage = (damage * 2);
else if (severity >= 64)
damage = (damage * 10);
else if (severity >= 30)
damage = (damage * 6);
else if (severity >= 20)
damage = (damage * 5);
else if (severity >= 14)
else if (severity >= 15)
damage = (damage * 4);
else
damage = (damage * 3);
if (targ.classname == "monster")
attacker.score = attacker.score + 5;
helm = targ.armortype;
if (targ.helmet == 0)
{
sound (targ, CHAN_BODY, "player/headshot.wav", 1, ATTN_NORM);
sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM);
helm = 0;
}
if (targ.helmet == AS_STRAIGHT)
if (targ.helmet == 1)
{
sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM);
helm = 0.30;
}
if (targ.helmet == AS_SLIDING)
if (targ.helmet == 2)
{
sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM);
helm = 0.45;
@ -182,22 +365,9 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
return;
}
sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM);
// save damage based on the target's armor level
save = ceil(targ.armortype*damage);
if (save >= targ.armorvalue)
{
save = targ.armorvalue;
/* targ.armortype = 0; // lost all armor
targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
*/
}
sound (targ, CHAN_ITEM, targ.armornoise, 1, ATTN_NORM);
take = ceil(damage-save);
// add to the damage total for clients, which will be sent as a single
// message at the end of the frame
// FIXME: remove after combining shotgun blasts?
@ -263,6 +433,347 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
return;
take = damage;
// do the damage
//different sorts of armour simply subtract different amounts
//this makes armor like the force armor good against many small rounds
//(SMG, shotguns, swords, etc) but useless against big damage (grenades)
//power armor, which has the best of both worlds, is also the heaviest :p
//fix: soldiers inherent armor bonus applies to armor absorb
//fix: psycho drug gives similar benefits to a soldiers bonus
if (targ.class == 3)
take -= 1;
if (self.rage == IID_CHEM_PSYCHO)
take -= 3;
switch(ToIID(targ.islot3))
{
case IID_ARM_DESERT:
take -= 1;
break;
case IID_ARM_SHIRT:
take -= 1;
break;
case IID_ARM_LEATHER:
take -= 5;
break;
case IID_ARM_KEVLAR:
take -= 3;
break;
case IID_ARM_METAL:
take -= 9;
break;
case IID_ARM_COMBAT:
take -= 7;
break;
case IID_ARM_BROTHERHOOD:
take -= 10;
break;
case IID_ARM_FORCE:
take -= 13;
break;
case IID_ARM_LPOWER:
take -= 11;
break;
default:
break;
}
switch(ToIID(targ.islot3))
{
case IID_ARM_SHIRT:
take = take * 0.80;
break;
case IID_ARM_LEATHER:
take = take * 0.70;
break;
case IID_ARM_KEVLAR:
take = take * 0.50;
break;
case IID_ARM_METAL:
take = take * 0.65;
break;
case IID_ARM_COMBAT:
take = take * 0.60;
break;
case IID_ARM_BROTHERHOOD:
take = take * 0.55;
break;
case IID_ARM_FORCE:
take = take * 0.90;
break;
case IID_ARM_LPOWER:
take = take * 0.50;
break;
default:
break;
}
if (targ.classname == "player" && targ.zoom > 0)
{
targ.maxspeed = targ.maxspeed * 0.33;
stuffcmd(targ, "v_idlescale 20\n");
}
else if (take > 20 && targ.classname == "player")
{
targ.maxspeed = targ.maxspeed * 0.25;
stuffcmd(targ, "v_cshift 100 0 0 100\n");
stuffcmd(targ, "v_idlescale 30\n");
}
else if (take > 0)
{
targ.maxspeed = targ.maxspeed * 0.50;
stuffcmd(targ, "v_cshift 100 0 0 50\n");
}
if (take <= 0)
{
take = 0;
sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM);
return;
}
targ.health = targ.health - take;
if (targ.classname == "monster" && targ.enemy.classname != "player" && attacker.classname == "player")
{
targ.enemy = attacker;
targ.think = HuntTarget;
targ.nextthink = time + 0.1;
}
local string lm;
if (targ.health <= 0)
{
//vanquishing a monster earns points for all players
if (attacker.classname == "player" && targ.classname == "monster")
{
local entity te;
te = findradius(attacker.origin, 1000);
while (te)
{
if (te.classname == "player")
te.score = te.score + 10;
te = te.chain;
}
}
Killed (targ, attacker);
if (attacker.perk1 == 11 || attacker.perk2 == 11)
{
attacker.lastman += 1.5;
lm = ftos(attacker.lastman);
sprint(self, 2, "!LAST MAN STANDING: ");
sprint(self, 2, lm);
sprint(self, 2, "\n");
attacker.health += attacker.lastman;
if (attacker.health > attacker.max_health)
attacker.health = attacker.max_health;
}
return;
}
// react to the damage
oldself = self;
self = targ;
//SERVER
if ( (self.flags & FL_MONSTER) && attacker != world)
{
// get mad unless of the same class (except for soldiers)
if (self != attacker && attacker != self.enemy)
{
if ((self.classname != attacker.classname))
{
if (self.enemy.classname == "player")
self.oldenemy = self.enemy;
self.enemy = attacker;
FoundTarget ();
}
}
}
if (self.th_pain)
{
self.th_pain (attacker, take);
}
self = oldself;
};
/*
============
J_Damage
This is a special function that is called for weapons using JHP ammo.
JHP ammo does extra damage against things wearing no armor or little
armor, but less damage against heavily armored foes.
============
*/
void(entity targ, entity inflictor, entity attacker, float damage) J_Damage =
{
local entity oldself;
local float save;
local float take, severity, helm;
local string attackerteam, targteam;
if (!targ.takedamage)
return;
damage = damage * 1.25;
damage = floor(damage);
// used by buttons and triggers to set activator for target firing
damage_attacker = attacker;
if (attacker.critical == 3 && targ.classname != "car")//attacker scored a headshot/critical
{
if (attacker.critical == 3)
{
severity = 0 + random()*20;
if (attacker.class == 3)
severity = severity + 2;
if (severity >= 19)
damage = (damage * 5);
else if (severity >= 14)
damage = (damage * 4);
else
damage = (damage * 3);
if (targ.classname == "monster")
attacker.score = attacker.score + 5;
helm = targ.armortype;
if (targ.helmet == 0)
{
sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM);
helm = 0;
}
if (targ.helmet == AS_STRAIGHT)
{
sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM);
helm = 0.30;
}
if (targ.helmet == AS_SLIDING)
{
sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM);
helm = 0.45;
}
damage = (damage - (damage * helm));
makevectors (targ.v_angle);
}
}
//sneak attack: if you attack a creature who isn't fighting you, bonus damage
if (attacker.perk1 == 7 || attacker.perk2 == 7)
{
if (targ.enemy != attacker)
{
sprint(attacker, 2, "!SNEAK ATTACK\n");
if (damage <= 10)
damage = damage * 3;
else if (damage <= 20)
damage = damage * 2;
else if (damage <= 30)
damage = damage * 1.5;
else
damage = damage * 1.25;
}
}
if (damage <= 0)
{
damage = 0;
sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM);
return;
}
sound (targ, CHAN_ITEM, targ.armornoise, 1, ATTN_NORM);
// add to the damage total for clients, which will be sent as a single
// message at the end of the frame
// FIXME: remove after combining shotgun blasts?
if (targ.flags & FL_CLIENT)
{
targ.dmg_take = targ.dmg_take + take;
targ.dmg_save = targ.dmg_save + save;
targ.dmg_inflictor = inflictor;
}
damage_inflictor = inflictor;
/*
// figure momentum add
if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) )
{
dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5;
dir = normalize(dir);
// Set kickback for smaller weapons
//Zoid -- use normal NQ kickback
// // Read: only if it's not yourself doing the damage
// if ( (damage < 60) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname != targ.netname))
// targ.velocity = targ.velocity + dir * damage * 11;
// else
// Otherwise, these rules apply to rockets and grenades
// for blast velocity
targ.velocity = targ.velocity + dir * damage * 8;
// Rocket Jump modifiers
if ( (rj > 1) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname == targ.netname))
targ.velocity = targ.velocity + dir * damage * rj;
}*/
// check for godmode or invincibility
if (targ.flags & FL_GODMODE)
return;
if (targ.invincible_finished >= time)
{
if (self.invincible_sound < time)
{
sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM);
self.invincible_sound = time + 2;
}
return;
}
// team play damage avoidance
//ZOID 12-13-96: self.team doesn't work in QW. Use keys
attackerteam = infokey(attacker, "team");
targteam = infokey(targ, "team");
if ((teamplay == 1) && (targteam == attackerteam) &&
(attacker.classname == "player") && (attackerteam != "") &&
inflictor.classname !="door")
return;
if ((teamplay == 3) && (targteam == attackerteam) &&
(attacker.classname == "player") && (attackerteam != "") &&
(targ != attacker)&& inflictor.classname !="door")
return;
take = damage;
// do the damage
//different sorts of armour simply subtract different ammounts
//this makes armor like the force armor good against many small rounds
@ -271,34 +782,84 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
switch(ToIID(targ.islot3))
{
case IID_ARM_DESERT:
take -= 1;
break;
case IID_ARM_SHIRT:
take -= 1;
break;
case IID_ARM_LEATHER:
take -= 2;
take -= 10;
break;
case IID_ARM_KEVLAR:
take -= 3;
break;
case IID_ARM_METAL:
take -= 4;
break;
case IID_ARM_COMBAT:
take -= 5;
break;
case IID_ARM_METAL:
take -= 25;
break;
case IID_ARM_COMBAT:
take -= 20;
break;
case IID_ARM_BROTHERHOOD:
take -= 6;
take -= 20;
break;
case IID_ARM_FORCE:
take -= 7;
take -= 30;
break;
case IID_ARM_LPOWER:
take -= 8;
take -= 25;
break;
default:
break;
}
switch(ToIID(targ.islot3))
{
case IID_ARM_SHIRT:
take = take * 0.70;
break;
case IID_ARM_LEATHER:
take = take * 0.60;
break;
case IID_ARM_KEVLAR:
take = take * 0.40;
break;
case IID_ARM_METAL:
take = take * 0.55;
break;
case IID_ARM_COMBAT:
take = take * 0.50;
break;
case IID_ARM_BROTHERHOOD:
take = take * 0.45;
break;
case IID_ARM_FORCE:
take = take * 0.80;
break;
case IID_ARM_LPOWER:
take = take * 0.40;
break;
default:
break;
}
if (targ.classname == "player" && targ.zoom > 0)
{
targ.maxspeed = targ.maxspeed * 0.20;
stuffcmd(targ, "v_idlescale 20\n");
}
else if (take > 20 && targ.classname == "player")
{
targ.maxspeed = targ.maxspeed * 0.20;
stuffcmd(targ, "v_cshift 100 0 0 100\n");
stuffcmd(targ, "v_idlescale 30\n");
}
else if (take > 0)
{
targ.maxspeed = targ.maxspeed * 0.30;
stuffcmd(targ, "v_cshift 100 0 0 50\n");
}
if (take <= 0)
{
@ -349,8 +910,8 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
============
X_Damage
The other damage function.
The purpose of X_Damage is to allow certain weapons to bypass armor
which is a very large part of the game.
============
*/
@ -365,50 +926,46 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage =
if (!targ.takedamage)
return;
damage = damage * 0.75;
damage = floor(damage);
// used by buttons and triggers to set activator for target firing
damage_attacker = attacker;
// check for quad damage powerup on the attacker
if (attacker.super_damage_finished > time && inflictor.classname != "door")
if (deathmatch == 4)
damage = damage * 8;
else
damage = damage * 4;
if (attacker.critical == 3)//attacker scored a headshot/critical
if (attacker.critical == 3 && targ.classname != "car")//attacker scored a headshot/critical
{
if (attacker.critical == 3)
{
severity = 0 + random()*20;
if (attacker.perk == 7)
if (attacker.class == 2)
severity = severity + 4;
if (attacker.class == 3)
severity = severity + 2;
if (severity >= 19)
damage = (damage * 3.0);
damage = (damage * 5);
else if (severity >= 14)
damage = (damage * 2.5);
damage = (damage * 4);
else
damage = (damage * 2.0);
damage = (damage * 3);
if (targ.classname == "monster")
attacker.score = attacker.score + 5;
helm = targ.armortype;
if (targ.helmet == 0)
{
sound (targ, CHAN_BODY, "player/headshot.wav", 1, ATTN_NORM);
sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM);
helm = 0;
}
if (targ.helmet == AS_STRAIGHT)
{
sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM);
helm = 0.10;
helm = 0.15;
}
if (targ.helmet == AS_SLIDING)
{
sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM);
helm = 0.15;
helm = 0.22;
}
damage = (damage - (damage * helm));
@ -417,8 +974,20 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage =
}
}
if (random()*4<=1)
if (damage <= 0)
{
damage = 0;
sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM);
return;
}
sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM);
// save damage based on the target's armor level
take = ceil(damage);
// add to the damage total for clients, which will be sent as a single
// message at the end of the frame
@ -459,7 +1028,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage =
// check for godmode or invincibility
if (targ.flags & FL_GODMODE)
return;
if (targ.invincible_finished >= time)
{
if (self.invincible_sound < time)
@ -494,19 +1062,63 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage =
switch(ToIID(targ.islot3))
{
case IID_ARM_BROTHERHOOD:
take -= 1;
case IID_ARM_METAL:
take -= 1;
break;
case IID_ARM_BROTHERHOOD:
take -= 1;
break;
case IID_ARM_FORCE:
take -= 3;
break;
case IID_ARM_LPOWER:
take -= 2;
break;
default:
break;
}
switch(ToIID(targ.islot3))
{
case IID_ARM_LEATHER:
take = take * 0.90;
break;
case IID_ARM_FORCE:
take -= 2;
case IID_ARM_KEVLAR:
take = take * 0.75;
break;
case IID_ARM_METAL:
take = take * 0.90;
break;
case IID_ARM_COMBAT:
take = take * 0.90;
break;
case IID_ARM_BROTHERHOOD:
take = take * 0.80;
break;
case IID_ARM_LPOWER:
take -= 3;
take = take * 0.75;
break;
default:
break;
}
if (targ.classname == "player" && targ.zoom > 0)
{
targ.maxspeed = targ.maxspeed * 0.33;
stuffcmd(targ, "v_idlescale 20\n");
}
else if (take > 20 && targ.classname == "player")
{
targ.maxspeed = targ.maxspeed * 0.25;
stuffcmd(targ, "v_cshift 100 0 0 100\n");
stuffcmd(targ, "v_idlescale 30\n");
}
else if (take > 0)
{
targ.maxspeed = targ.maxspeed * 0.50;
stuffcmd(targ, "v_cshift 100 0 0 50\n");
}
if (take <= 0)
{
@ -560,7 +1172,7 @@ T_RadiusDamage
*/
void(entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage =
{
local float points;
local float points, srange, brange;
local entity head;
local vector org;
@ -578,13 +1190,12 @@ void(entity inflictor, entity attacker, float damage, entity ignore, string dtyp
if (head.takedamage)
{
org = head.origin + (head.mins + head.maxs)*0.5;
points = 0.5*vlen (inflictor.origin - org);
points = vlen(inflictor.origin - org);
points = points + damage*0.50;
if (points < 0)
points = 0;
points = damage - points;
if (head == attacker)
points = points * 0.5;
if (points > 0)
{
if (CanDamage (head, inflictor))
@ -599,6 +1210,37 @@ void(entity inflictor, entity attacker, float damage, entity ignore, string dtyp
}
};
void (entity inflictor, entity attacker, float damage, entity ignore, float xrange) T_RadiusDamage2 =
{
local float points;
local entity head;
local vector org;
local float srange;
local float sub;
local float damaget;
head = findradius (inflictor.origin, xrange);
while (head)
{
if (head != ignore)
{
if (head.takedamage)
{
org = head.origin;
srange = vlen ((inflictor.origin - org));
points = (xrange / srange);
sub = (1 / points);
damaget = (damage - (damage * sub));
if (damaget > 0)
if (CanDamage (head, inflictor))
T_Damage (head, inflictor, attacker, damaget);
}
}
head = head.chain;
}
};
/*
============
T_BeamDamage

View file

@ -363,7 +363,7 @@ float TE_EXPLOSION = 3;
float TE_TAREXPLOSION = 4;
float TE_LIGHTNING1 = 5;
float TE_LIGHTNING2 = 6;
float TE_WIZSPIKE = 7;
float TE_WIZSPIKE = 7;
float TE_KNIGHTSPIKE = 8;
float TE_LIGHTNING3 = 9;
float TE_LAVASPLASH = 10;
@ -454,6 +454,16 @@ float MULTICAST_PVS_R = 5; // within sight, reliable
#define FL_FINDABLE_NONSOLID 16384 //a cpqwsv feature
// map objectives
float OBJ_NONE = 0; // no objective
float OBJ_HOSTAGE = 1; // rescue hostages
float OBJ_SUPPLY = 2; // capture supplies
float OBJ_SHADOW = 3; // pass without trace
float OBJ_DEADTOWN = 4; // overrun with zombies
float OBJ_DESTROY = 5; // destroy enemy fuel tanks
float OBJ_DEFUSE = 6; // defuse explosives
float OBJ_EXTERMINATE = 6; // destroy deathclaw nest
float OBJ_SHAMBLERHUNT = 7; // destroy shambler hive
//================================================
@ -478,18 +488,28 @@ float teamplay;
float timelimit;
float fraglimit;
float deathmatch;
string m_map;
float coop;
var float rj = 1;
float no_connect;
float round_end;
float red_kill;
float blue_kill;
float teamthatwon;
float team_blue;
float team_red;
float called_in;
float winningteam;
float t1alive;
float t2alive;
float t1dead;
float t2dead;
float bombed;
float zombies;
float hostages;
float musicplay;
float musictrack;
float supplies;
float commanders;
float rescue;
float dead_hostage;
float team1win;
float team2win;
@ -503,7 +523,17 @@ float max_zombies;
float gtimer;
float total_players;
float endgame_timer;
float time_left;
float s_map_obj;
float s_ent1;
float s_ent2;
float s_ent3;
float s_p1;
float s_p2;
float s_p3;
float challenge_rating;
//================================================
//
@ -575,7 +605,7 @@ float AS_MISSILE = 4;
.float rad_time;
.float fly_sound;
.float axhitme;
.float duck;
.float show_hostile; // set to time+0.2 whenever a client fires a
// weapon or takes damage. Used to alert
// monsters that otherwise would let the player go
@ -586,8 +616,8 @@ float AS_MISSILE = 4;
.string deathtype; // keeps track of how the player died
float POS_STAND = 0;
float POS_DUCK = 0;
float POS_PRONE = 0;
float POS_DUCK = 1;
float POS_PRONE = 2;
float blue_gadget;
float red_gadget;
@ -595,12 +625,19 @@ float blue_weapon;
float red_weapon;
float blue_armor;
float red_armor;
float intermission_running;
.float ghost;
.float ghostcnt;
.float dtime;
.float active;
.float class;
.float tclass;
.float xclass;
.float zone;
.float missionbrief;
.float silencer;
.float extender;
//.float vote1;
//.float vote2;
//.float vote3;
@ -616,6 +653,8 @@ float red_armor;
.float attack;
.float position;
.float recoil;
.float heat;
.float hold;
.float critical;
.float helmet;
.float rtime;
@ -626,6 +665,9 @@ float red_armor;
.float pcamera;
.float pcamera2;
.float equipment_slot;
.float has_radio;
.float score;
//.float select;
//.float grenade_hold;
.float grab;
@ -634,8 +676,14 @@ float red_armor;
.float weight;
.float max_weight;
.float hostage;
.float xregen;
.float sneak;
.float skill_combat;
.float skill_doctor;
.float skill_sneak;
.float skill_science;
.float rescued;
.float scale;
.float bandages;
@ -643,13 +691,14 @@ float red_armor;
.float cycle1;
.float cycle2;
//.float c4;
.float trait;
.float perk1;
.float perk2;
.float protect;
.float perk;
.float equipment;
.float buildtype;
//.float ctimer;
.float flash;
.float zoom;
.float oldteam;
.float dead;
.float grenadetoggle;
@ -659,6 +708,8 @@ float red_armor;
.float vote_on;
.float vote_type;
.float vote_num;
.float driftx;
.float drifty;
.float vote1;
.float vote2;
.float vote3;
@ -668,18 +719,57 @@ float red_armor;
.float vote7;
.float vote8;
.float spamdelay;
.float speedmulti;
.float picking;
.float inplace;
.float alert;
.float searchtime;
.float timer;
.float safezone;
.float pickup;
.float accept;
.float grenslot;
.float connected;
.string armornoise;
.string ammotype1;
.string ammotype2;
//.string deathsound;
.string currentmenu;
.entity wielded;
.float walk;
.float steadyaim;
.float lastman;
.float popup;
.float flare;
.entity friend;
.entity tumbler1;
.entity tumbler2;
.entity chest;
.entity view2;
.entity heal_ent;
.vector oldorg;
.vector home;
.float location;
.float start_time;
.float map_obj;//hostages, assassinate, rescue, defuse, supply crates
.float map_ent1;//map creature type 1
.float map_ent2;//map creature type 1
.float map_ent3;//map creature type 1
.float map_ent1_percent;//amount of creature type 1
.float map_ent2_percent;//amount of creature type 2
.float map_ent3_percent;//amount of creature type 3
.float skill_small_guns;
.float skill_big_guns;
.float skill_energy_weapons;
.float skill_melee;
.float skill_unarmed;
.float skill_thrown;
.entity tag_entity; // entity this is attached to (call setattachment to set this)
.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any)
//
// object stuff
//
@ -811,7 +901,7 @@ vector(entity e, float speed) aim = #44; // returns the shooting
float(string s) cvar = #45; // return cvar.value
void(string s) localcmd = #46; // put string into local que
entity(entity e) nextent = #47; // for looping through all ents
// #48 was removed
void particle(vector org, vector dir, float color, float count) = #48;
void() ChangeYaw = #49; // turn towards self.ideal_yaw
// at self.yaw_speed
// #50 was removed
@ -858,9 +948,23 @@ string(entity e, string key) infokey = #80; // get a key value (world = serv
float(string s) stof = #81; // convert string to float
void(vector where, float set) multicast = #82; // sends the temp message to a set
// of clients, possibly in PVS or PHS
vector(vector org) getlight = #92;
void particle2(vector origin, vector vmin, vector vmax, float color, float effect, float count) = #215;
void particle3(vector mins, vector maxsminusmins, float colour, float effect, float count) = #216;
void particle4(vector center, float radius, float colour, float effect, float count) = #217;
string(...) strcat = #115;
float(float stnum) getstati = #331; // (EXT_CSQC)
void(vector org) te_smallflash = #416;
void(vector org) te_gunshot = #418;
void(vector org) te_spike = #419;
void(vector org) te_superspike = #420;
void(vector org) te_tarexplosion = #421;
void(vector org) te_wizspike = #422;
void(vector org) te_knightspike = #423;
void(vector org) te_teleport = #424;
void(entity e, entity tagentity, string tagname) setattachment = #443;
//============================================================================

View file

@ -29,6 +29,8 @@ $frame death1 death2 death3 death4 death5 death6 death7 death8 death9
$frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8
$frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15
$frame ram1 ram2 ram3 ram4 ram5 ram6
//============================================================================
void(float side) Demon_Melee;
@ -149,6 +151,11 @@ void(entity attacker, float damage) demon1_pain =
if (self.pain_finished > time)
return;
if (self.health < (self.max_health*0.30))
self.skin = 2;
else if (self.health < (self.max_health*0.60))
self.skin = 1;
self.pain_finished = time + 10;
sound (self, CHAN_VOICE, "demon/dpain1.wav", 1, ATTN_NORM);
@ -158,33 +165,114 @@ void(entity attacker, float damage) demon1_pain =
demon1_pain1 ();
};
void() demon1_die1 =[ $death1, demon1_die2 ] {
sound (self, CHAN_VOICE, "demon/death1.wav", 1, ATTN_NORM);};
void() demon1_die1 =[ $death1, demon1_die2 ] {};
void() demon1_die2 =[ $death2, demon1_die3 ] {};
void() demon1_die3 =[ $death3, demon1_die4 ] {};
void() demon1_die3 =[ $death3, demon1_die4 ] {
self.rtime = 1;
setsize (self, '-24 -24 -24', '24 24 -8');
};
void() demon1_die4 =[ $death4, demon1_die5 ] {};
void() demon1_die5 =[ $death5, demon1_die6 ] {};
void() demon1_die6 =[ $death6, demon1_die7 ]
{self.solid = SOLID_NOT;};
void() demon1_die6 =[ $death6, demon1_die7 ] {};
void() demon1_die7 =[ $death7, demon1_die8 ] {};
void() demon1_die8 =[ $death8, demon1_die9 ] {};
void() demon1_die9 =[ $death9, demon1_die9 ] {};
void() demon_die =
void() demon1_splat1 =
{
// check for gib
if (self.health < -80)
self.rtime = 1;
setsize (self, '-24 -24 -24', '24 24 -8');
if (self.frame < 8)
self.frame = self.frame + 1;
self.think = demon1_splat1;
self.nextthink = time + 0.1;
if (self.frame == 8)
self.think = SUB_Null;
};
void () demon_pain =
{
local vector dir;
if (self.rtime > 0)
{
sound (self, CHAN_VOICE, "demon/death2.wav", 1, ATTN_NORM);
ThrowHead ("progs/h_demon.mdl", self.health);
ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib1.mdl", self.health);
self.health = 180;
return;
}
// regular death
demon1_die1 ();
dir = normalize(self.origin - self.enemy.origin);
self.velocity = dir * 120;
if (self.frame == 69)
{
self.health = 180;
self.frame = 42;
self.think = demon1_die1;
self.nextthink = time + 0.25;
}
else
{
self.health = 180;
ThrowGib ("progs/zom_gib.mdl", -40);
self.frame = 43;
self.think = demon1_die1;
self.nextthink = time + 0.25;
}
self.attack = self.attack + 1;
if (self.attack >= 8)
{
self.attack = 0;
self.health = 180;
ThrowGib ("progs/zom_gib.mdl", -40);
ThrowGib ("progs/zom_gib.mdl", -40);
ThrowGib ("progs/gib1.mdl", -40);
ThrowGib ("progs/h_demon.mdl", -40);
ThrowGib ("progs/zom_gib.mdl", -90);
ThrowGib ("progs/gib1.mdl", -90);
setmodel(self, "progs/x_demon.mdl");
sound (self, CHAN_VOICE, "player/gib1.wav", 1, ATTN_NORM);
self.think = demon1_splat1;
self.nextthink = time + 0.1;
}
};
void (vector stuff, vector ang) spawn_live_demon =
{
local entity demon;
demon = spawn ();
demon.origin = stuff;
demon.enemy = world;
demon.attack_finished = time + 10;
demon.solid = SOLID_SLIDEBOX;
demon.movetype = MOVETYPE_STEP;
demon.takedamage = DAMAGE_YES;
setmodel (demon, "progs/demon.mdl");
setsize (demon, '-20 -20 -24', '20 20 64');
demon.classname = "body";
demon.netname = "dead";
demon.health = 180;
demon.angles = ang;
demon.max_health = demon.health;
demon.th_pain = demon_pain;
demon.think = demon_pain;
demon.nextthink = time + 0.15;
};
void() demon_die =
{
self.solid = SOLID_NOT;
spawn_live_demon(self.origin, self.angles);
sound (self, CHAN_VOICE, "demon/death1.wav", 1, ATTN_NORM);
remove(self);
};
@ -195,8 +283,15 @@ void() Demon_MeleeAttack =
void() monster_demon1 =
{
if (self.zone == 0)
{
load_monster();
return;
}
precache_model ("progs/demon.mdl");
precache_model ("progs/h_demon.mdl");
precache_model ("progs/x_demon.mdl");
precache_sound ("demon/dhit2.wav");
precache_sound ("demon/djump.wav");
@ -215,7 +310,7 @@ void() monster_demon1 =
setmodel (self, "progs/demon.mdl");
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
self.health = 1200;
self.health = 600;
self.team = 3;
self.classname = "monster";
self.netname = "deathclaw";
@ -226,6 +321,7 @@ void() monster_demon1 =
self.th_melee = Demon_MeleeAttack; // one of two attacks
self.th_missile = demon1_jump1; // jump attack
self.th_pain = demon1_pain;
self.armornoise = "misc/thud.wav";
walkmonster_start();
};
@ -280,7 +376,7 @@ float() CheckDemonJump =
d = vlen(dist);
if (d < 100)
if (d < 200)
return FALSE;
if (d > 200)
@ -329,7 +425,7 @@ void(float side) Demon_Melee =
return;
sound (self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM);
ldmg = 10 + 5*random();
ldmg = 5 + 20*random();
T_Damage (self.enemy, self, self, ldmg);
makevectors (self.angles);
@ -348,13 +444,8 @@ void() Demon_JumpTouch =
{
if ( vlen(self.velocity) > 400 )
{
ldmg = 40 + 10*random();
ldmg = ldmg / 4;
ldmg = 20 + 20*random();
T_Damage (other, self, self, ldmg);
T_Damage (other, self, self, ldmg);
T_Damage (other, self, self, ldmg);
T_Damage (other, self, self, ldmg);
}
}

View file

@ -59,19 +59,22 @@ local float ldmg;
delta = self.enemy.origin - self.origin;
if (vlen(delta) > (100*self.scale))
if (vlen(delta) > (100))
return;
ldmg = 8+random()*8;
if (self.classname == "robofang")
ldmg = 4+random()*4;
ldmg = 5+random()*5;
T_Damage (self.enemy, self, self, ldmg);
T_Damage (self.enemy, self, self, ldmg);
if (random()*25 <= 5)
{
stuffcmd(self.enemy, "drop\n");
self.enemy.attack_finished = time + 1;
self.enemy.position = 2;
}
};
void() Dog_JumpTouch =
void() Dog_JumpTouch =
{
local float ldmg;
@ -164,6 +167,36 @@ void() Sniff =
local entity te;
local float x;
te = findradius (self.origin, 500);
if (te.classname == "player" && te.sneak > 0)
{
if (self.rtime < time)
{
sound (self, CHAN_VOICE, "dog/dsight.wav", 1, ATTN_NORM);
self.rtime = time + 5;
if (te.class == 2 && random()*100 > 99)
{
spawn_excla(te, 1);
te.sneak = 0;
sprint(te, 2, "detected!\n");
self.enemy = te;
FoundTarget();
}
else if (te.class != 2 && random()*100 > 80)
{
spawn_excla(te, 1);
te.sneak = 0;
sprint(te, 2, "detected!\n");
self.enemy = te;
FoundTarget();
}
}
return;
}
if (self.classname != "robofang")
return;
@ -192,23 +225,23 @@ void() dog_run1 =[ $run1 , dog_run2 ] {
if (random() < 0.2)
sound (self, CHAN_VOICE, "dog/idle.wav", 1, ATTN_IDLE);
ai_run(16);};
void() dog_run2 =[ $run2 , dog_run3 ] {ai_run(32);};
void() dog_run3 =[ $run3 , dog_run4 ] {ai_run(32);};
ai_run(20);};
void() dog_run2 =[ $run2 , dog_run3 ] {ai_run(20);};
void() dog_run3 =[ $run3 , dog_run4 ] {ai_run(20);};
void() dog_run4 =[ $run4 , dog_run5 ] {ai_run(20);};
void() dog_run5 =[ $run5 , dog_run6 ] {ai_run(64);};
void() dog_run5 =[ $run5 , dog_run6 ] {ai_run(20);};
void() dog_run6 =[ $run6 , dog_run7 ] {
if (self.enemy == self.owner)
self.enemy = self.enemy.enemy;
ai_run(32);};
void() dog_run7 =[ $run7 , dog_run8 ] {ai_run(16);};
void() dog_run8 =[ $run8 , dog_run9 ] {ai_run(32);};
void() dog_run9 =[ $run9 , dog_run10 ] {ai_run(32);};
void() dog_run7 =[ $run7 , dog_run8 ] {ai_run(20);};
void() dog_run8 =[ $run8 , dog_run9 ] {ai_run(20);};
void() dog_run9 =[ $run9 , dog_run10 ] {ai_run(20);};
void() dog_run10 =[ $run10 , dog_run11 ] {ai_run(20);};
void() dog_run11 =[ $run11 , dog_run12 ] {ai_run(64);};
void() dog_run12 =[ $run12 , dog_run1 ] {ai_run(32);};
void() dog_run11 =[ $run11 , dog_run12 ] {ai_run(20);};
void() dog_run12 =[ $run12 , dog_run1 ] {ai_run(20);};
void() dog_atta1 =[ $attack1, dog_atta2 ] {
@ -272,69 +305,76 @@ void() dog_pain =
{
sound (self, CHAN_VOICE, "dog/dpain1.wav", 1, ATTN_NORM);
if (random() > 0.5)
if (random() < 0.1)
dog_pain1 ();
else
else if (random() < 0.1)
dog_painb1 ();
};
void() dog_die1 =[ $death1, dog_die2 ] {};
void() dog_die2 =[ $death2, dog_die3 ] {};
void() dog_die3 =[ $death3, dog_die4 ] {};
void() dog_die3 =[ $death3, dog_die4 ] {
self.rtime = 1;
};
void() dog_die4 =[ $death4, dog_die5 ] {};
void() dog_die5 =[ $death5, dog_die6 ] {};
void() dog_die6 =[ $death6, dog_die7 ] {};
void() dog_die7 =[ $death7, dog_die8 ] {};
void() dog_die8 =[ $death8, dog_die9 ] {
self.solid = SOLID_NOT;
void() dog_die8 =[ $death8, dog_die9 ] {};
void() dog_die9 =[ $death9, dog_die9 ] {
setsize (self, '-10 -10 -24', '10 10 -16');
};
void() dog_die9 =[ $death9, dog_die9 ] {};
void() dog_dieb1 =[ $deathb1, dog_dieb2 ] {};
void() dog_dieb2 =[ $deathb2, dog_dieb3 ] {};
void() dog_dieb3 =[ $deathb3, dog_dieb4 ] {};
void() dog_dieb3 =[ $deathb3, dog_dieb4 ] {
self.rtime = 1;
};
void() dog_dieb4 =[ $deathb4, dog_dieb5 ] {};
void() dog_dieb5 =[ $deathb5, dog_dieb6 ] {};
void() dog_dieb6 =[ $deathb6, dog_dieb7 ] {};
void() dog_dieb7 =[ $deathb7, dog_dieb8 ] {};
void() dog_dieb8 =[ $deathb8, dog_dieb9 ] {
self.solid = SOLID_NOT;
setsize (self, '-10 -10 -24', '10 10 -16');
};
void() dog_dieb9 =[ $deathb9, dog_dieb9 ] {};
void () woof_pain =
{
if (self.rtime > 0)
{
self.health = 180;
return;
}
if (self.frame == 26)
{
self.frame = 27;
self.health = 180;
self.frame = 27;
self.think = dog_die1;
self.nextthink = time + 0.12;
}
else
{
self.health = 180;
ThrowGib2 ("progs/zom_gib.mdl", -35);
self.frame = 26;
self.health = 180;
self.think = dog_dieb1;
self.think = dog_die1;
self.nextthink = time + 0.12;
}
self.attack = self.attack + 1;
if (self.attack >= 4)
if (self.attack == 8)
{
if (random()*4 <= 2)
sound (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM);
else
sound (self, CHAN_VOICE, "dog/death2.wav", 1, ATTN_NORM);
ThrowHead ("progs/h_dog.mdl", -30);
ThrowGib ("progs/gib1.mdl", -30);
ThrowGib ("progs/gib2.mdl", -30);
ThrowGib ("progs/gib3.mdl", -30);
ThrowGib2 ("progs/zom_gib.mdl", -45);
ThrowGib2 ("progs/zom_gib.mdl", -45);
sound (self, CHAN_VOICE, "dog/death2.wav", 1, ATTN_NORM);
self.think = dog_dieb1;
self.nextthink = time + 0.01;
}
if (self.attack >= 16)
{
self.think = dog_dieb1;
self.nextthink = time + 0.01;
}
};
@ -350,13 +390,14 @@ void (vector stuff) spawn_live_dog =
dog.movetype = MOVETYPE_STEP;
dog.takedamage = DAMAGE_YES;
setmodel (dog, "progs/dog.mdl");
setsize (dog, VEC_HULL_MIN, '16 16 40');
setsize (dog, '-10 -10 -24', '10 10 12');
dog.classname = "body";
dog.netname = "dead";
dog.health = 180;
dog.max_health = dog.health;
dog.th_pain = woof_pain;
dog.think = woof_pain;
dog.th_die = corpse_gib;
dog.nextthink = time + 0.05;
};
@ -365,19 +406,10 @@ void () dog_die =
if (self.enemy.classname == "player")
self.enemy.frags = self.enemy.frags + 1;
if (self.health < -35)
{
self.solid = SOLID_NOT;
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
dog_die1 ();
}
else
{
sound (self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM);
self.solid = SOLID_NOT;
spawn_live_dog(self.origin);
remove(self);
}
sound (self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM);
spawn_live_dog(self.origin);
remove(self);
};
//============================================================================
@ -453,8 +485,81 @@ float() DogCheckAttack =
//===========================================================================
void (vector jojo) spawn_radbeast =
{
local entity dog;
local entity te;
dog = spawn ();
self = dog;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/dog.mdl");
setsize (self, '-10 -10 -24', '10 10 12');
self.health = 90;
self.takedamage = DAMAGE_YES;
self.netname = "rad-beast";
self.th_stand = dog_stand1;
self.th_walk = dog_walk1;
self.th_run = dog_run1;
self.th_pain = dog_pain;
self.th_die = dog_die;
self.th_melee = dog_atta1;
self.angles_y = random()*360;
self.origin = jojo + '0 64 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = jojo + '0 -64 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = jojo + '64 0 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = jojo + '-64 0 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
remove(self);
return;
}
}
}
}
te = findradius (self.origin, 30);
while (te)
{
if (te.classname == "player" || te.classname == "monster" && te.health > 0)
{
remove(self);
return;
}
te = te.chain;
}
self.classname = "monster";
walkmonster_start_go ();
};
void() monster_dog =
{
if (self.zone == 0)
{
load_monster();
return;
}
precache_model ("progs/h_dog.mdl");
precache_model ("progs/dog.mdl");
@ -470,68 +575,27 @@ void() monster_dog =
setmodel (self, "progs/dog.mdl");
setsize (self, '-24 -24 -24', '24 24 24');
self.health = 75;
self.scale = 1;
self.team = 3;
setsize (self, '-10 -10 -24', '10 10 12');
self.health = 90;
self.takedamage = DAMAGE_YES;
self.classname = "monster";
self.netname = "radwolf";
self.netname = "rad-beast";
self.th_stand = dog_stand1;
self.th_walk = dog_walk1;
self.th_run = dog_run1;
self.th_pain = dog_pain;
self.th_die = dog_die;
self.th_melee = dog_atta1;
self.angles_y = random()*360;
// if (random()<0.75)
// spawn_radbeast(self.origin);
if (random()<0.25 && world.map_obj == OBJ_HOSTAGE)
spawn_civilian(self.origin);
walkmonster_start();
};
void (vector org) spawn_dog =
{
local entity dog, oself;
local entity te;
makevectors (self.v_angle);
org = ((org + (v_forward * 96)) + (v_up * 72));
self.impulse = 0;
te = findradius (org, 80);
while (te)
{
if (te.classname == "player" && te.health > 0)
return;
te = te.chain;
}
dog = spawn();
oself = self;
self = dog;
self.scale = 1;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/dog.mdl");
setorigin(self, org);
setsize (self, '-24 -24 -24', '24 24 24');
self.health = 150;
self.helmet = 1;
self.armortype = 0.3;
self.takedamage = DAMAGE_YES;
self.classname = "robofang";
self.netname = "robofang";
self.th_stand = dog_stand1;
self.th_walk = dog_walk1;
self.th_run = dog_run1;
self.th_pain = dog_pain;
self.th_die = station_die;
self.th_melee = dog_atta1;
self.think = self.th_walk;
self.owner = oself;
self.track = oself;
self.nextthink = time + 0.1;
walkmonster_start();
self = oself;
};

View file

@ -165,21 +165,23 @@ void () OpenDoorBeep =
if (r != RANGE_MELEE)
{
self.think = OpenDoorBeep;
self.nextthink = time + 0.5;
self.owner.owner.rtime = 0;
remove(self);
return;
}
if (random()*3<1)
sound (self, CHAN_BODY, "misc/build1.wav", 1, ATTN_NORM);
else if (random()*3<2)
sound (self, CHAN_BODY, "misc/build2.wav", 1, ATTN_NORM);
if (random()*3<1.5)
sound (self, CHAN_BODY, "items/lockpick1.wav", 1, ATTN_NORM);
else
sound (self, CHAN_BODY, "misc/build3.wav", 1, ATTN_NORM);
sound (self, CHAN_BODY, "items/lockpick2.wav", 1, ATTN_NORM);
self.think = OpenDoorBeep;
self.nextthink = time + 0.5;
self.owner.owner.rtime = self.owner.owner.rtime + 1;
if (ToIID(other.islot4) == IID_EQUIP_TOOLKIT)
self.owner.owner.rtime = self.owner.owner.rtime + 3;
else
self.owner.owner.rtime = self.owner.owner.rtime + 1;
self.frame = floor ((self.owner.owner.rtime / 12) * 7);
if (self.owner.owner.rtime >= 12)
@ -239,12 +241,48 @@ void () door_touch =
{
if (self.size_y <= 128 && self.size_x <= 128)
{
if (other.class == 2 || other.class == 4) //assassins as well as scientists
{ //can open doors for more freedom
if (other.perk1 == 4 || other.perk2 == 4)
{
self.owner.rtime = 12;
sound (other, CHAN_VOICE, "player/berserk.wav", 1, ATTN_NORM);
door_use ();
loud_noise(200);
}
else if (self.owner.items == IT_KEY1)
{
SpawnOpenDoor(self, other);
return;
}
else if (self.owner.items == IT_KEY2)
{
if (other.class == 1)
{
sprint(other, 2, "the lock on this door is too complex for you.\n");
sound (other, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM);
return;
}
if (other.class == 2)
{
sprint(other, 2, "picking...\n");
other.attack_finished = time + 7;
other.rtime = time + 7.5;
SpawnOpenDoor(self, other);
return;
}
if (other.class == 3)
{
sprint(other, 2, "the lock on this door is too complex for you.\n");
sound (other, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM);
return;
}
if (other.class == 4)
{
sprint(other, 2, "picking...\n");
SpawnOpenDoor(self, other);
return;
}
}
if (self.owner.items == IT_KEY1)
sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
@ -483,23 +521,11 @@ void () func_door =
self.blocked = door_blocked;
self.use = door_use;
if (coop == 0)
{
if ((self.spawnflags & DOOR_SILVER_KEY))
self.items = IT_KEY1;
if ((self.spawnflags & DOOR_GOLD_KEY))
self.items = IT_KEY2;
}
if (coop == 1)
{
r = random()*10;
if (r <= 7)
self.items = IT_KEY1;
else
self.items = IT_KEY2;
}
if (random()<0.20)
self.items = IT_KEY1; //easy-to-pick lock
else if (random()<0.60)
self.items = IT_KEY2; //hard-to-pick lock
if (!self.speed)
{
self.speed = 100;

View file

@ -43,6 +43,7 @@ $frame paind17 paind18 paind19
void () enforcer_assault_rifle;
void () enf_reload1;
void () Footstep;
void() enforcer_fire =
{
@ -69,12 +70,37 @@ void (float tmp, float dam) enforcer_single =
{
sound (self, CHAN_WEAPON, "weapons/reload.wav", PLAT_LOW_TRIGGER, ATTN_NORM);
enf_reload1();
self.mag1 = self.maxmag1;
self.mag1 = 30;
return;
}
self.mag1 = self.mag1 - 1;
if (self.weapon == 3)
sound (self, CHAN_WEAPON, "weapons/smg_s.wav", 1, ATTN_NORM);
else if (self.weapon == 4)
sound (self, CHAN_WEAPON, "weapons/ak112.wav", 1, ATTN_NORM);
else if (self.weapon == 5)
sound (self, CHAN_WEAPON, "ogre/ak47.wav", 1, ATTN_NORM);
else if (self.weapon == 6 && random()<0.5)
sound (self, CHAN_WEAPON, "weapons/moonlight-1.wav", 1, ATTN_NORM);
else if (self.weapon == 6)
sound (self, CHAN_WEAPON, "weapons/moonlight-2.wav", 1, ATTN_NORM);
if (self.weapon == 3)
dam = 12;
else if (self.weapon == 4)
dam = 16;
else if (self.weapon == 5)
dam = 18;
else if (self.weapon == 6)
dam = 16;
self.attack = self.attack + 1;
if (self.attack > 5)
self.attack = 0;
makevectors (self.angles);
src = self.origin + v_forward*10;
@ -87,7 +113,7 @@ void (float tmp, float dam) enforcer_single =
direction = dir;
traceline (src, src + direction*4000 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self);
traceline (src, src + direction*4000 + v_right*crandom()*tmp*2 + v_up*crandom()*tmp*2, FALSE, self);
if (trace_fraction == PLAT_LOW_TRIGGER)
return;
@ -95,19 +121,13 @@ void (float tmp, float dam) enforcer_single =
if (trace_ent.takedamage)
{
SpawnBlood (org, PLAT_LOW_TRIGGER);
dam = dam + random()*dam;
dam = dam + random()*dam - 3;
dam = dam * (1 - (trace_fraction));
T_Damage (trace_ent, self, self, dam);
}
else
{
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_SPIKE);
WriteCoord (MSG_MULTICAST, trace_endpos_x);
WriteCoord (MSG_MULTICAST, trace_endpos_y);
WriteCoord (MSG_MULTICAST, trace_endpos_z);
multicast (trace_endpos, MULTICAST_PVS);
}
bullet_hole (trace_endpos);
};
//============================================================================
@ -126,7 +146,9 @@ if (random() < 0.2)
ai_walk(2);};
void() enf_walk2 =[ $walk2 , enf_walk3 ] {ai_walk(4);};
void() enf_walk3 =[ $walk3 , enf_walk4 ] {ai_walk(4);};
void() enf_walk4 =[ $walk4 , enf_walk5 ] {ai_walk(3);};
void() enf_walk4 =[ $walk4 , enf_walk5 ] {ai_walk(3);
Footstep();
};
void() enf_walk5 =[ $walk5 , enf_walk6 ] {ai_walk(1);};
void() enf_walk6 =[ $walk6 , enf_walk7 ] {ai_walk(2);};
void() enf_walk7 =[ $walk7 , enf_walk8 ] {ai_walk(2);};
@ -134,17 +156,23 @@ void() enf_walk8 =[ $walk8 , enf_walk9 ] {ai_walk(1);};
void() enf_walk9 =[ $walk9 , enf_walk10 ] {ai_walk(2);};
void() enf_walk10 =[ $walk10, enf_walk11 ] {ai_walk(4);};
void() enf_walk11 =[ $walk11, enf_walk12 ] {ai_walk(4);};
void() enf_walk12 =[ $walk12, enf_walk13 ] {ai_walk(1);};
void() enf_walk12 =[ $walk12, enf_walk13 ] {ai_walk(1);
Footstep();
};
void() enf_walk13 =[ $walk13, enf_walk14 ] {ai_walk(2);};
void() enf_walk14 =[ $walk14, enf_walk15 ] {ai_walk(3);};
void() enf_walk15 =[ $walk15, enf_walk16 ] {ai_walk(4);};
void() enf_walk16 =[ $walk16, enf_walk1 ] {ai_walk(2);};
void() enf_run1 =[ $run1 , enf_run2 ] {ai_run(18);};
void() enf_run2 =[ $run2 , enf_run3 ] {ai_run(14);};
void() enf_run2 =[ $run2 , enf_run3 ] {ai_run(14);
Footstep();
};
void() enf_run3 =[ $run3 , enf_run4 ] {ai_run(7);};
void() enf_run4 =[ $run4 , enf_run5 ] {ai_run(12);};
void() enf_run5 =[ $run5 , enf_run6 ] {ai_run(14);};
void() enf_run5 =[ $run5 , enf_run6 ] {ai_run(14);
Footstep();
};
void() enf_run6 =[ $run6 , enf_run7 ] {ai_run(14);};
void() enf_run7 =[ $run7 , enf_run8 ] {ai_run(7);};
void() enf_run8 =[ $run8 , enf_run1 ] {ai_run(11);};
@ -161,17 +189,19 @@ void() enf_atk8 =[ $attack3, enf_atk9 ] {ai_face();};
void() enf_atk9 =[ $attack2, enf_atk10 ] {ai_face();};
void() enf_atk10 =[ $attack1, enf_run1 ] {ai_face();};
void() enf_burst1 =[ $attack5, enf_burst2 ] {enforcer_single(400, 16);};
void() enf_burst2 =[ $attack6, enf_burst3 ] {enforcer_single(400, 16);ai_face();};
void() enf_burst3 =[ $attack5, enf_burst4 ] {enforcer_single(400, 16);};
void() enf_burst4 =[ $attack6, enf_burst5 ] {enforcer_single(450, 16);ai_face();};
void() enf_burst5 =[ $attack5, enf_burst6 ] {enforcer_single(450, 16);};
void() enf_burst6 =[ $attack6, enf_burst7 ] {enforcer_single(500, 16);ai_face();};
void() enf_burst7 =[ $attack5, enf_burst8 ] {enforcer_single(550, 16);};
void() enf_burst8 =[ $attack4, enf_burst9 ] {enforcer_single(600, 16);ai_face();};
void() enf_burst1 =[ $attack5, enf_burst2 ] {enforcer_single(500, 13);};
void() enf_burst2 =[ $attack6, enf_burst3 ] {enforcer_single(500, 13);ai_face();};
void() enf_burst3 =[ $attack5, enf_burst4 ] {enforcer_single(50, 13);};
void() enf_burst4 =[ $attack6, enf_burst5 ] {enforcer_single(550, 13);ai_face();};
void() enf_burst5 =[ $attack5, enf_burst6 ] {enforcer_single(550, 13);};
void() enf_burst6 =[ $attack6, enf_burst7 ] {enforcer_single(500, 13);ai_face();};
void() enf_burst7 =[ $attack5, enf_burst8 ] {enforcer_single(550, 13);};
void() enf_burst8 =[ $attack4, enf_burst9 ] {enforcer_single(700, 13);ai_face();};
void() enf_burst9 =[ $attack3, enf_burst10 ] {ai_face();};
void() enf_burst10 =[ $attack2, enf_run1 ] {ai_face();};
void() enf_burst1a =[ $attack5, enf_burst2a ] {enforcer_single(300, 17);};
void() enf_burst2a =[ $attack6, enf_burst1a ] {enforcer_single(300, 17);};
void() enf_reload1 =[ $attack10, enf_reload2 ] {};
@ -266,26 +296,25 @@ void(entity attacker, float damage) enf_pain =
void() enf_die1 =[ $death1, enf_die2 ] {};
void() enf_die2 =[ $death2, enf_die3 ] {};
void() enf_die3 =[ $death3, enf_die4 ]
{self.solid = SOLID_NOT;self.ammo_cells = 5;DropBackpack();};
void() enf_die3 =[ $death3, enf_die4 ] {};
void() enf_die4 =[ $death4, enf_die5 ] {ai_forward(14);};
void() enf_die5 =[ $death5, enf_die6 ] {ai_forward(2);};
void() enf_die5 =[ $death5, enf_die6 ] {ai_forward(6);};
void() enf_die6 =[ $death6, enf_die7 ] {};
void() enf_die7 =[ $death7, enf_die8 ] {};
void() enf_die8 =[ $death8, enf_die9 ] {};
void() enf_die9 =[ $death9, enf_die10 ] {ai_forward(3);};
void() enf_die10 =[ $death10, enf_die11 ] {ai_forward(5);};
void() enf_die11 =[ $death11, enf_die12 ] {ai_forward(5);};
void() enf_die12 =[ $death12, enf_die13 ] {ai_forward(5);};
void() enf_die9 =[ $death9, enf_die10 ] {ai_forward(6);};
void() enf_die10 =[ $death10, enf_die11 ] {ai_forward(6);};
void() enf_die11 =[ $death11, enf_die12 ] {ai_forward(6);};
void() enf_die12 =[ $death12, enf_die13 ] {ai_forward(6);};
void() enf_die13 =[ $death13, enf_die14 ] {};
void() enf_die14 =[ $death14, enf_die14 ] {};
void() enf_fdie1 =[ $fdeath1, enf_fdie2 ] {
void() enf_die14 =[ $death14, enf_die14 ] {
setsize (self, '-12 -12 -24', '12 12 -16');
self.rtime = 1;
};
void() enf_fdie1 =[ $fdeath1, enf_fdie2 ] {};
void() enf_fdie2 =[ $fdeath2, enf_fdie3 ] {};
void() enf_fdie3 =[ $fdeath3, enf_fdie4 ]
{self.solid = SOLID_NOT;self.ammo_cells = 5;DropBackpack();};
void() enf_fdie3 =[ $fdeath3, enf_fdie4 ] {};
void() enf_fdie4 =[ $fdeath4, enf_fdie5 ] {};
void() enf_fdie5 =[ $fdeath5, enf_fdie6 ] {};
void() enf_fdie6 =[ $fdeath6, enf_fdie7 ] {};
@ -293,56 +322,133 @@ void() enf_fdie7 =[ $fdeath7, enf_fdie8 ] {};
void() enf_fdie8 =[ $fdeath8, enf_fdie9 ] {};
void() enf_fdie9 =[ $fdeath9, enf_fdie10 ] {};
void() enf_fdie10 =[ $fdeath10, enf_fdie11 ] {};
void() enf_fdie11 =[ $fdeath11, enf_fdie11 ] {};
void() enf_fdie11 =[ $fdeath11, enf_fdie11 ] {
setsize (self, '-12 -12 -24', '12 12 -16');
self.rtime = 1;
};
void() enf_die =
void () enforcer_pain =
{
// check for gib
if (self.health < -35)
local vector dir;
if (self.rtime > 0)
{
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
if (random() > 0.5)
enf_die1 ();
else
enf_fdie1 ();
self.health = 240;
return;
}
// regular death
sound (self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM);
if (random() > 0.5)
enf_die1 ();
dir = normalize(self.origin - self.enemy.origin);
self.velocity = dir * 80;
if (self.frame == 47)
{
self.frame = 48;
self.think = enf_die1;
self.nextthink = time + 0.2;
}
else
enf_fdie1 ();
{
ThrowGib ("progs/zom_gib.mdl", -40);
self.frame = 47;
self.think = enf_fdie1;
self.nextthink = time + 0.2;
}
self.attack = self.attack + 1;
if (self.attack == 8)
{
if (random()*4 <= 2)
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
else
sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NORM);
}
if (self.attack >= 16)
{
self.solid = SOLID_NOT;
enf_die1();
ThrowGib ("progs/zom_gib.mdl", -35);
ThrowGib ("progs/zom_gib.mdl", -35);
ThrowGib ("progs/gib1.mdl", -35);
}
};
void (vector stuff, vector ang) spawn_live_enforcer =
{
local entity grunt;
grunt = spawn ();
grunt.origin = stuff;
grunt.enemy = self.enemy;
grunt.attack_finished = time + 10;
grunt.solid = SOLID_SLIDEBOX;
grunt.movetype = MOVETYPE_STEP;
grunt.takedamage = DAMAGE_YES;
setmodel (grunt, "progs/enforcer.mdl");
setsize (grunt, '-12 -12 -24', '12 12 32');
grunt.classname = "body";
grunt.netname = "dead";
grunt.health = 240;
grunt.angles = ang;
grunt.max_health = grunt.health;
grunt.th_pain = enforcer_pain;
grunt.think = enforcer_pain;
grunt.th_die = corpse_gib;
grunt.nextthink = time + 0.05;
};
void() enf_die =
{
if (random()<0.75)
DropMoney();
if (random()<0.50)
DropMoney();
if (random()<0.25)
DropMoney();
if (self.weapon == 3)
{
DropFromChest(self, IID_WP_MP7_S, self.mag1);
DropFromChest(self, IID_AM_5MMHIGHVEL, 30+random()*30);
}
else if (self.weapon == 4)
{
DropFromChest(self, IID_WP_AK112, self.mag1);
DropFromChest(self, IID_AM_5MMHIGHVEL, 24+random()*24);
}
else if (self.weapon == 5)
{
DropFromChest(self, IID_WP_AK74, self.mag1);
DropFromChest(self, IID_AM_WARSAW, 30+random()*30);
}
else if (self.weapon == 6)
{
DropFromChest(self, IID_WP_MOONLIGHT, self.mag1);
DropFromChest(self, IID_AM_556MM, 30+random()*30);
}
self.solid = SOLID_NOT;
spawn_live_enforcer(self.origin, self.angles);
remove(self);
};
void () enforcer_assault_rifle =
{
local float r;
r = range (self.enemy);
if (r == RANGE_FAR || r == RANGE_MID)//single shot at range
{
if (self.weapon == 5)
sound (self, CHAN_WEAPON, "weapons/ak112.wav", PLAT_LOW_TRIGGER, ATTN_NORM);
if (self.weapon == 6)
sound (self, CHAN_WEAPON, "weapons/ak47.wav", PLAT_LOW_TRIGGER, ATTN_NORM);
enforcer_single(200, 18);
}
if (r == RANGE_NEAR || r == RANGE_MELEE)//open up when close
{
if (self.weapon == 5)
sound (self, CHAN_WEAPON, "weapons/auto.wav", PLAT_LOW_TRIGGER, ATTN_NORM);
if (self.weapon == 6)
sound (self, CHAN_WEAPON, "weapons/auto2.wav", PLAT_LOW_TRIGGER, ATTN_NORM);
enf_burst1();
}
enf_burst1a();
};
void() monster_enforcer =
{
if (self.zone == 0)
{
load_monster();
return;
}
precache_model2 ("progs/enforcer.mdl");
precache_model2 ("progs/h_mega.mdl");
precache_model2 ("progs/laser.mdl");
@ -378,7 +484,18 @@ void() monster_enforcer =
self.th_die = enf_die;
self.th_missile = enf_atk1;
self.weapon = 6;
if (random()<0.9)
self.weapon = 5;
else if (random()<0.1)
self.weapon = 3;
else if (random()<0.1)
self.weapon = 4;
else if (random()<0.1)
self.weapon = 6;
else
self.weapon = 5;
self.th_missile = enf_atk1;
self.mag1 = 24;
self.maxmag1 = self.mag1;

View file

@ -15,6 +15,7 @@ float() DemonCheckAttack;
float(float v) anglemod;
void(vector dest) ChooseTurn;
void(entity targ, entity inflictor, entity attacker, float damage) X_Damage;
void() ai_face;
@ -60,9 +61,9 @@ float() CheckAttack =
traceline (spot1, spot2, FALSE, self);
if (trace_ent != targ)
return FALSE; // don't have a clear shot
//if (trace_ent != targ)
// return FALSE; // don't have a clear shot
if (trace_inopen && trace_inwater)
return FALSE; // sight line crossed contents
@ -85,9 +86,6 @@ float() CheckAttack =
if (time < self.attack_finished)
return FALSE;
if (enemy_range == RANGE_FAR)
return FALSE;
if (enemy_range == RANGE_MELEE)
{
chance = 0.9;
@ -132,6 +130,12 @@ void() ai_face =
{
self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
ChangeYaw ();
if (self.enemy.sneak > 0)//invisible, estimate position
{
self.angles_y += random()*50;
self.angles_y -= random()*50;
}
};
/*
@ -172,7 +176,9 @@ void() ai_charge_side =
/*
=============
ai_melee
Monster melee weapons will have armor-piercing properties
to make them feared, with the exception of the dogs, which
will have great damage that does not go through armor.
=============
*/
void() ai_melee =
@ -194,7 +200,7 @@ void() ai_melee =
void() ai_melee_side =
{
{
local vector delta;
local float ldmg;

View file

@ -58,18 +58,18 @@ void() f_walk16 =[ $swim16, f_walk17 ] {ai_walk(8);};
void() f_walk17 =[ $swim17, f_walk18 ] {ai_walk(8);};
void() f_walk18 =[ $swim18, f_walk1 ] {ai_walk(8);};
void() f_run1 =[ $swim1, f_run2 ] {ai_run(12);
void() f_run1 =[ $swim1, f_run2 ] {ai_run(24);
if (random() < 0.5)
sound (self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_NORM);
};
void() f_run2 =[ $swim3, f_run3 ] {ai_run(12);};
void() f_run3 =[ $swim5, f_run4 ] {ai_run(12);};
void() f_run4 =[ $swim7, f_run5 ] {ai_run(12);};
void() f_run5 =[ $swim9, f_run6 ] {ai_run(12);};
void() f_run6 =[ $swim11, f_run7 ] {ai_run(12);};
void() f_run7 =[ $swim13, f_run8 ] {ai_run(12);};
void() f_run8 =[ $swim15, f_run9 ] {ai_run(12);};
void() f_run9 =[ $swim17, f_run1 ] {ai_run(12);};
void() f_run2 =[ $swim3, f_run3 ] {ai_run(24);};
void() f_run3 =[ $swim5, f_run4 ] {ai_run(24);};
void() f_run4 =[ $swim7, f_run5 ] {ai_run(24);};
void() f_run5 =[ $swim9, f_run6 ] {ai_run(24);};
void() f_run6 =[ $swim11, f_run7 ] {ai_run(24);};
void() f_run7 =[ $swim13, f_run8 ] {ai_run(24);};
void() f_run8 =[ $swim15, f_run9 ] {ai_run(24);};
void() f_run9 =[ $swim17, f_run1 ] {ai_run(24);};
void() fish_melee =
{
@ -165,9 +165,8 @@ void() monster_fish =
setsize (self, '-16 -16 -24', '16 16 24');
self.health = 50;
self.helmet = 1;
self.corporation = 3;
self.classname = "monster";
self.netname = "pirannah";
self.netname = "death remora";
self.th_stand = f_stand1;
self.th_walk = f_walk1;

View file

@ -396,7 +396,11 @@ void() hknight_melee =
void() monster_hell_knight =
{
if (self.zone == 0)
{
load_monster();
return;
}
precache_model2 ("progs/hknight.mdl");
precache_model2 ("progs/k_spike.mdl");
precache_model2 ("progs/h_hellkn.mdl");
@ -420,13 +424,12 @@ void() monster_hell_knight =
setmodel (self, "progs/hknight.mdl");
setsize (self, '-16 -16 -24', '16 16 40');
self.health = 125;
self.islot3 = 10; //hell-knight armor
self.armortype = 0.30;
self.health = 200;
self.islot3 = SlotVal(IID_ARM_FORCE, 1);
self.helmet = 1;
self.team = 3;
self.classname = "monster";
self.netname = "reaver";
self.netname = "reaver overlord";
self.th_stand = hknight_stand1;
self.th_walk = hknight_walk1;
self.th_run = hknight_run1;

View file

@ -197,7 +197,6 @@ void (float xx) hos_forward =
rng = range (te);
if (((rng <= RANGE_NEAR) && (self.rescued == MULTICAST_ALL)))
{
sound (self, CHAN_BODY, "misc/rescued.wav", PLAT_LOW_TRIGGER, ATTN_NONE);
te = find (world, classname, "hostage");
while (te)
{
@ -217,3 +216,87 @@ void (float xx) hos_forward =
}
self.oldorg = self.origin;
};
void (vector jojo) spawn_civilian =
{
local entity civ, te, oself;
local entity x;
local float stop;
x = findradius (jojo, 300);
while (x)
{
if (x.classname == "trigger_teleport")
stop = 1;
x = x.chain;
}
if (stop == 1)
{
remove(self);
return;
}
civ = spawn ();
oself = self;
self = civ;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
self.takedamage = DAMAGE_AIM;
setmodel (self, "progs/hosfem.mdl");
setsize (self, VEC_HULL_MIN, '16 16 32');
self.health = 80;
self.netname = "civilian";
self.classname = "rhostage";
self.max_health = self.health;
hos_stand1 ();
self.th_die = hostage_die;
self.th_pain = hostage_pain;
self.rescued = 0;
self.angles_y = random()*360;
self.origin = jojo + '0 64 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = jojo + '0 -64 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = jojo + '64 0 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = jojo + '-64 0 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
remove(self);
return;
}
}
}
}
te = findradius (self.origin, 30);
while (te)
{
if (te.classname == "player" || te.classname == "monster" && te.health > 0)
{
remove(self);
return;
}
te = te.chain;
}
self = oself;
};

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -45,6 +45,18 @@ $frame death9 death10
$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8
$frame deathb9 deathb10 deathb11
void() go_invisible =
{
setmodel (self, "");
sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM);
};
void() go_visible =
{
setmodel (self, "progs/knight.mdl");
sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM);
};
void() knight_stand1 =[ $stand1, knight_stand2 ] {ai_stand();};
void() knight_stand2 =[ $stand2, knight_stand3 ] {ai_stand();};
void() knight_stand3 =[ $stand3, knight_stand4 ] {ai_stand();};
@ -75,16 +87,18 @@ void() knight_walk14 =[ $walk14, knight_walk1 ] {ai_walk(3);};
void() knight_run1 =[ $runb1, knight_run2 ] {
if (random() < 0.2)
if ((random() < 0.6) && self.model != "")
go_invisible();
else if (random() < 0.2)
sound (self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE);
ai_run(16);};
void() knight_run2 =[ $runb2, knight_run3 ] {ai_run(20);};
void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(13);};
void() knight_run4 =[ $runb4, knight_run5 ] {ai_run(7);};
void() knight_run5 =[ $runb5, knight_run6 ] {ai_run(16);};
void() knight_run6 =[ $runb6, knight_run7 ] {ai_run(20);};
void() knight_run7 =[ $runb7, knight_run8 ] {ai_run(14);};
void() knight_run8 =[ $runb8, knight_run1 ] {ai_run(6);};
ai_run(21);};
void() knight_run2 =[ $runb2, knight_run3 ] {ai_run(25);};
void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(18);};
void() knight_run4 =[ $runb4, knight_run5 ] {ai_run(12);};
void() knight_run5 =[ $runb5, knight_run6 ] {ai_run(21);};
void() knight_run6 =[ $runb6, knight_run7 ] {ai_run(25);};
void() knight_run7 =[ $runb7, knight_run8 ] {ai_run(19);};
void() knight_run8 =[ $runb8, knight_run1 ] {ai_run(11);};
void() knight_runatk1 =[ $runattack1, knight_runatk2 ]
@ -94,6 +108,7 @@ if (random() > 0.5)
else
sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM);
ai_charge(20);
go_visible();
};
void() knight_runatk2 =[ $runattack2, knight_runatk3 ] {ai_charge_side();};
void() knight_runatk3 =[ $runattack3, knight_runatk4 ] {ai_charge_side();};
@ -108,23 +123,71 @@ void() knight_runatk11 =[ $runattack11, knight_run1 ] {ai_charge(10);};
void() knight_atk1 =[ $attackb1, knight_atk2 ]
{
if (self.takedamage == DAMAGE_NO)
{
remove(self);
return;
}
sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM);
ai_charge(0);};
void() knight_atk2 =[ $attackb2, knight_atk3 ] {ai_charge(7);};
void() knight_atk3 =[ $attackb3, knight_atk4 ] {ai_charge(4);};
void() knight_atk4 =[ $attackb4, knight_atk5 ] {ai_charge(0);};
void() knight_atk5 =[ $attackb5, knight_atk6 ] {ai_charge(3);};
void() knight_atk6 =[ $attackb6, knight_atk7 ] {ai_charge(4); ai_melee();};
void() knight_atk7 =[ $attackb7, knight_atk8 ] {ai_charge(1); ai_melee();};
void() knight_atk8 =[ $attackb8, knight_atk9 ] {ai_charge(3);
ai_charge(0);
go_visible();
};
void() knight_atk2 =[ $attackb2, knight_atk3 ] {ai_charge(9);};
void() knight_atk3 =[ $attackb3, knight_atk4 ] {ai_charge(6);};
void() knight_atk4 =[ $attackb4, knight_atk5 ] {ai_charge(2);};
void() knight_atk5 =[ $attackb5, knight_atk6 ] {ai_charge(5);};
void() knight_atk6 =[ $attackb6, knight_atk7 ] {ai_charge(6); ai_melee();};
void() knight_atk7 =[ $attackb7, knight_atk8 ] {ai_charge(3); ai_melee();};
void() knight_atk8 =[ $attackb8, knight_atk9 ] {ai_charge(5);
ai_melee();};
void() knight_atk9 =[ $attackb9, knight_atk10] {ai_charge(1);};
void() knight_atk10=[ $attackb10, knight_run1 ] {ai_charge(5);};
void() knight_atk9 =[ $attackb9, knight_atk10] {ai_charge(3);};
void() knight_atk10=[ $attackb10, knight_run1 ] {ai_charge(9);};
//void() knight_atk9 =[ $attack9, knight_atk10 ] {};
//void() knight_atk10 =[ $attack10, knight_atk11 ] {};
//void() knight_atk11 =[ $attack11, knight_run1 ] {};
void() knight_laser =
{
local vector offang;
local vector org, vec;
offang = vectoangles (self.enemy.origin - self.origin);
makevectors (offang);
org = self.origin + self.mins + self.size*0.5 + v_forward * 20;
// set missile speed
vec = normalize (v_forward);
vec_z = 0 - vec_z + (random() - 0.5)*0.1;
launch_spike (org, vec);
newmis.classname = "knightspike";
setmodel (newmis, "progs/k_spike.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
newmis.velocity = vec*300;
sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);
};
void() knight_ratk1 =[ $attackb1, knight_ratk2 ] {};
void() knight_ratk2 =[ $attackb2, knight_ratk3 ] {};
void() knight_ratk3 =[ $attackb3, knight_ratk4 ] {};
void() knight_ratk4 =[ $attackb4, knight_ratk5 ] {};
void() knight_ratk5 =[ $attackb5, knight_ratk6 ] {};
void() knight_ratk6 =[ $attackb6, knight_ratk7 ] {};
void() knight_ratk7 =[ $attackb7, knight_ratk8 ] {
knight_laser();
};
void() knight_ratk8 =[ $attackb8, knight_ratk9 ] {};
void() knight_ratk9 =[ $attackb9, knight_ratk10 ] {};
void() knight_ratk10 =[ $attackb10, knight_run1 ] {};
//===========================================================================
void() knight_pain1 =[ $pain1, knight_pain2 ] {};
@ -166,6 +229,7 @@ void(entity attacker, float damage) knight_pain =
};
//===========================================================================
void() knight_bow1 =[ $kneel1, knight_bow2 ] {ai_turn();};
@ -233,13 +297,15 @@ void() knight_die =
void() monster_knight =
{
if (deathmatch)
if (self.zone == 0)
{
remove(self);
load_monster();
return;
}
precache_model ("progs/knight.mdl");
precache_model ("progs/h_knight.mdl");
precache_model ("progs/k_spike.mdl");
precache_sound ("knight/kdeath.wav");
precache_sound ("knight/khurt.wav");
@ -255,14 +321,15 @@ void() monster_knight =
setsize (self, '-16 -16 -24', '16 16 40');
self.health = 75;
self.islot3 = SlotVal(IID_ARM_METAL, 1);
self.armornoise = "weapons/ric1.wav";
self.th_stand = knight_stand1;
self.th_walk = knight_walk1;
self.th_run = knight_run1;
self.th_melee = knight_atk1;
self.th_pain = knight_pain;
self.th_die = knight_die;
self.armornoise = "weapons/ric1.wav";
self.classname = "monster";
self.netname = "reaver";
walkmonster_start ();
};

View file

@ -36,12 +36,12 @@ weaponry\n\n
string () ShopString =
{
return ("--- S H O P -------\n"
return ("<EFBFBD><EFBFBD><EFBFBD> supply merchant <20><EFBFBD><EFBFBD>\n"
"\n"
"<EFBFBD>1 traits \n"
"<EFBFBD>2 perks \n"
"<EFBFBD>1 perk [slot 1] \n"
"<EFBFBD>2 perk [slot 2] \n"
"<EFBFBD>3 body armour \n"
"<EFBFBD>4 protection \n"
"<EFBFBD>4 ammunition \n"
"<EFBFBD>5 weapons \n"
"<EFBFBD>6 equipment \n"
"<EFBFBD>7 chems \n"
@ -54,7 +54,7 @@ string () WeaponString =
return ("weaponry\n"
"\n"
"<EFBFBD>1 melee \n"
"<EFBFBD>2 thrown \n"
"<EFBFBD>2 explosives \n"
"<EFBFBD>3 pistols&smgs \n"
"<EFBFBD>4 shotguns \n"
"<EFBFBD>5 rifles \n"
@ -66,36 +66,41 @@ string () TraitString =
{
return ("traits\n"
"\n"
"<EFBFBD>1 one handed \n"
"<EFBFBD>2 small frame \n"
"<EFBFBD>3 bruiser \n"
"<EFBFBD>4 heavy handed \n"
"<EFBFBD>5 bloody mess \n"
"<EFBFBD>6 bad luck \n"
"<EFBFBD>e leave \n");
"<EFBFBD>1 unidextrous \n"
"<EFBFBD>2 ruthless \n"
"<EFBFBD>3 chem addict \n"
"<EFBFBD>4 red scare \n"
"<EFBFBD>5 living lightning \n"
"<EFBFBD>6 one in a million \n"
"<EFBFBD>e leave \n");
};
string () ThrownString =
{
return ("grenades\n"
" GRENADE | COST \n"
return ("<EFBFBD>! explosives <20>!\n"
"\n"
"<EFBFBD>1 smoke grenade 3$\n"
"<EFBFBD>2 frag grenade 4$\n"
"<EFBFBD>3 emp grenade 5$\n"
"<EFBFBD>4 flashbang 7$\n"
"<EFBFBD>e exit \n");
"<EFBFBD>1 flash bomb 8$\n"
"<EFBFBD>2 frag grenade 12$\n"
"<EFBFBD>3 ultra-light necklace 3$\n"
"<EFBFBD>4 hmx compound 2$\n"
"<EFBFBD>5 rdx crystals 2$\n"
"<EFBFBD>6 explosive rocket 10$\n"
"<EFBFBD>e exit \n");
};
string () BuildString =
{
return ("BUILD A STRUCTURE\n"
" NAME | UPGRADE | SCRAPS\n"
" NAME COST IN JUNK\n"
"\n"
"<EFBFBD>1 Mr. Ammo 4\n"
"<EFBFBD>2 Barricade 6\n"
"<EFBFBD>3 AutoDoc(tm) 10\n"
"<EFBFBD>4 Robo-Fang 11\n"
"<EFBFBD>1 Super Flash Bomb 4\n"
"<EFBFBD>2 Homemade Grenade 5\n"
"<EFBFBD>3 Needler Scope 5\n"
"<EFBFBD>4 Ghost Goggles 7\n"
"<EFBFBD>5 Gas Bomb 10\n"
"<EFBFBD>6 Deflector Ring 15\n"
"<EFBFBD>7 Auto-Doc 20\n"
"<EFBFBD>e exit \n");
};
@ -116,45 +121,75 @@ string () ArmorString =
{
return ("body armour wt abs prc\n"
"\n"
"<EFBFBD>1 light kevlar 03 1/20% 03$\n"
"<EFBFBD>2 leather armor 05 2/30% 08$\n"
"<EFBFBD>3 kevlar armor 09 3/35% 10$\n"
"<EFBFBD>4 metal armor 15 5/35% 12$\n"
"<EFBFBD>5 combat armor 12 4/40% 25$\n"
"<EFBFBD>6 brotherhood armor 17 5/45% 35$\n"
"<EFBFBD>7 force armor 06 7/10% 45$\n"
"<EFBFBD>8 metal armor mkii 20 8/50% 55$\n");
"<EFBFBD>1 kevlar shirt 04 1/25% 50$\n"
"<EFBFBD>2 leather armor 07 3/30% 100$\n"
"<EFBFBD>3 double kevlar 09 1/50% 125$\n"
"<EFBFBD>4 ceramic armor 15 7/25% 150$\n"
"<EFBFBD>5 combat armor 12 6/40% 200$\n"
"<EFBFBD>6 brotherhood 17 7/45% 250$\n"
"<EFBFBD>7 force armor 06 9/15% 300$\n"
"<EFBFBD>8 power armor 25 8/50% 400$\n");
};
string () PerkString =
{
return ("perks\n"
" ABILITY | FRAGS NEEDED \n"
"\n"
"<EFBFBD>1 bonus movement 2\n"
"<EFBFBD>2 strong back 2\n"
"<EFBFBD>3 quick pockets 2\n"
"<EFBFBD>4 awareness 2\n"
"<EFBFBD>5 silent running 3\n"
"<EFBFBD>6 better criticals 3\n"
"<EFBFBD>7 bonus ranged damage 3\n"
"<EFBFBD>8 divine favor 3\n"
"<EFBFBD>9 slayer 3\n"
"<EFBFBD>0 sharpshooter 4\n");
"<EFBFBD> 1 unbreakable \n"
"<EFBFBD> 2 feral swiftness \n"
"<EFBFBD> 3 stunt man \n"
"<EFBFBD> 4 kick in the door! \n"
"<EFBFBD> 5 quick draw \n"
"<EFBFBD> 6 light step \n"
"<EFBFBD> 7 surprise attack \n"
"<EFBFBD> 8 large and in charge \n"
"<EFBFBD> 9 nintendo gamer \n"
"<EFBFBD> 0 extrasensory paranoia\n"
"<EFBFBD>F1 last man standing \n"
"<EFBFBD>F2 bodysnatcher \n"
"<EFBFBD>F3 natural aim \n"
"<EFBFBD>F4 dark alchemist \n"
"<EFBFBD>F5 renegade commando \n"
"<EFBFBD>F6 power shot \n"
"<EFBFBD>F7 one in a million \n"
"<EFBFBD>F8 master blaster \n"
"<EFBFBD>F9 death wish \n");
};
string () ProtectString =
string () AmmoString =
{
return ("++ high-tech protective devices ++ \n"
return ("++ ammunition ++\n"
"\n"
" HARDWARE | SHIELDS VS | PRICE \n"
"<EFBFBD>1 energy amulet |damage: 7% <20>15\n"
"<EFBFBD>2 force field |front: 15% <20>20\n"
"<EFBFBD>3 safety ring |absorb: 3 <20>35\n"
"<EFBFBD>4 smokescreen |obscures <20>40\n"
"<EFBFBD>5 sentient cube |regenerate <20>45\n");
" AMMO | POWER | TYPE | COST[50]\n"
"<EFBFBD>1 10mm 2 FMJ <20>015\n"
"<EFBFBD>2 12gauge 4 SHOT <20>025\n"
"<EFBFBD>3 44 mag 3 AP <20>030\n"
"<EFBFBD>4 45 acp 3 JHP <20>020\n"
"<EFBFBD>5 .223 3 FMJ <20>030\n"
"<EFBFBD>6 5mm 3 JHP <20>025\n"
"<EFBFBD>7 .308 4 AP <20>040\n"
"<EFBFBD>8 needle 2 AP <20>035\n"
"<EFBFBD>9 caseless 3 FMJ <20>040\n"
"<EFBFBD>0 energycell 4 CELL <20>055\n");
};
string () AmmoString2 =
{
return ("++ ammunition ++\n"
"you get a discount when fighting ghouls!\n"
" AMMO | POWER | TYPE | COST[50]\n"
"<EFBFBD>1 10mm 2 FMJ <20>005\n"
"<EFBFBD>2 12gauge 4 N/A <20>008\n"
"<EFBFBD>3 44 mag 3 AP <20>010\n"
"<EFBFBD>4 45 acp 3 JHP <20>007\n"
"<EFBFBD>5 .223 3 FMJ <20>010\n"
"<EFBFBD>6 5mm 3 JHP <20>008\n"
"<EFBFBD>7 .308 4 AP <20>015\n"
"<EFBFBD>8 needle 2 AP <20>010\n"
"<EFBFBD>9 caseless 3 FMJ <20>020\n"
"<EFBFBD>0 energycell 4 N/A <20>015\n");
};
/*return ("++ high-tech protective devices ++ \n\n
HARDWARE | SHIELDS VS | PRICE \n
@ -167,17 +202,18 @@ string () ProtectString =
string () OtherString =
{
return
"++ miscellaneous items ++\n"
" ITEM | CLASS | PRICE \n"
return ("<EFBFBD>? miscellaneous <20>?\n"
"\n"
"\n"
"<EFBFBD>1 (25) bandages for medic 2$\n"
"<EFBFBD>3 (20) mr.ammo 20$\n"
"<EFBFBD>4 (20) auto-doc 20$\n"
"<EFBFBD>5 (20) shield-gen 20$\n"
"<EFBFBD>6 (20) tesla-turret 20$\n"
;
"<EFBFBD>1 junk 1$\n"
"<EFBFBD>2 nuka-cola 1$\n"
"<EFBFBD>3 chemicals 2$\n"
"<EFBFBD>4 aerosol can 2$\n"
"<EFBFBD>5 circuitboard 5$\n"
"<EFBFBD>6 steel pipe 3$\n"
"<EFBFBD>7 duct tape 1$\n"
"<EFBFBD>8 chewing gum 1$\n"
"<EFBFBD>9 copper wire 1$\n"
"<EFBFBD>0 x-ray tube 7$\n");
};
@ -186,10 +222,10 @@ string () MeleeString =
return ("MELEE WEAPONS\n"
"WEAPON | TYPE | WT | PRICE \n"
"\n"
"<EFBFBD>1 knife melee 01 01$\n"
"<EFBFBD>2 hand axe melee 08 03$\n"
"<EFBFBD>3 vibroblade melee 04 10$\n"
"<EFBFBD>4 power axe melee 07 15$\n"
"<EFBFBD>1 knife 01 06$\n"
"<EFBFBD>2 wrench 03 08$\n"
"<EFBFBD>3 axe 08 09$\n"
"<EFBFBD>4 spear 04 12$\n"
"<EFBFBD>e exit \n");
};
@ -209,12 +245,12 @@ string () PistolString =
return ("Pistols and Submachineguns\n"
" WEAPON | CAL | WEIGHT | PRICE \n"
"\n"
"<EFBFBD>1 mk23 socom .45 01 5$\n"
"<EFBFBD>2 d. eagle .44 02 7$\n"
"<EFBFBD>3 needler pistol 02 9$\n"
"<EFBFBD>4 h&k mp7 4mm 03 14$\n"
"<EFBFBD>5 grease gun 9mm 03 17$\n"
"<EFBFBD>6 alien blaster 02 21$\n");
"<EFBFBD>1 usp socom .45 01 50$\n"
"<EFBFBD>2 d. eagle .44 02 70$\n"
"<EFBFBD>3 glock 21 10mm 01 40$\n"
"<EFBFBD>4 needler pistol 02 120$\n"
"<EFBFBD>5 h&k mp10 10mm 03 150$\n"
"<EFBFBD>6 h&k ump .45 03 170$\n");
};
string () ShotgunString =
@ -222,10 +258,10 @@ string () ShotgunString =
return ("shotguns\n"
" WEAPON | TYPE | WEIGHT | PRICE \n"
"\n"
"<EFBFBD>1 pipe rifle .44 02 4$\n"
"<EFBFBD>2 winchester 12g 03 8$\n"
"<EFBFBD>3 mossberg 12g 04 14$\n"
"<EFBFBD>4 citykiller 12g 05 35$\n");
"<EFBFBD>1 pipe rifle .44 02 15$\n"
"<EFBFBD>2 winchester 12g 03 60$\n"
"<EFBFBD>3 citykiller 12g 04 240$\n"
"<EFBFBD>4 jackhammer 12g 07 350$\n");
};
/*
@ -241,13 +277,12 @@ string () RifleString =
return ("rifles\n"
" RIFLE | TYPE | WEIGHT | PRICE \n"
"\n"
"<EFBFBD>1 rangemaster 7mm 03 11$\n"
"<EFBFBD>2 ak-112 5mm 04 21$\n"
"<EFBFBD>3 remington .308 05 24$\n"
"<EFBFBD>4 ak-74 5mm 04 27$\n"
"<EFBFBD>5 moonlight .223 05 36$\n"
"<EFBFBD>6 sa-80 5mm 05 32$\n"
"<EFBFBD>7 fn-fal .308 09 25$\n");
"<EFBFBD>1 rangemaster 223 03 110$\n"
"<EFBFBD>2 ak-112 5mm 04 180$\n"
"<EFBFBD>3 fn fal 308 08 190$\n"
"<EFBFBD>4 widowmaker 308 10 270$\n"
"<EFBFBD>5 moonlight 223 05 280$\n"
"<EFBFBD>6 hk g11 4mm 06 220$\n");
};
string () HeavyString =
@ -255,40 +290,43 @@ string () HeavyString =
return ("other weaponry\n"
" WEAPON | TYPE | WEIGHT | PRICE \n"
"\n"
"<EFBFBD>1 rocket launcher 10 30$\n"
"<EFBFBD>2 gauss rifle 07 32$\n"
"<EFBFBD>3 laser carbine 12 45$\n");
"<EFBFBD>1 rpg-7 missile launcher 10 350$\n"
"<EFBFBD>2 m72 gauss rifle 07 550$\n"
"<EFBFBD>3 plasma pistol 02 250$\n"
"<EFBFBD>4 m25a2 phased plasma rifle 11 450$\n"
"<EFBFBD>5 m95a1 plasma carbine 08 550$\n"
"<EFBFBD>6 rsb-80 heavy plasma gun 25 650$\n");
};
string () ChemString =
{
return ("drugs\n DRUG | EFFECTS | PRICE\n"
"\n"
"<EFBFBD>1 stimpack heals 05+20 3$\n"
"<EFBFBD>2 medkit+ heals 10+50 5$\n"
"<EFBFBD>3 superstim* heals 20+60 12$\n"
"<EFBFBD>4 adrenaline*+speed/jump 10$\n"
"<EFBFBD>5 jet* aim better 18$\n"
"<EFBFBD>e exit \n"
"<EFBFBD>1 stimpack heal over time 10$\n"
"<EFBFBD>2 rad-x anti-radiation 15$\n"
"<EFBFBD>3 adrenaline*+speed/jump 15$\n"
"<EFBFBD>4 medkit* endless heal 25$\n"
"<EFBFBD>5 superstim* instant heal 25$\n"
"<EFBFBD>6 psycho* +resist damage 25$\n"
"<EFBFBD>7 berserk* +strength 25$\n"
"\n"
"+ requires medic \n"
"* requires advanced medic \n");
"* requires medic \n");
};
string () ChemString2 =
{
return ("chems\n DRUG | EFFECTS | PRICE\n"
"\n"
"<EFBFBD>1 adrenaline +60 speed/jump 3$\n"
"<EFBFBD>2 stimpack heals 40 5$\n"
"<EFBFBD>3 psycho+ +60 hp/no pain 11$\n"
"<EFBFBD>4 medkit* heals 20+50 12$\n"
"<EFBFBD>5 berserk* adren+psycho 12$\n"
"<EFBFBD>1 adrenaline +60 speed/jump 5$\n"
"<EFBFBD>2 stimpack heals 40 10$\n"
"<EFBFBD>3 psycho+ +60 hp/no pain 15$\n"
"<EFBFBD>4 medkit* heals 20+50 15$\n"
"<EFBFBD>5 berserk* adren+psycho 15$\n"
"<EFBFBD>6 jet* aim better 15$\n"
"<EFBFBD>e exit \n"
"\n"
"+ requires shaman \n"
"* requires advanced shaman \n");
"+ requires medic \n"
"* requires advanced medic \n");
};
string () EnergyWeaponsString =
@ -348,16 +386,98 @@ string () de_dust =
string () EquipmentString =
{
return ("+ special equipment +\n"
"press your c key to activate!\n"
"\n"
"<EFBFBD>1 medic's bag <20>15c\n"
"<EFBFBD>2 security alarm <20>15c\n"
"<EFBFBD>3 remote camera <20>15c\n"
"<EFBFBD>4 belt pouch <20>15c\n"
"<EFBFBD>5 backpack <20>15c\n"
"<EFBFBD>6 toolkit mark ii <20>15c\n"
"<EFBFBD>7 climbing gear <20>15c\n"
"<EFBFBD>8 enhanced battery <20>15c\n"
"<EFBFBD>9 stealth boy <20>45c\n"
"we only let you use one of these!\n"
"<EFBFBD>1 medic's bag <20>5c\n"
"<EFBFBD>2 ghost goggles <20>5c\n"
"<EFBFBD>3 stealth boy <20>5c\n"
"<EFBFBD>4 belt pouch <20>5c\n"
"<EFBFBD>5 backpack <20>5c\n"
"<EFBFBD>6 toolkit mark ii <20>5c\n"
"<EFBFBD>7 climbing gear <20>5c\n"
"<EFBFBD>8 enhanced battery <20>5c\n"
"\n");
};
string () EnterString =
{
return ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> fallout <20><EFBFBD><EFBFBD><EFBFBD>\n"
"<EFBFBD> a post-nuclear fps <20>\n"
"\n"
"scour the wastes with your friends!\n"
"this quake mod is entirely based on\n"
"the fallout series of computer rpgs\n"
"for best performance the fte client\n"
"is required for play, available at:\n"
" <20> www.fteqw.com <20> \n"
"\n"
"<EFBFBD>press 1 to continue\n"
"\n"
"\n");
};
string () WaitString =
{
return ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> fallout <20><EFBFBD><EFBFBD><EFBFBD>\n"
"<EFBFBD> a post-nuclear fps <20>\n"
"\n"
"scour the wastes with your friends!\n"
"this quake mod is entirely based on\n"
"the fallout series of computer rpgs\n"
"for best performance the fte client\n"
"is required for play, available at:\n"
" <20> www.fteqw.com <20> \n"
"\n"
"<EFBFBD>wait until next round\n"
"\n"
"\n");
};
string () LockpickString =
{
return ("<EFBFBD> Picking <20>\n"
"\n\n"
"this is tricky business! wait until\n"
"all three tumblers are in place by \n"
"watching for three [!] symbols. but\n"
"you have to be quick! failure means\n"
"you jam the lock.\n\n"
"<EFBFBD>press 1 to pick\n"
"<EFBFBD>press 2 to quit\n");
};
string () DefuseString =
{
return ("<EFBFBD> Defuse <20>\n"
"\n\n"
"this is tricky business! wait until\n"
"all three circuits are in place by \n"
"watching for three [!] symbols. but\n"
"you have to be quick! failure means\n"
"you reset the switch bypass.\n\n"
"<EFBFBD>press 1 to pick\n"
"<EFBFBD>press 2 to quit\n");
};
string () MissionString =
{
return ("<EFBFBD><EFBFBD><EFBFBD> mission select <20><EFBFBD><EFBFBD>\n"
"\n"
"\n"
"<EFBFBD>1 get new mission\n"
"<EFBFBD>2 grab one later \n\n\n");
};
string () DepartString =
{
return ("<EFBFBD><EFBFBD><EFBFBD> saddle up! <20><EFBFBD><EFBFBD>\n"
"\n"
"\n"
"<EFBFBD>1 take off to mission site\n"
"<EFBFBD>2 wait a second \n\n\n");
};

View file

@ -216,8 +216,7 @@ void() barrel_explode =
{
self.takedamage = DAMAGE_NO;
self.classname = "explo_box";
// did say self.owner
T_RadiusDamage (self, self, 160, world, "");
T_RadiusDamage2 (self, self.owner, 65+random()*65, other, 800);
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
WriteCoord (MSG_MULTICAST, self.origin_x);
@ -262,35 +261,27 @@ void() misc_explobox =
void () hostage_die =
{
self.enemy.frags = (self.enemy.frags - START_OFF);
self.enemy.ammo_shells = (self.enemy.ammo_shells - MULTICAST_PVS_R);
if ((self.enemy.team == START_OFF))
{
blue_kill = (blue_kill + START_OFF);
}
if ((self.enemy.team == SILENT))
{
red_kill = (red_kill + START_OFF);
}
if ((self.enemy.frags <= MULTICAST_ALL))
{
self.enemy.frags = MULTICAST_ALL;
}
if ((self.enemy.ammo_shells <= MULTICAST_ALL))
{
self.enemy.ammo_shells = MULTICAST_ALL;
}
local entity ze;
self.frame = START_OFF;
if ((self.model == "progs/hosfem.mdl"))
{
sound (self, CHAN_VOICE, "misc/hosdie2.wav", START_OFF, ATTN_NORM);
}
if (self.model == "progs/hosfem.mdl")
sound (self, CHAN_VOICE, "misc/hosdie2.wav", 1, ATTN_NONE);
else
{
sound (self, CHAN_VOICE, "misc/hosdie1.wav", START_OFF, ATTN_NORM);
}
sound (self, CHAN_BODY, "misc/hosdown.wav", START_OFF, ATTN_NONE);
sound (self, CHAN_VOICE, "misc/hosdie1.wav", 1, ATTN_NONE);
ze = find (world, classname, "player");
while (ze)
{
if (ze.classname == "player")
ze.score = ze.score - 100;
ze = find(ze, classname, "player");
}
hos_deatha1 ();
setsize (self, VEC_ORIGIN, VEC_ORIGIN);
};
@ -338,6 +329,40 @@ void () sci_think =
return;
};
void (vector place) hostage_new =
{
local entity te;
local float qq;
precache_model ("progs/hosfem.mdl");
precache_model ("progs/hosguy.mdl");
precache_sound ("misc/hosdie1.wav");
precache_sound ("misc/hosdie2.wav");
precache_sound ("misc/hosdown.wav");
precache_sound ("misc/rescued.wav");
hostages = hostages + 1;
setorigin(self, place + '0 0 24');
hos_stand1 ();
self.movetype = MOVETYPE_STEP;
self.velocity = VEC_ORIGIN;
self.touch = SUB_Null;
self.classname = "rhostage";
self.takedamage = DAMAGE_AIM;
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
self.home = self.origin;
setmodel (self, "progs/hosfem.mdl");
self.health = 70;
self.think = hostage_think;
self.nextthink = (time + START_OFF);
self.solid = SOLID_BBOX;
self.th_die = hostage_die;
self.th_pain = hostage_pain;
self.rescued = MULTICAST_ALL;
self.angles_y = floor ((random () * 360));
self.netname = "citizen";
};
void () hostage_spawn =
{
local entity te;
@ -882,3 +907,163 @@ void() misc_noisemaker =
self.nextthink = time + 0.1 + random();
self.think = noise_think;
};
void() brotherhood_merchant =
{
setorigin(self, self.origin + '0 0 64');
self.movetype = MOVETYPE_BOUNCE;
self.velocity_z = -200;
setmodel (self, "progs/enforcer.mdl");
self.touch = SUB_Null;
self.solid = SOLID_SLIDEBOX;
setsize (self, '-16 -16 -24', '16 16 32');
self.takedamage = DAMAGE_NO;
self.classname = "merchant";
self.think = shop_face;
self.nextthink = time + 0.5;
};
void() brotherhood_sergeant =
{
setorigin(self, self.origin + '0 0 64');
self.movetype = MOVETYPE_BOUNCE;
self.velocity_z = -200;
setmodel (self, "progs/enforcer.mdl");
self.touch = SUB_Null;
self.solid = SOLID_SLIDEBOX;
setsize (self, '-16 -16 -24', '16 16 32');
self.takedamage = DAMAGE_NO;
};
void() brotherhood_soldier =
{
setorigin(self, self.origin + '0 0 64');
self.movetype = MOVETYPE_BOUNCE;
self.velocity_z = -200;
setmodel (self, "progs/enforcer.mdl");
self.touch = SUB_Null;
self.solid = SOLID_SLIDEBOX;
setsize (self, '-16 -16 -24', '16 16 32');
self.takedamage = DAMAGE_NO;
};
void() brotherhood_guard =
{
precache_model ("progs/enforcer.mdl");
precache_sound ("enforcer/sight1.wav");
precache_sound ("enforcer/sight2.wav");
precache_sound ("enforcer/sight3.wav");
precache_sound ("enforcer/sight4.wav");
setorigin(self, self.origin + '0 0 64');
self.movetype = MOVETYPE_BOUNCE;
self.velocity_z = -200;
setmodel (self, "progs/enforcer.mdl");
self.touch = SUB_Null;
self.solid = SOLID_SLIDEBOX;
setsize (self, '-16 -16 -24', '16 16 32');
self.takedamage = DAMAGE_NO;
};
void() brotherhood_doctor =
{
setorigin(self, self.origin + '0 0 64');
self.movetype = MOVETYPE_BOUNCE;
self.velocity_z = -200;
setmodel (self, "progs/enforcer.mdl");
self.touch = SUB_Null;
self.solid = SOLID_SLIDEBOX;
setsize (self, '-16 -16 -24', '16 16 32');
self.takedamage = DAMAGE_NO;
};
void() computer_noise =
{
if (random()<0.10)
sound (self, CHAN_WEAPON, "effects/beep1.wav", 1, ATTN_IDLE);
else if (random()<0.10)
sound (self, CHAN_WEAPON, "effects/beep2.wav", 1, ATTN_IDLE);
else if (random()<0.10)
sound (self, CHAN_WEAPON, "effects/beep3.wav", 1, ATTN_IDLE);
else if (random()<0.10)
sound (self, CHAN_WEAPON, "effects/beep4.wav", 1, ATTN_IDLE);
self.nextthink = time + 5;
};
void() misc_computer =
{
precache_sound ("effects/beep1.wav");
precache_sound ("effects/beep2.wav");
precache_sound ("effects/beep3.wav");
precache_sound ("effects/beep4.wav");
self.nextthink = time + 5;
self.think = computer_noise;
};
void() medical_noise =
{
sound (self, CHAN_WEAPON, "effects/beep5.wav", 1, ATTN_IDLE);
self.nextthink = time + 2.50;
};
void() misc_medical =
{
precache_sound ("effects/beep5.wav");
self.nextthink = time + 2.50;
self.think = medical_noise;
};
void() radio_noise =
{
if (random()<0.10)
sound (self, CHAN_WEAPON, "effects/radio1.wav", 1, ATTN_NORM);
else if (random()<0.10)
sound (self, CHAN_WEAPON, "effects/radio2.wav", 1, ATTN_NORM);
else if (random()<0.10)
sound (self, CHAN_WEAPON, "effects/radio3.wav", 1, ATTN_NORM);
else if (random()<0.10)
sound (self, CHAN_WEAPON, "effects/radio4.wav", 1, ATTN_NORM);
self.nextthink = time + 4;
};
void() misc_radio =
{
self.nextthink = time + 5;
self.think = radio_noise;
};
void() brotherhood_wounded =
{
remove(self);
};
void() func_tank =
{
precache_model ("progs/x_tank.mdl");
setmodel (self, "progs/x_tank.mdl");
setorigin(self, self.origin + '0 0 64');
self.movetype = MOVETYPE_BOUNCE;
self.velocity_z = -200;
self.touch = SUB_Null;
self.solid = SOLID_SLIDEBOX;
setsize (self, '-64 -64 -32', '64 64 32');
self.takedamage = DAMAGE_NO;
};

File diff suppressed because it is too large Load diff

View file

@ -225,9 +225,10 @@ string () SmallArmString2 =
*/
string () SmallArmString3 =
{
return ("rifles\n RIFLE | TYPE | WEIGHT | PRICE \n\n<EFBFBD>1 rangemaster 7mm 03 11$\n<EFBFBD>2 ak-112 5mm 04 21$\n<EFBFBD>3 remington .308 05 24$\n<EFBFBD>4 ak-74 5mm 04 27$\n<EFBFBD>5 moonlight .223 05 36$\n<EFBFBD>6 sa-80 5mm 05 23$\n<EFBFBD>7 plasma rifle 07 41$\n<EFBFBD>8 gauss rifle 2mm 08 51$\n");
return ("rifles\n RIFLE | TYPE | WEIGHT | PRICE \n\n<EFBFBD>1 rangemaster 7mm 03 11$\n<EFBFBD>2 ak-112 5mm 04 21$\n<EFBFBD>3 fn-fal .308 08 27$\n<EFBFBD>4 widowmaker .308 09 24$\n<EFBFBD>5 moonlight .223 05 36$\n<EFBFBD>6 hk g11 5mm 05 23$\n");
};
string () DrugString1 =
{
return ("drugs\n DRUG | EFFECTS | PRICE\n"

View file

@ -66,6 +66,9 @@ void() monster_death_use =
void() walkmonster_start_go =
{
local float replace;
local vector back;
self.origin_z = self.origin_z + 1; // raise off floor a bit
droptofloor();
@ -74,6 +77,17 @@ void() walkmonster_start_go =
dprint ("walkmonster in wall at: ");
dprint (vtos(self.origin));
dprint ("\n");
back = self.origin;
replace = 90;
while (!walkmove(0,0) && replace > 0)
{
setorigin(self, back);
self.origin_x = self.origin_x + crandom()*600;
self.origin_y = self.origin_y + crandom()*600;
self.origin_z = self.origin_z + 1; // raise off floor a bit
droptofloor();
replace = replace - 1;
}
}
self.takedamage = DAMAGE_AIM;
@ -97,7 +111,7 @@ void() walkmonster_start_go =
dprint ("\n");
}
// this used to be an objerror
if (self.movetarget.classname == "path_corner")
if (self.movetarget.classname == "path_corner" || self.movetarget.classname == "rhostage")
self.th_walk ();
else
self.pausetime = 99999999;

View file

@ -61,29 +61,8 @@ string () GetPerkName =
local string name;
local float slot;
slot = self.perk;
if (slot == 0)
name = "none";
if (slot == 1)
name = "medic's bag";
else if (slot == 2)
name = "security alarm";
else if (slot == 3)
name = "remote camera";
else if (slot == 4)
name = "belt pouch";
else if (slot == 5)
name = "backpack";
else if (slot == 6)
name = "toolkit mark ii";
else if (slot == 7)
name = "climbing gear";
else if (slot == 8)
name = "enhanced battery";
else if (slot == 9)
name = "stealth-boy";
return name;
return "perk";
};
string () GetTraitName =
@ -91,28 +70,5 @@ string () GetTraitName =
local string name;
local float slot;
slot = self.trait;
if (slot == 0)
name = "none";
else if (slot == 1)
name = "medic's bag";
else if (slot == 2)
name = "security alarm";
else if (slot == 3)
name = "remote camera";
else if (slot == 4)
name = "belt pouch";
else if (slot == 5)
name = "backpack";
else if (slot == 6)
name = "toolkit mark ii";
else if (slot == 7)
name = "climbing gear";
else if (slot == 8)
name = "enhanced battery";
else if (slot == 9)
name = "stealth-boy";
return name;
return "trait";
};

View file

@ -1,3 +1,169 @@
#define mag1 currentammo
#define maxmag1 cnt
void () OgreFirePlasma =
{
local float x;
local vector dist, vec;
newmis = spawn ();
newmis.owner = self;
newmis.movetype = MOVETYPE_FLYMISSILE;
newmis.solid = SOLID_BBOX;
newmis.classname = "grenade";
newmis.skin = 0;
makevectors (self.angles);
sound (self, CHAN_WEAPON, "weapons/energy2.wav", PLAT_LOW_TRIGGER, ATTN_NORM);
newmis.touch = PlasmaBolt;
newmis.velocity = v_forward * 1200;
newmis.angles = vectoangles (newmis.velocity);
newmis.touch = PlasmaBolt;
newmis.voided = 0;
makevectors (self.enemy.angles);
dist = self.enemy.origin - x*self.movedir;
vec = normalize(dist - self.origin);
sound (self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM);
launch_spike (self.origin, vec);
newmis.velocity = vec*600;
newmis.owner = self.owner;
newmis.classname = "wizspike";
newmis.touch = wizspike_touch;
setmodel (newmis, "progs/w_spike.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
newmis.nextthink = time + 5;
newmis.think = SUB_Remove;
newmis.nextthink = (time + 1.5);
newmis.effects = EF_BLUE;
setmodel (newmis, "progs/plasma.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
setorigin (newmis, ((self.origin + (v_right * TE_BLOOD)) + (v_up * TE_BLOOD)));
};
void () ogre_load1 = [ 136, ogre_load2 ]
{
};
void () ogre_load2 = [ 136, ogre_load3 ]
{
};
void () ogre_load3 = [ 137, ogre_load4 ]
{
};
void () ogre_load4 = [ 137, ogre_load5 ]
{
};
void () ogre_load5 = [ 138, ogre_load6 ]
{
};
void () ogre_load6 = [ 138, ogre_load7 ]
{
};
void () ogre_load7 = [ 139, ogre_load8 ]
{
};
void () ogre_load8 = [ 139, ogre_load9 ]
{
};
void () ogre_load9 = [ 140, ogre_load10 ]
{
};
void () ogre_load10 = [ 140, ogre_load11 ]
{
};
void () ogre_load11 = [ 141, ogre_load12 ]
{
};
void () ogre_load12 = [ 141, ogre_load13 ]
{
};
void () ogre_load13 = [ 142, ogre_load14 ]
{
};
void () ogre_load14 = [ 142, ogre_load16 ]
{
};
void () ogre_load15 = [ 143, ogre_load16 ]
{
};
void () ogre_load16 = [ 143, ogre_run1 ]
{
};
//SMG
void (float tmp, float dam) ogre_smg =
{
local vector src;
local vector dir;
local vector direction;
local entity en;
local vector org;
if (self.mag1 <= 0)
{
sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM);
ogre_load1();
self.mag1 = 60;
return;
}
muzzleflash ();
self.weapon = 5;
sound (self, CHAN_WEAPON, "weapons/mp7.wav", 1, ATTN_NORM);
tmp = 350;
dam = 15;
if (self.enemy.sneak == 1)
tmp = tmp * 2;
self.mag1 = self.mag1 - 1;
makevectors (self.angles);
src = self.origin + v_forward*10;
src_z = self.absmin_z + self.size_z * 0.7;
en = self.enemy;
dir = en.origin - en.velocity*0.2;
if (en.position == 1)
dir = dir - '0 0 16';
if (en.position == 2)
dir = dir - '0 0 32';
dir = normalize (dir - self.origin);
direction = dir;
traceline (src, src + direction*2000 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self);
if (trace_fraction == PLAT_LOW_TRIGGER)
return;
if (trace_ent.takedamage)
{
SpawnBlood (org, PLAT_LOW_TRIGGER);
dam = 1 + random()*dam + random()*dam;
dam = dam * (1 - (trace_fraction));
T_Damage (trace_ent, self, self, dam);
}
else
bullet_hole (trace_endpos);
};
void () OgreGrenadeExplode =
{
@ -25,24 +191,30 @@ void () LobAGrenade =
newmis.skin = 0;
makevectors (self.angles);
newmis.velocity = v_forward * 800;
newmis.velocity_z = (newmis.velocity_z + 200);
newmis.angles = vectoangles (newmis.velocity);
newmis.avelocity_x = (random () * 300);
newmis.avelocity_y = (random () * 300);
newmis.avelocity_z = (random () * 300);
newmis.touch = HandGrenBounce;
newmis.nextthink = (time + 2.5);
// if (iid == IID_GREN_FRAG)
// newmis.think = FragExplode;
// else if (iid == IID_GREN_EMP)
// newmis.think = EMPExplode;
// else if (iid == IID_GREN_SMOKE)
newmis.think = SmokeThink;
if (random() < 0.5)
{
newmis.think = StunExplode;
newmis.velocity = v_forward * 600;
newmis.velocity_z = (newmis.velocity_z + 200);
newmis.angles = vectoangles (newmis.velocity);
newmis.avelocity_x = (random () * 200);
newmis.avelocity_y = (random () * 200);
newmis.avelocity_z = (random () * 200);
newmis.touch = HandGrenBounce;
newmis.nextthink = (time + 1.5);
}
else
{
newmis.think = FlashExplode;
newmis.velocity = v_forward * 80;
newmis.velocity_z = (newmis.velocity_z + 20);
newmis.angles = vectoangles (newmis.velocity);
newmis.avelocity_x = (random () * 30);
newmis.avelocity_y = (random () * 30);
newmis.avelocity_z = (random () * 30);
newmis.touch = HandGrenBounce;
newmis.nextthink = (time + 3);
}
newmis.frame = 1;
setmodel (newmis, "progs/handgren.mdl");
@ -59,33 +231,19 @@ void (float side) chainsaw =
local float ldmg;
if (!self.enemy)
{
return;
}
if (!CanDamage (self.enemy, self))
{
return;
}
ai_charge (TE_LAVASPLASH);
delta = (self.enemy.origin - self.origin);
if ((vlen (delta) > 100))
{
return;
}
ldmg = (TE_LIGHTNING3 + (random () * IDLE6A));
ldmg = (6 + (random()*6));
T_Damage (self.enemy, self, self, ldmg);
T_Damage (self.enemy, self, self, ldmg);
if (side)
{
makevectors (self.angles);
if ((side == PLAT_LOW_TRIGGER))
{
SpawnMeatSpray ((self.origin + (v_forward * SECRET_YES_SHOOT)), ((crandom () * 100) * v_right));
}
else
{
SpawnMeatSpray ((self.origin + (v_forward * SECRET_YES_SHOOT)), (side * v_right));
}
}
};
void () ogre_stand1 = [ 0, ogre_stand2 ]
@ -427,6 +585,7 @@ void () ogre_nail2 = [ 62, ogre_nail3 ]
void () ogre_nail3 = [ 62, ogre_nail4 ]
{
OgreFirePlasma();
ai_face ();
};
@ -443,7 +602,6 @@ void () ogre_nail5 = [ 64, ogre_nail6 ]
void () ogre_nail6 = [ 65, ogre_nail7 ]
{
ai_face ();
LobAGrenade();
};
void () ogre_nail7 = [ 66, ogre_run1 ]
@ -463,26 +621,69 @@ void () ogre_nailb = [ 62, ogre_nailc ]
void () ogre_nailc = [ 62, ogre_naild ]
{
ai_face ();
ogre_smg(110, 17);
if (visible(self.enemy))
ai_face ();
};
void () ogre_naild = [ 63, ogre_naile ]
void () ogre_naild = [ 63, ogre_nailc ]
{
ai_face ();
ogre_smg(110, 17);
if (visible(self.enemy))
ai_face ();
};
void () ogre_naile = [ 64, ogre_nailf ]
void () ogre_naile = [ 63, ogre_nailf ]
{
ai_face ();
LobAGrenade();
ogre_smg(120, 17);
if (visible(self.enemy))
ai_face ();
};
void () ogre_nailf = [ 65, ogre_nailg ]
void () ogre_nailf = [ 62, ogre_nailg ]
{
ai_face ();
ogre_smg(120, 17);
if (visible(self.enemy))
ai_face ();
};
void () ogre_nailg = [ 66, ogre_run1 ]
void () ogre_nailg = [ 62, ogre_nailh ]
{
ogre_smg(130, 17);
if (visible(self.enemy))
ai_face ();
};
void () ogre_nailh = [ 63, ogre_naili ]
{
ogre_smg(130, 17);
if (visible(self.enemy))
ai_face ();
};
void () ogre_naili = [ 63, ogre_nailj ]
{
ogre_smg(140, 17);
if (visible(self.enemy))
ai_face ();
};
void () ogre_nailj = [ 63, ogre_nailk ]
{
ogre_smg(140, 17);
if (visible(self.enemy))
ai_face ();
};
void () ogre_nailk = [ 63, ogre_naill ]
{
ogre_smg(150, 17);
if (visible(self.enemy))
ai_face ();
};
void () ogre_naill = [ 64, ogre_run1 ]
{
ai_face ();
};
@ -689,7 +890,6 @@ void (entity attacker, float damage) ogre_pain =
void () ogre_die1 = [ 112, ogre_die2 ]
{
self.solid = SOLID_NOT;
};
void () ogre_die2 = [ 113, ogre_die3 ]
@ -698,9 +898,8 @@ void () ogre_die2 = [ 113, ogre_die3 ]
void () ogre_die3 = [ 114, ogre_die4 ]
{
DropBackpack ();
DropBackpack ();
DropBackpack ();
self.rtime = 1;
};
void () ogre_die4 = [ 115, ogre_die5 ]
@ -758,9 +957,8 @@ void () ogre_bdie2 = [ 127, ogre_bdie3 ]
void () ogre_bdie3 = [ 128, ogre_bdie4 ]
{
self.solid = SOLID_NOT;
self.rtime = 1;
self.ammo_rockets = SILENT;
DropBackpack ();
};
void () ogre_bdie4 = [ 129, ogre_bdie5 ]
@ -798,57 +996,49 @@ void () ogre_bdie10 = [ 135, ogre_bdie10 ]
void () mutant_pain =
{
local vector dir;
if (self.rtime > 0)
{
self.health = 180;
return;
}
dir = normalize(self.origin - self.enemy.origin);
self.velocity = dir * 10;
if (self.frame == 69)
{
self.frame = 70;
self.health = 180;
self.think = army_die1;
self.nextthink = time + 0.12;
self.frame = 70;
self.think = ogre_die1;
self.nextthink = time + 0.12;
}
else
{
self.health = 180;
ThrowGib ("progs/zom_gib.mdl", -40);
self.frame = 69;
self.health = 180;
self.think = ogre_die1;
self.think = ogre_bdie1;
self.nextthink = time + 0.12;
}
self.attack = self.attack + 1;
if (self.attack == 8)
{
if (random()*4 <= 2)
sound (self, CHAN_VOICE, "player/agdie1.wav", 1, ATTN_NORM);
else
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
}
if (self.attack >= 16)
{
self.solid = SOLID_NOT;
self.think = ogre_bdie1;
ThrowGib ("progs/zom_gib.mdl", -35);
ThrowGib ("progs/zom_gib.mdl", -35);
ThrowGib ("progs/gib1.mdl", -35);
}
};
void (vector stuff, vector ang) spawn_live_ogre =
{
local entity ogre;
ogre = spawn ();
ogre.origin = stuff;
ogre.enemy = world;
ogre.enemy = self.enemy;
ogre.attack_finished = time + 10;
ogre.solid = SOLID_SLIDEBOX;
ogre.movetype = MOVETYPE_STEP;
ogre.takedamage = DAMAGE_YES;
setmodel (ogre, "progs/ogre.mdl");
setsize (ogre, '-20 -20 -24', '20 20 36');
setsize (self, '-16 -16 -24', '16 16 48');
ogre.classname = "body";
ogre.netname = "dead";
ogre.health = 180;
@ -856,30 +1046,44 @@ void (vector stuff, vector ang) spawn_live_ogre =
ogre.max_health = ogre.health;
ogre.th_pain = mutant_pain;
ogre.think = mutant_pain;
ogre.th_die = corpse_gib;
ogre.nextthink = time + 0.05;
};
void () ogre_die =
{
if (self.enemy.classname == "player")
self.enemy.frags = self.enemy.frags + 1;
if (self.health <= -35)
if (random()<0.75)
DropMoney();
if (random()<0.50)
DropMoney();
if (random()<0.25)
DropMoney();
sound (self, CHAN_VOICE, "ogre/ogdth.wav", PLAT_LOW_TRIGGER, ATTN_IDLE);
/*
spawn_live_ogre(self.origin, self.angles);
remove(self);*/
self.solid = SOLID_NOT;
if (self.frame == 69)
{
self.solid = SOLID_NOT;
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
ThrowGib ("progs/zom_gib.mdl", -30);
ThrowGib ("progs/zom_gib.mdl", -35);
ogre_bdie1 ();
self.health = 180;
self.frame = 70;
self.think = ogre_die1;
self.nextthink = time + 0.05;
}
else
{
self.solid = SOLID_NOT;
spawn_live_ogre(self.origin, self.angles);
remove(self);
self.health = 180;
ThrowGib ("progs/zom_gib.mdl", -40);
self.frame = 69;
self.think = ogre_bdie1;
self.nextthink = time + 0.05;
}
sound (self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM);
};
void () ogre_melee =
@ -896,6 +1100,11 @@ void () ogre_melee =
void () monster_ogre =
{
if (self.zone == 0)
{
load_monster();
return;
}
precache_model ("progs/ogre.mdl");
precache_model ("progs/h_ogre.mdl");
precache_model ("progs/grenade.mdl");
@ -906,24 +1115,36 @@ void () monster_ogre =
precache_sound ("ogre/ogpain1.wav");
precache_sound ("ogre/ogsawatk.wav");
precache_sound ("ogre/ogwake.wav");
self.weapon = 1;//ak47
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/ogre.mdl");
self.netname = "mutant";
self.classname = "monster";
setsize (self, '-24 -24 -24', '24 24 48');
self.health = 280;
setsize (self, '-16 -16 -24', '16 16 48');
self.health = 200;
self.team = 3;
self.armorvalue = 0;
self.islot3 = SlotVal(IID_ARM_SHIRT, 1);
self.armornoise = "misc/thud.wav";
self.th_stand = ogre_stand1;
self.th_walk = ogre_walk1;
self.th_run = ogre_run1;
self.th_die = ogre_die;
self.th_melee = ogre_melee;
self.th_missile = ogre_nail1;
self.th_pain = ogre_pain;
self.armortype = 0;
if (self.weapon == 1)
self.th_missile = ogre_naila;
else if (self.weapon == 2)
self.th_missile = ogre_nail1;
self.mag1 = 30;
self.maxmag1 = 30;
self.weapon = ceil(random()*3);
walkmonster_start ();
};

View file

@ -3,6 +3,85 @@ void () make_bubbles;
void () bubble_remove;
void () PlayerDead;
void () player_diea1;
void () player_walk;
void () player_slow;
$cd /raid/quake/id1/models/enforcer
$origin 0 -6 24
$base base
$skin skin
void() corpse_gib =
{
self.solid = SOLID_NOT;
};
//
// running
//
$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6
$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6
//
// standing
//
$frame stand1 stand2 stand3 stand4 stand5
$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6
$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12
//
// pain
//
$frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6
$frame pain1 pain2 pain3 pain4 pain5 pain6
//
// death
//
$frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6
$frame axdeth7 axdeth8 axdeth9
$frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8
$frame deatha9 deatha10 deatha11
$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8
$frame deathb9
$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8
$frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15
$frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7
$frame deathd8 deathd9
$frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7
$frame deathe8 deathe9
//
// attacks
//
$frame nailatt1 nailatt2
$frame light1 light2
$frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6
$frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6
$frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6
$frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6
$frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6
$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
void () player_duck = [ 45, player_run ]
{
@ -12,6 +91,153 @@ void () player_lay = [ 45, player_run ]
{
};
void () player_single_shot = [ 89, player_single_shot2 ]{};
void () player_single_shot2 = [ 90, player_run ]{};
void () player_single_shot_duck = [ 183, player_single_shot_duck2 ]{};
void () player_single_shot_duck2 = [ 184, player_run ]{};
void() idle_frames =
{
local float weap;
local string x;
self.weaponframe = 0;
return;
};
void() army_radio1;
void (vector org) spawn_tracer;
void (float db) loud_noise =
{
//db is loudness factor
//10 is low and 50 is high
//10 would be a footstep
//50 would be a gunshot
local vector dir, start, org;
local entity te;
local string z, dt;
local float x, y, d, t, v, md;
if (db >= 50)//big rifles and guns can be heard through thick walls
md = 3;
else if (db >= 30)//things like SMGs and pistols, a little less
md = 2;
else if (db >= 15)//miscellaneous, richochets, silenced guns
md = 1;
else//very quiet things cannot be heard through doors
md = 0;
te = findradius(self.origin, db*40);
while (te)
{
if (te.classname == "monster" && te.enemy.classname != "player")
{
dir = normalize(te.origin - self.origin);
v = vlen(te.origin - self.origin);
t = 32;
d = 0;
while (t < v)
{
start = (self.origin + (dir*t));
if (pointcontents (start) == CONTENT_SOLID)
d = d + 1;
//spawn_tracer(start);
t = t + 32;
}
if (x < db*20 && d <= md)
{
te.enemy = self;
te.think = HuntTarget;
te.nextthink = time + 0.25;
te.alert = 20;
if (world.map_obj == OBJ_SHADOW && self.has_radio == 1)
{
spawn_excla(self, 8);
bprint(2, self.netname);
bprint(2, " is calling for help! silence him!\n");
self.rtime = 0;
army_radio1();
return;
}
}
else
te.alert = 20;
}
te = te.chain;
}
traceline (self.origin, te.origin, FALSE, self);
if (trace_fraction == 1.0)
return;
};
void (float db) monster_noise =
{
//db is loudness factor
//10 is low and 50 is high
//10 would be a footstep
//50 would be a gunshot
local vector dir, start, org;
local entity te;
local string z, dt;
local float x, y, d, t, v, md;
if (db >= 50)
md = 3;
else if (db >= 30)
md = 2;
else if (db >= 15)
md = 1;
else
md = 0;
te = findradius(self.origin, db*40);
while (te)
{
if (te.classname == "monster" && te.enemy.classname == "world")
{
dir = normalize(te.origin - self.origin);
v = vlen(te.origin - self.origin);
t = 32;
d = 0;
while (t < v)
{
start = (self.origin + (dir*t));
if (pointcontents (start) == CONTENT_SOLID)
d = d + 1;
t = t + 32;
}
}
te = te.chain;
}
traceline (self.origin, te.origin, FALSE, self);
if (trace_fraction == 1.0)
return;
};
void () Footstep =
{
local float rand;
@ -22,13 +248,17 @@ void () Footstep =
if (self.sneak != 0)
return;
if (self.perk == 5)
if (getperk(6))
r = 0.5;
else
{
r = 1;
if (random()*4<=1)
self.show_hostile = time + 0.1;
if (self.classname == "player")
{
if (getperk(6))
loud_noise(10);
else
loud_noise(20);
}
if (world.worldtype == 1 || world.worldtype == 2)
@ -63,8 +293,8 @@ float (entity guy) holding_melee =
if (iid == IID_NONE ||
iid == IID_WP_KNIFE ||
iid == IID_WP_AXE ||
iid == IID_WP_VIBROBLADE ||
iid == IID_WP_POWERAXE)
iid == IID_WP_SPEAR ||
iid == IID_WP_WRENCH)
return true;
return false;
};
@ -73,7 +303,8 @@ void () player_crouch;
void () player_stand1 = [ 149, player_stand1 ]
{
if (self.rtime < time && self.attack == 0)
self.weaponframe = 0;
idle_frames();
if (self.position == 1)
{
@ -94,7 +325,7 @@ void () player_stand1 = [ 149, player_stand1 ]
player_run ();
return;
}
if (self.walkframe >= 5)
if (self.walkframe >= 4)
self.walkframe = 0;
self.frame = 149 + self.walkframe;
@ -119,12 +350,15 @@ void () player_crouch = [ 45, player_run ]
return;
}
}
self.frame = (36 + self.walkframe);
if ((self.walkframe >= TE_TELEPORT))
{
self.walkframe = MULTICAST_ALL;
}
self.walkframe = (self.walkframe + WEAPON_SHOTGUN);
idle_frames();
self.frame = (35 + self.walkframe);
if (self.walkframe == 11)
self.walkframe = 0;
self.walkframe = (self.walkframe + 1);
};
void () player_climb = [ 23, player_run ]
@ -145,14 +379,17 @@ void () player_climb = [ 23, player_run ]
void () player_run = [ 137, player_run ]
{
if (self.rtime < time)
self.weaponframe = 0;
if (self.rtime <= time)
idle_frames();
if (self.equipment_slot)
if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_CLIMBINGGEAR)
{
player_climb();
return;
if (self.gravity == 0)
{
player_climb();
return;
}
}
if ((!self.velocity_x && !self.velocity_y))
@ -173,17 +410,150 @@ void () player_run = [ 137, player_run ]
return;
}
}
if (self.walkframe == 1 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0)
if (self.speedmulti <= 0.60)
{
player_slow ();
return;
}
else if (self.speedmulti <= 0.80)
{
player_walk ();
return;
}
if (self.walkframe == 2 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0)
Footstep ();
if (self.walkframe == 5 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0)
Footstep ();
if (self.walkframe == 4 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0)
idle_frames();
self.frame = (137 + self.walkframe*2);
self.walkframe = self.walkframe + 1;
if (self.walkframe == 6)
self.walkframe = 0;
};
void () player_walk = [ 170, player_walk ]
{
if (self.rtime <= time)
self.weaponframe = 0;
if (self.equipment_slot)
if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_CLIMBINGGEAR)
{
if (self.gravity == 0)
{
player_climb();
return;
}
}
if (!self.velocity_x && !self.velocity_y)
{
player_stand1 ();
return;
}
if (self.position == 1)
{
player_crouch ();
return;
}
else
{
if (self.position == 2)
{
player_lay ();
return;
}
}
if (self.speedmulti > 0.80)
{
player_run ();
return;
}
else if (self.speedmulti <= 0.60)
{
player_slow ();
return;
}
if (self.walkframe == 3 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0)
Footstep ();
if (self.walkframe == 7 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0)
if (self.walkframe == 8 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0)
Footstep ();
self.frame = (137 + self.walkframe);
if (self.walkframe >= 9)
idle_frames();
self.frame = (170 + self.walkframe);
if (self.walkframe == 11)
self.walkframe = 0;
self.walkframe = (self.walkframe + 1);
};
void () player_slow = [ 170, player_slow ]
{
if (self.rtime <= time)
self.weaponframe = 0;
if (self.equipment_slot)
if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_CLIMBINGGEAR)
{
if (self.gravity == 0)
{
player_climb();
return;
}
}
if (!self.velocity_x && !self.velocity_y)
{
player_stand1 ();
return;
}
if (self.position == 1)
{
player_crouch ();
return;
}
else
{
if (self.position == 2)
{
player_lay ();
return;
}
}
if (self.speedmulti > 0.80)
{
player_run ();
return;
}
else if (self.speedmulti > 0.60)
{
player_walk ();
return;
}
if (self.walkframe == 6 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0)
Footstep ();
if (self.walkframe == 18 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0)
Footstep ();
idle_frames();
self.frame = (170 + floor(self.walkframe/2));
if (self.walkframe == 22)
self.walkframe = 0;
self.walkframe = (self.walkframe + 1);
@ -449,6 +819,17 @@ void () player_jump8 = [ 49, player_jump9 ]
void () player_jump9 = [ 48, player_run ]
{
};
void() player_singlex = [89, player_singlex2 ] {muzzleflash();};
void() player_singlex2 = [89, player_run ] {muzzleflash();};
void() player_singley = [90, player_singley2 ] {muzzleflash();};
void() player_singley2 = [90, player_run ] {muzzleflash();};
void() player_auto_duck1 = [182, player_auto_duck2 ] {muzzleflash();};
void() player_auto_duck2 = [182, player_run ] {muzzleflash();};
void() player_auto_ducka1 = [183, player_auto_ducka2 ] {muzzleflash();};
void() player_auto_ducka2 = [183, player_run ] {muzzleflash();};
void () player_single1_left = [ 88, player_single2_left ]
{
@ -530,12 +911,13 @@ void () player_shotty4 = [ 91, player_run ]
void () player_pull1 = [ 155, player_pull2 ]
{
self.weaponframe = WEAPON_SHOTGUN;
self.weaponframe = 1;
};
void () player_pull2 = [ 156, player_pull3 ]
{
self.weaponframe = WEAPON_ROCKET;
self.weaponframe = 2;
sound (self, CHAN_WEAPON, "weapons/gpull.wav", WEAPON_SHOTGUN, ATTN_IDLE);
};
void () player_pull3 = [ 157, player_pull4 ]
@ -556,7 +938,6 @@ void () player_pull5 = [ 157, player_pull6 ]
void () player_pull6 = [ 156, player_pull7 ]
{
self.weaponframe = TE_LIGHTNING2;
sound (self, CHAN_WEAPON, "weapons/gpull.wav", WEAPON_SHOTGUN, ATTN_IDLE);
};
void () player_pull7 = [ 155, player_pull8 ]
@ -580,81 +961,33 @@ void () player_pull10 = [ 155, player_pull11 ]
self.weaponframe = 10;
};
void () player_pull11 = [ 155, player_run ]
void () player_pull11 = [ 155, player_throw1 ]
{
self.weaponframe = 11;
};
void () player_throw1 = [ 155, player_throw2 ]
{
if (self.attack_finished > time)
return;
self.attack_finished = time + 1;
self.weaponframe = 12;
self.weaponframe = 13;
if (((random () * WEAPON_BIG) <= WEAPON_SPIKES))
sound (self, CHAN_VOICE, "radio/grenade.wav", 0.7, ATTN_NORM);
else
sound (self, CHAN_VOICE, "radio/lookout.wav", 0.7, ATTN_NORM);
};
void () player_throw2 = [ 156, player_throw3 ]
void () player_throw2 = [ 156, player_run ]
{
self.weaponframe = TE_LIGHTNINGBLOOD;
self.weaponframe = 14;
if (self.grenslot == 0)
self.grenslot = self.current_slot;
FireHandGrenade ();
self.attack_finished = time + 1;
};
void () player_throw3 = [ 157, player_throw4 ]
{
self.weaponframe = IDLE2A;
self.attack_finished = time + 1;
};
void () player_throw4 = [ 158, player_throw5 ]
{
self.weaponframe = IDLE3A;
self.attack_finished = time + 1;
};
void () player_throw5 = [ 157, player_throw6 ]
{
self.weaponframe = EF_FLAG1;
self.attack_finished = time + 1;
};
void () player_throw6 = [ 156, player_throw7 ]
{
self.weaponframe = IDLE5A;
self.attack_finished = time + 1;
};
void () player_throw7 = [ 155, player_throw8 ]
{
self.weaponframe = IDLE6A;
self.attack_finished = time + 1;
};
void () player_throw8 = [ 159, player_throw9 ]
{
self.weaponframe = IDLE7A;
self.attack_finished = time + 1;
};
void () player_throw9 = [ 160, player_throw10 ]
{
self.weaponframe = IDLE8A;
self.attack_finished = time + 1;
};
void () player_throw10 = [ 161, player_throw11 ]
{
self.weaponframe = IDLE9A;
self.attack_finished = time + 1;
};
void () player_throw11 = [ 162, player_run ]
{
self.weaponframe = IDLE10A;
self.attack_finished = self.nextthink;
W_SetCurrentAmmo();
};
@ -678,36 +1011,220 @@ void () player_shotty4b = [ 184, player_run ]
self.weaponframe = WEAPON_ROCKET;
};
void () player_knife1 = [ 155, player_knife2 ]
void () player_punch1 = [ 155, player_run ]
{
self.weaponframe = WEAPON_SHOTGUN;
self.weaponframe = 1;
W_FireMelee ();
};
void () player_knife2 = [ 156, player_knife3 ]
void () player_punch2 = [ 156, player_run ]
{
self.weaponframe = WEAPON_ROCKET;
self.weaponframe = 2;
W_FireMelee ();
};
void () player_knife3 = [ 157, player_run ]
{
self.weaponframe = AS_MELEE;
};
void () player_knifea = [ 155, player_knifeb ]
void () player_swing1 = [ 155, player_run ]
{
self.weaponframe = WEAPON_SPIKES;
};
void () player_knifeb = [ 156, player_knifec ]
{
self.weaponframe = MULTICAST_PVS_R;
self.attack_finished = time + 0.30;
self.weaponframe = 1;
W_FireMelee ();
};
void () player_knifec = [ 157, player_run ]
void () player_swing1a = [ 155, player_run ]
{
self.weaponframe = TE_LIGHTNING2;
self.attack_finished = time + 0.30;
self.weaponframe = 2;
W_FireMelee ();
};
void () player_kick1 = [ 155, player_kick2 ]
{
self.attack_finished = time + 0.40;
self.weaponframe = 7;
};
void () player_kick2 = [ 156, player_kick3 ]
{
self.weaponframe = 8;
W_FireMelee ();
W_FireMelee ();
};
void () player_kick3 = [ 157, player_run ]
{
self.weaponframe = 9;
};
void () player_kick1a = [ 155, player_kick2a ]
{
self.attack_finished = time + 0.40;
self.weaponframe = 10;
};
void () player_kick2a = [ 156, player_kick3a ]
{
self.weaponframe = 11;
W_FireMelee ();
W_FireMelee ();
};
void () player_kick3a = [ 157, player_run ]
{
self.weaponframe = 12;
};
void () player_kick1b = [ 155, player_kick2b ]
{
self.attack_finished = time + 1;
self.weaponframe = 10;
};
void () player_kick2b = [ 156, player_kick3b ]
{
self.weaponframe = 10;
};
void () player_kick3b = [ 155, player_kick4b ]
{
self.weaponframe = 11;
W_FireMelee ();
W_FireMelee ();
};
void () player_kick4b = [ 156, player_kick5b ]
{
self.weaponframe = 11;
W_FireMelee ();
W_FireMelee ();
};
void () player_kick5b = [ 155, player_kick6b ]
{
self.weaponframe = 12;
W_FireMelee ();
W_FireMelee ();
};
void () player_kick6b = [ 156, player_run ]
{
W_FireMelee ();
W_FireMelee ();
self.attack_finished = time + 1;
self.weaponframe = 12;
};
void () player_dragon_kick =
{
self.velocity = self.velocity * 1.50;
self.velocity_x = self.velocity_x * 1.50;
self.velocity_y = self.velocity_y * 1.50;
self.recoil = 30;
player_kick1b();
};
void () player_knife1 = [ 91, player_knife2 ]
{
self.weaponframe = 5;
};
void () player_knife2 = [ 92, player_knife3]
{
self.weaponframe = 6;
};
void () player_knife3 = [ 93, player_run ]
{
self.weaponframe = 7;
W_FireMelee ();
};
void () player_spear1 = [ 89, player_spear2 ]
{
self.weaponframe = 5;
};
void () player_spear2 = [ 90, player_spear3 ]
{
self.weaponframe = 6;
};
void () player_spear3 = [ 89, player_run ]
{
self.weaponframe = 7;
W_FireMelee ();
};
void () player_spear1a = [ 89, player_spear2a ]
{
self.weaponframe = 5;
};
void () player_spear2a = [ 90, player_spear3a ]
{
self.weaponframe = 6;
};
void () player_spear3a = [ 89, player_run ]
{
self.weaponframe = 7;
W_FireMelee ();
};
void () player_knifea = [ 91, player_knifeb ]
{
self.weaponframe = 8;
};
void () player_knifeb = [ 92, player_knifec ]
{
self.weaponframe = 9;
};
void () player_knifec = [ 93, player_run ]
{
self.weaponframe = 10;
W_FireMelee ();
};
void () player_axe1 = [ 89, player_axe2 ]
{
self.weaponframe = 1;
};
void () player_axe2 = [ 89, player_axe3 ]
{
self.weaponframe = 1;
};
void () player_axe3 = [ 90, player_axe4 ]
{
sound (self, CHAN_WEAPON, "effects/axe_swing.wav", TRUE, ATTN_NORM);
self.weaponframe = 2;
};
void () player_axe4 = [ 90, player_axe5 ]
{
self.weaponframe = 3;
W_FireMelee ();
};
void () player_axe5 = [ 89, player_run ]
{
self.weaponframe = 7;
};
void () player_axeb1 = [ 89, player_axeb2 ]
{
self.weaponframe = 4;
};
void () player_axeb2 = [ 89, player_axeb3 ]
{
self.weaponframe = 4;
};
void () player_axeb3 = [ 90, player_axeb4 ]
{
sound (self, CHAN_WEAPON, "effects/axe_swing.wav", TRUE, ATTN_NORM);
self.weaponframe = 5;
};
void () player_axeb4 = [ 90, player_axeb5 ]
{
self.weaponframe = 6;
W_FireMelee ();
};
void () player_axeb5 = [ 89, player_run ]
{
self.weaponframe = 8;
};
void () player_nail1 = [ 88, player_nail2 ]
@ -877,16 +1394,24 @@ void () player_pain6 = [ 19, player_run ]
void () player_pain =
{
self.pain_finished = time + 0.1;
self.missionbrief = 6;
if (self.pain_finished > time)
{
sound (self, CHAN_VOICE, self.armornoise, 1, ATTN_NORM);
return;
}
self.pain_finished = time + 0.5;
if ((self.health <= 40) && (getperk(9)) && (random()<=0.10))
{
sprint(self, 2, "THE ZONE!\n");
self.rage = 255;
self.ragetime = 10;
}
if (self.weaponframe)
return;
self.pain_finished = time + 0.1;
if (random () * WEAPON_BIG < WEAPON_SPIKES)
sound (self, CHAN_VOICE, "player/paina.wav", WEAPON_SHOTGUN, ATTN_NORM);
@ -897,9 +1422,14 @@ void () player_pain =
if (self.invisible_finished > time)
return;
self.maxspeed = (self.maxspeed * 0.6);
if (getperk(1))
self.maxspeed = (self.maxspeed * 0.9);
else
self.maxspeed = (self.maxspeed * 0.6);
player_pain1 ();
};
void () player_dieb1;
void () player_diec1;
@ -1144,42 +1674,23 @@ void () PlayerDie =
local float i;
local float r;
//self.solid = SOLID_NOT;
self.dead = self.dead + 1;
if ((self.deathtype == "fall"))
{
sound (self, CHAN_VOICE, "player/agdie4.wav", WEAPON_SHOTGUN, ATTN_NONE);
self.deathtype = "";
}
if ((self.waterlevel == AS_MELEE))
{
DeathBubbles (IDLE8A);
sound (self, CHAN_VOICE, "player/drown2.wav", WEAPON_SHOTGUN, ATTN_NONE);
}
r = random ();
self.noise = "player/agdie2.wav";
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
self.items = (self.items - (self.items & IT_INVISIBILITY));
self.invisible_finished = MULTICAST_ALL;
self.invincible_finished = MULTICAST_ALL;
self.super_damage_finished = MULTICAST_ALL;
self.radsuit_finished = MULTICAST_ALL;
self.invisible_finished = 0;
self.invincible_finished = 0;
self.super_damage_finished = 0;
self.radsuit_finished = 0;
self.modelindex = modelindex_player;
self.weaponmodel = "";
self.view_ofs = '0 0 -8';
self.deadflag = DEAD_DYING;
self.flags = (self.flags - (self.flags & FL_ONGROUND));
self.movetype = MOVETYPE_TOSS;
if ((self.velocity_z < TE_LAVASPLASH))
{
self.velocity_z = (self.velocity_z + (random () * 300));
}
self.angles_x = 0;
self.angles_y = 0;
self.movetype = MOVETYPE_WALK;
self.angles_z = 0;
i = (WEAPON_SHOTGUN + floor ((random () * WEAPON_ROCKET)));
self.angles_z = MULTICAST_ALL;
if (self.position == 1 || self.position == 2)
player_diec1 ();
else

View file

@ -31,11 +31,13 @@ boss.qc
knight.qc
hknight.qc
shalrath.qc
shambler.qc
wizard.qc
shambler.qc
dog.qc
ogre.qc
misc.qc
tarbaby.qc
mod_buy.qc
turrets.qc
cmds.qc
cmds.qc
fish.qc

View file

@ -1,5 +1,4 @@
void() monster_tarbaby = {remove(self);};
void() monster_oldone = {remove(self);};
void() event_lightning = {remove(self);};

View file

@ -175,28 +175,36 @@ void() ShalMissileTouch =
if (other == self.owner)
return; // don't explode on owner
if (other.classname == "monster_zombie")
T_Damage (other, self, self, 110);
T_RadiusDamage (self, self.owner, 40, world, "vore");
sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
self.velocity = '0 0 0';
self.touch = SUB_Null;
setmodel (self, "progs/s_explod.spr");
self.solid = SOLID_NOT;
Explosion(2);
if (random()<0.1)
{
other.islot3 = SlotVal(IID_ARM_LEATHER, 1);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_TAREXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
T_Damage (other, self, self, 25+random()*25);
other.hold = 20;
remove(self);
}
else
{
T_Damage (other, self, self, 25+random()*25);
te_smallflash(other.origin);
remove(self);
}
};
//=================================================================
void() monster_shalrath =
{
if (self.zone == 0)
{
load_monster();
return;
}
precache_model2 ("progs/shalrath.mdl");
precache_model2 ("progs/h_shal.mdl");
precache_model2 ("progs/v_spike.mdl");
@ -213,10 +221,9 @@ void() monster_shalrath =
setmodel (self, "progs/shalrath.mdl");
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
self.health = 800;
self.health = 300;
self.team = 3;
self.islot3 = 11; //vore armor
self.armortype = 0.1;
self.islot3 = SlotVal(IID_ARM_FORCE, 1);
self.helmet = 1;
self.classname = "monster";
self.netname = "experiment";

View file

@ -105,7 +105,7 @@ local float ldmg;
if (!CanDamage (self.enemy, self))
return;
ldmg = (random() + random() + random()) * 40;
ldmg = 40*random()*10*random()*10;
T_Damage (self.enemy, self, self, ldmg);
sound (self, CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM);
@ -179,9 +179,9 @@ void() sham_melee =
local float chance;
chance = random();
if (chance > 0.6 || self.health == 600)
if (self.class == 3)
sham_smash1 ();
else if (chance > 0.3)
else if (self.class == 5 && chance > 0.3)
sham_swingr1 ();
else
sham_swingl1 ();
@ -213,12 +213,190 @@ void() CastLightning =
WriteCoord (MSG_BROADCAST, trace_endpos_y);
WriteCoord (MSG_BROADCAST, trace_endpos_z);
LightningDamage (org, trace_endpos, self, 10);
LightningDamage (org, trace_endpos, self, 5+random()*10);
};
void() sham_magic1 =[ $magic1, sham_magic2 ] {ai_face();
sound (self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM);
void (vector spot) summon_wizard =
{
local entity wiz;
local entity te;
wiz = spawn ();
self = wiz;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/wizard.mdl");
setsize (self, '-8 -8 -12', '8 8 20');
self.scale = 0.5;
self.health = 90;
self.netname = "floater";
self.max_health = self.health;
self.th_stand = wiz_stand1;
self.th_walk = wiz_walk1;
self.th_run = wiz_run1;
self.th_missile = Wiz_Missile;
self.th_pain = Wiz_Pain;
self.th_die = wiz_die;
self.flags = self.flags | FL_FLY;
self.flags = self.flags | FL_MONSTER;
self.origin = spot;
if (!walkmove(0, 0))
{
self.origin = spot + '0 -64 0';
if (!walkmove(0, 0))
{
self.origin = spot + '64 0 0';
if (!walkmove(0, 0))
{
self.origin = spot + '-64 0 0';
if (!walkmove(0, 0))
{
remove(self);
return;
}
}
}
}
te = findradius (self.origin, 30);
while (te)
{
if (te.classname == "player" || te.classname == "monster" && te.health > 0)
{
remove(self);
return;
}
te = te.chain;
}
te_smallflash(self.origin);
self.classname = "monster";
flymonster_start_go ();
};
void() shambler_summon_magic =
{
local vector point;
local entity wiz;
makevectors (self.v_angle);
point = self.origin + '0 0 64' + v_up*crandom()*128 + v_right*crandom()*128;
summon_wizard(point);
if (random()<0.75)
summon_wizard(point);
if (random()<0.75)
summon_wizard(point);
};
void() sham_heal1;
void() sham_magic1;
void() sham_summon1;
void () sham_cast_magic =
{
local entity te;
local string cast_type;
local vector org;
self.heal_ent = world;
te = findradius (self.origin, 600);
while (te)
{
if (te.classname == "monster")
{
if (te.health < te.max_health*0.5)
{
self.heal_ent = te;
}
}
te = te.chain;
}
if (self.heal_ent.classname == "monster" && random()<0.8)
{
org = self.origin + '0 0 32';
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_WIZSPIKE);
WriteCoord (MSG_MULTICAST, org_x);
WriteCoord (MSG_MULTICAST, org_y);
WriteCoord (MSG_MULTICAST, org_z);
multicast (self.origin, MULTICAST_PHS);
sham_heal1();
sound (self, CHAN_WEAPON, "shambler/heal.wav", 1, ATTN_NORM);
te_smallflash(self.origin);
return;
}
else if (random()<0.25)
{
sham_summon1();
sound (self, CHAN_WEAPON, "shambler/summon.wav", 1, ATTN_NORM);
}
else
sham_magic1();
};
void() sham_summon1 =[ $magic1, sham_summon2 ] {ai_face();};
void() sham_summon2 =[ $magic1, sham_summon3 ] {ai_face();};
void() sham_summon3 =[ $magic1, sham_summon4 ] {ai_face();};
void() sham_summon4 =[ $magic1, sham_summon5 ] {ai_face();};
void() sham_summon5 =[ $magic1, sham_summon6 ] {ai_face();};
void() sham_summon6 =[ $magic2, sham_summon7 ] {ai_face();};
void() sham_summon7 =[ $magic2, sham_summon8 ] {ai_face();};
void() sham_summon8 =[ $magic2, sham_summon9 ] {ai_face();};
void() sham_summon9 =[ $magic2, sham_summon10 ] {ai_face();};
void() sham_summon10 =[ $magic2, sham_summon11 ] {ai_face();};
void() sham_summon11 =[ $magic3, sham_summon12 ] {ai_face();};
void() sham_summon12 =[ $magic3, sham_summon13 ] {ai_face();};
void() sham_summon13 =[ $magic3, sham_summon14 ] {ai_face();};
void() sham_summon14 =[ $magic3, sham_summon15 ] {ai_face();};
void() sham_summon15 =[ $magic3, sham_summon16 ] {ai_face();};
void() sham_summon16 =[ $magic4, sham_summon17 ] {ai_face();};
void() sham_summon17 =[ $magic4, sham_summon18 ] {ai_face();};
void() sham_summon18 =[ $magic4, sham_summon19 ] {ai_face();};
void() sham_summon19 =[ $magic4, sham_summon20 ] {ai_face();
shambler_summon_magic();
};
void() sham_summon20 =[ $magic4, sham_run1 ] {ai_face();};
void() sham_heal1 =[ $magic1, sham_heal2 ] {ai_face();};
void() sham_heal2 =[ $magic2, sham_heal3 ] {ai_face();};
void() sham_heal3 =[ $magic3, sham_heal4 ] {ai_face();};
void() sham_heal4 =[ $magic4, sham_heal5 ] {ai_face();};
void() sham_heal5 =[ $magic5, sham_heal6 ] {ai_face();
if (self.heal_ent.classname == "monster")
{
self.heal_ent.health = self.heal_ent.health + 200;
if (self.heal_ent.health > self.heal_ent.max_health)
self.heal_ent.health = self.heal_ent.max_health;
self.heal_ent = world;
te_smallflash(self.heal_ent.origin);
}
};
void() sham_heal6 =[ $magic1, sham_run1 ] {ai_face();};
void() sham_magic1 =[ $magic1, sham_magic2 ] {ai_face();
sound (self, CHAN_WEAPON, "shambler/sboom.wav", 1, ATTN_NORM);
};
void() sham_magic2 =[ $magic2, sham_magic3 ] {ai_face();};
void() sham_magic3 =[ $magic3, sham_magic4 ] {ai_face();self.nextthink = self.nextthink + 0.2;
local entity o;
@ -277,6 +455,7 @@ void(entity attacker, float damage) sham_pain =
if (self.pain_finished > time)
return;
self.pain_finished = time + 2;
sham_pain1 ();
@ -299,15 +478,13 @@ void() sham_death11 =[ $death11, sham_death11 ] {};
void() sham_die =
{
// check for gib
// check for gurgling death sound
if (self.health < -60)
{
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
ThrowHead ("progs/h_shams.mdl", self.health);
ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib2.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health);
return;
}
// regular death
@ -319,11 +496,12 @@ void() sham_die =
void() monster_shambler =
{
if (deathmatch)
if (self.zone == 0)
{
remove(self);
load_monster();
return;
}
precache_model ("progs/shambler.mdl");
precache_model ("progs/s_light.mdl");
precache_model ("progs/h_shams.mdl");
@ -338,21 +516,46 @@ void() monster_shambler =
precache_sound ("shambler/melee1.wav");
precache_sound ("shambler/melee2.wav");
precache_sound ("shambler/smack.wav");
precache_sound ("shambler/heal.wav");
precache_sound ("shambler/summon.wav");
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/shambler.mdl");
if (random() < 0.001)//shambler warrior
{
self.class = 3;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/shambler.mdl");
self.classname = "monster";
self.netname = "shambler warrior";
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
self.health = 2200;
self.islot3 = SlotVal(IID_ARM_FORCE, 1);
self.th_stand = sham_stand1;
self.th_walk = sham_walk1;
self.th_run = sham_run1;
self.th_die = sham_die;
self.th_melee = sham_melee;
self.th_pain = sham_pain;
}
else //shambler shaman
{
self.class = 5;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/shambler.mdl");
self.classname = "monster";
self.netname = "shambler shaman";
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
self.health = 1800;
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
self.health = 600;
self.th_stand = sham_stand1;
self.th_walk = sham_walk1;
self.th_run = sham_run1;
self.th_die = sham_die;
self.th_melee = sham_melee;
self.th_missile = sham_cast_magic;
self.th_pain = sham_pain;
}
self.th_stand = sham_stand1;
self.th_walk = sham_walk1;
self.th_run = sham_run1;
self.th_die = sham_die;
self.th_melee = sham_melee;
self.th_missile = sham_magic1;
self.th_pain = sham_pain;
walkmonster_start();
};

File diff suppressed because it is too large Load diff

View file

@ -88,7 +88,10 @@ void() multi_touch =
if (other.classname != "player")
return;
//PERK_ED: light step doesnt trigger trigger_multiple/trigger_once
if (other.perk1 == 6 || other.perk2 == 6)
return;
// if the trigger has an angles field, check player's facing direction
if (self.movedir != '0 0 0')
{
@ -417,7 +420,7 @@ local vector org;
org = t.origin + 32 * v_forward;
spawn_tfog (org);
spawn_tdeath(t.origin, other);
//spawn_tdeath(t.origin, other);
if (self.classname == "player")
{
self.solid = SOLID_NOT;

File diff suppressed because it is too large Load diff

View file

@ -187,15 +187,54 @@ FAST ATTACKS
==============================================================================
*/
void() wizspike_touch =
{
if (other == self.owner)
return;
self.voided = 1;
if (other.solid == SOLID_TRIGGER)
return; // trigger field, do nothing
if (pointcontents(self.origin) == CONTENT_SKY)
{
remove(self);
return;
}
// hit something that bleeds
if (other.takedamage)
{
T_Damage (other, self, self.owner, 12+random()*12);
other.maxspeed = other.maxspeed * 0.25;
}
else
{
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_WIZSPIKE);
WriteCoord (MSG_MULTICAST, self.origin_x);
WriteCoord (MSG_MULTICAST, self.origin_y);
WriteCoord (MSG_MULTICAST, self.origin_z);
multicast (self.origin, MULTICAST_PHS);
}
remove(self);
};
void() Wiz_FastFire =
{
local vector vec;
local vector dst;
local float x, y;
x = random()*24;
if (self.owner.health > 0)
{
makevectors (self.enemy.angles);
dst = self.enemy.origin - 13*self.movedir;
dst = self.enemy.origin - x*self.movedir;
vec = normalize(dst - self.origin);
sound (self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM);
@ -203,6 +242,7 @@ void() Wiz_FastFire =
newmis.velocity = vec*600;
newmis.owner = self.owner;
newmis.classname = "wizspike";
newmis.touch = wizspike_touch;
setmodel (newmis, "progs/w_spike.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
}
@ -244,9 +284,15 @@ void() Wiz_StartFast =
void() Wiz_idlesound =
{
local float wr;
local float wr;
wr = random() * 5;
if (self.takedamage == DAMAGE_NO)
{
remove(self);
return;
}
if (self.waitmin < time)
{
self.waitmin = time + 2;
@ -255,6 +301,7 @@ local float wr;
if (wr < 1.5)
sound (self, CHAN_VOICE, "wizard/widle2.wav", 1, ATTN_IDLE);
}
return;
};
@ -342,15 +389,10 @@ void() wiz_die =
if (self.health < -40)
{
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
ThrowHead ("progs/h_wizard.mdl", -10);
ThrowGib ("progs/gib2.mdl", -10);
ThrowGib ("progs/gib2.mdl", -10);
ThrowGib ("progs/gib2.mdl", -10);
ThrowGib ("progs/gib3.mdl", -10);
ThrowGib ("progs/gib1.mdl", -10);
return;
}
wiz_death1 ();
};
@ -372,6 +414,12 @@ void() Wiz_Missile =
void() monster_wizard =
{
if (self.zone == 0)
{
load_monster();
return;
}
precache_model ("progs/wizard.mdl");
precache_model ("progs/h_wizard.mdl");
precache_model ("progs/w_spike.mdl");
@ -389,8 +437,12 @@ void() monster_wizard =
setmodel (self, "progs/wizard.mdl");
setsize (self, '-16 -16 -24', '16 16 40');
self.health = 150;
setsize (self, '-16 -16 -16', '16 16 40');
self.health = 80;
self.max_health = 80;
self.islot3 = SlotVal(IID_ARM_LEATHER, 1);
self.armornoise = "misc/thud.wav";
self.team = 3;
self.classname = "monster";
self.netname = "floater";
@ -400,7 +452,6 @@ void() monster_wizard =
self.th_missile = Wiz_Missile;
self.th_pain = Wiz_Pain;
self.th_die = wiz_die;
self.armornoise = "misc/thud.wav";
flymonster_start ();
walkmonster_start ();
};

File diff suppressed because it is too large Load diff

View file

@ -81,46 +81,46 @@ void() zombie_cruc4 = [ $cruc_4, zombie_cruc5 ] {self.nextthink = time + 0.1 +
void() zombie_cruc5 = [ $cruc_5, zombie_cruc6 ] {self.nextthink = time + 0.1 + random()*0.1;};
void() zombie_cruc6 = [ $cruc_6, zombie_cruc1 ] {self.nextthink = time + 0.1 + random()*0.1;};
void() zombie_walk1 =[ $walk1, zombie_walk2 ] {ai_walk(0);};
void() zombie_walk2 =[ $walk2, zombie_walk3 ] {ai_walk(2);};
void() zombie_walk1 =[ $walk1, zombie_walk2 ] {ai_walk(3);};
void() zombie_walk2 =[ $walk2, zombie_walk3 ] {ai_walk(3);};
void() zombie_walk3 =[ $walk3, zombie_walk4 ] {ai_walk(3);};
void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(2);};
void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(1);};
void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(0);};
void() zombie_walk7 =[ $walk7, zombie_walk8 ] {ai_walk(0);};
void() zombie_walk8 =[ $walk8, zombie_walk9 ] {ai_walk(0);};
void() zombie_walk9 =[ $walk9, zombie_walk10 ] {ai_walk(0);};
void() zombie_walk10 =[ $walk10, zombie_walk11 ] {ai_walk(0);};
void() zombie_walk11 =[ $walk11, zombie_walk12 ] {ai_walk(2);};
void() zombie_walk12 =[ $walk12, zombie_walk13 ] {ai_walk(2);};
void() zombie_walk13 =[ $walk13, zombie_walk14 ] {ai_walk(1);};
void() zombie_walk14 =[ $walk14, zombie_walk15 ] {ai_walk(0);};
void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(0);};
void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(0);};
void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(0);};
void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(0);};
void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(3);};
void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(3);};
void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(3);};
void() zombie_walk7 =[ $walk7, zombie_walk8 ] {ai_walk(3);};
void() zombie_walk8 =[ $walk8, zombie_walk9 ] {ai_walk(3);};
void() zombie_walk9 =[ $walk9, zombie_walk10 ] {ai_walk(3);};
void() zombie_walk10 =[ $walk10, zombie_walk11 ] {ai_walk(3);};
void() zombie_walk11 =[ $walk11, zombie_walk12 ] {ai_walk(3);};
void() zombie_walk12 =[ $walk12, zombie_walk13 ] {ai_walk(3);};
void() zombie_walk13 =[ $walk13, zombie_walk14 ] {ai_walk(3);};
void() zombie_walk14 =[ $walk14, zombie_walk15 ] {ai_walk(3);};
void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(3);};
void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(3);};
void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(3);};
void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(3);};
void() zombie_walk19 =[ $walk19, zombie_walk1 ] {
ai_walk(0);
ai_walk(6);
if (random() < 0.2)
sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);};
void() zombie_run1 =[ $run1, zombie_run2 ] {ai_run(1);self.inpain = 0;};
void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(1);};
void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(0);};
void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(1);};
void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(2);};
void() zombie_run6 =[ $run6, zombie_run7 ] {ai_run(3);};
void() zombie_run1 =[ $run1, zombie_run2 ] {ai_run(4);self.inpain = 0;};
void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(4);};
void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(4);};
void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(4);};
void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(4);};
void() zombie_run6 =[ $run6, zombie_run7 ] {ai_run(4);};
void() zombie_run7 =[ $run7, zombie_run8 ] {ai_run(4);};
void() zombie_run8 =[ $run8, zombie_run9 ] {ai_run(4);};
void() zombie_run9 =[ $run9, zombie_run10 ] {ai_run(2);};
void() zombie_run10 =[ $run10, zombie_run11 ] {ai_run(0);};
void() zombie_run11 =[ $run11, zombie_run12 ] {ai_run(0);};
void() zombie_run12 =[ $run12, zombie_run13 ] {ai_run(0);};
void() zombie_run13 =[ $run13, zombie_run14 ] {ai_run(2);};
void() zombie_run9 =[ $run9, zombie_run10 ] {ai_run(4);};
void() zombie_run10 =[ $run10, zombie_run11 ] {ai_run(4);};
void() zombie_run11 =[ $run11, zombie_run12 ] {ai_run(4);};
void() zombie_run12 =[ $run12, zombie_run13 ] {ai_run(4);};
void() zombie_run13 =[ $run13, zombie_run14 ] {ai_run(4);};
void() zombie_run14 =[ $run14, zombie_run15 ] {ai_run(4);};
void() zombie_run15 =[ $run15, zombie_run16 ] {ai_run(6);};
void() zombie_run16 =[ $run16, zombie_run17 ] {ai_run(7);};
void() zombie_run17 =[ $run17, zombie_run18 ] {ai_run(3);};
void() zombie_run15 =[ $run15, zombie_run16 ] {ai_run(4);};
void() zombie_run16 =[ $run16, zombie_run17 ] {ai_run(4);};
void() zombie_run17 =[ $run17, zombie_run18 ] {ai_run(4);};
void() zombie_run18 =[ $run18, zombie_run1 ] {
ai_run(8);
if (random() < 0.2)
@ -141,17 +141,35 @@ void() ZombieGrenadeTouch =
{
if (other == self.owner)
return; // don't explode on owner
if (other.netname == "ghoul")
return; // don't explode on owner
if (other.takedamage)
{
T_Damage (other, self, self.owner, 10 );
sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM);
remove (self);
T_Damage (other, self, self.owner, 8+random()*8 );
self.velocity = self.velocity * 0.50;
self.touch = SUB_Null;
self.solid = SOLID_NOT;
return;
}
sound (self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound
self.velocity = '0 0 0';
self.avelocity = '0 0 0';
self.touch = SUB_Remove;
if (random() < 0.5)
sound (self, CHAN_WEAPON, "misc/rock1.wav", 0.5, ATTN_NORM);
else
sound (self, CHAN_WEAPON, "misc/rock2.wav", 0.5, ATTN_NORM);
self.velocity = self.velocity * 0.50;
};
void() Molotov =
{
if (random()<0.75)
return; // don't explode every time
Explosion();
T_RadiusDamage2 (self, self.owner, 25+random()*25, world, 300);
};
/*
@ -162,9 +180,16 @@ ZombieFireGrenade
void(vector st) ZombieFireGrenade =
{
local entity missile;
local vector org;
local vector org, t;
local float fire;
sound (self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM);
if (random()<0.15)
fire = 1;
else
fire = 0;
sound (self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM);
missile = spawn ();
missile.owner = self;
@ -173,24 +198,47 @@ void(vector st) ZombieFireGrenade =
// calc org
org = self.origin + st_x * v_forward + st_y * v_right + (st_z - 24) * v_up;
t = self.enemy.origin;
// set missile speed
makevectors (self.angles);
missile.velocity = normalize(self.enemy.origin - org);
if (self.enemy.sneak > 0)
t = t + v_right*crandom()*128;
missile.velocity = normalize(t - org);
missile.velocity = missile.velocity * 600;
missile.velocity_z = 200;
if ((self.enemy.origin_z - 32) > (self.origin_z))
missile.velocity_z += 128;
else if ((self.enemy.origin_z - 64) > (self.origin_z))
missile.velocity_z += 256;
missile.avelocity = '3000 1000 2000';
missile.touch = ZombieGrenadeTouch;
// set missile duration
missile.nextthink = time + 2.5;
missile.think = SUB_Remove;
if (random()*9 <= 8)
fire = 0;
else
fire = 1;
setmodel (missile, "progs/zom_gib.mdl");
if (fire == 0)
{
// set missile duration
setmodel (missile, "progs/rock.mdl");
missile.nextthink = time + 2.5;
missile.think = SUB_Remove;
}
else if (fire == 1)
{
setmodel (missile, "progs/homemade.mdl");
missile.nextthink = time + 2.5;
missile.think = SUB_Remove;
missile.touch = Molotov;
}
setsize (missile, '0 0 0', '0 0 0');
setorigin (missile, org);
};
@ -238,8 +286,82 @@ void() zombie_attc10 =[ $attc10, zombie_attc11 ] {ai_face();};
void() zombie_attc11 =[ $attc11, zombie_attc12 ] {ai_face();};
void() zombie_attc12 =[ $attc12, zombie_run1 ] {ai_face();ZombieFireGrenade('-12 -19 29');};
void() zombie_claw =
{
local vector delta;
local float ldmg;
if (!self.enemy)
return;
self.goalentity = self.enemy;
ai_charge(10);
if (!CanDamage (self.enemy, self))
return;
delta = self.enemy.origin - self.origin;
if (vlen(delta) > (80))
return;
ldmg = 5+random()*15;
T_Damage (self.enemy, self, self, ldmg);
};
void() zombie_attm1 =[ $attb12, zombie_attm2 ] {ai_face();};
void() zombie_attm2 =[ $attb12, zombie_attm3 ] {ai_face();};
void() zombie_attm3 =[ $attb12, zombie_attm4 ] {ai_face();};
void() zombie_attm4 =[ $attb12, zombie_attm5 ] {ai_face();};
void() zombie_attm5 =[ $attb13, zombie_attm6 ] {ai_face();};
void() zombie_attm6 =[ $attb13, zombie_attm7 ] {ai_face();};
void() zombie_attm7 =[ $attb14, zombie_run1 ] {ai_face();
zombie_claw();
};
void() zombie_attn1 =[ $attc11, zombie_attn2 ] {ai_face();};
void() zombie_attn2 =[ $attc11, zombie_attn3 ] {ai_face();};
void() zombie_attn3 =[ $attc11, zombie_attn4 ] {ai_face();};
void() zombie_attn4 =[ $attc12, zombie_attn5 ] {ai_face();};
void() zombie_attn5 =[ $attc12, zombie_attn6 ] {ai_face();};
void() zombie_attn6 =[ $attc12, zombie_attn7 ] {ai_face();};
void() zombie_attn7 =[ $attc12, zombie_run1 ] {ai_face();
zombie_claw();
};
void() zombie_melee =
{
local float r;
r = random();
if (r < 0.5)
{
sound (self, CHAN_WEAPON, "effects/axe_swing.wav", 1, ATTN_NORM);
zombie_attm1 ();
}
else
{
sound (self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM);
zombie_attn1 ();
}
};
void() zombie_missile =
{
local float x;
x = vlen(self.origin - self.enemy.origin);
if (x > 400)
return;
local float r;
r = random();
@ -338,7 +460,6 @@ void() zombie_paind13 =[ $paind13, zombie_run1 ] {};
void() zombie_paine1 =[ $paine1, zombie_paine2 ] {
sound (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);
self.health = 60;
};
void() zombie_paine2 =[ $paine2, zombie_paine3 ] {ai_pain(8);};
void() zombie_paine3 =[ $paine3, zombie_paine4 ] {ai_pain(5);};
@ -355,7 +476,6 @@ self.solid = SOLID_NOT;
void() zombie_paine11 =[ $paine11, zombie_paine12 ] {self.nextthink = self.nextthink + 5;self.health = 60;};
void() zombie_paine12 =[ $paine12, zombie_paine13 ]{
// see if ok to stand up
self.health = 60;
sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);
self.solid = SOLID_SLIDEBOX;
if (!walkmove (0, 0))
@ -384,16 +504,112 @@ void() zombie_paine28 =[ $paine28, zombie_paine29 ] {ai_pain(1);};
void() zombie_paine29 =[ $paine29, zombie_paine30 ] {};
void() zombie_paine30 =[ $paine30, zombie_run1 ] {};
void() zdie1 =[ $painb1, zdie2 ] {};
void() zdie2 =[ $painb2, zdie3 ] {
self.rtime = 1;
setsize (self, '-8 -8 -24', '8 8 -20');
};
void() zdie3 =[ $painb3, zdie4 ] {};
void() zdie4 =[ $painb4, zdie5 ] {};
void() zdie5 =[ $painb5, zdie6 ] {};
void() zdie6 =[ $painb6, zdie7 ] {};
void() zdie7 =[ $painb7, zdie8 ] {};
void() zdie8 =[ $painb8, zdie9 ] {};
void() zdie9 =[ $painb9, zdie10] {};
void() zdie10 =[ $painb10, zdie10] {};
void () zombie_death =
{
if (self.rtime > 0)
{
if (random()*100<50)
sound (self, CHAN_VOICE, "player/headshot.wav", 0.75, ATTN_NORM);
else
sound (self, CHAN_VOICE, "misc/thud.wav", 1, ATTN_NORM);
SpawnBlood (self.origin + '0 0 4', 4);
self.think = SUB_Remove;
self.nextthink = time + 30;
self.health = 180;
return;
}
if (self.frame == 153)
{
self.frame = 152;
self.health = 180;
self.think = zdie1;
self.nextthink = time + 0.12;
}
else
{
ThrowGib ("progs/zom_gib.mdl", -40);
self.frame = 153;
self.health = 180;
self.think = zdie1;
self.nextthink = time + 0.12;
}
self.attack = self.attack + 1;
};
void (vector stuff, vector ang) spawn_live_zombie =
{
local entity zombie;
zombie = spawn ();
zombie.origin = stuff;
zombie.enemy = world;
zombie.attack_finished = time + 10;
zombie.solid = SOLID_SLIDEBOX;
zombie.movetype = MOVETYPE_STEP;
zombie.takedamage = DAMAGE_YES;
setmodel (zombie, "progs/ghoul.mdl");
setsize (zombie, '-8 -8 -24', '8 8 24');
zombie.classname = "body";
zombie.netname = "dead";
zombie.health = 180;
zombie.angles = ang;
zombie.max_health = zombie.health;
zombie.th_pain = zombie_death;
zombie.think = zombie_death;
zombie.th_die = corpse_gib;
zombie.nextthink = time + 0.12;
};
void() DropBackpack;
void() zombie_die =
{
sound (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM);
ThrowHead ("progs/h_zombie.mdl", self.health);
ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib2.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health);
local float r;
if (random()<0.25)
DropMoney();
if (random()<0.25)
DropMoney();
r = random();
if (r <= 0.20)
sound (self, CHAN_VOICE, "player/agdie1.wav", 1, ATTN_NORM);
else if (r <= 0.40)
sound (self, CHAN_VOICE, "player/agdie2.wav", 1, ATTN_NORM);
else if (r <= 0.60)
sound (self, CHAN_VOICE, "player/agdie3.wav", 1, ATTN_NORM);
else if (r <= 0.80)
sound (self, CHAN_VOICE, "player/agdie4.wav", 1, ATTN_NORM);
else
sound (self, CHAN_VOICE, "player/agdie5.wav", 1, ATTN_NORM);
spawn_live_zombie(self.origin, self.angles);
remove(self);
return;
};
/*
=================
zombie_pain
@ -416,21 +632,11 @@ void(entity attacker, float take) zombie_pain =
{
local float r;
self.health = 60; // allways reset health
if (take < 9)
return; // totally ignore
if (self.inpain == 2)
return; // down on ground, so don't reset any counters
// go down immediately if a big enough hit
if (take >= 25)
{
self.inpain = 2;
zombie_paine1 ();
return;
}
if (self.inpain)
{
@ -439,26 +645,18 @@ void(entity attacker, float take) zombie_pain =
return; // currently going through an animation, don't change
}
if (self.pain_finished > time)
{
// hit again, so drop down
self.inpain = 2;
zombie_paine1 ();
return;
}
// gp into one of the fast pain animations
self.inpain = 1;
r = random();
if (r < 0.25)
if (r < 0.33)
zombie_paina1 ();
else if (r < 0.5)
zombie_painb1 ();
else if (r < 0.75)
else if (r < 0.66)
zombie_painc1 ();
else
else
zombie_paind1 ();
};
//============================================================================
@ -483,8 +681,8 @@ void (entity stuff) spawn_zombie =
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/tehghoul.mdl");
setsize (self, VEC_HULL_MIN, '16 16 40');
self.health = 180;
setsize (self, '-8 -8 -24', '8 8 24');
self.health = 60;
self.classname = "ighoul";
self.netname = "ghoul";
self.max_health = self.health;
@ -498,11 +696,206 @@ void (entity stuff) spawn_zombie =
walkmonster_start_go ();
};
void () spawn_ghoul_copy =
{
local entity zombie, lair;
local entity te, ze;
local vector jojo;
local float zomc, pcount;
ze = find (world, netname, "ghoul");
zomc = 0;
while (ze)
{
zomc = zomc + 1;
ze = find (ze, netname, "ghoul");
}
ze = find(world, classname, "player");
while (ze)
{
if (ze.health > 0)
pcount = pcount + 1;
ze = find(ze, classname, "player");
}
if (zomc > 25*pcount)
return;
zombie = spawn ();
self = zombie;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/ghoul.mdl");
setsize (self, '-8 -8 -24', '8 8 24');
self.health = 60;
self.netname = "ghoul";
self.max_health = self.health;
self.th_stand = zombie_stand1;
self.th_walk = zombie_walk1;
self.th_run = zombie_run1;
self.th_pain = zombie_pain;
self.th_die = zombie_die;
if (random()<0.1)
self.th_missile = zombie_missile;
self.angles_y = random()*360;
self.origin = self.origin + '0 64 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = self.origin + '0 -64 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = self.origin + '64 0 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = self.origin + '-64 0 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
remove(self);
return;
}
}
}
}
te = findradius (self.origin, 30);
while (te)
{
if (te.classname == "player" || te.classname == "monster" && te.health > 0)
{
remove(self);
return;
}
te = te.chain;
}
self.classname = "monster";
walkmonster_start_go ();
};
void (vector jojo) spawn_ghoul =
{
local entity zombie, lair;
local entity te, ze;
local float stop;
ze = findradius(jojo, 256);
while (ze)
{
if (ze.classname == "lair")
stop = 1;
ze = ze.chain;
}
if (stop == 0)
{
lair = spawn ();
self = lair;
self.solid = SOLID_NOT;
self.movetype = MOVETYPE_STEP;
setsize (self, '0 0 0', '0 0 0');
self.netname = "lair";
self.nextthink = time + 30;
self.think = spawn_ghoul_copy;
self.nextthink = time + 30;
}
zombie = spawn ();
self = zombie;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/ghoul.mdl");
setsize (self, '-8 -8 -24', '8 8 24');
self.health = 60;
self.netname = "ghoul";
self.max_health = self.health;
self.th_stand = zombie_stand1;
self.th_walk = zombie_walk1;
self.th_run = zombie_run1;
self.th_pain = zombie_pain;
self.th_die = zombie_die;
if (random()<0.1)
self.th_missile = zombie_missile;
self.angles_y = random()*360;
self.origin = jojo + '0 64 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = jojo + '0 -64 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = jojo + '64 0 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
self.origin = jojo + '-64 0 0';
self.origin_z = self.origin_z + 1;
droptofloor();
if (!walkmove(0, 0))
{
remove(self);
return;
}
}
}
}
te = findradius (self.origin, 30);
while (te)
{
if (te.classname == "player" || te.classname == "monster" && te.health > 0)
{
remove(self);
return;
}
te = te.chain;
}
self.classname = "monster";
walkmonster_start_go ();
};
void() monster_zombie =
{
precache_model ("progs/zombie.mdl");
if (self.zone == 0)
{
load_monster();
return;
}
precache_model ("progs/ghoul.mdl");
precache_model ("progs/h_zombie.mdl");
precache_model ("progs/zom_gib.mdl");
precache_model ("progs/rock.mdl");
precache_model ("progs/homemade.mdl");
precache_sound ("zombie/z_idle.wav");
precache_sound ("zombie/z_idle1.wav");
@ -514,27 +907,45 @@ void() monster_zombie =
precache_sound ("zombie/z_miss.wav");
precache_sound ("zombie/z_hit.wav");
precache_sound ("zombie/idle_w2.wav");
precache_sound ("misc/rock1.wav");
precache_sound ("misc/rock2.wav");
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "progs/zombie.mdl");
setmodel (self, "progs/ghoul.mdl");
setsize (self, '-16 -16 -24', '16 16 40');
setsize (self, '-8 -8 -24', '8 8 24');
self.health = 60;
self.classname = "monster";
self.netname = "ghoul";
self.th_stand = zombie_stand1;
self.th_walk = zombie_walk1;
self.th_run = zombie_run1;
self.th_pain = zombie_pain;
self.th_die = zombie_die;
self.th_missile = zombie_missile;
self.th_melee = zombie_melee;
if (self.spawnflags & SPAWN_CRUCIFIED)
if (world.map_obj == OBJ_DEADTOWN)
{
self.movetype = MOVETYPE_NONE;
zombie_cruc1 ();
if (random()<0.5)
self.th_missile = zombie_missile;
}
else
walkmonster_start();
self.th_missile = zombie_missile;
self.angles_y = random()*360;
walkmonster_start();
if (random()<0.25 || world.map_obj == OBJ_DEADTOWN)
spawn_ghoul(self.origin);
if (world.map_obj == OBJ_DEADTOWN && random()<0.25)
spawn_ghoul(self.origin + '128 128 0');
if (world.map_obj == OBJ_DEADTOWN && random()<0.25)
spawn_ghoul(self.origin + '128 0 0');
if (random()<0.25 && world.map_obj == 1)
spawn_civilian(self.origin);
};