diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 3e67377a1..e3a497978 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -1627,11 +1627,12 @@ void() PlayerPreThink = } - if ((self.skill_combat + self.skill_sneak + self.skill_doctor + self.skill_science) <= 5) + if ((self.skill_combat + self.skill_sneak + self.skill_doctor + self.skill_science) <= 10) { if (self.currentmenu == "none") { self.currentmenu = "gain_skill"; + self.missionbrief = 2; return; } } diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 21624ed8b..aa29552c1 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -21,7 +21,7 @@ float(string desc) itemtoslot = } slot = stof(desc); - if (slot >= 1 && slot <= MAXSLOTS) + if (slot >= 1 && slot <= 26) return slot; if (desc == "current") @@ -259,6 +259,551 @@ void(string arg1) Cmd_InvDrop = DropFromSlot(slotno, true, false); }; +void(string arg1) Cmd_InvBuy = +{ + local float x,y, iid, amount, money; + + + x = FindEmptySlot(self); + + if (x == 0) + { + sprint(self, 2, "no more room in inventory!\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + + + + if (arg1 == "1") + { + iid = ToIID(self.xslot1); + amount = ToStatus(self.xslot1); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot1); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + + if (arg1 == "2") + { + iid = ToIID(self.xslot2); + amount = ToStatus(self.xslot2); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot2); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + + if (arg1 == "3") + { + iid = ToIID(self.xslot3); + amount = ToStatus(self.xslot3); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot3); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + + if (arg1 == "4") + { + iid = ToIID(self.xslot4); + amount = ToStatus(self.xslot4); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot4); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + + if (arg1 == "5") + { + iid = ToIID(self.xslot5); + amount = ToStatus(self.xslot5); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot5); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + + if (arg1 == "6") + { + iid = ToIID(self.xslot6); + amount = ToStatus(self.xslot6); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot6); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + + if (arg1 == "7") + { + iid = ToIID(self.xslot7); + amount = ToStatus(self.xslot7); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot7); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + + if (arg1 == "8") + { + iid = ToIID(self.xslot8); + amount = ToStatus(self.xslot8); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot8); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "9") + { + iid = ToIID(self.xslot9); + amount = ToStatus(self.xslot9); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot9); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "10") + { + iid = ToIID(self.xslot10); + amount = ToStatus(self.xslot10); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot10); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "11") + { + iid = ToIID(self.xslot11); + amount = ToStatus(self.xslot11); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot11); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "12") + { + iid = ToIID(self.xslot12); + amount = ToStatus(self.xslot12); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot12); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "13") + { + iid = ToIID(self.xslot13); + amount = ToStatus(self.xslot13); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot13); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "14") + { + iid = ToIID(self.xslot14); + amount = ToStatus(self.xslot14); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot14); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "15") + { + iid = ToIID(self.xslot15); + amount = ToStatus(self.xslot15); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot15); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "16") + { + iid = ToIID(self.xslot16); + amount = ToStatus(self.xslot16); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot16); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "17") + { + iid = ToIID(self.xslot17); + amount = ToStatus(self.xslot17); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot17); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "18") + { + iid = ToIID(self.xslot18); + amount = ToStatus(self.xslot18); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot18); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "19") + { + iid = ToIID(self.xslot19); + amount = ToStatus(self.xslot19); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot19); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } + if (arg1 == "20") + { + iid = ToIID(self.xslot20); + amount = ToStatus(self.xslot20); + money = GetBaseValue(iid); + if (self.ammo_shells < money) + { + sprint(self, 2, "not enough money.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + else + self.ammo_shells = self.ammo_shells - money; + + if (NotStackable(iid)) + SetItemSlot(self, x, self.xslot20); + else + + if (!TryGiveStackable(self, iid, amount)) + { + sprint(self, 2, "full inventory.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + } +}; + void(string arg1) Cmd_InvSell = { local float it, iid, x; @@ -302,89 +847,188 @@ void(string arg1) Cmd_InvSell = void(string arg1) Cmd_InvMix = { - local float it, iid; + local float it, iid1, iid2, item1, item2; local float slotno, x; - slotno = itemtoslot(arg1); - if (!slotno) + + + it = ItemInSlot(self, 23); + iid1 = ToIID(it); + if (iid1 == 0) { - sprint(self, PRINT_MEDIUM, "Can't drop - you don't have one\n"); + sprint(self, PRINT_MEDIUM, "need two items!\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); return; } - - it = ItemInSlot(self, slotno); - iid = ToIID(it); - - - if (iid == 0) - return; - - if (iid == IID_MISC_NUKACOLA) + it = ItemInSlot(self, 24); + iid2 = ToIID(it); + if (iid2 == 0) { - x = SlotOfItem(self, IID_MISC_CHEMICALS); - if (x == 0) + sprint(self, PRINT_MEDIUM, "need two items!\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + + if ((iid1 == IID_MISC_NUKACOLA && iid2 == IID_MISC_CHEMICALS) || + (iid2 == IID_MISC_NUKACOLA && iid1 == IID_MISC_CHEMICALS)) + { + + DecreaseDestroySlot(23); + DecreaseDestroySlot(24); + + if (random()*100 >= (self.skill_science*10)) { - sprint(self, PRINT_MEDIUM, "you need (1) nukacola and (1) chemicals\n"); + sprint(self, PRINT_MEDIUM, "your concoction exploded!\n"); + Explosion(); return; } - DecreaseDestroySlot(slotno); - DecreaseDestroySlot(x); + if (random()*100 < ((self.skill_science*10) - 100)) + { + sprint(self, PRINT_MEDIUM, "2 stimpacks created!\n"); + sound (self, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NORM); + TryGiveStackable(self, IID_CHEM_STIMPACK, 2); + return; + } TryGiveStackable(self, IID_CHEM_STIMPACK, 1); - sprint(self, PRINT_MEDIUM, "stimpack created\n"); + sprint(self, PRINT_MEDIUM, "1 stimpack created\n"); + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); } - if (iid == IID_MISC_AEROSOL) + + + else if ((iid1 == IID_MISC_AEROSOL && iid2 == IID_MISC_CHEMICALS) || + (iid2 == IID_MISC_AEROSOL && iid1 == IID_MISC_CHEMICALS)) { - x = SlotOfItem(self, IID_MISC_CHEMICALS); - if (x == 0) + + DecreaseDestroySlot(23); + DecreaseDestroySlot(24); + + if (random()*100 > (self.skill_science*10)) { - sprint(self, PRINT_MEDIUM, "you need (1) aerosol can and (1) chemicals\n"); + sprint(self, PRINT_MEDIUM, "your concoction exploded!\n"); + Explosion(); return; } - DecreaseDestroySlot(slotno); - DecreaseDestroySlot(x); - TryGiveStackable(self, IID_CHEM_RADX, 3); - sprint(self, PRINT_MEDIUM, "rad-x created\n"); + if (random()*100 < ((self.skill_science*10) - 100)) + { + sprint(self, PRINT_MEDIUM, "2 flash bombs created!\n"); + sound (self, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NORM); + TryGiveStackable(self, IID_GREN_FLASH, 2); + return; + } + TryGiveStackable(self, IID_GREN_FLASH, 1); + sprint(self, PRINT_MEDIUM, "1 flash bomb created\n"); + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); } - if (iid == IID_MISC_RDXCRYSTAL) + else if ((iid1 == IID_MISC_NUKACOLA && iid2 == IID_MISC_GUM) || + (iid2 == IID_MISC_NUKACOLA && iid1 == IID_MISC_GUM)) { - x = SlotOfItem(self, IID_MISC_CHEMICALS); - if (x == 0) + + DecreaseDestroySlot(23); + DecreaseDestroySlot(24); + + if (random()*100 > (self.skill_science*10)) { - sprint(self, PRINT_MEDIUM, "you need (1) rdx crystal and (1) chemicals\n"); + sprint(self, PRINT_MEDIUM, "your concoction exploded!\n"); + Explosion(); return; } - DecreaseDestroySlot(slotno); - DecreaseDestroySlot(x); - TryGiveStackable(self, IID_CHEM_PSYCHO, 2); - sprint(self, PRINT_MEDIUM, "psycho created\n"); + if (random()*100 < ((self.skill_science*10) - 100)) + { + sprint(self, PRINT_MEDIUM, "2 stun bombs created!\n"); + sound (self, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NORM); + TryGiveStackable(self, IID_GREN_STUN, 2); + return; + } + TryGiveStackable(self, IID_GREN_STUN, 1); + sprint(self, PRINT_MEDIUM, "1 stun bomb created\n"); + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); } - if (iid == IID_CHEM_STIMPACK) + else if ((iid1 == IID_MISC_RDXCRYSTAL && iid2 == IID_MISC_HMXCOMPOUND) || + (iid2 == IID_MISC_RDXCRYSTAL && iid1 == IID_MISC_HMXCOMPOUND)) { - if (ToStatus(slotno) <= 1) - { - sprint(self, PRINT_MEDIUM, "you need (2) stimpacks and (1) chemicals\n"); - return; - } - x = SlotOfItem(self, IID_MISC_CHEMICALS); - if (x == 0) - { - sprint(self, PRINT_MEDIUM, "you need (2) stimpacks and (1) chemicals\n"); - return; - } - DecreaseDestroySlot(slotno); - DecreaseDestroySlot(slotno); - DecreaseDestroySlot(x); + DecreaseDestroySlot(23); + DecreaseDestroySlot(24); + + if (random()*100 > (self.skill_science*5)) + { + sprint(self, PRINT_MEDIUM, "your concoction exploded!\n"); + Explosion(); + return; + } + + if (random()*100 < ((self.skill_science*4) - 100)) + { + sprint(self, PRINT_MEDIUM, "2 rockets created!\n"); + sound (self, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NORM); + TryGiveStackable(self, IID_AM_ROCKET, 2); + return; + } + TryGiveStackable(self, IID_AM_ROCKET, 1); + sprint(self, PRINT_MEDIUM, "1 rocket created\n"); + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + } + else if ((iid1 == IID_MISC_CHEMICALS && iid2 == IID_MISC_HMXCOMPOUND) || + (iid2 == IID_MISC_CHEMICALS && iid1 == IID_MISC_HMXCOMPOUND)) + { + + DecreaseDestroySlot(23); + DecreaseDestroySlot(24); + + if (random()*100 > (self.skill_science*8)) + { + sprint(self, PRINT_MEDIUM, "your concoction exploded!\n"); + Explosion(); + return; + } + + if (random()*100 < ((self.skill_science*8) - 100)) + { + sprint(self, PRINT_MEDIUM, "2 grenades created!\n"); + sound (self, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NORM); + TryGiveStackable(self, IID_GREN_FRAG, 2); + return; + } + TryGiveStackable(self, IID_GREN_FRAG, 1); + sprint(self, PRINT_MEDIUM, "1 grenade created\n"); + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + } + else if ((iid1 == IID_MISC_CHEMICALS && iid2 == IID_MISC_RDXCRYSTAL) || + (iid2 == IID_MISC_CHEMICALS && iid1 == IID_MISC_RDXCRYSTAL)) + { + + DecreaseDestroySlot(23); + DecreaseDestroySlot(24); + + if (random()*100 > (self.skill_science*3)) + { + sprint(self, PRINT_MEDIUM, "your concoction exploded!\n"); + Explosion(); + return; + } + + if (random()*100 < ((self.skill_science*4) - 100)) + { + sprint(self, PRINT_MEDIUM, "2 super stims created!\n"); + sound (self, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NORM); + TryGiveStackable(self, IID_CHEM_SUPERSTIM, 2); + return; + } TryGiveStackable(self, IID_CHEM_SUPERSTIM, 1); - sprint(self, PRINT_MEDIUM, "superstim created.\n"); + sprint(self, PRINT_MEDIUM, "1 super stim created\n"); + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); } - - + else + { + sprint(self, PRINT_MEDIUM, "cannot merge items!\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } }; void(string arg1) Cmd_InvCreate = @@ -868,6 +1512,12 @@ void(string line) SV_ParseClientCommand = return; Cmd_InvSell(argv(1)); } + else if (cmd == "invbuy") + { + if (self.deadflag || self.current_slot==0) + return; + Cmd_InvBuy(argv(1)); + } else if (cmd == "invmix") { if (self.deadflag) @@ -898,4 +1548,4 @@ void(string line) SV_ParseClientCommand = } else clientcommand(self, line); -}; \ No newline at end of file +}; diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 8d75307e9..c6d4e8a6e 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -58,7 +58,7 @@ void(vector pos, float slotno) TraderImage = drawpic(pos, strcat("gui/", itname), IMGSIZEV, '1 1 1', 1); it = ToStatus(it); - if (it < 1) + if (it <= 1) return; itname = ftos(it); it = strlen(itname); @@ -97,7 +97,10 @@ void(vector pos, float slotno) SlotImage = it = getstati(97); if (slotno == 24) it = getstati(98); - + if (slotno == 25) + it = getstati(104); + if (slotno == 26) + it = getstati(105); } itname = GetItemImage(ToIID(it)); @@ -142,6 +145,10 @@ void(vector pos, float slotno) SlotImageSmall = it = getstati(97); if (slotno == 24) it = getstati(98); + if (slotno == 25) + it = getstati(104); + if (slotno == 26) + it = getstati(105); } itname = GetItemImage(ToIID(it)); @@ -377,6 +384,10 @@ void(vector pos, string image) Crosshair = void() Trader_Draw = { + local float i, price, money; + local float it; + local string itname, money2, s2, s3, s4, s5, s6, s7, s8, s9, perki, perk2i, p1, p2, pn, pd, price2; + local float op; float width,height,lvl,bar; vector w; @@ -387,10 +398,71 @@ void() Trader_Draw = - drawpic('0 0 0', "gui/pipboy/buyscreen.bmp", w, '1 1 1', 1); - TraderImage('2 2 0'*IMGSIZEF, 1); - TraderImage('2 3 0'*IMGSIZEF, 2); + drawpic('0 0 0', "gui/pipboy/buyscreen.jpg", '468 468 0', '1 1 1', 1); + TraderImage('1 1 0'*IMGSIZEF, 1); + TraderImage('2 1 0'*IMGSIZEF, 2); + TraderImage('3 1 0'*IMGSIZEF, 3); + TraderImage('4 1 0'*IMGSIZEF, 4); + TraderImage('5 1 0'*IMGSIZEF, 5); + TraderImage('1 2 0'*IMGSIZEF, 6); + TraderImage('2 2 0'*IMGSIZEF, 7); + TraderImage('3 2 0'*IMGSIZEF, 8); + TraderImage('4 2 0'*IMGSIZEF, 9); + TraderImage('5 2 0'*IMGSIZEF, 10); + TraderImage('1 3 0'*IMGSIZEF, 11); + TraderImage('2 3 0'*IMGSIZEF, 12); + TraderImage('3 3 0'*IMGSIZEF, 13); + TraderImage('4 3 0'*IMGSIZEF, 14); + TraderImage('5 3 0'*IMGSIZEF, 15); + TraderImage('1 4 0'*IMGSIZEF, 16); + TraderImage('2 4 0'*IMGSIZEF, 17); + TraderImage('3 4 0'*IMGSIZEF, 18); + TraderImage('4 4 0'*IMGSIZEF, 19); + TraderImage('5 4 0'*IMGSIZEF, 20); + + if (mousepos_x >= 1*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) + if (mousepos_y >= 1*IMGSIZEF && mousepos_y <= 2*IMGSIZEF) + slotnum = floor((mousepos_x)/IMGSIZEF) + 0; + + if (mousepos_x >= 1*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) + if (mousepos_y >= 2*IMGSIZEF && mousepos_y <= 3*IMGSIZEF) + slotnum = floor((mousepos_x)/IMGSIZEF) + 5; + + if (mousepos_x >= 1*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) + if (mousepos_y >= 3*IMGSIZEF && mousepos_y <= 4*IMGSIZEF) + slotnum = floor((mousepos_x)/IMGSIZEF) + 10; + + if (mousepos_x >= 1*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) + if (mousepos_y >= 4*IMGSIZEF && mousepos_y <= 5*IMGSIZEF) + slotnum = floor((mousepos_x)/IMGSIZEF) + 15; + + + if (showcontextmenu && show_trader) + { + drawfill(contextpos - '8 8 0', '88 24 0'+'96 96 0', '0 0 0', 0.9); + + op = floor((mousepos_y - contextpos_y)/8); + drawstring(contextpos + (0 * '0 8 0'), "buy", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', +1); + } + + if (slotnum <= 20) + it = getstati(70+slotnum); + itname = GetItemDesc(ToIID(it)); + drawstring('32 16 0', itname, '8 8 0', '1 1 1', 1); + + price = GetBaseValue(ToIID(it)); + price2 = ftos(price); + money = getstati(50); + money2 = ftos(money); + + drawstring('2 6 0'*IMGSIZEF - '16 48 0', " TOTAL ", '16 16 0', '1 1 1', 1); + drawstring('2 6 0'*IMGSIZEF - '16 32 0', " PRICE ", '16 16 0', '1 1 1', 1); + drawstring('2 6 0'*IMGSIZEF + '16 0 0', price2, '16 16 0', '1 1 1', 1); + drawstring('4 6 0'*IMGSIZEF - '16 48 0', " TOTAL ", '16 16 0', '1 1 1', 1); + drawstring('4 6 0'*IMGSIZEF - '16 32 0', " MONEY ", '16 16 0', '1 1 1', 1); + drawstring('4 6 0'*IMGSIZEF + '16 0 0', money2, '16 16 0', '1 1 1', 1); drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -406,42 +478,42 @@ void() Pipboy_Draw = - drawpic('0 0 0', "gui/pipboy/pipboy.jpg", w, '1 1 1', 1); - drawstring('2 2 0'*IMGSIZEF, "COMBAT", '8 8 8', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/pipboy.jpg", '640 480 0', '1 1 1', 1); + drawstring('3 2 0'*IMGSIZEF, "COMBAT", '8 8 8', '1 1 1', 1); bar = 0; - lvl = getstati(81); + lvl = getstati(100); while (bar <= lvl) { - drawpic('3 2 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/red.jpg", '1 4 0'*2, '1 1 1', 1); + drawpic('4 2 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/red.jpg", '1 4 0'*2, '1 1 1', 1); bar = bar + 1; } - drawstring('2 2.2 0'*IMGSIZEF, "DOCTOR", '8 8 8', '1 1 1', 1); + drawstring('3 2.2 0'*IMGSIZEF, "DOCTOR", '8 8 8', '1 1 1', 1); bar = 0; - lvl = getstati(82); + lvl = getstati(101); while (bar <= lvl) { - drawpic('3 2.2 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/green.jpg", '1 4 0'*2, '1 1 1', 1); + drawpic('4 2.2 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/green.jpg", '1 4 0'*2, '1 1 1', 1); bar = bar + 1; } - drawstring('2 2.4 0'*IMGSIZEF, "SNEAK", '8 8 8', '1 1 1', 1); + drawstring('3 2.4 0'*IMGSIZEF, "SNEAK", '8 8 8', '1 1 1', 1); bar = 0; - lvl = getstati(83); + lvl = getstati(102); while (bar <= lvl) { - drawpic('3 2.4 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/blue.jpg", '1 4 0'*2, '1 1 1', 1); + drawpic('4 2.4 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/blue.jpg", '1 4 0'*2, '1 1 1', 1); bar = bar + 1; } - drawstring('2 2.6 0'*IMGSIZEF, "SCIENCE", '8 8 8', '1 1 1', 1); + drawstring('3 2.6 0'*IMGSIZEF, "SCIENCE", '8 8 8', '1 1 1', 1); bar = 0; - lvl = getstati(84); + lvl = getstati(103); while (bar <= lvl) { - drawpic('3 2.6 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/yellow.jpg", '1 4 0'*2, '1 1 1', 1); + drawpic('4 2.6 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/yellow.jpg", '1 4 0'*2, '1 1 1', 1); bar = bar + 1; } @@ -461,7 +533,7 @@ void() Invent_Draw = width = cvar("vid_conwidth"); //how much space have we got for the slider? - drawpic('0 0 0', "gui/pipboy/inventory.jpg", w, '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/inventory.jpg", '500 470 0', '1 1 1', 1); local float slotofs; slotofs = sliderpos*(height - (IMGSIZEF*6)) + (IMGSIZEF*6); @@ -473,7 +545,6 @@ void() Invent_Draw = SlotImage('2 4 0'*IMGSIZEF, 8); SlotImage('2 5 0'*IMGSIZEF, 9); SlotImage('2 6 0'*IMGSIZEF, 10); - SlotImage('3 1 0'*IMGSIZEF, 11); SlotImage('3 2 0'*IMGSIZEF, 12); SlotImage('3 3 0'*IMGSIZEF, 13); @@ -482,8 +553,8 @@ void() Invent_Draw = SlotImage('3 6 0'*IMGSIZEF, 16); SlotImage('5.5 1 0'*IMGSIZEF, 1); - SlotImage('5.5 3 0'*IMGSIZEF, 2); - SlotImage('5.5 5.5 0'*IMGSIZEF, 3); + SlotImage('5.5 2 0'*IMGSIZEF, 2); + SlotImage('5.5 3 0'*IMGSIZEF, 3); SlotImageSmall('1 3 0'*IMGSIZEK, 17); SlotImageSmall('1 4 0'*IMGSIZEK, 18); @@ -491,12 +562,14 @@ void() Invent_Draw = SlotImageSmall('1 6 0'*IMGSIZEK, 20); SlotImageSmall('1 7 0'*IMGSIZEK, 21); SlotImageSmall('1 8 0'*IMGSIZEK, 22); - SlotImageSmall('1 9 0'*IMGSIZEK, 23); - SlotImageSmall('1 10 0'*IMGSIZEK, 24); + SlotImageSmall('1 12.5 0'*IMGSIZEK, 4); + SlotImageSmall('11 12 0'*IMGSIZEK, 23); + SlotImageSmall('13 12 0'*IMGSIZEK, 24); + /* perki = GetPerkImage(getstati(60)); perk2i = GetPerkImage(getstati(59)); @@ -520,7 +593,7 @@ void() Invent_Draw = - if (showcontextmenu) + if (showcontextmenu && show_inventory) { drawfill(contextpos - '8 8 0', '88 24 0'+'96 96 0', '0 0 0', 0.9); @@ -553,12 +626,21 @@ void() Invent_Draw = if (mousepos_y >= 1*IMGSIZEF && mousepos_y <= 2*IMGSIZEF) slotnum = 1; if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.5*IMGSIZEF) - if (mousepos_y >= 3*IMGSIZEF && mousepos_y <= 4*IMGSIZEF) + if (mousepos_y >= 2*IMGSIZEF && mousepos_y <= 3*IMGSIZEF) slotnum = 2; - if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.5*IMGSIZEF) - if (mousepos_y >= 5.5*IMGSIZEF && mousepos_y <= 6.5*IMGSIZEF) + if (mousepos_y >= 3*IMGSIZEF && mousepos_y <= 4*IMGSIZEF) slotnum = 3; + + + + + if (mousepos_x >= 11*IMGSIZEK && mousepos_x <= 12*IMGSIZEK) + if (mousepos_y >= 12*IMGSIZEK && mousepos_y <= 13*IMGSIZEK) + slotnum = 23; + if (mousepos_x >= 13*IMGSIZEK && mousepos_x <= 14*IMGSIZEK) + if (mousepos_y >= 12*IMGSIZEK && mousepos_y <= 13*IMGSIZEK) + slotnum = 24; } else { @@ -638,16 +720,22 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = if (param1 == 'i') { show_inventory = !show_inventory; + show_pipboy = false; + show_trader = false; } if (param1 == 'p') { show_pipboy = !show_pipboy; + show_inventory = false; + show_trader = false; } if (param1 == 'b' && (getstati(108) == 1)) { show_trader = !show_trader; + show_pipboy = false; + show_inventory = false; } - else if (!show_inventory) + else if (!show_inventory && !show_trader) return false; else if (param1 == k_mouse1) { @@ -679,7 +767,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = { if (param1 == k_mouse1) { - if (showcontextmenu) + if (showcontextmenu && show_inventory) { op = floor((mousepos_y - contextpos_y)/8); @@ -694,6 +782,15 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = showcontextmenu = false; } + else if (showcontextmenu && show_trader) + { + op = floor((mousepos_y - contextpos_y)/8); + + if (op == 0) + localcmd(strcat("cmd invbuy ", ftos(slotnum), "\n")); + + showcontextmenu = false; + } else { if (mouseisdown) @@ -703,9 +800,15 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = else if (downslotnum == slotnum) //mouse didn't move away { - if (slotnum >= 1 && slotnum <= 24) + if (slotnum >= 1 && slotnum <= 26) { - if (getstati(32+slotnum-1) != 0) //if there's actually an item there + //if there's actually an item there + if ((show_inventory) && (getstati(32+slotnum-1) != 0)) + { + showcontextmenu = true; //show the context menu + contextpos = mousepos; + } + else if ((show_trader) && (getstati(70+slotnum) != 0)) { showcontextmenu = true; //show the context menu contextpos = mousepos; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index d33099024..2a08b99dc 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -4,6 +4,7 @@ float IID_NONE = 0; #define IsGrenade(iid) (iid >= IID_GREN_FRAG && iid <= IID_GREN_STUN) #define IsRanged(iid) (iid >= IID_WP_GLOCK && iid <= IID_WP_ACR) + //weapons with ammo, things with a toggle state #define NotStackable(iid) (IsRanged(iid)) @@ -176,6 +177,8 @@ float(float slotno, float iid) FitsInSlot; .float islot22; .float islot23; .float islot24; +.float mixslot1; +.float mixslot2; .float xslot1; .float xslot2; .float xslot3; @@ -197,7 +200,7 @@ float(float slotno, float iid) FitsInSlot; .float xslot19; .float xslot20; -#define MAXSLOTS 24 +#define MAXSLOTS 26 @@ -256,7 +259,10 @@ float(entity e, float slotno) ItemInSlot = return e.islot23; if (slotno == 24) return e.islot24; - + if (slotno == 25) + return e.mixslot1; + if (slotno == 26) + return e.mixslot2; return 0; }; @@ -310,6 +316,10 @@ void(entity e, float slotno, float item) SetItemSlot = e.islot23 = item; else if (slotno == 24) e.islot24 = item; + else if (slotno == 25) + e.mixslot1 = item; + else if (slotno == 26) + e.mixslot2 = item; }; float(entity e, float iid) SlotOfItem = @@ -362,6 +372,10 @@ float(entity e, float iid) SlotOfItem = return 23; if (ToIID(e.islot24) == iid) return 24; + if (ToIID(e.islot23) == iid) + return 25; + if (ToIID(e.islot24) == iid) + return 26; return 0; }; @@ -416,6 +430,10 @@ float(entity e, float iid) ShadowSlotOfItem = return 23; if (ToIID(getstati(98)) == iid) return 24; + if (ToIID(getstati(104)) == iid) + return 25; + if (ToIID(getstati(105)) == iid) + return 26; return 0; }; @@ -470,16 +488,17 @@ float(entity e, float iid) TotalQuantity = ret += ToStatus(e.islot23); if (ToIID(e.islot24) == iid) ret += ToStatus(e.islot24); + if (ToIID(e.mixslot1) == iid) + ret += ToStatus(e.mixslot1); + if (ToIID(e.mixslot2) == iid) + ret += ToStatus(e.mixslot2); return ret; }; float(entity e) FindEmptySlot = { - if (ToIID(e.islot3) == IID_NONE) - return 3; - if (ToIID(e.islot4) == IID_NONE) - return 4; + if (ToIID(e.islot5) == IID_NONE) return 5; if (ToIID(e.islot6) == IID_NONE) @@ -502,6 +521,8 @@ float(entity e) FindEmptySlot = return 14; if (ToIID(e.islot15) == IID_NONE) return 15; + if (ToIID(e.islot16) == IID_NONE) + return 16; return 0; }; @@ -614,7 +635,10 @@ slot_t(float slot) SlotField = return islot23; if (slot == 24) return islot24; - + if (slot == 25) + return mixslot1; + if (slot == 26) + return mixslot2; //bprint(PRINT_MEDIUM, "ERROR: Invalid slot number (", ftos(slot), ")\n"); return islot1; @@ -1391,97 +1415,97 @@ float(float iid) GetBaseValue = if (iid == IID_WP_WRENCH) - return 1; + return 5; if (iid == IID_WP_KNIFE) - return 1; + return 5; if (iid == IID_WP_AXE) - return 1; + return 15; if (iid == IID_WP_SPEAR) - return 1; + return 25; if (iid == IID_WP_USP) - return 7; + return 40; if (iid == IID_WP_USP_S) - return 7; + return 60; if (iid == IID_WP_GLOCK) - return 6; + return 30; if (iid == IID_WP_GLOCK_S) - return 6; + return 50; if (iid == IID_WP_DEAGLE) - return 9; + return 70; if (iid == IID_WP_DEAGLE_M) - return 9; + return 120; if (iid == IID_WP_NEEDLER) - return 10; + return 80; if (iid == IID_WP_ALIENBLASTER) - return 20; + return 200; if (iid == IID_WP_PIPERIFLE) - return 5; + return 15; if (iid == IID_WP_PIPERIFLE_S) - return 5; - if (iid == IID_WP_PIPERIFLE_R) - return 6; - if (iid == IID_WP_PIPERIFLE_SCOPE) - return 6; - if (iid == IID_WP_PIPERIFLE_S_R) - return 7; - if (iid == IID_WP_PIPERIFLE_SCOPE_R) - return 7; - if (iid == IID_WP_PIPERIFLE_SCOPE_S) - return 7; - if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) - return 8; - if (iid == IID_WP_WINCHESTER) - return 10; - if (iid == IID_WP_MOSSBERG) - return 15; - if (iid == IID_WP_JACKHAMMER) return 25; + if (iid == IID_WP_PIPERIFLE_R) + return 25; + if (iid == IID_WP_PIPERIFLE_SCOPE) + return 25; + if (iid == IID_WP_PIPERIFLE_S_R) + return 35; + if (iid == IID_WP_PIPERIFLE_SCOPE_R) + return 35; + if (iid == IID_WP_PIPERIFLE_SCOPE_S) + return 35; + if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) + return 50; + if (iid == IID_WP_WINCHESTER) + return 50; + if (iid == IID_WP_MOSSBERG) + return 150; + if (iid == IID_WP_JACKHAMMER) + return 250; if (iid == IID_WP_MP9) - return 10; + return 100; if (iid == IID_WP_MP9_S) - return 10; + return 125; if (iid == IID_WP_MP7) - return 11; + return 110; if (iid == IID_WP_MP7_S) - return 11; + return 125; if (iid == IID_WP_RANGEMASTER) - return 12; + return 80; if (iid == IID_WP_RANGEMASTER_SCOPE) - return 12; + return 120; if (iid == IID_WP_AK47) - return 20; + return 150; if (iid == IID_WP_AK112) - return 15; + return 140; if (iid == IID_WP_AK112_M) - return 17; + return 170; if (iid == IID_WP_AK74) return 20; if (iid == IID_WP_ACR) - return 24; + return 240; if (iid == IID_WP_DKS1) - return 25; + return 110; if (iid == IID_WP_DKS1_S) - return 25; - if (iid == IID_WP_MOONLIGHT) - return 30; - if (iid == IID_WP_G11) - return 75; - if (iid == IID_WP_GAUSERIFLE) - return 75; - if (iid == IID_WP_PULSERIFLE) - return 85; - if (iid == IID_WP_TURBOPLASMA) - return 100; - if (iid == IID_WP_PLASMACARBINE) - return 105; - if (iid == IID_WP_FNFAL) - return 50; - if (iid == IID_WP_ROCKETLAUNCHER) - return 100; - if (iid == IID_WP_LASERGATLING) return 150; + if (iid == IID_WP_MOONLIGHT) + return 225; + if (iid == IID_WP_G11) + return 240; + if (iid == IID_WP_GAUSERIFLE) + return 300; + if (iid == IID_WP_PULSERIFLE) + return 280; + if (iid == IID_WP_TURBOPLASMA) + return 380; + if (iid == IID_WP_PLASMACARBINE) + return 400; + if (iid == IID_WP_FNFAL) + return 190; + if (iid == IID_WP_ROCKETLAUNCHER) + return 200; + if (iid == IID_WP_LASERGATLING) + return 450; @@ -1526,66 +1550,66 @@ float(float iid) GetBaseValue = if (iid == IID_ARM_DESERT) - return 1; + return 45; if (iid == IID_ARM_SHIRT) - return 1; + return 50; if (iid == IID_ARM_LEATHER) - return 2; + return 90; if (iid == IID_ARM_KEVLAR) - return 3; + return 125; if (iid == IID_ARM_METAL) - return 4; + return 100; if (iid == IID_ARM_COMBAT) - return 5; + return 300; if (iid == IID_ARM_BROTHERHOOD) - return 8; + return 350; if (iid == IID_ARM_FORCE) - return 10; + return 500; if (iid == IID_ARM_LPOWER) - return 15; + return 550; if (iid == IID_CHEM_STIMPACK) - return 1; + return 5; if (iid == IID_CHEM_MEDICALBAG) - return 1; + return 25; if (iid == IID_CHEM_SUPERSTIM) - return 1; + return 15; if (iid == IID_CHEM_ADRENALINE) - return 1; + return 9; if (iid == IID_CHEM_PSYCHO) - return 1; + return 12; if (iid == IID_CHEM_BESERK) - return 1; + return 14; if (iid == IID_CHEM_RADX) - return 1; + return 15; if (iid == IID_EQUIP_MEDIC_BAG) - return 1; + return 35; if (iid == IID_EQUIP_GOGGLES) - return 1; + return 45; if (iid == IID_EQUIP_SILENCER) - return 1; + return 20; if (iid == IID_EQUIP_BELTPOUCH) - return 1; + return 70; if (iid == IID_EQUIP_TOOLKIT) - return 1; + return 50; if (iid == IID_EQUIP_BACKPACK) - return 1; + return 100; if (iid == IID_EQUIP_CLIMBINGGEAR) - return 1; + return 150; if (iid == IID_EQUIP_BATTERY) - return 1; + return 100; if (iid == IID_EQUIP_STEALTHBOY) - return 1; + return 50; if (iid == IID_EQUIP_SPRINTKIT) - return 1; + return 1000; if (iid == IID_EQUIP_HOVERBOOTS) - return 1; + return 1000; if (iid == IID_EQUIP_EXTENDER) - return 1; + return 10; if (iid == IID_EQUIP_XRAY) - return 1; + return 10; if (iid == IID_MISC_JUNK) return 0; diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index d570d1f50..cb89004f6 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -924,8 +924,169 @@ void() brotherhood_merchant = self.think = shop_face; self.nextthink = time + 0.5; - self.xslot1 = 412; - self.xslot2 = 413; + + if (random()*100 < 33) + { + self.xslot1 = SlotVal(IID_WP_MP9, 1); + self.xslot6 = SlotVal(IID_AM_10MM, 30); + } + else if (random()*100 < 33) + { + self.xslot1 = SlotVal(IID_WP_USP, 1); + self.xslot6 = SlotVal(IID_AM_45ACP, 30); + } + else + { + self.xslot1 = SlotVal(IID_WP_GLOCK, 1); + self.xslot6 = SlotVal(IID_AM_10MM, 30); + } + + if (random()*100 < 33) + { + self.xslot2 = SlotVal(IID_WP_DEAGLE, 1); + self.xslot7 = SlotVal(IID_AM_44MAGNUM, 30); + } + else if (random()*100 < 33) + { + self.xslot2 = SlotVal(IID_WP_NEEDLER, 1); + self.xslot7 = SlotVal(IID_AM_NEEDLER, 30); + } + else + { + self.xslot2 = SlotVal(IID_WP_PIPERIFLE, 1); + self.xslot7 = SlotVal(IID_AM_44MAGNUM, 30); + } + + if (random()*100 < 33) + { + self.xslot3 = SlotVal(IID_WP_WINCHESTER, 1); + self.xslot8 = SlotVal(IID_AM_12GAUGESHELLS, 30); + } + else if (random()*100 < 33) + { + self.xslot3 = SlotVal(IID_WP_RANGEMASTER, 1); + self.xslot8 = SlotVal(IID_AM_556MM, 30); + } + else + { + self.xslot3 = SlotVal(IID_WP_DKS1, 1); + self.xslot8 = SlotVal(IID_AM_762MM, 30); + } + + if (random()*100 < 33) + { + self.xslot4 = SlotVal(IID_WP_WINCHESTER, 1); + self.xslot9 = SlotVal(IID_AM_12GAUGESHELLS, 30); + } + else if (random()*100 < 33) + { + self.xslot4 = SlotVal(IID_WP_RANGEMASTER, 1); + self.xslot9 = SlotVal(IID_AM_556MM, 30); + } + else + { + self.xslot4 = SlotVal(IID_WP_DKS1, 1); + self.xslot9 = SlotVal(IID_AM_762MM, 30); + } + + if (random()*100 < 33) + { + self.xslot5 = SlotVal(IID_WP_AK112, 1); + self.xslot10 = SlotVal(IID_AM_556MM, 30); + } + else if (random()*100 < 33) + { + self.xslot5 = SlotVal(IID_WP_MOSSBERG, 1); + self.xslot10 = SlotVal(IID_AM_12GAUGESHELLS, 30); + } + else + { + self.xslot5 = SlotVal(IID_WP_MP7, 1); + self.xslot10 = SlotVal(IID_AM_45ACP, 30); + } + + + if (random()*100 < 50) + self.xslot11 = SlotVal(IID_ARM_SHIRT, 1); + else + self.xslot11 = SlotVal(IID_ARM_LEATHER, 1); + + if (random()*100 < 50) + self.xslot12 = SlotVal(IID_ARM_KEVLAR, 1); + else + self.xslot12 = SlotVal(IID_ARM_METAL, 1); + + if (random()*100 < 75) + self.xslot13 = SlotVal(IID_ARM_COMBAT, 1); + else + self.xslot13 = SlotVal(IID_ARM_BROTHERHOOD, 1); + + + if (random()*100 < 75) + self.xslot14 = SlotVal(IID_GREN_FRAG, 1); + else + self.xslot14 = SlotVal(IID_GREN_FLASH, 1); + + if (random()*100 < 75) + self.xslot15 = SlotVal(IID_GREN_SMOKE, 1); + else + self.xslot15 = SlotVal(IID_GREN_STUN, 1); + + if (random()*100 < 80) + self.xslot16 = SlotVal(IID_WP_AK112, 1); + else if (random()*100 < 20) + self.xslot16 = SlotVal(IID_WP_MOSSBERG, 1); + else if (random()*100 < 20) + self.xslot16 = SlotVal(IID_WP_FNFAL, 1); + else if (random()*100 < 20) + self.xslot16 = SlotVal(IID_WP_MOONLIGHT, 1); + else + self.xslot16 = SlotVal(IID_WP_G11, 1); + + if (random()*100 < 80) + self.xslot17 = SlotVal(IID_WP_DKS1, 1); + else if (random()*100 < 20) + self.xslot17 = SlotVal(IID_WP_JACKHAMMER, 1); + else if (random()*100 < 20) + self.xslot17 = SlotVal(IID_WP_PLASMACARBINE, 1); + else if (random()*100 < 20) + self.xslot17 = SlotVal(IID_WP_ROCKETLAUNCHER, 1); + else + self.xslot17 = SlotVal(IID_WP_LASERGATLING, 1); + + if (random()*100 < 20) + self.xslot18 = SlotVal(IID_AM_ENERGYCELL, 30); + else if (random()*100 < 20) + self.xslot18 = SlotVal(IID_EQUIP_BELTPOUCH, 1); + else if (random()*100 < 20) + self.xslot18 = SlotVal(IID_EQUIP_STEALTHBOY, 1); + else if (random()*100 < 20) + self.xslot18 = SlotVal(IID_EQUIP_CLIMBINGGEAR, 1); + else + self.xslot18 = SlotVal(IID_EQUIP_TOOLKIT, 1); + + if (random()*100 < 20) + self.xslot19 = SlotVal(IID_EQUIP_MEDIC_BAG, 1); + else if (random()*100 < 20) + self.xslot19 = SlotVal(IID_AM_CASELESS, 30); + else if (random()*100 < 20) + self.xslot19 = SlotVal(IID_AM_2MMEC, 30); + else if (random()*100 < 20) + self.xslot19 = SlotVal(IID_EQUIP_BACKPACK, 1); + else + self.xslot19 = SlotVal(IID_EQUIP_TOOLKIT, 1); + + + if (random()*100 < 20) + self.xslot20 = SlotVal(IID_MISC_NUKACOLA, 1); + else if (random()*100 < 20) + self.xslot20 = SlotVal(IID_MISC_CHEMICALS, 1); + else if (random()*100 < 20) + self.xslot20 = SlotVal(IID_MISC_AEROSOL, 1); + else if (random()*100 < 20) + self.xslot20 = SlotVal(IID_MISC_DUCKTAPE, 1); + else + self.xslot20 = SlotVal(IID_MISC_XRAYTUBE, 1); }; void() brotherhood_sergeant = @@ -984,6 +1145,18 @@ void() brotherhood_doctor = self.solid = SOLID_SLIDEBOX; setsize (self, '-16 -16 -24', '16 16 32'); self.takedamage = DAMAGE_NO; + self.classname = "merchant"; + self.think = shop_face; + self.nextthink = time + 0.5; + + self.xslot1 = SlotVal(IID_WP_KNIFE, 1); + self.xslot2 = SlotVal(IID_WP_NEEDLER, 1); + self.xslot3 = SlotVal(IID_ARM_LEATHER, 1); + self.xslot16 = SlotVal(IID_CHEM_STIMPACK, 5); + self.xslot17 = SlotVal(IID_CHEM_MEDICALBAG, 4); + self.xslot18 = SlotVal(IID_CHEM_SUPERSTIM, 3); + self.xslot19 = SlotVal(IID_CHEM_ADRENALINE, 3); + self.xslot20 = SlotVal(IID_CHEM_PSYCHO, 3); }; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index b17285ae7..e7eed3f62 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1755,20 +1755,17 @@ void() W_ChangeWeapon = CheatCommand ============ */ + + void() CheatCommand = { local float x; local string y; -/* - x = self.waterlevel; - y = ftos(x); - sprint(self, 2, "waterlevel: "); - sprint(self, 2, y); - sprint(self, 2, "\n"); - self.ammo_shells = 900; - self.currentmenu = "gain_skill"; -*/ + self.islot17 = SlotVal(IID_MISC_CHEMICALS, 50); + self.islot18 = SlotVal(IID_MISC_NUKACOLA, 50); + self.islot19 = SlotVal(IID_MISC_AEROSOL, 50); + self.islot20 = SlotVal(IID_MISC_GUM, 50); }; /* @@ -2456,8 +2453,8 @@ void () Explosion = { local float r; - self.effects = EF_DIMLIGHT; - self.touch = SUB_Null; + //self.effects = EF_DIMLIGHT; + //self.touch = SUB_Null; r = random (); if (r < 0.33) @@ -2472,12 +2469,12 @@ void () Explosion = WriteCoord (MSG_BROADCAST, self.origin_x); WriteCoord (MSG_BROADCAST, self.origin_y); WriteCoord (MSG_BROADCAST, self.origin_z); - Screenshake (); - self.frame = 3; - self.velocity = VEC_ORIGIN; - self.avelocity = '300 300 250'; - self.think = ExplosionFrames; - self.nextthink = (time + 0.02); + //Screenshake (); + //self.frame = 3; + //self.velocity = VEC_ORIGIN; + //self.avelocity = '300 300 250'; + //self.think = ExplosionFrames; + //self.nextthink = (time + 0.02); }; void () FragExplode = @@ -3715,9 +3712,6 @@ void () WeaponTouch = x = (ToIID(self.islot1)); - if (IsJunk(x) && other.class != 4) - return; - if (ItemInSlot(other, other.current_slot) == 0 && FitsInSlot(other.current_slot, ToIID(self.islot1))) slotnum = other.current_slot; if (!slotnum) @@ -4196,8 +4190,8 @@ void () UseStimpack = thing = thing.chain; } - self.health = self.health + 10; - self.regen = self.regen + 10; + self.health = self.health + 20; + self.regen = self.regen + (5 + (self.skill_doctor)); } } else if (trace_ent.classname == "player")//healing another team-mate @@ -4268,8 +4262,8 @@ void () UseStimpack = sprint(self, PRINT_MEDIUM, trace_ent.netname); sprint(self, PRINT_MEDIUM, " with a stimpack\n"); - trace_ent.health = trace_ent.health + 10; - trace_ent.regen = trace_ent.regen + 10; + trace_ent.health = trace_ent.health + 20; + trace_ent.regen = trace_ent.regen + (5 + (self.skill_doctor)); } } } @@ -5643,25 +5637,25 @@ void () shop_face = self.enemy = te; te.safezone = 1; te.xslot1 = self.xslot1; - te.xslot1 = self.xslot2; - te.xslot1 = self.xslot3; - te.xslot1 = self.xslot4; - te.xslot1 = self.xslot5; - te.xslot1 = self.xslot6; - te.xslot1 = self.xslot7; - te.xslot1 = self.xslot8; - te.xslot1 = self.xslot9; - te.xslot1 = self.xslot10; - te.xslot1 = self.xslot11; - te.xslot1 = self.xslot12; - te.xslot1 = self.xslot13; - te.xslot1 = self.xslot14; - te.xslot1 = self.xslot15; - te.xslot1 = self.xslot16; - te.xslot1 = self.xslot17; - te.xslot1 = self.xslot18; - te.xslot1 = self.xslot19; - te.xslot1 = self.xslot20; + te.xslot2 = self.xslot2; + te.xslot3 = self.xslot3; + te.xslot4 = self.xslot4; + te.xslot5 = self.xslot5; + te.xslot6 = self.xslot6; + te.xslot7 = self.xslot7; + te.xslot8 = self.xslot8; + te.xslot9 = self.xslot9; + te.xslot10 = self.xslot10; + te.xslot11 = self.xslot11; + te.xslot12 = self.xslot12; + te.xslot13 = self.xslot13; + te.xslot14 = self.xslot14; + te.xslot15 = self.xslot15; + te.xslot16 = self.xslot16; + te.xslot17 = self.xslot17; + te.xslot18 = self.xslot18; + te.xslot19 = self.xslot19; + te.xslot20 = self.xslot20; } te = te.chain; } diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index e0ba0f080..87d055f93 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -97,11 +97,12 @@ void() SetupStats = clientstat(97, 2, islot23); clientstat(98, 2, islot24); clientstat(99, 2, recoil); - clientstat(81, 2, skill_combat); - clientstat(82, 2, skill_doctor); - clientstat(83, 2, skill_sneak); - clientstat(84, 2, skill_science); - + clientstat(100, 2, skill_combat); + clientstat(101, 2, skill_doctor); + clientstat(102, 2, skill_sneak); + clientstat(103, 2, skill_science); + clientstat(104, 2, mixslot1); + clientstat(105, 2, mixslot2); clientstat(108, 2, safezone); clientstat(109, 2, connected); clientstat(110, 2, steadyaim); @@ -2101,6 +2102,7 @@ void() worldspawn = precache_sound ("misc/hosdie2.wav"); precache_sound ("misc/hosdown.wav"); precache_sound ("misc/rescued.wav"); + precache_sound ("misc/beep1.wav"); precache_sound ("player/gib1.wav"); precache_sound ("player/step1.wav"); diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index 49449ac0c..efbda82a9 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -697,6 +697,7 @@ void (entity stuff) spawn_zombie = self.th_run = zombie_run1; self.th_pain = zombie_pain; self.th_die = zombie_die; + self.th_melee = zombie_melee; self.th_missile = zombie_missile; self.target = stuff.target; walkmonster_start_go (); @@ -747,8 +748,8 @@ void () spawn_ghoul_copy = self.th_run = zombie_run1; self.th_pain = zombie_pain; self.th_die = zombie_die; - if (random()<0.1) - self.th_missile = zombie_missile; + self.th_melee = zombie_melee; + self.th_missile = zombie_missile; self.angles_y = random()*360; self.origin = self.origin + '0 64 0'; @@ -840,8 +841,8 @@ void (vector jojo) spawn_ghoul = self.th_run = zombie_run1; self.th_pain = zombie_pain; self.th_die = zombie_die; - if (random()<0.1) - self.th_missile = zombie_missile; + self.th_melee = zombie_melee; + self.th_missile = zombie_missile; self.angles_y = random()*360; self.origin = jojo + '0 64 0'; @@ -930,8 +931,6 @@ void() monster_zombie = self.th_run = zombie_run1; self.th_die = zombie_die; self.th_melee = zombie_melee; - - self.th_missile = zombie_missile; self.angles_y = random()*360;