From 119ce05ca47c3f631937febc03f9a4b9ddcebb25 Mon Sep 17 00:00:00 2001 From: Magnus Date: Mon, 2 Jan 2006 03:53:58 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1758 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 338 +++++------ quakec/fallout2/combat.qc | 36 +- quakec/fallout2/defs.qc | 42 +- quakec/fallout2/enforcer.qc | 16 +- quakec/fallout2/fight.qc | 1 + quakec/fallout2/items.qc | 91 ++- quakec/fallout2/misc.qc | 6 +- quakec/fallout2/mod_buy.qc | 52 +- quakec/fallout2/name.qc | 80 +++ quakec/fallout2/ogre.qc | 2 +- quakec/fallout2/player.qc | 53 +- quakec/fallout2/progs.src | 4 +- quakec/fallout2/soldier.qc | 44 +- quakec/fallout2/subs.qc | 2 +- quakec/fallout2/weapons.qc | 1067 ++++++++++++++++++++++------------- quakec/fallout2/world.qc | 20 +- 16 files changed, 1074 insertions(+), 780 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 4f8daa81..b7d51f77 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -37,7 +37,7 @@ void() info_intermission = void() SetChangeParms = { - if (self.health <= 0) + if (self.armor <= 0) { SetNewParms (); return; @@ -47,114 +47,62 @@ void() SetChangeParms = self.items = self.items - (self.items & (IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) ); -// cap super health - if (self.health > 100) - self.health = 100; - if (self.health < 50) - self.health = 50; - parm1 = self.items; - parm2 = self.health; - parm3 = self.armorvalue; - if (self.ammo_shells < 25) - parm4 = 25; - else - parm4 = self.ammo_shells; - parm5 = self.ammo_nails; - parm6 = self.ammo_rockets; - parm7 = self.ammo_cells; - parm8 = self.weapon; - parm9 = self.armortype * 100; + parm1 = self.slot1; + parm2 = self.slot2; + parm3 = self.armor; + parm4 = self.protect; + parm5 = self.equipment; + parm6 = self.chem; + parm7 = self.chemcount; + 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; - - - parm16 = self.current_slot; - parm17 = self.islot1; - parm18 = self.islot2; - parm19 = self.islot3; - parm20 = self.islot4; - parm21 = self.islot5; - parm22 = self.islot6; - parm23 = self.islot7; - parm24 = self.islot8; - parm25 = self.islot9; - parm26 = self.islot10; - parm27 = self.islot11; - parm28 = self.islot12; - parm29 = self.islot13; - parm30 = self.islot14; - parm31 = self.islot15; - parm32 = self.islot16; }; void() SetNewParms = -{ //remember, don't use self! - parm1 = IT_SHOTGUN | IT_AXE; - parm2 = 100; - parm3 = 0; - parm4 = 25; +{ + parm1 = 5; + parm2 = 1; + parm3 = 1; + parm4 = 0; parm5 = 0; parm6 = 0; parm7 = 0; - parm8 = 1; + parm8 = 8; parm9 = 0; - - - parm16 = 1; - parm17 = SlotVal(IID_WP_AK74, 30); - parm18 = SlotVal(IID_GREN_SMOKE, 500); - parm19 = SlotVal(IID_ARM_LEATHER, 1); - parm20 = SlotVal(IID_AM_AK74, 120); - parm21 = SlotVal(IID_AM_MOONLIGHT, 120); - parm22 = 0; - parm23 = SlotVal(IID_WP_TOOLKIT, 1); - parm24 = SlotVal(IID_WP_MOONLIGHT, 30); - parm25 = 0; - parm26 = SlotVal(IID_CHEM_STIMPACK, 3); - parm27 = SlotVal(IID_BUILD_MRAMMO, 3); - parm28 = SlotVal(IID_BUILD_AUTODOC, 3); - parm29 = 0; - parm30 = 0; - parm31 = 0; - parm32 = 0; + parm10 = 0; + parm11 = 0; + parm12 = 0; + //parm13 = 0; + parm14 = 0; + parm15 = 0; }; void() DecodeLevelParms = -{ - if (serverflags) - { - if (world.model == "maps/start.bsp") - SetNewParms (); // take away all stuff on starting new episode - } - - self.items = parm1; - self.health = parm2; - self.armorvalue = parm3; - self.ammo_shells = parm4; - self.ammo_nails = parm5; - self.ammo_rockets = parm6; - self.ammo_cells = parm7; - self.weapon = parm8; - self.armortype = parm9 * 0.01; +{ + self.slot1 = parm1; + self.slot2 = parm2; + self.armor = parm3; + self.protect = parm4; + self.equipment = parm5; + self.chem = parm6; + self.chemcount = 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.current_slot = parm16; - self.islot1 = parm17; - self.islot2 = parm18; - self.islot3 = parm19; - self.islot4 = parm20; - self.islot5 = parm21; - self.islot6 = parm22; - self.islot7 = parm23; - self.islot8 = parm24; - self.islot9 = parm25; - self.islot10= parm26; - self.islot11= parm27; - self.islot12 = parm28; - self.islot13 = parm29; - self.islot14 = parm30; - self.islot15 = parm31; - self.islot16 = parm32; }; /* @@ -190,7 +138,6 @@ entity() FindIntermission = return spot; objerror ("FindIntermission: no spot"); - return world; }; @@ -470,6 +417,63 @@ entity() SelectSpawnPoint = void() DecodeLevelParms; void() PlayerDie; +/* +=========== +ValidateUser + + +============ +*/ +float(entity e) ValidateUser = +{ +/* + local string s; + local string userclan; + local float rank, rankmin, rankmax; + +// +// if the server has set "clan1" and "clan2", then it +// is a clan match that will allow only those two clans in +// + s = serverinfo("clan1"); + if (s) + { + userclan = masterinfo(e,"clan"); + if (s == userclan) + return true; + s = serverinfo("clan2"); + if (s == userclan) + return true; + return false; + } + +// +// if the server has set "rankmin" and/or "rankmax" then +// the users rank must be between those two values +// + s = masterinfo (e, "rank"); + rank = stof (s); + + s = serverinfo("rankmin"); + if (s) + { + rankmin = stof (s); + if (rank < rankmin) + return false; + } + s = serverinfo("rankmax"); + if (s) + { + rankmax = stof (s); + if (rankmax < rank) + return false; + } + + return true; +*/ +}; + + /* =========== PutClientInServer @@ -504,11 +508,15 @@ void() PutClientInServer = self.materialize = 200; DecodeLevelParms (); + + W_SetCurrentAmmo (); self.attack_finished = time; self.th_pain = player_pain; self.th_die = PlayerDie; - + self.current_slot = 1; + WeaponAmmo(1); + WeaponAmmo(2); self.deadflag = DEAD_NO; // paustime is set by teleporters to keep the player from moving a while self.pausetime = 0; @@ -617,7 +625,7 @@ void() PutClientInServer = self.invincible_finished = time + 3; } - W_SetCurrentAmmo(); + }; @@ -1044,49 +1052,46 @@ void() ArmorCheck = local float bit; local float value; - local float aid; - //Armor - aid = ToIID(self.islot3); - if (aid == IID_ARM_SHIRT) + if (self.armor == 1) type = 0.20; - if (aid == IID_ARM_LEATHER) + if (self.armor == 2) type = 0.30; - if (aid == IID_ARM_KEVLAR) + if (self.armor == 3) type = 0.35; - if (aid == IID_ARM_METAL) + if (self.armor == 4) type = 0.35; - if (aid == IID_ARM_COMBAT) + if (self.armor == 5) type = 0.40; - if (aid == IID_ARM_BROTHERHOOD) + if (self.armor == 6) type = 0.45; - if (aid == IID_ARM_FORCE) + if (self.armor == 7) type = 0.10; - if (aid == IID_ARM_LPOWER) + if (self.armor == 8) type = 0.50; - if (aid <= IID_ARM_KEVLAR) + if (self.armor <= 3) self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1); - else if (aid <= IID_ARM_BROTHERHOOD) + else if (self.armor <= 6) self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1); else self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1); - if (aid == 1) + if (self.armor == 1) self.armornoise = "misc/thud.wav"; - if (aid == 2) + if (self.armor == 2) self.armornoise = "misc/thud.wav"; - if (aid == 3) + if (self.armor == 3) self.armornoise = "misc/thud.wav"; - if (aid == 4) + if (self.armor == 4) self.armornoise = "weapons/ric1.wav"; - if (aid == 5) + if (self.armor == 5) self.armornoise = "misc/thud.wav"; - if (aid == 6) + if (self.armor == 6) self.armornoise = "misc/thud.wav"; - if (aid == 7) + if (self.armor == 7) self.armornoise = "misc/laserdef.wav"; - if (aid == 8) + if (self.armor == 8) self.armornoise = "weapons/ric1.wav"; self.armorvalue = type * 100; @@ -1095,26 +1100,10 @@ void() ArmorCheck = void () WeightControl = { - //for each inventory item, add up it's weight. - local float wt; - wt = wt + GetItemsWeight(self.islot1); - wt = wt + GetItemsWeight(self.islot2); - wt = wt + GetItemsWeight(self.islot3); - wt = wt + GetItemsWeight(self.islot4); - wt = wt + GetItemsWeight(self.islot5); - wt = wt + GetItemsWeight(self.islot6); - wt = wt + GetItemsWeight(self.islot7); - wt = wt + GetItemsWeight(self.islot8); - wt = wt + GetItemsWeight(self.islot9); - wt = wt + GetItemsWeight(self.islot10); - wt = wt + GetItemsWeight(self.islot11); - wt = wt + GetItemsWeight(self.islot12); - wt = wt + GetItemsWeight(self.islot13); - wt = wt + GetItemsWeight(self.islot14); - wt = wt + GetItemsWeight(self.islot15); - wt = wt + GetItemsWeight(self.islot16); - self.weight = wt; + GetArmorWeight(); + GetWeaponWeight(self, 1); + GetWeaponWeight(self, 2); if (self.class == 1) self.max_weight = 20; @@ -1536,6 +1525,7 @@ void() PlayerPostThink = if (self.rtime > time) self.weaponframe = 3; + CheckPowerups (); @@ -1676,8 +1666,8 @@ void(entity targ, entity attacker) ClientObituary = bprint (PRINT_MEDIUM, "& "); if (attacker.velocity_z != 0) bprint (PRINT_MEDIUM, "@ "); -// if (attacker.current_slot == 1 && attacker.mag1 == 0) -// bprint (PRINT_MEDIUM, "! "); + if (attacker.current_slot == 1 && attacker.mag1 == 0) + bprint (PRINT_MEDIUM, "! "); bprint (PRINT_MEDIUM, "] "); @@ -1975,30 +1965,43 @@ void(entity targ, entity attacker) ClientObituary = void() Identify = { local string c1, c2, c3, c5, c6, c7; - local float tmp; makevectors (self.v_angle); traceline (self.origin, (self.origin + (v_forward * 2000)), FALSE, self); if (trace_ent.classname == "player" && self.currentmenu == "none" && self.team == trace_ent.team) { if (trace_ent.class == 2) - c1 = "\nmedic\n"; + c1 = "medic\n"; if (trace_ent.class == 3) - c1 = "\nassassin\n"; + c1 = "assassin\n"; if (trace_ent.class == 4) - c1 = "\nsoldier\n"; + c1 = "soldier\n"; if (trace_ent.class == 6) - c1 = "\nscientist\n"; + c1 = "scientist\n"; c2 = ftos (trace_ent.health); - c3 = GetItemName (ToIID(ItemInSlot(trace_ent, trace_ent.current_slot))); + c3 = GetWeaponName (trace_ent, trace_ent.current_slot); - if (trace_ent.islot3 == 0) - c5 = "no armor"; - else - c5 = GetItemName(ToIID(trace_ent.islot3)); + if (trace_ent.armor == 0) + c5 = "\nno armor"; + if (trace_ent.armor == 1) + c5 = "\nlightly armored"; + if (trace_ent.armor == 2) + c5 = "\nleather armor"; + if (trace_ent.armor == 3) + c5 = "\nkevlar armor"; + if (trace_ent.armor == 4) + c5 = "\nmetal armor"; + if (trace_ent.armor == 5) + c5 = "\ncombat armor"; + if (trace_ent.armor == 6) + c5 = "\nbrotherhood armor"; + if (trace_ent.armor == 7) + c5 = "\nforce armor"; + if (trace_ent.armor == 8) + c5 = "\nmetal armor mkii"; - centerprint (self, trace_ent.netname, c1, c2, "\n", c3, "\n", c5); + centerprint7 (self, trace_ent.netname, "\n", c1, c2, "\n", c3, c5); } if (trace_ent.classname == "robowolf" && self.currentmenu == "none") { @@ -2010,12 +2013,12 @@ void() Identify = else c5 = "\nhostile\n"; - centerprint (self, trace_ent.netname, c1, c2, c3, c5, "", ""); + centerprint7 (self, trace_ent.netname, c1, c2, c3, c5, "", ""); } if (trace_ent.classname == "station" && self.currentmenu == "none") { c1 = trace_ent.netname; - if (self.armortype == 0) + if (self.armor == 0) c2 = "uncompleted"; else if (trace_ent.health >= trace_ent.max_health) c2 = "online"; @@ -2028,19 +2031,28 @@ void() Identify = c3 = trace_ent.track.netname; - centerprint (self, c1, "\nstationary bot", "\n", c2, "\n", "owned by ", c3); + centerprint7 (self, c1, "\nstationary bot", "\n", c2, "\n", "owned by ", c3); } if (trace_ent.classname == "monster" && self.currentmenu == "none") { c1 = "hostile"; - - tmp = ToIID(trace_ent.islot3); - if (tmp == 0) - c2 = "natural armor"; - else if (tmp == IID_ARM_SHIRT) + c2 = "natural armor"; + if (trace_ent.armor == 1) c2 = "lightly armored"; - else - c2 = GetItemName(ToIID(trace_ent.islot3)); + if (trace_ent.armor == 2) + c2 = "leather armor"; + if (trace_ent.armor == 3) + c2 = "kevlar armor"; + if (trace_ent.armor == 4) + c2 = "metal armor"; + if (trace_ent.armor == 5) + c2 = "combat armor"; + if (trace_ent.armor == 6) + c2 = "brotherhood armor"; + if (trace_ent.armor == 7) + c2 = "force armor"; + if (trace_ent.armor == 8) + c2 = "metal armor mkii"; if (trace_ent.weapon == 1) c3 = "rifle"; @@ -2053,6 +2065,6 @@ void() Identify = if (trace_ent.weapon >= 5) c3 = "assault rifle"; - centerprint (self, trace_ent.netname, "\n", c1, "\n", c2, "\n", c3); + centerprint7 (self, trace_ent.netname, "\n", c1, "\n", c2, "\n", c3); } }; diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index fac27c58..07b07e98 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -192,11 +192,9 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (save >= targ.armorvalue) { save = targ.armorvalue; -/* targ.armortype = 0; // lost all armor + targ.armortype = 0; // lost all armor targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); -*/ } - take = ceil(damage-save); @@ -264,38 +262,8 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = (targ != attacker)&& inflictor.classname !="door") return; - // do the damage - //different sorts of armour simply subtract different ammounts - switch(ToIID(targ.islot3)) - { - case IID_ARM_SHIRT: - take -= 1; - break; - case IID_ARM_LEATHER: - take -= 2; - 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_BROTHERHOOD: - take -= 6; - break; - case IID_ARM_FORCE: - take -= 7; - break; - case IID_ARM_LPOWER: - take -= 8; - break; - default: - break; - } + take = take - targ.armor; targ.health = targ.health - take; if (targ.health <= 0) diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 3aa49726..536cea97 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -212,14 +212,6 @@ void end_sys_globals; // flag for structure dumping void end_sys_fields; // flag for structure dumping //================================================ - - - - -float parm17, parm18, parm18, parm19, parm20, parm21, parm22, parm23, parm24, parm25, parm26, parm27, parm28, parm29, parm30, parm31, parm32; - - - /* ============================================================================== @@ -234,9 +226,7 @@ float parm17, parm18, parm18, parm19, parm20, parm21, parm22, parm23, // float FALSE = 0; -float false = 0; float TRUE = 1; -float true = 1; // edict.flags float FL_FLY = 1; @@ -477,9 +467,8 @@ float timelimit; float fraglimit; float deathmatch; float coop; -var float rj = 1; +float rj = 1; float no_connect; - //================================================ // @@ -592,6 +581,12 @@ float red_armor; .float attack; .float position; .float recoil; +.float ammo1; +.float ammo2; +.float mag1; +.float mag2; +.float maxmag1; +.float maxmag2; .float critical; .float helmet; .float rtime; @@ -608,15 +603,18 @@ float red_armor; .float grenade_hold; .float grab; .float vehicle; - -.float weight; +.float slot1_weight; +.float slot2_weight; +.float armor_weight; .float max_weight; - .float sneak; .float rescued; .float scale; .float bandages; .float scraps; +.float armor; +.float slot1; +.float slot2; .float cycle1; .float cycle2; .float c4; @@ -624,6 +622,8 @@ float red_armor; .float protect; .float perk; .float equipment; +.float chem; +.float chemcount; .float buildtype; .float ctimer; .float flash; @@ -747,8 +747,8 @@ string(string s) precache_sound = #19; string(string s) precache_model = #20; void(entity client, string s)stuffcmd = #21; entity(vector org, float rad) findradius = #22; -void(float level, string s, ...) bprint = #23; -void(entity client, float level, string s, ...) sprint = #24; +void(float level, string s) bprint = #23; +void(entity client, float level, string s) sprint = #24; void(string s) dprint = #25; string(float f) ftos = #26; string(vector v) vtos = #27; @@ -758,7 +758,7 @@ void() traceoff = #30; void(entity e) eprint = #31; // prints an entire edict float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE // #33 was removed -float() droptofloor= #34; // TRUE if landed on floor +float(float yaw, float dist) droptofloor= #34; // TRUE if landed on floor void(float style, string value) lightstyle = #35; float(float v) rint = #36; // round to nearest int float(float v) floor = #37; // largest integer <= v @@ -802,7 +802,8 @@ void(string s) changelevel = #70; void(string var, string val) cvar_set = #72; // sets cvar.value -void(entity client, string s, ...) centerprint = #73; // sprint, but in middle +void(entity client, string s) centerprint = #73; // sprint, but in middle +void (entity client, string x1, string x2, string x3, string x4, string x5, string x6, string x7) centerprint7 = #73; void(vector pos, string samp, float vol, float atten) ambientsound = #74; @@ -845,6 +846,3 @@ float (entity e, float healamount, float ignore) T_Heal; // health function float(entity targ, entity inflictor) CanDamage; - - - diff --git a/quakec/fallout2/enforcer.qc b/quakec/fallout2/enforcer.qc index 20cdda23..df64f062 100644 --- a/quakec/fallout2/enforcer.qc +++ b/quakec/fallout2/enforcer.qc @@ -6,9 +6,6 @@ SOLDIER / PLAYER ============================================================================== */ -#define mag1 currentammo -#define maxmag1 cnt - $cd id1/models/enforcer $origin 0 -6 24 $base base @@ -54,12 +51,13 @@ void() enforcer_fire = }; -void (float tmp, float dam) enforcer_single = +void (float var, float dam) enforcer_single = { local vector src; local vector dir; local vector direction; local entity en; + local float var; local float r; local vector targ; local vector org; @@ -68,9 +66,10 @@ void (float tmp, float dam) enforcer_single = local float ydif; local float xdif; local float true; + local float zdif; if (self.enemy.sneak == 1) - tmp = tmp * 2; + var = var * 2; if (self.mag1 == 0) { @@ -94,7 +93,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()*var + v_up*crandom()*var, FALSE, self); if (trace_fraction == PLAT_LOW_TRIGGER) return; @@ -375,7 +374,7 @@ void() monster_enforcer = setsize (self, '-12 -12 -24', '12 12 32'); self.health = 100; - self.islot3 = SlotVal(IID_ARM_COMBAT, 1); + self.armor = 5; self.armortype = 0.5; self.helmet = 1; self.th_stand = enf_stand1; @@ -393,6 +392,3 @@ void() monster_enforcer = walkmonster_start(); return; }; - -#undef mag1 -#undef maxmag1 diff --git a/quakec/fallout2/fight.qc b/quakec/fallout2/fight.qc index 7db4be9b..23466f89 100644 --- a/quakec/fallout2/fight.qc +++ b/quakec/fallout2/fight.qc @@ -288,6 +288,7 @@ float() ShamCheckAttack = local vector spot1, spot2; local entity targ; local float chance; + local float enemy_yaw; if (enemy_range == RANGE_MELEE) { diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index acbcf795..feda629d 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -274,67 +274,50 @@ void() item_health = }; -void() health_touch = +void () health_touch = { - local float amount; - local string s; - - if (deathmatch == 4) - if (other.invincible_time > 0) - return; + local float amount; + local string s; - if (other.classname != "player") + if (other.classname != "player" || other.ghost != 0) return; - - if (self.healtype == 2) // Megahealth? Ignore max_health... - { - if (other.health >= 250) - return; - if (!T_Heal(other, self.healamount, 1)) - return; - } - else - { - if (!T_Heal(other, self.healamount, 0)) - return; - } - - sprint(other, PRINT_LOW, "You receive "); - s = ftos(self.healamount); - sprint(other, PRINT_LOW, s); - sprint(other, PRINT_LOW, " health\n"); - -// health touch sound - sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); - stuffcmd (other, "bf\n"); - - self.model = string_null; - self.solid = SOLID_NOT; + if (other.classname == "player") + { + if (self.healtype == H_MEGA) + return; - // Megahealth = rot down the player's super health - if (self.healtype == 2) - { - other.items = other.items | IT_SUPERHEALTH; - if (deathmatch != 4) - { - self.nextthink = time + 5; - self.think = item_megahealth_rot; - } - self.owner = other; + if (other.ghost != 0) + return; + + if (other.chem == 0) + other.chem = 1; + + if (other.chem > 1) + return; + + if (other.equipment == 4 && other.chemcount >= 4) + return; + + if (other.equipment != 4 && other.chemcount >= 2) + return; + + sprint (other, PRINT_HIGH, "picked up a stimpack.\n"); + other.chemcount = other.chemcount + 1; + + 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); + + self.model = string_null; + self.solid = SOLID_NOT; + return; } - else - { - if (deathmatch != 2) // deathmatch 2 is the silly old rules - { - self.nextthink = time + 20; - self.think = SUB_regen; - } - } - + activator = other; - SUB_UseTargets(); // fire all targets / killtargets -}; + SUB_UseTargets (); +}; void() item_megahealth_rot = { diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index fd26a959..6ba82b57 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -176,7 +176,7 @@ void() misc_fireball = self.nextthink = time + (random() * 5); self.think = fire_fly; if (!self.speed) - self.speed = 1000; + self.speed == 1000; }; void() fire_fly = @@ -335,6 +335,8 @@ void() Laser_Touch = void(vector org, vector vec) LaunchLaser = { + local vector vec; + if (self.classname == "monster_enforcer") sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); @@ -589,7 +591,7 @@ void() func_illusionary = self.movetype = MOVETYPE_NONE; self.solid = SOLID_NOT; setmodel (self, self.model); - makestatic (self); + makestatic (); }; /*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4 diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index de15b735..7baced7b 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -76,7 +76,6 @@ void() BuyBandages = void(float cost, float type) BuyChem = { -/* local string x; local float y; @@ -111,7 +110,6 @@ void(float cost, float type) BuyChem = x = GetChemName(); sprint (self, PRINT_HIGH, x); sprint(self, PRINT_HIGH, " purchased.\n"); -*/ }; void(string type) ChangeAmmo = @@ -171,7 +169,6 @@ void() BuyScraps = void (float wt, float cost, float item) BuyWeapon = { -/* local float lbs; local string qq; local float curr; @@ -181,31 +178,29 @@ void (float wt, float cost, float item) BuyWeapon = lbs = weightx (); - if ((self.current_slot == 1)) + if (self.current_slot == 1) { curr = self.slot1_weight; if (self.slot2 == 0) self.slot2 = self.slot1; - if (self.slot2 != 0) + else if (self.slot2 != 0) DropWeapon (self.slot2, 1, 0); GetWeaponModel (); } - if ((self.current_slot == 2)) + if (self.current_slot == 2) { curr = self.slot2_weight; if (self.slot1 == 0) self.slot1 = self.slot2; - if (self.slot1 != 0) - { + else if (self.slot1 != 0) DropWeapon (self.slot1, 1, 0); - self.slot2 = 0; - } GetWeaponModel (); } + if ((lbs + wt - curr) > self.max_weight) { sprint (self, PRINT_HIGH, "you can't carry that much.\n"); @@ -248,7 +243,6 @@ void (float wt, float cost, float item) BuyWeapon = GetWeaponWeight (self, 2); GetWeaponModel (); return; -*/ }; void (float cost, float item) BuyPerk = @@ -267,7 +261,6 @@ void (float cost, float item) BuyPerk = void (float wt, float cost, float item) BuyArmor = { -/* local float curr; local float lbs; local string x; @@ -285,7 +278,7 @@ void (float wt, float cost, float item) BuyArmor = self.currentmenu = "none"; return; } - if ((((lbs + wt) - GetItemsWeight(self.islot3)) > self.max_weight)) + if ((((lbs + wt) - self.armor_weight) > self.max_weight)) { sprint (self, PRINT_HIGH, "you can't carry that much.\n"); self.currentmenu = "none"; @@ -293,14 +286,13 @@ void (float wt, float cost, float item) BuyArmor = } sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); self.ammo_shells = (self.ammo_shells - cost); -// self.armor_weight = wt; + self.armor_weight = wt; self.armor = item; x = GetArmorName(); sprint (self, PRINT_HIGH, x); sprint (self, PRINT_HIGH, " purchased.\n"); return; -*/ }; void (float cost, float item) BuyEquipment = @@ -328,14 +320,12 @@ void (float cost, float item) BuyProtect = { local string x; -/* if ((self.armor >= TE_LIGHTNING2)) { sprint (self, PRINT_HIGH, "too many electronics in\nyour currently worn armor!"); self.currentmenu = "none"; return; } -*/ if ((cost > self.ammo_shells)) { sprint (self, PRINT_HIGH, "not enough money.\n"); @@ -355,20 +345,20 @@ void (float cost, float item) BuyProtect = float (float input) overweight = { - local float tmp; + local float var; local float max; - tmp = input + self.weight; + var = ((((input) + self.armor_weight) + self.slot1_weight) + self.slot2_weight); max = self.max_weight; - if (self.class == TE_LIGHTNING2) + if ((self.class == TE_LIGHTNING2)) { - max = max + SPAWNFLAG_LASER; + max = (max + SPAWNFLAG_LASER); } - if (self.perk == TE_LAVASPLASH) + if ((self.perk == TE_LAVASPLASH)) { return (FALSE); } - if (tmp > max) + if ((var > max)) { return (TRUE); } @@ -378,6 +368,14 @@ float (float input) overweight = } }; +float () weightx = +{ + local float var; + + var = self.slot1_weight + self.slot2_weight + self.armor_weight; + return var; +}; + void () W_GetClass = { if ((self.currentmenu == "select_skill")) @@ -621,13 +619,13 @@ void() W_PlayerMenu = BuyWeapon(5, 25, 17); //weight, cost, item if (self.impulse == 4) BuyWeapon(6, 28, 18); //weight, cost, item - if (self.impulse == 4) + if (self.impulse == 5) BuyWeapon(5, 30, 19); //weight, cost, item - if (self.impulse == 4) + if (self.impulse == 6) BuyWeapon(4, 32, 20); //weight, cost, item - if (self.impulse == 4) + if (self.impulse == 7) BuyWeapon(7, 40, 21); //weight, cost, item - if (self.impulse == 4) + if (self.impulse == 8) BuyWeapon(10, 45, 22); //weight, cost, item return; diff --git a/quakec/fallout2/name.qc b/quakec/fallout2/name.qc index ccc15d2f..4ca0ea2f 100644 --- a/quakec/fallout2/name.qc +++ b/quakec/fallout2/name.qc @@ -1,5 +1,85 @@ +string (entity guy, float slot) GetWeaponName = +{ + local string name; + if (slot == 0) + name = "bare hands"; + if (slot == 1) + name = "knife"; + else if (slot == 2) + name = "axe"; + else if (slot == 3) + name = "ripper"; + else if (slot == 4) + name = "power axe"; + else if (slot == 5) + name = "1911"; + else if (slot == 6) + name = "desert eagle"; + else if (slot == 7) + name = "needler"; + else if (slot == 8) + name = "alien blaster"; + else if (slot == 9) + name = "pipe rifle"; + else if (slot == 10) + name = "winchester"; + else if (slot == 11) + name = "mossberg"; + else if (slot == 12) + name = "citykiller"; + else if (slot == 13) + name = "mp9"; + else if (slot == 14) + name = "grease gun"; + else if (slot == 15) + name = "rangemaster"; + else if (slot == 16) + name = "ak-112"; + else if (slot == 17) + name = "ak-74"; + else if (slot == 18) + name = "dks-1"; + else if (slot == 19) + name = "moonlight"; + else if (slot == 20) + name = "sa-80"; + else if (slot == 21) + name = "gauss rifle"; + else if (slot == 22) + name = "laser carbine"; + return name; +}; + +string () GetArmorName = +{ + local string name; + local float slot; + + slot = self.armor; + + if (slot == 0) + name = "none"; + else if (slot == 1) + name = "bulletproof shirt"; + else if (slot == 2) + name = "leather armor"; + else if (slot == 3) + name = "kevlar armor"; + else if (slot == 4) + name = "metal armor"; + else if (slot == 5) + name = "combat armor"; + else if (slot == 6) + name = "brotherhood armor"; + else if (slot == 7) + name = "force armor"; + else if (slot == 8) + name = "light power armor"; + + return name; +}; string () GetEquipmentName = diff --git a/quakec/fallout2/ogre.qc b/quakec/fallout2/ogre.qc index 6ce4b7a5..54c7f798 100644 --- a/quakec/fallout2/ogre.qc +++ b/quakec/fallout2/ogre.qc @@ -363,7 +363,7 @@ void () ogre_smash11 = [ 57, ogre_smash12 ] void () ogre_smash12 = [ 58, ogre_smash13 ] { - ai_charge (0); + ai_charge (); }; void () ogre_smash13 = [ 59, ogre_smash14 ] diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index e8c40c17..f99fe282 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -57,16 +57,28 @@ void () Footstep = float (entity guy) holding_melee = { - local float iid; - iid = ToIID(ItemInSlot(guy, guy.current_slot)); - - if (iid == IID_NONE || - iid == IID_WP_KNIFE || - iid == IID_WP_AXE || - iid == IID_WP_VIBROBLADE || - iid == IID_WP_POWERAXE) - return true; - return false; + if ((guy.current_slot == WEAPON_SHOTGUN)) + { + if ((guy.slot1 <= TE_WIZSPIKE)) + { + return (TRUE); + } + if ((guy.slot1 >= WEAPON_BIG)) + { + return (FALSE); + } + } + if ((guy.current_slot == WEAPON_ROCKET)) + { + if ((guy.slot2 <= TE_WIZSPIKE)) + { + return (TRUE); + } + if ((guy.slot2 >= WEAPON_BIG)) + { + return (FALSE); + } + } }; void () player_crouch; @@ -196,6 +208,7 @@ void () player_reload1 = [ 123, player_reload2 ] void () player_reload2 = [ 124, player_reload3 ] { + }; void () player_reload3 = [ 125, player_reload4 ] @@ -588,8 +601,6 @@ void () player_pull11 = [ 155, player_run ] void () player_throw1 = [ 155, player_throw2 ] { - self.attack_finished = time + 1; - self.weaponframe = 12; if (((random () * WEAPON_BIG) <= WEAPON_SPIKES)) sound (self, CHAN_VOICE, "radio/grenade.wav", 0.7, ATTN_NORM); @@ -600,63 +611,57 @@ void () player_throw1 = [ 155, player_throw2 ] void () player_throw2 = [ 156, player_throw3 ] { self.weaponframe = TE_LIGHTNINGBLOOD; - FireHandGrenade (); - self.attack_finished = time + 1; + //FireHandGrenade (); }; 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; + if (self.handgrenade <= 0) + stuffcmd (self, "impulse 1\n"); + else + stuffcmd (self, "impulse 3\n"); + }; 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(); }; void () player_shotty1b = [ 183, player_shotty2b ] diff --git a/quakec/fallout2/progs.src b/quakec/fallout2/progs.src index 29b829e9..97ef3028 100644 --- a/quakec/fallout2/progs.src +++ b/quakec/fallout2/progs.src @@ -1,7 +1,6 @@ -../qwprogs.dat +../quake/turn/qwprogs.dat defs.qc -inventory.qc subs.qc fight.qc @@ -32,4 +31,3 @@ dog.qc ogre.qc misc.qc mod_buy.qc -cmds.qc \ No newline at end of file diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index ac0d7fe8..b0114474 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -1,16 +1,13 @@ -#define mag1 currentammo -#define maxmag1 cnt - - void () army_load1; //PISTOL -void (float tmp, float dam) army_fire = +void (float var, float dam) army_fire = { local vector src; local vector dir; local vector direction; local entity en; + local float var; local float r; local vector targ; local vector org; @@ -19,9 +16,10 @@ void (float tmp, float dam) army_fire = local float ydif; local float xdif; local float true; + local float zdif; if (self.enemy.sneak == 1) - tmp = tmp * 2; + var = var * 2; if (self.mag1 == 0) { @@ -48,7 +46,7 @@ void (float tmp, float dam) army_fire = direction = dir; - traceline (src, src + direction*2048 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); + traceline (src, src + direction*2048 + v_right*crandom()*var + v_up*crandom()*var, FALSE, self); if (trace_fraction == PLAT_LOW_TRIGGER) return; @@ -73,12 +71,13 @@ void (float tmp, float dam) army_fire = //RIFLE -void (float tmp, float dam) army_fire1 = +void (float var, float dam) army_fire1 = { local vector src; local vector dir; local vector direction; local entity en; + local float var; local float r; local vector targ; local vector org; @@ -87,9 +86,10 @@ void (float tmp, float dam) army_fire1 = local float ydif; local float xdif; local float true; + local float zdif; if (self.enemy.sneak == 1) - tmp = tmp * 2; + var = var * 2; if (self.mag1 == 0) { @@ -140,12 +140,13 @@ void (float tmp, float dam) army_fire1 = //SHOTGUN -void (float tmp, float dam) army_fire2 = +void (float var, float dam) army_fire2 = { local vector src; local vector dir; local vector direction; local entity en; + local float var; local float r; local vector targ; local vector org; @@ -155,7 +156,7 @@ void (float tmp, float dam) army_fire2 = local float dif; if (self.enemy.sneak == 1) - tmp = tmp * 2; + var = var * 2; if (self.mag1 == 0) { @@ -239,12 +240,13 @@ void (float tmp, float dam) army_fire2 = }; //SMG -void (float tmp, float dam) army_fire3 = +void (float var, float dam) army_fire3 = { local vector src; local vector dir; local vector direction; local entity en; + local float var; local float r; local vector targ; local vector org; @@ -253,6 +255,7 @@ void (float tmp, float dam) army_fire3 = local float ydif; local float xdif; local float true; + local float zdif; if (self.mag1 == 0) { @@ -263,7 +266,7 @@ void (float tmp, float dam) army_fire3 = } if (self.enemy.sneak == 1) - tmp = tmp * 2; + var = var * 2; self.mag1 = self.mag1 - 1; @@ -279,7 +282,7 @@ void (float tmp, float dam) army_fire3 = direction = dir; - traceline (src, src + direction*1024 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); + traceline (src, src + direction*1024 + v_right*crandom()*var + v_up*crandom()*var, FALSE, self); if (trace_fraction == PLAT_LOW_TRIGGER) return; @@ -303,12 +306,13 @@ void (float tmp, float dam) army_fire3 = }; //Assault Rifle -void (float tmp, float dam) army_fire4 = +void (float var, float dam) army_fire4 = { local vector src; local vector dir; local vector direction; local entity en; + local float var; local float r; local vector targ; local vector org; @@ -328,7 +332,7 @@ void (float tmp, float dam) army_fire4 = } if (self.enemy.sneak == 1) - tmp = tmp * 2; + var = var * 2; self.mag1 = self.mag1 - 1; @@ -344,7 +348,7 @@ void (float tmp, float dam) army_fire4 = direction = dir; - traceline (src, src + direction*2048 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); + traceline (src, src + direction*2048 + v_right*crandom()*var + v_up*crandom()*var, FALSE, self); if (trace_fraction == PLAT_LOW_TRIGGER) return; @@ -1328,7 +1332,7 @@ void () monster_army = setsize (self, '-12 -12 -24', '12 12 32'); self.health = 120; - self.islot3 = SlotVal(IID_ARM_COMBAT, 1); + self.armor = 5; self.armortype = 35; self.th_stand = enf_stand1; self.th_walk = enf_walk1; @@ -1370,7 +1374,7 @@ void () monster_army = setsize (self, '-16 -16 -24', '16 16 32'); self.health = 90; self.team = 3; - self.islot3 = SlotVal(IID_ARM_LEATHER, 1); + self.armor = 2; self.armortype = 0.2; self.armornoise = "misc/thud.wav"; self.th_stand = army_stand1; @@ -1404,5 +1408,3 @@ void () monster_army = self.maxmag1 = self.mag1; }; -#undef mag1 -#undef maxmag1 diff --git a/quakec/fallout2/subs.qc b/quakec/fallout2/subs.qc index 0f0fd3a7..3346c0dc 100644 --- a/quakec/fallout2/subs.qc +++ b/quakec/fallout2/subs.qc @@ -15,7 +15,7 @@ void(float normal) SUB_AttackFinished = QuakeEd only writes a single float for angles (bad idea), so up and down are just constant angles. */ -void() SetMovedir = +vector() SetMovedir = { if (self.angles == '0 -1 0') self.movedir = '0 0 1'; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 210a782e..594be686 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -16,16 +16,18 @@ void () BuyMenu; void() Sneak; void() Bandage; void() Shield; -void () player_throw1; void() player_knife1; void() player_knifea; void() ExitScreen; void() CharacterSheet; void() UseEquipment; -void (float slot, float snd, float drop) DropFromSlot; +void (float weap, float snd, float drop) DropWeapon; void() PositionControl; +void() autofire; +void() autofire_s; -#define weightx() (self.weight) +float () weightx; +void (entity guy, float slot) GetWeaponWeight; // called by worldspawn @@ -45,8 +47,6 @@ void() W_Precache = precache_sound ("weapons/grenade.wav"); // grenade launcher precache_sound ("weapons/bounce.wav"); // grenade bounce precache_sound ("weapons/shotgn2.wav"); // super shotgun - - precache_model ("progs/v_handgren.mdl"); }; float() crandom = @@ -115,6 +115,7 @@ SpawnMeatSpray void(vector org, vector vel) SpawnMeatSpray = { local entity missile; + local vector org; missile = spawn (); missile.owner = self; @@ -812,11 +813,8 @@ PLAYER WEAPON USE =============================================================================== */ -void() SetWeaponModel = +void(float temp_weapon) GetWeaponModel = { - self.weaponmodel = GetItemVModel(ToIID(ItemInSlot(self, self.current_slot))); - -/* if (temp_weapon == 0) self.weaponmodel = "progs/v_fist.mdl"; else if (temp_weapon == 1) @@ -846,7 +844,7 @@ void() SetWeaponModel = else if (temp_weapon == 13) self.weaponmodel = "progs/v_mp9.mdl"; else if (temp_weapon == 14) - self.weaponmodel = "progs/v_mp5.mdl"; + self.weaponmodel = "progs/v_smg.mdl"; else if (temp_weapon == 15) self.weaponmodel = "progs/v_rangem.mdl"; else if (temp_weapon == 16) @@ -859,7 +857,6 @@ void() SetWeaponModel = self.weaponmodel = "progs/v_night.mdl"; else if (temp_weapon == 99) self.weaponmodel = "progs/v_handgren.mdl"; -*/ }; void() W_SetCurrentAmmo = @@ -872,11 +869,10 @@ void() W_SetCurrentAmmo = self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) ); -/*SPIKEREMOVED if (self.current_slot == 1) - self.currentammo = ToStatus(self.islot1); + self.currentammo = self.mag1; else if (self.current_slot == 2) - self.currentammo = ToStatus(self.islot2); + self.currentammo = self.mag2; else if (self.current_slot == 3 && self.handgrenade > 0) self.currentammo = self.handgrenade; else if (self.current_slot == 4) @@ -891,27 +887,32 @@ void() W_SetCurrentAmmo = else sound (self, CHAN_WEAPON, "misc/menu3.wav", 1, ATTN_NORM); } -*/ -// else + else sound (self, CHAN_WEAPON, "misc/menu3.wav", 1, ATTN_NORM); if (self.current_slot == 1) - x = GetItemName(ToIID(self.islot1)); + x = GetWeaponName(self, self.slot1); if (self.current_slot == 2) - x = GetItemName(ToIID(self.islot2)); -/*SPIKEREMOVED + x = GetWeaponName(self, self.slot2); if (self.current_slot == 3) x = "grenade"; if (self.current_slot == 4) x = "tools"; -*/ sprint(self, 2, x); sprint (self, PRINT_HIGH, " selected.\n"); sound (self, CHAN_WEAPON, "misc/weapon.wav", 1, ATTN_NORM); - SetWeaponModel(); + if (self.current_slot == 1) + GetWeaponModel(self.slot1); + if (self.current_slot == 2) + GetWeaponModel(self.slot2); + if (self.current_slot == 3) + GetWeaponModel(99); - self.currentammo = ToStatus(ItemInSlot(self, self.current_slot)); + if (self.current_slot == 1) + self.currentammo = self.mag1; + if (self.current_slot == 2) + self.currentammo = self.mag2; }; float() W_BestWeapon = @@ -942,102 +943,116 @@ float() W_BestWeapon = return IT_AXE; }; -void (float slotno) ReloadWeapon = +void () ReloadWeapon = { - local float at; - local float as; - local float asv; - local float ac; local float x; - local float wid; - local .float wslot; - - if (self.rtime > time || self.attack_finished > time) + if (self.current_slot != 1 && self.current_slot != 2) return; - wslot = SlotField(slotno); + if (self.rtime > time) + return; - if (self.wslot == 0) - return; //already empty.. - - wid = ToIID(self.wslot); - at = WeaponAmmoType(wid); - as = SlotOfItem(self, at); - if (as == 0) + if (self.current_slot == 1) { - sprint(self, 2, "no suitable ammo\n"); - return; - } - asv = ItemInSlot(self, as); - ac = ToStatus(asv); + if (self.ammo1 <= 0) + return; + if (self.maxmag1 == self.mag1) + return; + if (self.slot1 <= 4) + return; - x = WeaponMagQuant(wid); //get the max ammo capacity - x = x - ToStatus(self.wslot); //take away the ammo currently in the weapon - if (x > ac) //make sure there's enough ammo - x = ac; - ac -= x; - - if (ac) - asv = SlotVal(at, ac); - else - asv = 0; //totally used up. - - SetItemSlot(self, as, asv); - - self.wslot = SlotVal(wid, x + ToStatus(self.wslot)); - - if (wid == IID_WP_PIPERIFLE || wid == IID_WP_WINCHESTER || wid == IID_WP_MOSSBERG) - sound (self, CHAN_WEAPON, "weapons/shell.wav", TRUE, ATTN_NORM); - else + if (self.slot1 >= 9 && self.slot1 <= 11) + { + sound (self, CHAN_WEAPON, "weapons/shell.wav", TRUE, ATTN_NORM); + self.mag1 = self.mag1 + 1; + self.ammo1 = self.ammo1 - 1; + self.currentammo = self.mag1; + self.rtime = time + 0.5; + player_run(); + return; + } sound (self, CHAN_WEAPON, "weapons/reload.wav", TRUE, ATTN_NORM); - sprint(self, 2, "reloading...\n"); + sprint(self, 2, "reloading...\n"); - if (self.perk == 3) - { - self.attack_finished = time + 1; - self.rtime = time + 1; - } - else - { - self.attack_finished = time + 2; + x = (self.maxmag1 - self.mag1); + self.mag1 = self.mag1 + x; + self.ammo1 = self.ammo1 - x; + self.currentammo = self.mag1; self.rtime = time + 2; + player_run(); + return; } + if (self.current_slot == 2) + { + if (self.ammo2 <= 0) + return; + if (self.maxmag2 == self.mag2) + return; + if (self.slot2 <= 4) + return; - if (self.current_slot == slotno) - self.currentammo = ToStatus(ItemInSlot(self, slotno)); + if (self.slot2 >= 9 && self.slot2 <= 11) + { + sound (self, CHAN_WEAPON, "weapons/shell.wav", TRUE, ATTN_NORM); + self.mag2 = self.mag2 + 1; + self.ammo2 = self.ammo2 - 1; + self.currentammo = self.mag2; + self.rtime = time + 0.5; + player_run(); + return; + } + sound (self, CHAN_WEAPON, "weapons/reload.wav", TRUE, ATTN_NORM); + sprint(self, 2, "reloading...\n"); - player_run(); + x = (self.maxmag2 - self.mag2); + self.mag2 = self.mag2 + x; + self.ammo2 = self.ammo2 - x; + self.currentammo = self.mag2; + self.rtime = time + 2; + player_run(); + return; + } }; float() W_CheckNoAmmo = { - local float at; - local .float slotfield; - slotfield = SlotField(self.current_slot); - - if (ToIID(self.slotfield) == IID_NONE) - return FALSE; - - if (ToStatus(self.slotfield) < 1) + if (self.current_slot == 1) { - at = WeaponAmmoType(ToIID(self.slotfield)); - if (at == 0) + if (self.slot1 <= 4) return FALSE; - at = SlotOfItem(self, at); - if (at == 0) + if (self.mag1 < 1 && self.ammo1 < 1) { self.attack_finished = (time + 0.2); stuffcmd (self, "-attack\n"); sound (self, CHAN_WEAPON, "weapons/click.wav", TRUE, ATTN_NORM); return TRUE; } - else + if (self.mag1 <= 0) { stuffcmd (self, "-attack\n"); - ReloadWeapon (self.current_slot); + ReloadWeapon (); + return TRUE; + } + } + if (self.current_slot == 2) + { + if (self.slot2 <= 4) + return FALSE; + + if (self.mag2 < 2 && self.ammo2 < 2) + { + self.attack_finished = (time + 0.2); + stuffcmd (self, "-attack\n"); + sound (self, CHAN_WEAPON, "weapons/click.wav", TRUE, ATTN_NORM); + return TRUE; + } + if (self.mag2 <= 0) + { + stuffcmd (self, "-attack\n"); + ReloadWeapon (); return TRUE; } } @@ -1060,68 +1075,52 @@ void() W_Attack = makevectors (self.v_angle); // calculate forward angle for velocity self.show_hostile = time + 1; // wake monsters up - if (self.rtime > time) - return; + if (self.current_slot == 1) + weap = self.slot1; + if (self.current_slot == 2) + weap = self.slot2; if (W_CheckNoAmmo()) return; - weap = ToIID(self.(SlotField(self.current_slot))); + if (self.rtime > time) + return; - if (weap == IID_NONE || - weap == IID_WP_KNIFE || - weap == IID_WP_AXE || - weap == IID_WP_VIBROBLADE || - weap == IID_WP_POWERAXE) + if (weap >= 0 && weap <= 4) { self.attack_finished = time + 0.25; player_knife1 (); } - else if (weap == IID_WP_USP) + else if (weap == 5) FirePistol(10, 2, "weapons/1911.wav", 2000, 0.25); - else if (weap == IID_WP_DEAGLE) + else if (weap == 6) FirePistol(10, 2, "weapons/deagle.wav", 2000, 0.25); - else if (weap == IID_WP_NEEDLER) + else if (weap == 7) FirePistol(10, 2, "weapons/needler.wav", 2000, 0.25); - //if (weap == IID_WP_ALIENBLASTER) + //if (weap == 8) // FireAlienBlaster(); - else if (weap == IID_WP_PIPERIFLE) + else if (weap == 9) FireAssaultRifle(18, 2, "weapons/rangem.wav", 3000, 0.1); - else if (weap == IID_WP_WINCHESTER) + else if (weap == 10) W_FireShotgun (1, 5, 6, 160, 3000, 0); - else if (weap == IID_WP_MOSSBERG) + else if (weap == 11) W_FireShotgun (1, 5, 6, 160, 3000, 0); - else if (weap == IID_WP_JACKHAMMER) + else if (weap == 12) W_FireShotgun (1, 5, 6, 160, 3000, 1); - else if (weap == IID_WP_MP9) + else if (weap == 13) FireSMG(12, 2, "weapons/mp9.wav", 2000, 0.1); - else if (weap == IID_WP_MP7) + else if (weap == 14) FireSMG(12, 2, "weapons/mp7.wav", 2000, 0.1); - else if (weap == IID_WP_RANGERMASTER) + else if (weap == 15) FireAssaultRifle(14, 2, "weapons/rangem.wav", 4000, 0.5); - else if (weap == IID_WP_AK112) + else if (weap == 16) FireAssaultRifle(14, 2, "weapons/rangem.wav", 4000, 0.1); - else if (weap == IID_WP_AK74) + else if (weap == 17) FireAssaultRifle(18, 2, "weapons/ak47.wav", 6000, 0.1); - else if (weap == IID_WP_DKS1) + else if (weap == 18) FireAssaultRifle(30, 2, "weapons/dks-1.wav", 8000, 0.5); - else if (weap == IID_WP_MOONLIGHT) + else if (weap == 19) FireAssaultRifle(16, 2, "weapons/m4a1.wav", 4000, 0.1); - - else if (weap == IID_GREN_FRAG) - player_throw1(); - else if (weap == IID_GREN_EMP) - player_throw1(); - else if (weap == IID_GREN_SMOKE) - player_throw1(); - else if (weap == IID_GREN_FLASH) - player_throw1(); - -//float IID_WP_SA80 = 420; -//float IID_WP_GAUSERIFLE = 421; -//float IID_WP_PULSERIFLE = 422; - else - centerprint(self, "Not implemented (", ftos(weap), ")"); }; /* @@ -1170,7 +1169,28 @@ CheatCommand */ void() CheatCommand = { +// if (deathmatch || coop) + return; + self.ammo_rockets = 100; + self.ammo_nails = 200; + self.ammo_shells = 100; + self.items = self.items | + IT_AXE | + IT_SHOTGUN | + IT_SUPER_SHOTGUN | + IT_NAILGUN | + IT_SUPER_NAILGUN | + IT_GRENADE_LAUNCHER | + IT_ROCKET_LAUNCHER | + IT_KEY1 | IT_KEY2; + + self.ammo_cells = 200; + self.items = self.items | IT_LIGHTNING; + + self.weapon = IT_ROCKET_LAUNCHER; + self.impulse = 0; + W_SetCurrentAmmo (); }; /* @@ -1419,9 +1439,9 @@ void() ImpulseCommands = ProneOn (); if (self.impulse == 50) - ReloadWeapon (self.current_slot); -// if (self.impulse == 51) -// UseChem (); + ReloadWeapon (); + if (self.impulse == 51) + UseChem (); if (self.impulse == 52) BuyMenu (); if (self.impulse == 53) @@ -1429,7 +1449,12 @@ void() ImpulseCommands = if (self.impulse == 54) ExitScreen (); if (self.impulse == 55) - DropFromSlot (self.current_slot, 1, 0); + { + if (self.current_slot == 1) + DropWeapon (self.slot1, 1, 0); + else + DropWeapon (self.slot2, 1, 0); + } if (self.impulse == 56) CharacterSheet (); if (self.impulse == 57) @@ -1483,14 +1508,21 @@ void() SuperDamageSound = void () DropAmmo = { - local .float wslot; - wslot = SlotField(self.current_slot); - - self.wslot = SlotVal(ToIID(self.wslot), ToStatus(self.wslot)-1); - self.currentammo = ToStatus(self.wslot); + if (self.current_slot == 1) + { + self.currentammo = (self.mag1 - 1); + self.mag1 = (self.mag1 - 1); + self.ammo_nails = self.ammo1; + } + if (self.current_slot == 2) + { + self.currentammo = (self.mag2 - 1); + self.mag2 = (self.mag2 - 1); + self.ammo_nails = self.ammo2; + } }; -void() muzzleflash = +void()muzzleflash = { WriteByte (MSG_MULTICAST, SVC_MUZZLEFLASH); WriteEntity (MSG_MULTICAST, self); @@ -1506,9 +1538,9 @@ void () autofire = if (self.weaponframe == 1) - self.weaponframe = 2; + self.weaponframe == 2; else if (self.weaponframe == 2) - self.weaponframe = 1; + self.weaponframe == 1; muzzleflash (); }; @@ -1521,9 +1553,9 @@ void () autofire_s = self.frame = 88; if (self.weaponframe == 1) - self.weaponframe = 2; + self.weaponframe == 2; else if (self.weaponframe == 2) - self.weaponframe = 1; + self.weaponframe == 1; muzzleflash (); }; @@ -1591,6 +1623,7 @@ void (vector test, float length, float dam) penetrate = local float zdif; local float ydif; local float xdif; + local float true; local float go; local float tl; @@ -1815,7 +1848,6 @@ void () FlashExplode = remove (self); }; -/* void () HandGrenExplode = { if ((self.cnt == 0)) @@ -1852,7 +1884,6 @@ void () HandGrenExplode = } } }; -*/ void () HandGrenBounce = { @@ -1882,23 +1913,17 @@ void () HandGrenBounce = void () FireHandGrenade = { - local float item, iid; - local float count; + local float type; - item = ItemInSlot(self, self.current_slot); - iid = ToIID(item); - count = ToStatus(item); - if (iid == 0) + if (self.handgrenade <= 0) return; - - self.currentammo = count-1; - if (count <= 1) - SetItemSlot(self, self.current_slot, 0); - else - SetItemSlot(self, self.current_slot, SlotVal(iid, self.currentammo)); - + + type = self.grenadetype; + self.handgrenade = self.handgrenade - 1; + self.grenadetype = 0; + self.currentammo = 0; msg_entity = self; WriteByte (MSG_ONE, SVC_SMALLKICK); @@ -1920,13 +1945,13 @@ void () FireHandGrenade = newmis.touch = HandGrenBounce; newmis.nextthink = (time + 2.5); - if (iid == IID_GREN_FRAG) + if (type == 1) newmis.think = FragExplode; - else if (iid == IID_GREN_EMP) + if (type == 2) newmis.think = EMPExplode; - else if (iid == IID_GREN_SMOKE) + if (type == 3) newmis.think = SmokeThink; - else //if (iid == IID_GREN_FLASH) + if (type == 4) newmis.think = FlashExplode; newmis.frame = 1; @@ -1939,31 +1964,28 @@ void () FireHandGrenade = void(float slot, float magazine) GiveAmmo = { - local float wi; - local float wt; - local float at; - local float as; - - //give ammo to the weapon in a slot - wi = ItemInSlot(self, slot); - wt = ToIID(wi); - SetItemSlot(self, slot, SlotVal(wt, magazine)); - - at = WeaponAmmoType(wt); - //make sure we have enough ammo - as = SlotOfItem(self, at); - if (as == 0) - as = SlotOfItem(self, IID_NONE); - if (as == 0) - return; //no free slots, so we can't give them ammo - if (ToStatus(ItemInSlot(self, as)) < magazine*4) - SetItemSlot(self, as, SlotVal(at, magazine*4)); + if (slot == 1) + { + self.maxmag1 = magazine; + self.ammo1 = magazine * 4; + self.mag1 = magazine; + if (self.ammo1 < 30) + self.ammo1 = 30; + } + if (slot == 2) + { + self.maxmag2 = magazine; + self.ammo2 = magazine * 4; + self.mag2 = magazine; + if (self.ammo2 < 30) + self.ammo2 = 30; + } }; void (float dam, float rec, string snd, float rng, float rate) FirePistol = { - local float tmp, var1, var2, zdif, xdif, ydif, tru; + local float var, var1, var2, zdif, xdif, ydif, true; local vector dir, source, targ, org, org2, adjust; local string x; @@ -2010,25 +2032,25 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol = player_single1 (); } - tmp = 50; + var = 50; if (self.velocity != '0 0 0') - tmp = 400; + var = 400; - tmp = tmp + (40 * self.recoil); + var = var + (40 * self.recoil); if (self.attack <= 3 && self.position == 1 && self.velocity_z == 0) - tmp = (tmp * 0.75); + var = (var * 0.75); if (self.attack <= 3 && self.position == 2 && self.velocity_z == 0) - tmp = (tmp * 0.5); + var = (var * 0.5); self.attack = self.attack + 1; 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; + targ = self.origin + '0 0 22' + v_right*crandom()* var + v_up*crandom()*var; traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); if (trace_fraction == 1) @@ -2042,13 +2064,13 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol = zdif = org_z - trace_ent.origin_z; ydif = org2_y - trace_ent.origin_y; xdif = org2_x - trace_ent.origin_x; - tru = 0; + true = 0; if (((ydif >= CONTENT_SKY) && (ydif <= TE_LIGHTNING2))) - tru = 1; + true = 1; if (((xdif >= CONTENT_SKY) && (xdif <= TE_LIGHTNING2))) - tru = 1; - if (self.attack <= 5 && tru == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) + true = 1; + if (self.attack <= 5 && true == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) self.critical = 3; dam = (dam * (1 - trace_fraction)); @@ -2074,7 +2096,7 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol = void (float dam, float rec, string snd, float rng, float rate) FireSMG = { - local float tmp, var1, var2, zdif, xdif, ydif, tru; + local float var, var1, var2, zdif, xdif, ydif, true; local vector dir, source, targ, org, org2, adjust; local string x; @@ -2084,9 +2106,9 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG = if (self.attack == 0 && self.position == POS_STAND) - player_single1 (); + autofire (); if (self.attack == 0 && self.position >= POS_DUCK) - player_single1_s (); + autofire_s (); if (self.position == 0) adjust = '0 0 0'; @@ -2120,25 +2142,25 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG = player_single1 (); } - tmp = 200; + var = 200; if (self.velocity != '0 0 0') - tmp = 200; + var = 200; - tmp = tmp + (40 * self.recoil); + var = var + (40 * self.recoil); if (self.attack <= 3 && self.position == 1 && self.velocity_z == 0) - tmp = (tmp * 0.75); + var = (var * 0.75); if (self.attack <= 3 && self.position == 2 && self.velocity_z == 0) - tmp = (tmp * 0.5); + var = (var * 0.5); self.attack = self.attack + 1; self.recoil = self.recoil + 3; 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()* var + v_up*crandom()*var; traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); if (trace_fraction == 1) @@ -2152,12 +2174,12 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG = zdif = org_z - trace_ent.origin_z; ydif = org2_y - trace_ent.origin_y; xdif = org2_x - trace_ent.origin_x; - tru = 0; + true = 0; if (((ydif >= CONTENT_SKY) && (ydif <= TE_LIGHTNING2))) - tru = 1; + true = 1; if (((xdif >= CONTENT_SKY) && (xdif <= TE_LIGHTNING2))) - tru = 1; - if (self.attack <= 5 && tru == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) + true = 1; + if (self.attack <= 5 && true == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) self.critical = 3; dam = (dam * (1 - trace_fraction)); @@ -2183,8 +2205,7 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG = void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle = { - local float tmp, var1, var2, zdif, xdif, ydif, tru, z; - + local float var, var1, var2, zdif, xdif, ydif, true, z; local vector dir, source, targ, org, org2, adjust; local string x; @@ -2232,7 +2253,7 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle player_single1 (); } - tmp = 50; + var = 50; if (self.velocity_y < 0) z = z + (self.velocity_y*-1); @@ -2244,21 +2265,21 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle else if (self.velocity_x > 0) z = z + (self.velocity_x); - tmp = tmp + z; - tmp = tmp + (40 * self.recoil); + var = var + z; + var = var + (40 * self.recoil); if (self.attack <= 3 && self.position == 1 && self.velocity_z == 0) - tmp = (tmp * 0.75); + var = (var * 0.75); if (self.attack <= 3 && self.position == 2 && self.velocity_z == 0) - tmp = (tmp * 0.5); + var = (var * 0.5); self.attack = self.attack + 1; self.recoil = self.recoil + 5; 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()* var + v_up*crandom()*var; traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); if (trace_fraction == 1) @@ -2272,13 +2293,12 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle zdif = org_z - trace_ent.origin_z; ydif = org2_y - trace_ent.origin_y; xdif = org2_x - trace_ent.origin_x; - - tru = 0; + true = 0; if (ydif >= -6 && ydif <= 6) - tru = 1; + true = 1; if (xdif >= -6 && xdif <= 6) - tru = 1; - if (self.attack <= 5 && tru == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) + true = 1; + if (self.attack <= 5 && true == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) self.critical = 3; dam = (dam * (1 - trace_fraction)); @@ -2406,35 +2426,54 @@ void () WeaponTouch = return; } - if (ItemInSlot(other, other.current_slot) != 0) + if (((other.current_slot == 1) && (other.slot1 != 0))) return; - sound (other, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + if (((other.current_slot == 2) && (other.slot2 != 0))) + return; - SetItemSlot(other, other.current_slot, self.islot1); - remove (self); - - self = other; - SetWeaponModel (); + sound (other, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); if ((other.current_slot == 1)) - stuffcmd (self, "impulse 1\n"); + { + GetWeaponWeight (other, self.cnt); + other.slot1 = self.cnt; + stuffcmd (other, "impulse 1\n"); + other.ammo1 = self.slot1; + other.maxmag1 = self.slot2; + other.mag1 = self.class; + GetWeaponModel (self.slot1); + remove (self); + } if ((other.current_slot == 2)) - stuffcmd (self, "impulse 2\n"); + { + GetWeaponWeight (other, self.cnt); + other.slot2 = self.cnt; + stuffcmd (other, "impulse 2\n"); + other.ammo2 = self.slot1; + other.maxmag2 = self.slot2; + other.mag2 = self.class; + GetWeaponModel (self.slot2); + remove (self); + } }; -void (float slotnum, float snd, float force) DropFromSlot = +void (float weap, float snd, float drop) DropWeapon = { - local float weap; local string mdel; - if (self.attack_finished > time && !force) + if (self.attack_finished > time && drop == 0) return; - if (slotnum == 0) + if (self.current_slot == 3 && self.handgrenade == 0) + return; + + if (self.current_slot == 4 && self.c4 == 0) + return; + + if (weap == 0) return; - weap = ItemInSlot(self, slotnum); if (snd == 1) sound (self, CHAN_WEAPON, "weapons/lock4.wav", 1, ATTN_NORM); @@ -2501,6 +2540,9 @@ void (float slotnum, float snd, float force) DropFromSlot = if (self.current_slot == 3) mdel = "progs/grenade2.mdl"; + if (self.current_slot == 4 && self.c4 == 1) + mdel = "progs/c4.mdl"; + setmodel (newmis, mdel); setsize (newmis, '-2 -2 0', '2 2 1'); makevectors (self.v_angle); @@ -2511,26 +2553,180 @@ void (float slotnum, float snd, float force) DropFromSlot = newmis.nextthink = (time + 180); newmis.think = SUB_Remove; newmis.touch = WeaponTouch; + newmis.cnt = weap; + if (self.current_slot == 1) + { + self.attack_finished = time; + self.slot1_weight = 0; + self.slot1 = 0; + newmis.slot1 = self.ammo1; + newmis.slot2 = self.maxmag1; + newmis.class = self.mag1; + self.mag1 = 0; + self.maxmag1 = 0; + GetWeaponModel (); + stuffcmd(self, "impulse 1\n"); + } + if (self.current_slot == 2) + { + self.attack_finished = time; + self.slot2_weight = 0; + self.slot2 = 0; + newmis.slot1 = self.ammo2; + newmis.slot2 = self.maxmag2; + newmis.class = self.mag2; + self.mag2 = 0; + self.maxmag2 = 0; + GetWeaponModel (); + stuffcmd(self, "impulse 2\n"); + } + if (self.current_slot == 3) + { + self.attack_finished = time; + newmis.handgrenade = self.handgrenade; + newmis.grenadetype = self.grenadetype; - newmis.islot1 = weap; - - SetItemSlot(self, slotnum, 0); - - if (self.attack_finished < time+0.6) - self.attack_finished = time+0.6; - - if (self.current_slot == slotnum) - SetWeaponModel (); + stuffcmd(self, "impulse 1\n"); + } }; +void () GetArmorWeight = +{ + local float wt; + + if (self.armor == 0) + wt = 0; + if (self.armor == 1) + wt = 3; + if (self.armor == 2) + wt = 5; + if (self.armor == 3) + wt = 9; + if (self.armor == 4) + wt = 15; + if (self.armor == 5) + wt = 12; + if (self.armor == 6) + wt = 17; + if (self.armor == 7) + wt = 6; + if (self.armor == 8) + wt = 20; + + self.armor_weight = wt; +}; + +void (entity guy, float slot) GetWeaponWeight = +{ + local float wt; + + if (slot == 1) + wt = 1; + else if (slot == 2) + wt = 2; + else if (slot == 3) + wt = 8; + else if (slot == 4) + wt = 6; + else if (slot == 5) + wt = 1; + else if (slot == 6) + wt = 2; + else if (slot == 7) + wt = 2; + else if (slot == 8) + wt = 2; + else if (slot == 9) + wt = 3; + else if (slot == 10) + wt = 4; + else if (slot == 11) + wt = 5; + else if (slot == 12) + wt = 6; + else if (slot == 13) + wt = 3; + else if (slot == 14) + wt = 3; + else if (slot == 15) + wt = 5; + else if (slot == 16) + wt = 5; + else if (slot == 17) + wt = 5; + else if (slot == 18) + wt = 7; + else if (slot == 19) + wt = 5; + else if (slot == 20) + wt = 5; + else if (slot == 21) + wt = 9; + else if (slot == 22) + wt = 10; + else if (slot == 23) + wt = 1; + + if (self.current_slot == 1) + self.slot1_weight = wt; + if (self.current_slot == 2) + self.slot2_weight = wt; +}; + + + void (float slot) WeaponAmmo = { local float weap, amount; - weap = ToIID(ItemInSlot(self, slot)); + if (slot == 1) + weap = self.slot1; + if (slot == 2) + weap = self.slot2; - amount = WeaponMagQuant(weap); - GiveAmmo (slot, amount); + if (weap <= 4) + amount = 0; + else if (weap == 5) + amount = 12; + else if (weap == 6) + amount = 7; + else if (weap == 7) + amount = 15; + else if (weap == 8) + amount = 6; + else if (weap == 9) + amount = 1; + else if (weap == 10) + amount = 2; + else if (weap == 11) + amount = 6; + else if (weap == 12) + amount = 10; + else if (weap == 13) + amount = 30; + else if (weap == 14) + amount = 30; + else if (weap == 15) + amount = 10; + else if (weap == 16) + amount = 24; + else if (weap == 17) + amount = 30; + else if (weap == 18) + amount = 8; + else if (weap == 19) + amount = 30; + else if (weap == 20) + amount = 30; + else if (weap == 21) + amount = 10; + else if (weap == 22) + amount = 40; + + if (slot == 1) + GiveAmmo (1, amount); + if (slot == 2) + GiveAmmo (2, amount); }; void() Crosshair = @@ -2558,6 +2754,23 @@ void() Crosshair = stuffcmd(self, "\n"); }; + +string () GetChemName = +{ + if (self.chem == 1) + return "stimpack"; + if (self.chem == 2) + return "medical bag"; + if (self.chem == 3) + return "superstim"; + if (self.chem == 4) + return "adrenaline"; + if (self.chem == 5) + return "psycho"; + if (self.chem == 6) + return "berserk"; +}; + void (entity healer, entity saved) RevivePlayer = { local entity oself; @@ -2583,123 +2796,121 @@ void (entity healer, entity saved) RevivePlayer = saved.view2 = world; }; -float(float iid) UseBoostingChem = +void(float type) UseBoostingChem = { local vector source; local vector org; local string x; - local float duration; + + x = GetChemName(); if (self.attack_finished > time) - return false; - - x = GetItemName (iid); - if (iid == IID_CHEM_ADRENALINE) - duration = 30+random()*30; - else if (iid == IID_CHEM_PSYCHO) - duration = 30+random()*30; - else if (iid == IID_CHEM_BESERK) - duration = 30+random()*30; - else - { - sprint (self, PRINT_HIGH, "Not a boosting chem\n"); - return false; - } + return; self.attack_finished = time + 1; makevectors (self.v_angle); source = self.origin + '0 0 0'; traceline (source, source + v_forward*64, FALSE, self); + if (trace_fraction == 1.0) + { + if (self.health < self.max_health && self.rage == 0) + { + sound (self, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); + self.rage = type; + self.ragetime = (20+type)+random()*30; + return; + } + } if (trace_ent.classname == "player" && trace_ent.team == self.team) { if (trace_ent.health <= 0) - return false; + return; if (trace_ent.rage >= 1) { sprint (self, 2, trace_ent.netname); sprint (self, PRINT_HIGH, " is already affected.\n"); - return false; + return; } sprint (trace_ent, 2, self.netname); 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); - trace_ent.rage = iid; - trace_ent.ragetime = duration; - return true; + trace_ent.rage = type; + trace_ent.ragetime = (20+type)+random()*30; } - if (trace_fraction == 1.0) - { - if (self.health < self.max_health && self.rage == 0) - { - sound (self, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); - self.rage = iid; - self.ragetime = duration; - return true; - } - } - return false; }; -float(float iid) UseHealingChem = +void(float type) UseHealingChem = { local vector source; local vector org; local float heal; local string x; + x = GetChemName(); + if (type == 1) + x = "bandage"; if (self.attack_finished > time) - return false; + return; - x = GetItemName (iid); - if (iid == IID_CHEM_STIMPACK) - heal = 2*5; - else if (iid == IID_CHEM_MEDICALBAG) - { - heal = 3*5; - x = "bandage"; - } - else if (iid == IID_CHEM_SUPERSTIM) - heal = 4*5; - else - { - sprint (self, PRINT_HIGH, "Not a healing chem\n"); - return false; - } - + heal = type*5; self.attack_finished = time + 1; makevectors (self.v_angle); source = self.origin + '0 0 0'; traceline (source, source + v_forward*64, FALSE, self); + if (trace_fraction == 1.0) + { + if (self.health >= self.max_health) + { + sprint(self, 2, "you aren't injured.\n"); + return; + } + if (self.regen >= 1) + { + sprint (self, PRINT_HIGH, "you are already healing.\n"); + return; + } + if (self.health < self.max_health && self.regen == 0) + { + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + self.health = self.health + heal; + self.regen = heal; + sprint (self, PRINT_HIGH, "used a "); + sprint (self, PRINT_HIGH, x); + sprint (self, PRINT_HIGH, " to heal yourself.\n"); + self.chemcount = self.chemcount - 1; + return; + } + } if (trace_ent.classname == "player" && trace_ent.team == self.team) { if (trace_ent.health <= 0 && coop == 1) { RevivePlayer(self, trace_ent); - return false; + return; } if (trace_ent.health <= 0 && coop == 0) - return false; + return; if (trace_ent.regen >= 1) { - sprint (self, PRINT_HIGH, trace_ent.netname); + sprint (self, 2, trace_ent.netname); sprint (self, PRINT_HIGH, " is already healing.\n"); - return false; + return; } if (trace_ent.health >= trace_ent.max_health) { - sprint(self, PRINT_HIGH, trace_ent.netname); - sprint(self, PRINT_HIGH, " isn't injured.\n"); - return false; + sprint(self, 2, trace_ent.netname); + sprint(self, 2, " isn't injured.\n"); + return; } - sprint (trace_ent, PRINT_HIGH, self.netname); + sprint (trace_ent, 2, self.netname); sprint (trace_ent, PRINT_HIGH, " used a "); sprint (trace_ent, PRINT_HIGH, x); sprint (trace_ent, PRINT_HIGH, " to heal you.\n"); @@ -2708,19 +2919,57 @@ float(float iid) UseHealingChem = trace_ent.health = trace_ent.health + heal; stuffcmd (trace_ent, "v_cshift 0 0 0 0\n"); sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); - return true; + self.chemcount = self.chemcount - 1; } - if (trace_fraction == 1.0) +}; + +void() UseChem = +{ + if (self.chemcount <= 0 || self.chem == 0) { - if (self.health < self.max_health && self.regen == 0) - { - sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); - self.health = self.health + heal; - self.regen = heal; - return true; - } + self.chem = 0; + self.chemcount = 0; + sound (self, CHAN_BODY, "misc/menu3.wav", 1, ATTN_IDLE); + sprint(self, 2, "you are out of chems!\n"); + return; } - return false; + + if (self.chem == 1)//stimpack + UseHealingChem(2); + if (self.chem == 2)//medical bag + UseHealingChem(3); + if (self.chem == 3)//super-stim + UseHealingChem(4); + if (self.chem == 4)//adrenaline + UseBoostingChem(1); + if (self.chem == 5)//jet + UseBoostingChem(2); + if (self.chem == 6)//psycho + UseBoostingChem(3); + if (self.chem == 7)//mentats + UseBoostingChem(3); + + if (self.chemcount == 0) + self.chem = 0; + + self.rtime = time + 1; +}; + +void() Bandage = +{ + if (self.bandages <= 0) + { + self.bandages = 0; + sound (self, CHAN_BODY, "misc/menu3.wav", 1, ATTN_IDLE); + sprint(self, 2, "you are out of bandages!\n"); + return; + } + + UseHealingChem(1); + + self.chemcount = self.chemcount - 1; + if (self.chemcount == 0) + self.chem = 0; }; void () DisplayMenu = @@ -2853,35 +3102,17 @@ 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 }; void () hos_run1; void () hos_stand1; -float (float iid) spawn_station; +void (vector org, entity guy, float input, float cost) spawn_station; void () ExitScreen = { @@ -3016,7 +3247,7 @@ void () Shield = void () station_die = { - if ((self.buildtype == IID_BUILD_MRAMMO)) + if ((self.buildtype == 1)) { if ((self.team == 1)) { @@ -3030,7 +3261,7 @@ void () station_die = } } } - if ((self.buildtype == IID_BUILD_SHIELDGEN)) + if ((self.buildtype == 2)) { if ((self.team == 1)) { @@ -3044,7 +3275,7 @@ void () station_die = } } } - if ((self.buildtype == IID_BUILD_AUTODOC)) + if ((self.buildtype == AS_MELEE)) { if ((self.team == 1)) { @@ -3063,7 +3294,6 @@ void () station_die = void () station_think = { -#define chemcount attack_finished local entity dog; local entity te; local string qq; @@ -3084,7 +3314,7 @@ void () station_think = return; } - if (self.buildtype == IID_BUILD_SHIELDGEN)//barricade + if (self.buildtype == 1)//barricade { sound (self, CHAN_BODY, "items/protect2.wav", 1, ATTN_NORM); @@ -3109,7 +3339,7 @@ void () station_think = te = te.chain; } } - if (self.buildtype == IID_BUILD_AUTODOC)//autodoc + if (self.buildtype == 2)//autodoc { te = findradius (self.origin, 70); while (te) @@ -3136,7 +3366,7 @@ void () station_think = } } - if (self.buildtype == IID_BUILD_MRAMMO)//mr. ammo + if (self.buildtype == 0)//mr. ammo { te = findradius (self.origin, 60); while (te) @@ -3150,11 +3380,9 @@ void () station_think = return; } - sprint (te, 2, "mr.ammo incorporated would like to appologise for any inconvienience caused by this unit being offline.\nOur engineers have diagnosed the fault and will remove the stub whenever they can be arsed.\n"); -/* x = 300; - if (te.current_slot == 1 && te.ammo2 < x) + if (te.current_slot == 1 && te.ammo2 < (x)) { sound (self, CHAN_BODY, "misc/item1.wav", TRUE, ATTN_NORM); zz = (te.maxmag1 / 2); @@ -3162,13 +3390,13 @@ void () station_think = qq = ftos (zz); sprint (te, 2, qq); sprint (te, 2, " ammo was received from the mr.ammo.\n"); - te.ammo1 = te.ammo1 + zz; + te.ammo1 = (te.ammo1 + zz); te.ammo1 = ceil (te.ammo1); self.chemcount = self.chemcount - 1; } else { - if (te.current_slot == 2 && te.ammo2 < x) + if (te.current_slot == 2 && te.ammo2 < (x)) { sound (self, CHAN_BODY, "misc/item1.wav", TRUE, ATTN_NORM); zz = (te.maxmag2 / 2); @@ -3176,12 +3404,11 @@ void () station_think = qq = ftos (zz); sprint (te, 2, qq); sprint (te, 2, " ammo was received from the mr.ammo.\n"); - te.ammo2 = te.ammo2 + zz; + te.ammo2 = (te.ammo2 + zz); te.ammo2 = ceil (te.ammo2); self.chemcount = self.chemcount - 1; } } -*/ } te = te.chain; } @@ -3190,6 +3417,7 @@ void () station_think = void () Bar_Think = { + local float var; local float dot1; if ((self.owner.health < WEAPON_SHOTGUN)) @@ -3244,38 +3472,59 @@ void (entity guy) spawn_dot = }; -float (float iid) spawn_station = +void (vector org, entity guy, float input, float cost) spawn_station = { - local entity oself; + local entity dog; local entity te; - local vector org; - if (iid == IID_BUILD_ROBOFANG) + if (input == 3) { te = find (world, classname, "robofang"); while (te) { - if (te.track == self && te.buildtype == IID_BUILD_ROBOFANG) + if (te.track == self && te.buildtype == 3) { makevectors (self.v_angle); setorigin(te, self.origin + v_forward*32); - return false; + return; } te = find (te, classname, "robofang"); } } + if (self.scraps < cost) + { + sprint (self, 2, "not enough metal.\n"); + return; + } + + if (input == 4) + { + if (self.handgrenade == 0) + { + sprint (self, 2, "need a grenade.\n"); + return; + } + if (self.handgrenade == 1) + { + self.grenadetype = 0; + self.handgrenade = 0; + } + + } + + self = guy; te = find (world, classname, "station"); while (te) { - if (te.track == self && te.buildtype == iid) + if (te.track == self && te.buildtype == input) { sprint (self, 2, "already have one.\n"); - return false; + return; } te = find (te, classname, "station"); } - if (iid == IID_BUILD_ROBOFANG) + if (input == 3) { te = findradius (self.origin, 128); while (te) @@ -3283,43 +3532,43 @@ float (float iid) spawn_station = if (te != self && te.classname == "player" && te.health > 0) { sprint(self, PRINT_HIGH, "not with other players nearby.\n"); - return false; + return; } te = te.chain; } } makevectors (self.v_angle); - org = ((self.origin + (v_forward * IT_LIGHTNING)) + (v_up * EF_FLAG2)); + org = ((org + (v_forward * IT_LIGHTNING)) + (v_up * EF_FLAG2)); if ((pointcontents ((org + '0 20 0')) != CONTENT_EMPTY)) { sprint (self, 2, "can't build there.\n"); - return false; + return; } if ((pointcontents ((org + '0 -20 0')) != CONTENT_EMPTY)) { sprint (self, 2, "can't build there.\n"); - return false; + return; } if ((pointcontents ((org + '20 0 0')) != CONTENT_EMPTY)) { sprint (self, 2, "can't build there.\n"); - return false; + return; } if ((pointcontents ((org + '-20 0 0')) != CONTENT_EMPTY)) { sprint (self, 2, "can't build there.\n"); - return false; + return; } if ((pointcontents ((org + '0 0 50')) != CONTENT_EMPTY)) { sprint (self, 2, "can't build there.\n"); - return false; + return; } if ((pointcontents ((org + '0 0 -10')) != CONTENT_EMPTY)) { sprint (self, 2, "can't build there.\n"); - return false; + return; } self.impulse = 0; te = findradius (org, 40); @@ -3328,67 +3577,68 @@ float (float iid) spawn_station = if (te.classname == "spawn1") { sprint (self, 2, "can't build at spawn.\n"); - return false; + return; } if (te.classname == "spawn2") { sprint (self, 2, "can't build at spawn.\n"); - return false; + return; } if (te.classname == "ghoul") { sprint (self, 2, "somethings in the way.\n"); - return false; + return; } if (((te.classname == "player") && (te.health > 0))) { sprint (self, 2, "can't build on players.\n"); - return false; + return; } if (((te.classname == "station") && (te.health > 0))) { sprint (self, 2, "can't build on other stations.\n"); - return false; + return; } te = te.chain; } - - oself = self; - self = spawn (); - self.team = oself.team; - self.track = oself; - - spawn_dot (self); + self.scraps = (self.scraps - cost); + dog = spawn (); + dog.team = self.team; + dog.track = self; + self = dog; + spawn_dot (dog); self.origin = org; self.takedamage = DAMAGE_YES; self.solid = SOLID_SLIDEBOX; self.movetype = MOVETYPE_TOSS; setsize (self, '-16 -16 0', '16 16 40'); - self.health = 30; - self.max_health = 300; + self.health = SVC_INTERMISSION; + self.max_health = (300 + (input * 50)); self.th_die = station_die; setmodel (self, "progs/station.mdl"); self.classname = "station"; self.think = station_think; self.helmet = 2; - self.buildtype = iid; - if (self.buildtype == IID_BUILD_MRAMMO) + self.buildtype = input; + if (self.buildtype == 0) self.netname = "mr. ammo"; - if (self.buildtype == IID_BUILD_SHIELDGEN) + if (self.buildtype == 1) self.netname = "shield generator"; - if (self.buildtype == IID_BUILD_AUTODOC) + if (self.buildtype == 2) self.netname = "autodoc"; - if (self.buildtype == IID_BUILD_ROBOFANG) + if (self.buildtype == 3) { setsize(self, '-24 -24 -24', '24 24 24'); self.netname = "robofang"; setmodel (self, "progs/dog.mdl"); } + if (self.buildtype == 4) + { + setsize(self, '-4 -4 -4', '4 4 4'); + self.netname = "grenade"; + setmodel (self, "progs/grenade2.mdl"); + } self.frame = 4; - - self = oself; - - return true; }; void () BuyMenu = @@ -3465,7 +3715,9 @@ void () CharacterSheet = local float ratio; local float r1; local float r2; + local float var; + var = weightx (); stuffcmd (self, "toggleconsole\n"); sprint (self, PRINT_HIGH, "\n\n\n\n ** INFO ** \n"); sprint (self, PRINT_HIGH, "Class ‘ "); @@ -3524,7 +3776,7 @@ void () CharacterSheet = sprint (self, 2, x); sprint (self, PRINT_HIGH, "\n"); } -/* + sprint (self, PRINT_HIGH, "\nArmor ‘ "); x = GetArmorName(); sprint (self, 2, x); @@ -3532,12 +3784,11 @@ void () CharacterSheet = x = ftos (self.armor_weight); sprint (self, 2, x); sprint (self, 2, ")\n"); -*/ + sprint (self, PRINT_HIGH, "Protective‘ "); x = GetProtectName(); sprint (self, 2, x); sprint (self, 2, "\n"); -/* sprint (self, PRINT_HIGH, "Chem ‘ "); x = GetChemName(); sprint (self, 2, x); @@ -3546,7 +3797,6 @@ void () CharacterSheet = sprint (self, 2, x); sprint (self, 2, "]"); sprint (self, 2, "\n"); -*/ sprint (self, PRINT_HIGH, "Gadget ‘ "); x = GetEquipmentName(); @@ -3560,7 +3810,6 @@ void () CharacterSheet = x = GetTraitName(); sprint (self, 2, x); sprint (self, 2, "\n"); -/* sprint (self, PRINT_HIGH, "Weapon 1 ‘ "); x = GetWeaponName (self, self.slot1); sprint (self, 2, x); @@ -3580,7 +3829,6 @@ void () CharacterSheet = sprint (self, 2, ") ("); sprint (self, 2, self.ammotype2); sprint (self, 2, ")\n\n"); -*/ qq = weightx (); sprint (self, PRINT_HIGH, "Weight ‘ "); x = ftos (qq); @@ -3651,7 +3899,7 @@ void () UseEquipment = }; -void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 = +void (vector s_aim, float dam, float var, float ran) W_FireBuckshotSpread1 = { local vector source; local vector targ; @@ -3663,10 +3911,9 @@ void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 = local vector pos; local float ydif; local float xdif; - local float tru; + local float true; makevectors (self.v_angle); - if (self.position == 0) source = (self.origin + '0 0 20'); if (self.position == 1) @@ -3674,8 +3921,7 @@ void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 = if (self.position == 2) source = (self.origin + '0 0 -12'); - targ = ((((((s_aim + ((v_right * random ()) * tmp)) - ((v_right * random ()) * tmp)) + ((v_up * random ()) * tmp)) - ((v_up * random ()) * tmp)) + (((v_up * random ()) * tmp) * 0.5)) + (v_forward * ran)); - + targ = ((((((s_aim + ((v_right * random ()) * var)) - ((v_right * random ()) * var)) + ((v_up * random ()) * var)) - ((v_up * random ()) * var)) + (((v_up * random ()) * var) * 0.5)) + (v_forward * ran)); traceline (source, targ, FALSE, self); if ((trace_fraction == 1)) { @@ -3695,16 +3941,16 @@ void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 = zdif = (org_z - trace_ent.origin_z); ydif = (org_y - trace_ent.origin_y); xdif = (org_x - trace_ent.origin_x); - tru = 0; + true = 0; if (((ydif >= CONTENT_SLIME) && (ydif <= WEAPON_SPIKES))) { - tru = 1; + true = 1; } if (((xdif >= CONTENT_SLIME) && (xdif <= WEAPON_SPIKES))) { - tru = 1; + true = 1; } - if (((tru == 1) && (zdif >= ((trace_ent.size_z / 2) * 0.8)))) + if (((true == 1) && (zdif >= ((trace_ent.size_z / 2) * 0.8)))) { if (self.attack > 2) dam = (dam * 0.4); @@ -3719,7 +3965,7 @@ void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 = } }; -void (float rec, float number, float dam, float spread, float ran, float auto) W_FireShotgun = +void (float rec, float number, float dam, float var, float ran, float auto) W_FireShotgun = { local vector dir; local vector p_aim; @@ -3727,8 +3973,14 @@ 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; local vector adjust; + if (self.current_slot == 1) + weap = self.slot1; + else + weap = self.slot2; + if (self.velocity != '0 0 0') { var1 = ((random () * 48) * (6 + self.recoil * 1.5)); @@ -3791,22 +4043,23 @@ void (float rec, float number, float dam, float spread, float ran, float auto) W self.attack_finished = (time + 0.2); dir = aim (self, 10000); - spread = 30; + var = SVC_INTERMISSION; 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, var, ran); + W_FireBuckshotSpread1 ((p_aim + (v_right * 80)), dam, var, ran); + W_FireBuckshotSpread1 ((p_aim - (v_right * 80)), dam, var, ran); + W_FireBuckshotSpread1 ((p_aim + (v_up * 80)), dam, var, ran); + W_FireBuckshotSpread1 ((p_aim - (v_up * 80)), dam, var, ran); } else { if ((number == AS_MELEE)) { - W_FireBuckshotSpread1 (p_aim, dam, spread, ran); - W_FireBuckshotSpread1 (p_aim, dam, spread, ran); - W_FireBuckshotSpread1 (p_aim, dam, spread, ran); + var = 80; + W_FireBuckshotSpread1 (p_aim, dam, var, ran); + W_FireBuckshotSpread1 (p_aim, dam, var, ran); + W_FireBuckshotSpread1 (p_aim, dam, var, ran); } } }; diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 0b41d978..bbd7674a 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -157,16 +157,16 @@ void() main = void () GameTimer = { local entity te, ze; - local float switched; + local float switch; local float c, z; - switched = 0; + switch = 0; te = findradius(self.origin, 25000); - while (c < 300 && switched == 0) + while (c < 300 && switch == 0) { - if (te.classname == "raider" && te.enemy != world && te.processed == 0 && te.active == 0 && switched == 0) + if (te.classname == "raider" && te.enemy != world && te.processed == 0 && te.active == 0 && switch == 0) { te.active = 1; te.processed = 1; @@ -174,7 +174,7 @@ void () GameTimer = bprint(2, te.netname); bprint(2, "'s turn.\n"); te.maxspeed = 300; - switched = 1; + switch = 1; ze = findradius(self.origin, 25000); z = 0; @@ -189,7 +189,7 @@ void () GameTimer = ze = ze.chain; } } - if (te.classname == "player" && te.processed == 0 && te.active == 0 && switched == 0) + if (te.classname == "player" && te.processed == 0 && te.active == 0 && switch == 0) { te.active = 1; te.processed = 1; @@ -197,7 +197,7 @@ void () GameTimer = bprint(2, te.netname); bprint(2, "'s turn.\n"); te.maxspeed = 300; - switched = 1; + switch = 1; ze = findradius(self.origin, 25000); z = 0; @@ -217,7 +217,7 @@ void () GameTimer = } c = 0; - if (switched == 0) // no entities left, turn is over + if (switch == 0) // no entities left, turn is over { bprint(2, "round is now over.\n"); @@ -275,8 +275,6 @@ void() worldspawn = InitBodyQue (); coop = 1; - SetupStats(); - // custom map attributes if (self.model == "maps/e1m8.bsp") @@ -390,7 +388,7 @@ void() worldspawn = precache_model ("progs/v_knife.mdl"); precache_model ("progs/v_1911.mdl"); precache_model ("progs/v_ak47.mdl"); - precache_model ("progs/v_mp7.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");