diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 4f8daa819..7220ea981 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -37,33 +37,33 @@ void() info_intermission = void() SetChangeParms = { +/* if (self.health <= 0) { SetNewParms (); return; } - + */ + // remove items 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; @@ -89,15 +89,21 @@ void() SetChangeParms = void() SetNewParms = { //remember, don't use self! - parm1 = IT_SHOTGUN | IT_AXE; - parm2 = 100; - parm3 = 0; - parm4 = 25; - parm5 = 0; - parm6 = 0; - parm7 = 0; - parm8 = 1; - parm9 = 0; + parm1 = IID_WP_USP; + parm2 = IID_WP_KNIFE; + parm3 = IID_ARM_SHIRT; + parm4 = 0; + parm5 = 0; + parm6 = 0; + parm7 = 0; + parm8 = 8; + parm9 = 0; + parm10 = 0; + parm11 = 0; + parm12 = 0; + //parm13 = 0; + parm14 = 0; + parm15 = 0; parm16 = 1; @@ -121,21 +127,21 @@ void() SetNewParms = 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; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 5be4a55da..6bf0d2e25 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -309,36 +309,32 @@ string(float iid) GetItemVModel = return "progs/v_1911.mdl"; /* if (iid == IID_WP_DEAGLE) - return ""; + return "progs/v_deagle.mdl"; if (iid == IID_WP_NEEDLER) - return ""; + return "progs/v_1911.mdl"; if (iid == IID_WP_ALIENBLASTER) - return ""; + return "progs/v_alien.mdl"; if (iid == IID_WP_PIPERIFLE) - return ""; + return "progs/v_piperifle.mdl"; if (iid == IID_WP_WINCHESTER) - return ""; + return "progs/v_double.mdl"; if (iid == IID_WP_MOSSBERG) - return ""; + return "progs/v_shotgun.mdl"; */ if (iid == IID_WP_JACKHAMMER) return "progs/v_jackhammer.mdl"; if (iid == IID_WP_MP9) return "progs/v_mp9.mdl"; if (iid == IID_WP_MP7) - return "progs/v_mp7.mdl"; -/* + return "progs/v_smg.mdl"; if (iid == IID_WP_RANGERMASTER) - return ""; + return "progs/v_rangem.mdl"; if (iid == IID_WP_AK112) - return ""; -*/ + return "progs/v_ak47.mdl"; if (iid == IID_WP_AK74) return "progs/v_ak47.mdl"; -/* if (iid == IID_WP_DKS1) - return ""; -*/ + return "progs/v_srifle.mdl"; if (iid == IID_WP_MOONLIGHT) return "progs/v_night.mdl"; diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index acbcf795e..b6198d759 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -274,67 +274,71 @@ void() item_health = }; -void() health_touch = +float (entity to, float iid, float quant) TryGiveStackable = { - local float amount; - local string s; - - if (deathmatch == 4) - if (other.invincible_time > 0) - return; + local float slot; + local float item; + slot = SlotOfItem(to, iid); + if (slot != 0) + { + item = ItemInSlot(to, slot); + if (ToStatus(item) + quant > 100) //100 is our maxstack value here + { + quant = quant + ToStatus(item) - 100; + SetItemSlot(to, slot, SlotVal(iid, 100)); + slot = 0; + } + else + quant = quant + ToStatus(item); + } + if (quant == 0) + return true; + if (slot == 0) + { + slot = SlotOfItem(to, 0); + if (slot == 0) + return false; + } - if (other.classname != "player") + SetItemSlot(to, slot, SlotVal(iid, quant)); + + return true; +}; + +void () health_touch = +{ + local float amount; + local string s; + + 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 (!TryGiveStackable(other, IID_CHEM_STIMPACK, 1)) + return; + + sprint (other, PRINT_HIGH, "picked up a stimpack.\n"); + + 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/mod_buy.qc b/quakec/fallout2/mod_buy.qc index de15b735f..e8d890a8e 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -621,13 +621,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/weapons.qc b/quakec/fallout2/weapons.qc index 210a782e7..66bed6a4e 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -24,6 +24,8 @@ void() CharacterSheet; void() UseEquipment; void (float slot, float snd, float drop) DropFromSlot; void() PositionControl; +void() autofire; +void() autofire_s; #define weightx() (self.weight) @@ -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 = @@ -1949,6 +1949,10 @@ void(float slot, float magazine) GiveAmmo = wt = ToIID(wi); SetItemSlot(self, slot, SlotVal(wt, magazine)); + magazine = magazine*4; + if (magazine < 30) + magazine = 30; //be generous. + at = WeaponAmmoType(wt); //make sure we have enough ammo as = SlotOfItem(self, at); @@ -1956,8 +1960,8 @@ void(float slot, float magazine) GiveAmmo = 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 (ToStatus(ItemInSlot(self, as)) < magazine) + SetItemSlot(self, as, SlotVal(at, magazine)); }; @@ -2084,9 +2088,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'; diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 0b41d9783..f6efab2d4 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -390,7 +390,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"); @@ -403,6 +403,7 @@ void() worldspawn = precache_model ("progs/v_night.mdl"); precache_model ("progs/v_nailer.mdl"); precache_model ("progs/v_piperifle.mdl"); + precache_model ("progs/v_handgren.mdl"); precache_model ("progs/sneak.mdl"); precache_model ("progs/dead.mdl");