diff --git a/quakec/fallout2/ai.qc b/quakec/fallout2/ai.qc index 848a58dc3..481ed4f9a 100644 --- a/quakec/fallout2/ai.qc +++ b/quakec/fallout2/ai.qc @@ -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; diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 10abc7500..b90367d23 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -10,8 +10,9 @@ void(float slot) WeaponAmmo; void() Identify; void(entity to, float iid, float amount) AddStackable; void(entity to, float iid, float amount) AddNonStackable; +void() shop_face; -float modelindex_dead, modelindex_sneak, modelindex_prone, modelindex_eyes, modelindex_player, modelindex_gone; +float modelindex_dead, modelindex_sneak, modelindex_prone, modelindex_eyes, modelindex_player, modelindex_gone, modelindex_melee; /* ============================================================================= @@ -23,7 +24,6 @@ float modelindex_dead, modelindex_sneak, modelindex_prone, modelindex_eyes, mode string nextmap; -float intermission_running; float intermission_exittime; /*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16) @@ -56,21 +56,12 @@ void() SetChangeParms = self.items = self.items - (self.items & (IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) ); -// parm1 = self.slot1; -// parm2 = self.slot2; -// parm3 = self.armor; -// parm4 = self.protect; -// parm5 = self.equipment; // parm6 = self.chem; -// parm7 = self.chemcount; + if (self.class > 0) + parm7 = self.class; parm8 = self.ammo_shells; - parm9 = self.trait; - parm10 = self.perk; -// parm11 = self.bandages; -// parm12 = self.scraps; - //parm13 = self.class; - parm14 = self.team; -// parm15 = self.grenadetype; + parm9 = self.perk1; + parm10 = self.perk2; @@ -92,6 +83,15 @@ void() SetChangeParms = parm30 = self.islot14; parm31 = self.islot15; parm32 = self.islot16; + parm1 = self.islot17; + parm2 = self.islot18; + parm3 = self.islot19; + parm4 = self.islot20; + parm11 = self.islot21; + parm12 = self.islot22; + parm13 = self.islot23; + parm15 = self.islot24; + }; void() SetNewParms = @@ -100,10 +100,9 @@ void() SetNewParms = // parm2 = IID_WP_KNIFE; // parm3 = IID_ARM_SHIRT; // parm4 = 0; -// parm5 = 0; // parm6 = 0; -// parm7 = 0; - parm8 = 8; //starting cash + parm7 = 0; + parm8 = 300; //starting cash parm9 = 0; parm10 = 0; // parm11 = 0; @@ -112,6 +111,7 @@ void() SetNewParms = parm14 = 0; // parm15 = 0; + parm5 = 0; //score //16 is the current_slot //17 to 32 are inventory slots. @@ -140,21 +140,14 @@ void() DecodeLevelParms = { setspawnparms(self); -// self.slot1 = parm1; -// self.slot2 = parm2; -// self.armor = parm3; -// self.protect = parm4; -// self.equipment = parm5; // self.chem = parm6; -// self.chemcount = parm7; + if (parm7 > 0) + self.class = parm7; self.ammo_shells = parm8; - self.trait = parm9; - self.perk = parm10; -// self.bandages = parm11; -// self.scraps = parm12; -// self.class = parm13; - self.oldteam = parm14; -// self.grenadetype = parm15; + self.perk1 = parm9; + self.perk2 = parm10; + self.score = parm5; + self.current_slot = parm16; @@ -174,6 +167,15 @@ void() DecodeLevelParms = self.islot14 = parm30; self.islot15 = parm31; self.islot16 = parm32; + self.islot17 = parm1; + self.islot18 = parm2; + self.islot19 = parm3; + self.islot20 = parm4; + self.islot21 = parm11; + self.islot22 = parm12; + self.islot23 = parm13; + self.islot24 = parm15; + }; /* @@ -252,6 +254,75 @@ void() IntermissionThink = GotoNextMap (); }; + +void() get_new_map = +{ + if (random()<0.04) + m_map = "e1m1"; + else if (random()<0.04) + m_map = "e2m1"; + else if (random()<0.10) + m_map = "e3m1"; + else if (random()<0.04) + m_map = "e4m1"; + else if (random()<0.04) + m_map = "bbelief1"; + else if (random()<0.15) + m_map = "bbelief1"; + else if (random()<0.15) + m_map = "bbelief2"; + else if (random()<0.15) + m_map = "bbelief3"; + else if (random()<0.15) + m_map = "bbelief4"; + else if (random()<0.15) + m_map = "bbelief5"; + else if (random()<0.15) + m_map = "bbelief6"; + else if (random()<0.15) + m_map = "bbelief7"; + else if (random()<0.15) + m_map = "bbelief8"; + else + m_map = "bbelief1"; + +}; + +void() get_new_mission = +{ + local float x; + local string savemap; + + x = ceil(random()*6); + + if (x == 1) + savemap = "hostage"; + if (x == 2) + savemap = "supplies"; + if (x == 3) + savemap = "shadow"; + if (x == 4) + savemap = "deadtown"; + if (x == 5) + savemap = "destroy"; + if (x == 6) + savemap = "defuse"; + + localcmd("serverinfo objective "); + localcmd(savemap); + localcmd("\n"); + + get_new_map(); + + bprint(2, "new mission has been received: "); + bprint(2, savemap); + bprint(2, "\n"); + bprint(2, "location coordinates are near "); + bprint(2, m_map); + bprint(2, "\n"); + +}; + /* ============ execute_changelevel @@ -262,18 +333,17 @@ Take the players to the intermission spot */ void() execute_changelevel = { + local string savemap; local entity pos; + local float x; intermission_running = 1; // enforce a wait time before allowing changelevel - intermission_exittime = time + 5; + intermission_exittime = time + 15; pos = FindIntermission (); -// play intermission music - WriteByte (MSG_ALL, SVC_CDTRACK); - WriteByte (MSG_ALL, 3); WriteByte (MSG_ALL, SVC_INTERMISSION); WriteCoord (MSG_ALL, pos.origin_x); @@ -283,16 +353,30 @@ void() execute_changelevel = WriteAngle (MSG_ALL, pos.mangle_y); WriteAngle (MSG_ALL, pos.mangle_z); - other = find (world, classname, "player"); - while (other != world) - { - other.takedamage = DAMAGE_NO; - other.solid = SOLID_NOT; - other.movetype = MOVETYPE_NONE; - other.modelindex = 0; - other = find (other, classname, "player"); - } + + x = ceil(random()*6); + + if (x == 1) + savemap = "hostage"; + if (x == 2) + savemap = "supplies"; + if (x == 3) + savemap = "shadow"; + if (x == 4) + savemap = "deadtown"; + if (x == 5) + savemap = "destroy"; + if (x == 6) + savemap = "defuse"; + + if (intermission_exittime < time) + localcmd("map r_bunker"); + + if (infokey(world, "objective") != "return" && infokey(world, "objective") != "start") + localcmd("serverinfo objective return\n"); + + self.nextthink = time + 1; }; @@ -301,19 +385,54 @@ void() changelevel_touch = if (other.classname != "player") return; -// if "noexit" is set, blow up the player trying to leave -//ZOID, 12-13-96, noexit isn't supported in QW. Overload samelevel -// if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start"))) - if ((cvar("samelevel") == 2) || ((cvar("samelevel") == 3) && (mapname != "start"))) + if ((world.map_obj == OBJ_HOSTAGE && hostages > 0) && random()<0.02) { - T_Damage (other, self, self, 50000); + sprint (other, 2,"there are more hostages to save.\n"); return; } + else if ((world.map_obj == OBJ_SUPPLY && supplies > 0) && random()<0.02) + { + sprint (other, 2,"there are more supplies to secure.\n"); + return; + } + else if ((world.map_obj == OBJ_DESTROY && supplies > 0) && random()<0.02) + { + sprint (other, 2,"there are more fuel tanks to destroy.\n"); + return; + } + else if ((world.map_obj == OBJ_DEFUSE && supplies > 0) && random()<0.02) + { + sprint (other, 2,"there are still bombs to disarm.\n"); + return; + } + + if (world.map_obj == OBJ_HOSTAGE && hostages > 0) + return; + else if (world.map_obj == OBJ_SUPPLY && supplies > 0) + return; + else if (world.map_obj == OBJ_DESTROY && supplies > 0) + return; + else if (world.map_obj == OBJ_DEFUSE && supplies > 0) + return; + bprint (PRINT_HIGH, other.netname); bprint (PRINT_HIGH," exited the level\n"); - nextmap = self.map; + other = find (world, classname, "player"); + while (other) + { + stuffcmd(other, "play music/victory\n"); + other.missionbrief = 3; + other.takedamage = DAMAGE_NO; + other.solid = SOLID_NOT; + other.movetype = MOVETYPE_NONE; + other.modelindex = 0; + + other = find (other, classname, "player"); + } + + localcmd("serverinfo objective return\n"); SUB_UseTargets (); @@ -352,9 +471,9 @@ void() set_suicide_frame; void() respawn = { // make a copy of the dead body for appearances sake - CopyToBodyQue (self); + //CopyToBodyQue (self); // set default spawn parms - SetNewParms (); + //SetNewParms (); // respawn PutClientInServer (); }; @@ -369,13 +488,7 @@ Player entered the suicide command */ void() ClientKill = { - bprint (PRINT_MEDIUM, self.netname); - bprint (PRINT_MEDIUM, " suicides\n"); - set_suicide_frame (); - self.modelindex = modelindex_player; - logfrag (self, self); - self.frags = self.frags - 2; // extra penalty - respawn (); + sprint(self, 2, "you chicken out!\n"); }; float(vector v) CheckSpawnPoint = @@ -407,10 +520,12 @@ entity() SelectSpawnPoint = if (spot) return spot; - if (coop == 1) - ent1 = "info_player_coop"; + spot = find (world, classname, "spawn3"); + + if (spot) + ent1 = "spawn3"; else - ent1 = "spawn3"; + ent1 = "info_player_coop"; if (ent1 == "spawn3") { @@ -494,8 +609,33 @@ called each time a player enters a new level */ void() PutClientInServer = { - local entity spot; - local float x; + local entity spot, gun; + local float x, xx; + + self.classname = "player"; + self.health = 100; + self.takedamage = DAMAGE_AIM; + self.movetype = MOVETYPE_WALK; + self.show_hostile = 0; + self.max_health = 100; + self.health = 100; + self.flags = FL_CLIENT; + self.air_finished = time + 12; + self.dmg = 2; // initial water damage + self.super_damage_finished = 0; + self.radsuit_finished = 0; + self.invisible_finished = 0; + self.currentmenu = "none"; + self.invincible_finished = 0; + self.effects = 0; + self.invincible_time = 0; + self.active = 1; + self.solid = SOLID_NOT; + self.materialize = 20; + + + DecodeLevelParms (); + if (self.class == 0 || self.team == 0) { self.deadflag = DEAD_NO; @@ -518,40 +658,36 @@ void() PutClientInServer = player_stand1 (); return; } - self.classname = "player"; - self.health = 100; - self.takedamage = DAMAGE_AIM; - self.movetype = MOVETYPE_WALK; - self.show_hostile = 0; - self.max_health = 100; - self.health = 100; - self.flags = FL_CLIENT; - self.air_finished = time + 12; - self.dmg = 2; // initial water damage - self.super_damage_finished = 0; - self.radsuit_finished = 0; - self.invisible_finished = 0; - self.currentmenu = "none"; - self.invincible_finished = 0; - self.effects = 0; - self.invincible_time = 0; - self.active = 1; - self.solid = SOLID_NOT; - self.materialize = 20; - - DecodeLevelParms (); if (self.current_slot == 0) { - self.current_slot = 1; - self.islot1 = SlotVal(IID_WP_USP, 12); self.islot2 = 0; - self.islot3 = SlotVal(IID_ARM_SHIRT, 1); - self.islot4 = SlotVal(IID_CHEM_STIMPACK, 3); - self.islot5 = SlotVal(IID_AM_10MM, 24); - self.islot6 = 0; - self.islot7 = 0; - self.islot8 = 0; + + self.current_slot = 1; + if (self.class == 1) + self.islot1 = SlotVal(IID_WP_WINCHESTER, 2); + if (self.class == 2) + { + self.islot1 = SlotVal(IID_WP_GLOCK, 15); + self.islot2 = SlotVal(IID_WP_KNIFE, 1); + } + if (self.class == 3) + self.islot1 = SlotVal(IID_WP_USP, 12); + if (self.class == 4) + self.islot1 = SlotVal(IID_WP_PIPERIFLE, 1); + + self.islot3 = 0; + self.islot7 = SlotVal(IID_CHEM_STIMPACK, 3); + + if (self.class == 1) + self.islot8 = SlotVal(IID_AM_12GAUGESHELLS, 20); + if (self.class == 2) + self.islot8 = SlotVal(IID_AM_10MM, 30); + if (self.class == 3) + self.islot8 = SlotVal(IID_AM_45ACP, 24); + if (self.class == 4) + self.islot8 = SlotVal(IID_AM_44MAGNUM, 20); + self.islot9 = 0; self.islot10 = 0; self.islot11 = 0; @@ -560,26 +696,43 @@ void() PutClientInServer = self.islot14 = 0; self.islot15 = 0; self.islot16 = 0; - + self.islot17 = 0; + self.islot18 = 0; + self.islot19 = 0; + self.islot20 = 0; //now give them special items for thier class. //you're fairly screwed if you change class. if (self.class == 1) { x = SlotOfItem(self, IID_CHEM_MEDICALBAG); if (x == 0) - AddNonStackable(self, IID_CHEM_MEDICALBAG, 1); + self.islot5 = SlotVal(IID_CHEM_MEDICALBAG, 100); } if (self.class == 2) { x = SlotOfItem(self, IID_EQUIP_STEALTHBOY); if (x == 0) - AddNonStackable(self, IID_EQUIP_STEALTHBOY, 1); + self.islot4 = SlotVal(IID_EQUIP_STEALTHBOY, 1); } if (self.class == 4) { - x = SlotOfItem(self, IID_WP_TOOLKIT); + x = SlotOfItem(self, IID_WP_WRENCH); if (x == 0) - AddNonStackable(self, IID_WP_TOOLKIT, 1); + self.islot5 = SlotVal(IID_WP_WRENCH, 1); + + TryGiveStackable(self, IID_MISC_STEELPIPE, 1); + TryGiveStackable(self, IID_MISC_DUCKTAPE, 1); + TryGiveStackable(self, IID_MISC_AEROSOL, 2); + TryGiveStackable(self, IID_MISC_JUNK, 2); + + xx = ceil(309+random()*12); + TryGiveStackable(self, xx, 1); + + xx = ceil(309+random()*12); + TryGiveStackable(self, xx, 1); + + xx = ceil(309+random()*12); + TryGiveStackable(self, xx, 1); } } @@ -619,6 +772,9 @@ void() PutClientInServer = setmodel (self, "progs/sneak.mdl"); modelindex_sneak = self.modelindex; + setmodel (self, "progs/melee.mdl"); + modelindex_melee = self.modelindex; + setmodel (self, "progs/dead.mdl"); modelindex_dead = self.modelindex; @@ -633,6 +789,43 @@ void() PutClientInServer = self.view_ofs = '0 0 22'; self.view2 = world; + if (world.model == "maps/r_bunker.bsp") + { + if (infokey(world, "objective") != "return") + { + if (self.ammo_shells == 300) + self.popup = 1; + else + self.popup = 2; + } + } + + if (world.model == "maps/r_bunker.bsp") + { + if (infokey(world, "objective") == "return") + { + if (self.score <= 0) + { + self.popup = 6; + } + if (self.score <= 400) + { + self.ammo_shells = self.ammo_shells + 25; + self.popup = 3; + } + else if (self.score <= 800) + { + self.ammo_shells = self.ammo_shells + 50; + self.popup = 4; + } + else + { + self.ammo_shells = self.ammo_shells + 75; + self.popup = 5; + } + } + } + // Mod - Xian (May.20.97) // Bug where player would have velocity from their last kill @@ -762,6 +955,20 @@ void() info_player_deathmatch = potential spawning position for coop games */ void() info_player_coop = +{ + coop = 1; +}; + + +void() spawn1 = +{ +}; + +void() spawn2 = +{ +}; + +void() spawn3 = { }; @@ -926,7 +1133,7 @@ void() PlayerDeathThink = self.view_ofs = '0 0 -12'; self.modelindex = modelindex_dead; - self.solid = SOLID_NOT; +// self.solid = SOLID_NOT; if ((self.flags & FL_ONGROUND)) { @@ -968,7 +1175,10 @@ void() PlayerJump = { if (self.flags & FL_WATERJUMP) return; - + + if (self.health <= (self.max_health*0.20)) + return; + if (self.waterlevel >= 2) { // play swiming sound @@ -1060,7 +1270,7 @@ void() WaterMove = } else if (self.watertype == CONTENT_SLIME) { // do damage - if (self.dmgtime < time && self.radsuit_finished < time) + if (self.dmgtime < time && self.rage != IID_CHEM_RADX) { self.dmgtime = time + 1; T_Damage (self, world, world, 4*self.waterlevel); @@ -1113,30 +1323,191 @@ void() CheckWaterJump = } }; + +//this is used to check if the player is directly in front of a monster +//or off to the side, on the corner of the monsters vision + +float(entity targ) check_fov = +{ + local vector vec; + local float dot; + + makevectors (targ.angles); + vec = normalize (self.origin - targ.origin); + dot = vec * v_forward; + + if ( dot > 0.9) + { + return TRUE; + } + + return FALSE; +}; + +float(entity targ) check_fov_side = +{ + local vector vec; + local float dot; + + makevectors (targ.angles); + vec = normalize (self.origin - targ.origin); + dot = vec * v_forward; + + if ( dot > 0.6 && dot < 0.9) + { + return TRUE; + } + + return FALSE; +}; + +//determines chance of someone getting detected while sneaking + +void() SneakLevel = +{ + local float sn, st, front, r; + local entity te; + local string report; + + + front = 0; + + te = findradius(self.origin, 1000); + while (te) + { + if (visible(te) && te.classname == "monster" && check_fov(te)) + r = vlen(self.origin - te.origin); + + + te = te.chain; + } + + + sn = 95; + + //sneaking along a wall increases chance by 2% + makevectors(self.angles); + if (pointcontents (self.origin + v_right*64) == CONTENT_SOLID) + sn = sn + 2; + else if (pointcontents (self.origin - v_right*64) == CONTENT_SOLID) + sn = sn + 2; + else if (pointcontents (self.origin + v_forward*64) == CONTENT_SOLID) + sn = sn + 2; + else if (pointcontents (self.origin - v_forward*64) == CONTENT_SOLID) + sn = sn + 2; + + //duck or prone gives a 1% bonus to stealth + if (self.position > 0) + sn = sn + 1; + + //light step perk gives a 1% bonus to stealth + if (getperk(6)) + sn = sn + 1; + + //walking in front of a monster at close range is very bad + //at longer ranges it isn't so bad to do so + //thus even healer and barbarian types can sneak if they do so smartly + + if (r > 0 && r <= 600) + { + r = 600 - r; + + + if (self.class == 1) + sn = sn - r/3; + if (self.class == 2) + sn = sn - r/6; + if (self.class == 3) + sn = sn - r/3; + if (self.class == 4) + sn = sn - r/3; + } + + + //wearing no armor gives a 5% bonus to stealth + st = ToIID(self.islot3); + if (st == 0) + sn = sn + 5; + + //bulletproof shirt gives a 2% bonus to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_SHIRT) + sn = sn + 2; + + //metal armor gives a large penalty to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_METAL) + sn = sn - 5; + + //power armor gives a huge penalty to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_LPOWER) + sn = sn - 10; + + //body snatcher allows for an automatic disguise + st = ToIID(self.islot3); + if (st == IID_ARM_DESERT) + sn = 99; + + //stealthboy allows for an automatic 10-second invisibility + st = ToIID(self.islot4); + if (st == IID_EQUIP_STEALTHBOY && self.ammo_cells > 0) + sn = 99; + + if (sn <= 5) + sn = 5; + + if (sn >= 99) + sn = 99; + + if (self.sneak > 0) + self.sneak = sn; +}; + void() ArmorCheck = { - local float type; + local float type, aid, slow; + aid = ToIID(self.islot3); - local float aid; + if (self.hold > 0) + self.speedmulti = 0; + + slow = self.weight/self.max_weight; + + self.speedmulti = 1.00 - (slow/2); + + if (self.health <= (self.max_health*0.20)) + self.speedmulti = 0.75; + else if (self.health <= (self.max_health*0.10)) + self.speedmulti = 0.50; + + if (self.walk == 1) + self.speedmulti = self.speedmulti * 0.50; //Armor - aid = ToIID(self.islot3); + if (aid == IID_ARM_DESERT) + type = 0.10; if (aid == IID_ARM_SHIRT) - type = 0.20; + type = 0.25; if (aid == IID_ARM_LEATHER) type = 0.30; if (aid == IID_ARM_KEVLAR) - type = 0.35; + type = 0.50; if (aid == IID_ARM_METAL) - type = 0.35; + type = 0.25; if (aid == IID_ARM_COMBAT) type = 0.40; if (aid == IID_ARM_BROTHERHOOD) type = 0.45; if (aid == IID_ARM_FORCE) - type = 0.10; + type = 0.15; if (aid == IID_ARM_LPOWER) type = 0.50; + if (self.class == 3) + type += 0.10; + if (self.rage == IID_CHEM_PSYCHO) + type += 0.20; + if (aid <= IID_ARM_KEVLAR) self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1); @@ -1145,21 +1516,21 @@ void() ArmorCheck = else self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1); - if (aid == 1) + if (aid == IID_ARM_SHIRT) self.armornoise = "misc/thud.wav"; - if (aid == 2) + if (aid == IID_ARM_LEATHER) self.armornoise = "misc/thud.wav"; - if (aid == 3) + if (aid == IID_ARM_KEVLAR) self.armornoise = "misc/thud.wav"; - if (aid == 4) + if (aid == IID_ARM_METAL) self.armornoise = "weapons/ric1.wav"; - if (aid == 5) + if (aid == IID_ARM_COMBAT) self.armornoise = "misc/thud.wav"; - if (aid == 6) + if (aid == IID_ARM_BROTHERHOOD) self.armornoise = "misc/thud.wav"; - if (aid == 7) + if (aid == IID_ARM_FORCE) self.armornoise = "misc/laserdef.wav"; - if (aid == 8) + if (aid == IID_ARM_LPOWER) self.armornoise = "weapons/ric1.wav"; self.armorvalue = type * 100; @@ -1190,19 +1561,19 @@ void () WeightControl = self.weight = wt; if (self.class == 1) - self.max_weight = 50; + self.max_weight = 40; if (self.class == 2) - self.max_weight = 50; + self.max_weight = 40; if (self.class == 3) self.max_weight = 60; if (self.class == 4) - self.max_weight = 40; + self.max_weight = 30; }; void () PositionControl = { - local float exp; + local float exp, slow; if (self.position == 0) self.view_ofs = '0 0 22'; @@ -1226,25 +1597,37 @@ void () PositionControl = } if (self.position == 0) - self.maxspeed = 200; + self.maxspeed = 225; else if (self.position == 1) self.maxspeed = 100; - else //if (self.position == 2) + else if (self.position == 2 && getperk(3))//stunt man + self.maxspeed = 100; + else self.maxspeed = 50; - if (self.weight > self.max_weight) //this is the penalty for being overweight. - { - exp = (self.weight/self.max_weight); - exp = (exp+2)*(exp+2)+(exp*exp*exp*8); //is this enough? - self.maxspeed = self.maxspeed / exp; - } + if (self.health <= (self.max_health*0.20) && random()<0.05) + sound (self, CHAN_AUTO, "player/paina.wav", 1, ATTN_NORM); + else if (self.health <= (self.max_health*0.20) && random()<0.05) + sound (self, CHAN_AUTO, "player/painb.wav", 1, ATTN_NORM); + + if (getperk(2)) + self.maxspeed = self.maxspeed*1.10; + + if (self.rage == IID_CHEM_ADRENALINE) + self.maxspeed = self.maxspeed*1.20; + + if (self.sneak > 0) + self.maxspeed = self.maxspeed*0.50; + + self.maxspeed = self.maxspeed*self.speedmulti; + + if (self.maxspeed < 50) + self.maxspeed = 50; if (self.equipment_slot) { if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_SPRINTKIT) self.maxspeed = self.maxspeed*2; - if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_STEALTHBOY) - self.maxspeed = self.maxspeed/2; } }; @@ -1260,7 +1643,8 @@ Called every frame before physics are run */ void() PlayerPreThink = { - local float r; + local float r, grip; + local entity te; if (intermission_running) { @@ -1280,6 +1664,9 @@ void() PlayerPreThink = } + if (self.hold > 0) + self.hold = self.hold - 1; + if (self.team == 0) self.clientcolors = 0; else if (self.team == 1) @@ -1288,13 +1675,9 @@ void() PlayerPreThink = self.clientcolors = 4 + 4*16; if (self.team == 0 && self.currentmenu == "none") { - if (coop) - self.team = 1; - else - { - self.currentmenu = "select_team"; - DisplayMenu (); - } + self.currentmenu = "display_enter_screen"; + DisplayMenu (); + return; } else if (self.class == 0 && self.currentmenu == "none") { @@ -1319,19 +1702,33 @@ void() PlayerPreThink = PositionControl(); WeightControl(); ArmorCheck(); - Crosshair(); + SneakLevel(); + self.accept = 0; + + local float lgrip, rgrip; + + + //nintendo gamer: player sometimes goes into 'the zone' + if ((self.recoil >= 5) && (getperk(9)) && (random()<=0.10)) + { + sprint(self, 2, "THE ZONE!\n"); + self.rage = 255; + self.ragetime = 15; + } if (self.health > self.max_health) self.health = self.max_health; - if (self.flash < time) + if (self.flash < time || ToIID(self.islot4) == IID_EQUIP_GOGGLES) { - if (self.ragetime > time) + if (ToIID(self.islot4) == IID_EQUIP_GOGGLES) + stuffcmd(self, "v_cshift 25 0 25 25\n"); + else if (self.ragetime > time && self.rage != IID_CHEM_RADX) stuffcmd(self, "v_cshift 75 0 0 75\n"); else if (self.sneak > 0) - stuffcmd(self, "v_cshift 0 75 0 75\n"); - else + stuffcmd(self, "v_cshift 0 0 75 75\n"); + else if (self.zoom == 0) stuffcmd(self, "v_cshift 0 0 0 0\n"); } self.cycle1 = time + 0.5; @@ -1356,17 +1753,9 @@ void() PlayerPreThink = } } - if (self.class == 1) - self.recoil = self.recoil - 0.16; - if (self.class == 2) - self.recoil = self.recoil - 0.14; - if (self.class == 3) - self.recoil = self.recoil - 0.12; - if (self.class == 4) - self.recoil = self.recoil - 0.19; - if (self.recoil <= 0) - self.recoil = 0; + + self.deathtype = ""; @@ -1374,10 +1763,37 @@ void() PlayerPreThink = if (self.cycle2 < time) { - if (self.equipment == 8) - r = 30; - else + if (ToIID(self.islot4) == IID_EQUIP_BATTERY) r = 20; + else + r = 10; + + if (self.ragetime > 0) + self.ragetime -= 1; + + if (self.ragetime <= 0) + self.rage = 0; + + traceline ((self.origin), ((self.origin - (v_right * 24))) + (v_forward * 64), FALSE, self); + if (trace_fraction < 1 && trace_fraction > 0) + lgrip = 1; + + traceline ((self.origin), ((self.origin - (v_right * 48))) + (v_forward * 32), FALSE, self); + if (trace_fraction < 1 && trace_fraction > 0) + lgrip = 1; + + traceline ((self.origin), ((self.origin + (v_right * 24))) + (v_forward * 64), FALSE, self); + if (trace_fraction < 1 && trace_fraction > 0) + rgrip = 1; + + traceline ((self.origin), ((self.origin + (v_right * 48))) + (v_forward * 32), FALSE, self); + if (trace_fraction < 1 && trace_fraction > 0) + rgrip = 1; + + if (rgrip == 1 && lgrip == 0) + self.rage = 777; + if (rgrip == 0 && lgrip == 1) + self.rage = 777; if (self.sneak == 0) { @@ -1387,14 +1803,49 @@ void() PlayerPreThink = if (self.ammo_cells > r) self.ammo_cells = r; } - if (self.sneak >= 1) - { - self.ammo_cells = self.ammo_cells - 1; - if (self.ammo_cells <= 0) + if (self.sneak > 0) + { + if (self.ammo_cells == 3 && ToIID(self.islot4) == IID_EQUIP_STEALTHBOY) + sprint(self, 2, "stealthboy running low!\n"); + + if (self.ammo_cells > 0) + self.ammo_cells = self.ammo_cells - 1; + + if (self.ammo_cells < 0) + self.ammo_cells = 0; + } + + if (getperk(100))//SPIRIT LINK + { + te = findradius(self.origin, 500); + + while (te) { - sprint(self, 2, "uncloaked.\n"); - self.sneak = 0; + if (te.classname == "player" && te != self && (te.health < self.health)) + { + if (self.health > 5 && te.health > 0) + { + + sound (te, CHAN_BODY, "items/r_item1.wav", 1, ATTN_IDLE); + sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_IDLE); + + sprint(self, 2, "!SPIRIT LINK\n"); + sprint(te, 2, "!SPIRIT LINK\n"); + + if ((self.health - te.health) > 10) + { + self.health -= 5; + te.health += 5; + } + else + { + self.health -= 1; + te.health += 1; + } + } + } + te = te.chain; } } @@ -1403,10 +1854,29 @@ void() PlayerPreThink = self.health = self.health + 3; self.regen = self.regen - 1; } + else if (self.rage == IID_CHEM_BESERK && !self.deadflag) //don't come back to life. + self.health = self.health + 1; - if (self.flash < time) + if (self.flash < time || ToIID(self.islot4) == IID_EQUIP_GOGGLES) { - stuffcmd(self, "v_idlescale 0\n"); + if (ToIID(self.islot4) == IID_EQUIP_GOGGLES) + stuffcmd(self, "v_cshift 25 0 25 25\n"); + + if (self.steadyaim == 0) + stuffcmd(self, "v_idlescale 0\n"); + else if (self.recoil >= 4) + stuffcmd(self, "v_idlescale 4\n"); + else if (self.velocity == '0 0 0' && self.health >= self.max_health*0.80 && self.position > 0) + stuffcmd(self, "v_idlescale 0\n"); + else if (self.velocity == '0 0 0' && self.position > 0) + stuffcmd(self, "v_idlescale 1\n"); + else if (self.velocity == '0 0 0' && self.health >= self.max_health*0.80) + stuffcmd(self, "v_idlescale 2\n"); + else if (self.velocity != '0 0 0' || self.health < self.max_health*0.80) + stuffcmd(self, "v_idlescale 4\n"); + else if (self.health < self.max_health*0.50) + stuffcmd(self, "v_idlescale 6\n"); + } self.cycle2 = time + 1; } @@ -1440,18 +1910,26 @@ void() PlayerPreThink = { if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_CLIMBINGGEAR) { - traceline ((self.origin - '0 0 24'), ((self.origin + (v_forward * EF_FLAG2)) - '0 0 24'), FALSE, self); + grip = 0; + + + traceline ((self.origin), ((self.origin + (v_forward * 48))), FALSE, self); if (trace_fraction < 1 && trace_fraction > 0) + grip = 1; + + + if (grip == 1) { + self.attack_finished = time + 0.1; + self.rtime = time + 0.2; self.gravity = 0; self.maxspeed = 50; - self.velocity = v_forward*40 * self.movement_x; + self.velocity = v_forward*20 * self.movement_x; } else { self.gravity = 1; } - self.attack_finished = time + 0.1; } if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_HOVERBOOTS && self.button2) { @@ -1473,6 +1951,8 @@ Check for turning off powerups */ void() CheckPowerups = { + local float weap; + if (self.health <= 0) return; @@ -1516,25 +1996,32 @@ void() CheckPowerups = :beinvis self.items = self.items | IT_INVISIBILITY; - // use the eyes self.frame = 0; - self.modelindex = modelindex_eyes; + self.modelindex = modelindex_sneak; } else { self.items = self.items - (self.items & IT_INVISIBILITY); + if (self.ghost == 1 || self.class == 0 || self.team == 0) + { + self.modelindex = modelindex_gone; + return; + } + + weap = ToIID(self.(SlotField(self.current_slot))); + if (self.position <= 1) self.modelindex = modelindex_player; if (self.position == 2) self.modelindex = modelindex_prone; if (self.sneak == 1 || self.sneak == 3 && coop == 0) self.modelindex = modelindex_gone; - if (self.sneak == 1 || self.sneak == 3 && coop == 1) + if (self.sneak > 0 && coop == 1) self.modelindex = modelindex_sneak; + if (IsMelee(weap)) + self.modelindex = modelindex_melee; if (self.health <= 0) self.modelindex = modelindex_dead; - if (self.ghost == 1 || self.class == 0 || self.team == 0) - self.modelindex = modelindex_gone; } @@ -1715,32 +2202,114 @@ called when a player connects to a server */ void() ClientConnect = { + local entity te; + local float t; + bprint (PRINT_HIGH, self.netname); - bprint (PRINT_HIGH, " entered the game\n"); - + bprint (PRINT_HIGH, " entered the wasteland\n"); + + te = find(world, classname, "player"); + +/* + t = 0; + + while (te) + { + t = t + 1; + + te = find(te, classname, "player"); + }*/ + +/* + if (infokey(world, "total") == "zero") + { + bprint(2, "setting difficulty for one player.\n"); + localcmd("serverinfo total one\n"); + } + else if (infokey(world, "total") == "one") + { + bprint(2, "setting difficulty for two players.\n"); + localcmd("serverinfo total two\n"); + } + else if (infokey(world, "total") == "two") + { + bprint(2, "setting difficulty for three players.\n"); + localcmd("serverinfo total three\n"); + } + else if (infokey(world, "total") == "three") + { + bprint(2, "setting difficulty for four players.\n"); + localcmd("serverinfo total four\n"); + } + else if (infokey(world, "total") == "four") + { + bprint(2, "setting difficulty maxed out.\n"); + localcmd("serverinfo total four\n"); + } +*/ + self.start_time = world.start_time; + self.map_ent1 = world.map_ent1; + self.map_ent2 = world.map_ent2; + self.map_ent3 = world.map_ent3; + self.map_obj = world.map_obj; + self.location = world.location; stuffcmd(self, "v_damagecshift 1\n"); + stuffcmd(self, "alias +walk impulse 66\n"); + stuffcmd(self, "alias -walk impulse 67\n"); stuffcmd(self, "alias duck impulse 200\n"); stuffcmd(self, "alias prone impulse 201\n"); stuffcmd(self, "alias reload impulse 50\n"); stuffcmd(self, "alias chem impulse 51\n"); stuffcmd(self, "alias buy impulse 52\n"); stuffcmd(self, "alias special impulse 53\n"); - stuffcmd(self, "alias exit impulse 54\n"); + stuffcmd(self, "alias exit impulse 100\n"); stuffcmd(self, "alias drop impulse 55\n"); stuffcmd(self, "alias info impulse 56\n"); - stuffcmd(self, "alias equip impulse 57\n"); + stuffcmd(self, "alias zoom impulse 60\n"); + stuffcmd(self, "alias hostage impulse 65\n"); stuffcmd(self, "alias stimpack \"cmd invuse superstims+stimpack+bandages\"\n"); stuffcmd(self, "alias bandages \"cmd invuse bandages+superstims+stimpack\"\n"); + stuffcmd(self, "alias equip \"cmd invuse 4\"\n"); + stuffcmd(self, "alias q1 \"cmd invuse 5\"\n"); + stuffcmd(self, "alias q2 \"cmd invuse 6\"\n"); + stuffcmd(self, "alias quick1 \"cmd invuse 5\"\n"); + stuffcmd(self, "alias quick2 \"cmd invuse 6\"\n"); stuffcmd(self, "alias toolkit \"cmd invswap toolkit 2;impulse 2\"\n"); + stuffcmd (self, "alias radio1 impulse 212\n"); + stuffcmd (self, "alias radio2 impulse 213\n"); + stuffcmd (self, "alias radio3 impulse 214\n"); + stuffcmd (self, "alias radio4 impulse 215\n"); + stuffcmd (self, "alias radio5 impulse 216\n"); + stuffcmd (self, "alias radio6 impulse 217\n"); + stuffcmd (self, "alias radio7 impulse 218\n"); + stuffcmd (self, "alias radio8 impulse 219\n"); + stuffcmd (self, "alias radio9 impulse 220\n"); + stuffcmd (self, "alias radio10 impulse 221\n"); + stuffcmd (self, "alias radio11 impulse 222\n"); + stuffcmd (self, "bind f1 radio1\n"); + stuffcmd (self, "bind f2 radio2\n"); + stuffcmd (self, "bind f3 radio3\n"); + stuffcmd (self, "bind f4 radio4\n"); + stuffcmd (self, "bind f5 radio5\n"); + stuffcmd (self, "bind f6 radio6\n"); + stuffcmd (self, "bind f7 radio7\n"); + stuffcmd (self, "bind f8 radio8\n"); + stuffcmd (self, "bind f9 radio9\n"); + stuffcmd (self, "bind f10 radio10\n"); + stuffcmd (self, "bind f11 radio11\n"); + + stuffcmd(self, "bind 9 impulse 9\n"); + stuffcmd(self, "bind 0 impulse 10\n"); stuffcmd(self, "bind c equip\n"); stuffcmd(self, "bind g drop\n"); stuffcmd(self, "bind e exit\n"); stuffcmd(self, "bind z special\n"); stuffcmd(self, "bind r reload\n"); + stuffcmd(self, "bind h hostage\n"); stuffcmd(self, "bind x stimpack\n"); stuffcmd(self, "bind b buy\n"); stuffcmd(self, "bind q info\n"); @@ -1764,13 +2333,44 @@ called when a player disconnects from a server */ void() ClientDisconnect = { + local entity te; + local float t; + +/* + if (infokey(world, "total") == "zero") + { + bprint(2, "need players to begin map.\n"); + localcmd("serverinfo total zero\n"); + } + else if (infokey(world, "total") == "one") + { + bprint(2, "need players to begin map.\n"); + localcmd("serverinfo total zero\n"); + } + else if (infokey(world, "total") == "two") + { + bprint(2, "setting difficulty for one player.\n"); + localcmd("serverinfo total one\n"); + } + else if (infokey(world, "total") == "three") + { + bprint(2, "setting difficulty for two players.\n"); + localcmd("serverinfo total two\n"); + } + else if (infokey(world, "total") == "four") + { + bprint(2, "setting difficulty for three players.\n"); + localcmd("serverinfo total three\n"); + } +*/ + // let everyone else know bprint (PRINT_HIGH, self.netname); - bprint (PRINT_HIGH, " left the game with "); - bprint (PRINT_HIGH, ftos(self.frags)); - bprint (PRINT_HIGH, " frags\n"); + bprint (PRINT_HIGH, " left the game.\n"); + self.classname = "disconnected"; sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); set_suicide_frame (); + total_players = total_players - 1; }; /* @@ -1835,13 +2435,25 @@ void(entity targ, entity attacker) ClientObituary = bprint (PRINT_MEDIUM, "[ "); if (attacker.critical == 3) //headshot + { bprint (PRINT_MEDIUM, "X "); + attacker.score = attacker.score + 25; + } if (attacker.critical == 777) //through the wall + { bprint (PRINT_MEDIUM, "% "); + attacker.score = attacker.score + 50; + } if (attacker.critical == 778) //wall headshot + { bprint (PRINT_MEDIUM, "& "); + attacker.score = attacker.score + 75; + } if (attacker.velocity_z != 0) + { bprint (PRINT_MEDIUM, "@ "); + attacker.score = attacker.score - 50; + } // if (attacker.current_slot == 1 && attacker.mag1 == 0) // bprint (PRINT_MEDIUM, "! "); @@ -1854,6 +2466,16 @@ void(entity targ, entity attacker) ClientObituary = return; } + if (targ != attacker && (targ.classname == "monster" || targ.classname == "player") && (attacker.classname == "robofang" || attacker.classname == "player")) + { + bprint (PRINT_MEDIUM, "[;;] "); + bprint(2, attacker.owner.netname); + bprint(2, " >>> "); + bprint(2, targ.netname); + bprint(2, "\n"); + return; + } + if (targ.classname == "player") { @@ -2147,19 +2769,19 @@ void() Identify = traceline (self.origin, (self.origin + (v_forward * 2000)), 32, self); if (trace_ent.classname == "player" && self.currentmenu == "none" && self.team == trace_ent.team) { - if (trace_ent.class == 2) - c1 = "^7\nmedic\n"; + if (trace_ent.class == 1) + c1 = "\nfirst aid\n"; + else if (trace_ent.class == 2) + c1 = "\nstealth\n"; else if (trace_ent.class == 3) - c1 = "^7\nassassin\n"; + c1 = "\ncombat\n"; else if (trace_ent.class == 4) - c1 = "^7\nsoldier\n"; - else if (trace_ent.class == 6) - c1 = "^7\nscientist\n"; + c1 = "\nscience\n"; else - c1 = "^7\n"; + c1 = "\n"; if (trace_ent.health <= 0) - c2 = "^1dead^7"; + c2 = "dead"; c2 = ftos (trace_ent.health); c3 = GetItemName (ToIID(ItemInSlot(trace_ent, trace_ent.current_slot))); diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 8e5f9070d..44070214c 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -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) diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 36b7c944e..5faaab5c5 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -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 diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 9b268c142..323173b71 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -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; //============================================================================ diff --git a/quakec/fallout2/demon.qc b/quakec/fallout2/demon.qc index beefaf6d4..64796fc96 100644 --- a/quakec/fallout2/demon.qc +++ b/quakec/fallout2/demon.qc @@ -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); - } } diff --git a/quakec/fallout2/dog.qc b/quakec/fallout2/dog.qc index b0beb7cb7..ec7c1270a 100644 --- a/quakec/fallout2/dog.qc +++ b/quakec/fallout2/dog.qc @@ -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; -}; diff --git a/quakec/fallout2/doors.qc b/quakec/fallout2/doors.qc index 8b0332739..5c1efdedf 100644 --- a/quakec/fallout2/doors.qc +++ b/quakec/fallout2/doors.qc @@ -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; diff --git a/quakec/fallout2/enforcer.qc b/quakec/fallout2/enforcer.qc index 8f347d842..d1f8239da 100644 --- a/quakec/fallout2/enforcer.qc +++ b/quakec/fallout2/enforcer.qc @@ -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; diff --git a/quakec/fallout2/fight.qc b/quakec/fallout2/fight.qc index 6deda3937..c50723796 100644 --- a/quakec/fallout2/fight.qc +++ b/quakec/fallout2/fight.qc @@ -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; diff --git a/quakec/fallout2/fish.qc b/quakec/fallout2/fish.qc index 3b7cfb2ae..4709ef844 100644 --- a/quakec/fallout2/fish.qc +++ b/quakec/fallout2/fish.qc @@ -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; diff --git a/quakec/fallout2/hknight.qc b/quakec/fallout2/hknight.qc index 50adcdba5..1623526b2 100644 --- a/quakec/fallout2/hknight.qc +++ b/quakec/fallout2/hknight.qc @@ -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; diff --git a/quakec/fallout2/hos.qc b/quakec/fallout2/hos.qc index 4b7414ac7..b61197b9f 100644 --- a/quakec/fallout2/hos.qc +++ b/quakec/fallout2/hos.qc @@ -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; +}; \ No newline at end of file diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 2aff70d50..e1c6f6455 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -1,41 +1,62 @@ float IID_NONE = 0; -#define IsMelee(iid) (iid == IID_NONE || (iid >= IID_WP_TOOLKIT && iid <= IID_WP_POWERAXE)) -#define IsGrenade(iid) (iid >= IID_GREN_FRAG && iid <= IID_GREN_FLASH) -#define IsRanged(iid) (iid >= IID_WP_USP && iid <= IID_WP_ROCKETLAUNCHER) +#define IsMelee(iid) (iid == IID_NONE || (iid >= IID_WP_WRENCH && iid <= IID_WP_POWERAXE)) +#define IsGrenade(iid) (iid >= IID_GREN_FRAG && iid <= IID_GREN_STUN) +#define IsRanged(iid) (iid >= IID_WP_GLOCK && iid <= IID_WP_ACR) //weapons with ammo, things with a toggle state #define NotStackable(iid) (IsRanged(iid)) //the ammoless weapons -float IID_WP_TOOLKIT = 400; -float IID_WP_KNIFE = 401; -float IID_WP_AXE = 402; -float IID_WP_VIBROBLADE = 403; -float IID_WP_POWERAXE = 404; +float IID_WP_WRENCH = 399; +float IID_WP_KNIFE = 400; +float IID_WP_AXE = 401; +float IID_WP_SPEAR = 402; +float IID_WP_POWERAXE = 403; //the ammoed weapons +float IID_WP_GLOCK = 404; float IID_WP_USP = 405; float IID_WP_DEAGLE = 406; float IID_WP_NEEDLER = 407; float IID_WP_ALIENBLASTER = 408; -float IID_WP_PIPERIFLE = 409; -float IID_WP_WINCHESTER = 410; -float IID_WP_MOSSBERG = 411; -float IID_WP_JACKHAMMER = 412; -float IID_WP_MP9 = 413; -float IID_WP_MP7 = 414; -float IID_WP_RANGEMASTER = 415; -float IID_WP_AK112 = 416; -float IID_WP_AK74 = 417; -float IID_WP_DKS1 = 418; -float IID_WP_MOONLIGHT = 419; -float IID_WP_SA80 = 420; -float IID_WP_GAUSERIFLE = 421; //2mm EC -float IID_WP_PULSERIFLE = 422; -float IID_WP_FNFAL = 423; //.308 AP -float IID_WP_ROCKETLAUNCHER = 430; +float IID_WP_WINCHESTER = 409; +float IID_WP_MOSSBERG = 410; +float IID_WP_JACKHAMMER = 411; +float IID_WP_MP9 = 412; +float IID_WP_MP7 = 413; +float IID_WP_RANGEMASTER = 414; +float IID_WP_AK112 = 415; +float IID_WP_AK74 = 416; +float IID_WP_DKS1 = 417; +float IID_WP_MOONLIGHT = 418; +float IID_WP_G11 = 419; +float IID_WP_GLOCK_S = 420; +float IID_WP_USP_S = 421; +float IID_WP_MP9_S = 422; +float IID_WP_MP7_S = 423; +float IID_WP_PIPERIFLE = 424; +float IID_WP_PIPERIFLE_R = 425; +float IID_WP_PIPERIFLE_S = 426; +float IID_WP_PIPERIFLE_SCOPE = 427; +float IID_WP_PIPERIFLE_SCOPE_S = 428; +float IID_WP_PIPERIFLE_SCOPE_R = 429; +float IID_WP_PIPERIFLE_SCOPE_S_R = 430; +float IID_WP_PIPERIFLE_S_R = 431; +float IID_WP_DEAGLE_M = 432; +float IID_WP_AK112_M = 433; +float IID_WP_GAUSERIFLE = 434; //2mm EC +float IID_WP_PULSERIFLE = 435; +float IID_WP_PLASMACARBINE = 436; +float IID_WP_TURBOPLASMA = 437; +float IID_WP_FNFAL = 438; //.308 AP +float IID_WP_ROCKETLAUNCHER = 439; +float IID_WP_LASERGATLING = 440; +float IID_WP_DKS1_S = 441; +float IID_WP_RANGEMASTER_SCOPE = 442; +float IID_WP_AK47 = 443; +float IID_WP_ACR = 444; //and ammo for those guns float IID_AM_NEEDLER = 507; @@ -49,15 +70,20 @@ float IID_AM_762MM = 514; //"7.62mm ammo"; float IID_AM_44MAGNUM = 515; //".44 magnum ammo"; float IID_AM_45ACP = 516; //".45 ACP ammo"; float IID_AM_ROCKET = 517; //"explosive rocket" +float IID_AM_CASELESS = 518; //caseless +float IID_AM_WARSAW = 519; //ak-47 ammo //grenade items float IID_GREN_FRAG = 101; float IID_GREN_EMP = 102; float IID_GREN_SMOKE = 103; float IID_GREN_FLASH = 104; +float IID_GREN_STUN = 105; +float IID_GREN_FLARE = 106; //armour -#define IsArmor(iid) (iid >= IID_ARM_SHIRT && iid <= IID_ARM_LPOWER) +#define IsArmor(iid) (iid >= IID_ARM_DESERT && iid <= IID_ARM_LPOWER) +float IID_ARM_DESERT = 200; float IID_ARM_SHIRT = 201; float IID_ARM_LEATHER = 202; float IID_ARM_KEVLAR = 203; @@ -75,6 +101,7 @@ float IID_CHEM_SUPERSTIM = 303; float IID_CHEM_ADRENALINE = 304; float IID_CHEM_PSYCHO = 305; float IID_CHEM_BESERK = 306; +float IID_CHEM_RADX = 307; float IID_BUILD_MRAMMO = 350; float IID_BUILD_SHIELDGEN = 351; @@ -85,15 +112,41 @@ float IID_BUILD_TELEPAD = 355; float IID_BUILD_RTURRET = 356; float IID_BUILD_GTURRET = 357; -float IID_EQUIP_CLIMBINGGEAR = 375; -float IID_EQUIP_STEALTHBOY = 376; -float IID_EQUIP_SPRINTKIT = 377; -float IID_EQUIP_HOVERBOOTS = 378; +#define IsEquip(iid) (iid >= IID_EQUIP_MEDIC_BAG && iid <= IID_EQUIP_EXTENDER) +#define IsJunk(iid) (iid >= IID_MISC_JUNK && iid <= IID_MISC_XRAYTUBE) + +float IID_EQUIP_MEDIC_BAG = 375; +float IID_EQUIP_GOGGLES = 376; +float IID_EQUIP_BELTPOUCH = 378; +float IID_EQUIP_BACKPACK = 379; +float IID_EQUIP_TOOLKIT = 380; +float IID_EQUIP_CLIMBINGGEAR = 381; +float IID_EQUIP_BATTERY = 382; +float IID_EQUIP_STEALTHBOY = 383; +float IID_EQUIP_SPRINTKIT = 384; +float IID_EQUIP_HOVERBOOTS = 385; +float IID_EQUIP_XRAY = 386; +float IID_EQUIP_EXTENDER = 387; + + +float IID_MISC_JUNK = 310; +float IID_MISC_NUKACOLA = 311; +float IID_MISC_CHEMICALS = 312; +float IID_MISC_AEROSOL = 313; +float IID_MISC_RDXCRYSTAL = 314; +float IID_MISC_STEELPIPE = 315; +float IID_MISC_DUCKTAPE = 316; +float IID_MISC_LCD = 317; +float IID_MISC_CIRCUITBOARD = 318; +float IID_MISC_COPPERWIRE = 319; +float IID_MISC_HMXCOMPOUND = 320; +float IID_MISC_GUM = 321; +float IID_MISC_XRAYTUBE = 322; + +float IID_EQUIP_SILENCER = 323; + #define IsShootable(iid) (IsMelee(iid) || IsRanged(iid) || IsGrenade(iid)) -#define ToIID(it) floor(it/512) -#define ToStatus(it) (it&511) -#define SlotVal(iid,st) ((iid*512) | (st&511)) float(float slotno, float iid) FitsInSlot; @@ -101,9 +154,6 @@ float(float slotno, float iid) FitsInSlot; //slot3 is the armour slot. //the other slots are for misilaneous things. -#define MAXSLOTS 16 - -#ifndef CSQC .float islot1; .float islot2; .float islot3; @@ -120,34 +170,101 @@ float(float slotno, float iid) FitsInSlot; .float islot14; .float islot15; .float islot16; +.float islot17; +.float islot18; +.float islot19; +.float islot20; +.float islot21; +.float islot22; +.float islot23; +.float islot24; +.float xslot1; +.float xslot2; +.float xslot3; +.float xslot4; +.float xslot5; +.float xslot6; +.float xslot7; +.float xslot8; -void(float stnum, float sttype, .float fieldname) clientstatf = #232; +#define MAXSLOTS 24 + +void(float sttype, float stnum, string fieldname) clientstat = #232; void() SetupStats = { //2 is ev_float //32 is the first stat we are allowed to use - clientstatf(32, 2, islot1); - clientstatf(33, 2, islot2); - clientstatf(34, 2, islot3); - clientstatf(35, 2, islot4); - clientstatf(36, 2, islot5); - clientstatf(37, 2, islot6); - clientstatf(38, 2, islot7); - clientstatf(39, 2, islot8); - clientstatf(40, 2, islot9); - clientstatf(41, 2, islot10); - clientstatf(42, 2, islot11); - clientstatf(43, 2, islot12); - clientstatf(44, 2, islot13); - clientstatf(45, 2, islot14); - clientstatf(46, 2, islot15); - clientstatf(47, 2, islot16); - - clientstatf(61, 2, current_slot); - clientstatf(62, 2, team); - clientstatf(63, 2, class); + clientstat(2, 32, "islot1"); + clientstat(2, 33, "islot2"); + clientstat(2, 34, "islot3"); + clientstat(2, 35, "islot4"); + clientstat(2, 36, "islot5"); + clientstat(2, 37, "islot6"); + clientstat(2, 38, "islot7"); + clientstat(2, 39, "islot8"); + clientstat(2, 40, "islot9"); + clientstat(2, 41, "islot10"); + clientstat(2, 42, "islot11"); + clientstat(2, 43, "islot12"); + clientstat(2, 44, "islot13"); + clientstat(2, 45, "islot14"); + clientstat(2, 46, "islot15"); + clientstat(2, 47, "islot16"); + clientstat(2, 48, "health"); + clientstat(2, 49, "max_health"); + clientstat(2, 50, "ammo_shells"); + clientstat(2, 51, "ammo_cells"); + clientstat(2, 52, "weight"); + clientstat(2, 53, "max_weight"); + clientstat(2, 54, "position"); + clientstat(2, 55, "rage"); + clientstat(2, 56, "regen"); + clientstat(2, 57, "missionbrief"); + clientstat(2, 58, "sneak"); + clientstat(2, 59, "perk2"); + clientstat(2, 60, "perk1"); + clientstat(2, 61, "current_slot"); + clientstat(2, 62, "team"); + clientstat(2, 63, "class"); + clientstat(2, 64, "start_time"); + clientstat(2, 65, "location"); + clientstat(2, 66, "map_obj"); + clientstat(2, 67, "map_ent1"); + clientstat(2, 68, "map_ent2"); + clientstat(2, 69, "map_ent3"); + clientstat(2, 70, "silencer"); + clientstat(2, 71, "extender"); + clientstat(2, 91, "islot17"); + clientstat(2, 92, "islot18"); + clientstat(2, 93, "islot19"); + clientstat(2, 94, "islot20"); + clientstat(2, 95, "islot21"); + clientstat(2, 96, "islot22"); + clientstat(2, 97, "islot23"); + clientstat(2, 98, "islot24"); + clientstat(2, 99, "recoil"); + clientstat(2, 100, "xslot1"); + clientstat(2, 101, "xslot2"); + clientstat(2, 102, "xslot3"); + clientstat(2, 103, "xslot4"); + clientstat(2, 104, "xslot5"); + clientstat(2, 105, "xslot6"); + clientstat(2, 106, "xslot7"); + clientstat(2, 107, "xslot8"); + clientstat(2, 108, "safezone"); + clientstat(2, 109, "connected"); + clientstat(2, 110, "steadyaim"); + clientstat(2, 125, "timer"); + clientstat(2, 126, "popup"); + clientstat(2, 127, "score"); }; + +#define ToIID(it) floor(it/512) +#define ToStatus(it) (it&511) +#define SlotVal(iid,st) ((iid*512) | (st&511)) + + float(entity e, float slotno) ItemInSlot = { if (slotno == 1) @@ -182,6 +299,22 @@ float(entity e, float slotno) ItemInSlot = return e.islot15; if (slotno == 16) return e.islot16; + if (slotno == 17) + return e.islot17; + if (slotno == 18) + return e.islot18; + if (slotno == 19) + return e.islot19; + if (slotno == 20) + return e.islot20; + if (slotno == 21) + return e.islot21; + if (slotno == 22) + return e.islot22; + if (slotno == 23) + return e.islot23; + if (slotno == 24) + return e.islot24; return 0; }; @@ -220,6 +353,22 @@ void(entity e, float slotno, float item) SetItemSlot = e.islot15 = item; else if (slotno == 16) e.islot16 = item; + else if (slotno == 17) + e.islot17 = item; + else if (slotno == 18) + e.islot18 = item; + else if (slotno == 19) + e.islot19 = item; + else if (slotno == 20) + e.islot20 = item; + else if (slotno == 21) + e.islot21 = item; + else if (slotno == 22) + e.islot22 = item; + else if (slotno == 23) + e.islot23 = item; + else if (slotno == 24) + e.islot24 = item; }; float(entity e, float iid) SlotOfItem = @@ -256,7 +405,76 @@ float(entity e, float iid) SlotOfItem = return 15; if (ToIID(e.islot16) == iid) return 16; + if (ToIID(e.islot17) == iid) + return 17; + if (ToIID(e.islot18) == iid) + return 18; + if (ToIID(e.islot19) == iid) + return 19; + if (ToIID(e.islot20) == iid) + return 20; + if (ToIID(e.islot21) == iid) + return 21; + if (ToIID(e.islot22) == iid) + return 22; + if (ToIID(e.islot23) == iid) + return 23; + if (ToIID(e.islot24) == iid) + return 24; + return 0; +}; +float(entity e, float iid) ShadowSlotOfItem = +{ + if (ToIID(getstati(32)) == iid) + return 1; + if (ToIID(getstati(33)) == iid) + return 2; + if (ToIID(getstati(34)) == iid) + return 3; + if (ToIID(getstati(35)) == iid) + return 4; + if (ToIID(getstati(36)) == iid) + return 5; + if (ToIID(getstati(37)) == iid) + return 6; + if (ToIID(getstati(38)) == iid) + return 7; + if (ToIID(getstati(39)) == iid) + return 8; + if (ToIID(getstati(40)) == iid) + return 9; + if (ToIID(getstati(41)) == iid) + return 10; + if (ToIID(getstati(42)) == iid) + return 11; + if (ToIID(getstati(43)) == iid) + return 12; + if (ToIID(getstati(44)) == iid) + return 13; + if (ToIID(getstati(45)) == iid) + return 14; + if (ToIID(getstati(46)) == iid) + return 15; + if (ToIID(getstati(47)) == iid) + return 16; + + if (ToIID(getstati(91)) == iid) + return 17; + if (ToIID(getstati(92)) == iid) + return 18; + if (ToIID(getstati(93)) == iid) + return 19; + if (ToIID(getstati(94)) == iid) + return 20; + if (ToIID(getstati(95)) == iid) + return 21; + if (ToIID(getstati(96)) == iid) + return 22; + if (ToIID(getstati(97)) == iid) + return 23; + if (ToIID(getstati(98)) == iid) + return 24; return 0; }; @@ -295,6 +513,22 @@ float(entity e, float iid) TotalQuantity = ret += ToStatus(e.islot15); if (ToIID(e.islot16) == iid) ret += ToStatus(e.islot16); + if (ToIID(e.islot17) == iid) + ret += ToStatus(e.islot17); + if (ToIID(e.islot18) == iid) + ret += ToStatus(e.islot18); + if (ToIID(e.islot19) == iid) + ret += ToStatus(e.islot19); + if (ToIID(e.islot20) == iid) + ret += ToStatus(e.islot20); + if (ToIID(e.islot21) == iid) + ret += ToStatus(e.islot21); + if (ToIID(e.islot22) == iid) + ret += ToStatus(e.islot22); + if (ToIID(e.islot23) == iid) + ret += ToStatus(e.islot23); + if (ToIID(e.islot24) == iid) + ret += ToStatus(e.islot24); return ret; }; @@ -327,32 +561,14 @@ float(entity e) FindEmptySlot = return 14; if (ToIID(e.islot15) == IID_NONE) return 15; - if (ToIID(e.islot16) == IID_NONE) - return 16; return 0; }; float(entity e, float iid) FindSuitableEmptySlot = { - if (ToIID(e.islot1) == IID_NONE) - if (FitsInSlot(1, iid)) - return 1; - if (ToIID(e.islot2) == IID_NONE) - if (FitsInSlot(2, iid)) - return 2; - if (ToIID(e.islot3) == IID_NONE) - if (FitsInSlot(3, iid)) - return 3; - if (ToIID(e.islot4) == IID_NONE) - if (FitsInSlot(4, iid)) - return 4; - if (ToIID(e.islot5) == IID_NONE) - if (FitsInSlot(5, iid)) - return 5; - if (ToIID(e.islot6) == IID_NONE) - if (FitsInSlot(6, iid)) - return 6; + if (!IsJunk(iid)) + { if (ToIID(e.islot7) == IID_NONE) if (FitsInSlot(7, iid)) return 7; @@ -383,7 +599,26 @@ float(entity e, float iid) FindSuitableEmptySlot = if (ToIID(e.islot16) == IID_NONE) if (FitsInSlot(16, iid)) return 16; - + } + else if (IsJunk(iid)) + { + if (ToIID(e.islot17) == IID_NONE) + return 17; + if (ToIID(e.islot18) == IID_NONE) + return 18; + if (ToIID(e.islot19) == IID_NONE) + return 19; + if (ToIID(e.islot20) == IID_NONE) + return 20; + if (ToIID(e.islot21) == IID_NONE) + return 21; + if (ToIID(e.islot22) == IID_NONE) + return 22; + if (ToIID(e.islot23) == IID_NONE) + return 23; + if (ToIID(e.islot24) == IID_NONE) + return 24; + } return 0; }; @@ -422,76 +657,114 @@ slot_t(float slot) SlotField = return islot15; if (slot == 16) return islot16; + if (slot == 17) + return islot17; + if (slot == 18) + return islot18; + if (slot == 19) + return islot19; + if (slot == 20) + return islot20; + if (slot == 21) + return islot21; + if (slot == 22) + return islot22; + if (slot == 23) + return islot23; + if (slot == 24) + return islot24; bprint(PRINT_MEDIUM, "ERROR: Invalid slot number (", ftos(slot), ")\n"); return islot1; }; -#endif string(float iid) GetItemVModel = { if (iid == IID_NONE) return "progs/v_fist.mdl"; - if (iid == IID_WP_TOOLKIT) + if (iid == IID_WP_WRENCH) return "progs/v_span.mdl"; if (iid == IID_WP_KNIFE) return "progs/v_knife.mdl"; if (iid == IID_WP_AXE) return "progs/v_axe.mdl"; - if (iid == IID_WP_VIBROBLADE) - return "progs/v_knife.mdl"; + if (iid == IID_WP_SPEAR) + return "progs/v_spear.mdl"; if (iid == IID_WP_POWERAXE) return "progs/v_axe.mdl"; if (iid == IID_WP_USP) return "progs/v_1911.mdl"; - + if (iid == IID_WP_USP_S) + return "progs/v_1911.mdl"; + if (iid == IID_WP_GLOCK) + return "progs/v_glock.mdl"; + if (iid == IID_WP_GLOCK_S) + return "progs/v_glock.mdl"; if (iid == IID_WP_DEAGLE) return "progs/v_deagle.mdl"; if (iid == IID_WP_NEEDLER) - return "progs/v_1911.mdl"; + return "progs/v_needler.mdl"; if (iid == IID_WP_ALIENBLASTER) - return "progs/v_alien.mdl"; - if (iid == IID_WP_PIPERIFLE) - return "progs/v_piperifle.mdl"; + return "progs/v_blaster.mdl"; + if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) + return "progs/v_pipe.mdl"; if (iid == IID_WP_WINCHESTER) return "progs/v_double.mdl"; if (iid == IID_WP_MOSSBERG) - return "progs/v_shotgun.mdl"; + return "progs/v_combat.mdl"; if (iid == IID_WP_JACKHAMMER) return "progs/v_jackhammer.mdl"; if (iid == IID_WP_MP9) - return "progs/v_mp9.mdl"; + return "progs/v_ump.mdl"; if (iid == IID_WP_MP7) return "progs/v_smg.mdl"; + if (iid == IID_WP_MP9_S) + return "progs/v_ump.mdl"; + if (iid == IID_WP_MP7_S) + return "progs/v_smg.mdl"; if (iid == IID_WP_RANGEMASTER) return "progs/v_rangem.mdl"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "progs/v_rangem_s.mdl"; if (iid == IID_WP_AK112) return "progs/v_ak47.mdl"; if (iid == IID_WP_AK74) return "progs/v_ak47.mdl"; + if (iid == IID_WP_ACR) + return "progs/v_acr.mdl"; if (iid == IID_WP_DKS1) return "progs/v_srifle.mdl"; + if (iid == IID_WP_DKS1_S) + return "progs/v_srifle.mdl"; if (iid == IID_WP_MOONLIGHT) return "progs/v_night.mdl"; if (iid == IID_WP_FNFAL) - return "progs/v_rangem.mdl"; + return "progs/v_fnfal.mdl"; + if (iid == IID_WP_AK112_M) + return "progs/v_ak47.mdl"; - - if (iid == IID_WP_SA80) - return "progs/v_sa80.mdl"; + if (iid == IID_WP_G11) + return "progs/v_g11.mdl"; if (iid == IID_WP_GAUSERIFLE) return "progs/v_gauss.mdl"; if (iid == IID_WP_PULSERIFLE) + return "progs/v_plasma.mdl"; + if (iid == IID_WP_TURBOPLASMA) + return "progs/v_plasma.mdl"; + if (iid == IID_WP_PLASMACARBINE) return "progs/v_carbine.mdl"; - if (iid == IID_WP_ROCKETLAUNCHER) return "progs/v_rocket.mdl"; + if (iid == IID_WP_LASERGATLING) + return "progs/v_chain.mdl"; if (iid == IID_GREN_FRAG) return "progs/v_handgren.mdl"; + if (iid == IID_GREN_STUN) + return "progs/v_handgren.mdl"; if (iid == IID_GREN_EMP) return "progs/v_handgren.mdl"; if (iid == IID_GREN_SMOKE) @@ -507,56 +780,87 @@ string(float iid) GetItemWModel = { if (iid == IID_WP_KNIFE) return "progs/w_knife.mdl"; + if (iid == IID_WP_WRENCH) + return "progs/w_span.mdl"; if (iid == IID_WP_AXE) return "progs/w_knife.mdl"; - if (iid == IID_WP_VIBROBLADE) - return "progs/w_axe.mdl"; + if (iid == IID_WP_SPEAR) + return "progs/w_spear.mdl"; if (iid == IID_WP_POWERAXE) return "progs/w_axe.mdl"; if (iid == IID_WP_USP) return "progs/w_1911.mdl"; + if (iid == IID_WP_USP_S) + return "progs/w_1911.mdl"; + if (iid == IID_WP_GLOCK) + return "progs/w_glock.mdl"; + if (iid == IID_WP_GLOCK_S) + return "progs/w_glock.mdl"; if (iid == IID_WP_DEAGLE) return "progs/w_deagle.mdl"; + if (iid == IID_WP_DEAGLE_M) + return "progs/w_deagle.mdl"; if (iid == IID_WP_NEEDLER) return "progs/w_1911.mdl"; if (iid == IID_WP_ALIENBLASTER) return "progs/w_alien.mdl"; - if (iid == IID_WP_PIPERIFLE) - return "progs/w_pipe.mdl"; + if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) + return "progs/w_rangem.mdl"; if (iid == IID_WP_WINCHESTER) - return "progs/w_shotgun.mdl"; + return "progs/w_double.mdl"; if (iid == IID_WP_MOSSBERG) - return "progs/w_pipe.mdl"; + return "progs/w_combat.mdl"; if (iid == IID_WP_JACKHAMMER) return "progs/w_jackhammer.mdl"; if (iid == IID_WP_MP9) return "progs/w_mp9.mdl"; if (iid == IID_WP_MP7) + return "progs/w_mp5.mdl"; + if (iid == IID_WP_MP9_S) + return "progs/w_mp9.mdl"; + if (iid == IID_WP_MP7_S) return "progs/w_mp7.mdl"; if (iid == IID_WP_RANGEMASTER) return "progs/w_rangem.mdl"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "progs/w_rangem.mdl"; if (iid == IID_WP_AK112) return "progs/w_ak47.mdl"; + if (iid == IID_WP_AK112_M) + return "progs/w_ak47.mdl"; if (iid == IID_WP_AK74) return "progs/w_ak47.mdl"; + if (iid == IID_WP_ACR) + return "progs/w_acr.mdl"; if (iid == IID_WP_DKS1) return "progs/w_srifle.mdl"; + if (iid == IID_WP_DKS1_S) + return "progs/w_srifle.mdl"; if (iid == IID_WP_MOONLIGHT) return "progs/w_night.mdl"; - if (iid == IID_WP_SA80) - return "progs/w_sa80.mdl"; + if (iid == IID_WP_G11) + return "progs/w_g11.mdl"; if (iid == IID_WP_FNFAL) - return "progs/w_rangem.mdl"; + return "progs/w_fnfal.mdl"; if (iid == IID_WP_GAUSERIFLE) return "progs/w_gauss.mdl"; if (iid == IID_WP_PULSERIFLE) + return "progs/w_plasma.mdl"; + if (iid == IID_WP_TURBOPLASMA) + return "progs/w_plasma.mdl"; + if (iid == IID_WP_PLASMACARBINE) return "progs/w_carbine.mdl"; + if (iid == IID_WP_ROCKETLAUNCHER) return "progs/w_rocket.mdl"; + if (iid == IID_WP_LASERGATLING) + return "progs/w_chain.mdl"; + if (iid == IID_GREN_STUN) + return "progs/grenade2.mdl"; if (iid == IID_GREN_FRAG) return "progs/grenade2.mdl"; if (iid == IID_GREN_EMP) @@ -573,6 +877,9 @@ string(float iid) GetItemWModel = if (iid == IID_CHEM_SUPERSTIM) return "maps/b_bh100.bsp"; + if (iid >= IID_AM_NEEDLER && iid <= IID_AM_WARSAW) + return "progs/ammobox.mdl"; + //fixme if (iid == IID_CHEM_ADRENALINE) return "maps/b_bh10.bsp"; @@ -580,6 +887,11 @@ string(float iid) GetItemWModel = return "maps/b_bh25.bsp"; if (iid == IID_CHEM_BESERK) return "maps/b_bh100.bsp"; + if (iid == IID_CHEM_RADX) + return "maps/b_bh25.bsp"; + + if (iid >= IID_MISC_JUNK && iid <= IID_MISC_XRAYTUBE) + return "progs/junk1.mdl"; return "progs/s_light.spr"; //no model. :/ @@ -587,16 +899,38 @@ string(float iid) GetItemWModel = float(float iid) WeaponAmmoType = { + if (iid == IID_GREN_STUN) + return IID_GREN_STUN; + if (iid == IID_GREN_FRAG) + return IID_GREN_FRAG; + if (iid == IID_GREN_EMP) + return IID_GREN_EMP; + if (iid == IID_GREN_SMOKE) + return IID_GREN_SMOKE; + if (iid == IID_GREN_FLASH) + return IID_GREN_FLASH; + + if (iid == IID_WP_USP) + return IID_AM_45ACP; + if (iid == IID_WP_USP_S) + return IID_AM_45ACP; + if (iid == IID_WP_GLOCK) + return IID_AM_10MM; + if (iid == IID_WP_GLOCK_S) return IID_AM_10MM; if (iid == IID_WP_DEAGLE) return IID_AM_44MAGNUM; + if (iid == IID_WP_AK47) + return IID_AM_WARSAW; + if (iid == IID_WP_DEAGLE_M) + return IID_AM_44MAGNUM; if (iid == IID_WP_NEEDLER) return IID_AM_NEEDLER; if (iid == IID_WP_ALIENBLASTER) return IID_AM_ENERGYCELL; - if (iid == IID_WP_PIPERIFLE) - return IID_AM_10MM; + if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) + return IID_AM_44MAGNUM; if (iid == IID_WP_WINCHESTER) return IID_AM_12GAUGESHELLS; if (iid == IID_WP_MOSSBERG) @@ -604,21 +938,35 @@ float(float iid) WeaponAmmoType = if (iid == IID_WP_JACKHAMMER) return IID_AM_12GAUGESHELLS; if (iid == IID_WP_MP9) - return IID_AM_10MM; + return IID_AM_45ACP; if (iid == IID_WP_MP7) return IID_AM_10MM; + if (iid == IID_WP_MP9_S) + return IID_AM_45ACP; + if (iid == IID_WP_MP7_S) + return IID_AM_10MM; if (iid == IID_WP_RANGEMASTER) return IID_AM_556MM; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return IID_AM_556MM; if (iid == IID_WP_AK112) return IID_AM_5MMHIGHVEL; - if (iid == IID_WP_AK74) + if (iid == IID_WP_AK47) + return IID_AM_WARSAW; + if (iid == IID_WP_AK112_M) return IID_AM_5MMHIGHVEL; + if (iid == IID_WP_AK74) + return IID_AM_WARSAW; + if (iid == IID_WP_ACR) + return IID_AM_NEEDLER; if (iid == IID_WP_DKS1) return IID_AM_762MM; + if (iid == IID_WP_DKS1_S) + return IID_AM_762MM; if (iid == IID_WP_MOONLIGHT) return IID_AM_556MM; - if (iid == IID_WP_SA80) - return IID_AM_556MM; + if (iid == IID_WP_G11) + return IID_AM_CASELESS; if (iid == IID_WP_FNFAL) return IID_AM_762MM; @@ -626,8 +974,16 @@ float(float iid) WeaponAmmoType = return IID_AM_2MMEC; if (iid == IID_WP_PULSERIFLE) return IID_AM_ENERGYCELL; + if (iid == IID_WP_PULSERIFLE) + return IID_AM_ENERGYCELL; + if (iid == IID_WP_TURBOPLASMA) + return IID_AM_ENERGYCELL; + if (iid == IID_WP_PLASMACARBINE) + return IID_AM_ENERGYCELL; if (iid == IID_WP_ROCKETLAUNCHER) return IID_AM_ROCKET; + if (iid == IID_WP_LASERGATLING) + return IID_AM_ENERGYCELL; return IID_NONE; }; @@ -636,44 +992,72 @@ float(float iid) WeaponMagQuant = { if (iid == IID_WP_USP) return 12; + if (iid == IID_WP_USP_S) + return 12; + if (iid == IID_WP_GLOCK) + return 15; + if (iid == IID_WP_GLOCK_S) + return 15; if (iid == IID_WP_DEAGLE) return 7; + if (iid == IID_WP_DEAGLE_M) + return 11; if (iid == IID_WP_NEEDLER) return 15; if (iid == IID_WP_ALIENBLASTER) return 6; - if (iid == IID_WP_PIPERIFLE) + if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) return 1; if (iid == IID_WP_WINCHESTER) return 2; if (iid == IID_WP_MOSSBERG) - return 6; + return 8; if (iid == IID_WP_JACKHAMMER) - return 10; + return 12; if (iid == IID_WP_MP9) - return 30; + return 25; if (iid == IID_WP_MP7) return 30; + if (iid == IID_WP_MP9_S) + return 25; + if (iid == IID_WP_MP7_S) + return 30; if (iid == IID_WP_RANGEMASTER) return 10; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return 10; + if (iid == IID_WP_AK47) + return 30; if (iid == IID_WP_AK112) return 24; + if (iid == IID_WP_AK112_M) + return 40; if (iid == IID_WP_AK74) return 30; + if (iid == IID_WP_ACR) + return 24; if (iid == IID_WP_DKS1) return 8; + if (iid == IID_WP_DKS1_S) + return 8; if (iid == IID_WP_MOONLIGHT) return 30; - if (iid == IID_WP_SA80) - return 30; + if (iid == IID_WP_G11) + return 50; if (iid == IID_WP_GAUSERIFLE) return 10; if (iid == IID_WP_PULSERIFLE) return 40; + if (iid == IID_WP_TURBOPLASMA) + return 40; + if (iid == IID_WP_PLASMACARBINE) + return 50; if (iid == IID_WP_FNFAL) return 20; if (iid == IID_WP_ROCKETLAUNCHER) return 1; + if (iid == IID_WP_LASERGATLING) + return 120; return 0; }; @@ -685,15 +1069,23 @@ float(float iid) GetItemWeight = if (iid == IID_WP_KNIFE) return 1; if (iid == IID_WP_AXE) - return 2; - if (iid == IID_WP_VIBROBLADE) + return 8; + if (iid == IID_WP_SPEAR) return 8; if (iid == IID_WP_POWERAXE) return 6; if (iid == IID_WP_USP) return 1; + if (iid == IID_WP_USP_S) + return 1; + if (iid == IID_WP_GLOCK) + return 1; + if (iid == IID_WP_GLOCK_S) + return 1; if (iid == IID_WP_DEAGLE) - return 2; + return 3; + if (iid == IID_WP_DEAGLE_M) + return 4; if (iid == IID_WP_NEEDLER) return 2; if (iid == IID_WP_ALIENBLASTER) @@ -708,28 +1100,48 @@ float(float iid) GetItemWeight = return 6; if (iid == IID_WP_MP9) return 3; + if (iid == IID_WP_MP9_S) + return 3; if (iid == IID_WP_MP7) return 3; + if (iid == IID_WP_MP7_S) + return 3; if (iid == IID_WP_RANGEMASTER) return 5; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return 5; if (iid == IID_WP_AK112) return 5; + if (iid == IID_WP_AK47) + return 6; + if (iid == IID_WP_AK112_M) + return 7; if (iid == IID_WP_AK74) return 5; + if (iid == IID_WP_ACR) + return 5; if (iid == IID_WP_DKS1) - return 7; + return 9; + if (iid == IID_WP_DKS1_S) + return 9; if (iid == IID_WP_MOONLIGHT) return 5; - if (iid == IID_WP_SA80) - return 5; + if (iid == IID_WP_G11) + return 6; if (iid == IID_WP_GAUSERIFLE) return 9; if (iid == IID_WP_PULSERIFLE) - return 12; + return 11; + if (iid == IID_WP_TURBOPLASMA) + return 11; + if (iid == IID_WP_PLASMACARBINE) + return 08; if (iid == IID_WP_FNFAL) - return 9; + return 8; if (iid == IID_WP_ROCKETLAUNCHER) return 10; + if (iid == IID_WP_LASERGATLING) + return 25; if (iid == IID_ARM_SHIRT) @@ -786,27 +1198,49 @@ string(float iid) GetItemName = return "nothing"; - if (iid == IID_WP_TOOLKIT) - return "toolkit"; + if (iid == IID_WP_WRENCH) + return "WRENCH"; if (iid == IID_WP_KNIFE) return "knife"; if (iid == IID_WP_AXE) return "axe"; - if (iid == IID_WP_VIBROBLADE) - return "ripper"; + if (iid == IID_WP_SPEAR) + return "spear"; if (iid == IID_WP_POWERAXE) - return "poweraxe"; + return "disruptor"; if (iid == IID_WP_USP) - return "1911 (10mm)"; + return "usp (45 acp)"; + if (iid == IID_WP_USP_S) + return "usp (silenced)"; + if (iid == IID_WP_GLOCK) + return "glock 21 (10mm)"; + if (iid == IID_WP_GLOCK_S) + return "glock 21 (silenced)"; if (iid == IID_WP_DEAGLE) return "desert eagle (.44mag)"; + if (iid == IID_WP_DEAGLE_M) + return "desert eagle (silenced)"; if (iid == IID_WP_NEEDLER) return "needler"; if (iid == IID_WP_ALIENBLASTER) return "alien blaster (energy)"; if (iid == IID_WP_PIPERIFLE) - return "pipe rifle (10mm)"; + return "pipe rifle (.44mag)"; + if (iid == IID_WP_PIPERIFLE_S) + return "pipe rifle (silenced)"; + if (iid == IID_WP_PIPERIFLE_R) + return "pipe rifle (rod&spring)"; + if (iid == IID_WP_PIPERIFLE_SCOPE) + return "pipe rifle (scope)"; + if (iid == IID_WP_PIPERIFLE_S_R) + return "pipe rifle (silenced, rod&spring)"; + if (iid == IID_WP_PIPERIFLE_SCOPE_R) + return "pipe rifle (scope, rod&spring)"; + if (iid == IID_WP_PIPERIFLE_SCOPE_S) + return "pipe rifle (scope, silenced)"; + if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) + return "pipe rifle (scope, silenced, rod&spring)"; if (iid == IID_WP_WINCHESTER) return "winchester (12g)"; if (iid == IID_WP_MOSSBERG) @@ -814,56 +1248,82 @@ string(float iid) GetItemName = if (iid == IID_WP_JACKHAMMER) return "jackhammer (12g)"; if (iid == IID_WP_MP9) - return "mp9 (10mm)"; + return "h&k ump (.45 acp)"; + if (iid == IID_WP_MP9_S) + return "h&k ump (silenced)"; if (iid == IID_WP_MP7) - return "grease gun (10mm)"; + return "h&k mp10 (10mm)"; + if (iid == IID_WP_MP7_S) + return "h&k mp10 (silenced)"; if (iid == IID_WP_RANGEMASTER) return "rangemaster (5.56mm)"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "rangemaster (x2 SUSAT scope)"; + if (iid == IID_WP_AK47) + return "ak-47 (7.62mm warsaw pact)"; if (iid == IID_WP_AK112) - return "ak-112 (5mm-hv)"; + return "ak-112 (5mm jhp)"; + if (iid == IID_WP_AK112_M) + return "ak-112 (extended magazine)"; if (iid == IID_WP_AK74) - return "ak-74 (5mm-hv)"; + return "ak-47 (7.62mm warsaw pact)"; + if (iid == IID_WP_ACR) + return "steyr acr (5mm flechette)"; if (iid == IID_WP_DKS1) - return "dks-1 (7.62mm)"; + return "knight sr-25 widowmaker (7.62mm)"; + if (iid == IID_WP_DKS1_S) + return "knight sr-25 widowmaker (silenced)"; if (iid == IID_WP_MOONLIGHT) return "moonlight (5.56mm)"; - if (iid == IID_WP_SA80) - return "sa-80 (5.56mm)"; + if (iid == IID_WP_G11) + return "hk g11 (4mm)"; if (iid == IID_WP_GAUSERIFLE) return "gauss rifle (2mm EC)"; if (iid == IID_WP_PULSERIFLE) - return "laser carbine (energy)"; + return "phased plasma rifle (energy)"; + if (iid == IID_WP_TURBOPLASMA) + return "turbo plasma rifle (energy)"; + if (iid == IID_WP_PLASMACARBINE) + return "plasma carbine (energy)"; if (iid == IID_WP_FNFAL) - return "fn-fal (7.62mm)"; + return "fn fal (7.62mm)"; if (iid == IID_WP_ROCKETLAUNCHER) return "rocket launcher"; + if (iid == IID_WP_LASERGATLING) + return "laser minigun (energy)"; if (iid == IID_AM_NEEDLER) return "needler cartidge"; if (iid == IID_AM_2MMEC) - return "2mm EC ammo"; + return "2mm AP"; if (iid == IID_AM_10MM) - return "10mm FMJ"; + return "10mm JHP"; if (iid == IID_AM_556MM) return "5.56mm FMJ"; if (iid == IID_AM_5MMHIGHVEL) return "5mm JHP"; if (iid == IID_AM_12GAUGESHELLS) - return "12-guage shotgun shells"; + return "12GA shotgun shells"; if (iid == IID_AM_ENERGYCELL) return "small energy cell"; if (iid == IID_AM_762MM) return "7.62mm AP"; if (iid == IID_AM_44MAGNUM) - return ".44 magnum ammo"; + return ".44 magnum FMJ"; + if (iid == IID_AM_WARSAW) + return "7.62mmx38 Warsaw Pact"; if (iid == IID_AM_45ACP) - return ".45 ACP ammo"; + return ".45 ACP"; if (iid == IID_AM_ROCKET) return "explosive rocket"; + if (iid == IID_AM_CASELESS) + return "4.7mm caseless"; + if (iid == IID_GREN_STUN) + return "stun grenade"; if (iid == IID_GREN_FRAG) return "frag grenade"; if (iid == IID_GREN_EMP) @@ -871,17 +1331,20 @@ string(float iid) GetItemName = if (iid == IID_GREN_SMOKE) return "smoke grenade"; if (iid == IID_GREN_FLASH) - return "flashbang"; - + return "flash grenade"; + if (iid == IID_GREN_FLARE) + return "ultra-light flare"; + if (iid == IID_ARM_DESERT) + return "desert armor"; if (iid == IID_ARM_SHIRT) - return "bulletproof shirt"; + return "kevlar shirt"; if (iid == IID_ARM_LEATHER) return "leather armor"; if (iid == IID_ARM_KEVLAR) - return "kevlar armor"; + return "double kevlar"; if (iid == IID_ARM_METAL) - return "metal armor"; + return "ceramic armor"; if (iid == IID_ARM_COMBAT) return "combat armor"; if (iid == IID_ARM_BROTHERHOOD) @@ -889,7 +1352,7 @@ string(float iid) GetItemName = if (iid == IID_ARM_FORCE) return "force armor"; if (iid == IID_ARM_LPOWER) - return "light power armor"; + return "power armor"; if (iid == IID_CHEM_STIMPACK) @@ -904,7 +1367,8 @@ string(float iid) GetItemName = return "psycho"; if (iid == IID_CHEM_BESERK) return "beserk"; - + if (iid == IID_CHEM_RADX) + return "rad-x"; if (iid == IID_BUILD_MRAMMO) return "mr. ammo"; @@ -921,36 +1385,547 @@ string(float iid) GetItemName = if (iid == IID_BUILD_GTURRET) return "machine-gun turret"; + + if (iid == IID_EQUIP_MEDIC_BAG) + return "medics bag"; + if (iid == IID_EQUIP_GOGGLES) + return "ghost goggles"; + if (iid == IID_EQUIP_SILENCER) + return "universal silencer"; + if (iid == IID_EQUIP_BELTPOUCH) + return "belt pouch"; + if (iid == IID_EQUIP_TOOLKIT) + return "super WRENCH"; + if (iid == IID_EQUIP_BACKPACK) + return "haversack"; if (iid == IID_EQUIP_CLIMBINGGEAR) return "climbing gear"; + if (iid == IID_EQUIP_BATTERY) + return "enhanced battery"; if (iid == IID_EQUIP_STEALTHBOY) return "stealthboy"; if (iid == IID_EQUIP_SPRINTKIT) return "lucozade sport!"; if (iid == IID_EQUIP_HOVERBOOTS) return "hover boots"; + if (iid == IID_EQUIP_EXTENDER) + return "barrel extender"; + if (iid == IID_EQUIP_XRAY) + return "x-ray device"; + + if (iid == IID_MISC_JUNK) + return "random junk"; + if (iid == IID_MISC_NUKACOLA) + return "nuka-cola"; + if (iid == IID_MISC_CHEMICALS) + return "chemicals"; + if (iid == IID_MISC_AEROSOL) + return "aerosol can"; + if (iid == IID_MISC_RDXCRYSTAL) + return "rdx crystals"; + if (iid == IID_MISC_STEELPIPE) + return "steel pipe"; + if (iid == IID_MISC_DUCKTAPE) + return "duct tape"; + if (iid == IID_MISC_LCD) + return "liquid crystal display"; + if (iid == IID_MISC_CIRCUITBOARD) + return "circuit board"; + if (iid == IID_MISC_COPPERWIRE) + return "copper wire"; + if (iid == IID_MISC_HMXCOMPOUND) + return "hmx compound"; + if (iid == IID_MISC_GUM) + return "chewing gum"; + if (iid == IID_MISC_XRAYTUBE) + return "x-ray tube"; + bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n"); return strcat("unknown", ftos(iid)); }; +float(float iid) GetBaseValue = +{ + if (iid == IID_NONE) + return 0; + + + if (iid == IID_WP_WRENCH) + return 1; + if (iid == IID_WP_KNIFE) + return 1; + if (iid == IID_WP_AXE) + return 1; + if (iid == IID_WP_SPEAR) + return 1; + + + if (iid == IID_WP_USP) + return 25; + if (iid == IID_WP_USP_S) + return 30; + if (iid == IID_WP_GLOCK) + return 20; + if (iid == IID_WP_GLOCK_S) + return 25; + if (iid == IID_WP_DEAGLE) + return 35; + if (iid == IID_WP_DEAGLE_M) + return 40; + if (iid == IID_WP_NEEDLER) + return 10; + if (iid == IID_WP_ALIENBLASTER) + return 20; + if (iid == IID_WP_PIPERIFLE) + return 5; + if (iid == IID_WP_PIPERIFLE_S) + return 5; + if (iid == IID_WP_PIPERIFLE_R) + return 6; + if (iid == IID_WP_PIPERIFLE_SCOPE) + return 6; + if (iid == IID_WP_PIPERIFLE_S_R) + return 7; + if (iid == IID_WP_PIPERIFLE_SCOPE_R) + return 7; + if (iid == IID_WP_PIPERIFLE_SCOPE_S) + return 7; + if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) + return 8; + if (iid == IID_WP_WINCHESTER) + return 30; + if (iid == IID_WP_MOSSBERG) + return 150; + if (iid == IID_WP_JACKHAMMER) + return 200; + if (iid == IID_WP_MP9) + return 75; + if (iid == IID_WP_MP9_S) + return 75; + if (iid == IID_WP_MP7) + return 75; + if (iid == IID_WP_MP7_S) + return 75; + if (iid == IID_WP_RANGEMASTER) + return 50; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return 50; + if (iid == IID_WP_AK47) + return 25; + if (iid == IID_WP_AK112) + return 80; + if (iid == IID_WP_AK112_M) + return 90; + if (iid == IID_WP_AK74) + return 30; + if (iid == IID_WP_ACR) + return 100; + if (iid == IID_WP_DKS1) + return 120; + if (iid == IID_WP_DKS1_S) + return 125; + if (iid == IID_WP_MOONLIGHT) + return 140; + if (iid == IID_WP_G11) + return 150; + if (iid == IID_WP_GAUSERIFLE) + return 200; + if (iid == IID_WP_PULSERIFLE) + return 200; + if (iid == IID_WP_TURBOPLASMA) + return 200; + if (iid == IID_WP_PLASMACARBINE) + return 105; + if (iid == IID_WP_FNFAL) + return 50; + if (iid == IID_WP_ROCKETLAUNCHER) + return 100; + if (iid == IID_WP_LASERGATLING) + return 150; + + + + if (iid == IID_AM_NEEDLER) + return 1; + if (iid == IID_AM_2MMEC) + return 1; + if (iid == IID_AM_10MM) + return 1; + if (iid == IID_AM_556MM) + return 1; + if (iid == IID_AM_5MMHIGHVEL) + return 1; + if (iid == IID_AM_12GAUGESHELLS) + return 1; + if (iid == IID_AM_ENERGYCELL) + return 1; + if (iid == IID_AM_762MM) + return 1; + if (iid == IID_AM_44MAGNUM) + return 1; + if (iid == IID_AM_WARSAW) + return 1; + if (iid == IID_AM_45ACP) + return 1; + if (iid == IID_AM_ROCKET) + return 1; + if (iid == IID_AM_CASELESS) + return 1; + + + if (iid == IID_GREN_STUN) + return 1; + if (iid == IID_GREN_FRAG) + return 1; + if (iid == IID_GREN_EMP) + return 1; + if (iid == IID_GREN_SMOKE) + return 1; + if (iid == IID_GREN_FLASH) + return 1; + if (iid == IID_GREN_FLARE) + return 1; + + if (iid == IID_ARM_DESERT) + return 1; + if (iid == IID_ARM_SHIRT) + return 1; + if (iid == IID_ARM_LEATHER) + return 2; + if (iid == IID_ARM_KEVLAR) + return 3; + if (iid == IID_ARM_METAL) + return 4; + if (iid == IID_ARM_COMBAT) + return 5; + if (iid == IID_ARM_BROTHERHOOD) + return 8; + if (iid == IID_ARM_FORCE) + return 10; + if (iid == IID_ARM_LPOWER) + return 15; + + + if (iid == IID_CHEM_STIMPACK) + return 1; + if (iid == IID_CHEM_MEDICALBAG) + return 1; + if (iid == IID_CHEM_SUPERSTIM) + return 1; + if (iid == IID_CHEM_ADRENALINE) + return 1; + if (iid == IID_CHEM_PSYCHO) + return 1; + if (iid == IID_CHEM_BESERK) + return 1; + if (iid == IID_CHEM_RADX) + return 1; + + if (iid == IID_EQUIP_MEDIC_BAG) + return 1; + if (iid == IID_EQUIP_GOGGLES) + return 1; + if (iid == IID_EQUIP_SILENCER) + return 1; + if (iid == IID_EQUIP_BELTPOUCH) + return 1; + if (iid == IID_EQUIP_TOOLKIT) + return 1; + if (iid == IID_EQUIP_BACKPACK) + return 1; + if (iid == IID_EQUIP_CLIMBINGGEAR) + return 1; + if (iid == IID_EQUIP_BATTERY) + return 1; + if (iid == IID_EQUIP_STEALTHBOY) + return 1; + if (iid == IID_EQUIP_SPRINTKIT) + return 1; + if (iid == IID_EQUIP_HOVERBOOTS) + return 1; + if (iid == IID_EQUIP_EXTENDER) + return 1; + if (iid == IID_EQUIP_XRAY) + return 1; + + if (iid == IID_MISC_JUNK) + return 0; + if (iid == IID_MISC_NUKACOLA) + return 0; + if (iid == IID_MISC_CHEMICALS) + return 0; + if (iid == IID_MISC_AEROSOL) + return 0; + if (iid == IID_MISC_RDXCRYSTAL) + return 0; + if (iid == IID_MISC_STEELPIPE) + return 0; + if (iid == IID_MISC_DUCKTAPE) + return 0; + if (iid == IID_MISC_LCD) + return 0; + if (iid == IID_MISC_CIRCUITBOARD) + return 0; + if (iid == IID_MISC_COPPERWIRE) + return 0; + if (iid == IID_MISC_HMXCOMPOUND) + return 0; + if (iid == IID_MISC_GUM) + return 0; + if (iid == IID_MISC_XRAYTUBE) + return 0; + + + bprint(PRINT_MEDIUM, ftos(iid), " without a sell price!\n"); + return 0; +}; + string(float iid) GetItemDesc = { if (iid == IID_NONE) return ""; - if (iid == IID_WP_TOOLKIT) - return "a wattz(tm) brand toolkit consisting of many handy instruments, including a wrench. this kit is a repairman's dream, and allows those with the proper knowledge to perform technical tasks."; - if (iid == IID_WP_AK74) - return "the ak74 is the predecessor of the legendary ak-47. it is still the same old killing machine, except that it uses the 5.45mm high-velocity round that was common in the latest assault rifles just before the war."; + if (iid == IID_WP_WRENCH) + return "a heavy multi-function wrench"; + if (iid == IID_WP_KNIFE) + return "great for stealth attacks"; + if (iid == IID_WP_AXE) + return "a futuristic battle axe"; + if (iid == IID_WP_SPEAR) + return "a long, sharp polearm"; + if (iid == IID_WP_POWERAXE) + return "a futuristic axe of some sort"; + + if (iid == IID_WP_USP) + return "uses 45 acp, a solid round"; + if (iid == IID_WP_USP_S) + return "this usp has a silencer attached for maximum stealth"; + if (iid == IID_WP_GLOCK) + return "a rugged, reliable sidearm"; + if (iid == IID_WP_GLOCK_S) + return "silencer allows for hit-and-run tactics"; + if (iid == IID_WP_DEAGLE) + return "the favorite of late 20th century action heroes"; + if (iid == IID_WP_DEAGLE_M) + return "a modified desert eagle with extended magazines"; + if (iid == IID_WP_NEEDLER) + return "an experimental weapon of some sort"; + if (iid == IID_WP_ALIENBLASTER) + return "this gun is of an unknown origin"; + if (iid == IID_WP_PIPERIFLE) + return "a homemade rifle made out of a steel pipe"; + if (iid == IID_WP_PIPERIFLE_S) + return "this pipe rifle has a silencer attached"; + if (iid == IID_WP_PIPERIFLE_SCOPE) + return "a crude scope has been attached to this pipe rifle"; + if (iid == IID_WP_PIPERIFLE_R) + return "a modified pipe rifle with a rod&spring replacement"; + if (iid == IID_WP_PIPERIFLE_S_R) + return "pipe rifle with a silencer and rod&spring replacement"; + if (iid == IID_WP_PIPERIFLE_SCOPE_R) + return "pipe rifle with a scope and rod&spring replacement"; + if (iid == IID_WP_PIPERIFLE_SCOPE_S) + return "pipe rifle with a scope and silencer"; + if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) + return "pipe rifle with a scope, silencer, and rod&spring"; + if (iid == IID_WP_WINCHESTER) + return "double-barrelled and sawed off"; + if (iid == IID_WP_MOSSBERG) + return "semi-auto combat shotgun, magazine fed"; + if (iid == IID_WP_JACKHAMMER) + return "the ultimate for close range battles"; + if (iid == IID_WP_MP9) + return "higher recoil due to larger .45 acp round"; + if (iid == IID_WP_MP9_S) + return "higher recoil due to larger .45 acp round"; + if (iid == IID_WP_MP7) + return "great all-around weapon; good burst fire"; + if (iid == IID_WP_MP7_S) + return "silenced 10mm smg; less recoil"; + if (iid == IID_WP_RANGEMASTER) + return "civilian battle rifle. sturdy and effective"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "civilian battle rifle. this one has a scope"; + if (iid == IID_WP_AK47) + return "an outdated assault rifle with extreme durability"; + if (iid == IID_WP_AK112) + return "a common assault rifle with extreme durability"; + if (iid == IID_WP_AK112_M) + return "this rifle has been modified to accept larger magazines"; + if (iid == IID_WP_DKS1) + return "this sturdy rifle fires .308, a larger, more reliable round"; + if (iid == IID_WP_DKS1_S) + return ".308 sniper rifle, silenced for stealth-ops"; + if (iid == IID_WP_DKS1) + return "semi-auto sniper rifle"; + if (iid == IID_WP_MOONLIGHT) + return "decent rifle with extra utility"; + if (iid == IID_WP_G11) + return "a prototype rifle that uses caseless ammo"; + if (iid == IID_WP_GAUSERIFLE) + return "fires extremely high-velocity rounds"; + if (iid == IID_WP_PULSERIFLE) + return "high-tech plasma weapon released just before the war"; + if (iid == IID_WP_TURBOPLASMA) + return "modified plasma rifle for greater heat and pressure dissipation"; + if (iid == IID_WP_PLASMACARBINE) + return "prototype plasma rifle released during the final stages of the war"; + if (iid == IID_WP_FNFAL) + return "rifle designed for longer range; high recoil"; + if (iid == IID_WP_ROCKETLAUNCHER) + return "great for devastating tactical strikes"; + if (iid == IID_WP_LASERGATLING) + return "quite simply, the ultimate in heavy firepower"; + + + + if (iid == IID_AM_NEEDLER) + return "good armor-peircing properties"; + if (iid == IID_AM_2MMEC) + return "virtually ignores armor"; + if (iid == IID_AM_10MM) + return "jacketed hollow-points for good damage"; + if (iid == IID_AM_556MM) + return "standard rifle round, moderate recoil"; + if (iid == IID_AM_5MMHIGHVEL) + return "experimental high-velocity rifle ammo"; + if (iid == IID_AM_12GAUGESHELLS) + return "the old standard, has trouble with heavy armor"; + if (iid == IID_AM_ENERGYCELL) + return "this energy cell comes from an unknown origin"; + if (iid == IID_AM_762MM) + return "good stopping power and armor-piercing performance"; + if (iid == IID_AM_44MAGNUM) + return "full metal jacket, hit 'em hard"; + if (iid == IID_AM_WARSAW) + return "ancient soviet rifle round, used in the ak47"; + if (iid == IID_AM_45ACP) + return "a common pistol round with good stopping power"; + if (iid == IID_AM_ROCKET) + return "expensive and extremely lethal"; + if (iid == IID_AM_CASELESS) + return "a brick of small-caliber caseless ammo"; + + + if (iid == IID_GREN_FRAG) + return "all-purpose fragmentation grenade"; + if (iid == IID_GREN_EMP) + return "useful against robots and cyborgs"; + if (iid == IID_GREN_SMOKE) + return "very useful for a quick getaway!"; + if (iid == IID_GREN_FLASH) + return "temporarily blinds nearby enemies"; + if (iid == IID_GREN_STUN) + return "delivers a forceful shock to nearby enemies"; + if (iid == IID_GREN_FLARE) + return "provides a blue light for shadowy areas"; + + if (iid == IID_ARM_DESERT) + return "the light armor of a raider; makes a great disguise"; + if (iid == IID_ARM_SHIRT) + return "featherweight body armor with good stealth and mobility"; + if (iid == IID_ARM_LEATHER) + return "made of thick, tanned brahmin hide"; + if (iid == IID_ARM_KEVLAR) + return "a suit of dragon skin(tm), reduces all damage to blunt trauma"; + if (iid == IID_ARM_METAL) + return "metal plates deflect smaller attacks easily"; + if (iid == IID_ARM_COMBAT) + return "made from defensive polymers, the yardstick of armors"; + if (iid == IID_ARM_BROTHERHOOD) + return "enhanced combat armor with anti-explosive plating"; + if (iid == IID_ARM_FORCE) + return "experimental energy-field armor, very low absorb"; + if (iid == IID_ARM_LPOWER) + return "this heavy armor contains servos that assist with movement"; + + + if (iid == IID_CHEM_STIMPACK) + return "advanced healing chem that replaces lost blood"; + if (iid == IID_CHEM_MEDICALBAG) + return "first aid kit with many high-tech supplies"; + if (iid == IID_CHEM_SUPERSTIM) + return "contains nanobots that heal very fast"; + if (iid == IID_CHEM_ADRENALINE) + return "boosts the metabolism, increasing jump and run speed"; + if (iid == IID_CHEM_PSYCHO) + return "unknown chemicals, probably of military origin"; + if (iid == IID_CHEM_BESERK) + return "unknown chemicals, probably of military origin"; + if (iid == IID_CHEM_RADX) + return "powerful anti-radiation pills"; + + if (iid == IID_BUILD_MRAMMO) - return "a military prototype, the mr. ammo was designed to allow soldiers an extra source of ammunition in remote areas, as the handy little machine is capable of churning out ammo from things such as rocks, debris, and metal scraps."; + return "provides extra ammunition"; + if (iid == IID_BUILD_SHIELDGEN) + return "protects all nearby allies"; + if (iid == IID_BUILD_AUTODOC) + return "the auto-doc will repair injuries"; + if (iid == IID_BUILD_ROBOFANG) + return "robofang guardian unit"; + if (iid == IID_BUILD_TTURRET) + return "dispatches hostile intruders"; + if (iid == IID_BUILD_RTURRET) + return "rocket turret"; + if (iid == IID_BUILD_GTURRET) + return "machine-gun turret"; + + + if (iid == IID_EQUIP_MEDIC_BAG) + return "allows more chems to be carried"; + if (iid == IID_EQUIP_GOGGLES) + return "protects against visual impairments"; + if (iid == IID_EQUIP_SILENCER) + return "attaches to any smallarm"; + if (iid == IID_EQUIP_BELTPOUCH) + return "useful for carrying extra grenades"; + if (iid == IID_EQUIP_TOOLKIT) + return "for picking all sorts of locks"; + if (iid == IID_EQUIP_BACKPACK) + return "this handy bag lets you carry more ammunition"; if (iid == IID_EQUIP_CLIMBINGGEAR) - return "FIXME:\nActivate, and then run at and up a wall. Don't look too far away from the wall!"; + return "for those hard to reach places"; + if (iid == IID_EQUIP_BATTERY) + return "provides prolonged battery life"; + if (iid == IID_EQUIP_STEALTHBOY) + return "makes user blurry and hard to see"; + if (iid == IID_EQUIP_EXTENDER) + return "gives a weapon slightly longer range and damage"; + if (iid == IID_EQUIP_XRAY) + return "allows for enemy detection through walls"; + + if (iid == IID_MISC_NUKACOLA) + return "a bottle of tasty nuka-cola"; + if (iid == IID_MISC_JUNK) + return "metallic bits, pipe and other debris"; + if (iid == IID_MISC_CHEMICALS) + return "standard household cleaner"; + if (iid == IID_MISC_AEROSOL) + return "a half-full aerosol can"; + if (iid == IID_MISC_RDXCRYSTAL) + return "a batch of highly unstable explosive crystals"; + if (iid == IID_MISC_STEELPIPE) + return "a slightly rusted steel pipe"; + if (iid == IID_MISC_DUCKTAPE) + return "ancient, but still highly functional"; + if (iid == IID_MISC_LCD) + return "an lcd from a Lameboy DS videogame unit"; + if (iid == IID_MISC_CIRCUITBOARD) + return "a corroded circuit board from a remote control"; + if (iid == IID_MISC_COPPERWIRE) + return "a small spool of thin copper wire"; + if (iid == IID_MISC_HMXCOMPOUND) + return "a small amount of high-grade military explosive"; + if (iid == IID_MISC_GUM) + return "trident chewing gum, limited edition watermelon flavor"; + if (iid == IID_MISC_XRAYTUBE) + return "??? a strange device ???"; bprint(PRINT_MEDIUM, ftos(iid), " without a desc!\n"); - return strcat("", ftos(iid)); + return strcat("", ftos(iid)); }; string(float iid) GetItemImage = @@ -959,63 +1934,91 @@ string(float iid) GetItemImage = return "blank.jpg"; - if (iid == IID_WP_TOOLKIT) - return "toolkit.jpg"; + if (iid == IID_WP_WRENCH) + return "wrench.jpg"; if (iid == IID_WP_KNIFE) return "knife.jpg"; if (iid == IID_WP_AXE) - return "axe.jpg"; - if (iid == IID_WP_VIBROBLADE) - return "ripper.jpg"; + return "disruptor.jpg"; + if (iid == IID_WP_SPEAR) + return "spear.jpg"; if (iid == IID_WP_POWERAXE) - return "poweraxe.jpg"; + return "disruptor.jpg"; if (iid == IID_WP_USP) return "usp.jpg"; + if (iid == IID_WP_USP_S) + return "usp.jpg"; + if (iid == IID_WP_GLOCK) + return "glock.jpg"; + if (iid == IID_WP_GLOCK_S) + return "glock.jpg"; if (iid == IID_WP_DEAGLE) return "deagle.jpg"; + if (iid == IID_WP_DEAGLE_M) + return "deagle.jpg"; if (iid == IID_WP_NEEDLER) return "needler.jpg"; if (iid == IID_WP_ALIENBLASTER) - return "blaster.jpg"; - if (iid == IID_WP_PIPERIFLE) + return "ppistol.jpg"; + if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) return "prifle.jpg"; if (iid == IID_WP_WINCHESTER) return "double.jpg"; if (iid == IID_WP_MOSSBERG) - return "mossberg.jpg"; + return "citykiller.jpg"; if (iid == IID_WP_JACKHAMMER) return "jackhammer.jpg"; if (iid == IID_WP_MP9) return "mp9.jpg"; if (iid == IID_WP_MP7) return "ggun.jpg"; + if (iid == IID_WP_MP9_S) + return "mp9.jpg"; + if (iid == IID_WP_MP7_S) + return "ggun.jpg"; if (iid == IID_WP_RANGEMASTER) return "rangem.jpg"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "rangem_s.jpg"; + if (iid == IID_WP_AK47) + return "ak47.jpg"; if (iid == IID_WP_AK112) return "ak112.jpg"; + if (iid == IID_WP_AK112_M) + return "ak112.jpg"; if (iid == IID_WP_AK74) - return "ak74.jpg"; + return "ak47.jpg"; + if (iid == IID_WP_ACR) + return "acr.jpg"; if (iid == IID_WP_DKS1) return "dks1.jpg"; + if (iid == IID_WP_DKS1_S) + return "dks1_s.jpg"; if (iid == IID_WP_MOONLIGHT) return "moonlight.jpg"; - if (iid == IID_WP_SA80) - return "sa80.jpg"; + if (iid == IID_WP_G11) + return "g11.jpg"; if (iid == IID_WP_GAUSERIFLE) return "grifle.jpg"; if (iid == IID_WP_PULSERIFLE) - return "lcarbine.jpg"; + return "plasmar.jpg"; + if (iid == IID_WP_TURBOPLASMA) + return "turbo.jpg"; + if (iid == IID_WP_PULSERIFLE) + return "carbine.jpg"; if (iid == IID_WP_FNFAL) return "fnfal.jpg"; if (iid == IID_WP_ROCKETLAUNCHER) return "rpg.jpg"; + if (iid == IID_WP_LASERGATLING) + return "gatling.jpg"; if (iid == IID_AM_NEEDLER) return "needles.jpg"; if (iid == IID_AM_2MMEC) - return "2mm.jpg"; + return "2mmec.jpg"; if (iid == IID_AM_10MM) return "10mm.jpg"; if (iid == IID_AM_556MM) @@ -1030,11 +2033,14 @@ string(float iid) GetItemImage = return "762mm.jpg"; if (iid == IID_AM_44MAGNUM) return "44mag.jpg"; + if (iid == IID_AM_WARSAW) + return "762mm.jpg"; if (iid == IID_AM_45ACP) return "45acp.jpg"; if (iid == IID_AM_ROCKET) return "rocket.jpg"; - + if (iid == IID_AM_CASELESS) + return "caseless.jpg"; if (iid == IID_GREN_FRAG) return "frag.jpg"; @@ -1044,16 +2050,21 @@ string(float iid) GetItemImage = return "smoke.jpg"; if (iid == IID_GREN_FLASH) return "flash.jpg"; + if (iid == IID_GREN_STUN) + return "stun.jpg"; + if (iid == IID_GREN_FLARE) + return "flare.jpg"; - + if (iid == IID_ARM_DESERT) + return "desert.jpg"; if (iid == IID_ARM_SHIRT) return "shirt.jpg"; if (iid == IID_ARM_LEATHER) return "leather.jpg"; if (iid == IID_ARM_KEVLAR) - return "kevlar.jpg"; + return "doublek.jpg"; if (iid == IID_ARM_METAL) - return "metal.jpg"; + return "ceramic.jpg"; if (iid == IID_ARM_COMBAT) return "combat.jpg"; if (iid == IID_ARM_BROTHERHOOD) @@ -1067,13 +2078,15 @@ string(float iid) GetItemImage = if (iid == IID_CHEM_STIMPACK) return "stimpack.jpg"; if (iid == IID_CHEM_MEDICALBAG) - return "medbag.jpg"; + return "medkit.jpg"; if (iid == IID_CHEM_SUPERSTIM) return "superstim.jpg"; if (iid == IID_CHEM_ADRENALINE) return "adrenaline.jpg"; if (iid == IID_CHEM_PSYCHO) return "psycho.jpg"; + if (iid == IID_CHEM_RADX) + return "radx.jpg"; if (iid == IID_CHEM_BESERK) return "beserk.jpg"; @@ -1093,12 +2106,56 @@ string(float iid) GetItemImage = if (iid == IID_BUILD_GTURRET) return "gturret.jpg"; + if (iid == IID_EQUIP_MEDIC_BAG) + return "equip/medbag.jpg"; + if (iid == IID_EQUIP_GOGGLES) + return "equip/goggles.jpg"; + if (iid == IID_EQUIP_SILENCER) + return "equip/silencer.jpg"; + if (iid == IID_EQUIP_BELTPOUCH) + return "equip/beltpouch.jpg"; + if (iid == IID_EQUIP_TOOLKIT) + return "equip/WRENCH2.jpg"; + if (iid == IID_EQUIP_BACKPACK) + return "equip/haversack.jpg"; if (iid == IID_EQUIP_CLIMBINGGEAR) - return "robofang.jpg"; + return "equip/cgear.jpg"; + if (iid == IID_EQUIP_BATTERY) + return "equip/battery.jpg"; if (iid == IID_EQUIP_STEALTHBOY) - return "stealthboy.jpg"; - if (iid == IID_EQUIP_SPRINTKIT) - return "sprintkit.jpg"; + return "equip/stealthboy.jpg"; + if (iid == IID_EQUIP_EXTENDER) + return "equip/silencer.jpg"; + if (iid == IID_EQUIP_XRAY) + return "equip/xray.jpg"; + + + if (iid == IID_MISC_NUKACOLA) + return "junk/nukacola.jpg"; + if (iid == IID_MISC_JUNK) + return "junk/junk.jpg"; + if (iid == IID_MISC_CHEMICALS) + return "junk/chemicals.jpg"; + if (iid == IID_MISC_AEROSOL) + return "junk/aerosol.jpg"; + if (iid == IID_MISC_RDXCRYSTAL) + return "junk/rdxcrystal.jpg"; + if (iid == IID_MISC_STEELPIPE) + return "junk/pipe.jpg"; + if (iid == IID_MISC_DUCKTAPE) + return "junk/tape.jpg"; + if (iid == IID_MISC_LCD) + return "junk/lcd.jpg"; + if (iid == IID_MISC_CIRCUITBOARD) + return "junk/board.jpg"; + if (iid == IID_MISC_COPPERWIRE) + return "junk/wire.jpg"; + if (iid == IID_MISC_HMXCOMPOUND) + return "junk/hmx.jpg"; + if (iid == IID_MISC_GUM) + return "junk/gum.jpg"; + if (iid == IID_MISC_XRAYTUBE) + return "junk/tube.jpg"; bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n"); return strcat("unknown.jpg", ftos(iid)); @@ -1109,18 +2166,20 @@ float(string itname) ItemIDOfName = { if (itname == "nothing") return IID_NONE; - if (itname == "toolkit") - return IID_WP_TOOLKIT; + if (itname == "WRENCH") + return IID_WP_WRENCH; if (itname == "knife") return IID_WP_KNIFE; - if (itname == "axe") + if (itname == "hand-axe") return IID_WP_AXE; - if (itname == "ripper") - return IID_WP_VIBROBLADE; + if (itname == "spear") + return IID_WP_SPEAR; if (itname == "poweraxe") return IID_WP_POWERAXE; - if (itname == "1911") + if (itname == "usp") return IID_WP_USP; + if (itname == "glock") + return IID_WP_GLOCK; if (itname == "desert eagle") return IID_WP_DEAGLE; if (itname == "deagle") @@ -1145,31 +2204,51 @@ float(string itname) ItemIDOfName = return IID_WP_MP7; if (itname == "rangemaster") return IID_WP_RANGEMASTER; + if (itname == "rangemaster (scope)") + return IID_WP_RANGEMASTER_SCOPE; if (itname == "fnfal") return IID_WP_FNFAL; + if (itname == "ak-47") + return IID_WP_AK112; if (itname == "ak-112") return IID_WP_AK112; + if (itname == "ak-112 m") + return IID_WP_AK112_M; if (itname == "ak-74") return IID_WP_AK74; + if (itname == "acr") + return IID_WP_ACR; if (itname == "dks-1") return IID_WP_DKS1; + if (itname == "dks-1 silenced") + return IID_WP_DKS1_S; if (itname == "moonlight") return IID_WP_MOONLIGHT; - if (itname == "sa-80") - return IID_WP_SA80; + if (itname == "g11") + return IID_WP_G11; if (itname == "gauss rifle") return IID_WP_GAUSERIFLE; - if (itname == "laser carbine") + if (itname == "phased plasma rifle") return IID_WP_PULSERIFLE; + if (itname == "plasma carbine") + return IID_WP_PLASMACARBINE; + if (itname == "turbo plasma rifle") + return IID_WP_TURBOPLASMA; if (itname == "rocket") return IID_WP_ROCKETLAUNCHER; + if (itname == "laser minigun") + return IID_WP_LASERGATLING; if (itname == "frag grenade") return IID_GREN_FRAG; + if (itname == "stun grenade") + return IID_GREN_STUN; + if (itname == "stun flare") + return IID_GREN_FLARE; if (itname == "emp grenade") return IID_GREN_EMP; if (itname == "smoke grenade") return IID_GREN_SMOKE; - if (itname == "flashbang") + if (itname == "flash grenade") return IID_GREN_FLASH; if (itname == "bulletproof shirt") return IID_ARM_SHIRT; @@ -1201,6 +2280,8 @@ float(string itname) ItemIDOfName = return IID_CHEM_ADRENALINE; if (itname == "psycho") return IID_CHEM_PSYCHO; + if (itname == "rad-x") + return IID_CHEM_RADX; if (itname == "beserk") return IID_CHEM_BESERK; if (itname == "mr.ammo") @@ -1225,6 +2306,39 @@ float(string itname) ItemIDOfName = return IID_EQUIP_CLIMBINGGEAR; if (itname == "stealthboy") return IID_EQUIP_STEALTHBOY; + if (itname == "xray") + return IID_EQUIP_XRAY; + if (itname == "extender") + return IID_EQUIP_EXTENDER; + + if (itname == "nukacola") + return IID_MISC_NUKACOLA; + if (itname == "junk") + return IID_MISC_JUNK; + if (itname == "chemicals") + return IID_MISC_CHEMICALS; + if (itname == "aerosol") + return IID_MISC_AEROSOL; + if (itname == "rdx") + return IID_MISC_RDXCRYSTAL; + if (itname == "steelpipe") + return IID_MISC_STEELPIPE; + if (itname == "duct-tape") + return IID_MISC_DUCKTAPE; + if (itname == "lcd") + return IID_MISC_LCD; + if (itname == "circuit board") + return IID_MISC_CIRCUITBOARD; + if (itname == "copper wire") + return IID_MISC_COPPERWIRE; + if (itname == "nukacola") + return IID_MISC_NUKACOLA; + if (itname == "hmx compound") + return IID_MISC_HMXCOMPOUND; + if (itname == "chewing gum") + return IID_MISC_GUM; + if (itname == "x-ray tube") + return IID_MISC_XRAYTUBE; if (itname == "sprintkit") return IID_EQUIP_SPRINTKIT; @@ -1239,11 +2353,177 @@ float(string itname) ItemIDOfName = float(float slotno, float iid) FitsInSlot = { + if (IsEquip(iid)) + return false; + if (!iid) //nothing can be put in every slot. return true; if (slotno == 1 || slotno == 2) return IsShootable(iid); if (slotno == 3) return IsArmor(iid); + if (slotno == 4) + return IsEquip(iid); + if (slotno == 17) + return IsJunk(iid); + if (slotno == 18) + return IsJunk(iid); + if (slotno == 19) + return IsJunk(iid); + if (slotno == 20) + return IsJunk(iid); + if (slotno == 21) + return IsJunk(iid); + if (slotno == 22) + return IsJunk(iid); + if (slotno == 23) + return IsJunk(iid); + if (slotno == 24) + return IsJunk(iid); + return true; +}; + +string (float slot, float int) PerkName = +{ + if (int == 1) + return "unbreakable"; + if (int == 2) + return "feral swiftness"; + if (int == 3) + return "stunt man"; + if (int == 4) + return "kick in the door!"; + if (int == 5) + return "quick draw"; + if (int == 6) + return "light step"; + if (int == 7) + return "surprise attack"; + if (int == 8) + return "large and in charge"; + if (int == 9) + return "nintendo gamer"; + if (int == 10) + return "duck and cover"; + if (int == 11) + return "last man standing"; + if (int == 12) + return "bodysnatcher"; + if (int == 13) + return "natural aim"; + if (int == 14) + return "dark alchemist"; + if (int == 15) + return "commando"; + if (int == 16) + return "power shot"; + if (int == 17) + return "one in a million"; + if (int == 18) + return "master blaster"; + if (int == 19) + return "death wish"; +}; + +string(float int) GetPerkImage = +{ + if (int == 1) + return "gui/perks/ironman.jpg"; + else if (int == 2) + return "gui/perks/swiftness.jpg"; + else if (int == 3) + return "gui/perks/stuntman.jpg"; + else if (int == 4) + return "gui/perks/kickin.jpg"; + else if (int == 5) + return "gui/perks/quickdraw.jpg"; + else if (int == 6) + return "gui/perks/lightstep.jpg"; + else if (int == 7) + return "gui/perks/surprise.jpg"; + else if (int == 8) + return "gui/perks/large.jpg"; + else if (int == 9) + return "gui/perks/nintendo.jpg"; + else if (int == 10) + return "gui/perks/redscare.jpg"; + else if (int == 11) + return "gui/perks/lastman.jpg"; + else if (int == 12) + return "gui/perks/bodysnatcher.jpg"; + else if (int == 13) + return "gui/perks/sixthsense.jpg"; + else if (int == 14) + return "gui/perks/alchemist.jpg"; + else if (int == 15) + return "gui/perks/eastern.jpg"; + else if (int == 16) + return "gui/perks/powershot.jpg"; + else if (int == 17) + return "gui/perks/million.jpg"; + else if (int == 18) + return "gui/perks/demoman.jpg"; + else if (int == 19) + return "gui/perks/lightning.jpg"; + else + return "gui/perks/none.jpg"; + +}; + + +string(float int) GetPerkDesc = +{ + if (int == 1) + return "25% damage resist bonus while at half health"; + else if (int == 2) + return "provides a flat 10% bonus movement speed"; + else if (int == 3) + return "instant stance change, fast prone movement"; + else if (int == 4) + return "smash down locked doors and chests very loudly"; + else if (int == 5) + return "fast reloading, instant weapon switching"; + else if (int == 6) + return "reduced footsteps, +10% sneak, don't trip traps"; + else if (int == 7) + return "25% damage bonus to any enemy not targetting you"; + else if (int == 8) + return "gain melee knockback and berserker speed"; + else if (int == 9) + return "you'll sometimes enter 'the zone'!"; + else if (int == 10) + return "+25% miss chance when taking cover"; + else if (int == 11) + return "recover hit points as you mow down foes"; + else if (int == 12) + return "become a master of disguise by looting dead bodies"; + else if (int == 13) + return "you can perform quicker aimed shots"; + else if (int == 14) + return "mix chems together to make better ones"; + else if (int == 15) + return "you have mastered martial arts and kick attacks"; + else if (int == 16) + return "25% damage bonus to your aimed shots"; + else if (int == 17) + return "you sometimes get very, very lucky with anything"; + else if (int == 18) + return "bigger crosshairs means even bigger damage bonus"; + else if (int == 19) + return "20% damage bonus and you also take 20% more damage"; + else + return ""; + +}; + +float (float int) getperk = +{ + + if (self.perk1 == int) + return TRUE; + else if (self.perk2 == int) + return TRUE; + else + return FALSE; }; \ No newline at end of file diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index c8c319d2b..7d938a498 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -3,6 +3,9 @@ void() W_SetCurrentAmmo; BE .8 .3 .4 IN COLOR */ void(entity to, float iid, float count) AddStackable; +void (entity jeb, float time) spawn_excla; +void() AmmoTouch; +void() shop_face; void() SUB_regen = { @@ -12,10 +15,321 @@ void() SUB_regen = setorigin (self, self.origin); }; +float() crandom; +void () Levelshake = +{ + local entity te; + + te = findradius (self.origin, 1400); + while (te) + { + if (te.classname == "player") + stuffcmd (te, "v_idlescale 4\n"); + + if (te.classname == "monster") + te.alert = 120; + + te = te.chain; + } +}; + +void(vector pos) throw_debris = +{ + local entity tank, oself; + local float oldz; + + oself = self; + tank = spawn(); + self = tank; + + self.origin = pos; + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_BOUNCE; + self.takedamage = DAMAGE_NO; + + if (random()<0.5) + setmodel (self, "progs/junk1.mdl"); + else + setmodel (self, "progs/junk2.mdl"); + + setsize (self, '0 0 0', '0 0 0'); + + self.velocity_y = random()*900 - random()*900; + self.velocity_x = random()*900 - random()*900; + self.velocity_z = 400 + random()*400; + + self.avelocity_x = random()*600; + self.avelocity_y = random()*600; + self.avelocity_z = random()*600; + + self.think = SUB_Remove; + self.nextthink = time + 2+random()*2; + + self = oself; + +}; + +void() fueltank_explode = +{ + throw_debris(self.origin); + throw_debris(self.origin); + throw_debris(self.origin); + throw_debris(self.origin); + throw_debris(self.origin); + + bprint(2, "an enemy fuel tank has been destroyed!\n"); + self.takedamage = DAMAGE_NO; + self.classname = "explo_box"; + Levelshake(); + T_RadiusDamage2 (self, self.owner, 50+random()*100, other, 200); + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_EXPLOSION); + WriteCoord (MSG_MULTICAST, self.origin_x); + WriteCoord (MSG_MULTICAST, self.origin_y); + WriteCoord (MSG_MULTICAST, self.origin_z+32); + multicast (self.origin, MULTICAST_PHS); + supplies = supplies - 1; + remove (self); +}; + +void(vector pos) FuelTankSmall = +{ + local entity item, oself; + precache_model ("maps/b_exbox2.bsp"); + + item = spawn(); + oself = self; + self = item; + setorigin (self, pos); + setmodel (self, "maps/b_exbox2.bsp"); + supplies += 1; + self.rtime = 1; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -16', '16 16 24'); + self.health = 50; + self.th_die = fueltank_explode; + self.takedamage = DAMAGE_AIM; + self.classname = "fueltank"; + self.netname = "fuel tank"; + self.movetype = MOVETYPE_STEP; + self = oself; +}; + +void() FuelTankLarge = +{ + local entity item, oself; + precache_model ("maps/b_explob.bsp"); + + item = spawn(); + oself = self; + self = item; + setmodel (self, "maps/b_explob.bsp"); + supplies += 1; + self.rtime = 1; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -16', '16 16 48'); + self.health = 50; + self.th_die = fueltank_explode; + self.takedamage = DAMAGE_AIM; + self.classname = "fueltank"; + self.netname = "fuel tank"; + self.movetype = MOVETYPE_STEP; + self = oself; +}; + + +void(vector pos) obj_fueltank = +{ + FuelTankLarge(); + + if (random()<0.25) + FuelTankSmall(pos + '0 64 0'); + if (random()<0.25) + FuelTankSmall(pos + '0 -64 0'); + if (random()<0.25) + FuelTankSmall(pos + '64 0 0'); + if (random()<0.25) + FuelTankSmall(pos + '-64 0 0'); +}; + + +void () food_touch = +{ + if (other.classname != "player") + return; + + if (self.rtime > 0) + { + self.rtime = 0; + bprint(2, "food crate has been secured.\n"); + + other.score = other.score + 10; + + if (random()<0.25) + sound (self, CHAN_BODY, "effects/radio1.wav", 1, ATTN_NONE); + else if (random()<0.25) + sound (self, CHAN_BODY, "effects/radio2.wav", 1, ATTN_NONE); + else if (random()<0.25) + sound (self, CHAN_BODY, "effects/radio3.wav", 1, ATTN_NONE); + else + sound (self, CHAN_BODY, "effects/radio4.wav", 1, ATTN_NONE); + + supplies = supplies - 1; + spawn_excla(self, 3000); + } + +}; + +void() FoodCrate = +{ + setmodel (self, "maps/crate.bsp"); + self.touch = food_touch; + supplies += 1; + self.rtime = 1; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 0', '16 16 16'); + self.takedamage = DAMAGE_NO; + self.touch = food_touch; + self.movetype = MOVETYPE_STEP; + self.classname = "foodcrate"; +}; + +void() treasure_touch = +{ + if (other.classname != "player") + return; + if (self.picking > 0) + return; + + if (self.attack_finished < time) + { + sound (self, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); + sprint(other, 2, "this metal box is locked.\n"); + if (other.class == 2 || other.class == 4) + { + sprint(other, 2, "you may attempt to pick this\n"); + sprint(other, 2, "by pressing your 'action' key\n"); + } + } + self.attack_finished = time + 2; + return; +}; + + +void() bomb_touch = +{ + if (other.classname != "player") + return; + if (self.picking > 0) + return; + + if (self.attack_finished < time) + { + sound (self, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); + sprint(other, 2, "this is a high-tech bomb.\n"); + if (other.class == 4) + { + sprint(other, 2, "you may attempt to deactivate this\n"); + sprint(other, 2, "bomb by pressing your 'action' key\n"); + } + } + self.attack_finished = time + 2; + return; +}; + +void() Explosive = +{ + if (random()*100<=25) + { + remove(self); + return; + } + + setmodel (self, "progs/bomb.mdl"); + self.touch = bomb_touch; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 0', '16 16 16'); + self.takedamage = DAMAGE_NO; + self.movetype = MOVETYPE_STEP; + self.classname = "bomb"; + droptofloor(); +}; + +void() TreasureChest = +{ + setorigin(self, self.origin + '0 0 64'); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_x = crandom()*200; + self.velocity_y = crandom()*200; + self.velocity_z = -200; + + self.avelocity_y = crandom()*200; + + setmodel (self, "progs/ammobox2.mdl"); + self.touch = treasure_touch; + self.solid = SOLID_BBOX; + setsize (self, '-12 -12 0', '12 12 12'); + self.takedamage = DAMAGE_NO; + self.classname = "treasure_chest"; +}; + +void() car_rock = +{ + self.frame = self.frame + 1; + + if (self.frame >= 11) + self.frame = 0; + + self.nextthink = time + 0.1 + (self.cnt*0.025); + self.think = car_rock; + self.cnt = self.cnt + 1; +}; + +void() car_rock2 = +{ + if (random()<0.5) + sound (self, CHAN_BODY, "effects/metal-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "effects/metal-2.wav", 1, ATTN_NORM); +}; + +void() car_touch = +{ + if (other.classname != "player") + return; + + if (self.attack_finished < time) + { + self.think = car_rock; + self.nextthink = time + 0.1; + self.cnt = 1; + } + self.attack_finished = time + 4; + return; +}; + +void() BlownUpCar = +{ + setmodel (self, "progs/BlownUp.mdl"); + self.origin = self.origin + '0 0 32'; + self.touch = car_touch; + self.solid = SOLID_SLIDEBOX; + self.helmet = 2; + setsize (self, '-32 -32 0', '32 32 32'); + self.islot3 = SlotVal(IID_ARM_METAL, 1); + self.takedamage = DAMAGE_AIM; + self.health = 90000; + self.th_pain = car_rock2; + self.movetype = MOVETYPE_BOUNCE; + self.classname = "car"; +}; /*QUAKED noclass (0 0 0) (-8 -8 -8) (8 8 8) prints a warning message when spawned +376 5857 +354 8501 */ void() noclass = { @@ -95,6 +409,182 @@ void(float timeleft) DropQuad = void() r_touch; +void () BombBeep = +{ + local float r; + + r = range (self.enemy); + + if (r != RANGE_MELEE || self.enemy.health <= 0) + { + self.owner.picking = 0; + self.enemy.picking = 0; + self.enemy.currentmenu = "none"; + remove(self.tumbler1); + remove(self.tumbler2); + remove(self); + return; + } + + self.inplace = 0; + self.tumbler1.inplace = 0; + self.tumbler2.inplace = 0; + self.model = ""; + self.tumbler1.model = ""; + self.tumbler2.model = ""; + + if (random() < 0.75) + { + self.inplace = 1; + self.model = "progs/radio.spr"; + } + if (random() < 0.75) + { + self.tumbler1.inplace = 1; + self.tumbler1.model = "progs/radio.spr"; + } + if (random() < 0.75) + { + self.tumbler2.inplace = 1; + self.tumbler2.model = "progs/radio.spr"; + } + + + self.think = BombBeep; + self.nextthink = time + 0.3+random()*0.6; + self.enemy.chest = self; + self.enemy.currentmenu = "menu_defuse"; + + if (random() < 0.5) + sound (self, CHAN_BODY, "items/lockpick1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "items/lockpick2.wav", 1, ATTN_NORM); + +}; + + +void (entity portal, entity toucher) SpawnBomb = +{ + local entity open, t1, t2; + + makevectors (toucher.v_angle); + + open = spawn(); + setmodel(open, "progs/radio.spr"); + setorigin (open, toucher.origin + '0 0 48' + v_forward*64); + setsize (open, VEC_ORIGIN, VEC_ORIGIN); + open.think = BombBeep; + open.nextthink = time + random()*0.2; + open.enemy = toucher; + open.owner = portal; + open.owner.rtime = 3; + + t1 = spawn(); + setmodel(t1, "progs/radio.spr"); + setorigin (t1, toucher.origin + '0 0 48' + v_forward*64 + v_right*32); + setsize (t1, VEC_ORIGIN, VEC_ORIGIN); + t1.enemy = toucher; + t1.owner = portal; + + t2 = spawn(); + setmodel(t2, "progs/radio.spr"); + setorigin (t2, toucher.origin + '0 0 48' + v_forward*64 - v_right*32); + setsize (t2, VEC_ORIGIN, VEC_ORIGIN); + t2.enemy = toucher; + t2.owner = portal; + + open.tumbler1 = t1; + open.tumbler2 = t2; +}; + +void () OpenChestBeep = +{ + local float r; + + r = range (self.enemy); + + if (r != RANGE_MELEE || self.enemy.health <= 0) + { + self.owner.picking = 0; + self.enemy.picking = 0; + self.enemy.currentmenu = "none"; + remove(self.tumbler1); + remove(self.tumbler2); + remove(self); + return; + } + + self.inplace = 0; + self.tumbler1.inplace = 0; + self.tumbler2.inplace = 0; + self.model = ""; + self.tumbler1.model = ""; + self.tumbler2.model = ""; + + if (random() < 0.5) + { + self.inplace = 1; + self.model = "progs/radio.spr"; + } + if (random() < 0.5) + { + self.tumbler1.inplace = 1; + self.tumbler1.model = "progs/radio.spr"; + } + if (random() < 0.5) + { + self.tumbler2.inplace = 1; + self.tumbler2.model = "progs/radio.spr"; + } + + + self.think = OpenChestBeep; + self.nextthink = time + 0.2+random()*0.4; + self.enemy.chest = self; + self.enemy.currentmenu = "menu_lockpick"; + + if (random() < 0.5) + sound (self, CHAN_BODY, "items/lockpick1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "items/lockpick2.wav", 1, ATTN_NORM); + +}; + + +void (entity portal, entity toucher) SpawnOpenChest = +{ + local entity open, t1, t2; + + makevectors (toucher.v_angle); + + open = spawn(); + setmodel(open, "progs/radio.spr"); + setorigin (open, toucher.origin + '0 0 48' + v_forward*64); + setsize (open, VEC_ORIGIN, VEC_ORIGIN); + open.think = OpenChestBeep; + open.nextthink = time + random()*0.2; + open.enemy = toucher; + open.owner = portal; + + t1 = spawn(); + setmodel(t1, "progs/radio.spr"); + setorigin (t1, toucher.origin + '0 0 48' + v_forward*64 + v_right*32); + setsize (t1, VEC_ORIGIN, VEC_ORIGIN); + t1.enemy = toucher; + t1.owner = portal; + + t2 = spawn(); + setmodel(t2, "progs/radio.spr"); + setorigin (t2, toucher.origin + '0 0 48' + v_forward*64 - v_right*32); + setsize (t2, VEC_ORIGIN, VEC_ORIGIN); + t2.enemy = toucher; + t2.owner = portal; + + open.tumbler1 = t1; + open.tumbler2 = t2; +}; + + void() r_touch = { local string s; @@ -235,39 +725,27 @@ void() item_megahealth_rot; void() item_health = { - self.touch = health_touch; - if (self.spawnflags & H_ROTTEN) - { - precache_model("maps/b_bh10.bsp"); - - precache_sound("items/r_item1.wav"); - setmodel(self, "maps/b_bh10.bsp"); - self.noise = "items/r_item1.wav"; - self.healamount = 15; - self.healtype = 0; - } - else if (self.spawnflags & H_MEGA) - { - precache_model("maps/b_bh100.bsp"); - precache_sound("items/r_item2.wav"); - setmodel(self, "maps/b_bh100.bsp"); - self.noise = "items/r_item2.wav"; - self.healamount = 100; - self.healtype = 2; - } + TreasureChest(); else { + if (random()*100<=75) + { + remove(self); + return; + } + + self.touch = health_touch; precache_model("maps/b_bh25.bsp"); precache_sound("items/health1.wav"); setmodel(self, "maps/b_bh25.bsp"); self.noise = "items/health1.wav"; self.healamount = 25; self.healtype = 1; + setsize (self, '0 0 0', '32 32 56'); + StartItem (); } - setsize (self, '0 0 0', '32 32 56'); - StartItem (); }; @@ -275,14 +753,21 @@ float (entity to, float iid, float quant) TryGiveStackable = { local float slot; local float item; + local float x; + + x = 300; + + if (ToIID(self.islot4) == IID_EQUIP_BACKPACK) + x = 600; + slot = SlotOfItem(to, iid); - if (slot > 2) + if (slot > 4) { item = ItemInSlot(to, slot); - if (ToStatus(item) + quant > 500) //500 is our maxstack value here + if (ToStatus(item) + quant > x) //300 is our maxstack value here { - quant = quant + ToStatus(item) - 500; - SetItemSlot(to, slot, SlotVal(iid, 500)); + quant = quant + ToStatus(item) - x; + SetItemSlot(to, slot, SlotVal(iid, x)); slot = 0; return false; } @@ -303,6 +788,7 @@ float (entity to, float iid, float quant) TryGiveStackable = return true; }; + void () health_touch = { if (!triggercantouch(self, other)) @@ -319,13 +805,9 @@ void () health_touch = if (other.ghost != 0) return; - if (!TryGiveStackable(other, IID_CHEM_STIMPACK, 1)) - { - if (self.spamdelay < time) - sprint(other, 2, "full inventory.\n"); - self.spamdelay = time + 1; + if (!TryGiveStackable(other, IID_CHEM_STIMPACK, 1)) return; - } + sprint (other, PRINT_HIGH, "picked up a stimpack.\n"); if (random()*4 <= 2) @@ -434,7 +916,22 @@ void() armor_touch = /*QUAKED item_armor1 (0 .5 .8) (-16 -16 0) (16 16 32) */ -void() item_armor1_finish = +void() buyzone1 = +{ + SUB_UseTargets (); + + + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/enforcer.mdl"); + self.skin = 0; + setsize (self, '-16 -16 -24', '16 16 32'); + setorigin(self, self.origin + '0 0 24'); + self.classname = "merchant"; +}; + +void() buyzone2 = { SUB_UseTargets (); @@ -447,11 +944,31 @@ void() item_armor1_finish = setorigin(self, self.origin + '0 0 24'); self.classname = "merchant"; }; + +void() item_armor1_finish = +{ + SUB_UseTargets (); + + + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/enforcer.mdl"); + self.skin = 0; + setsize (self, '-16 -16 -24', '16 16 32'); + setorigin(self, self.origin + '0 0 24'); + self.classname = "merchant"; + self.think = shop_face; + self.nextthink = time + 0.5; +}; void() item_armor1 = { - precache_model ("progs/enforcer.mdl"); - self.think = item_armor1_finish; - self.nextthink = time + 0.1; + if (random()<0.50) + { + precache_model ("progs/enforcer.mdl"); + self.think = item_armor1_finish; + self.nextthink = time + 0.1; + } }; /*QUAKED item_armor2 (0 .5 .8) (-16 -16 0) (16 16 32) @@ -459,12 +976,19 @@ void() item_armor1 = void() item_armor2 = { - self.touch = armor_touch; - precache_model ("progs/armor.mdl"); - setmodel (self, "progs/armor.mdl"); - self.skin = 1; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); + if (random()<0.50) + { + precache_model ("progs/enforcer.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + setmodel (self, "progs/enforcer.mdl"); + self.skin = 0; + setsize (self, '-16 -16 -24', '16 16 32'); + setorigin(self, self.origin + '0 0 24'); + self.classname = "merchant"; + self.think = shop_face; + self.nextthink = time + 0.5; + } }; /*QUAKED item_armorInv (0 .5 .8) (-16 -16 0) (16 16 32) @@ -472,12 +996,19 @@ void() item_armor2 = void() item_armorInv = { - self.touch = armor_touch; - precache_model ("progs/armor.mdl"); - setmodel (self, "progs/armor.mdl"); - self.skin = 2; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); + if (random()<0.50) + { + precache_model ("progs/enforcer.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + setmodel (self, "progs/enforcer.mdl"); + self.skin = 0; + setsize (self, '-16 -16 -24', '16 16 32'); + setorigin(self, self.origin + '0 0 24'); + self.classname = "merchant"; + self.think = shop_face; + self.nextthink = time + 0.5; + } }; /* @@ -490,14 +1021,7 @@ WEAPONS void() bound_other_ammo = { - if (other.ammo_shells > 100) - other.ammo_shells = 100; - if (other.ammo_nails > 200) - other.ammo_nails = 200; - if (other.ammo_rockets > 100) - other.ammo_rockets = 100; - if (other.ammo_cells > 100) - other.ammo_cells = 100; + }; @@ -696,21 +1220,20 @@ void() weapon_touch = }; +void(vector place) hostage_new; + /*QUAKED weapon_supershotgun (0 .5 .8) (-16 -16 0) (16 16 32) */ + + void() weapon_supershotgun = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_shot.mdl"); - setmodel (self, "progs/g_shot.mdl"); - self.weapon = IT_SUPER_SHOTGUN; - self.netname = "Double-barrelled Shotgun"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + //weapon spawns are now either treasure chests + //or hostages that need to be rescued + + if (random()<0.25) + TreasureChest(); }; /*QUAKED weapon_nailgun (0 .5 .8) (-16 -16 0) (16 16 32) @@ -718,16 +1241,14 @@ if (deathmatch <= 3) void() weapon_nailgun = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_nail.mdl"); - setmodel (self, "progs/g_nail.mdl"); - self.weapon = IT_NAILGUN; - self.netname = "nailgun"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + if (world.map_obj == 2) + FoodCrate(); + else if (world.map_obj == 5) + obj_fueltank(self.origin); + else if (world.map_obj == 6) + Explosive(); + else + TreasureChest(); }; /*QUAKED weapon_supernailgun (0 .5 .8) (-16 -16 0) (16 16 32) @@ -735,16 +1256,14 @@ if (deathmatch <= 3) void() weapon_supernailgun = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_nail2.mdl"); - setmodel (self, "progs/g_nail2.mdl"); - self.weapon = IT_SUPER_NAILGUN; - self.netname = "Super Nailgun"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + if (world.map_obj == 2) + FoodCrate(); + else if (world.map_obj == 5) + obj_fueltank(self.origin); + else if (world.map_obj == 6) + Explosive(); + else if (random()*100 <= 40) + TreasureChest(); }; /*QUAKED weapon_grenadelauncher (0 .5 .8) (-16 -16 0) (16 16 32) @@ -752,16 +1271,16 @@ if (deathmatch <= 3) void() weapon_grenadelauncher = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_rock.mdl"); - setmodel (self, "progs/g_rock.mdl"); - self.weapon = 3; - self.netname = "Grenade Launcher"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + + if (world.map_obj == 2) + FoodCrate(); + else if (world.map_obj == 5) + obj_fueltank(self.origin); + else if (world.map_obj == 6) + Explosive(); + else if (random()*100 <= 40) + TreasureChest(); + }; /*QUAKED weapon_rocketlauncher (0 .5 .8) (-16 -16 0) (16 16 32) @@ -769,16 +1288,15 @@ if (deathmatch <= 3) void() weapon_rocketlauncher = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_rock2.mdl"); - setmodel (self, "progs/g_rock2.mdl"); - self.weapon = 3; - self.netname = "Rocket Launcher"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + if (world.map_obj == 2) + FoodCrate(); + else if (world.map_obj == 5) + obj_fueltank(self.origin); + else if (world.map_obj == 6) + Explosive(); + else if (random()*100 <= 40) + TreasureChest(); + }; @@ -787,16 +1305,16 @@ if (deathmatch <= 3) void() weapon_lightning = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_light.mdl"); - setmodel (self, "progs/g_light.mdl"); - self.weapon = 3; - self.netname = "Thunderbolt"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + + if (world.map_obj == 2) + FoodCrate(); + else if (world.map_obj == 5) + obj_fueltank(self.origin); + else if (world.map_obj == 6) + Explosive(); + else if (random()*100 <= 40) + TreasureChest(); + }; @@ -812,29 +1330,30 @@ float() GetRandomAmmo = { local float r; - r = random()*20; + r = random()*42; - if (r <= 2) - return IID_AM_NEEDLER; - else if (r <= 6) + if (r <= 5) return IID_AM_10MM; - else if (r <= 8) - return IID_AM_556MM; else if (r <= 10) - return IID_AM_5MMHIGHVEL; - else if (r <= 13) - return IID_AM_12GAUGESHELLS; - else if (r <= 14) - return IID_AM_ENERGYCELL; + return IID_AM_45ACP; else if (r <= 15) - return IID_AM_2MMEC; - else if (r <= 16) - return IID_AM_762MM; - else if (r <= 18) + return IID_AM_12GAUGESHELLS; + else if (r <= 20) return IID_AM_44MAGNUM; + else if (r <= 24) + return IID_AM_556MM; + else if (r <= 28) + return IID_AM_5MMHIGHVEL; + else if (r <= 32) + return IID_AM_762MM; + else if (r <= 36) + return IID_AM_NEEDLER; + else if (r <= 38) + return IID_AM_ENERGYCELL; + else if (r <= 40) + return IID_AM_2MMEC; else - return IID_AM_10MM; - + return IID_AM_CASELESS; }; float(float ammotype) GetAmmoCount = @@ -844,11 +1363,11 @@ float(float ammotype) GetAmmoCount = if (ammotype == IID_AM_NEEDLER) ammocount = 2 + random()*7; if (ammotype == IID_AM_10MM) - ammocount = 5 + random()*10; + ammocount = 5 + random()*5; if (ammotype == IID_AM_556MM) ammocount = 3 + random()*8; if (ammotype == IID_AM_5MMHIGHVEL) - ammocount = 5 + random()*10; + ammocount = 5 + random()*8; if (ammotype == IID_AM_12GAUGESHELLS) ammocount = 2 + random()*6; if (ammotype == IID_AM_ENERGYCELL) @@ -899,6 +1418,10 @@ void() ammo_touch = ammoname = GetItemName(ammotype); ammocountftos = ftos(ammocount); + if (random()*4 <= 2) + sound (other, CHAN_ITEM, "misc/item1.wav", 1, ATTN_NORM); + else + sound (other, CHAN_ITEM, "misc/item2.wav", 1, ATTN_NORM); // shotgun if (self.weapon == 1) @@ -912,11 +1435,8 @@ void() ammo_touch = if (random()*20 <= 10) { - other.ammo_shells = other.ammo_shells + 2; - if (coop == 1 && total_players == 1) - other.ammo_shells = other.ammo_shells + 2; - - sprint (other, 2, " and bottle caps.\n"); + other.ammo_shells = other.ammo_shells + ceil(10+random()*10); + sprint (other, 2, "& money.\n"); } else sprint (other, 2, "\n"); @@ -935,8 +1455,8 @@ void() ammo_touch = if (random()*20 <= 10) { - other.ammo_shells = other.ammo_shells + 2; - sprint (other, 2, " and bottle caps.\n"); + other.ammo_shells = other.ammo_shells + ceil(10+random()*10); + sprint (other, 2, " & money.\n"); } else sprint (other, 2, "\n"); @@ -954,8 +1474,8 @@ void() ammo_touch = if (random()*20 <= 10) { - other.ammo_shells = other.ammo_shells + 2; - sprint (other, 2, " and bottle caps.\n"); + other.ammo_shells = other.ammo_shells + ceil(5+random()*25); + sprint (other, 2, " & money.\n"); } else sprint (other, 2, "\n"); @@ -974,8 +1494,8 @@ void() ammo_touch = if (random()*20 <= 10) { - other.ammo_shells = other.ammo_shells + 2; - sprint (other, 2, " and bottle caps.\n"); + other.ammo_shells = other.ammo_shells + ceil(5+random()*25); + sprint (other, 2, " & money.\n"); } else sprint (other, 2, "\n"); @@ -1031,7 +1551,14 @@ void() item_shells = if (coop == 1 && random()*4 <= 2) return; - self.touch = ammo_touch; + self.islot1 = GetRandomAmmo(); + self.islot1 = self.islot1 * 512; + self.flash = ceil(random()*30); + self.touch = AmmoTouch; + if (random()<0.5) + self.islot2 = ceil(random()*20); + + if (self.spawnflags & WEAPON_BIG2) { @@ -1062,7 +1589,13 @@ void() item_spikes = if (coop == 1 && random()*4 <= 1) return; - self.touch = ammo_touch; + self.islot1 = GetRandomAmmo(); + self.islot1 = self.islot1 * 512; + self.flash = ceil(random()*30); + self.touch = AmmoTouch; + if (random()<0.5) + self.islot2 = ceil(random()*20); + if (self.spawnflags & WEAPON_BIG2) { @@ -1094,7 +1627,13 @@ void() item_rockets = if (coop == 1 && random()*4 <= 3) return; - self.touch = ammo_touch; + self.islot1 = GetRandomAmmo(); + self.islot1 = self.islot1 * 512; + self.flash = ceil(random()*30); + self.touch = AmmoTouch; + if (random()<0.5) + self.islot2 = ceil(random()*20); + if (self.spawnflags & WEAPON_BIG2) { @@ -1127,7 +1666,13 @@ void() item_cells = if (coop == 1 && random()*4 <= 2) return; - self.touch = ammo_touch; + self.islot1 = GetRandomAmmo(); + self.islot1 = self.islot1 * 512; + self.flash = ceil(random()*30); + self.touch = AmmoTouch; + if (random()<0.5) + self.islot2 = ceil(random()*20); + if (self.spawnflags & WEAPON_BIG2) { @@ -1162,11 +1707,16 @@ void() item_weapon = if (coop == 1 && random()*4 <= 3) return; - self.touch = ammo_touch; - - precache_model ("maps/b_shell0.bsp"); - setmodel (self, "maps/b_shell0.bsp"); + self.islot1 = GetRandomAmmo(); + self.islot1 = self.islot1 * 512; + self.flash = ceil(random()*30); + self.touch = AmmoTouch; + if (random()<0.5) + self.islot2 = ceil(random()*20); + precache_model ("progs/ammobox.mdl"); + setmodel (self, "progs/ammobox.mdl"); + self.skin = 2; setsize (self, '0 0 0', '32 32 56'); StartItem (); @@ -1479,17 +2029,8 @@ Player takes no damage from water or slime for 30 seconds */ void() item_artifact_envirosuit = { - self.touch = powerup_touch; - - precache_model ("progs/suit.mdl"); - precache_sound ("items/suit.wav"); - precache_sound ("items/suit2.wav"); - self.noise = "items/suit.wav"; - setmodel (self, "progs/suit.mdl"); - self.netname = "Biosuit"; - self.items = IT_SUIT; - setsize (self, '-16 -16 -24', '16 16 32'); - StartItem (); + remove(self); + return; }; @@ -1498,18 +2039,8 @@ Player is invisible for 30 seconds */ void() item_artifact_invisibility = { - self.touch = powerup_touch; - - precache_model ("progs/invisibl.mdl"); - precache_sound ("items/inv1.wav"); - precache_sound ("items/inv2.wav"); - precache_sound ("items/inv3.wav"); - self.noise = "items/inv1.wav"; - setmodel (self, "progs/invisibl.mdl"); - self.netname = "Ring of Shadows"; - self.items = IT_INVISIBILITY; - setsize (self, '-16 -16 -24', '16 16 32'); - StartItem (); + remove(self); + return; }; @@ -1518,22 +2049,8 @@ The next attack from the player will do 4x damage */ void() item_artifact_super_damage = { - self.touch = powerup_touch; - precache_model ("progs/quaddama.mdl"); - precache_sound ("items/damage.wav"); - precache_sound ("items/damage2.wav"); - precache_sound ("items/damage3.wav"); - self.noise = "items/damage.wav"; - setmodel (self, "progs/quaddama.mdl"); - if (deathmatch == 4) - self.netname = "OctaPower"; - else - self.netname = "Quad Damage"; - self.items = IT_QUAD; - self.effects = self.effects | EF_BLUE; - setsize (self, '-16 -16 -24', '16 16 32'); - StartItem (); + remove(self); }; @@ -1558,22 +2075,22 @@ void() BackpackTouch = if (self.weapon == 1) { - TryGiveStackable(other, IID_AM_10MM, floor(9+random()*9)); + TryGiveStackable(other, IID_AM_10MM, floor(9+random()*20)); sprint(other, 2, " 10mm ammo"); } else if (self.weapon == 2) { - TryGiveStackable(other, IID_AM_556MM, floor(5+random()*5)); + TryGiveStackable(other, IID_AM_556MM, floor(5+random()*15)); sprint(other, 2, " 5mm ammo"); } else if (self.weapon == 3) { - TryGiveStackable(other, IID_AM_12GAUGESHELLS, floor(3+random()*3)); + TryGiveStackable(other, IID_AM_12GAUGESHELLS, floor(3+random()*6)); sprint(other, 2, " 12 gauge ammo"); } else if (self.weapon == 4) { - TryGiveStackable(other, IID_AM_10MM, floor(9+random()*9)); + TryGiveStackable(other, IID_AM_10MM, floor(9+random()*20)); sprint(other, 2, " 10mm ammo"); } else @@ -1583,16 +2100,15 @@ void() BackpackTouch = ammoname = GetItemName(ammotype); sprint(other, 2, " "); sprint(other, 2, ammoname); + TryGiveStackable(other, ammotype, ammocount); } if (random()*4 <= 2) { - self.ammo_shells = self.ammo_shells + 3; - sprint(other, 2, " and some caps.\n"); - if (total_players == 1) - self.ammo_shells = self.ammo_shells + 3; + other.ammo_shells = other.ammo_shells + ceil(5+random()*20); + sprint(other, 2, " & money.\n"); } else sprint(other, 2, ".\n"); @@ -1601,12 +2117,28 @@ void() BackpackTouch = return; }; + /* =============== -DropBackpack +DropMoney =============== */ -void() DropBackpack = + +void() MoneyTouch = +{ + if (other.classname != "player") + return; + + if (other.health <= 0) + return; + + sound (self, CHAN_VOICE, "items/item1.wav", 1, ATTN_IDLE); + sprint(other, 2, "a small amount of wasteland currency.\n"); + other.ammo_shells += self.islot1; + remove(self); +}; + +void() DropMoney = { local entity item; @@ -1622,10 +2154,49 @@ void() DropBackpack = item.flags = FL_ITEM; item.solid = SOLID_TRIGGER; item.movetype = MOVETYPE_TOSS; - setmodel (item, "progs/backpack.mdl"); + setmodel (item, "progs/money.mdl"); setsize (item, '-16 -16 0', '16 16 56'); - item.touch = BackpackTouch; - + item.islot1 = 2 + random()*5; + item.skin = ToIID(item.islot1) - 506; + + item.touch = MoneyTouch; + + item.nextthink = time + 120; // remove after 2 minutes + item.think = SUB_Remove; +}; + + +/* +=============== +DropBackpack +=============== +*/ +void() DropBackpack = +{ + local entity item; + + + item = spawn(); + item.origin = self.origin - '0 0 24'; + + item.weapon = self.weapon; + + item.velocity_z = 300; + item.velocity_x = -100 + (random() * 200); + item.velocity_y = -100 + (random() * 200); + + item.flags = FL_ITEM; + item.solid = SOLID_TRIGGER; + item.movetype = MOVETYPE_TOSS; + setmodel (item, "progs/ammobox.mdl"); + setsize (item, '-16 -16 0', '16 16 56'); + item.islot1 = GetRandomAmmo(); + item.islot1 = item.islot1 * 512; + item.skin = ToIID(item.islot1) - 506; + + item.flash = ceil(random()*30); + item.touch = AmmoTouch; + item.nextthink = time + 120; // remove after 2 minutes item.think = SUB_Remove; }; diff --git a/quakec/fallout2/knight.qc b/quakec/fallout2/knight.qc index 8baa4a0a7..2f21e509f 100644 --- a/quakec/fallout2/knight.qc +++ b/quakec/fallout2/knight.qc @@ -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 (); }; diff --git a/quakec/fallout2/menus.qc b/quakec/fallout2/menus.qc index 0f9998670..6953b3c8b 100644 --- a/quakec/fallout2/menus.qc +++ b/quakec/fallout2/menus.qc @@ -36,12 +36,12 @@ weaponry\n\n string () ShopString = { - return ("--- S H O P -------\n" + return ("‘‘‘ supply merchant ‘‘‘\n" "\n" - "1‘ traits \n" - "2‘ perks \n" + "1‘ perk [slot 1] \n" + "2‘ perk [slot 2] \n" "3‘ body armour \n" - "4‘ protection \n" + "4‘ ammunition \n" "5‘ weapons \n" "6‘ equipment \n" "7‘ chems \n" @@ -54,7 +54,7 @@ string () WeaponString = return ("weaponry\n" "\n" "1‘ melee \n" - "2‘ thrown \n" + "2‘ explosives \n" "3‘ pistols&smgs \n" "4‘ shotguns \n" "5‘ rifles \n" @@ -66,36 +66,41 @@ string () TraitString = { return ("traits\n" "\n" - "1‘ one handed \n" - "2‘ small frame \n" - "3‘ bruiser \n" - "4‘ heavy handed \n" - "5‘ bloody mess \n" - "6‘ bad luck \n" - "e‘ leave \n"); + "1‘ unidextrous \n" + "2‘ ruthless \n" + "3‘ chem addict \n" + "4‘ red scare \n" + "5‘ living lightning \n" + "6‘ one in a million \n" + "e‘ leave \n"); }; + string () ThrownString = { - return ("grenades\n" - " GRENADE | COST \n" + return ("!‘ explosives !‘\n" "\n" - "1‘ smoke grenade 3$\n" - "2‘ frag grenade 4$\n" - "3‘ emp grenade 5$\n" - "4‘ flashbang 7$\n" - "e‘ exit \n"); + "1‘ flash bomb 8$\n" + "2‘ frag grenade 12$\n" + "3‘ ultra-light necklace 3$\n" + "4‘ hmx compound 2$\n" + "5‘ rdx crystals 2$\n" + "6‘ explosive rocket 10$\n" + "e‘ exit \n"); }; string () BuildString = { return ("BUILD A STRUCTURE\n" - " NAME | UPGRADE | SCRAPS\n" + " NAME COST IN JUNK\n" "\n" - "1‘ Mr. Ammo 4\n" - "2‘ Barricade 6\n" - "3‘ AutoDoc(tm) 10\n" - "4‘ Robo-Fang 11\n" + "1‘ Super Flash Bomb 4\n" + "2‘ Homemade Grenade 5\n" + "3‘ Needler Scope 5\n" + "4‘ Ghost Goggles 7\n" + "5‘ Gas Bomb 10\n" + "6‘ Deflector Ring 15\n" + "7‘ Auto-Doc 20\n" "e‘ exit \n"); }; @@ -116,45 +121,75 @@ string () ArmorString = { return ("body armour wt abs prc\n" "\n" - "1‘ light kevlar 03 1/20% 03$\n" - "2‘ leather armor 05 2/30% 08$\n" - "3‘ kevlar armor 09 3/35% 10$\n" - "4‘ metal armor 15 5/35% 12$\n" - "5‘ combat armor 12 4/40% 25$\n" - "6‘ brotherhood armor 17 5/45% 35$\n" - "7‘ force armor 06 7/10% 45$\n" - "8‘ metal armor mkii 20 8/50% 55$\n"); + "1‘ kevlar shirt 04 1/25% 50$\n" + "2‘ leather armor 07 3/30% 100$\n" + "3‘ double kevlar 09 1/50% 125$\n" + "4‘ ceramic armor 15 7/25% 150$\n" + "5‘ combat armor 12 6/40% 200$\n" + "6‘ brotherhood 17 7/45% 250$\n" + "7‘ force armor 06 9/15% 300$\n" + "8‘ power armor 25 8/50% 400$\n"); }; string () PerkString = { return ("perks\n" - " ABILITY | FRAGS NEEDED \n" "\n" - "1‘ bonus movement 2\n" - "2‘ strong back 2\n" - "3‘ quick pockets 2\n" - "4‘ awareness 2\n" - "5‘ silent running 3\n" - "6‘ better criticals 3\n" - "7‘ bonus ranged damage 3\n" - "8‘ divine favor 3\n" - "9‘ slayer 3\n" - "0‘ sharpshooter 4\n"); + " 1‘ unbreakable \n" + " 2‘ feral swiftness \n" + " 3‘ stunt man \n" + " 4‘ kick in the door! \n" + " 5‘ quick draw \n" + " 6‘ light step \n" + " 7‘ surprise attack \n" + " 8‘ large and in charge \n" + " 9‘ nintendo gamer \n" + " 0‘ extrasensory paranoia\n" + "F1‘ last man standing \n" + "F2‘ bodysnatcher \n" + "F3‘ natural aim \n" + "F4‘ dark alchemist \n" + "F5‘ renegade commando \n" + "F6‘ power shot \n" + "F7‘ one in a million \n" + "F8‘ master blaster \n" + "F9‘ death wish \n"); }; -string () ProtectString = + +string () AmmoString = { - return ("++ high-tech protective devices ++ \n" + return ("++ ammunition ++\n" "\n" - " HARDWARE | SHIELDS VS | PRICE \n" - "1‘ energy amulet |damage: 7% 15‘\n" - "2‘ force field |front: 15% 20‘\n" - "3‘ safety ring |absorb: 3 35‘\n" - "4‘ smokescreen |obscures 40‘\n" - "5‘ sentient cube |regenerate 45‘\n"); + " AMMO | POWER | TYPE | COST[50]\n" + "1‘ 10mm 2 FMJ 015‘\n" + "2‘ 12gauge 4 SHOT 025‘\n" + "3‘ 44 mag 3 AP 030‘\n" + "4‘ 45 acp 3 JHP 020‘\n" + "5‘ .223 3 FMJ 030‘\n" + "6‘ 5mm 3 JHP 025‘\n" + "7‘ .308 4 AP 040‘\n" + "8‘ needle 2 AP 035‘\n" + "9‘ caseless 3 FMJ 040‘\n" + "0‘ energycell 4 CELL 055‘\n"); }; +string () AmmoString2 = +{ + return ("++ ammunition ++\n" + "you get a discount when fighting ghouls!\n" + " AMMO | POWER | TYPE | COST[50]\n" + "1‘ 10mm 2 FMJ 005‘\n" + "2‘ 12gauge 4 N/A 008‘\n" + "3‘ 44 mag 3 AP 010‘\n" + "4‘ 45 acp 3 JHP 007‘\n" + "5‘ .223 3 FMJ 010‘\n" + "6‘ 5mm 3 JHP 008‘\n" + "7‘ .308 4 AP 015‘\n" + "8‘ needle 2 AP 010‘\n" + "9‘ caseless 3 FMJ 020‘\n" + "0‘ energycell 4 N/A 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 ("?‘ miscellaneous ?‘\n" "\n" - "\n" - "1‘ (25) bandages for medic 2$\n" - "3‘ (20) mr.ammo 20$\n" - "4‘ (20) auto-doc 20$\n" - "5‘ (20) shield-gen 20$\n" - "6‘ (20) tesla-turret 20$\n" - ; + "1‘ junk 1$\n" + "2‘ nuka-cola 1$\n" + "3‘ chemicals 2$\n" + "4‘ aerosol can 2$\n" + "5‘ circuitboard 5$\n" + "6‘ steel pipe 3$\n" + "7‘ duct tape 1$\n" + "8‘ chewing gum 1$\n" + "9‘ copper wire 1$\n" + "0‘ x-ray tube 7$\n"); }; @@ -186,10 +222,10 @@ string () MeleeString = return ("MELEE WEAPONS\n" "WEAPON | TYPE | WT | PRICE \n" "\n" - "1‘ knife melee 01 01$\n" - "2‘ hand axe melee 08 03$\n" - "3‘ vibroblade melee 04 10$\n" - "4‘ power axe melee 07 15$\n" + "1‘ knife 01 06$\n" + "2‘ wrench 03 08$\n" + "3‘ axe 08 09$\n" + "4‘ spear 04 12$\n" "e‘ exit \n"); }; @@ -209,12 +245,12 @@ string () PistolString = return ("Pistols and Submachineguns\n" " WEAPON | CAL | WEIGHT | PRICE \n" "\n" - "1‘ mk23 socom .45 01 5$\n" - "2‘ d. eagle .44 02 7$\n" - "3‘ needler pistol 02 9$\n" - "4‘ h&k mp7 4mm 03 14$\n" - "5‘ grease gun 9mm 03 17$\n" - "6‘ alien blaster 02 21$\n"); + "1‘ usp socom .45 01 50$\n" + "2‘ d. eagle .44 02 70$\n" + "3‘ glock 21 10mm 01 40$\n" + "4‘ needler pistol 02 120$\n" + "5‘ h&k mp10 10mm 03 150$\n" + "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" - "1‘ pipe rifle .44 02 4$\n" - "2‘ winchester 12g 03 8$\n" - "3‘ mossberg 12g 04 14$\n" - "4‘ citykiller 12g 05 35$\n"); + "1‘ pipe rifle .44 02 15$\n" + "2‘ winchester 12g 03 60$\n" + "3‘ citykiller 12g 04 240$\n" + "4‘ jackhammer 12g 07 350$\n"); }; /* @@ -241,13 +277,12 @@ string () RifleString = return ("rifles\n" " RIFLE | TYPE | WEIGHT | PRICE \n" "\n" - "1‘ rangemaster 7mm 03 11$\n" - "2‘ ak-112 5mm 04 21$\n" - "3‘ remington .308 05 24$\n" - "4‘ ak-74 5mm 04 27$\n" - "5‘ moonlight .223 05 36$\n" - "6‘ sa-80 5mm 05 32$\n" - "7‘ fn-fal .308 09 25$\n"); + "1‘ rangemaster 223 03 110$\n" + "2‘ ak-112 5mm 04 180$\n" + "3‘ fn fal 308 08 190$\n" + "4‘ widowmaker 308 10 270$\n" + "5‘ moonlight 223 05 280$\n" + "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" - "1‘ rocket launcher 10 30$\n" - "2‘ gauss rifle 07 32$\n" - "3‘ laser carbine 12 45$\n"); + "1‘ rpg-7 missile launcher 10 350$\n" + "2‘ m72 gauss rifle 07 550$\n" + "3‘ plasma pistol 02 250$\n" + "4‘ m25a2 phased plasma rifle 11 450$\n" + "5‘ m95a1 plasma carbine 08 550$\n" + "6‘ rsb-80 heavy plasma gun 25 650$\n"); }; string () ChemString = { return ("drugs\n DRUG | EFFECTS | PRICE\n" "\n" - "1‘ stimpack heals 05+20 3$\n" - "2‘ medkit+ heals 10+50 5$\n" - "3‘ superstim* heals 20+60 12$\n" - "4‘ adrenaline*+speed/jump 10$\n" - "5‘ jet* aim better 18$\n" - "e‘ exit \n" + "1‘ stimpack heal over time 10$\n" + "2‘ rad-x anti-radiation 15$\n" + "3‘ adrenaline*+speed/jump 15$\n" + "4‘ medkit* endless heal 25$\n" + "5‘ superstim* instant heal 25$\n" + "6‘ psycho* +resist damage 25$\n" + "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" - "1‘ adrenaline +60 speed/jump 3$\n" - "2‘ stimpack heals 40 5$\n" - "3‘ psycho+ +60 hp/no pain 11$\n" - "4‘ medkit* heals 20+50 12$\n" - "5‘ berserk* adren+psycho 12$\n" + "1‘ adrenaline +60 speed/jump 5$\n" + "2‘ stimpack heals 40 10$\n" + "3‘ psycho+ +60 hp/no pain 15$\n" + "4‘ medkit* heals 20+50 15$\n" + "5‘ berserk* adren+psycho 15$\n" "6‘ jet* aim better 15$\n" "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" - "1‘ medic's bag 15c‘\n" - "2‘ security alarm 15c‘\n" - "3‘ remote camera 15c‘\n" - "4‘ belt pouch 15c‘\n" - "5‘ backpack 15c‘\n" - "6‘ toolkit mark ii 15c‘\n" - "7‘ climbing gear 15c‘\n" - "8‘ enhanced battery 15c‘\n" - "9‘ stealth boy 45c‘\n" + "we only let you use one of these!\n" + "1‘ medic's bag 5c‘\n" + "2‘ ghost goggles 5c‘\n" + "3‘ stealth boy 5c‘\n" + "4‘ belt pouch 5c‘\n" + "5‘ backpack 5c‘\n" + "6‘ toolkit mark ii 5c‘\n" + "7‘ climbing gear 5c‘\n" + "8‘ enhanced battery 5c‘\n" "\n"); }; + + +string () EnterString = +{ + return ("‘‘‘‘ fallout ‘‘‘‘\n" + "‘ a post-nuclear fps ‘\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" + " ‘ www.fteqw.com ‘ \n" + "\n" + "press 1 to continue‘\n" + "\n" + + "\n"); +}; + + +string () WaitString = +{ + return ("‘‘‘‘ fallout ‘‘‘‘\n" + "‘ a post-nuclear fps ‘\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" + " ‘ www.fteqw.com ‘ \n" + "\n" + "wait until next round‘\n" + "\n" + + "\n"); +}; + +string () LockpickString = +{ + return ("‘ Picking ‘\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" + "press 1 to pick‘\n" + "press 2 to quit‘\n"); +}; + +string () DefuseString = +{ + return ("‘ Defuse ‘\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" + "press 1 to pick‘\n" + "press 2 to quit‘\n"); +}; + + + +string () MissionString = +{ + return ("‘‘‘ mission select ‘‘‘\n" + "\n" + "\n" + "1‘ get new mission\n" + "2‘ grab one later \n\n\n"); +}; + +string () DepartString = +{ + return ("‘‘‘ saddle up! ‘‘‘\n" + "\n" + "\n" + "1‘ take off to mission site\n" + "2‘ wait a second \n\n\n"); +}; \ No newline at end of file diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index ab5ed4477..55dc05bbd 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -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; +}; + + diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index 2f4ce1d5b..67d761afe 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -1,4 +1,6 @@ +void (entity chest, float iid, float num) DropFromChest; + void(entity to, float iid, float amount) AddNonStackable = { local float slot; @@ -30,6 +32,40 @@ void(float cost, float iid) BuyStackable = return; } + if (!TryGiveStackable(self, iid)) + { + sprint(self, 2, "full inventory.\n"); + return; + } + + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + self.ammo_shells = self.ammo_shells - cost; + + sprint(self, PRINT_HIGH, "you bought a "); + + z = GetItemName(iid); + sprint(self, PRINT_HIGH, z); + sprint(self, PRINT_HIGH, "\n"); + self.impulse = 0; +}; + +void(float cost, float iid, float amount) BuyStackableMulti = +{ + local string z; + + if (self.ammo_shells < cost) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "not enough money.\n"); + return; + } + + if (!TryGiveStackable(self, iid)) + { + sprint(self, 2, "full inventory.\n"); + return; + } + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); self.ammo_shells = self.ammo_shells - cost; @@ -41,8 +77,6 @@ void(float cost, float iid) BuyStackable = //put grenade in inventory //finds existing grenades, otherwise, empty slot - - TryGiveStackable(self, iid, 1); }; void() BuyBandages = @@ -79,11 +113,12 @@ void() BuyBandages = sprint(self, PRINT_HIGH, "/50 bandages.\n"); }; -void(float cost, float type) BuyChem = +void(float cost, float type, float count) BuyChem = { local string chemname; local float max; local float alreadygot; + local float typex; if (self.ammo_shells < cost) { @@ -91,25 +126,120 @@ void(float cost, float type) BuyChem = sprint(self, PRINT_HIGH, "not enough money.\n"); return; } - if (type != IID_CHEM_STIMPACK && self.class != 1) + + //only medics and engineers can buy superstims + if (type == IID_CHEM_SUPERSTIM && self.class != 1 && self.class != 4) { self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "not a medic.\n"); + sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); + sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); return; } - if (self.equipment == 1) - max = 4; - else - max = 2; + //only medics and engineers can buy adrenaline + if (type == IID_CHEM_ADRENALINE && self.class != 1 && self.class != 4) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); + sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); + return; + } + + //only medics can buy psycho + if (type == IID_CHEM_PSYCHO && self.class != 1) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); + sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); + return; + } + + //only medics can buy berserk + if (type == IID_CHEM_BESERK && self.class != 1) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); + sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); + return; + } + + //only medics can buy the doctor bag + if (type == IID_CHEM_MEDICALBAG && self.class != 1) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "you will need a higher doctor skill\n"); + sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); + return; + } + + if (type == IID_CHEM_STIMPACK) + max = 4; + if (type == IID_CHEM_SUPERSTIM) + max = 1; if (type == IID_CHEM_MEDICALBAG) max = 50; + if (type == IID_CHEM_ADRENALINE) + max = 25; + if (type == IID_CHEM_PSYCHO) + max = 25; + if (type == IID_CHEM_BESERK) + max = 25; + if (type == IID_CHEM_RADX) + max = 5; + + if (self.class == 1) + max = max + 1; + + if (ToIID(self.islot4) == IID_EQUIP_MEDIC_BAG) + max = max * 2; alreadygot = TotalQuantity(self, type); if (alreadygot >= max) { self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "you can't hold any more chems.\n"); + sprint(self, PRINT_HIGH, "you can't hold any more of those chems.\n"); + return; + } + + //can only carry two types of chem + typex = 0; + if (SlotOfItem(self, IID_CHEM_STIMPACK) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_SUPERSTIM) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_MEDICALBAG) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_ADRENALINE) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_PSYCHO) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_BESERK) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_RADX) > 0) + typex = typex + 1; + + max = 2; + + if (self.class == 1) + max = 4; + if (ToIID(self.islot4) == IID_EQUIP_MEDIC_BAG) + max = 4; + + if (typex >= max) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "only authorized to carry "); + if (max == 2) + sprint(self, PRINT_HIGH, "two types of chems (non-medic)\n"); + else + sprint(self, PRINT_HIGH, "four types of chems (medic)\n"); + + return; + } + + if (!TryGiveStackable(self, type, count)) + { + sprint(self, 2, "full inventory.\n"); return; } @@ -118,7 +248,6 @@ void(float cost, float type) BuyChem = chemname = GetItemName(type); sprint(self, PRINT_HIGH, chemname); sprint(self, PRINT_HIGH, " purchased.\n"); - TryGiveStackable(self, type, 1); }; void(string type) ChangeAmmo = @@ -189,59 +318,30 @@ void (float wt, float cost, float wid) BuyWeapon = }; -void (float cost, float item) BuyPerk = +void (float cost, float item, float slot) BuyPerk = { - if (self.frags < cost) + + if (slot == 1 && self.perk2 == item) { - sprint (self, PRINT_HIGH, "not enough kills\n"); - self.currentmenu = "none"; + sprint (self, PRINT_HIGH, "you already know that ability!\n"); return; } - sprint (self, PRINT_HIGH, "ok, ability gained.\n"); - self.perk = item; + if (slot == 2 && self.perk1 == item) + { + sprint (self, PRINT_HIGH, "you already know that ability!\n"); + return; + } + + sprint (self, PRINT_HIGH, "you have learned a new ability in the wastes.\n"); + + if (slot == 1) + self.perk1 = item; + else if (slot == 2) + self.perk2 = item; self.currentmenu = "none"; return; }; -/* -void (float wt, float cost, float item) BuyArmor = -{ - - local float curr; - local float lbs; - local string x; - - lbs = weightx (); - if (((item >= TE_LIGHTNING2) && (self.protect >= SPAWNFLAG_SUPERSPIKE))) - { - sprint (self, PRINT_HIGH, "remove your hardware before buying\nany kind of advanced armor!\ntoo much interference otherwise."); - self.currentmenu = "none"; - return; - } - if ((cost > self.ammo_shells)) - { - sprint (self, PRINT_HIGH, "not enough money.\n"); - self.currentmenu = "none"; - return; - } - if ((((lbs + wt) - GetItemsWeight(self.islot3)) > self.max_weight)) - { - sprint (self, PRINT_HIGH, "you can't carry that much.\n"); - self.currentmenu = "none"; - return; - } - sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); - self.ammo_shells = (self.ammo_shells - cost); -// self.armor_weight = wt; - self.armor = item; - x = GetArmorName(); - sprint (self, PRINT_HIGH, x); - sprint (self, PRINT_HIGH, " purchased.\n"); - - return; - -};*/ - void (float wt, float cost, float item) BuyArmor = { local string z; @@ -269,11 +369,11 @@ void (float wt, float cost, float item) BuyArmor = x = FindEmptySlot(self); - if (x == 0) - sprint(self, 2, "no more room. giving armor to merchant.\n"); +// if (x == 0) +// sprint(self, 2, "no more room. giving armor to merchant.\n"); - if (x != 0) //found a place to stick old armor - SetItemSlot(self, x, SlotVal(self.islot3, 1)); +// if (x != 0) //found a place to stick old armor +// SetItemSlot(self, x, SlotVal(self.islot3, 1)); SetItemSlot(self, 3, SlotVal(item, 1)); }; @@ -291,8 +391,10 @@ void (float cost, float item) BuyEquipment = return; } sound (self, CHAN_BODY, "items/item1.wav", 1, ATTN_NORM); - self.equipment = item; - x = GetEquipmentName(); + + x = GetItemName(item); + SetItemSlot(self, 4, SlotVal(item, 1)); + sprint (self, PRINT_HIGH, x); sprint (self, PRINT_HIGH, " purchased.\n"); self.ammo_shells = (self.ammo_shells - cost); @@ -335,66 +437,58 @@ float (float input) overweight = tmp = input + self.weight; max = self.max_weight; - if (self.class == TE_LIGHTNING2) - { - max = max + SPAWNFLAG_LASER; - } - if (self.perk == TE_LAVASPLASH) - { - return (FALSE); - } + if (tmp > max) - { return (TRUE); - } else - { return (FALSE); - } }; void () W_GetClass = { if ((self.currentmenu == "select_skill")) { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); if (self.impulse == 1) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 80; - self.class = 1; + self.tclass = 1; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nMedic - OK?\n1‘ Yes \n2‘ No \n"); self.ghost = 0; return; } if ((self.impulse == 2)) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 70; - self.class = 2; + self.tclass = 2; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nAssassin - OK?\n1‘ Yes \n2‘ No \n"); self.ghost = 0; return; } if (self.impulse == 3) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 100; - self.class = 3; + self.tclass = 3; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nSoldiier - OK?\n1‘ Yes \n2‘ No \n"); self.ghost = 0; return; } if (self.impulse == 4) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.max_health = 80; self.currentmenu = "none"; - self.class = 4; + self.tclass = 4; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nScientist - OK?\n1‘ Yes \n2‘ No \n"); self.ghost = 0; return; } @@ -407,19 +501,21 @@ void () W_GetClass = void() W_PlayerMenu = { + local float xx; + local string yy, q, x; + if (self.currentmenu == "none") return; - - if (self.currentmenu == "shop_list") + else if (self.currentmenu == "shop_list") { if (self.impulse == 1) - self.currentmenu = "shop_trait"; + self.currentmenu = "shop_perk1"; if (self.impulse == 2) - self.currentmenu = "shop_perk"; + self.currentmenu = "shop_perk2"; if (self.impulse == 3) self.currentmenu = "shop_armor"; if (self.impulse == 4) - self.currentmenu = "shop_protect"; + self.currentmenu = "shop_ammo"; if (self.impulse == 5) self.currentmenu = "shop_weapons"; if (self.impulse == 6) @@ -432,89 +528,175 @@ void() W_PlayerMenu = DisplayMenu(); return; } - - if (self.currentmenu == "shop_trait") + else if (self.currentmenu == "shop_perk1") { if (self.impulse == 1) - self.currentmenu = "shop_trait"; + BuyPerk(1, 1, 1); if (self.impulse == 2) - self.currentmenu = "shop_perk"; + BuyPerk(1, 2, 1); if (self.impulse == 3) - self.currentmenu = "shop_armor"; + BuyPerk(1, 3, 1); if (self.impulse == 4) - self.currentmenu = "shop_protect"; + BuyPerk(2, 4, 1); if (self.impulse == 5) - self.currentmenu = "shop_weapons"; + BuyPerk(2, 5, 1); if (self.impulse == 6) - self.currentmenu = "shop_equipment"; + BuyPerk(2, 6, 1); if (self.impulse == 7) - self.currentmenu = "shop_chems"; + BuyPerk(2, 7, 1); if (self.impulse == 8) - self.currentmenu = "shop_other"; - - DisplayMenu(); - return; - } - if (self.currentmenu == "shop_perk") - { - if (self.impulse == 1) - BuyPerk(1, 1); - if (self.impulse == 2) - BuyPerk(1, 2); - if (self.impulse == 3) - BuyPerk(1, 3); - if (self.impulse == 4) - BuyPerk(2, 4); - if (self.impulse == 5) - BuyPerk(2, 5); - if (self.impulse == 6) - BuyPerk(2, 6); - if (self.impulse == 7) - BuyPerk(2, 7); - if (self.impulse == 8) - BuyPerk(3, 8); + BuyPerk(3, 8, 1); if (self.impulse == 9) - BuyPerk(4, 9); + BuyPerk(4, 9, 1); + if (self.impulse == 10) + BuyPerk(4, 10, 1); + if (self.impulse == 212) + BuyPerk(4, 11, 1); + if (self.impulse == 213) + BuyPerk(4, 12, 1); + if (self.impulse == 214) + BuyPerk(4, 13, 1); + if (self.impulse == 215) + BuyPerk(4, 14, 1); + if (self.impulse == 216) + BuyPerk(4, 15, 1); + if (self.impulse == 217) + BuyPerk(4, 16, 1); + if (self.impulse == 218) + BuyPerk(4, 17, 1); + if (self.impulse == 219) + BuyPerk(4, 18, 1); + if (self.impulse == 220) + BuyPerk(4, 19, 1); + return; } - if (self.currentmenu == "shop_armor") + if (self.currentmenu == "shop_perk2") { if (self.impulse == 1) - BuyArmor(3, 03, IID_ARM_SHIRT); //weight, cost, item + BuyPerk(1, 1, 2); if (self.impulse == 2) - BuyArmor(7, 05, IID_ARM_LEATHER); //weight, cost, item + BuyPerk(1, 2, 2); if (self.impulse == 3) - BuyArmor(9, 10, IID_ARM_KEVLAR); //weight, cost, item + BuyPerk(1, 3, 2); if (self.impulse == 4) - BuyArmor(15, 12, IID_ARM_METAL); //weight, cost, item + BuyPerk(2, 4, 2); if (self.impulse == 5) - BuyArmor(12, 25, IID_ARM_COMBAT); //weight, cost, item + BuyPerk(2, 5, 2); if (self.impulse == 6) - BuyArmor(17, 35, IID_ARM_BROTHERHOOD); //weight, cost, item + BuyPerk(2, 6, 2); if (self.impulse == 7) - BuyArmor(5, 45, IID_ARM_FORCE); //weight, cost, item + BuyPerk(2, 7, 2); if (self.impulse == 8) - BuyArmor(20, 55, IID_ARM_LPOWER); //weight, cost, item + BuyPerk(3, 8, 2); + if (self.impulse == 9) + BuyPerk(4, 9, 2); + if (self.impulse == 10) + BuyPerk(4, 10, 2); + if (self.impulse == 212) + BuyPerk(4, 11, 2); + if (self.impulse == 213) + BuyPerk(4, 12, 2); + if (self.impulse == 214) + BuyPerk(4, 13, 2); + if (self.impulse == 215) + BuyPerk(4, 14, 2); + if (self.impulse == 216) + BuyPerk(4, 15, 2); + if (self.impulse == 217) + BuyPerk(4, 16, 2); + if (self.impulse == 218) + BuyPerk(4, 17, 2); + if (self.impulse == 219) + BuyPerk(4, 18, 2); + if (self.impulse == 220) + BuyPerk(4, 19, 2); return; } - if (self.currentmenu == "shop_protect") + else if (self.currentmenu == "shop_armor") { if (self.impulse == 1) - BuyProtect(20, 1); + BuyArmor(3, 50, IID_ARM_SHIRT); //weight, cost, item if (self.impulse == 2) - BuyProtect(20, 2); + BuyArmor(7, 100, IID_ARM_LEATHER); //weight, cost, item if (self.impulse == 3) - BuyProtect(30, 3); + BuyArmor(9, 125, IID_ARM_KEVLAR); //weight, cost, item if (self.impulse == 4) - BuyProtect(30, 4); + BuyArmor(15, 150, IID_ARM_METAL); //weight, cost, item if (self.impulse == 5) - BuyProtect(40, 5); + BuyArmor(12, 200, IID_ARM_COMBAT); //weight, cost, item + if (self.impulse == 6) + BuyArmor(17, 250, IID_ARM_BROTHERHOOD); //weight, cost, item + if (self.impulse == 7) + BuyArmor(5, 300, IID_ARM_FORCE); //weight, cost, item + if (self.impulse == 8) + BuyArmor(20, 400, IID_ARM_LPOWER); //weight, cost, item return; } - if (self.currentmenu == "shop_weapons") + else if (self.currentmenu == "shop_ammo" && world.map_obj != 4) + { + if (self.impulse == 1) + BuyStackableMulti(15,IID_AM_10MM,50); + if (self.impulse == 2) + BuyStackableMulti(25,IID_AM_12GAUGESHELLS,50); + if (self.impulse == 3) + BuyStackableMulti(30,IID_AM_44MAGNUM,50); + if (self.impulse == 4) + BuyStackableMulti(20,IID_AM_45ACP,50); + if (self.impulse == 5) + BuyStackableMulti(30,IID_AM_556MM,50); + if (self.impulse == 6) + BuyStackableMulti(25,IID_AM_5MMHIGHVEL,50); + if (self.impulse == 7) + BuyStackableMulti(40,IID_AM_762MM,50); + if (self.impulse == 8) + BuyStackableMulti(35,IID_AM_NEEDLER,50); + if (self.impulse == 9) + BuyStackableMulti(40,IID_AM_CASELESS, 50); + if (self.impulse == 10) + BuyStackableMulti(55,IID_AM_ENERGYCELL,50); + + if (random() < 0.5) + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + + return; + } + else if (self.currentmenu == "shop_ammo" && world.map_obj == 4) + { + if (self.impulse == 1) + BuyStackableMulti(5,IID_AM_10MM,50); + if (self.impulse == 2) + BuyStackableMulti(8,IID_AM_12GAUGESHELLS,50); + if (self.impulse == 3) + BuyStackableMulti(10,IID_AM_44MAGNUM,50); + if (self.impulse == 4) + BuyStackableMulti(7,IID_AM_45ACP,50); + if (self.impulse == 5) + BuyStackableMulti(10,IID_AM_556MM,50); + if (self.impulse == 6) + BuyStackableMulti(8,IID_AM_5MMHIGHVEL,50); + if (self.impulse == 7) + BuyStackableMulti(15,IID_AM_762MM,50); + if (self.impulse == 8) + BuyStackableMulti(10,IID_AM_NEEDLER,50); + if (self.impulse == 9) + BuyStackableMulti(20,IID_AM_CASELESS, 50); + if (self.impulse == 10) + BuyStackableMulti(15,IID_AM_ENERGYCELL,50); + + if (random() < 0.5) + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + + return; + } + else if (self.currentmenu == "shop_weapons") { if (self.impulse == 1) self.currentmenu = "shop_melee"; @@ -532,154 +714,168 @@ void() W_PlayerMenu = DisplayMenu(); return; } - if (self.currentmenu == "shop_melee") + else if (self.currentmenu == "shop_melee") { if (self.impulse == 1) - BuyWeapon(1, 1, IID_WP_KNIFE); //weight, cost, item + BuyWeapon(1, 6, IID_WP_KNIFE); //weight, cost, item if (self.impulse == 2) - BuyWeapon(6, 3, IID_WP_AXE); //weight, cost, item + BuyWeapon(3, 8, IID_WP_WRENCH); //weight, cost, item if (self.impulse == 3) - BuyWeapon(3, 10, IID_WP_VIBROBLADE); //weight, cost, item + BuyWeapon(8, 9, IID_WP_AXE); //weight, cost, item if (self.impulse == 4) - BuyWeapon(10, 15, IID_WP_POWERAXE); //weight, cost, item + BuyWeapon(4, 12, IID_WP_SPEAR); //weight, cost, item return; } - if (self.currentmenu == "shop_thrown") + else if (self.currentmenu == "shop_thrown") { if (self.impulse == 1) - BuyStackable(3, IID_GREN_SMOKE); //weight, cost, item + BuyStackableMulti(8, IID_GREN_FLASH, 1); //weight, cost, item if (self.impulse == 2) - BuyStackable(4, IID_GREN_FRAG); //weight, cost, item + BuyStackableMulti(12, IID_GREN_FRAG, 1); //weight, cost, item if (self.impulse == 3) - BuyStackable(5, IID_GREN_EMP); //weight, cost, item + BuyStackableMulti(1, IID_GREN_FLARE, 1); //weight, cost, item if (self.impulse == 4) - BuyStackable(6, IID_GREN_FLASH); //weight, cost, item - - return; - } - if (self.currentmenu == "shop_pistols") - { - if (self.impulse == 1) - BuyWeapon(1, 5, IID_WP_USP); //weight, cost, item - if (self.impulse == 2) - BuyWeapon(2, 7, IID_WP_DEAGLE); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(2, 9, IID_WP_NEEDLER); //weight, cost, item - if (self.impulse == 4) - BuyWeapon(3, 14, IID_WP_MP9); //weight, cost, item + BuyStackableMulti(2, IID_MISC_HMXCOMPOUND, 1); //weight, cost, item if (self.impulse == 5) - BuyWeapon(3, 17, IID_WP_MP7); //weight, cost, item + BuyStackableMulti(2, IID_MISC_RDXCRYSTAL, 1); //weight, cost, item if (self.impulse == 6) - BuyWeapon(2, 21, IID_WP_ALIENBLASTER); //weight, cost, item + BuyStackableMulti(10, IID_AM_ROCKET, 1); //weight, cost, item return; } - if (self.currentmenu == "shop_shotguns") + else if (self.currentmenu == "shop_pistols") { if (self.impulse == 1) - BuyWeapon(3, 4, IID_WP_PIPERIFLE); //weight, cost, item + BuyWeapon(1, 50, IID_WP_USP); //weight, cost, item if (self.impulse == 2) - BuyWeapon(4, 8, IID_WP_WINCHESTER); //weight, cost, item + BuyWeapon(2, 70, IID_WP_DEAGLE); //weight, cost, item if (self.impulse == 3) - BuyWeapon(5, 12, IID_WP_MOSSBERG); //weight, cost, item + BuyWeapon(1, 40, IID_WP_GLOCK); //weight, cost, item if (self.impulse == 4) - BuyWeapon(7, 34, IID_WP_JACKHAMMER); //weight, cost, item - - return; - } - if (self.currentmenu == "shop_rifles") - { - if (self.impulse == 1) - BuyWeapon(3, 11, IID_WP_RANGEMASTER); //weight, cost, item - if (self.impulse == 2) - BuyWeapon(4, 21, IID_WP_AK112); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(5, 25, IID_WP_AK74); //weight, cost, item - if (self.impulse == 4) - BuyWeapon(6, 28, IID_WP_DKS1); //weight, cost, item + BuyWeapon(2, 120, IID_WP_NEEDLER); //weight, cost, item if (self.impulse == 5) - BuyWeapon(5, 30, IID_WP_MOONLIGHT); //weight, cost, item + BuyWeapon(3, 170, IID_WP_MP7); //weight, cost, item if (self.impulse == 6) - BuyWeapon(4, 32, IID_WP_SA80); //weight, cost, item + BuyWeapon(3, 150, IID_WP_MP9); //weight, cost, item + + return; + } + else if (self.currentmenu == "shop_shotguns") + { + if (self.impulse == 1) + BuyWeapon(3, 15, IID_WP_PIPERIFLE); //weight, cost, item + if (self.impulse == 2) + BuyWeapon(4, 60, IID_WP_WINCHESTER); //weight, cost, item + if (self.impulse == 3) + BuyWeapon(5, 240, IID_WP_MOSSBERG); //weight, cost, item + if (self.impulse == 4) + BuyWeapon(7, 350, IID_WP_JACKHAMMER); //weight, cost, item + + return; + } + else if (self.currentmenu == "shop_rifles") + { + if (self.impulse == 1) + BuyWeapon(3, 110, IID_WP_RANGEMASTER); //weight, cost, item + if (self.impulse == 2) + BuyWeapon(4, 180, IID_WP_AK112); //weight, cost, item + if (self.impulse == 3) + BuyWeapon(8, 190, IID_WP_FNFAL); //weight, cost, item + if (self.impulse == 4) + BuyWeapon(9, 270, IID_WP_DKS1); //weight, cost, item + if (self.impulse == 5) + BuyWeapon(5, 280, IID_WP_MOONLIGHT); //weight, cost, item + if (self.impulse == 6) + BuyWeapon(6, 220, IID_WP_G11); //weight, cost, item + + return; + } + else if (self.currentmenu == "shop_heavy") + { + if (self.impulse == 1) + BuyWeapon(10, 650, IID_WP_ROCKETLAUNCHER); //weight, cost, item + if (self.impulse == 2) + BuyWeapon(7, 550, IID_WP_GAUSERIFLE); //weight, cost, item + if (self.impulse == 3) + BuyWeapon(2, 250, IID_WP_ALIENBLASTER); //weight, cost, item + if (self.impulse == 4) + BuyWeapon(11, 450, IID_WP_PULSERIFLE); //weight, cost, item + if (self.impulse == 5) + BuyWeapon(8, 550, IID_WP_PLASMACARBINE); //weight, cost, item + if (self.impulse == 6) + BuyWeapon(25, 650, IID_WP_LASERGATLING); //weight, cost, item + } + else if (self.currentmenu == "shop_equipment") + { + if (self.impulse == 1) + BuyEquipment(5, IID_EQUIP_MEDIC_BAG); //cost, item + if (self.impulse == 2) + BuyEquipment(5, IID_EQUIP_GOGGLES); //cost, item + if (self.impulse == 3) + BuyEquipment(5, IID_EQUIP_STEALTHBOY); //cost, item + if (self.impulse == 4) + BuyEquipment(5, IID_EQUIP_BELTPOUCH); //cost, item + if (self.impulse == 5) + BuyEquipment(5, IID_EQUIP_BACKPACK); //cost, item + if (self.impulse == 6) + BuyEquipment(5, IID_EQUIP_TOOLKIT); //cost, item if (self.impulse == 7) - BuyWeapon(9, 25, IID_WP_FNFAL); //weight, cost, item - - return; - } - if (self.currentmenu == "shop_heavy") - { - if (self.impulse == 1) - BuyWeapon(10, 30, IID_WP_ROCKETLAUNCHER);//weight, cost, item - if (self.impulse == 2) - BuyWeapon(7, 32, IID_WP_GAUSERIFLE); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(12, 45, IID_WP_PULSERIFLE); //weight, cost, item - } - - if (self.currentmenu == "shop_equipment") - { - if (self.impulse == 1) - BuyEquipment(20, 1); //cost, item - if (self.impulse == 2) - BuyEquipment(20, 2); //cost, item - if (self.impulse == 3) - BuyEquipment(20, 3); //cost, item - if (self.impulse == 4) - BuyEquipment(20, 4); //cost, item - if (self.impulse == 5) - BuyEquipment(20, 5); //cost, item - if (self.impulse == 6) - BuyEquipment(20, 6); //cost, item - if (self.impulse == 7) - BuyEquipment(20, 7); //cost, item + BuyEquipment(5, IID_EQUIP_CLIMBINGGEAR); //cost, item if (self.impulse == 8) - BuyEquipment(20, 8); //cost, item - if (self.impulse == 9) - BuyEquipment(20, 9); //cost, item - if (self.impulse == 10) - BuyEquipment(20, 10); //cost, item + BuyEquipment(5, IID_EQUIP_BATTERY); //cost, item return; } - - if (self.currentmenu == "shop_chems") + else if (self.currentmenu == "shop_chems") { if (self.impulse == 1) - BuyChem(3, IID_CHEM_STIMPACK); //cost, item + BuyChem(5, IID_CHEM_STIMPACK, 1); //cost, item if (self.impulse == 2) - BuyChem(5, IID_CHEM_MEDICALBAG); //cost, item + BuyChem(15, IID_CHEM_RADX, 5); //cost, item if (self.impulse == 3) - BuyChem(10, IID_CHEM_SUPERSTIM); //cost, item + BuyChem(15, IID_CHEM_ADRENALINE, 25); //cost, item if (self.impulse == 4) - BuyChem(12, IID_CHEM_ADRENALINE); //cost, item + BuyChem(25, IID_CHEM_MEDICALBAG, 100); //cost, item if (self.impulse == 5) - BuyChem(18, IID_CHEM_PSYCHO); //cost, item + BuyChem(25, IID_CHEM_SUPERSTIM, 1); //cost, item if (self.impulse == 6) - BuyChem(21, IID_CHEM_BESERK); //cost, item + BuyChem(25, IID_CHEM_PSYCHO, 25); //cost, item + if (self.impulse == 7) + BuyChem(25, IID_CHEM_BESERK, 25); //cost, item + return; } - - if (self.currentmenu == "shop_other") + else if (self.currentmenu == "shop_other") { if (self.impulse == 1) - BuyChem(5, IID_CHEM_MEDICALBAG); + BuyStackableMulti(1, IID_MISC_JUNK, 1); //weight, cost, item + if (self.impulse == 2) + BuyStackableMulti(1, IID_MISC_NUKACOLA, 1); //weight, cost, item if (self.impulse == 3) - BuyStackable(20, IID_BUILD_MRAMMO); + BuyStackableMulti(2, IID_MISC_CHEMICALS, 1); //weight, cost, item if (self.impulse == 4) - BuyStackable(20, IID_BUILD_AUTODOC); + BuyStackableMulti(2, IID_MISC_AEROSOL, 1); //weight, cost, item if (self.impulse == 5) - BuyStackable(20, IID_BUILD_SHIELDGEN); + BuyStackableMulti(5, IID_MISC_CIRCUITBOARD, 1); //weight, cost, item if (self.impulse == 6) - BuyStackable(20, IID_BUILD_TTURRET); + BuyStackableMulti(3, IID_MISC_STEELPIPE, 1); //weight, cost, item + if (self.impulse == 7) + BuyStackableMulti(1, IID_MISC_DUCKTAPE, 1); //weight, cost, item + if (self.impulse == 8) + BuyStackableMulti(1, IID_MISC_GUM, 1); //weight, cost, item + if (self.impulse == 9) + BuyStackableMulti(1, IID_MISC_COPPERWIRE, 1); //weight, cost, item + if (self.impulse == 10) + BuyStackableMulti(7, IID_MISC_XRAYTUBE, 1); //weight, cost, item + return; } - - - if (self.currentmenu == "select_team") + else if (self.currentmenu == "select_team") { if (self.impulse == 1) { + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); bprint(2, self.netname); bprint(2, " has joined the rangers.\n"); self.currentmenu = "confirm_team"; @@ -689,6 +885,7 @@ void() W_PlayerMenu = } if (self.impulse == 2) { + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); bprint(2, self.netname); bprint(2, " has joined the raiders.\n"); self.currentmenu = "confirm_team"; @@ -698,59 +895,62 @@ void() W_PlayerMenu = } } - - if (self.currentmenu == "select_skill") + else if (self.currentmenu == "select_skill") { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); - if (self.impulse == 1) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 80; - self.class = 1; + self.tclass = 1; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nMedic - OK?\n1‘ Yes \n2‘ No \n"); + centerprint (self, "your skill-set will be‘\n\nfirst aid - OK?\n1‘ Yes \n2‘ No \n\nprimary: first aid\nsecondary: buff allies\n"); self.ghost = 0; return; } if ((self.impulse == 2)) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 70; - self.class = 2; + self.tclass = 2; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nAssassin - OK?\n1‘ Yes \n2‘ No \n"); + centerprint (self, "your skill-set will be‘\n\nstealth - OK?\n1‘ Yes \n2‘ No \n\nprimary: stealth\nsecondary: damage"); self.ghost = 0; return; } if (self.impulse == 3) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 100; - self.class = 3; + self.tclass = 3; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nSoldiier - OK?\n1‘ Yes \n2‘ No \n"); + centerprint (self, "your skill-set will be‘\n\ncombat - OK?\n1‘ Yes \n2‘ No \n\nprimary: survival\nsecondary: damage"); self.ghost = 0; return; } if (self.impulse == 4) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.max_health = 80; self.currentmenu = "none"; - self.class = 4; + self.tclass = 4; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nScientist - OK?\n1‘ Yes \n2‘ No \n"); + centerprint (self, "your skill-set will be‘\n\nscience - OK?\n1‘ Yes \n2‘ No \n\nprimary: create\nsecondary: bypass"); self.ghost = 0; return; } } - - - if (self.currentmenu == "confirm_team") + else if (self.currentmenu == "confirm_team") { if (self.impulse == 1) { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "select_skill"; DisplayMenu(); self.impulse = 0; @@ -758,7 +958,7 @@ void() W_PlayerMenu = } if (self.impulse == 2) { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "select_team"; DisplayMenu(); self.impulse = 0; @@ -766,20 +966,26 @@ void() W_PlayerMenu = return; } } - if (self.currentmenu == "confirm_skill") + else if (self.currentmenu == "confirm_skill") { if (self.impulse == 1) { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); + self.missionbrief = 0; + self.class = self.tclass; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; centerprint(self, ""); PutClientInServer(); + bprint(2, self.netname); + bprint(2, " has entered the wasteland.\n"); + self.class = self.tclass; + total_players = total_players + 1; self.impulse = 0; return; } if (self.impulse == 2) { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "select_skill"; DisplayMenu(); self.impulse = 0; @@ -787,5 +993,394 @@ void() W_PlayerMenu = return; } } + else if (self.currentmenu == "display_enter_screen") + { + if (self.impulse == 1 && coop == 1) + { + if (time > 3000) + { + self.currentmenu = "display_wait_screen"; + return; + } + self.missionbrief = 1; + self.team = 1; + self.connected = 1; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); + centerprint(self, "\n"); + self.currentmenu = "display_brief"; + DisplayMenu(); + self.impulse = 0; + return; + } + else if (self.impulse == 1 && coop == 0) + { + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); + self.connected = 1; + self.currentmenu = "select_team"; + DisplayMenu(); + self.impulse = 0; + return; + } + } + else if (self.currentmenu == "display_brief") + { + if (self.impulse == 1) + { + if (self.class > 0) + { + self.missionbrief = 0; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); + self.currentmenu = "none"; + centerprint(self, ""); + PutClientInServer(); + bprint(2, self.netname); + bprint(2, " has entered the wasteland.\n"); + total_players = total_players + 1; + return; + } + self.team = 1; + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); + self.currentmenu = "select_skill"; + DisplayMenu(); + self.impulse = 0; + return; + } + } + else if (self.currentmenu == "select_mission") + { + if (self.impulse == 1) + { + if (infokey(world, "objective") == "return" || infokey(world, "objective") == "start") + get_new_mission(); + else + { + sprint(self, 2, "you're already on a mission!\n"); + self.currentmenu = "none"; + return; + } + self.team = 1; + sound (self, CHAN_WEAPON, "effects/radio2.wav", TRUE, ATTN_IDLE); + centerprint(self, "mission obtained\n"); + self.currentmenu = "none"; + self.impulse = 0; + return; + } + else if (self.impulse == 2) + { + centerprint(self, "\n"); + self.currentmenu = "none"; + self.impulse = 0; + return; + } + } + else if (self.currentmenu == "confirm_depart") + { + if (self.impulse == 1) + { + if (infokey(world, "objective") == "return") + { + sprint(self, 2, "you're not on a mission!\n"); + self.currentmenu = "none"; + return; + } + else + { + changelevel(m_map); + return; + } + } + else if (self.impulse == 2) + { + centerprint(self, "\n"); + self.currentmenu = "none"; + self.impulse = 0; + return; + } + } + else if (self.currentmenu == "menu_lockpick") + { + if (self.impulse == 1) + { + if (self.chest.inplace == 1 && self.chest.tumbler1.inplace == 1 && self.chest.tumbler2.inplace == 1) + { + local entity te; + local float greed; + te = findradius (self.origin, 600); + while (te) + { + if (te.classname == "player" && te != self) + greed = 0; + else + greed = 1; + + te = te.chain; + } + /* + if (greed == 1) + self.score = self.score - 50; + else + self.score = self.score - 25;*/ + + self.chest.solid = SOLID_NOT; + + sound (self, CHAN_WEAPON, "effects/openlock.wav", TRUE, ATTN_NORM); + sprint(self, 2, "you manage to pick the lock. you find:\n"); + if (random()<1) + { + sprint(self, 2, "‘ money ("); + xx = 10 + ceil(random()*30); + yy = ftos(xx); + sprint(self, 2, yy); + sprint(self, 2, ")\n"); + self.ammo_shells = self.ammo_shells + xx; + } + if (random()<0.5) + { + xx = ceil(random()*2); + DropFromChest(self.chest.owner, IID_CHEM_STIMPACK, xx); + sprint(self, 2, "‘ stimpacks ("); + yy = ftos(xx); + sprint(self, 2, yy); + sprint(self, 2, ")\n"); + } + if (random()<0.75) + { + xx = ceil(309+random()*12); + yy = GetItemName(xx); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, xx, 1); + //TryGiveStackable(self, xx, 1); + } + if (random()<0.75) + { + xx = ceil(309+random()*12); + yy = GetItemName(xx); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, xx, 1); + //TryGiveStackable(self, xx, 1); + } + if (random()<0.75) + { + xx = ceil(309+random()*12); + yy = GetItemName(xx); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, xx, 1); + //TryGiveStackable(self, xx, 1); + } + if (random()<0.75) + { + xx = ceil(309+random()*12); + yy = GetItemName(xx); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, xx, 1); + //TryGiveStackable(self, xx, 1); + } + if (random()<0.05) + { + yy = GetItemName(IID_WP_MP9); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_WP_MP9, 30); + //AddNonStackable(self, IID_WP_MP9, 30); + } + if (random()<0.05) + { + yy = GetItemName(IID_WP_NEEDLER); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_WP_NEEDLER, 10); + //AddNonStackable(self, IID_WP_NEEDLER, 10); + } + if (random()<0.50) + { + yy = GetItemName(IID_ARM_LEATHER); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_ARM_LEATHER, 1); + //AddNonStackable(self, IID_ARM_LEATHER, 1); + } + if (random()<0.05) + { + yy = GetItemName(IID_WP_PIPERIFLE_SCOPE_S); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_WP_PIPERIFLE_SCOPE_S, 1); + //AddNonStackable(self, IID_WP_PIPERIFLE_SCOPE_S, 1); + //AddNonStackable(self, IID_AM_44MAGNUM, 12); + } + if (random()<0.05) + { + yy = GetItemName(IID_WP_USP); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_WP_USP, 12); + //AddNonStackable(self, IID_WP_USP, 10); + //AddNonStackable(self, IID_AM_45ACP, 12); + } + if (random()<0.05) + { + yy = GetItemName(IID_WP_WINCHESTER); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_WP_WINCHESTER, 2); + //AddNonStackable(self, IID_WP_WINCHESTER, 2); + //AddNonStackable(self, IID_AM_12GAUGESHELLS, 18); + } + if (random()<0.75) + { + xx = ceil(309+random()*12); + yy = GetItemName(xx); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, xx, 1); + //TryGiveStackable(self, xx, 1); + } + if (random()<0.25) + { + yy = GetItemName(IID_GREN_FRAG); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_GREN_FRAG, 1); + //TryGiveStackable(self, IID_GREN_FRAG, 1); + } + self.picking = 0; + self.chest.owner.picking = 2; + self.chest.owner.frame = 1; + self.currentmenu = "none"; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + return; + } + else + { + if (random()<0.90) + { + sprint(self, 2, "failed to pick the lock.\n"); + self.chest.owner.picking = 0; + } + else if (ToIID(self.islot4) == IID_EQUIP_TOOLKIT) + { + sprint(self, 2, "failed, almost jammed but super toolkit prevented.\n"); + self.chest.owner.picking = 0; + } + else + { + sprint(self, 2, "failed. lock is jammed.\n"); + self.chest.owner.picking = 3; + } + self.picking = 0; + self.currentmenu = "none"; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + return; + } + } + else if (self.impulse == 2) + { + self.picking = 0; + self.chest.owner.picking = 0; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + self.currentmenu = "none"; + self.impulse = 0; + return; + } + } + else if (self.currentmenu == "menu_defuse") + { + if (self.impulse == 1) + { + if (self.chest.inplace == 1 && self.chest.tumbler1.inplace == 1 && self.chest.tumbler2.inplace == 1) + { + + if (self.chest.owner.rtime <= 0) + { + sound (self, CHAN_WEAPON, "effects/beep1.wav", TRUE, ATTN_NORM); + sprint(self, 2, "you manage to disarm the bomb\n"); + + self.score = self.score + 75; + spawn_excla(self.chest.owner, 3000); + remove(self.chest.owner); + self.picking = 0; + self.chest.owner.picking = 2; + self.chest.owner.frame = 1; + self.currentmenu = "none"; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + return; + } + else + { + sprint(self, 2, "almost got it... "); + self.chest.owner.rtime = self.chest.owner.rtime - 1; + x = ftos(self.chest.owner.rtime); + sprint(self, 2, x); + sprint(self, 2, " circuits left\n"); + + return; + } + } + else + { + if (random()<0.75) + { + sprint(self, 2, "oops! slipped...\n"); + self.chest.owner.picking = 0; + } + else if (ToIID(self.islot4) == IID_EQUIP_TOOLKIT) + { + sprint(self, 2, "failed, almost jammed but super toolkit prevented.\n"); + self.chest.owner.picking = 0; + } + else + { + sprint(self, 2, "oops! circuits have been shorted. "); + self.chest.owner.rtime = self.chest.owner.rtime + 1; + self.chest.owner.picking = 0; + x = ftos(self.chest.owner.rtime); + sprint(self, 2, x); + sprint(self, 2, " circuits left\n"); + } + self.picking = 0; + self.currentmenu = "none"; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + return; + } + } + else if (self.impulse == 2) + { + self.picking = 0; + self.chest.owner.picking = 0; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + self.currentmenu = "none"; + self.impulse = 0; + return; + } + } }; \ No newline at end of file diff --git a/quakec/fallout2/mod_menus.qc b/quakec/fallout2/mod_menus.qc index 5b9a83c83..602f371f1 100644 --- a/quakec/fallout2/mod_menus.qc +++ b/quakec/fallout2/mod_menus.qc @@ -225,9 +225,10 @@ string () SmallArmString2 = */ string () SmallArmString3 = { - return ("rifles\n RIFLE | TYPE | WEIGHT | PRICE \n\n1‘ rangemaster 7mm 03 11$\n2‘ ak-112 5mm 04 21$\n3‘ remington .308 05 24$\n4‘ ak-74 5mm 04 27$\n5‘ moonlight .223 05 36$\n6‘ sa-80 5mm 05 23$\n7‘ plasma rifle 07 41$\n8‘ gauss rifle 2mm 08 51$\n"); + return ("rifles\n RIFLE | TYPE | WEIGHT | PRICE \n\n1‘ rangemaster 7mm 03 11$\n2‘ ak-112 5mm 04 21$\n3‘ fn-fal .308 08 27$\n4‘ widowmaker .308 09 24$\n5‘ moonlight .223 05 36$\n6‘ hk g11 5mm 05 23$\n"); }; + string () DrugString1 = { return ("drugs\n DRUG | EFFECTS | PRICE\n" diff --git a/quakec/fallout2/monsters.qc b/quakec/fallout2/monsters.qc index 6321e7362..f12dfd54f 100644 --- a/quakec/fallout2/monsters.qc +++ b/quakec/fallout2/monsters.qc @@ -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; diff --git a/quakec/fallout2/name.qc b/quakec/fallout2/name.qc index ccc15d2f8..bded5efbe 100644 --- a/quakec/fallout2/name.qc +++ b/quakec/fallout2/name.qc @@ -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"; }; \ No newline at end of file diff --git a/quakec/fallout2/ogre.qc b/quakec/fallout2/ogre.qc index e15ad15fe..b49b6e6da 100644 --- a/quakec/fallout2/ogre.qc +++ b/quakec/fallout2/ogre.qc @@ -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 (); }; diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index fde7e68ed..6edea438c 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -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 diff --git a/quakec/fallout2/progs.src b/quakec/fallout2/progs.src index a1b29d710..353a3519b 100644 --- a/quakec/fallout2/progs.src +++ b/quakec/fallout2/progs.src @@ -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 \ No newline at end of file +cmds.qc +fish.qc \ No newline at end of file diff --git a/quakec/fallout2/server.qc b/quakec/fallout2/server.qc index 465bf4e8b..2b0bd6803 100644 --- a/quakec/fallout2/server.qc +++ b/quakec/fallout2/server.qc @@ -1,5 +1,4 @@ -void() monster_tarbaby = {remove(self);}; void() monster_oldone = {remove(self);}; void() event_lightning = {remove(self);}; diff --git a/quakec/fallout2/shalrath.qc b/quakec/fallout2/shalrath.qc index 812d23a24..487db6eb6 100644 --- a/quakec/fallout2/shalrath.qc +++ b/quakec/fallout2/shalrath.qc @@ -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"; diff --git a/quakec/fallout2/shambler.qc b/quakec/fallout2/shambler.qc index 5165ec436..3322a08cb 100644 --- a/quakec/fallout2/shambler.qc +++ b/quakec/fallout2/shambler.qc @@ -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(); }; diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index 68a1afe02..a35260edf 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -1,8 +1,47 @@ #define mag1 currentammo #define maxmag1 cnt +.entity objective; + +void () LobAGrenade; +void (vector jojo) spawn_civilian; +void (entity jeb, float time) spawn_excla; +void(float db) monster_noise; +void () find_hide; void () army_load1; +void () army_radio1; +void () Footstep; +void () monster_commander; + +void () DeathThroes = +{ + local entity te; + + te = findradius (self.origin, 300); + while (te) + { + if (te.classname == "monster" && te.health > 0 && te != self) + te.enemy = self; + + te = te.chain; + } +}; + +//RADIO +void() fire_radio = +{ + 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; + } +}; + //PISTOL void (float tmp, float dam) army_fire = @@ -16,11 +55,22 @@ void (float tmp, float dam) army_fire = if (self.enemy.sneak == 1) tmp = tmp * 2; - if (self.mag1 == 0) + //soldiers call for help on shadow ops + 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; + } + + if (self.mag1 <= 0) + { + self.mag1 = 12; sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); army_load1(); - self.mag1 = self.maxmag1; return; } @@ -29,7 +79,7 @@ void (float tmp, float dam) army_fire = makevectors (self.angles); - sound (self, CHAN_WEAPON, "weapons/1911.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/usp.wav", PLAT_LOW_TRIGGER, ATTN_NORM); src = self.origin + v_forward*10; src_z = self.absmin_z + self.size_z * 0.7; @@ -37,31 +87,29 @@ void (float tmp, float dam) army_fire = en = self.enemy; dir = en.origin - en.velocity*0.2; + if (en.position == 1) + dir = dir - '0 0 8'; + if (en.position == 2) + dir = dir - '0 0 16'; + dir = normalize (dir - self.origin); direction = dir; traceline (src, src + direction*2048 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); - if (trace_fraction == PLAT_LOW_TRIGGER) + if (trace_fraction == 1) return; if (trace_ent.takedamage) { dam = 1 + random()*dam + random()*dam; - dam = dam * (1 - (trace_fraction/2)); + dam = dam - (1 - (trace_fraction/2)); SpawnBlood (org, PLAT_LOW_TRIGGER); 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); }; @@ -77,11 +125,24 @@ void (float tmp, float dam) army_fire1 = if (self.enemy.sneak == 1) tmp = tmp * 2; - if (self.mag1 == 0) + //soldiers call for help on shadow ops + 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; + } + + monster_noise(60); + + if (self.mag1 <= 0) + { + self.mag1 = 1; sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); army_load1(); - self.mag1 = self.maxmag1; return; } @@ -96,14 +157,19 @@ void (float tmp, float dam) army_fire1 = en = self.enemy; - dir = en.origin - en.velocity*0.2; + dir = en.origin - en.velocity*0.05; + if (en.position == 1) + dir = dir - '0 0 8'; + if (en.position == 2) + dir = dir - '0 0 16'; + dir = normalize (dir - self.origin); direction = dir; - traceline (src, src + direction*2048 + v_right*crandom()*100 + v_up*crandom()*100, FALSE, self); + traceline (src, src + direction*2048 + v_right*crandom()*150 + v_up*crandom()*150, FALSE, self); - if (trace_fraction == PLAT_LOW_TRIGGER) + if (trace_fraction == 1) return; if (trace_ent.takedamage) @@ -111,17 +177,10 @@ void (float tmp, float dam) army_fire1 = SpawnBlood (org, PLAT_LOW_TRIGGER); dam = 10 + random()*dam + random()*dam; dam = dam * (1 - (trace_fraction/2)); - T_Damage (trace_ent, self, self, dam); + X_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); }; @@ -139,11 +198,22 @@ void (float tmp, float dam) army_fire2 = if (self.enemy.sneak == 1) tmp = tmp * 2; - if (self.mag1 == 0) + if (self.mag1 <= 0) { + self.mag1 = 6; sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); army_load1(); - self.mag1 = self.maxmag1; + return; + } + + //soldiers call for help on shadow ops + 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; } @@ -151,7 +221,9 @@ void (float tmp, float dam) army_fire2 = makevectors (self.angles); - sound (self, CHAN_WEAPON, "weapons/shotgun2.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/shotgun1.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + + monster_noise(50); src = self.origin + v_forward*10; src_z = self.absmin_z + self.size_z * 0.7; @@ -159,6 +231,11 @@ void (float tmp, float dam) army_fire2 = en = self.enemy; dir = en.origin - en.velocity*0.2; + if (en.position == 1) + dir = dir - '0 0 8'; + if (en.position == 2) + dir = dir - '0 0 16'; + dir = normalize (dir - self.origin); direction = dir; @@ -198,7 +275,7 @@ void (float tmp, float dam) army_fire2 = shot = (shot - 1); - if (trace_fraction == PLAT_LOW_TRIGGER) + if (trace_fraction == 1) return; if (trace_ent.takedamage) @@ -209,14 +286,7 @@ void (float tmp, float dam) army_fire2 = 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); } }; @@ -229,17 +299,32 @@ void (float tmp, float dam) army_fire3 = local entity en; local vector org; - if (self.mag1 == 0) + if (self.mag1 <= 0) { - sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + self.mag1 = 30; + sound (self, CHAN_WEAPON, "misc/greload.wav", 1, ATTN_NORM); army_load1(); - self.mag1 = self.maxmag1; return; } + //soldiers call for help on shadow ops + 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; + } + + monster_noise(40); + if (self.enemy.sneak == 1) tmp = tmp * 2; + sound (self, CHAN_WEAPON, "weapons/mp5.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + self.mag1 = self.mag1 - 1; makevectors (self.angles); @@ -250,13 +335,18 @@ void (float tmp, float dam) army_fire3 = en = self.enemy; dir = en.origin - en.velocity*0.2; + if (en.position == 1) + dir = dir - '0 0 8'; + if (en.position == 2) + dir = dir - '0 0 16'; + dir = normalize (dir - self.origin); direction = dir; traceline (src, src + direction*1024 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); - if (trace_fraction == PLAT_LOW_TRIGGER) + if (trace_fraction == 1) return; if (trace_ent.takedamage) @@ -267,14 +357,8 @@ void (float tmp, float dam) army_fire3 = 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); + }; //Assault Rifle @@ -286,34 +370,41 @@ void (float tmp, float dam) army_fire4 = local entity en; local vector org; - if (self.mag1 == 0) + if (self.mag1 <= 0) { + self.mag1 = 24; sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); army_load1(); - self.mag1 = self.maxmag1; return; } - if (self.enemy.sneak == 1) - tmp = tmp * 2; self.mag1 = self.mag1 - 1; makevectors (self.angles); + sound (self, CHAN_WEAPON, "weapons/ak112.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + 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 8'; + if (en.position == 2) + dir = dir - '0 0 16'; + dir = normalize (dir - self.origin); direction = dir; traceline (src, src + direction*2048 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); - if (trace_fraction == PLAT_LOW_TRIGGER) + monster_noise(60); + + if (trace_fraction == 1) return; if (trace_ent.takedamage) @@ -325,15 +416,73 @@ void (float tmp, float dam) army_fire4 = } 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); + if (en.classname == "player" && random()*20 <= 5) + stuffcmd(en, "play effects/miss\n"); + + bullet_hole (trace_endpos); } }; +void () army_run1; + +void () army_radio1 = [ 29, army_radio2 ] +{ + if (self.health <= 0) + { + self.think = SUB_Null; + return; + } + + self.rtime = self.rtime + 1; + ai_stand (); +}; + +void () army_radio2 = [ 29, army_radio3 ] +{ + ai_stand (); +}; + +void () army_radio3 = [ 29, army_radio1 ] +{ + if (self.rtime > 15) + { + if (random()<0.25) + sound (self, CHAN_VOICE, "effects/radio1.wav", 1, ATTN_NONE); + else if (random()<0.25) + sound (self, CHAN_VOICE, "effects/radio2.wav", 1, ATTN_NONE); + else if (random()<0.25) + sound (self, CHAN_VOICE, "effects/radio3.wav", 1, ATTN_NONE); + else + sound (self, CHAN_VOICE, "effects/radio4.wav", 1, ATTN_NONE); + + called_in += 1; + self.has_radio = 0; + army_run1(); + bprint(2, "soldier reported suspicious activity!\n"); + if (called_in == 1) + bprint(2, "threat level: low\n"); + if (called_in == 2) + bprint(2, "threat level: rising\n"); + if (called_in == 3) + bprint(2, "threat level: alert\n"); + if (called_in == 4) + bprint(2, "threat level: paranoid\n"); + if (called_in >= 5) + bprint(2, "threat level: discovered\n"); + + } + else + { + if (random()<0.5) + sound (self, CHAN_VOICE, "effects/blip1.wav", 1, ATTN_IDLE); + else + sound (self, CHAN_VOICE, "effects/blip2.wav", 1, ATTN_IDLE); + } + ai_stand (); +}; + + + void () army_load1 = [ 29, army_load2 ] { @@ -508,6 +657,9 @@ void () army_walk8 = [ 80, army_walk1 ] void () army_run1 = [ 73, army_run2 ] { + if (random()<0.25 || self.health <= 25) + find_hide(); + ai_run (TE_TELEPORT); }; @@ -518,8 +670,15 @@ void () army_run2 = [ 74, army_run3 ] void () army_run3 = [ 75, army_run4 ] { - if (self.active == 1) - self.action_points = self.action_points - 1; + 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; + } ai_run (TE_LAVASPLASH); }; @@ -551,6 +710,12 @@ void () army_run8 = [ 80, army_run1 ] void () army_atk1 = [ 81, army_atk2 ] { + if (self.grenadetoggle > 0 && random()*4 <= 1) + { + LobAGrenade(); + self.grenadetoggle = self.grenadetoggle - 1; + } + ai_face (); }; @@ -582,7 +747,7 @@ void () army_atk6 = [ 86, army_atk7 ] void () army_atk7 = [ 87, army_atk8 ] { ai_face (); - army_fire (120, 14); + army_fire (120, 19); }; void () army_atk8 = [ 88, army_atk9 ] @@ -597,6 +762,12 @@ void () army_atk9 = [ 89, army_run1 ] void () army_atka1 = [ 81, army_atka2 ] { + if (self.grenadetoggle > 0 && self.health < 70) + { + LobAGrenade(); + self.grenadetoggle = self.grenadetoggle - 1; + } + ai_face (); }; @@ -618,7 +789,7 @@ void () army_atka4 = [ 84, army_atka5 ] void () army_atka5 = [ 85, army_atka6 ] { ai_face (); - army_fire2 (200, 4); + army_fire2 (200, 7); }; void () army_atka6 = [ 86, army_atka7 ] @@ -643,6 +814,12 @@ void () army_atka9 = [ 89, army_run1 ] void () army_atkb1 = [ 81, army_atkb2 ] { + if (self.grenadetoggle > 0 && self.health < 70) + { + LobAGrenade(); + self.grenadetoggle = self.grenadetoggle - 1; + } + ai_face (); }; @@ -673,12 +850,7 @@ void () army_atkb5 = [ 85, army_atkb6 ] if (r == RANGE_NEAR || r == RANGE_MELEE) self.recoil = 1; - if (self.recoil == 1) - sound (self, CHAN_WEAPON, "weapons/burst.wav", PLAT_LOW_TRIGGER, ATTN_NORM); - else - sound (self, CHAN_WEAPON, "weapons/mp7.wav", PLAT_LOW_TRIGGER, ATTN_NORM); - - army_fire3 (150, 13); + army_fire3 (100, 15); }; void () army_atkb6 = [ 86, army_atkb7 ] @@ -686,8 +858,8 @@ void () army_atkb6 = [ 86, army_atkb7 ] ai_face (); if (self.recoil == 1) { - army_fire3 (170, 11); - army_fire3 (190, 9); + army_fire3 (150, 14); + army_fire3 (150, 14); } }; @@ -695,7 +867,7 @@ void () army_atkb7 = [ 87, army_atkb8 ] { ai_face (); if (self.recoil == 1) - army_fire3 (210, 11); + army_fire3 (150, 14); }; void () army_atkb8 = [ 88, army_atkb9 ] @@ -703,8 +875,8 @@ void () army_atkb8 = [ 88, army_atkb9 ] ai_face (); if (self.recoil == 1) { - army_fire3 (230, 11); - army_fire3 (250, 9); + army_fire3 (150, 14); + army_fire3 (150, 14); } }; @@ -713,13 +885,19 @@ void () army_atkb9 = [ 89, army_run1 ] ai_face (); if (self.recoil == 1) { - army_fire3 (270, 11); - army_fire3 (290, 9); + army_fire3 (150, 14); + army_fire3 (150, 14); } }; void () army_atkcs1 = [ 81, army_atkcs2 ] { + if (self.grenadetoggle > 0 && self.health < 70) + { + LobAGrenade(); + self.grenadetoggle = self.grenadetoggle - 1; + } + ai_face (); }; @@ -742,7 +920,7 @@ void () army_atkcs5 = [ 85, army_atkcs6 ] { ai_face (); sound (self, CHAN_WEAPON, "weapons/ak112.wav", PLAT_LOW_TRIGGER, ATTN_NORM); - army_fire4 (100, 16); + army_fire4 (100, 20); }; void () army_atkcs6 = [ 85, army_atkcs7 ] @@ -794,9 +972,9 @@ void () army_assault_rifle = r = range (self.enemy); - if (r == RANGE_FAR || r == RANGE_MID)//single shot at range + if (r == RANGE_FAR)//single shot at range army_atkcs1(); - if (r == RANGE_NEAR || r == RANGE_MELEE)//open up when close + else//full-auto army_atkc1(); }; @@ -872,6 +1050,12 @@ void () army_atkc16 = [ 89, army_run1 ] void () army_atkp1 = [ 81, army_atkp2 ] { + if (self.grenadetoggle > 0 && self.health < 70) + { + LobAGrenade(); + self.grenadetoggle = self.grenadetoggle - 1; + } + ai_face (); }; @@ -893,7 +1077,7 @@ void () army_atkp4 = [ 84, army_atkp5 ] void () army_atkp5 = [ 85, army_atkp6 ] { ai_face (); - army_fire1 (200, 15); + army_fire1 (300, 22); }; void () army_atkp6 = [ 86, army_atkp7 ] @@ -1098,7 +1282,8 @@ void () army_die1 = [ 8, army_die2 ] void () army_die2 = [ 9, army_die3 ] { - self.solid = SOLID_NOT; + self.rtime = 1; + self.velocity_z = 50+random()*50; }; void () army_die3 = [ 10, army_die4 ] @@ -1107,6 +1292,7 @@ void () army_die3 = [ 10, army_die4 ] void () army_die4 = [ 11, army_die5 ] { + setsize (self, '-12 -12 -24', '12 12 -16'); }; void () army_die5 = [ 12, army_die6 ] @@ -1139,7 +1325,8 @@ void () army_cdie1 = [ 18, army_cdie2 ] void () army_cdie2 = [ 19, army_cdie3 ] { - self.solid = SOLID_NOT; + self.rtime = 1; + self.velocity_z = 50+random()*50; ai_back (MULTICAST_PVS_R); }; @@ -1150,6 +1337,7 @@ void () army_cdie3 = [ 20, army_cdie4 ] void () army_cdie4 = [ 21, army_cdie5 ] { + setsize (self, '-12 -12 -24', '12 12 -16'); ai_back (TE_LIGHTNINGBLOOD); }; @@ -1186,31 +1374,42 @@ void () army_cdie11 = [ 28, army_cdie11 ] void () grunt_pain = { + local vector dir; + + 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 8', 4); + + self.health = 180; + return; + } + + dir = normalize(self.origin - self.enemy.origin); + self.velocity = dir * 120; + if (self.frame == 41) { - self.frame = 42; self.health = 180; + self.frame = 42; self.think = army_die1; self.nextthink = time + 0.12; } else { + self.health = 180; ThrowGib ("progs/zom_gib.mdl", -40); self.frame = 41; - self.health = 180; self.think = army_cdie1; 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/agdie5.wav", 1, ATTN_NORM); - } if (self.attack >= 16) { self.solid = SOLID_NOT; @@ -1228,13 +1427,13 @@ void (vector stuff, vector ang) spawn_live_grunt = grunt = spawn (); grunt.origin = stuff; - grunt.enemy = world; + grunt.enemy = self.enemy; grunt.attack_finished = time + 10; grunt.solid = SOLID_SLIDEBOX; grunt.movetype = MOVETYPE_STEP; grunt.takedamage = DAMAGE_YES; setmodel (grunt, "progs/soldier.mdl"); - setsize (grunt, VEC_HULL_MIN, '16 16 40'); + setsize (grunt, '-12 -12 -24', '12 12 28'); grunt.classname = "body"; grunt.netname = "dead"; grunt.health = 180; @@ -1242,33 +1441,202 @@ void (vector stuff, vector ang) spawn_live_grunt = grunt.max_health = grunt.health; grunt.th_pain = grunt_pain; grunt.think = grunt_pain; + grunt.th_die = corpse_gib; grunt.nextthink = time + 0.05; }; void () army_die = { - DropBackpack (); + local float r; - if (self.health <= -35) - { - self.solid = SOLID_NOT; - sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - army_die1 (); - } + r = random(); + + if (random()<0.75) + DropMoney(); + + 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); + + DeathThroes(); + + sound (self, CHAN_BODY, "", 1, ATTN_NORM); + + if (self.weapon == 1) + DropFromChest(self, IID_WP_PIPERIFLE, 1); + if (self.weapon == 2) + DropFromChest(self, IID_WP_USP, 6); + if (self.weapon == 3) + DropFromChest(self, IID_WP_WINCHESTER, 1); + if (self.weapon == 4) + DropFromChest(self, IID_WP_MP9, 15); + if (self.weapon == 5) + DropFromChest(self, IID_WP_AK112, 12); + + if (self.weapon == 1) + DropFromChest(self, IID_AM_44MAGNUM, 10); + if (self.weapon == 2) + DropFromChest(self, IID_AM_45ACP, 12); + if (self.weapon == 3) + DropFromChest(self, IID_AM_12GAUGESHELLS, 8); + if (self.weapon == 4) + DropFromChest(self, IID_AM_10MM, 15); + if (self.weapon == 4) + DropFromChest(self, IID_AM_10MM, 30); + if (self.weapon == 5) + DropFromChest(self, IID_AM_5MMHIGHVEL, 24); + + self.solid = SOLID_NOT; + spawn_live_grunt(self.origin, self.angles); + remove(self); +}; + +void (vector jojo, entity friend) spawn_soldier = +{ + local entity soldier; + local entity te; + + + soldier = spawn (); + self = soldier; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/soldier.mdl"); + setsize (self, '-12 -12 -24', '12 12 28'); + self.health = 60+random()*30; + self.netname = "raider"; + self.max_health = self.health; + self.armornoise = "misc/thud.wav"; + self.th_stand = army_stand1; + self.th_walk = army_walk1; + self.th_run = army_run1; + if (random()<0.3) + self.has_radio = 1; + if (self.has_radio == 0) + self.th_missile = army_atk1; + if (self.has_radio == 1) + self.th_missile = army_radio1; + self.th_pain = army_pain; + self.th_die = army_die; + + self.origin = jojo + '0 64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + + if (!walkmove(0, 0)) { - self.solid = SOLID_NOT; - spawn_live_grunt(self.origin, self.angles); - remove(self); + 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; + } + +//soldiers have either 0, 1 or 2 grenades + self.grenadetoggle = floor(random()*2); + +//soldiers have either pistol, smg, shotgun or rifle + self.weapon = ceil(random()*4); + + if (self.weapon == 1) + self.th_missile = army_atkp1; //rifle + if (self.weapon == 2) + self.th_missile = army_atk1; //pistol + if (self.weapon == 3) + self.th_missile = army_atka1; //shotgun + if (self.weapon == 4) + self.th_missile = army_atkb1; //smg + + self.mag1 = 8; + + if (self.weapon == 1) + self.mag1 = 6+random()*6; + if (self.weapon == 2) + self.mag1 = 12+random()*12; + if (self.weapon == 3) + self.mag1 = 3+random()*3; + if (self.weapon == 4) + self.mag1 = 15+random()*15; + + self.maxmag1 = self.mag1; + + self.classname = "monster"; + walkmonster_start_go (); + self.angles_y = friend.angles_y; }; void () monster_army = { + local float com; + local entity te; + + if (self.zone == 0) + { + load_monster(); + return; + } + local float x; + local entity te; x = total_players; + te = find(world, classname, "monster"); + while (te) + { + if (te.netname == "commander") + com = com + 1; + + te = find(te, classname, "monster"); + } + + if (com == 0 && random()<0.50 && world.map_obj == OBJ_SHADOW) + { + monster_commander(); + return; + } + + else if (com == 1 && random()<0.25 && world.map_obj == OBJ_SHADOW) + { + monster_commander(); + return; + } + if (random()*10 <= x*0.5) { precache_model2 ("progs/enforcer.mdl"); @@ -1294,10 +1662,11 @@ void () monster_army = self.classname = "monster"; self.netname = "enforcer"; - setsize (self, '-16 -16 -24', '16 16 32'); + setsize (self, '-12 -12 -24', '12 12 28'); self.health = 120; self.islot3 = SlotVal(IID_ARM_COMBAT, 1); self.armortype = 35; + self.helmet = 1; self.th_stand = enf_stand1; self.th_walk = enf_walk1; self.th_run = enf_run1; @@ -1330,47 +1699,246 @@ void () monster_army = precache_sound ("soldier/sight1.wav"); precache_sound ("player/udeath.wav"); + self.ammo_shells = 1; self.solid = SOLID_SLIDEBOX; self.classname = "monster"; self.netname = "raider"; self.movetype = MOVETYPE_STEP; setmodel (self, "progs/soldier.mdl"); - setsize (self, '-16 -16 -24', '16 16 28'); - self.health = 90; + setsize (self, '-12 -12 -24', '12 12 28'); + self.health = 70+random()*30; self.team = 3; - self.islot3 = SlotVal(IID_ARM_LEATHER, 1); + self.islot3 = SlotVal(IID_ARM_LEATHER, 1); self.armortype = 0.2; self.armornoise = "misc/thud.wav"; self.th_stand = army_stand1; self.th_walk = army_walk1; self.th_run = army_run1; - self.th_missile = army_atk1; + if (random()<0.3) + self.has_radio = 1; + if (self.has_radio == 0) + self.th_missile = army_atk1; + if (self.has_radio == 1) + self.th_missile = army_radio1; + self.th_pain = army_pain; self.th_die = army_die; + + te = find (world, classname, "rhostage"); + self.movetarget = te; + walkmonster_start (); - self.weapon = ceil(random()*4); +//soldiers have either 0, 1 or 2 grenades + self.grenadetoggle = floor(random()*2); + +//soldiers have either pistol, smg, shotgun or rifle + + if (random()*100 >= 80) + self.weapon = ceil(random()*4); + else + self.weapon = 2; if (self.weapon == 1) - self.th_missile = army_atkp1; //pistol + self.th_missile = army_atkp1; //pipe rifle if (self.weapon == 2) - self.th_missile = army_atk1; //rifle + self.th_missile = army_atk1; //pistol if (self.weapon == 3) self.th_missile = army_atka1; //shotgun if (self.weapon == 4) self.th_missile = army_atkb1; //smg + self.mag1 = 8; + if (self.weapon == 1) - self.mag1 = 12; + self.mag1 = 1; if (self.weapon == 2) - self.mag1 = 10; + self.mag1 = 6+random()*6; if (self.weapon == 3) - self.mag1 = 6; + self.mag1 = 3+random()*3; if (self.weapon == 4) - self.mag1 = 30; + self.mag1 = 15+random()*15; + +//soldiers on shadow missions have full combat armor & assault rifles + if (world.map_obj == OBJ_SHADOW) + { + if (random()<0.5) + self.islot3 = SlotVal(IID_ARM_LEATHER, 1); + else if (random()<0.5) + self.islot3 = SlotVal(IID_ARM_METAL, 1); + else + self.islot3 = SlotVal(IID_ARM_COMBAT, 1); + + if (random()<0.25) + self.weapon = 3; + else if (random()<0.5) + self.weapon = 4; + else + self.weapon = 5; + + if (self.weapon == 3) + self.th_missile = army_atka1; //shotgun + if (self.weapon == 4) + self.th_missile = army_atkb1; //smg + if (self.weapon == 5) + self.th_missile = army_assault_rifle; //ak-112 assault rifle + + self.mag1 = 24; + } self.maxmag1 = self.mag1; + + if (random()<0.25 && (world.map_obj != OBJ_SHADOW)) + spawn_soldier(self.origin, self); + if (random()<0.25 && world.map_obj == OBJ_HOSTAGE) + spawn_civilian(self.origin); }; +void() WalkTo_Think = +{ + local entity ent; + + ent = nextent(world); + + while(ent) + { + if((ent.goalentity == self) || (ent.objective == self)) + { + self.nextthink = time + 2; + return; + } + ent = nextent(ent); + } + + remove(self); + +}; + + +float(vector vec) hide_search = +{ + local float flo; + local vector vic; + local entity ent; + + flo = random() * 1000; + + traceline(self.origin, self.origin + vec * flo, TRUE, self); + vic = trace_endpos - normalize(trace_endpos - self.origin) * 32; + traceline(vic, self.enemy.origin, TRUE, self); + + if (vlen(trace_endpos - self.enemy.origin) > 50) + { + makevectors(vec); + + ent = spawn(); +// setmodel(ent, "progs/lavaball.mdl"); + setorigin(ent, vic - v_forward * 8); + ent.think = WalkTo_Think; + ent.nextthink = time + 8; + ent.classname = "runner"; + +// self.objective = ent; + self.angles_y = vectoyaw(ent.origin - self.origin); + self.goalentity = ent; +// self.think = self.th_run; + return TRUE; + } + + return FALSE; +}; + + +void() find_hide = +{ + local float flo; + local vector vec, vac; + + flo = 5; + makevectors(self.angles); + while(flo) + { + vec = crandom() * v_right; + vac = crandom() * v_forward; + vec = vec + vac; + if (hide_search(vec)) + return; + flo = flo - 1; + } +}; + + +void () monster_commander = +{ + if (self.zone == 0) + { + load_monster(); + return; + } + + precache_model2 ("progs/enforcer.mdl"); + precache_model2 ("progs/h_mega.mdl"); + precache_model2 ("progs/laser.mdl"); + + precache_sound2 ("enforcer/death1.wav"); + precache_sound2 ("enforcer/enfire.wav"); + precache_sound2 ("enforcer/enfstop.wav"); + precache_sound2 ("enforcer/idle1.wav"); + precache_sound2 ("enforcer/pain1.wav"); + precache_sound2 ("enforcer/pain2.wav"); + precache_sound2 ("enforcer/sight1.wav"); + precache_sound2 ("enforcer/sight2.wav"); + precache_sound2 ("enforcer/sight3.wav"); + precache_sound2 ("enforcer/sight4.wav"); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.team = 3; + + setmodel (self, "progs/enforcer.mdl"); + self.classname = "monster"; + self.netname = "commander"; + commanders = commanders + 1; + + setsize (self, '-12 -12 -24', '12 12 32'); + self.health = 120; + self.islot3 = SlotVal(IID_ARM_COMBAT, 1); + self.armortype = 0.5; + self.helmet = 1; + self.th_stand = enf_stand1; + self.th_walk = enf_walk1; + self.th_run = enf_run1; + self.th_pain = enf_pain; + self.th_die = enf_die; + self.th_missile = enf_atk1; + + 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; + + walkmonster_start(); + + spawn_soldier(self.origin, self); + spawn_soldier(self.origin, self); + spawn_soldier(self.origin, self); + spawn_soldier(self.origin, self); + + return; + +}; + + #undef mag1 #undef maxmag1 diff --git a/quakec/fallout2/triggers.qc b/quakec/fallout2/triggers.qc index 42a6ec7b2..551e5587a 100644 --- a/quakec/fallout2/triggers.qc +++ b/quakec/fallout2/triggers.qc @@ -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; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index b3e9ef28c..c3907981f 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1,26 +1,58 @@ /* */ +void() show_light_level; +void() UseStimpack; +void() UseSuperStim; +void() UseMedicalBag; +void (entity chest, float iid, float num) DropFromChest; +void() AddClone; +void() SpawnGModel; +void (string snd, float type) function_radio; +void () MapInfo; void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; void () player_run; void(entity bomb, entity attacker, float rad, entity ignore, string dtype) T_RadiusDamage; +void(entity bomb, entity attacker, float rad, entity ignore, float xrange) T_RadiusDamage2; +void() ZoomIn; +void (float dam, float xrecoil, string snd, float rng, float rate) FireMinigun; +void(float db) loud_noise; +void() player_auto_duck1; +void() player_auto_ducka1; void(vector org, float damage) SpawnBlood; +void(vector org, float damage) SpawnNonBlood; void() SuperDamageSound; -void (float rec, float number, float dam, float var, float ran, float auto) W_FireShotgun; +void (float rec, float speed, float dam, float type) FirePulseRifle; +void (float rec, float number, float dam, float var, float ran, float auto, string snd) W_FireShotgun; void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle; void (float dam, float rec, string snd, float rng, float rate) FirePistol; void (float dam, float rec, string snd, float rng, float rate) FireSMG; float() FireToolkit; +void () HostageReport; +void (entity jeb, float time) spawn_excla; void () FireAlienBlaster; void () W_PlayerMenu; +void () player_single_shot; +void () player_single_shot_duck; //void () UseChem; void () Special; void () BuyMenu; void() Sneak; //void() Bandage; void() Shield; -void () player_throw1; +void () player_pull1; +void() player_dragon_kick; +void() player_kick1; +void() player_kick1a; +void() player_swing1; +void() player_swing1a; +void() player_punch1; +void() player_punch2; void() player_knife1; void() player_knifea; +void() player_spear1; +void() player_spear1a; +void() player_axe1; +void() player_axeb1; void() ExitScreen; void() CharacterSheet; void() UseEquipment; @@ -32,10 +64,14 @@ float(float iid) UseBoostingChem; float(float iid) UseHealingChem; float(float slotno) DecreaseDestroySlot; void () DropAmmo; +void() player_singlex; +void() player_singley; +void(string arg1) Cmd_InvUse; #define weightx() (self.weight) + // called by worldspawn void() W_Precache = { @@ -60,6 +96,57 @@ float() crandom = return 2*(random() - 0.5); }; +void() muzzleflash = +{ + WriteByte (MSG_MULTICAST, SVC_MUZZLEFLASH); + WriteEntity (MSG_MULTICAST, self); + multicast (self.origin, MULTICAST_PVS); +}; + + +float (entity healer, entity saved) RevivePlayer = +{ + local entity oself; + oself = self; + + self = saved; +/* if (!walkmove(0, 0)) + { + //too close? + return FALSE; + } +*/ + saved.deadflag = DEAD_NO; + saved.takedamage = DAMAGE_AIM; + saved.movetype = MOVETYPE_WALK; +// saved.solid = SOLID_NOT; + + self = oself; + +// saved.materialize = 200; + saved.ghost = 0; + saved.health = 1; + saved.air_finished = time + 10; + saved.view_ofs = '0 0 22'; + self = saved; + player_run(); + self = oself; + stuffcmd(saved, "impulse 1\n"); + if (healer.classname == "player") + { + sprint (healer, PRINT_HIGH, "you revive "); + sprint (healer, PRINT_HIGH, trace_ent.netname); + sprint (healer, PRINT_HIGH, ".\n "); + } + sprint (saved, PRINT_HIGH, healer.netname); + sprint (saved, PRINT_HIGH, " saves you from death.\n"); + saved.view2 = world; + + saved.flags (-) FL_FINDABLE_NONSOLID; + + return TRUE; +}; + /* ================ W_FireMelee @@ -67,8 +154,34 @@ W_FireMelee */ void(float damage, float dist, float rate) FireMelee = { - local vector source; - local vector org; + local vector source, org, vec, dir; + local float weap, dot, tdam; + local string sdam; + + if (getperk(16))//power shot adds a small bonus to the first shot fired + { + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + damage = damage * 1.20; + } + } + + self.recoil = self.recoil + 5; + + weap = ToIID(self.(SlotField(self.current_slot))); + + //large and in charge! adds a small burst of adrenalnie + if ((getperk(8)) && ((weap == IID_WP_SPEAR || weap == IID_WP_AXE || weap == IID_WP_WRENCH))) + { + if (self.ragetime <= 0) + { + sprint(self, 2, "!LARGE AND IN CHARGE\n"); + sound (self, CHAN_VOICE, "player/berserk.wav", 1, ATTN_NORM); + self.rage = IID_CHEM_ADRENALINE; + self.ragetime = 3; + } + } makevectors (self.v_angle); source = self.origin + '0 0 16'; @@ -78,24 +191,136 @@ void(float damage, float dist, float rate) FireMelee = org = trace_endpos - v_forward*4; - if (trace_ent.takedamage) + if (self.sneak > 0 && weap == IID_WP_KNIFE) { + makevectors (trace_ent.angles); + vec = normalize ((self.origin - trace_ent.origin)); + dot = (vec * v_forward); + + if (dot < 0.5 && trace_ent.takedamage) + { + tdam = self.sneak*random()*3; + if (getperk(7)) + tdam = self.sneak*random()*6; + + if (self.steadyaim == 0) + tdam = tdam * 5; + + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + SpawnBlood (org, 1); + else + SpawnNonBlood (org, 1); + + T_Damage (trace_ent, self, self, tdam); + self.attack_finished = time + 2; + + if (trace_ent.health > 0)//victim survived the attack + { + bprint(2, self.netname); + bprint(2, " ambushes "); + bprint(2, trace_ent.netname); + bprint(2, "!\n"); + + if (random()*4<2) + sound (trace_ent, CHAN_WEAPON, "player/headshot.wav", 1, ATTN_NONE); + else + sound (trace_ent, CHAN_WEAPON, "player/udeath.wav", 1, ATTN_NONE); + + loud_noise(15); + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); + } + else + { + bprint(2, self.netname); + bprint(2, " assassinates "); + bprint(2, trace_ent.netname); + bprint(2, "!\n"); + self.score = self.score + 25; + + if (random()*4<2) + sound (trace_ent, CHAN_WEAPON, "player/headshot.wav", 0.25, ATTN_IDLE); + else + sound (trace_ent, CHAN_WEAPON, "player/udeath.wav", 0.25, ATTN_IDLE); + } + return; + } + else if (trace_ent.takedamage) + { + loud_noise(15); + tdam = (30*(random()*30)); + sdam = ftos(tdam); + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + SpawnBlood (org, 1); + else + SpawnNonBlood (org, 1); T_Damage (trace_ent, self, self, tdam); + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); + return; + } + } + else if (trace_ent.takedamage) + { + //soldiers and assassins do more melee damage + if (self.class == 2 || self.class == 3) + damage = damage * 1.25; + + if (weap == IID_WP_AXE || weap == IID_WP_SPEAR || weap == IID_WP_KNIFE) + SpawnBlood (org, 1); + + if ((getperk(8)) && (weap == IID_WP_AXE || weap == IID_WP_SPEAR || weap == IID_WP_WRENCH)) + { + sprint(self, 2, "!LARGE AND IN CHARGE\n"); + dir = normalize(trace_ent.origin - self.origin); + trace_ent.velocity = dir * 600; + trace_ent.velocity_z = 100+random()*200; + } + trace_ent.axhitme = 1; - SpawnBlood (org, 1); + if (trace_ent.classname != "car") + { + if (weap == IID_NONE) + { + if (random()<0.5) + sound (self, CHAN_BODY, "weapons/brawl-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "weapons/brawl-2.wav", 1, ATTN_NORM); + } + else + sound (trace_ent, CHAN_VOICE, "player/headshot.wav", 0.5, ATTN_IDLE); + } T_Damage (trace_ent, self, self, damage+random()*damage); - sound (self, CHAN_WEAPON, trace_ent.armornoise, 1, ATTN_NORM); + } + + else if (weap == IID_NONE) + { + if (random()<0.5) + sound (self, CHAN_BODY, "weapons/brawl-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "weapons/brawl-2.wav", 1, ATTN_NORM); + } + else if (weap == IID_WP_AXE || weap == IID_WP_WRENCH) + { + if (random()<0.5) + sound (self, CHAN_BODY, "effects/axe_hit1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "effects/axe_hit2.wav", 1, ATTN_NORM); + } + else if (weap == IID_WP_SPEAR) + { + if (random()<0.5) + sound (self, CHAN_BODY, "effects/spear_hit1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "effects/spear_hit2.wav", 1, ATTN_NORM); } else - { // hit wall - sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); - - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, org_x); - WriteCoord (MSG_MULTICAST, org_y); - WriteCoord (MSG_MULTICAST, org_z); - multicast (self.origin, MULTICAST_PHS); - } + sound (self, CHAN_WEAPON, "weapons/knifehit.wav", 1, ATTN_NORM); }; void() W_FireMelee = @@ -103,27 +328,27 @@ void() W_FireMelee = local float iid; iid = ToIID(self.(SlotField(self.current_slot))); if (iid == IID_NONE) - FireMelee(3, 32, 0.6); - else if (iid == IID_WP_TOOLKIT) - FireMelee(5, 32, 0.2); + FireMelee(5+random()*10, 64, 0.6); + else if (iid == IID_WP_WRENCH) + FireMelee(5+random()*30, 64, 1.2); else if (iid == IID_WP_KNIFE) - FireMelee(5, 32, 0.2); + FireMelee(5+random()*20, 64, 0.4); else if (iid == IID_WP_AXE) - FireMelee(10, 64, 0.2); - else if (iid == IID_WP_VIBROBLADE) - FireMelee(25, 64, 0.2); - else if (iid == IID_WP_POWERAXE) - FireMelee(50, 96, 0.2); + FireMelee(5+random()*80, 96, 1); + else if (iid == IID_WP_SPEAR) + FireMelee(5+random()*60, 160, 0.8); else if (iid == IID_CHEM_STIMPACK || iid == IID_CHEM_MEDICALBAG || - iid == IID_CHEM_SUPERSTIM) + iid == IID_CHEM_SUPERSTIM || + iid == IID_MISC_NUKACOLA) { if (UseHealingChem(iid)) DecreaseDestroySlot(self.current_slot); } else if (iid == IID_CHEM_ADRENALINE || iid == IID_CHEM_PSYCHO || + iid == IID_CHEM_RADX || iid == IID_CHEM_BESERK) { if (UseBoostingChem(iid)) @@ -133,6 +358,27 @@ void() W_FireMelee = dprint(strcat("W_FireMelee - ", ftos(iid), "not implemented\n")); }; +void () player_single1 = [ 89, player_single2 ] +{ + self.weaponframe = 1; + muzzleflash (); +}; + +void () player_single2 = [ 90, player_run ] +{ + self.weaponframe = 2; +}; + +void () player_single1_s = [ 182, player_single2_s ] +{ + self.weaponframe = 1; + muzzleflash (); +}; + +void () player_single2_s = [ 183, player_run ] +{ + self.weaponframe = 2; +}; //============================================================================ @@ -195,6 +441,28 @@ void(vector org, float damage) SpawnBlood = multicast (org, MULTICAST_PVS); }; +void(vector org, float damage) SpawnNonBlood = +{ + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_KNIGHTSPIKE); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + multicast (org, MULTICAST_PVS); +}; + +void(vector org, float damage) MassBlood = +{ + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_GUNSHOT); + WriteByte (MSG_MULTICAST, 1); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + multicast (org, MULTICAST_PVS); +}; + + /* ================ spawn_touchblood @@ -357,32 +625,15 @@ void() T_MissileTouch = if (other == self.owner) return; // don't explode on owner - if (self.voided) { - return; - } - self.voided = 1; - if (pointcontents(self.origin) == CONTENT_SKY) { remove(self); return; } - damg = 100 + random()*20; - - if (other.health) - { - other.deathtype = "rocket"; - T_Damage (other, self, self.owner, damg ); - } - // don't do radius damage to the other, because all the damage - // was done in the impact + T_RadiusDamage2 (self, self.owner, 100+random()*100, world, 600); - - T_RadiusDamage (self, self.owner, 120, other, "rocket"); - -// sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); self.origin = self.origin - 8 * normalize(self.velocity); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); @@ -396,6 +647,126 @@ void() T_MissileTouch = }; +/* +================ +W_FirePlasma +================ +*/ +void () PlasmaBolt = +{ + local float dam; + local float zdif; + local float ydif; + local float xdif; + local float tru; + + if (other.solid == SOLID_TRIGGER) + return; //they're not really solid + + if (pointcontents (self.origin) == CONTENT_SKY) + { + remove (self); + return; + } + + if (other.takedamage) + { + dam = 30 + (random () * 30); + + T_Damage (other, self, self.owner, dam); + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNINGBLOOD); + WriteCoord (MSG_MULTICAST, self.origin_x); + WriteCoord (MSG_MULTICAST, self.origin_y); + WriteCoord (MSG_MULTICAST, self.origin_z); + multicast (self.origin, MULTICAST_PHS); + sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_NORM); + } + else + { + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNINGBLOOD); + WriteCoord (MSG_MULTICAST, self.origin_x); + WriteCoord (MSG_MULTICAST, self.origin_y); + WriteCoord (MSG_MULTICAST, self.origin_z); + multicast (self.origin, MULTICAST_PHS); + sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_NORM); + } + remove (self); +}; + +void() FirePlasmaBolt = +{ + local float tmp; + local vector adjust; + + if (self.attack >= 3) + return; + + DropAmmo (); + self.attack_finished = time + 0.1; + + sound (self, CHAN_WEAPON, "weapons/energy2.wav", 1, ATTN_NORM); + + msg_entity = self; + WriteByte (MSG_ONE, SVC_SMALLKICK); + + self.recoil = self.recoil + 4; + self.attack = self.attack + 1; + + if (random()*3<=2) + self.driftx = self.driftx + 72; + else + self.driftx = self.driftx - 72; + + if (random()*2<=1) + self.drifty = self.drifty + 72; + else + self.drifty = self.drifty - 72; + + newmis = spawn (); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + + makevectors (self.v_angle); + newmis.velocity = aim(self, 2000); + newmis.velocity = newmis.velocity * 2000; + newmis.angles = vectoangles(newmis.velocity); + + newmis.touch = PlasmaBolt; + newmis.voided = 0; + + newmis.nextthink = time + 5; + newmis.think = SUB_Remove; + newmis.classname = "rocket"; + + if (self.position == 0) + player_single1(); + if (self.position == 1) + player_single1_s(); + if (self.position == 2) + player_single1_s(); + + + if (self.position == 0) + adjust = '0 0 0'; + if (self.position == 1) + adjust = '0 0 -16'; + if (self.position == 2) + adjust = '0 0 -32'; + + newmis.effects = EF_BLUE; + setmodel (newmis, "progs/plasma.mdl"); + setsize (newmis, '0 0 0', '0 0 0'); + setorigin (newmis, self.origin + v_forward*8 + '0 0 16' + adjust); + + tmp = 60; + tmp = tmp + self.velocity_y + self.velocity_x; + + newmis.velocity = newmis.velocity + (v_right * crandom () * tmp) + (v_up * crandom () * tmp); + +}; /* ================ @@ -453,6 +824,8 @@ void(entity from, float damage) LightningHit = multicast (trace_endpos, MULTICAST_PVS); T_Damage (trace_ent, from, from, damage); + if (trace_ent.classname == "player") + trace_ent.hold = 120; }; /* @@ -938,6 +1311,9 @@ float() W_BestWeapon = return IT_AXE; }; +void() player_reload1; +void() player_creload1; + void (float slotno) ReloadWeapon = { local float at; @@ -946,12 +1322,16 @@ void (float slotno) ReloadWeapon = local float ac; local float x; local float wid; + local float r; local .float wslot; if (self.rtime > time || self.attack_finished > time) return; + if (self.zoom > 0) + ZoomIn(); + wslot = SlotField(slotno); if (self.wslot == 0) @@ -987,13 +1367,38 @@ void (float slotno) ReloadWeapon = self.wslot = SlotVal(wid, x + ToStatus(self.wslot)); - if (wid == IID_WP_ROCKETLAUNCHER || wid == IID_WP_PIPERIFLE || wid == IID_WP_WINCHESTER || wid == IID_WP_MOSSBERG) + r = 3; + + if (wid == IID_WP_ROCKETLAUNCHER || wid == IID_WP_WINCHESTER || wid == IID_WP_MOSSBERG) { - sound (self, CHAN_WEAPON, "weapons/shell.wav", TRUE, ATTN_NORM); - self.attack_finished = time + 1; - self.rtime = time + 1; + sound (self, CHAN_VOICE, "weapons/shell.wav", TRUE, ATTN_NORM); + r = 1; if (self.current_slot == slotno) self.currentammo = ToStatus(ItemInSlot(self, slotno)); + self.attack_finished = time + r; + self.rtime = time + r; + + return; + } + else if (wid == IID_WP_PIPERIFLE_R || wid == IID_WP_PIPERIFLE_S_R || wid == IID_WP_PIPERIFLE_SCOPE_R || wid == IID_WP_PIPERIFLE_SCOPE_S_R) + { + sound (self, CHAN_VOICE, "weapons/shell.wav", TRUE, ATTN_NORM); + r = 0.5; + if (self.current_slot == slotno) + self.currentammo = ToStatus(ItemInSlot(self, slotno)); + self.attack_finished = time + r; + self.rtime = time + r; + + return; + } + else if (wid >= IID_WP_PIPERIFLE && wid <= IID_WP_PIPERIFLE_S_R) + { + sound (self, CHAN_VOICE, "weapons/shell.wav", TRUE, ATTN_NORM); + r = 1; + if (self.current_slot == slotno) + self.currentammo = ToStatus(ItemInSlot(self, slotno)); + self.attack_finished = time + r; + self.rtime = time + r; return; } @@ -1002,16 +1407,17 @@ void (float slotno) ReloadWeapon = sprint(self, 2, "reloading...\n"); - if (self.perk == 3) - { - self.attack_finished = time + 1; - self.rtime = time + 1; - } - else - { - self.attack_finished = time + 2; - self.rtime = time + 2; - } + if (self.position == 0) + player_reload1(); + else if (self.position == 1) + player_creload1(); + + if (getperk(5)) + r = r * 0.5; + + + self.attack_finished = time + r; + self.rtime = time + r; if (self.current_slot == slotno) self.currentammo = ToStatus(ItemInSlot(self, slotno)); @@ -1054,6 +1460,22 @@ float() W_CheckNoAmmo = return FALSE; }; +void() ToggleFlare = +{ + if (self.flare == 0) + { + sound (self, CHAN_BODY, "weapons/flare.wav", 1, ATTN_NORM); + self.flare = 1; + self.effects = EF_BLUE; + } + else if (self.flare == 1) + { + sound (self, CHAN_BODY, "weapons/gpull.wav", 1, ATTN_NORM); + self.flare = 0; + self.effects = self.effects - EF_BLUE; + } +}; + /* ============ W_Attack @@ -1066,11 +1488,26 @@ void() W_Attack = { local float weap; + if (self.hold > 0) + return; + + if (self.popup > 0) + { + self.popup = 0; + self.attack_finished = time + 5; + stuffcmd(self, "-attack\n"); + return; + } + makevectors (self.v_angle); // calculate forward angle for velocity self.show_hostile = time + 1; // wake monsters up if (self.rtime > time) return; + if (self.class == 0) + return; + if (self.team == 0) + return; if (self.attack_finished > time) return; @@ -1079,72 +1516,183 @@ void() W_Attack = weap = ToIID(self.(SlotField(self.current_slot))); + self.safezone = 0; - if (weap == IID_NONE || - weap == IID_WP_KNIFE || - weap == IID_WP_AXE || - weap == IID_WP_VIBROBLADE || - weap == IID_WP_POWERAXE) + if (weap == IID_NONE) + { + if (getperk(15)) + { + if ((self.velocity_z > 0) && self.recoil == 0) + player_dragon_kick (); + else + { + if (random()<0.25) + player_swing1 (); + else if (random()<0.25) + player_swing1a (); + else if (random()<0.25) + player_kick1 (); + else if (random()<0.25) + player_kick1a (); + } + + sound (self, CHAN_WEAPON, "effects/axe_swing.wav", TRUE, ATTN_IDLE); + } + else + { + self.attack_finished = time + 0.50; + if (random()<0.5) + player_punch1 (); + else + player_punch2 (); + + sound (self, CHAN_WEAPON, "weapons/ax1.wav", TRUE, ATTN_IDLE); + } + } + else if (weap == IID_WP_KNIFE) { self.attack_finished = time + 0.50; - player_knife1 (); + if (random()<0.5) + player_knife1 (); + else + player_knifea (); + + sound (self, CHAN_WEAPON, "weapons/ax1.wav", TRUE, ATTN_NORM); + + } + else if (weap == IID_WP_SPEAR) + { + self.attack_finished = time + 0.80; + + if (random()<0.5) + player_spear1 (); + else + player_spear1a (); + + sound (self, CHAN_WEAPON, "effects/miss.wav", TRUE, ATTN_NORM); + + } + else if (weap == IID_WP_AXE || weap == IID_WP_WRENCH) + { + if (random()<0.75) + { + player_axeb1 (); + self.attack_finished = time + 1; + } + else + { + player_axe1 (); + self.attack_finished = time + 1.25; + } } else if (weap == IID_WP_USP) - FirePistol(12, 2, "weapons/1911.wav", 2000, 0.25); + FirePistol(14, 6, "weapons/usp.wav", 2000, 0.1); + else if (weap == IID_WP_USP_S) + FirePistol(12, 6, "weapons/smg_s.wav", 2000, 0.1); else if (weap == IID_WP_DEAGLE) - FirePistol(15, 2, "weapons/deagle.wav", 2000, 0.25); + FirePistol(18, 9, "weapons/deagle.wav", 3000, 0.1); + else if (weap == IID_WP_DEAGLE_M) + FirePistol(18, 9, "weapons/deagle.wav", 3000, 0.1); else if (weap == IID_WP_NEEDLER) - FirePistol(10, 2, "weapons/needler.wav", 2000, 0.25); + FirePistol(16, 2, "weapons/needler.wav", 2000, 0.1); + else if (weap == IID_WP_GLOCK) + FirePistol(12, 6, "weapons/glock.wav", 2000, 0.1); + else if (weap == IID_WP_GLOCK_S) + FirePistol(10, 6, "weapons/smg_s.wav", 2000, 0.1); else if (weap == IID_WP_ALIENBLASTER) - FireAlienBlaster(); + FirePulseRifle(16, 0.1, 48, 2); else if (weap == IID_WP_PIPERIFLE) - FireAssaultRifle(18, 2, "weapons/rangem.wav", 3000, 0.1); + FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_S) + FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_S_R) + FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_SCOPE_S_R) + FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_SCOPE_S) + FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_R) + FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_SCOPE) + FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_SCOPE_R) + FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + else if (weap == IID_WP_DKS1_S) + FireAssaultRifle(35, 3, "weapons/moonlight1.wav", 5000, 0.25); else if (weap == IID_WP_WINCHESTER) - W_FireShotgun (1, 5, 6, 160, 3000, 0); + W_FireShotgun (2, 4, 8, 30, 1500, 0, "weapons/shotgun1.wav"); else if (weap == IID_WP_MOSSBERG) - W_FireShotgun (1, 5, 6, 160, 3000, 0); + W_FireShotgun (2, 4, 8, 20, 2000, 1, "weapons/citykiller.wav"); else if (weap == IID_WP_JACKHAMMER) - W_FireShotgun (1, 5, 6, 160, 3000, 1); + W_FireShotgun (1, 4, 9, 25, 1750, 2, "weapons/citykiller.wav"); else if (weap == IID_WP_MP9) - FireSMG(12, 2, "weapons/burst.wav", 2000, 0.09); + FireSMG(14, 0, "weapons/mp7.wav", 1500, 0.10); else if (weap == IID_WP_MP7) - FireSMG(12, 2, "weapons/mp7.wav", 2000, 0.09); + FireSMG(12, 0, "weapons/mp5.wav", 1500, 0.08); + else if (weap == IID_WP_MP9_S) + FireSMG(12, 0, "weapons/smg_s.wav", 1500, 0.10); + else if (weap == IID_WP_MP7_S) + FireSMG(10, 0, "weapons/smg_s.wav", 1500, 0.08); else if (weap == IID_WP_RANGEMASTER) - FireAssaultRifle(14, 2, "weapons/rangem.wav", 4000, 0.5); + FireAssaultRifle(18, 4, "weapons/rangem.wav", 4000, 0.1); else if (weap == IID_WP_AK112) - FireAssaultRifle(14, 2, "weapons/ak112.wav", 4000, 0.09); + FireAssaultRifle(16, 10, "weapons/ak112.wav", 4000, 0.095); + else if (weap == IID_WP_AK112_M) + FireAssaultRifle(16, 10, "weapons/ak112.wav", 4000, 0.095); + else if (weap == IID_WP_ACR) + FireAssaultRifle(16, 7, "weapons/auto2.wav", 9000, 0.090); else if (weap == IID_WP_AK74) - FireAssaultRifle(18, 2, "weapons/ak47.wav", 4000, 0.1); + FireAssaultRifle(20, 12, "ogre/ak47.wav", 3500, 0.090); else if (weap == IID_WP_DKS1) - FireAssaultRifle(24, 2, "weapons/dks-1.wav", 8000, 0.5); - else if (weap == IID_WP_MOONLIGHT) - FireAssaultRifle(14, 2, "weapons/m4-nw.wav", 4000, 0.09); - else if (weap == IID_WP_SA80) - FireAssaultRifle(17, 2, "weapons/sa80.wav", 4000, 0.08); + FireAssaultRifle(40, 3, "weapons/dks-1.wav", 8000, 0.2); + else if (weap == IID_WP_MOONLIGHT && self.zoom == 0) + FireAssaultRifle(16, 10, "weapons/m4-nw.wav", 4000, 0.09); + else if (weap == IID_WP_MOONLIGHT && self.zoom == 1) + FireAssaultRifle(16, 5, "weapons/m4-nw.wav", 4000, 0.20); + else if (weap == IID_WP_G11 && self.zoom == 0) + FireAssaultRifle(14, 7, "weapons/g11.wav", 4000, 0.11); + else if (weap == IID_WP_G11 && self.zoom == 1) + FireAssaultRifle(14, 7, "weapons/g11.wav", 4000, 0.02); else if (weap == IID_WP_FNFAL) - FireAssaultRifle(12, 3, "weapons/fnfal.wav", 6000, 0.12); + FireAssaultRifle(30, 6, "weapons/fnfal.wav", 7000, 0.11); + else if (weap == IID_WP_PULSERIFLE) + FirePulseRifle(12, 0.8, 36, 2); + else if (weap == IID_WP_TURBOPLASMA) + FirePulseRifle(8, 0.4, 30, 2); + else if (weap == IID_WP_PLASMACARBINE) + FirePlasmaBolt(); + else if (weap == IID_WP_GAUSERIFLE) + FireAssaultRifle(30, 80, "weapons/gauss.wav", 9000, 0.2); + else if (weap == IID_WP_LASERGATLING) + FireMinigun(16, 20, "weapons/ak112.wav", 4000, 0.05); + + //FirePulseRifle(2, 0.1, 30, 3); + //float IID_WP_GAUSERIFLE = 421; //float IID_WP_PULSERIFLE = 422; else if (weap == IID_GREN_FRAG) - player_throw1(); + player_pull1(); else if (weap == IID_GREN_EMP) - player_throw1(); + player_pull1(); else if (weap == IID_GREN_SMOKE) - player_throw1(); + player_pull1(); else if (weap == IID_GREN_FLASH) - player_throw1(); + player_pull1(); else if (weap == IID_WP_ROCKETLAUNCHER) W_FireRocket(); - else if (weap == IID_WP_TOOLKIT) + else if (weap == IID_WP_WRENCH) { if (!FireToolkit()) { - self.attack_finished = time + 0.25; - player_knife1 (); + self.attack_finished = time + 1; + if (random()<0.5) + player_knife1 (); + else + player_knifea (); } } else if (IsChem(weap)) @@ -1168,16 +1716,33 @@ void() W_ChangeWeapon = it = self.items; am = 0; - - if (self.impulse == 1) + + + if (self.impulse == 1 && self.current_slot != 1) { + if (!getperk(5)) + { + self.weaponframe = 4; + self.attack_finished = time + 1; + self.rtime = time + 1; + } fl = IT_NAILGUN; - self.current_slot = 1; + self.current_slot = 1; + if (IsMelee(ToIID(self.islot1))) + SpawnGModel(); } - if (self.impulse == 2) + else if (self.impulse == 2 && self.current_slot != 2) { + if (!getperk(5)) + { + self.weaponframe = 4; + self.attack_finished = time + 1; + self.rtime = time + 1; + } fl = IT_SUPER_NAILGUN; self.current_slot = 2; + if (IsMelee(ToIID(self.islot2))) + SpawnGModel(); } self.weapon = fl; @@ -1191,6 +1756,16 @@ CheatCommand */ void() CheatCommand = { + local float x; + local string y; + + x = self.waterlevel; + y = ftos(x); + + sprint(self, 2, "waterlevel: "); + sprint(self, 2, y); + sprint(self, 2, "\n"); + self.ammo_shells = 900; }; @@ -1275,7 +1850,8 @@ void () ProneOff = { setsize(self, '-16 -16 -24', '16 16 32'); - if (!walkmove(0, 0)) + //if (!walkmove(0, 0) && self.waterlevel == 0) + if (pointcontents (self.origin + '0 0 32') == CONTENT_SOLID) //not enough room to stand up { sprint (self, 2, "not enough room to stand up.\n"); setsize(self, '-16 -16 -24', '16 16 0'); @@ -1283,6 +1859,16 @@ void () ProneOff = } sprint (self, 2, "position: stand.\n"); + if (getperk(3)) + { + self.attack_finished = time + 0.5; + self.rtime = time + 0.5; + } + else + { + self.attack_finished = time + 1.5; + self.rtime = time + 1.5; + } self.position = 0; PositionControl(); player_run (); @@ -1290,7 +1876,16 @@ void () ProneOff = void () ProneOn = { - if (self.velocity_z != 0) + if (self.waterlevel > 0) + { + sprint (self, 2, "position: stand.\n"); + self.position = 0; + PositionControl(); + player_run (); + return; + } + + if (!getperk(3) && self.velocity_z != 0) return; if (self.position == 2) @@ -1299,10 +1894,22 @@ void () ProneOn = return; } + self.walk = 0; + self.speedmulti = 1.00; self.maxspeed = (self.maxspeed * 0.25); self.position = 2; self.view_ofs = '0 0 -10'; sprint (self, 2, "position: prone.\n"); + if (getperk(3)) + { + self.attack_finished = time + 0.5; + self.rtime = time + 0.5; + } + else + { + self.attack_finished = time + 1.5; + self.rtime = time + 1.5; + } PositionControl(); }; @@ -1311,13 +1918,19 @@ void () DuckOff = { setsize(self, '-16 -16 -24', '16 16 32'); - if (!walkmove(0, 0)) + //if (!walkmove(0, 0) && self.waterlevel == 0) + if (pointcontents (self.origin + '0 0 16') == CONTENT_SOLID) //not enough room to stand up { sprint (self, 2, "not enough room to stand up.\n"); setsize(self, '-16 -16 -24', '16 16 16'); return; } sprint (self, 2, "position: stand.\n"); + if (!getperk(3)) + { + self.attack_finished = time + 0.2; + self.rtime = time + 0.2; + } self.view_ofs = '0 0 22'; self.position = 0; PositionControl(); @@ -1327,97 +1940,59 @@ void () DuckOff = void () DuckOn = { + if (self.waterlevel > 0) + { + if (!getperk(3)) + { + self.attack_finished = time + 0.5; + self.rtime = time + 0.5; + } + sprint (self, 2, "position: stand.\n"); + self.view_ofs = '0 0 22'; + self.position = 0; + PositionControl(); + player_run (); + self.position = 0; + return; + } + if (self.velocity_z != 0) return; - + if (self.position == 1) { DuckOff(); return; } + if (!getperk(3)) + { + self.attack_finished = time + 0.5; + self.rtime = time + 0.5; + } + self.walk = 0; + self.speedmulti = 1.00; self.maxspeed = (self.maxspeed * 0.50); self.position = 1; sprint (self, 2, "position: duck.\n"); PositionControl(); }; - -/* -============ -CycleWeaponReverseCommand - -Go to the prev weapon with ammo -============ -*/ -void() CycleWeaponReverseCommand = +void () WalkOff = { - local float it, am; - - it = self.items; - self.impulse = 0; - - while (1) - { - am = 0; - - if (self.weapon == IT_LIGHTNING) - { - self.weapon = IT_ROCKET_LAUNCHER; - if (self.ammo_rockets < 1) - am = 1; - } - else if (self.weapon == IT_ROCKET_LAUNCHER) - { - self.weapon = IT_GRENADE_LAUNCHER; - if (self.ammo_rockets < 1) - am = 1; - } - else if (self.weapon == IT_GRENADE_LAUNCHER) - { - self.weapon = IT_SUPER_NAILGUN; - if (self.ammo_nails < 2) - am = 1; - } - else if (self.weapon == IT_SUPER_NAILGUN) - { - self.weapon = IT_NAILGUN; - if (self.ammo_nails < 1) - am = 1; - } - else if (self.weapon == IT_NAILGUN) - { - self.weapon = IT_SUPER_SHOTGUN; - if (self.ammo_shells < 2) - am = 1; - } - else if (self.weapon == IT_SUPER_SHOTGUN) - { - self.weapon = IT_SHOTGUN; - if (self.ammo_shells < 1) - am = 1; - } - else if (self.weapon == IT_SHOTGUN) - { - self.weapon = IT_AXE; - } - else if (self.weapon == IT_AXE) - { - self.weapon = IT_LIGHTNING; - if (self.ammo_cells < 1) - am = 1; - } - - if ( (it & self.weapon) && am == 0) - { - W_SetCurrentAmmo (); - return; - } - } - + sprint (self, 2, "position: run.\n"); + self.walk = 0; + self.speedmulti = 1.00; }; +void () WalkOn = +{ + sprint (self, 2, "position: walk.\n"); + self.walk = 1; + self.speedmulti = 0.50; +}; + /* ============ @@ -1440,21 +2015,48 @@ ImpulseCommands */ void() ImpulseCommands = { - if (self.impulse >= 1 && self.impulse <= 4 && self.currentmenu == "none") + if (self.hold > 0) + return; + + if (self.impulse >= 1 && self.impulse <= 2 && self.currentmenu == "none") W_ChangeWeapon (); - if (self.impulse >= 1 && self.impulse <= 10 && self.currentmenu != "none") + if (self.impulse == 3 && self.currentmenu == "none") + Cmd_InvUse("5"); + if (self.impulse == 4 && self.currentmenu == "none") + Cmd_InvUse("6"); + + if (self.impulse >= 1 && self.currentmenu == "shop_perk1") + { W_PlayerMenu (); + self.impulse = 0; + return; + } + else if (self.impulse >= 1 && self.currentmenu == "shop_perk2") + { + W_PlayerMenu (); + self.impulse = 0; + return; + } + else if (self.impulse >= 1 && self.impulse <= 10 && self.currentmenu != "none") + { + W_PlayerMenu (); + self.impulse = 0; + return; + } + if (self.impulse == 11) ServerflagsCommand (); - if (self.impulse == 12) - CycleWeaponReverseCommand (); + if (self.impulse == 200) DuckOn (); if (self.impulse == 201) ProneOn (); + if (self.impulse == 240) + AddClone (); + if (self.impulse == 50) ReloadWeapon (self.current_slot); // if (self.impulse == 51) @@ -1463,7 +2065,7 @@ void() ImpulseCommands = BuyMenu (); if (self.impulse == 53) Special (); - if (self.impulse == 54) + if (self.impulse == 100) ExitScreen (); if (self.impulse == 55) DropFromSlot (self.current_slot, 1, 0); @@ -1471,6 +2073,48 @@ void() ImpulseCommands = CharacterSheet (); if (self.impulse == 57) UseEquipment (); + if (self.impulse == 60) + ZoomIn (); + if (self.impulse == 65) + HostageReport (); + + if (self.impulse == 66) + WalkOn (); + if (self.impulse == 67) + WalkOff (); + + if (self.impulse == 212) + function_radio ("radio/1_yes.wav", 1); + if (self.impulse == 213) + function_radio ("radio/2_no.wav", 2); + if (self.impulse == 214) + function_radio ("radio/3_letsgo.wav", 3); + if (self.impulse == 215) + function_radio ("radio/4_cover.wav", 4); + if (self.impulse == 216) + function_radio ("radio/5_recon.wav", 5); + if (self.impulse == 217) + function_radio ("radio/6_backup.wav", 6); + if (self.impulse == 218) + function_radio ("radio/7_hold.wav", 7); + if (self.impulse == 219) + function_radio ("radio/8_behind.wav", 8); + if (self.impulse == 220) + function_radio ("radio/9_secure.wav", 9); + if (self.impulse == 221) + function_radio ("radio/10_suppressing.wav", 10); + if (self.impulse == 222) + function_radio ("radio/11_quiet.wav", 11); + if (self.impulse == 223) + CheatCommand(); + if (self.impulse == 224) + show_light_level(); + if (self.impulse == 225) + UseStimpack(); + if (self.impulse == 226) + UseSuperStim(); + if (self.impulse == 227) + UseMedicalBag(); if (self.impulse == 255) self.ammo_shells = 200; @@ -1487,6 +2131,8 @@ Called every frame so impulse events can be handled as well as possible */ void() W_WeaponFrame = { + local float weap; + if (time < self.attack_finished) return; @@ -1500,6 +2146,7 @@ void() W_WeaponFrame = } if (!self.button0) { + if (self.attack > 0) player_run (); @@ -1539,14 +2186,29 @@ void () DropAmmo = self.currentammo = ToStatus(self.wslot); }; -void() muzzleflash = + +void() autofire = { - WriteByte (MSG_MULTICAST, SVC_MUZZLEFLASH); - WriteEntity (MSG_MULTICAST, self); - multicast (self.origin, MULTICAST_PVS); + if (self.attack == 0) + self.cnt = 0; + + if (self.weaponframe == 1) + self.weaponframe = 2; + else + self.weaponframe = 1; + + if (self.cnt == 0) + player_singlex(); + else if (self.cnt == 1) + player_singley(); + + self.cnt = self.cnt + 1; + + if (self.cnt == 2) + self.cnt = 0; }; -void () autofire = +/*void () autofire = { if (self.frame == 88) self.frame = 89; @@ -1560,46 +2222,30 @@ void () autofire = self.weaponframe = 1; muzzleflash (); -}; +};*/ -void () autofire_s = +void() autofire_s = { - if (self.frame == 88) - self.frame = 89; - else - self.frame = 88; + if (self.attack == 0) + self.cnt = 0; if (self.weaponframe == 1) self.weaponframe = 2; else self.weaponframe = 1; - muzzleflash (); + if (self.cnt == 0) + player_auto_duck1(); + else if (self.cnt == 1) + player_auto_ducka1(); + + self.cnt = self.cnt + 1; + + if (self.cnt == 2) + self.cnt = 0; }; -void () player_single1 = [ 88, player_single2 ] -{ - self.weaponframe = 1; - muzzleflash (); -}; - -void () player_single2 = [ 89, player_run ] -{ - self.weaponframe = 2; -}; - -void () player_single1_s = [ 183, player_single2_s ] -{ - self.weaponframe = 1; - muzzleflash (); -}; - -void () player_single2_s = [ 184, player_run ] -{ - self.weaponframe = 2; -}; - void (vector org) bullet_hole = { local float r; @@ -1712,7 +2358,8 @@ void () EMPExplode = WriteCoord (MSG_BROADCAST, self.origin_z); sound (self, CHAN_BODY, "misc/flash.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "misc/flash.wav", 0.2, ATTN_NONE); - te = findradius (self.origin, 300); + + te = findradius (self.origin, 600); while (te) { if ((((te.classname == "camera") || (te.classname == "alarm")) && (te.owner.pcamera == 0))) @@ -1726,9 +2373,16 @@ void () EMPExplode = sprint (self.owner, 2, " was wiped out!\n"); remove (te); } + if (te.has_radio == 1) + { + te.has_radio = 0; + sprint (self.owner, 2, te.netname); + sprint (self.owner, 2, "'s radio was wiped out!\n"); + } + te = te.chain; } - T_RadiusDamage (self, self.owner, 45+random()*45, other, ""); + T_RadiusDamage (self, self.owner, 30+random()*30, other, ""); remove (self); }; @@ -1763,36 +2417,97 @@ void () SmokeThink = WriteCoord (MSG_MULTICAST, self.origin_z); multicast (self.origin, MULTICAST_PVS); + if (self.cnt == 1) + sound (self, CHAN_VOICE, "weapons/smoke.wav", 1, ATTN_NORM); + self.nextthink = (time + 0.33); if (self.cnt >= 90) remove (self); }; -void () FragExplode = +void () Screenshake = +{ + local entity te; + + te = findradius (self.origin, 700); + while (te) + { + if (te.classname == "player") + stuffcmd (te, "v_idlescale 5\n"); + te = te.chain; + } +}; + + +void () ExplosionFrames = +{ + self.avelocity = '300 300 250'; + self.nextthink = (time + 0.02); + self.frame = self.frame + 1; + if (self.frame == 60) + remove (self); + + self.nextthink = (time + 0.02); +}; + +void () Explosion = { local float r; - sound (self, CHAN_VOICE, "ambience/gunfire7.wav", 1, ATTN_NONE); - self.origin = (self.origin + '0 0 16'); + self.effects = EF_DIMLIGHT; + self.touch = SUB_Null; + + r = random (); + if (r < 0.33) + sound (self, CHAN_BODY, "misc/exp1.wav", 1, ATTN_NORM); + if (r < 0.66) + sound (self, CHAN_BODY, "misc/exp2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "misc/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); - r = random (); - if ((r < 0.3)) + Screenshake (); + self.frame = 3; + self.velocity = VEC_ORIGIN; + self.avelocity = '300 300 250'; + self.think = ExplosionFrames; + self.nextthink = (time + 0.02); +}; + +void () FragExplode = +{ + local float r; + local entity te; + local vector dir; + + sound (self, CHAN_VOICE, "ambience/gunfire7.wav", 1, ATTN_NONE); + self.origin = (self.origin + '0 0 16'); + setmodel (self, "progs/blast.mdl"); + setorigin (self, self.origin); + setsize (self, '0 0 0', '0 0 0'); + + bprint(2, "fragex\n"); + Explosion(); + + te = findradius(self.origin, 400); + while (te)//bodies fly { - sound (self, CHAN_BODY, "misc/exp1.wav", 1, ATTN_NORM); + if (te.classname == "body") + { + dir = normalize(te.origin - self.origin); + te.velocity = dir * 100; + te.velocity_z = 100; + te.avelocity_y = (random()* 300); + } + + te = te.chain; } - if ((r < 0.65)) - { - sound (self, CHAN_BODY, "misc/exp2.wav", 1, ATTN_NORM); - } - else - { - sound (self, CHAN_BODY, "misc/exp3.wav", 1, ATTN_NORM); - } - T_RadiusDamage (self, self.owner, 50+random()*50, other, ""); + + T_RadiusDamage2 (self, self.owner, 65+random()*65, other, 400); remove (self); }; @@ -1826,26 +2541,65 @@ void () FlashExplode = WriteCoord (0, self.origin_y); WriteCoord (0, self.origin_z); sound (self, CHAN_BODY, "misc/flash.wav", 1, ATTN_NORM); - te = findradius (self.origin, 1200); + + te = findradius (self.origin, 200); while (te) { - if (te.flags & FL_MONSTER && te.classname != te.owner.classname) - te.attack_finished = time + 6; + if (te.flags & FL_MONSTER) + { + if (CanDamage (self, te)) + { + te.flash = 4; + te.attack_finished = time + 4; + spawn_excla(te, 4); + } + } if ((te.classname == "player")) { -/* makevectors (te.angles); + if (CanDamage (self, te)) + { + te.missionbrief = 5; + stuffcmd (te, "v_cshift 255 255 255 255\n"); + stuffcmd (te, "v_idlescale 3\n"); + te.flash = time + 4; + + spawn_excla(te, 4); + } + } + te = te.chain; + } + + te = findradius (self.origin, 800); + while (te) + { + if (te.flags & FL_MONSTER) + { + makevectors (te.angles); vec = normalize ((self.origin - te.origin)); dot = (vec * v_forward); -*/ - if (/*dot > 0.3 &&*/ CanDamage (self, te)) + + if (dot > 0.3 && CanDamage (self, te)) + { + te.flash = 4; + te.attack_finished = time + 4; + spawn_excla(te, 4); + } + + } + if ((te.classname == "player")) + { + makevectors (te.angles); + vec = normalize ((self.origin - te.origin)); + dot = (vec * v_forward); + + if (dot > 0.3 && CanDamage (self, te)) { stuffcmd (te, "v_cshift 255 255 255 255\n"); - stuffcmd (te, "v_idlescale 10\n"); - if (self.owner.flags & FL_MONSTER) - te.flash = time + 2; - else - te.flash = time + 6; + stuffcmd (te, "v_idlescale 3\n"); + te.flash = time + 4; + + spawn_excla(te, 4); } } te = te.chain; @@ -1853,6 +2607,39 @@ void () FlashExplode = remove (self); }; +void () FlashThink = +{ + local entity te; + + te = findradius(self.origin, 600); + + while (te) + { + if (te.classname == "player" && te.sneak > 0) + te.sneak = 0; + + te = te.chain; + } + + self.nextthink = time + 1; + self.score = self.score + 1; + + if (self.score == 120) + remove(self); +}; + +void () StunExplode = +{ + local entity te; + local float dot; + local vector vec; + + self.effects = EF_BLUE; + self.think = FlashThink; + self.nextthink = time + 1; + sound (self, CHAN_BODY, "misc/flash.wav", 1, ATTN_NORM); +}; + /* void () HandGrenExplode = { @@ -1870,6 +2657,7 @@ void () HandGrenExplode = { if ((self.cnt == 2)) { + sound (self, CHAN_VOICE, "weapons/smoke.wav", 1, ATTN_NORM); self.nextthink = (time + 0.5); self.think = SmokeThink; } @@ -1917,26 +2705,23 @@ void () HandGrenBounce = } }; - void () FireHandGrenade = { local float item, iid; local float amcount; + local float w, x; - item = ItemInSlot(self, self.current_slot); + item = ItemInSlot(self, self.grenslot); iid = ToIID(item); amcount = ToStatus(item); if (iid == 0) return; - self.currentammo = amcount-1; - if (amcount <= 1) - SetItemSlot(self, self.current_slot, 0); - else - SetItemSlot(self, self.current_slot, SlotVal(iid, self.currentammo)); - + w = SlotOfItem(self, iid); + DecreaseDestroySlot(w); + //SetItemSlot(self, self.current_slot, w); msg_entity = self; WriteByte (MSG_ONE, SVC_SMALLKICK); @@ -1962,6 +2747,8 @@ void () FireHandGrenade = newmis.think = FragExplode; else if (iid == IID_GREN_EMP) newmis.think = EMPExplode; + else if (iid == IID_GREN_STUN) + newmis.think = StunExplode; else if (iid == IID_GREN_SMOKE) newmis.think = SmokeThink; else //if (iid == IID_GREN_FLASH) @@ -1970,7 +2757,8 @@ void () FireHandGrenade = newmis.frame = 1; setmodel (newmis, "progs/handgren.mdl"); setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); - setorigin (newmis, ((self.origin + (v_right * TE_BLOOD)) + (v_up * TE_BLOOD))); + setorigin (newmis, self.origin); + self.grenslot = 0; }; @@ -2003,7 +2791,9 @@ void(float slot, float magazine) GiveAmmo = }; -void (float dam, float rec, string snd, float rng, float rate) FirePistol = + + +void (float dam, float ap, string snd, float rng, float rate) FirePistol = { local float weap, tmp, zdif, xdif, ydif, is_headshot; local vector dir, source, targ, org, org2, org3, adjust; @@ -2011,14 +2801,53 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol = weap = ToIID(self.(SlotField(self.current_slot))); stuffcmd(self, "-attack\n"); - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); self.attack_finished = (time + rate); + if (getperk(16))//power shot adds a small bonus to the first shot fired + { + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + dam = dam * 1.20; + } + } + + if (self.extender == weap && self.silencer != weap) + dam = dam * 1.10; + + + sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); + + if (weap == IID_WP_NEEDLER) + loud_noise(5); + else if (weap == IID_WP_USP) + loud_noise(40); + else if (weap == IID_WP_GLOCK) + loud_noise(40); + else if (weap == IID_WP_DEAGLE) + loud_noise(50); + else if (weap == IID_WP_USP_S) + loud_noise(10); + else if (weap == IID_WP_GLOCK_S) + loud_noise(10); + + //only silenced weapons do not break stealth + if (weap != IID_WP_NEEDLER && weap != IID_WP_USP_S && weap != IID_WP_GLOCK_S && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + } + + if (self.position == 0) + player_single1(); + if (self.position == 1) + player_single1_s(); + if (self.position == 2) + player_single1_s(); - if (self.position == POS_STAND) - player_single1 (); - if (self.position >= POS_DUCK) - player_single1_s (); if (self.position == 0) adjust = '0 0 0'; @@ -2030,25 +2859,23 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol = DropAmmo (); makevectors (self.v_angle); - if (self.recoil >= 15) - self.recoil = 15; + if (self.recoil >= 10) + self.recoil = 10; + tmp = 50; - if (self.velocity != '0 0 0') - tmp = 400; + if (self.velocity == '0 0 0') + tmp = tmp + (20 * self.recoil); + else + tmp = tmp + (40 * self.recoil); - tmp = tmp + (40 * self.recoil); - - if (self.attack <= 3 && self.position == 1 && self.velocity_z == 0) - tmp = (tmp * 0.75); - - if (self.attack <= 3 && self.position == 2 && self.velocity_z == 0) - tmp = (tmp * 0.5); + if (self.steadyaim == 0) + tmp = tmp * 0.50; self.attack = self.attack + 1; - self.recoil = self.recoil + 4; + self.recoil = self.recoil + ap; source = self.origin + '0 0 22'; @@ -2072,59 +2899,94 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol = is_headshot = 0; - if (((ydif >= CONTENT_SKY) && (ydif <= TE_LIGHTNING2))) + if (((ydif >= -6) && (ydif <= 6))) is_headshot = 1; - if (((xdif >= CONTENT_SKY) && (xdif <= TE_LIGHTNING2))) + if (((xdif >= -6) && (xdif <= 6))) is_headshot = 1; if (self.attack <= 5 && is_headshot == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) self.critical = 3; dam = (dam * (1 - trace_fraction)); - if (trace_ent.solid != SOLID_BSP) + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) SpawnBlood (org, 1); - - if (trace_ent.solid == SOLID_BSP) + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + else if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") SpawnWood (trace_ent, org, 1); dam = dam + random()*dam; + if (weap == IID_WP_NEEDLER) X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_USP) + J_Damage (trace_ent, self, self, dam); else T_Damage (trace_ent, self, self, dam); + loud_noise(5);//hit flesh + + //victim survived the ambush + if (random()*10 < 8 && trace_ent.health > 0 && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); + } + self.critical = 0; } else { + te_smallflash(org); bullet_hole (org); dir = vectoangles (source - targ); return; } }; -void (float dam, float rec, string snd, float rng, float rate) FireSMG = +void (float dam, float ap, string snd, float rng, float rate) FireSMG = { local float weap, tmp, zdif, xdif, ydif, is_headshot; local vector dir, source, targ, org, org2, adjust; weap = ToIID(self.(SlotField(self.current_slot))); - if (weap != IID_WP_MP9) - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); - if (weap == IID_WP_MP9 && self.attack == 0) - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); - if (weap == IID_WP_MP9 && self.attack == 6) + if (getperk(16))//power shot adds a small bonus to the first shot fired { - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); - self.attack = 1; + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + dam = dam * 1.20; + } + } + + sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); + if (weap == IID_WP_MP9) + loud_noise(50); + else if (weap == IID_WP_MP7) + loud_noise(40); + else if (weap == IID_WP_MP9_S) + loud_noise(5); + else if (weap == IID_WP_MP7_S) + loud_noise(5); + + //only silenced weapons do not break stealth + if (weap != IID_WP_MP9_S && weap != IID_WP_MP7_S && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); } self.attack_finished = (time + rate); - - if (self.position == POS_STAND) + if (self.position == 0) autofire (); - if (self.position >= POS_DUCK) + if (self.position >= 1) autofire_s (); if (self.position == 0) @@ -2135,30 +2997,43 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG = adjust = '0 0 -32'; + if (self.attack > 0) + { + if (random()*3<=2) + self.driftx = self.driftx + 90; + else + self.driftx = self.driftx - 90; + + if (random()*2<=1) + self.drifty = self.drifty + 90; + else + self.drifty = self.drifty - 90; + } + DropAmmo (); makevectors (self.v_angle); - if (self.recoil >= 15) - self.recoil = 15; - tmp = 200; + if (self.recoil >= 10) + self.recoil = 10; - if (self.velocity != '0 0 0') - tmp = 200; + tmp = 150; - tmp = tmp + (40 * self.recoil); - - if (self.attack <= 3 && self.position == 1 && self.velocity_z == 0) - tmp = (tmp * 0.75); - - if (self.attack <= 3 && self.position == 2 && self.velocity_z == 0) - tmp = (tmp * 0.5); + if (self.velocity == '0 0 0') + tmp = tmp + (15*self.recoil); + else + tmp = tmp + (20*self.recoil); self.attack = self.attack + 1; - self.recoil = self.recoil + 3; + self.recoil = self.recoil + 4; source = self.origin + '0 0 22'; - targ = self.origin + '0 0 22' + v_right*crandom()* tmp + v_up*crandom()*tmp; + tmp = tmp * 0.50; + + if (self.steadyaim == 0) + tmp = tmp * 0.50; + + targ = self.origin + '0 0 22' + v_right*self.driftx + v_up*self.drifty + v_right*crandom()* tmp + v_up*random()*(tmp*2); traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); if (trace_fraction == 1) @@ -2173,25 +3048,37 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG = ydif = org2_y - trace_ent.origin_y; xdif = org2_x - trace_ent.origin_x; is_headshot = 0; - if (((ydif >= CONTENT_SKY) && (ydif <= TE_LIGHTNING2))) + if (((ydif >= -5) && (ydif <= 5))) is_headshot = 1; - if (((xdif >= CONTENT_SKY) && (xdif <= TE_LIGHTNING2))) + if (((xdif >= -5) && (xdif <= 5))) is_headshot = 1; - if (self.attack <= 5 && is_headshot == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) + if (self.attack == 1 && is_headshot == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) self.critical = 3; dam = (dam * (1 - trace_fraction)); - if (trace_ent.solid != SOLID_BSP) + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) SpawnBlood (org, 1); - - if (trace_ent.solid == SOLID_BSP) + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") SpawnWood (trace_ent, org, 1); + dam = dam + random()*dam; + + if (weap == IID_WP_MP9) + J_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_MP7) + T_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_MP9_S) + J_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_MP7_S) + T_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); self.critical = 0; - if (trace_ent.solid == SOLID_BSP) + if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") penetrate (org, (dam / 2), (dam / 2)); } else @@ -2203,14 +3090,259 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG = } }; -void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle = +void (float rec, float speed, float dam, float type) FirePulseRifle = { - local float weap, hs, tmp, zdif, is_headshot, z; - local vector dir, source, targ, org, adjust, headshot_check; + local float dam, weap, tmp, zdif, xdif, ydif, is_headshot; + local vector dir, source, targ, org, org2, adjust; + local entity zap; weap = ToIID(self.(SlotField(self.current_slot))); - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); + if (weap != IID_WP_ALIENBLASTER) + { + if (self.recoil >= 15) + { + loud_noise(60); + sound (self, CHAN_WEAPON, "weapons/blowoff-1.wav", 1, ATTN_NORM); + self.attack_finished = (time + (1 + random()*1.5)); + return; + } + else if (weap != IID_WP_LASERGATLING) + { + loud_noise(60); + sound (self, CHAN_AUTO, "weapons/blowoff-2.wav", 0.5, ATTN_IDLE); + } + } + + + if (weap == IID_WP_ALIENBLASTER) + stuffcmd (self, "-attack\n"); + + if (weap != IID_WP_LASERGATLING) + { + loud_noise(20); + + if (random()<0.5) + sound (self, CHAN_WEAPON, "weapons/plasma-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "weapons/plasma-2.wav", 1, ATTN_NORM); + } + else if (weap == IID_WP_LASERGATLING && self.attack == 1) + { + loud_noise(40); + sound (self, CHAN_WEAPON, "weapons/laserburst1.wav", 1, ATTN_NORM); + } + + if (self.attack >= 6) + self.attack = 0; + + self.attack_finished = time + (speed*0.5) + (random()*speed*0.5); + + +//only silenced weapons do not break stealth + if (self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + } + + if (self.position == 0) + autofire (); + if (self.position >= 1) + autofire_s (); + + if (self.position == 0) + adjust = '0 0 -4'; + if (self.position == 1) + adjust = '0 0 -20'; + if (self.position == 2) + adjust = '0 0 -36'; + + + DropAmmo (); + makevectors (self.v_angle); + + if (self.recoil >= 20) + self.recoil = 20; + + tmp = 50; + + if (self.velocity != '0 0 0') + tmp = 100; + + tmp = tmp + (5*self.recoil); + + if (self.recoil <= 1 && self.velocity_z == 0) + tmp = (tmp * 0.5); + + self.attack = self.attack + 1; + self.recoil = self.recoil + rec; + + + source = self.origin + '0 0 22' + v_right*6 + v_forward*14; + source = source + adjust; + + tmp = tmp * 0.60; + + if (self.position == 2) + tmp = tmp * 0.60; + + targ = source + v_right*crandom()* tmp + v_up*crandom()*(tmp*2); + + traceline (source, targ+adjust+v_forward*2000, FALSE, self); + if (trace_fraction == 1) + return; + + org = trace_endpos - v_forward * 2; + org2 = trace_endpos + (v_forward * ((trace_ent.size_y / 2) + (trace_ent.size_x / 2))); + + zap = spawn(); + zap.origin = self.origin + v_right*16 + adjust; + zap.velocity = self.velocity; + zap.angles = self.angles; + zap.v_angle = self.v_angle; + + if (type == 1) + { + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNING1); + WriteEntity (MSG_MULTICAST, zap); + WriteCoord (MSG_MULTICAST, source_x); + WriteCoord (MSG_MULTICAST, source_y); + WriteCoord (MSG_MULTICAST, source_z); + WriteCoord (MSG_MULTICAST, trace_endpos_x); + WriteCoord (MSG_MULTICAST, trace_endpos_y); + WriteCoord (MSG_MULTICAST, trace_endpos_z); + multicast (org, MULTICAST_PHS); + } + if (type == 2) + { + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNING2); + WriteEntity (MSG_MULTICAST, zap); + WriteCoord (MSG_MULTICAST, source_x); + WriteCoord (MSG_MULTICAST, source_y); + WriteCoord (MSG_MULTICAST, source_z); + WriteCoord (MSG_MULTICAST, trace_endpos_x); + WriteCoord (MSG_MULTICAST, trace_endpos_y); + WriteCoord (MSG_MULTICAST, trace_endpos_z); + multicast (org, MULTICAST_PHS); + } + if (type == 3) + { + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNING3); + WriteEntity (MSG_MULTICAST, zap); + WriteCoord (MSG_MULTICAST, source_x); + WriteCoord (MSG_MULTICAST, source_y); + WriteCoord (MSG_MULTICAST, source_z); + WriteCoord (MSG_MULTICAST, trace_endpos_x); + WriteCoord (MSG_MULTICAST, trace_endpos_y); + WriteCoord (MSG_MULTICAST, trace_endpos_z); + multicast (org, MULTICAST_PHS); + } + remove(zap); + + if (trace_ent.takedamage) + { + + dam = (dam * (1 - trace_fraction)); + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + SpawnBlood (org, 1); + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + else if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") + SpawnWood (trace_ent, org, 1); + + + dam = dam + random()*dam; + + T_Damage (trace_ent, self, self, dam); + self.critical = 0; + + if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") + penetrate (org, (dam / 2), (dam / 2)); + } +}; + +void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultRifle = +{ + local float weap, hs, tmp, zdif, is_headshot, z, y; + local vector dir, source, targ, org, adjust, headshot_check; + local float xrecoil; + + //xrecoil: 8 is average, 12 high, 6 low + + weap = ToIID(self.(SlotField(self.current_slot))); + + if (getperk(16))//power shot adds a small bonus to the first shot fired + { + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + dam = dam * 1.20; + } + } + + if (self.extender == weap && self.silencer != weap) + dam = dam * 1.10; + + if (self.silencer == weap) + { + sound (self, CHAN_WEAPON, "weapons/needler.wav", 1, ATTN_NORM); + loud_noise(20); + } + else + { + if (weap == IID_WP_MOONLIGHT) + { + if (random()<0.5) + sound (self, CHAN_WEAPON, "weapons/moonlight-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "weapons/moonlight-2.wav", 1, ATTN_NORM); + } + else if (weap == IID_WP_DKS1_S) + sound (self, CHAN_WEAPON, "ogre/ak74.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); + + if (weap == IID_WP_DKS1) + loud_noise(100); + else if (weap == IID_WP_MOONLIGHT) + loud_noise(5); + else if (weap == IID_WP_DKS1_S) + loud_noise(15); + else if (weap == IID_WP_PIPERIFLE_S) + loud_noise(5); + else if (weap == IID_WP_PIPERIFLE_S_R) + loud_noise(5); + else if (weap == IID_WP_PIPERIFLE_SCOPE_S) + loud_noise(5); + else if (weap == IID_WP_PIPERIFLE_SCOPE_S_R) + loud_noise(5); + else + loud_noise(80); + + if (weap == IID_WP_DKS1) + stuffcmd(self, "v_idlescale 10\n"); + else if (weap == IID_WP_FNFAL) + stuffcmd(self, "v_idlescale 10\n"); + else if (weap == IID_WP_DKS1_S) + stuffcmd(self, "v_idlescale 10\n"); + + //only silenced weapons do not break stealth + if (weap != IID_WP_MOONLIGHT && weap != IID_WP_DKS1_S && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + } + } self.attack_finished = (time + rate); @@ -2223,8 +3355,8 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle DropAmmo (); makevectors (self.v_angle); - if (self.recoil >= 15) - self.recoil = 15; + if (self.recoil >= 10) + self.recoil = 10; if (self.attack == 0) { @@ -2245,6 +3377,204 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle player_single1 (); } + tmp = accuracy * 10; + xrecoil = dam / 2; + + //for the snipers + if (self.position == 2 && self.recoil == 0) + tmp = tmp * 0.75; + + if (self.steadyaim == 0) + tmp = tmp * 0.25; + + self.attack = self.attack + 1; + self.recoil = self.recoil + xrecoil; + + if (self.zoom > 0 && weap == IID_WP_G11 && self.attack == 3) + { + self.recoil = self.recoil + 10; + self.attack_finished = time + 1; + } + + if (tmp > 500) + tmp = 500; + + source = self.origin + '0 0 22'; + + targ = self.origin + '0 0 22' + v_right*self.driftx + v_up*self.drifty + v_right*crandom()* tmp + v_up*random()*tmp + v_up*random()*tmp; + + y = xrecoil * 12; + + if (self.attack == 0) + y = y * 0.90; + if (self.velocity == '0 0 0') + y = y * 0.90; + if (self.position == 2) + y = y * 0.80; + if (self.position == 1) + y = y * 0.90; + + if (random()*3<=2) + self.driftx = self.driftx + y; + else + self.driftx = self.driftx - y; + + if (random()*2<=1) + self.drifty = self.drifty + y; + else + self.drifty = self.drifty - y; + + traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); + if (trace_fraction == 1) + return; + + org = trace_endpos - v_forward * 2; + headshot_check = trace_endpos + v_forward * (trace_ent.size_x / 2); + + if (weap == IID_WP_PIPERIFLE) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_RANGEMASTER) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_DKS1) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_FNFAL && self.zoom == 1) + stuffcmd (self, "-attack\n"); + if (self.zoom > 0 && weap != IID_WP_G11 && weap != IID_WP_MOONLIGHT) + stuffcmd (self, "-attack\n"); + if (self.zoom > 0 && weap == IID_WP_G11 && self.attack >= 3 && weap != IID_WP_MOONLIGHT) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_GAUSERIFLE) + stuffcmd (self, "-attack\n"); + + if (trace_ent.takedamage) + { + + + if (self.attack <= 3) + { + is_headshot = 0; + hs = headshot_check_x - trace_ent.origin_x; + hs = hs + headshot_check_y - trace_ent.origin_y; + + if (hs < 0) + hs = hs * -1; + + if (hs <= 8) + is_headshot = 1; + + zdif = trace_endpos_z - trace_ent.origin_z; + + if (is_headshot == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) + self.critical = 3; + } + + + dam = (dam * (1 - trace_fraction)); + + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + SpawnBlood (org, 1); + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + else if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") + SpawnWood (trace_ent, org, 1); + + dam = dam + random()*dam; + + if (weap == IID_WP_DKS1 || weap == IID_WP_FNFAL || weap == IID_WP_ACR) + X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_AK112) + J_Damage (trace_ent, self, self, dam); + else + T_Damage (trace_ent, self, self, dam); + + loud_noise(5);//hit flesh + + //victim survived the ambush + if (random()*10 < 7.5 && trace_ent.health > 0 && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); + } + + + self.critical = 0; + + if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") + penetrate (org, (dam / 2), (dam / 2)); + } + else + { + loud_noise(15); + bullet_hole (org); + dir = vectoangles (source - targ); + penetrate (org, (dam / 2), (dam / 2)); + return; + } +}; + + + +void (float dam, float xrecoil, string snd, float rng, float rate) FireMinigun = +{ + local float weap, hs, tmp, zdif, is_headshot, z; + local vector dir, source, targ, org, adjust, headshot_check; + + //xrecoil: 40 is average, 60 high, 30 low + + weap = ToIID(self.(SlotField(self.current_slot))); + + if (self.attack <= 3) + { + self.weaponframe = self.attack; + self.attack_finished = time + 0.10; + self.attack = self.attack + 1; + return; + } + + if (self.attack == 4) + self.weaponframe = 5; + if (self.attack == 5) + self.weaponframe = 6; + if (self.attack == 6) + self.weaponframe = 7; + if (self.attack == 7) + self.weaponframe = 8; + if (self.attack == 8) + { + self.attack = 4; + self.weaponframe = 9; + } + + if (getperk(16))//power shot adds a small bonus to the first shot fired + { + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + dam = dam * 1.20; + } + } + + loud_noise(50); + + sound (self, CHAN_WEAPON, "weapons/ak112.wav", 0.8, ATTN_NORM); + + self.attack_finished = (time + rate); + + if (self.position == 0) + adjust = '0 0 0'; + if (self.position == 1) + adjust = '0 0 -16'; + if (self.position == 2) + adjust = '0 0 -32'; + + DropAmmo (); + makevectors (self.v_angle); + if (self.recoil >= 15) + self.recoil = 15; + tmp = 50; if (self.velocity_y < 0) @@ -2258,7 +3588,7 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle z = z + (self.velocity_x); tmp = tmp + z; - tmp = tmp + (40 * self.recoil); + tmp = tmp + (xrecoil * self.recoil); if (self.attack <= 3 && self.position == 1 && self.velocity_z == 0) tmp = (tmp * 0.75); @@ -2271,7 +3601,7 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle source = self.origin + '0 0 22'; - targ = self.origin + '0 0 22' + v_right*crandom()* tmp + v_up*crandom()*tmp; + targ = self.origin + '0 0 22' + v_right*crandom()* tmp + v_up*random()*tmp; traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); if (trace_fraction == 1) @@ -2280,6 +3610,21 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle org = trace_endpos - v_forward * 2; headshot_check = trace_endpos + v_forward * (trace_ent.size_x / 2); + if (weap == IID_WP_PIPERIFLE) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_RANGEMASTER) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_DKS1) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_FNFAL && self.zoom == 1) + stuffcmd (self, "-attack\n"); + if (self.zoom > 0 && weap != IID_WP_G11 && weap != IID_WP_MOONLIGHT) + stuffcmd (self, "-attack\n"); + if (self.zoom > 0 && weap == IID_WP_G11 && self.attack >= 3 && weap != IID_WP_MOONLIGHT) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_GAUSERIFLE) + stuffcmd (self, "-attack\n"); + if (trace_ent.takedamage) { @@ -2302,25 +3647,50 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle dam = (dam * (1 - trace_fraction)); - if (trace_ent.solid != SOLID_BSP && self.critical == 3) - SpawnBlood (org, 1); - if (trace_ent.solid == SOLID_BSP) + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + SpawnBlood (org, 1); + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + else if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") SpawnWood (trace_ent, org, 1); dam = dam + random()*dam; - if (weap != IID_WP_DKS1 && weap != IID_WP_FNFAL) - T_Damage (trace_ent, self, self, dam); - else if (weap == IID_WP_DKS1 || weap == IID_WP_FNFAL) + if (weap == IID_WP_DKS1) X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_FNFAL) + X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_DKS1_S) + X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_AK112) + X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_AK112_M) + X_Damage (trace_ent, self, self, dam); + else + T_Damage (trace_ent, self, self, dam); + + loud_noise(5);//hit flesh + + //victim survived the ambush + if (random()*10 < 7.5 && trace_ent.health > 0 && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); + } + + self.critical = 0; - if (trace_ent.solid == SOLID_BSP) + if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") penetrate (org, (dam / 2), (dam / 2)); } else { + loud_noise(15); bullet_hole (org); dir = vectoangles (source - targ); penetrate (org, (dam / 2), (dam / 2)); @@ -2329,84 +3699,22 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle }; -void () Screenshake = -{ - local entity te; - - te = findradius (self.origin, 700); - while (te) - { - if (((te.classname == "player") && (te.ghost == 0))) - { - stuffcmd (te, "v_iyaw_level 2\n"); - stuffcmd (te, "v_iyaw_cycle 32\n"); - stuffcmd (te, "v_ipitch_level 2\n"); - stuffcmd (te, "v_ipitch_cycle 32\n"); - stuffcmd (te, "v_iroll_level 2\n"); - stuffcmd (te, "v_iroll_cycle 32\n"); - stuffcmd (te, "v_idlescale 1\n"); - } - te = te.chain; - } -}; - -void () ScreenshakeSingle = -{ - stuffcmd (self, "v_iyaw_level 2\n"); - stuffcmd (self, "v_iyaw_cycle 32\n"); - stuffcmd (self, "v_ipitch_level 2\n"); - stuffcmd (self, "v_ipitch_cycle 32\n"); - stuffcmd (self, "v_iroll_level 2\n"); - stuffcmd (self, "v_iroll_cycle 32\n"); - stuffcmd (self, "v_idlescale 1\n"); -}; - -void () ExplosionFrames = -{ - self.avelocity = '300 300 250'; - self.nextthink = (time + 0.02); - self.frame = (self.frame + 1); - if (self.frame == 16) - remove (self); -}; - -void (float input) Explosion = -{ - local float r; - - self.effects = EF_DIMLIGHT; - self.touch = SUB_Null; - setmodel (self, "progs/blast.mdl"); - r = random (); - if ((r < 0.3)) - sound (self, CHAN_BODY, "misc/exp1.wav", 1, ATTN_NORM); - if ((r < 0.65)) - sound (self, CHAN_BODY, "misc/exp2.wav", 1, ATTN_NORM); - else - sound (self, CHAN_BODY, "misc/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); - Screenshake (); - self.frame = AS_MELEE; - self.velocity = VEC_ORIGIN; - self.avelocity = '300 300 250'; - self.think = ExplosionFrames; - self.nextthink = (time + 0.02); -}; - - void () WeaponTouch = { - local float slotnum; + local float slotnum, x; if (other.classname != "player") return; - if (other.ghost != 0) return; + if (other.accept == 0) + return; + + other.accept = 0; + + x = (ToIID(self.islot1)); + + if (IsJunk(x) && other.class != 4) + return; if (ItemInSlot(other, other.current_slot) == 0 && FitsInSlot(other.current_slot, ToIID(self.islot1))) slotnum = other.current_slot; @@ -2429,6 +3737,82 @@ void () WeaponTouch = W_SetCurrentAmmo (); }; +void () AmmoTouch = +{ + local float slotnum,x,y,z; + + if (other.classname != "player") + return; + + if (other.ghost != 0) + return; + + x = ToIID(other.islot1); + y = ToIID(other.islot2); + z = ToIID(self.islot1); + + x = WeaponAmmoType(x); + y = WeaponAmmoType(y); + + + if ((x != z) && (y != z) && (other.accept == 0)) + return; + + other.accept = 0; + + if (!TryGiveStackable(other, ToIID(self.islot1), self.flash)) + { + sprint(other, PRINT_MEDIUM, "inventory full.\n"); + return; + } + + sound (other, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + + sprint(other, PRINT_MEDIUM, "found "); + sprint(other, PRINT_MEDIUM, GetItemName(ToIID(self.islot1))); + sprint(other, PRINT_MEDIUM, ".\n"); + + remove (self); + + self = other; + if (self.current_slot == slotnum) + W_SetCurrentAmmo (); +}; + +void () MultiTouch = +{ + local float slotnum,x,y,z; + + if (other.classname != "player") + return; + + if (other.ghost != 0) + return; + + if (other.accept == 0) + return; + + other.accept = 0; + + if (!TryGiveStackable(other, ToIID(self.islot1), self.flash)) + { + sprint(other, PRINT_MEDIUM, "inventory full.\n"); + return; + } + + sound (other, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + + sprint(other, PRINT_MEDIUM, "found "); + sprint(other, PRINT_MEDIUM, GetItemName(ToIID(self.islot1))); + sprint(other, PRINT_MEDIUM, ".\n"); + + remove (self); + + self = other; + if (self.current_slot == slotnum) + W_SetCurrentAmmo (); +}; + void (float slotnum, float snd, float force) DropFromSlot = { local float weap; @@ -2472,10 +3856,28 @@ void (float slotnum, float snd, float force) DropFromSlot = newmis.origin_z = self.origin_z; newmis.nextthink = (time + 180); newmis.think = SUB_Remove; - newmis.touch = WeaponTouch; - newmis.islot1 = weap; + if (ToIID(weap) >= IID_AM_NEEDLER && ToIID(weap) <= IID_AM_WARSAW) + { + newmis.flash = ToStatus(ItemInSlot(self, slotnum)); + newmis.touch = AmmoTouch; + newmis.skin = 1; + } + else if (ToIID(weap) >= IID_MISC_JUNK && ToIID(weap) <= IID_MISC_XRAYTUBE) + { + newmis.flash = ToStatus(ItemInSlot(self, slotnum)); + newmis.touch = MultiTouch; + } + else if (ToIID(weap) >= IID_CHEM_STIMPACK && ToIID(weap) <= IID_CHEM_RADX) + { + newmis.flash = ToStatus(ItemInSlot(self, slotnum)); + newmis.touch = MultiTouch; + } + else + newmis.touch = WeaponTouch; + + SetItemSlot(self, slotnum, 0); if (self.attack_finished < time+0.6) @@ -2489,6 +3891,65 @@ void (float slotnum, float snd, float force) DropFromSlot = }; +void (entity chest, float iid, float num) DropFromChest = +{ + local float weap; + local string mdel; + + makevectors (self.v_angle); + newmis = spawn (); + newmis.owner = self; + newmis.classname = "dropped_weapon"; + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_TRIGGER; + newmis.flags = FL_ITEM; //item makes it bigger to player touches. + newmis.velocity = aim (self, 500); + newmis.velocity = (newmis.velocity * 500); + newmis.angles_y = (random () * 360); + newmis.angles_x = (random () * 360); + newmis.velocity_x = (random () * 360); + newmis.velocity_x = (random () * 360); + + + mdel = GetItemWModel(iid); + + setmodel (newmis, mdel); + setsize (newmis, '-2 -2 0', '2 2 1'); + makevectors (self.v_angle); + setorigin (newmis, self.origin + '0 0 48'); + newmis.origin_z = self.origin_z; + newmis.nextthink = (time + 180); + newmis.think = SUB_Remove; + newmis.islot1 = iid*512; + + if (iid >= IID_AM_NEEDLER && iid <= IID_AM_WARSAW) + { + newmis.flash = num; + newmis.touch = AmmoTouch; + newmis.skin = ToIID(weap) - 506; + } + else if (iid >= IID_MISC_JUNK && iid <= IID_MISC_XRAYTUBE) + { + newmis.flash = num; + newmis.touch = MultiTouch; + } + else if (iid >= IID_CHEM_STIMPACK && iid <= IID_CHEM_RADX) + { + newmis.flash = num; + newmis.touch = MultiTouch; + } + else if (iid >= IID_ARM_SHIRT && iid <= IID_ARM_LPOWER) + { + newmis.flash = num; + newmis.touch = MultiTouch; + } + else + { + newmis.islot1 = (iid*512) + num; + newmis.touch = WeaponTouch; + } +}; + void (float slot) WeaponAmmo = { local float weap, amount; @@ -2499,73 +3960,6 @@ void (float slot) WeaponAmmo = GiveAmmo (slot, amount); }; -void() Crosshair = -{ - local float r; - local string new; - - r = 32 + (self.recoil*8); - if (r > 256) - r = 256; - if (r < 0) - r = 0; - - new = ftos(r); - stuffcmd(self, "crosshairsize "); - stuffcmd(self, new); - stuffcmd(self, "\n"); - r = 0.75 - (self.recoil*0.03); - if (r <= 0.25) - r = 0.25; - - new = ftos(r); - stuffcmd(self, "crosshairalpha "); - stuffcmd(self, new); - stuffcmd(self, "\n"); -}; - -float (entity healer, entity saved) RevivePlayer = -{ - local entity oself; - oself = self; - - self = saved; -/* if (!walkmove(0, 0)) - { - //too close? - return FALSE; - } -*/ - saved.deadflag = DEAD_NO; - saved.takedamage = DAMAGE_AIM; - saved.movetype = MOVETYPE_WALK; - saved.solid = SOLID_NOT; - - self = oself; - - saved.materialize = 200; - saved.ghost = 0; - saved.health = 2; - saved.air_finished = time + 10; - saved.view_ofs = '0 0 22'; - self = saved; - player_run(); - self = oself; - stuffcmd(saved, "impulse 1\n"); - if (healer.classname == "player") - { - sprint (healer, PRINT_HIGH, "you revive "); - sprint (healer, PRINT_HIGH, trace_ent.netname); - sprint (healer, PRINT_HIGH, ".\n "); - } - sprint (saved, PRINT_HIGH, healer.netname); - sprint (saved, PRINT_HIGH, " saves you from death.\n"); - saved.view2 = world; - - saved.flags (-) FL_FINDABLE_NONSOLID; - - return TRUE; -}; float(float iid) UseBoostingChem = { @@ -2578,17 +3972,23 @@ float(float iid) UseBoostingChem = x = GetItemName (iid); if (iid == IID_CHEM_ADRENALINE) - duration = 30+random()*30; + duration = 30; else if (iid == IID_CHEM_PSYCHO) - duration = 30+random()*30; + duration = 30; else if (iid == IID_CHEM_BESERK) - duration = 30+random()*30; + duration = 60; + else if (iid == IID_CHEM_RADX) + duration = 120; else { sprint (self, PRINT_HIGH, "Not a boosting chem\n"); return false; } + //chem addict: any self-used chem functions better + if (getperk(15)) + duration = duration * 2; + self.attack_finished = time + 1; makevectors (self.v_angle); @@ -2609,14 +4009,22 @@ float(float iid) UseBoostingChem = sprint (trace_ent, PRINT_HIGH, " used a "); sprint (trace_ent, PRINT_HIGH, x); sprint (trace_ent, PRINT_HIGH, " on you.\n"); - sound (trace_ent, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); + if (iid != IID_CHEM_RADX) + sound (trace_ent, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); + if (iid == IID_CHEM_RADX) + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + stuffcmd(trace_ent, "v_cshift 200 0 0 200\n"); trace_ent.rage = iid; trace_ent.ragetime = duration; return true; } if (self.health < self.max_health && self.rage == 0) { - sound (self, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); + stuffcmd(self, "v_cshift 200 0 0 200\n"); + if (iid != IID_CHEM_RADX) + sound (self, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); + if (iid == IID_CHEM_RADX) + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); self.rage = iid; self.ragetime = duration; return true; @@ -2637,14 +4045,14 @@ float(float iid) UseHealingChem = x = GetItemName (iid); if (iid == IID_CHEM_STIMPACK) - heal = 2*5; + heal = 10; else if (iid == IID_CHEM_MEDICALBAG) { - heal = 3*5; - x = "bandage"; + heal = 5; + x = "medkit"; } else if (iid == IID_CHEM_SUPERSTIM) - heal = 4*5; + heal = 50; else { sprint (self, PRINT_HIGH, "Not a healing chem\n"); @@ -2653,11 +4061,12 @@ float(float iid) UseHealingChem = self.attack_finished = time + 1; + self.rtime = time + 0.9; makevectors (self.v_angle); source = self.origin + '0 0 0'; - traceline (source, source + v_forward*64, 32, self); - if (trace_ent.classname == "player" && trace_ent.team == self.team) + traceline (source, source + v_forward*64, FALSE, self); + if (trace_ent.classname == "player") { if (coop) friendly = true; //all players are friendly in coop @@ -2670,7 +4079,7 @@ float(float iid) UseHealingChem = if (!friendly) return false; - if (trace_ent.regen >= 1) + if (trace_ent.regen >= 1 && trace_ent.health > 0) { sprint (self, PRINT_HIGH, trace_ent.netname); sprint (self, PRINT_HIGH, " is already healing.\n"); @@ -2682,6 +4091,21 @@ float(float iid) UseHealingChem = sprint(self, PRINT_HIGH, " isn't injured.\n"); return false; } + + if (self.perk1 == 13 || self.perk2 == 13) + { + sprint(self, 2, "MEDICINE MAN\n"); + heal = heal * 1.25; + } + if (self.perk1 == 17 || self.perk2 == 17) + { + if (random()<0.05) + { + sprint(self, 2, "ONE IN A MILLION\n"); + heal = heal * 5; + } + } + sprint (trace_ent, PRINT_HIGH, self.netname); sprint (trace_ent, PRINT_HIGH, " used a "); sprint (trace_ent, PRINT_HIGH, x); @@ -2693,25 +4117,376 @@ float(float iid) UseHealingChem = sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); return true; } - if (self.health < self.max_health && self.regen == 0) + else if (self.health < self.max_health && self.regen == 0) { + sprint (self, PRINT_HIGH, "you heal yourself with a "); + sprint (self, PRINT_HIGH, x); + sprint (self, PRINT_HIGH, ".\n"); + + if (self.perk1 == 13 || self.perk2 == 13) + { + sprint(self, 2, "MEDICINE MAN\n"); + heal = heal * 1.25; + } + if (self.perk1 == 17 || self.perk2 == 17) + { + if (random()<0.05) + { + sprint(self, 2, "ONE IN A MILLION\n"); + heal = heal * 5; + } + } + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); self.health = self.health + heal; self.regen = heal; return true; } + return false; }; +float(entity x, float slotno) DecreaseDestroySlotOther; + +void () UseStimpack = +{ + local float x; + local vector source; + local entity thing; + + + if (self.attack_finished > time) + return; + + self.attack_finished = time + 1; + self.rtime = time + 1; + + makevectors (self.v_angle); + source = self.origin + '0 0 16'; + traceline (source, source + v_forward*64, FALSE, self); + + if (trace_fraction == 1.0)//nobody in front of user, so heal self + { + x = SlotOfItem(self, IID_CHEM_STIMPACK); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you don't have a stimpack\n"); + return; + } + + if (self.regen > 0) + sprint(self, PRINT_MEDIUM, "you are already affected by a stimpack\n"); + else if (self.health >= self.max_health) + sprint(self, PRINT_MEDIUM, "you are not injured.\n"); + else if (self.health < self.max_health) + { + DecreaseDestroySlot(x);//take away a stimpack + + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + sprint(self, PRINT_MEDIUM, "you heal yourself with a stimpack\n"); + + thing = findradius(self.origin, 400); + while (thing) + { + if (thing.classname == "player" && thing.health < self.health) + self.score = self.score - 50; + + thing = thing.chain; + } + + self.health = self.health + 10; + self.regen = self.regen + 10; + } + } + else if (trace_ent.classname == "player")//healing another team-mate + { + if (trace_ent.regen >= 1 && trace_ent.health > 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is already healing from a stimpack.\n"); + } + else if (trace_ent.health >= trace_ent.max_health) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is not injured.\n"); + } + else if (trace_ent.health < trace_ent.max_health) + { + x = SlotOfItem(self, IID_CHEM_STIMPACK); + if (x > 0) + DecreaseDestroySlot(x);//take away a stimpack + else if (x == 0) + { + sprint(self, PRINT_MEDIUM, "no stims! searching "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, "'s body...\n"); + + x = SlotOfItem(trace_ent, IID_CHEM_STIMPACK); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had no stims!\n"); + return; + } + else + { + self.score = self.score + 50; + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had a stim. using it to heal.\n"); + DecreaseDestroySlotOther(trace_ent, x);//take away a stimpack + } + } + + if (trace_ent.deadflag) + { + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + RevivePlayer(self, trace_ent); + } + else + { + sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + self.score = self.score + 50; + sprint(trace_ent, PRINT_MEDIUM, self.netname); + sprint(trace_ent, PRINT_MEDIUM, " heals you with a stimpack\n"); + sprint(self, PRINT_MEDIUM, "you heal "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " with a stimpack\n"); + + trace_ent.health = trace_ent.health + 10; + trace_ent.regen = trace_ent.regen + 10; + } + } + } +}; + +void () UseSuperStim = +{ + local float x; + local vector source; + + + if (self.attack_finished > time) + return; + + self.attack_finished = time + 1; + self.rtime = time + 1; + + makevectors (self.v_angle); + source = self.origin + '0 0 16'; + traceline (source, source + v_forward*64, FALSE, self); + + if (trace_fraction == 1.0)//nobody in front of user, so heal self + { + x = SlotOfItem(self, IID_CHEM_SUPERSTIM); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you don't have a superstim\n"); + return; + } + + if (self.regen > 0) + sprint(self, PRINT_MEDIUM, "you are already affected by a healing chem\n"); + else if (self.health >= self.max_health) + sprint(self, PRINT_MEDIUM, "you are not injured.\n"); + else if (self.health < self.max_health) + { + local entity thing; + thing = findradius(self.origin, 400); + while (thing) + { + if (thing.classname == "player" && (thing.health+20) < self.health) + self.score = self.score - 50; + + thing = thing.chain; + } + + DecreaseDestroySlot(x);//take away a stimpack + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + sprint(self, PRINT_MEDIUM, "you heal yourself with a superstim\n"); + self.xregen = 100; + } + } + else if (trace_ent.classname == "player")//healing another team-mate + { + if (trace_ent.regen >= 1 && trace_ent.health > 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is already healing from a healing chem.\n"); + } + else if (trace_ent.health >= trace_ent.max_health) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is not injured.\n"); + } + else if (trace_ent.health < trace_ent.max_health) + { + x = SlotOfItem(self, IID_CHEM_STIMPACK); + if (x > 0) + DecreaseDestroySlot(x);//take away a stimpack + else if (x == 0) + { + sprint(self, PRINT_MEDIUM, "no stims! searching "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, "'s body...\n"); + + x = SlotOfItem(trace_ent, IID_CHEM_SUPERSTIM); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had no stims!\n"); + return; + } + else + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had a superstim. using it to heal.\n"); + DecreaseDestroySlotOther(trace_ent, x);//take away a stimpack + } + } + + if (trace_ent.deadflag) + { + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + RevivePlayer(self, trace_ent); + } + else + { + sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + + self.score = self.score + 50; + sprint(trace_ent, PRINT_MEDIUM, self.netname); + sprint(trace_ent, PRINT_MEDIUM, " heals you with a superstim!\n"); + sprint(self, PRINT_MEDIUM, "you heal "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " with a superstim\n"); + + trace_ent.xregen = 100; + } + } + } +}; + +void () UseMedicalBag = +{ + local float x; + local vector source; + + + if (self.attack_finished > time) + return; + + self.attack_finished = time + 1; + self.rtime = time + 1; + + makevectors (self.v_angle); + source = self.origin + '0 0 16'; + traceline (source, source + v_forward*64, FALSE, self); + + if (trace_fraction == 1.0)//nobody in front of user, so heal self + { + x = SlotOfItem(self, IID_CHEM_MEDICALBAG); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you don't have a medkit\n"); + return; + } + + if (self.regen > 0) + sprint(self, PRINT_MEDIUM, "you are already affected by a healing chem\n"); + else if (self.health >= self.max_health) + sprint(self, PRINT_MEDIUM, "you are not injured.\n"); + else if (self.health < self.max_health) + { + DecreaseDestroySlot(x);//take away a medkit + + local entity thing; + thing = findradius(self.origin, 400); + while (thing) + { + if (thing.classname == "player" && (thing.health+20) < self.health) + self.score = self.score - 50; + + thing = thing.chain; + } + + sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + sprint(self, PRINT_MEDIUM, "you heal yourself with your medkit\n"); + self.health = self.health + 5; + self.regen = self.regen + 5; + } + } + else if (trace_ent.classname == "player")//healing another team-mate + { + if (trace_ent.regen >= 1 && trace_ent.health > 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is already healing from a healing chem.\n"); + } + else if (trace_ent.health >= trace_ent.max_health) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is not injured.\n"); + } + else if (trace_ent.health < trace_ent.max_health) + { + x = SlotOfItem(self, IID_CHEM_MEDICALBAG); + if (x > 0) + DecreaseDestroySlot(x);//take away a medkit + else if (x == 0) + { + sprint(self, PRINT_MEDIUM, "no stims! searching "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, "'s body...\n"); + + x = SlotOfItem(trace_ent, IID_CHEM_MEDICALBAG); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had no medkit!\n"); + return; + } + else + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had a medkit. using it to heal.\n"); + DecreaseDestroySlotOther(trace_ent, x);//take away a medkit + } + } + + if (trace_ent.deadflag) + { + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + RevivePlayer(self, trace_ent); + } + else + { + sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + self.score = self.score + 10; + sprint(trace_ent, PRINT_MEDIUM, self.netname); + sprint(trace_ent, PRINT_MEDIUM, " heals you with a stimpack\n"); + sprint(self, PRINT_MEDIUM, "you heal "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " with a stimpack\n"); + + trace_ent.health = trace_ent.health + 10; + trace_ent.regen = trace_ent.regen + 10; + } + } + } +}; + void () DisplayMenu = { local string menu; + local entity ze; + local float gotm, gotc, gots, gote; if (self.currentmenu == "none") return; if (self.currentmenu == "shop_list") { + self.missionbrief = 4; menu = ShopString (); centerprint (self, menu); } @@ -2720,19 +4495,38 @@ void () DisplayMenu = menu = TraitString (); centerprint (self, menu); } - if (self.currentmenu == "shop_perks") + if (self.currentmenu == "select_mission") + { + menu = MissionString (); + centerprint (self, menu); + } + if (self.currentmenu == "confirm_depart") + { + menu = DepartString (); + centerprint (self, menu); + } + if (self.currentmenu == "shop_perk1") { menu = PerkString (); centerprint (self, menu); } + if (self.currentmenu == "shop_perk2") + { + menu = PerkString (); + centerprint (self, menu); + } + if (self.currentmenu == "shop_armor") { menu = ArmorString (); centerprint (self, menu); } - if (self.currentmenu == "shop_protect") + if (self.currentmenu == "shop_ammo") { - menu = ProtectString (); + if (world.map_obj != 4) + menu = AmmoString (); + else + menu = AmmoString2 (); centerprint (self, menu); } if (self.currentmenu == "shop_melee") @@ -2780,19 +4574,53 @@ void () DisplayMenu = menu = EquipmentString (); centerprint (self, menu); } + if (self.currentmenu == "menu_lockpick") + { + menu = LockpickString (); + centerprint (self, menu); + } + if (self.currentmenu == "menu_defuse") + { + menu = DefuseString (); + centerprint (self, menu); + } + if (self.currentmenu == "display_enter_screen") + { + menu = EnterString (); + centerprint (self, menu); + } + if (self.currentmenu == "display_wait_screen") + { + menu = WaitString (); + centerprint (self, menu); + } if (self.currentmenu == "shop_weapons") { menu = WeaponString (); centerprint (self, menu); } - if (((self.currentmenu == "select_skill") && (self.team == 1))) + + if (self.currentmenu == "select_skill") { - centerprint (self, "CHOOSE SKILL SET‘\n\n1‘ Medic \n2‘ Assassin \n3‘ Soldier \n4‘ Scientist\n"); - } - if (((self.currentmenu == "select_skill") && (self.team == 2))) - { - centerprint (self, "CHOOSE SKILL SET‘\n\n1‘ Medic \n2‘ Assassin \n3‘ Soldier \n4‘ Scientist\n"); + ze = find (world, classname, "player"); + + while (ze) + { + if (ze.class == 1) + gotm += 1; + if (ze.class == 2) + gots += 1; + if (ze.class == 3) + gotc += 1; + if (ze.class == 4) + gote += 1; + + ze = find(ze, classname, "player"); + } + + centerprint (self, "choose skill set‘\n\n1‘ first aid \n2‘ stealth \n3‘ combat \n4‘ science \n"); } + if ((self.currentmenu == "select_team")) { if (self.class == 0) @@ -2804,8 +4632,6 @@ void () DisplayMenu = } if (self.currentmenu == "confirm_team") { - sound (self, CHAN_BODY, "player/yourturn.wav", 1, ATTN_NORM); - if (self.team == 1) centerprint (self, "you will respawn as‘\n\nRanger - OK?\n1‘ Yes \n2‘ No \n"); if (self.team == 2) @@ -2813,16 +4639,14 @@ void () DisplayMenu = } if (self.currentmenu == "confirm_skill") { - sound (self, CHAN_BODY, "player/yourturn.wav", 1, ATTN_NORM); - - if (self.class == 1) - centerprint (self, "your class will be‘\n\nMedic - OK?\n1‘ Yes \n2‘ No \n"); - if (self.class == 2) - centerprint (self, "your class will be‘\n\nAssassin - OK?\n1‘ Yes \n2‘ No \n"); - if (self.class == 3) - centerprint (self, "your class will be‘\n\nSoldiier - OK?\n1‘ Yes \n2‘ No \n"); - if (self.class == 4) - centerprint (self, "your class will be‘\n\nScientist - OK?\n1‘ Yes \n2‘ No \n"); + if (self.tclass == 1) + centerprint (self, "your skill-set will be‘\n\nfirst aid - OK?\n1‘ Yes \n2‘ No \n\nprimary: first aid\nsecondary: buff allies\n"); + if (self.tclass == 2) + centerprint (self, "your skill-set will be‘\n\nstealth - OK?\n1‘ Yes \n2‘ No \n\nprimary: stealth\nsecondary: damage"); + if (self.tclass == 3) + centerprint (self, "your skill-set will be‘\n\ncombat - OK?\n1‘ Yes \n2‘ No \n\nprimary: survival\nsecondary: damage"); + if (self.tclass == 4) + centerprint (self, "your skill-set will be‘\n\nscience - OK?\n1‘ Yes \n2‘ No \n\nprimary: create\nsecondary: bypass"); } if (self.currentmenu == "menu_build") @@ -2835,38 +4659,114 @@ void () DisplayMenu = void () Special = { -#if 0 -<<<< <<< weapons.qc -/* -==== === if (self.class == 1) - Bandage (); ->>>> >>> 1.2 - if (self.class == 2) -<<< <<<< weapons.qc - Cmd_InvUse(GetItemName(IID_CHEM_MEDICALBAG)); - if (self.class == 3) - Cmd_InvUse("sneak-boy"); - if (self.class == 4) - Cmd_InvUse(GetItemName(IID_GREN_FRAG)); - if (self.class == 6) - Cmd_InvUse("shield"); -*/ - -===== == - Sneak (); - if (self.class == 4) - self.currentmenu = "menu_build"; ->>>> >>> 1.2 -#endif + UseMedicalBag(); + else + Sneak(); }; void () hos_run1; void () hos_stand1; float (float iid) spawn_station; +.float gravity; + + +void () pickup_body = +{ + local float x, z, forward_okay, down_okay, fp; + local vector dir, org; + local entity te; + + makevectors(self.enemy.v_angle); + traceline (self.enemy.origin, self.enemy.origin + v_forward*64, TRUE, self); + org = trace_endpos - v_forward*24; + + self.movetype = MOVETYPE_TOSS; + + if (self.enemy.pickup == 1) + { + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.gravity = 0; + dir = normalize(self.origin - (self.enemy.origin+'0 0 48')); + self.angles_y = dir; + self.velocity_z += 30; + self.goalentity = self.enemy; + self.velocity = dir * -100; + self.enemy.maxspeed = 100; + self.nextthink = time + 0.01; + return; + } + else if (self.enemy.pickup == 0) + { + self.velocity = '0 0 0'; + self.velocity_z = -250; + self.gravity = 800; + self.enemy = world; + return; + } +}; + +void () pickup_body2 = +{ + local float x, z; + local vector dir; + + x = vlen(self.origin - self.enemy.origin); + dir = normalize(self.origin - self.enemy.origin); + + self.movetype = MOVETYPE_STEP; + + z = self.origin_z - self.enemy.origin_z; + + if ((x >= 32 && x <= 96) && self.enemy.pickup == 1) + { + self.velocity = (dir * (-30)); + self.velocity_z = 1; + self.enemy.maxspeed = 50; + self.angles = dir; + self.nextthink = time + 0.01; + } + else if (x > 96 && self.enemy.pickup == 1) + { + self.velocity = '0 0 0'; + self.enemy.pickup = 0; + sprint(self.enemy, 2, "dropped body.\n"); + } +}; + +void () hos_face = +{ + local entity te; + + te = findradius (self.origin, 250); + while (te) + { + if (te.classname == "player") + { + self.enemy = te; + te.safezone = 1; + } + te = te.chain; + } + + self.angles_y = vectoyaw(self.enemy.origin - self.origin); + + self.nextthink = time + 0.1; + + if (vlen(self.origin - self.enemy.origin) > 250) + self.enemy = world; +}; + void () ExitScreen = { + local vector vec, dir; + local string ammoname, ammocountftos, rep; + local float best, ammotype, ammocount, dot; + local entity save; + + self.impulse = 0; + if (self.class == 0) return; @@ -2879,6 +4779,264 @@ void () ExitScreen = if (self.attack_finished > time) return; + self.accept = 1; + + if (self.currentmenu != "menu_none") + self.missionbrief = 0; + + makevectors (self.v_angle); + traceline (self.origin, self.origin + v_forward*128, FALSE, self); + + if (self.pickup == 1) + { + self.pickup = 0; + return; + } + if (trace_ent.classname == "body" && self.pickup == 0) + { + if ((self.perk1 == 12 || self.perk2 == 12) && (ToIID(self.islot3) != IID_ARM_DESERT)) + { + sprint(self, 2, "you loot the raider's desert armor\n"); + SetItemSlot(self, 3, SlotVal(IID_ARM_DESERT, 1)); + return; + } + + trace_ent.movetype = MOVETYPE_BOUNCE; + dir = normalize(trace_ent.origin - self.origin); + trace_ent.velocity = dir * 100; + trace_ent.velocity_z = 100; + trace_ent.avelocity_y = (random()* 30); + trace_ent.think = pickup_body; + trace_ent.enemy = self; + trace_ent.nextthink = time + 0.01; + self.pickup = 1; + sound (self, CHAN_BODY, "player/land.wav", 1, ATTN_IDLE); + sprint(self, 2, "grabbed body.\n"); + return; + } + else if (self.pickup == 1) + self.pickup = 0; + + if (trace_ent.classname == "bomb") + { + if (trace_ent.picking == 1) + { + sprint(self, 2, "already being defused.\n"); + return; + } + if (trace_ent.picking == 2) + { + sprint(self, 2, "that bomb is disarmed\n"); + return; + } + if (trace_ent.picking == 3) + { + sprint(self, 2, "circuits are jammed.\n"); + return; + } + + self.picking = 1; + trace_ent.picking = 1; + self.currentmenu = "menu_defuse"; + SpawnBomb(trace_ent, self); + return; + } + + if (trace_ent.classname == "brotherhood_guard") + { + + if (random()<0.25) + sound (self, CHAN_BODY, "enforcer/sight2.wav", 1, ATTN_NORM); + else if (random()<0.25) + sound (self, CHAN_BODY, "enforcer/sight2.wav", 1, ATTN_NORM); + else if (random()<0.25) + sound (self, CHAN_BODY, "enforcer/sight3.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "enforcer/sight4.wav", 1, ATTN_NORM); + + sprint(self, 2, "guard: back off, grunts ain't allowed in here.\n"); + return; + } + + if (trace_ent.classname == "brotherhood_doctor") + { + sprint(self, 2, "doctor: if you are hurt, lie down and rest\n"); + return; + } + + if (trace_ent.classname == "brotherhood_soldier") + { + if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "make sure you buy ammo before going out\n"); + sprint(self, 2, "into the wastes, you'll use alot of it!\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "have team mates whose skills cover up your\n"); + sprint(self, 2, "weaknesses. first-aid and science-oriented\n"); + sprint(self, 2, "team members are crucial to a team.\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "those skilled in science & repair can make \n"); + sprint(self, 2, "make useful objects out of junk. this helps\n"); + sprint(self, 2, "improve your squad as a whole.\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "jhp stands for jacketed hollow-point, which\n"); + sprint(self, 2, "means the ammo spreads for a great deal of \n"); + sprint(self, 2, "stopping power against unarmored foes.\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "ap stands for armor-piercing, which means the \n"); + sprint(self, 2, "rounds will tear through armor like paper. use\n"); + sprint(self, 2, "such rounds when fighting heavily-armored foes\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "you can improve your stealth level by being\n"); + sprint(self, 2, "quiet, hugging walls, ducking, silencers, &\n"); + sprint(self, 2, "wearing light armor. \n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "perks are useful abilities. make sure you have\n"); + sprint(self, 2, "perks that complement your skills and playing \n"); + sprint(self, 2, "style. some perks even go really well together\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "proper positioning of all squad members is key\n"); + sprint(self, 2, "to success in the battles you will face. make \n"); + sprint(self, 2, "sure to duck, prone and sneak when necessary \n"); + } + else + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "if you are trained in first aid, do not forget\n"); + sprint(self, 2, "about your chems. psycho can provide temporary\n"); + sprint(self, 2, "armor bonus, and adrenaline lets you run fast.\n"); + } + return; + } + + if (trace_ent.classname == "brotherhood_sergeant") + { + sprint(self, 2, "sergeant: ready for your next mission?\n"); + self.currentmenu = "select_mission"; + return; + } + if (trace_ent.classname == "func_tank") + { + sprint(self, 2, "get ready to gear up!\n"); + self.currentmenu = "confirm_depart"; + return; + } + if (trace_ent.classname == "treasure_chest") + { + if (trace_ent.picking == 1) + { + sprint(self, 2, "already being picked.\n"); + return; + } + if (trace_ent.picking == 2) + { + sprint(self, 2, "that chest is empty!\n"); + return; + } + if (trace_ent.picking == 3) + { + sprint(self, 2, "lock is jammed.\n"); + return; + } + if (self.class != 2 && self.class != 4) + { + sound (self, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); + sprint(self, 2, "locked!\n"); + return; + } + + self.attack_finished = time + 0.5; + self.rtime = time + 4; + self.picking = 1; + trace_ent.picking = 1; + self.currentmenu = "menu_lockpick"; + SpawnOpenChest(trace_ent, self); + return; + } + + if (trace_ent.classname == "rhostage" && trace_ent.health > 0 && trace_ent.rescued == 0) + { + if (self.team != 1) + return; + + if (self.currentmenu != "none") + return; + + bprint (2, "hostage has been located.\n"); + rescue = rescue + 1; + //remove(trace_ent); + spawn_excla(trace_ent, 3000); + trace_ent.rescued = 1; + trace_ent.think = hos_face; + trace_ent.nextthink = time + 1; + + return; + } + if (trace_ent.classname == "monster" && trace_ent.health > 0) + { + if (self.sneak == 0) + return; + + if (self.class != 2) + return; + + if (self.currentmenu != "none") + return; + + + if (random()*100 <= 75) + { + if (trace_ent.ammo_shells == 0) + { + sprint(self, 2, "nothing to steal!\n"); + return; + } + sprint (self, 2, "success! stole "); + + ammotype = GetRandomAmmo(); + ammocount = GetAmmoCount(ammotype); + ammocount = ceil(ammocount); + ammoname = GetItemName(ammotype); + ammocountftos = ftos(ammocount); + sprint (self, 2, ammoname); + sprint (self, 2, "("); + sprint (self, 2, ammocountftos); + sprint (self, 2, ") "); + TryGiveStackable(self, ammotype, ammocount); + + sound (self, CHAN_WEAPON, "weapons/ax1", 1, ATTN_NORM); + trace_ent.ammo_shells = 0; + return; + } + else + { + sound (self, CHAN_WEAPON, "weapons/ax1", 1, ATTN_NORM); + sprint (self, 2, "pilfer failed...\n"); + return; + } + } if (trace_ent.classname == "hostage" && trace_ent.health > 0 && trace_fraction < 1) { if (self.team != 1) @@ -2918,6 +5076,35 @@ void () ExitScreen = } }; +void () disappear = +{ + local entity te; + local float nearby; + //this allows an assassin to vanish, making monsters aggro + //those who are visible + + te = findradius(self.origin, 500); + while (te) + { + if (te.classname == "player" && te.sneak == 0 && te != self) + nearby = 1; + + te = te.chain; + } + + if (nearby == 1) + { + te = findradius(self.origin, 1000); + while (te) + { + if (te.enemy == self) + te.enemy = world; + + te = te.chain; + } + } +}; + void () Sneak = { local float w; @@ -2932,33 +5119,14 @@ void () Sneak = self.sneak = 0; return; } - if (self.ammo_cells < 20) - { - sprint (self, PRINT_HIGH, "wait for stealth-boy to recharge.\n"); - return; - } - if (self.sneak == 0 && self.class == 2) + if (self.sneak == 0) { + disappear(); sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); - centerprint (self, " cloaked and sneaking \n(1% detection chance)"); + centerprint (self, " sneaking \n"); self.sneak = 1; return; } - else if (self.sneak == 0 && self.class != 2) - { - sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); - centerprint (self, " cloaked \n(15% detection chance)"); - self.sneak = 3; - return; - } - else if (self.sneak == 0 && w > 20) - { - sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); - centerprint (self, " too much gear \n"); - setmodel (self, "progs/guy.mdl"); - self.sneak = 0; - return; - } }; void () Shield = @@ -3170,9 +5338,8 @@ void () station_think = if (ammoslot) SetItemSlot(te, ammoslot, SlotVal(ammotype, x + ToStatus(ItemInSlot(te, ammoslot)))); - r = random()*6; - if (r < 1) - sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was received from the mr.ammo.\n"); + sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was received from the mr.ammo.\n"); +/* else if (r < 2) sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " potatos were received from the mr.ammo.\n"); else if (r < 3) @@ -3182,7 +5349,7 @@ void () station_think = else if (r < 5) sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was extracted from the mr.ammo.\n"); else - sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was given by the mr.ammo, along with an std\n"); + sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was given by the mr.ammo, along with an std\n");*/ self.chemcount = self.chemcount - 1; } @@ -3419,12 +5586,10 @@ float() FireToolkit = //play a random build sound rr = random (); - if (rr < 0.3) - sound (self, CHAN_WEAPON, "misc/build1.wav", TRUE, ATTN_NORM); - else if (rr < 0.6) - sound (self, CHAN_WEAPON, "misc/build2.wav", TRUE, ATTN_NORM); + if (rr < 0.5) + sound (self, CHAN_WEAPON, "items/lockpick1.wav", TRUE, ATTN_NORM); else - sound (self, CHAN_WEAPON, "misc/build3.wav", TRUE, ATTN_NORM); + sound (self, CHAN_WEAPON, "items/lockpick2.wav", TRUE, ATTN_NORM); if (!trace_ent.nextthink) @@ -3452,7 +5617,6 @@ float() FireToolkit = trace_ent.nextthink = time; makevectors (self.v_angle); sprint(self, PRINT_HIGH, "Robofang appears to have malfunctioned\n"); -// spawn_dog (self.origin + v_forward * 32); } if (trace_ent.buildtype == IID_BUILD_AUTODOC) trace_ent.frame = 1; @@ -3466,6 +5630,30 @@ sprint(self, PRINT_HIGH, "Robofang appears to have malfunctioned\n"); return false; }; + +void () shop_face = +{ + local entity te; + + te = findradius (self.origin, 250); + while (te) + { + if (te.classname == "player") + { + self.enemy = te; + te.safezone = 1; + } + te = te.chain; + } + + self.angles_y = vectoyaw(self.enemy.origin - self.origin); + + self.nextthink = time + 0.1; + + if (vlen(self.origin - self.enemy.origin) > 500) + self.enemy = world; +}; + void () BuyMenu = { local float is_shop; @@ -3500,8 +5688,12 @@ void () BuyMenu = if (te.classname == "buyzone") is_shop = 1; if (te.classname == "merchant") + { + te.enemy = self; + te.think = shop_face; + te.nextthink = time + 0.5; is_shop = 1; - + } te = te.chain; } } @@ -3513,6 +5705,7 @@ void () BuyMenu = } if ((is_shop == 1)) { + self.missionbrief = 4; menu = ShopString (); centerprint (self, menu); self.currentmenu = "shop_list"; @@ -3578,20 +5771,7 @@ void () CharacterSheet = x = ftos (self.ammo_shells); sprint (self, 2, x); sprint (self, PRINT_HIGH, "$\n"); - if (self.class == 2) - { - sprint (self, PRINT_HIGH, "Bandages ‘ "); - x = ftos (self.bandages); - sprint (self, 2, x); - sprint (self, PRINT_HIGH, "\n"); - } - if (self.class == 6) - { - sprint (self, PRINT_HIGH, "Scraps ‘ "); - x = ftos (self.scraps); - sprint (self, 2, x); - sprint (self, PRINT_HIGH, "\n"); - } + /* sprint (self, PRINT_HIGH, "\nArmor ‘ "); x = GetArmorName(); @@ -3752,9 +5932,11 @@ void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 = dam = ((random () * dam) + dam); dam = (dam * (1 - trace_fraction)); - if (trace_ent.solid != SOLID_BSP) + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) SpawnBlood (org, 1); - if (trace_ent.solid == SOLID_BSP) + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + else if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") SpawnWood (trace_ent, org, 1); zdif = (org_z - trace_ent.origin_z); @@ -3779,15 +5961,17 @@ void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 = dam = dam + random()*dam; T_Damage (trace_ent, self, self, dam); + loud_noise(5);//hit flesh self.critical = 0; } else { + loud_noise(15);//richochet bullet_hole (org); } }; -void (float rec, float number, float dam, float spread, float ran, float auto) W_FireShotgun = +void (float rec, float number, float dam, float spread, float ran, float auto, string snd) W_FireShotgun = { local vector dir; local vector p_aim; @@ -3795,77 +5979,88 @@ void (float rec, float number, float dam, float spread, float ran, float auto) W local float var2; local float var3; local float var4; + local float weap; - if (self.velocity != '0 0 0') + if (getperk(16))//power shot adds a small bonus to the first shot fired { - var1 = ((random () * 48) * (6 + self.recoil * 1.5)); - var2 = ((random () * 48) * (6 + self.recoil * 1.5)); - var3 = ((random () * 48) * (6 + self.recoil * 1.5)); - var4 = ((random () * 48) * (6 + self.recoil * 1.5)); - } - if (self.position == 2) - { - var1 = ((random () * 12) * (6 + self.recoil * 1.5)); - var2 = ((random () * 12) * (6 + self.recoil * 1.5)); - var3 = ((random () * 12) * (6 + self.recoil * 1.5)); - var4 = ((random () * 12) * (6 + self.recoil * 1.5)); - } - if (self.position == 1) - { - var1 = ((random () * IDLE3A) * (6 + self.recoil * 1.5)); - var2 = ((random () * IDLE3A) * (6 + self.recoil * 1.5)); - var3 = ((random () * IDLE3A) * (6 + self.recoil * 1.5)); - var4 = ((random () * IDLE3A) * (6 + self.recoil * 1.5)); - } - if (self.position == 0) - { - var1 = ((random () * IDLE10A) * (6 + (self.recoil * 3))); - var2 = ((random () * IDLE10A) * (6 + (self.recoil * 3))); - var3 = ((random () * IDLE10A) * (6 + (self.recoil * 3))); - var4 = ((random () * IDLE10A) * (6 + (self.recoil * 3))); + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + dam = dam * 1.20; + } } + weap = ToIID(self.(SlotField(self.current_slot))); + + var1 = (16 + (random () * 12) * (self.recoil)); + var2 = (16 + (random () * 12) * (self.recoil)); + var3 = (16 + (random () * 12) * (self.recoil)); + var4 = (16 + (random () * 12) * (self.recoil)); + if (self.position == 0) player_single1 (); - if (self.position == 2) - player_single1 (); - if (self.position == 1) + else player_single1_s (); + if (self.steadyaim == 0) + { + var1 = (8 + (random () * 6) * (self.recoil)); + var2 = (8 + (random () * 6) * (self.recoil)); + var3 = (8 + (random () * 6) * (self.recoil)); + var4 = (8 + (random () * 6) * (self.recoil)); + } + stuffcmd (self, "+lookup\n"); stuffcmd (self, "wait\n"); stuffcmd (self, "-lookup\n"); - sound (self, CHAN_WEAPON, "weapons/shotgun1.wav", 1.5, ATTN_NORM); + sound (self, CHAN_WEAPON, snd, 1.5, ATTN_NORM); + + //only silenced weapons do not break stealth + if (self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); + } + + + loud_noise(40); - p_aim = (((((self.origin + '0 0 20') + (v_right * var1)) - (v_right * var2)) + (v_up * var3)) - (v_up * var4)); msg_entity = self; WriteByte (MSG_ONE, SVC_BIGKICK); DropAmmo (); self.attack = (self.attack + 1); - self.recoil = (self.recoil + 8); - Crosshair(); + self.recoil = (self.recoil + 8*rec); if (self.recoil >= 30) self.recoil = 30; if (auto == 0) + { self.attack_finished = (time + 0.5); - + stuffcmd (self, "-attack\n"); + } if (auto == 1) + { + self.attack_finished = (time + 0.25); + stuffcmd (self, "-attack\n"); + } + if (auto == 2) self.attack_finished = (time + 0.2); dir = aim (self, 10000); - spread = 30; if ((number == MULTICAST_PVS_R)) { - W_FireBuckshotSpread1 (p_aim, dam, spread, ran); - W_FireBuckshotSpread1 ((p_aim + (v_right * 80)), dam, spread, ran); - W_FireBuckshotSpread1 ((p_aim - (v_right * 80)), dam, spread, ran); - W_FireBuckshotSpread1 ((p_aim + (v_up * 80)), dam, spread, ran); - W_FireBuckshotSpread1 ((p_aim - (v_up * 80)), dam, spread, ran); + W_FireBuckshotSpread1 (p_aim, dam, 30, ran); + W_FireBuckshotSpread1 ((p_aim + (v_right * spread)), dam, 30, ran); + W_FireBuckshotSpread1 ((p_aim - (v_right * spread)), dam, 30, ran); + W_FireBuckshotSpread1 ((p_aim + (v_up * spread)), dam, 30, ran); + W_FireBuckshotSpread1 ((p_aim - (v_up * spread)), dam, 30, ran); } else { @@ -3878,49 +6073,33 @@ void (float rec, float number, float dam, float spread, float ran, float auto) W } }; -void () PlasmaBolt = + + + +void (vector org) spawn_tracer = { - local float dam; - local float zdif; - local float ydif; - local float xdif; - local float tru; + local entity tracer; + local float x; + local string y; - if (other.solid == SOLID_TRIGGER) - return; //they're not really solid + x = 0; - if (pointcontents (self.origin) == CONTENT_SKY) - { - remove (self); - return; - } + tracer = spawn(); + setmodel(tracer, "progs/handgren.mdl"); + setorigin(tracer, org); + setsize(tracer, '0 0 0', '0 0 0'); + tracer.think = SUB_Remove; + tracer.nextthink = time + 2; - if (other.takedamage) - { - dam = 30 + (random () * 30); - - T_Damage (other, self, self.owner, dam); - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_LIGHTNINGBLOOD); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); - sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_NORM); - } - else - { - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_LIGHTNINGBLOOD); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); - sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_NORM); - } - remove (self); + if (pointcontents (org) == CONTENT_SOLID) + x = x + 1; + + y = ftos(x); + bprint(2, y); + bprint(2, "\n"); }; + //the alien blaster void () FireAlienBlaster = { @@ -3961,7 +6140,773 @@ void () FireAlienBlaster = setsize (newmis, '0 0 0', '0 0 0'); setorigin (newmis, self.origin + (v_right * WEAPON_BIG) + (v_forward * WEAPON_ROCKET) + '0 0 20'); + newmis.velocity = newmis.velocity + (v_right * random () * tmp) - (v_right * random () * tmp) + (v_up * random () * tmp) - (v_up * random () * tmp); self.attack_finished = time + 0.5; }; + + + +void () radio_think = +{ + self.cnt = self.cnt - 1; + setorigin (self, (self.owner.origin + '0 0 48')); + self.nextthink = (time + 0.01); + if (self.cnt <= 0) + remove (self); +}; + +void (entity jeb, float length) spawn_excla = +{ + local entity hologram; + + hologram = spawn (); + hologram.movetype = MOVETYPE_NONE; + hologram.solid = SOLID_NOT; + hologram.owner = jeb; + setmodel (hologram, "progs/radio.spr"); + setorigin (hologram, jeb.origin); + setsize (hologram, VEC_ORIGIN, VEC_ORIGIN); + hologram.angles = jeb.angles; + hologram.colormap = jeb.colormap; + hologram.cnt = 100*length; + hologram.think = radio_think; + hologram.nextthink = (time + 0.01); +}; + +void (string color) ZoomInLarge = +{ + if (self.attack_finished > time) + return; + + self.weaponmodel = "progs/v_scope1.mdl"; + self.zoom = 1; + stuffcmd (self, "fov 30\n"); + + if (color == "red") + stuffcmd (self, "v_cshift 100 0 0 50\n"); + if (color == "blue") + stuffcmd (self, "v_cshift 0 0 100 75\n"); + if (color == "green") + stuffcmd (self, "v_cshift 0 100 0 100\n"); + if (color == "yellow") + stuffcmd (self, "v_cshift 100 100 0 50\n"); + if (color == "purple") + stuffcmd (self, "v_cshift 100 0 100 100\n"); +}; + +void (string color) ZoomInSmall = +{ + if (self.attack_finished > time) + return; + + self.weaponmodel = "progs/v_scope2.mdl"; + self.zoom = 1; + stuffcmd (self, "fov 60\n"); + + if (color == "red") + stuffcmd (self, "v_cshift 100 0 0 50\n"); + if (color == "blue") + stuffcmd (self, "v_cshift 0 0 100 75\n"); + if (color == "green") + stuffcmd (self, "v_cshift 0 100 0 100\n"); + if (color == "yellow") + stuffcmd (self, "v_cshift 100 100 0 50\n"); + if (color == "purple") + stuffcmd (self, "v_cshift 100 0 100 100\n"); +}; + +void () ZoomOut = +{ + SetWeaponModel(); + self.zoom = 0; + stuffcmd (self, "fov 90\n"); + stuffcmd (self, "v_cshift 0 0 0 0\n"); +}; + +void () ZoomIn = +{ + local float weap; + + weap = ToIID(self.(SlotField(self.current_slot))); + + if (self.zoom > 0) + { + ZoomOut (); + return; + } + + if (weap == IID_WP_DKS1) + ZoomInLarge("purple"); + if (weap == IID_WP_ACR) + ZoomInLarge("pink"); + if (weap == IID_WP_DKS1_S) + ZoomInLarge("purple"); + if (weap == IID_WP_FNFAL) + ZoomInSmall("red"); + if (weap == IID_WP_G11) + ZoomInSmall("blue"); + if (weap == IID_WP_MOONLIGHT) + ZoomInSmall("green"); + + if (weap == IID_WP_PIPERIFLE_SCOPE) + ZoomInLarge("green"); + if (weap == IID_WP_PIPERIFLE_SCOPE_R) + ZoomInLarge("green"); + if (weap == IID_WP_PIPERIFLE_SCOPE_S) + ZoomInLarge("green"); + if (weap == IID_WP_PIPERIFLE_SCOPE_S_R) + ZoomInLarge("green"); +}; + + +void () HostageReport = +{ + local float acount, dcount; + local entity te; + local string ah, dh, rh; + local vector dir, org; + + hostages = 0; + dead_hostage = 0; + + org = self.origin; + + te = find (world, classname, "rhostage"); + while (te) + { + if (te.health > 0) + acount = acount + 1; + + if (te.health <= 0) + dcount = dcount + 1; + + te = find (te, classname, "rhostage"); + } + + te = find (world, classname, "rhostage"); + while (te) + { + if (te.health > 0) + { + dir = normalize(te.origin - self.origin); + traceline (self.origin, self.origin+dir*2000, FALSE, self); + + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNING2); + WriteEntity (MSG_MULTICAST, self); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + WriteCoord (MSG_MULTICAST, trace_endpos_x); + WriteCoord (MSG_MULTICAST, trace_endpos_y); + WriteCoord (MSG_MULTICAST, trace_endpos_z); + multicast (org, MULTICAST_PHS); + } + te = find (te, classname, "rhostage"); + } + + + hostages = acount; + dead_hostage = dcount; + + ah = ftos(acount); + dh = ftos(dcount); + rh = ftos(rescue); + + sprint (self, PRINT_HIGH, "*** HOSTAGE REPORT ***\n"); + sprint (self, PRINT_HIGH, "rescued: "); + sprint (self, PRINT_HIGH, rh); + sprint (self, PRINT_HIGH, "\n"); + sprint (self, PRINT_HIGH, "alive: "); + sprint (self, PRINT_HIGH, ah); + sprint (self, PRINT_HIGH, "\n"); + sprint (self, PRINT_HIGH, "dead: "); + sprint (self, PRINT_HIGH, dh); + sprint (self, PRINT_HIGH, "\n"); + + rh = ftos(supplies); + sprint (self, PRINT_HIGH, "*** SUPPLY REPORT ***\n"); + sprint (self, PRINT_HIGH, "supplies: "); + sprint (self, PRINT_HIGH, rh); + sprint (self, PRINT_HIGH, "\n"); +}; + + +void () clone_think = +{ + self.model = self.owner.model; + self.frame = self.owner.frame; + self.nextthink = time + 0.01; +}; + +void () AddClone = +{ + local entity clone; + + clone = spawn (); + setmodel(clone, "progs/guy.mdl"); + clone.owner = self; + clone.movetype = MOVETYPE_BOUNCE; + clone.solid = SOLID_NOT; + clone.touch = SUB_Null; + clone.owner = self; + clone.think = clone_think; + setsize(clone, '-16 -16 -24', '16 16 32'); + setorigin(clone, self.origin); + clone.nextthink = time + 0.01; + sprint(self, 2, "clone added.\n"); + self.health = 9000; +}; + +float (float x) find_percent = +{ + if (x == 1) + return world.map_ent1_percent; + if (x == 2) + return world.map_ent2_percent; + if (x == 3) + return world.map_ent3_percent; +}; + +float(vector org) light_level = +{ + local vector light; + local float brightness; + + light = getlight(self.origin); + brightness = light_x*0.3 + light_y*0.51 + light_z*0.2; + + return brightness; +}; + +void() show_light_level = +{ + local float x; + local string y; + + x = light_level(self.origin); + y = ftos(x); + + bprint(2, "light level: "); + bprint(2, y); + bprint(2, "\n"); +}; + +void() AttachSilencer = +{ + local float weap, x, y; + + weap = ToIID(self.(SlotField(self.current_slot))); + + y = SlotOfItem(self, IID_EQUIP_SILENCER); + + if (weap == IID_WP_USP) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_USP_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_USP_S, x)); + return; + } + } + else if (weap == IID_WP_DKS1) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_DKS1_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_DKS1_S, x)); + return; + } + } + else if (weap == IID_WP_GLOCK) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_GLOCK_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_GLOCK_S, x)); + return; + } + } + else if (weap == IID_WP_MP7) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_MP7_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_MP7_S, x)); + return; + } + } + else if (weap == IID_WP_MP9) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_MP9_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_MP9_S, x)); + return; + } + } + else if (weap == IID_WP_PIPERIFLE) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_S, x)); + return; + } + } + else if (weap == IID_WP_PIPERIFLE_R) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_S_R, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_S_R, x)); + return; + } + } + else if (weap == IID_WP_PIPERIFLE_SCOPE) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_SCOPE_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_SCOPE_S, x)); + return; + } + } + else if (weap == IID_WP_PIPERIFLE_SCOPE_R) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_SCOPE_S_R, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_SCOPE_S_R, x)); + return; + } + } + else + { + sprint(self, 2, "cannot be silenced.\n"); + return; + } + +}; + + +void() AttachExtender = +{ + local float weap; + + weap = ToIID(self.(SlotField(self.current_slot))); + + if (weap == IID_WP_NEEDLER || weap == IID_WP_MOONLIGHT) + { + sprint(self, 2, "that weapon already has a silencer attached\n"); + return; + } + if (weap == IID_WP_ALIENBLASTER) + { + sprint(self, 2, "how exactly do you extend that???\n"); + return; + } + if (self.silencer == weap) + { + sprint(self, 2, "that weapon already has a silencer attached\n"); + return; + } + else if (ToIID(self.islot4) == IID_EQUIP_EXTENDER && self.extender == 0) + { + self.extender = weap; + sprint(self, 2, "extender attached.\n"); + self.islot4 = 0; + self.attack_finished = time + 1; + self.rtime = time + 1; + return; + } +/* + else if (ToIID(self.islot4) == IID_EQUIP_EXTENDER && self.extender > 0) + { + self.extender = 0; + sprint(self, 2, "removing extender...\n"); + self.attack_finished = time + 1; + return; + }*/ +}; + +void (float iid) RemoveSilencer = +{ + if (ToIID(self.islot4) == 0) + { + SetItemSlot(self, 4, SlotVal(IID_EQUIP_SILENCER, 1)); + sprint(self, 2, "removing silencer...\n"); + self.attack_finished = time + 1; + self.rtime = time + 1; + self.silencer = 0; + } + else if (ToIID(self.islot4) > 0) + { + sprint(self, 2, "can't remove silencer, equipment slot is full\n"); + return; + } +}; + +void (float iid) RemoveExtender = +{ + if (ToIID(self.islot4) == 0) + { + SetItemSlot(self, 4, SlotVal(IID_EQUIP_EXTENDER, 1)); + sprint(self, 2, "removing extender...\n"); + self.attack_finished = time + 1; + self.rtime = time + 1; + self.extender = 0; + } + else if (ToIID(self.islot4) > 0) + { + sprint(self, 2, "can't remove extender, equipment slot is full\n"); + return; + } +}; + + +void (string snd, float type) function_radio = +{ + local entity te; + local vector dir; + local vector vec; + local float dot1; + local float dot2; + local float dot3; + local float dot4; + local float dot5; + local float dot6; + + if (!self.attack_finished) + { + return; + } + self.attack_finished = (time + 2); + spawn_excla (self, 2); + te = find (world, classname, "player"); + while (te) + { + if (te.team == self.team) + { + sprint (te, 2, "radio"); + makevectors (te.angles); + vec = normalize ((te.origin - self.origin)); + dot1 = ((vec * v_forward) * 1); + dot2 = ((vec * v_right) * CONTENT_EMPTY); + dot3 = ((vec * v_right) * 1); + dot4 = ((vec * v_forward) * CONTENT_EMPTY); + dot5 = ((vec * v_up) * 1); + dot6 = ((vec * v_up) * CONTENT_EMPTY); + if ((te == self)) + { + sprint (te, 2, "(talk)"); + } + else + { + if ((dot1 > 0.3)) + { + sprint (te, 2, "(ahead)"); + } + else + { + if ((dot2 > 0.3)) + { + sprint (te, 2, "(left)"); + } + else + { + if ((dot3 > 0.3)) + { + sprint (te, 2, "(right)"); + } + else + { + if ((dot4 > 0.3)) + { + sprint (te, 2, "(behind)"); + } + else + { + if ((dot5 > 0.3)) + { + sprint (te, 2, "(above)"); + } + else + { + if ((dot6 > 0.3)) + { + sprint (te, 2, "(below)"); + } + else + { + sprint (te, 2, "(???)"); + } + } + } + } + } + } + } + sprint (te, 2, self.netname); + if ((type == 1)) + { + sprint (te, 2, ": affirmative"); + } + else + { + if ((type == 2)) + { + sprint (te, 2, ": negative"); + } + else + { + if ((type == 3)) + { + sprint (te, 2, ": lets go"); + } + else + { + if ((type == 4)) + { + sprint (te, 2, ": team, take cover"); + } + else + { + if ((type == 5)) + { + sprint (te, 2, ": team, get in formation!"); + } + else + { + if ((type == 6)) + { + sprint (te, 2, ": need backup!"); + } + else + { + if ((type == 7)) + { + sprint (te, 2, ": hold this position"); + } + else + { + if ((type == 8)) + { + sprint (te, 2, ": check your six"); + } + else + { + if ((type == 9)) + { + sprint (te, 2, ": secure this area"); + } + else + { + if ((type == 10)) + { + sprint (te, 2, ": squad, use suppressing fire!"); + } + else + { + if ((type == 11)) + { + sprint (te, 2, ": team, silence"); + } + } + } + } + } + } + } + } + } + } + } + sprint (te, 2, "\n"); + sound (self, CHAN_VOICE, snd, 0.55, ATTN_IDLE); + } + te = find (te, classname, "player"); + } +}; + + +void () GModelThink = +{ + local float weap; + + weap = ToIID(self.(SlotField(self.owner.current_slot))); + + local float dot1; + + if (self.owner.health <= 0) + { + remove (self); + return; + } + if (!IsMelee(weap)) + { + setmodel(self, ""); + return; + } + if (self.owner.health >= 1) + { + self.frame = self.owner.weaponframe; + self.nextthink = (time + 0.01); + } + + self.nextthink = time + 0.01; + +}; + +void() SpawnGModel = +{ + local entity hologram; + local float weap; + + weap = ToIID(self.(SlotField(self.current_slot))); + + if (!self.wielded) + { + hologram = spawn (); + hologram.movetype = MOVETYPE_NONE; + hologram.solid = SOLID_NOT; + hologram.owner = self; + if (weap == IID_WP_KNIFE) + setmodel (hologram, "progs/g_knife.mdl"); + if (weap == IID_WP_WRENCH) + setmodel (hologram, "progs/g_wrench.mdl"); + if (weap == IID_WP_AXE) + setmodel (hologram, "progs/g_axe.mdl"); + if (weap == IID_WP_SPEAR) + setmodel (hologram, "progs/g_spear.mdl"); + + setsize (hologram, VEC_ORIGIN, VEC_ORIGIN); + + setattachment(hologram, self, ""); + hologram.nextthink = time + 0.01; + hologram.think = GModelThink; + self.wielded = hologram; + } + else + { + hologram = self.wielded; + hologram.movetype = MOVETYPE_NONE; + hologram.solid = SOLID_NOT; + hologram.owner = self; + if (weap == IID_WP_KNIFE) + setmodel (hologram, "progs/g_knife.mdl"); + if (weap == IID_WP_WRENCH) + setmodel (hologram, "progs/g_wrench.mdl"); + if (weap == IID_WP_AXE) + setmodel (hologram, "progs/g_axe.mdl"); + if (weap == IID_WP_SPEAR) + setmodel (hologram, "progs/g_spear.mdl"); + + setsize (hologram, VEC_ORIGIN, VEC_ORIGIN); + + setattachment(hologram, self, ""); + hologram.nextthink = time + 0.01; + hologram.think = GModelThink; + } +}; diff --git a/quakec/fallout2/wizard.qc b/quakec/fallout2/wizard.qc index b2047fffd..c9c096a92 100644 --- a/quakec/fallout2/wizard.qc +++ b/quakec/fallout2/wizard.qc @@ -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 (); }; diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 0b98cda6b..76a205e33 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -1,3 +1,303 @@ +void () monster_dog; +void () monster_zombie; +void () monster_tarbaby; +void () monster_army; +void () monster_ogre; +void () monster_wizard; +void () monster_knight; +void () monster_demon1; +void () monster_enforcer; +void () monster_shalrath; +void () monster_shambler; +void () monster_fish; + +void (vector jojo) spawn_ghoul; + +//assesses all current players +void() get_difficulty = +{ + local entity te; + local float cr; + + //challenge rating system + // + //0-24 level of difficulty + //0 = barely equipped players + //24 = using the best arms and equipment + + challenge_rating = 0; + + te = find (world, classname, "player"); + while (te) + { + + if (te.ammo_shells > 200)//money + challenge_rating += 1; + if (te.ammo_shells > 500)//money + challenge_rating += 1; + if (ToIID(te.islot1) >= IID_WP_AK112 || ToIID(te.islot2) >= IID_WP_AK112)//good weapon + challenge_rating += 1; + if (ToIID(te.islot3) >= IID_ARM_COMBAT)//good armor + challenge_rating += 1; + + te = te.chain; + } + + if (challenge_rating > 24) + challenge_rating = 24; +}; + +void() load_monster = +{ + local float x, y, z; + +/* + if (infokey(world, "total") == "one") + bprint(2, "test - one player\n"); + + if (infokey(world, "total") == "two") + bprint(2, "test - two players\n"); + + if (infokey(world, "total") == "three") + bprint(2, "test - three players\n"); + + if (infokey(world, "total") == "four") + bprint(2, "test - four players\n");*/ + + + if (infokey(world, "total") == "one" && random()<0.40) + return; + + if (infokey(world, "total") == "two" && random()<0.30) + return; + + if (infokey(world, "total") == "three" && random()<0.20) + return; + + if (infokey(world, "total") == "four" && random()<0.10) + return; + + if (self.waterlevel > 2) + { + monster_fish(); + return; + } + + x = random()*100; + y = random()*100; + + if (x <= world.map_ent1_percent) + { + self.zone = 1; + + monster_ogre(); +/* + if (world.map_ent1 == 1) + monster_dog(); + if (world.map_ent1 == 2) + monster_zombie(); + if (world.map_ent1 == 3) + monster_tarbaby(); + if (world.map_ent1 == 4 || world.map_ent1 == 5) + monster_army(); + if (world.map_ent1 == 6) + monster_ogre(); + if (world.map_ent1 == 7) + monster_wizard(); + if (world.map_ent1 == 8) + monster_knight(); + if (world.map_ent1 == 9) + monster_demon1(); + if (world.map_ent1 == 10) + monster_enforcer(); + if (world.map_ent1 == 11) + monster_shalrath(); + if (world.map_ent1 == 12) + monster_shambler();*/ + } + else if (y <= world.map_ent2_percent) + { + self.zone = 1; + + if (world.map_ent2 == 1) + monster_dog(); + if (world.map_ent2 == 2) + monster_zombie(); + if (world.map_ent2 == 3) + monster_tarbaby(); + if (world.map_ent2 == 4 || world.map_ent2 == 5) + monster_army(); + if (world.map_ent2 == 6) + monster_ogre(); + if (world.map_ent2 == 7) + monster_wizard(); + if (world.map_ent2 == 8) + monster_knight(); + if (world.map_ent2 == 9) + monster_demon1(); + if (world.map_ent2 == 10) + monster_enforcer(); + if (world.map_ent2 == 11) + monster_shalrath(); + if (world.map_ent2 == 12) + monster_shambler(); + } + else + { + self.zone = 1; + + if (random()<0.10) + monster_dog(); + else if (random()<0.10) + monster_zombie(); + else if (random()<0.10) + monster_army(); + else if (random()<0.10) + monster_ogre(); + else if (random()<0.10) + monster_wizard(); + else if (random()<0.10) + monster_knight(); + + if (world.map_obj == OBJ_DEADTOWN) + spawn_ghoul(self.origin + '128 0 0'); + if (world.map_obj == OBJ_DEADTOWN) + spawn_ghoul(self.origin + '0 128 0'); + + } +}; + +//the big one +//randomly generates map information +//objective, monsters, etc +//1=dog, 2=ghoul, 3=soldier, 4=mutant, 5=scrag, 6=knight, 7=deathclaw,8=shalrath + +void() map_startup = +{ + local float r, x, t, e1, e2, e3, d; + local string savemap; + + if (s_map_obj != 0) + return; + + r = random(); + + get_difficulty(); + d = challenge_rating; + + + localcmd("serverinfo total zero\n"); + + if (infokey(world, "objective") == "return") + world.map_obj = 0; + if (infokey(world, "objective") == "hostage") + world.map_obj = 1; + if (infokey(world, "objective") == "supplies") + world.map_obj = 2; + if (infokey(world, "objective") == "shadow") + world.map_obj = 3; + if (infokey(world, "objective") == "deadtown") + world.map_obj = 4; + if (infokey(world, "objective") == "destroy") + world.map_obj = 5; + if (infokey(world, "objective") == "defuse") + world.map_obj = 6; + + if (infokey(world, "objective") == "hostage") + time_left = 400; + if (infokey(world, "objective") == "supplies") + time_left = 500; + if (infokey(world, "objective") == "shadow") + time_left = 300; + if (infokey(world, "objective") == "deadtown") + time_left = 300; + if (infokey(world, "objective") == "destroy") + time_left = 500; + if (infokey(world, "objective") == "defuse") + time_left = 400; + +/* + if (world.map_obj == 0) + savemap = "return"; + if (world.map_obj == 1) + savemap = "hostage"; + if (world.map_obj == 2) + savemap = "supplies"; + if (world.map_obj == 3) + savemap = "shadow"; + if (world.map_obj == 4) + savemap = "deadtown"; + if (world.map_obj == 5) + savemap = "destroy"; + if (world.map_obj == 6) + savemap = "defuse"; + + + localcmd("serverinfo objective "); + localcmd(savemap); + localcmd("\n");*/ + + x = 100; + t = floor(30+random()*30); + x -= t; + + world.map_ent1_percent = t; + + t = floor(15+random()*15); + x -= t; + + world.map_ent2_percent = t; + world.map_ent3_percent = x; + +if (challenge_rating < 4) +{ + world.map_ent1 = 2 + ceil(random()*6); + world.map_ent2 = ceil(random()*8); + world.map_ent3 = ceil(random()*8); +} +else if (challenge_rating < 8) +{ + world.map_ent1 = 2 + ceil(random()*8); + world.map_ent2 = 4 + ceil(random()*6); + world.map_ent3 = 6 + ceil(random()*4); +} +else +{ + world.map_ent1 = 4 + ceil(random()*8); + world.map_ent2 = 6 + ceil(random()*6); + world.map_ent3 = 8 + ceil(random()*4); +} + + if (world.map_obj == OBJ_HOSTAGE) + world.map_ent2 = 5; + if (world.map_obj == OBJ_SUPPLY) + world.map_ent2 = 5; + if (world.map_obj == OBJ_SHADOW) + world.map_ent1 = 5; + if (world.map_obj == OBJ_DEADTOWN) + { + world.map_ent1 = 3; + world.map_ent2 = 3; + world.map_ent3 = 8; + } + if (world.map_obj == OBJ_DESTROY) + world.map_ent2 = 5; + if (world.map_obj == OBJ_DEFUSE) + { + world.map_ent1 = 7; + world.map_ent2 = 16; + world.map_ent3 = 7; + } + s_map_obj = world.map_obj; + s_ent1 = world.map_ent1; + s_ent2 = world.map_ent2; + s_ent3 = world.map_ent3; + s_p1 = world.map_ent1_percent; + s_p2 = world.map_ent2_percent; + s_p3 = world.map_ent3_percent; + +}; + void() InitBodyQue; @@ -7,7 +307,9 @@ void() hostage_think; void() hostage_die; void(entity stuff) spawn_zombie; void() GameControl; -void() VoteBoy; +void() RespawnPlayer; + + void () create_referees = { @@ -22,18 +324,6 @@ void () create_referees = newmis.nextthink = (time + WEAPON_SHOTGUN); newmis.think = GameControl; newmis.classname = "referee"; - newmis = spawn (); - newmis.owner = self; - newmis.movetype = MOVETYPE_NONE; - setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); - newmis.solid = SOLID_BBOX; - newmis.velocity = VEC_ORIGIN; - newmis.touch = SUB_Null; - setorigin (newmis, '0 0 -300'); - newmis.nextthink = (time + MULTICAST_PVS_R); - newmis.think = VoteBoy; - newmis.classname = "voteboy"; - newmis.vote_time = (time + MULTICAST_PVS_R); }; void() main = @@ -188,11 +478,908 @@ void() main = precache_file2 ("maps/dm6.bsp"); }; +entity() SelectSpawnPoint; + +void () RespawnPlayer = +{ + local entity spot; + + bprint(2, "test\n"); + spot = SelectSpawnPoint (); + self.origin = spot.origin + '0 0 1'; + self.angles = spot.angles; + + self.deadflag = DEAD_NO; + self.takedamage = DAMAGE_AIM; + self.movetype = MOVETYPE_WALK; + self.solid = SOLID_NOT; + self.materialize = 200; + self.ghost = 0; + self.air_finished = time + 10; + self.view_ofs = '0 0 22'; + self.health = self.max_health; + + player_run(); +}; + +void () ResetMap = +{ + local entity te; + + te = find(world, classname, "player"); + while (te) + { + te.nextthink = time + 1; + te.think = RespawnPlayer; + + te = find(te, classname, "player"); + } + +}; + void () GameControl = { - local float pcount, pdead; - local entity te; + local float pcount, pdead, hcount, hdead, bcount; + local entity te, ze; + + if (world.model == "maps/r_bunker.bsp") + return; + + if (world.model == "maps/r_wastes1.bsp") + return; + + if (random()<0.05) + sound (self, CHAN_AUTO, "ambience/gunfire1.wav", 0.75, ATTN_NONE); + else if (random()<0.05) + sound (self, CHAN_AUTO, "ambience/gunfire5.wav", 0.75, ATTN_NONE); + +if (coop == 1) // Players vs Monsters +{ + local float combat; + + combat = 0; + get_difficulty(); + + te = find(world, classname, "monster"); + while (te) + { + + if (te.enemy != world && te.enemy.classname == "player" && te.health > 0) + combat = 1; + + te = find(te, classname, "monster"); + } + + if (musicplay == 0) + { + musicplay = 1; + musictrack = 1; + + bprint(2, "the battle begins!\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + if (musictrack == 1) + stuffcmd(ze, "play music/battle\n"); + + ze = find (ze, classname, "player"); + } + + } + else if (musicplay < 100) + musicplay = musicplay + 1; + else if (musicplay >= 100) + musicplay = 0; + + te = find(world, classname, "player"); + while (te) + { + + if (te.health > 0 && te.class > 0) + pcount = pcount + 1; + if (te.health <= 0) + pdead = pdead + 1; + + te = find(te, classname, "player"); + } + +// if (pcount > 0) +// self.timer = self.timer + 0.5; + + if (pcount == 0 && self.timer > 5) + localcmd("restart\n"); + + if (world.map_obj == OBJ_HOSTAGE) + { + time_left = time_left - 1; + + te = find(world, classname, "rhostage"); + while (te) + { + + if (te.health > 0 && te.rescued == 0) + hcount = hcount + 1; + if (te.health <= 0) + hdead = hdead + 1; + + te = find(te, classname, "rhostage"); + } + + hostages = hcount; + dead_hostage = hdead; + + if (pcount == 0 && pdead > 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE PLAYERS WERE SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bTHIS AREA WILL RESTART^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); + } + else if (hdead >= 2) //hostages killed + { + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE HOSTAGES WERE KILLED!!!^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bYOU HAVE FAILED THE MISSION^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (hcount == 0 && hdead <= rescue) //hostages rescued + { + if (endgame_timer == 0) + { + bprint(2, "^4** ^bTHE HOSTAGES WERE SAVED!!!^b **\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + } + else if (time_left <= 0) //time ran out + { + if (endgame_timer == 0) + bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + if (hcount == 0 && hdead <= rescue) + endgame_timer = endgame_timer + 1; + } + if (world.map_obj == OBJ_DEFUSE) + { + time_left = time_left - 1; + + bcount = 0; + + te = find(world, classname, "bomb"); + while (te) + { + if (self.owner.picking != 2) + bcount = bcount + 1; + + te = find(te, classname, "bomb"); + } + + local string xx; + + if (random()*10 <= 1) + { + xx = ftos(bcount); + bprint(2, xx); + bprint(2, " bombs left!!\n"); + } + + if (pcount == 0 && pdead > 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE PLAYERS WERE SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bTHIS AREA WILL RESTART^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); + } + else if (bcount == 0) //bombs defused + { + if (endgame_timer == 0) + { + bprint(2, "^4** ^bTHE FUEL TANKS WERE DESTROYED!!!^b **\n"); + bprint(2, "^4** ^b RETURNING TO BASE!!!^b **\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } + + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + } + + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + else if (time_left == 0) //time ran out + { + if (endgame_timer == 0) + sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); + if (endgame_timer == 2) + sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); + if (endgame_timer == 3) + sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); + if (endgame_timer == 4) + sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); + + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE EXPLOSIVES WERE NOT DEFUSED^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^b!!! MISSION SITE DESTROYED !!!^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); + } + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + if (bcount == 0) + endgame_timer = endgame_timer + 1; + if (self.timer >= 300) + endgame_timer = endgame_timer + 1; + } + else if (world.map_obj == OBJ_SUPPLY) + { + time_left = time_left - 1; + + if (pcount == 0 && pdead > 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + } + else if (time_left <= 0) //time ran out + { + if (endgame_timer == 0) + bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + else if (supplies == 0) //supplies secured + { + if (endgame_timer == 0) + { + bprint(2, "^4** ^bTHE SUPPLIES WERE SECURED!!!^b **\n"); + bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + } + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + else if (supplies == 0) + endgame_timer = endgame_timer + 1; + } + else if (world.map_obj == OBJ_SHADOW) + { + time_left = time_left - 1; + + if (pcount == 0 && pdead > 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + } + else if (commanders == 0) //commanders assassinated + { + if (endgame_timer == 0) + { + bprint(2, "^4** ^bTHE COMMANDERS WERE NEUTRALIZED!!!^b **\n"); + bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + } + else if (time_left <= 0 && intermission_running == 0) //time ran out + { + if (endgame_timer == 0) + bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + else if (called_in >= 5) //soldier radioed in + { + if (endgame_timer == 0) + bprint(2, "^4** ^bYOUR SQUAD WAS DISCOVERED^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 5) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 6) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 7) + localcmd("restart\n"); + } + + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + else if (called_in >= 5) + endgame_timer = endgame_timer + 1; + } + else if (world.map_obj == OBJ_DEADTOWN) + { + time_left = time_left - 1; + + if (time_left <= 0 && intermission_running == 0) //time ran out + { + if (endgame_timer == 0) + bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + else if (pcount == 0 && pdead > 0 && called_in == 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + } + + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + else if (called_in == 1) + endgame_timer = endgame_timer + 1; + } + else if (world.map_obj == OBJ_DESTROY) + { + time_left = time_left - 1; + + if (pcount == 0 && pdead > 0 && called_in == 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + } + else if (supplies == 0) //fuel tanks destroyed + { + if (endgame_timer == 0) + { + bprint(2, "^4** ^bTHE FUEL TANKS WERE DESTROYED!!!^b **\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + } + else if (time_left <= 0) //time ran out + { + if (endgame_timer == 0) + bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + else if (supplies == 0) + endgame_timer = endgame_timer + 1; + } + self.think = GameControl; + self.nextthink = time + 1; + return; +} +if (coop == 0) // Players vs Players +{ + t1alive = 0; + t1dead = 0; + t2alive = 0; + t2dead = 0; + + pcount = 0; + pdead = 0; + + bprint(2, "gc test\n"); te = find(world, classname, "player"); while (te) @@ -206,29 +1393,88 @@ void () GameControl = te = find(te, classname, "player"); } - if (pcount == 0 && pdead > 0) //everyone died + if (pcount == 0 || (pcount == 1 && pdead == 0)) { - if (endgame_timer == 0) - bprint(2, "^4** ^bTHE PLAYERS WERE SLAIN^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bTHIS AREA WILL RESTART^b **\n"); - if (endgame_timer == 7) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 8) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 9) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 10) - localcmd("restart\n"); - - sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); + bprint(2, "^4** ^bTHE ROUND WILL NOT BEGIN UNTIL^b **\n"); + bprint(2, "^4** ^bBOTH TEAMS HAVE ENOUGH PLAYERS^b **\n"); + self.think = GameControl; + self.nextthink = time + 10; + return; } - if (pcount == 0 && pdead > 0) + te = find(world, classname, "player"); + while (te) + { + if (te.team == 1) + { + if (te.health > 0) + t1alive = t1alive + 1; + if (te.health <= 0) + t1dead = t1dead + 1; + } + if (te.team == 2) + { + if (te.health > 0) + t2alive = t2alive + 1; + if (te.health <= 0) + t2dead = t2dead + 1; + } + te = find(te, classname, "player"); + } + + if (t1alive > 0 && t2alive == 0) //team 1 has won + { + self.think = GameControl; + self.nextthink = time + 1; + + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE RANGERS HAVE WON!^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bTHIS MAP WILL RESTART^b **\n"); + if (endgame_timer == 5) + ResetMap(); + + winningteam = 1; + sound (world, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NONE); endgame_timer = endgame_timer + 1; + } + if (t2alive > 0 && t1alive == 0) //team 2 has won + { + self.think = GameControl; + self.nextthink = time + 1; + + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE RAIDERS HAVE WON!^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bTHIS MAP WILL RESTART^b **\n"); + if (endgame_timer == 5) + ResetMap(); + + winningteam = 2; + sound (world, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NONE); + endgame_timer = endgame_timer + 1; + } + if (t2alive == 0 && t1alive == 0) //team 2 has won + { + self.think = GameControl; + self.nextthink = time + 1; + + if (endgame_timer == 0) + bprint(2, "^4** ^bBOTH SIDES ARE DEFEATED!^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bTHIS MAP WILL RESTART^b **\n"); + if (endgame_timer == 5) + ResetMap(); + + winningteam = 0; + sound (world, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NONE); + endgame_timer = endgame_timer + 1; + } self.think = GameControl; self.nextthink = time + 1; + return; +} }; void () GameTimer = @@ -332,6 +1578,163 @@ void () create_timer = newmis.classname = "referee"; }; + +void () RecoilControl = +{ + local entity te, ze; + local float switched; + local float c, z; + + + self.think = RecoilControl; + self.nextthink = time + 0.01; + + te = find (world, classname, "player"); + + while (te) + { + + te.lastman = te.lastman - 0.01; + + if (te.lastman < 0) + te.lastman = 0; + + //superstims: heal at an incredible rate! + if ((te.xregen > 0 && te.health < te.max_health) && random()<0.5) + { + te.health = te.health + 1; + te.xregen = te.xregen - 1; + + if (te.health > te.max_health) + te.health = te.max_health; + } + + //superstims: decay if not healing + + if ((te.xregen > 0 && te.health >= te.max_health) && random()<0.05) + { + te.xregen = te.xregen - 1; + + if (te.health > te.max_health) + te.health = te.max_health; + } + + te.lastman = te.lastman - 0.01; + + //steady aim: for power shot, and aimed shots by standing still + if (te.recoil != 0) + te.steadyaim = 6; + else if (te.recoil == 0 && te.steadyaim > 0) + { + te.steadyaim = te.steadyaim - 0.05; + + if (te.perk1 == 13 || te.perk2 == 13) + te.steadyaim = te.steadyaim - 0.05; + } + + if (te.steadyaim > 0 && te.steadyaim <= 0.10) + te.steadyaim = 0; + + + if (te.pain_finished < time && te.missionbrief == 6) // remove pain + te.missionbrief = 0; + else if (te.flash < time && te.missionbrief == 5) // remove flash + te.missionbrief = 0; + else if (te.currentmenu == "menu_none" && te.missionbrief == 4) // remove shop + te.missionbrief = 0; + if (te.velocity == '0 0 0') + { + if (te.attack == 0) + { + if (te.driftx >= 1) + te.driftx = te.driftx - 1; + if (te.driftx <= -1) + te.driftx = te.driftx + 1; + + if (te.drifty >= 1) + te.drifty = te.drifty - 1; + if (te.drifty <= -1) + te.drifty = te.drifty + 1; + + } + + if (te.class == 1) + te.recoil = te.recoil - 0.20; + if (te.class == 2) + te.recoil = te.recoil - 0.20; + if (te.class == 3) + te.recoil = te.recoil - 0.25; + if (te.class == 4) + te.recoil = te.recoil - 0.15; + } + else + { + if (te.attack == 0) + { + if (te.driftx >= 0.5) + te.driftx = te.driftx - 0.5; + if (te.driftx <= -0.5) + te.driftx = te.driftx + 0.5; + + if (te.drifty >= 0.5) + te.drifty = te.drifty - 0.5; + if (te.drifty <= -0.5) + te.drifty = te.drifty + 0.5; + } + + if (te.recoil > 5) + te.recoil = te.recoil - 0.05; + + if (te.recoil <= 5) + { + te.recoil = te.recoil + 0.10; + + if (te.recoil >= 5) + te.recoil = 5; + } + } + + if (te.driftx > 250) + te.driftx = 250; + if (te.drifty > 250) + te.drifty = 250; + + //nintendo gamer: going into the zone gives a -5 recoil bonus + if (te.rage == 255) + te.recoil = te.recoil - 0.05; + + + //prone: going prone gives a -5 recoil bonus + + if (self.position == 2) + te.recoil = te.recoil - 0.05; + + if (te.recoil <= 0) + { + te.recoil = 0; + te.driftx = 0; + te.drifty = 0; + } + + te = find (te, classname, "player"); + } +}; + +void () recoil_control = +{ + newmis = spawn (); + newmis.owner = self; + newmis.movetype = MOVETYPE_NONE; + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.solid = SOLID_BBOX; + newmis.velocity = VEC_ORIGIN; + newmis.touch = SUB_Null; + setorigin (newmis, '0 0 -300'); + newmis.nextthink = (time + 1); + newmis.think = RecoilControl; + newmis.classname = "recoil"; +}; + entity lastspawn; //======================= @@ -348,21 +1751,34 @@ World Types: //======================= void() worldspawn = { + local entity te; + local string x; + lastspawn = world; InitBodyQue (); coop = !cvar("deathmatch"); + recoil_control(); create_referees(); SetupStats(); // custom map attributes - if (self.model == "maps/e1m8.bsp") - cvar_set ("sv_gravity", "100"); - else - cvar_set ("sv_gravity", "800"); + cvar_set ("skill", "3"); + world.location = ceil(random()*5); + total_players = 0; + te = find (world, classname, "player"); + while (te) + { + if (te.classname == "player") + total_players = total_players + 1; + + te = find(te, classname, "player"); + } + + map_startup(); // the area based ambient sounds MUST be the first precache_sounds // player precaches @@ -373,7 +1789,6 @@ void() worldspawn = precache_sound ("misc/h2ohit1.wav"); // landing splash // setup precaches allways needed - precache_sound ("items/itembk2.wav"); // item respawn sound precache_sound ("player/plyrjmp8.wav"); // player jump precache_sound ("player/land.wav"); // player landing precache_sound ("player/land2.wav"); // player hurt landing @@ -383,18 +1798,13 @@ void() worldspawn = precache_sound ("player/gasp2.wav"); // taking breath precache_sound ("player/h2odeath.wav"); // drowning death + precache_sound ("radio/9_secure.wav"); // drowning death precache_sound ("misc/talk.wav"); // talk precache_sound ("player/teledth1.wav"); // telefrag - precache_sound ("misc/r_tele1.wav"); // teleport sounds - precache_sound ("misc/r_tele2.wav"); - precache_sound ("misc/r_tele3.wav"); - precache_sound ("misc/r_tele4.wav"); - precache_sound ("misc/r_tele5.wav"); + + precache_sound ("items/inv1.wav"); precache_sound ("weapons/lock4.wav"); // ammo pick up precache_sound ("weapons/pkup.wav"); // weapon up - precache_sound ("items/armor1.wav"); // armor up - precache_sound ("weapons/lhit.wav"); //lightning - precache_sound ("weapons/lstart.wav"); //lightning start precache_sound ("items/damage3.wav"); precache_sound ("misc/power.wav"); //lightning for boss @@ -413,19 +1823,15 @@ void() worldspawn = precache_sound ("player/pain5.wav"); precache_sound ("player/pain6.wav"); -// player death sounds - precache_sound ("player/death1.wav"); - precache_sound ("player/death2.wav"); - precache_sound ("player/death3.wav"); - precache_sound ("player/death4.wav"); - precache_sound ("player/death5.wav"); - precache_sound ("boss1/sight1.wav"); // ax sounds + precache_sound ("weapons/knifehit.wav"); // ax swoosh precache_sound ("weapons/ax1.wav"); // ax swoosh precache_sound ("player/axhit1.wav"); // ax hit meat precache_sound ("player/axhit2.wav"); // ax hit world + precache_sound ("weapons/brawl-1.wav"); // ax hit world + precache_sound ("weapons/brawl-2.wav"); // ax hit world precache_sound ("player/h2ojump.wav"); // player jumping into water precache_sound ("player/slimbrn2.wav"); // player enter slime @@ -444,7 +1850,7 @@ void() worldspawn = precache_sound ("items/protect2.wav"); precache_sound ("items/protect3.wav"); - precache_model ("progs/player.mdl"); + precache_model ("progs/melee.mdl"); precache_model ("progs/guy.mdl"); precache_model ("progs/lay.mdl"); precache_model ("progs/eyes.mdl"); @@ -455,35 +1861,55 @@ void() worldspawn = precache_model ("progs/s_bubble.spr"); // drowning bubbles precache_model ("progs/s_explod.spr"); // sprite explosion + precache_model ("progs/ammobox.mdl"); + precache_model ("progs/ammobox2.mdl"); precache_model ("progs/v_axe.mdl"); - precache_model ("progs/v_shot.mdl"); precache_model ("progs/v_span.mdl"); precache_model ("progs/v_nail.mdl"); precache_model ("progs/v_rock.mdl"); - precache_model ("progs/v_shot2.mdl"); precache_model ("progs/v_nail2.mdl"); precache_model ("progs/v_rock2.mdl"); precache_model ("progs/v_fist.mdl"); precache_model ("progs/v_knife.mdl"); + precache_model ("progs/v_spear.mdl"); precache_model ("progs/v_1911.mdl"); - precache_model ("progs/v_ak47.mdl"); + precache_model ("progs/v_needler.mdl"); + precache_model ("progs/v_glock.mdl"); + precache_model ("progs/v_fnfal.mdl"); precache_model ("progs/v_smg.mdl"); precache_model ("progs/v_rangem.mdl"); precache_model ("progs/v_pipe.mdl"); - precache_model ("progs/v_shotgun.mdl"); precache_model ("progs/v_double.mdl"); - precache_model ("progs/v_mp9.mdl"); - precache_model ("progs/v_sa80.mdl"); + precache_model ("progs/v_combat.mdl"); + precache_model ("progs/v_ump.mdl"); + precache_model ("progs/v_g11.mdl"); + precache_model ("progs/v_ak47.mdl"); + precache_model ("progs/v_acr.mdl"); precache_model ("progs/v_deagle.mdl"); - precache_model ("progs/v_alien.mdl"); + precache_model ("progs/v_blaster.mdl"); precache_model ("progs/v_srifle.mdl"); precache_model ("progs/v_night.mdl"); - precache_model ("progs/v_piperifle.mdl"); precache_model ("progs/v_handgren.mdl"); precache_model ("progs/v_jackhammer.mdl"); precache_model ("progs/v_rocket.mdl"); + precache_model ("progs/v_pipe.mdl"); + precache_model ("progs/v_gauss.mdl"); + precache_model ("progs/v_carbine.mdl"); + precache_model ("progs/v_plasma.mdl"); + precache_model ("progs/v_scope1.mdl"); + precache_model ("progs/v_scope2.mdl"); + precache_model ("progs/v_chain.mdl"); + precache_model ("progs/g_spear.mdl"); + precache_model ("progs/g_knife.mdl"); + precache_model ("progs/g_axe.mdl"); + precache_model ("progs/g_wrench.mdl"); + precache_model ("progs/junk1.mdl"); + precache_model ("progs/junk2.mdl"); + precache_model ("progs/chest.mdl"); + precache_model ("progs/hosfem.mdl"); + precache_model ("progs/hosguy.mdl"); precache_model ("progs/handgren.mdl"); precache_model ("progs/plasma.mdl"); precache_model ("progs/ray.mdl"); @@ -491,23 +1917,26 @@ void() worldspawn = precache_model ("progs/dead.mdl"); precache_model ("progs/hbar.spr"); precache_model ("progs/blast.mdl"); - precache_model ("progs/station.mdl"); - precache_model ("progs/camera.mdl"); - precache_model ("progs/tehghoul.mdl"); precache_model ("progs/ray.mdl"); + precache_model ("progs/radio.spr"); + precache_model ("progs/w_spear.mdl"); + precache_model ("progs/w_span.mdl"); precache_model ("progs/w_knife.mdl"); precache_model ("progs/w_pipe.mdl"); - precache_model ("progs/w_shotgun.mdl"); + precache_model ("progs/w_double.mdl"); + precache_model ("progs/w_combat.mdl"); precache_model ("progs/w_axe.mdl"); + precache_model ("progs/w_glock.mdl"); precache_model ("progs/w_1911.mdl"); precache_model ("progs/w_deagle.mdl"); precache_model ("progs/w_alien.mdl"); - precache_model ("progs/w_mp7.mdl"); precache_model ("progs/w_mp9.mdl"); + precache_model ("progs/w_mp5.mdl"); precache_model ("progs/w_jackhammer.mdl"); precache_model ("progs/w_rangem.mdl"); - precache_model ("progs/w_sa80.mdl"); + precache_model ("progs/w_g11.mdl"); + precache_model ("progs/w_acr.mdl"); precache_model ("progs/w_ak47.mdl"); precache_model ("progs/w_night.mdl"); precache_model ("progs/w_srifle.mdl"); @@ -515,6 +1944,14 @@ void() worldspawn = precache_model ("progs/w_carbine.mdl"); precache_model ("progs/w_laser.mdl"); precache_model ("progs/w_rocket.mdl"); + precache_model ("progs/w_plasma.mdl"); + precache_model ("progs/w_chain.mdl"); + precache_model ("progs/money.mdl"); + + precache_model ("progs/turrgun.mdl"); + precache_model ("progs/turrbase.mdl"); + precache_model ("progs/miniturr.mdl"); + precache_model ("progs/minibase.mdl"); precache_model ("progs/grenade2.mdl"); precache_model ("maps/b_bh10.bsp"); @@ -522,7 +1959,60 @@ void() worldspawn = precache_model ("maps/b_bh100.bsp"); precache_model ("progs/s_light.spr"); + precache_sound ("misc/basekey.wav"); precache_sound ("misc/thud.wav"); + precache_sound ("misc/exp1.wav"); + precache_sound ("misc/exp2.wav"); + precache_sound ("misc/exp3.wav"); + precache_sound ("effects/openlock.wav"); + precache_sound ("effects/miss.wav"); + precache_sound ("effects/radio1.wav"); + precache_sound ("effects/radio2.wav"); + precache_sound ("effects/radio3.wav"); + precache_sound ("effects/radio4.wav"); + precache_sound ("effects/blip1.wav"); + precache_sound ("effects/blip2.wav"); + precache_sound ("effects/axe_hit1.wav"); + precache_sound ("effects/axe_hit2.wav"); + precache_sound ("effects/axe_swing.wav"); + precache_sound ("effects/metal-1.wav"); + precache_sound ("effects/metal-2.wav"); + precache_sound ("effects/spear_hit1.wav"); + precache_sound ("effects/spear_hit2.wav"); + + precache_sound ("misc/item1.wav"); + precache_sound ("misc/item2.wav"); + precache_sound ("items/r_item1.wav"); + precache_sound ("items/r_item2.wav"); + precache_sound ("items/locked.wav"); + precache_sound ("items/lockpick1.wav"); + precache_sound ("items/lockpick2.wav"); + + + precache_sound ("radio/1_yes.wav"); + precache_sound ("radio/2_no.wav"); + precache_sound ("radio/3_letsgo.wav"); + precache_sound ("radio/4_cover.wav"); + precache_sound ("radio/5_recon.wav"); + precache_sound ("radio/6_backup.wav"); + precache_sound ("radio/7_hold.wav"); + precache_sound ("radio/8_behind.wav"); + precache_sound ("radio/9_secure.wav"); + precache_sound ("radio/10_suppressing.wav"); + precache_sound ("radio/11_silence.wav"); + precache_sound ("radio/medic.wav"); + precache_sound ("radio/grenade.wav"); + + precache_sound ("ambience/gunfire1.wav"); + precache_sound ("ambience/gunfire5.wav"); + + precache_sound ("weapons/smoke.wav"); + precache_sound ("weapons/energy2.wav"); + + precache_sound ("misc/hosdie1.wav"); + precache_sound ("misc/hosdie2.wav"); + + precache_sound ("player/gib1.wav"); precache_sound ("player/step1.wav"); precache_sound ("player/step2.wav"); precache_sound ("player/step3.wav"); @@ -536,39 +2026,36 @@ void() worldspawn = precache_sound ("dog/dpain1.wav"); precache_sound ("dog/dsight.wav"); precache_sound ("dog/idle.wav"); - precache_sound ("weapons/1911.wav"); - precache_sound ("weapons/auto.wav"); + precache_sound ("ogre/ak74.wav"); + precache_sound ("ogre/ak47.wav"); + precache_sound ("weapons/usp.wav"); + precache_sound ("weapons/glock.wav"); precache_sound ("weapons/auto2.wav"); precache_sound ("weapons/ak112.wav"); - precache_sound ("weapons/ak47.wav"); precache_sound ("weapons/amr.wav"); - precache_sound ("weapons/blaster.wav"); - precache_sound ("weapons/blaster2.wav"); - precache_sound ("weapons/blowoff.wav"); - precache_sound ("weapons/bounce.wav"); + precache_sound ("weapons/blowoff-1.wav"); + precache_sound ("weapons/blowoff-2.wav"); + precache_sound ("misc/bounce_1.wav"); + precache_sound ("misc/bounce_2.wav"); + precache_sound ("misc/bounce_3.wav"); precache_sound ("weapons/burst.wav"); - precache_sound ("weapons/caws.wav"); precache_sound ("weapons/click.wav"); precache_sound ("weapons/deagle.wav"); precache_sound ("weapons/dks-1.wav"); - precache_sound ("weapons/energy1.wav"); - precache_sound ("weapons/energy2.wav"); - precache_sound ("weapons/energy3.wav"); - precache_sound ("weapons/energy4.wav"); - precache_sound ("weapons/flamer.wav"); precache_sound ("weapons/fnfal.wav"); precache_sound ("weapons/g11.wav"); precache_sound ("weapons/gauss.wav"); - precache_sound ("weapons/gl-1.wav"); precache_sound ("weapons/gpull.wav"); - precache_sound ("weapons/helmet.wav"); - precache_sound ("weapons/jackhammer.wav"); + precache_sound ("weapons/citykiller.wav"); precache_sound ("weapons/laser.wav"); - precache_sound ("weapons/m249.wav"); - precache_sound ("weapons/m4-nw.wav"); + precache_sound ("weapons/laserburst1.wav"); + precache_sound ("weapons/plasma-1.wav"); + precache_sound ("weapons/plasma-2.wav"); + precache_sound ("weapons/moonlight-1.wav"); + precache_sound ("weapons/moonlight-2.wav"); precache_sound ("weapons/needler.wav"); + precache_sound ("weapons/smg_s.wav"); precache_sound ("weapons/shotgun1.wav"); - precache_sound ("weapons/shotgun2.wav"); precache_sound ("weapons/mp5.wav"); precache_sound ("weapons/mp7.wav"); precache_sound ("weapons/rangem.wav"); @@ -578,9 +2065,10 @@ void() worldspawn = precache_sound ("weapons/ric4.wav"); precache_sound ("weapons/ric5.wav"); precache_sound ("weapons/tink1.wav"); - precache_sound ("weapons/sa80-1.wav"); precache_sound ("weapons/shell.wav"); precache_sound ("weapons/reload.wav"); + precache_sound ("weapons/silenced.wav"); + precache_sound ("misc/greload.wav"); precache_sound ("misc/build1.wav"); precache_sound ("misc/build2.wav"); precache_sound ("misc/build3.wav"); @@ -590,16 +2078,19 @@ void() worldspawn = precache_sound ("player/agdie4.wav"); precache_sound ("player/agdie5.wav"); precache_sound ("player/berserk.wav"); - precache_sound ("player/breathe.wav"); precache_sound ("player/headshot.wav"); precache_sound ("player/hit1.wav"); + precache_sound ("player/paina.wav"); precache_sound ("player/painb.wav"); + precache_sound ("player/yourturn.wav"); precache_model ("progs/bolt.mdl"); // for lightning gun precache_model ("progs/bolt2.mdl"); // for lightning gun precache_model ("progs/bolt3.mdl"); // for boss shock precache_model ("progs/lavaball.mdl"); // for testing - + + + precache_model ("progs/bomb.mdl"); precache_model ("progs/missile.mdl"); precache_model ("progs/grenade.mdl"); precache_model ("progs/spike.mdl"); @@ -610,8 +2101,8 @@ void() worldspawn = precache_model ("progs/zom_gib.mdl"); precache_model ("progs/v_light.mdl"); - + precache_model ("maps/crate.bsp"); // // Setup light animation tables. 'a' is total darkness, 'z' is maxbright. diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index 504917987..d485f4b8b 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -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); };