diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 72ecc4683..d050982df 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -552,6 +552,7 @@ void() PutClientInServer = self.max_health = 100; if (self.class == 4) self.max_health = 60; + self.equipment_slot = 0; self.health = self.max_health; @@ -804,6 +805,13 @@ void () LocateSpectatorTarget = local entity ke; local entity de; + if (self.button1) + { + bprint(PRINT_MEDIUM, self.classname); + bprint(PRINT_MEDIUM, " is dying...\n"); + return; + } + if (self.ghost == 1) { ke = find (world, classname, "player"); @@ -1185,6 +1193,8 @@ void () PositionControl = } }; +.float gravity; +.vector movement; /* ================ PlayerPreThink @@ -1232,13 +1242,15 @@ void() PlayerPreThink = self.health = self.max_health; - if (self.ragetime > time) - stuffcmd(self, "v_cshift 75 0 0 75\n"); - else if (self.sneak > 0) - stuffcmd(self, "v_cshift 0 75 0 75\n"); - else - stuffcmd(self, "v_cshift 0 0 0 0\n"); - + if (self.flash < time) + { + if (self.ragetime > time) + stuffcmd(self, "v_cshift 75 0 0 75\n"); + else if (self.sneak > 0) + stuffcmd(self, "v_cshift 0 75 0 75\n"); + else + stuffcmd(self, "v_cshift 0 0 0 0\n"); + } self.cycle1 = time + 0.5; } @@ -1263,8 +1275,13 @@ void() PlayerPreThink = if (self.team == 0 && self.currentmenu == "none") { - self.currentmenu = "select_team"; - DisplayMenu (); + if (coop) + self.team = 1; + else + { + self.currentmenu = "select_team"; + DisplayMenu (); + } } else if (self.class == 0 && self.currentmenu == "none") { @@ -1320,7 +1337,10 @@ void() PlayerPreThink = self.regen = self.regen - 1; } - stuffcmd(self, "v_idlescale 0\n"); + if (self.flash < time) + { + stuffcmd(self, "v_idlescale 0\n"); + } self.cycle2 = time + 1; } @@ -1343,6 +1363,31 @@ void() PlayerPreThink = // teleporters can force a non-moving pause time if (time < self.pausetime) self.velocity = '0 0 0'; + + if (!self.gravity) + { //climbing gear + if (self.velocity != '0 0 0' || self.button2) + self.gravity = 1; + } + if (self.equipment_slot) + { + if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_CLIMBINGGEAR) + { + traceline ((self.origin - '0 0 24'), ((self.origin + (v_forward * EF_FLAG2)) - '0 0 24'), FALSE, self); + if (trace_fraction < 1 && trace_fraction > 0) + { + self.gravity = 0; + self.maxspeed = 50; + self.velocity = v_forward*40 * self.movement_x; + } + else + { + self.gravity = 1; + } + } + else + dprint("Bad equipment item\n"); + } }; /* @@ -1588,8 +1633,6 @@ called when a player connects to a server */ void() ClientConnect = { - total_players = total_players + 1; - bprint (PRINT_HIGH, self.netname); bprint (PRINT_HIGH, " entered the game\n"); @@ -1606,7 +1649,10 @@ void() ClientConnect = stuffcmd(self, "alias info impulse 56\n"); stuffcmd(self, "alias equip impulse 57\n"); - stuffcmd(self, "alias stimpack cmd invuse superstims+stimpack+bandages\n"); + stuffcmd(self, "alias stimpack \"cmd invuse superstims+stimpack+bandages\"\n"); + stuffcmd(self, "alias bandages \"cmd invuse bandages+superstims+stimpack\"\n"); + + stuffcmd(self, "alias toolkit \"cmd invswap toolkit 2;impulse 2\"\n"); stuffcmd(self, "bind c equip\n"); stuffcmd(self, "bind g drop\n"); @@ -1636,8 +1682,6 @@ called when a player disconnects from a server */ void() ClientDisconnect = { - total_players = total_players - 1; - // let everyone else know bprint (PRINT_HIGH, self.netname); bprint (PRINT_HIGH, " left the game with "); @@ -2018,20 +2062,22 @@ void() Identify = local float tmp; makevectors (self.v_angle); - traceline (self.origin, (self.origin + (v_forward * 2000)), FALSE, self); + traceline (self.origin, (self.origin + (v_forward * 2000)), 32, self); if (trace_ent.classname == "player" && self.currentmenu == "none" && self.team == trace_ent.team) { if (trace_ent.class == 2) - c1 = "\nmedic\n"; + c1 = "^7\nmedic\n"; else if (trace_ent.class == 3) - c1 = "\nassassin\n"; + c1 = "^7\nassassin\n"; else if (trace_ent.class == 4) - c1 = "\nsoldier\n"; + c1 = "^7\nsoldier\n"; else if (trace_ent.class == 6) - c1 = "\nscientist\n"; + c1 = "^7\nscientist\n"; else - c1 = "\n"; + c1 = "^7\n"; + if (trace_ent.health <= 0) + c2 = "^1dead^7"; c2 = ftos (trace_ent.health); c3 = GetItemName (ToIID(ItemInSlot(trace_ent, trace_ent.current_slot))); diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 10a4a40c5..17da88404 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -2,13 +2,28 @@ void(entity e, string s) clientcommand = #440 float(string s) tokenize = #441; string(float n) argv = #442; +string(string s, float start, float length) substring = #116; +float(string str, string sub) strstrofs = #221; + float(string desc) itemtoslot = { local float slot; + local float coma; + + while((coma = strstrofs(desc, "+")) > 0) + { + slot = itemtoslot(substring(desc, 0, coma)); + if (slot) + return slot; + desc = substring(desc, coma+1, -1); + } + slot = stof(desc); if (slot >= 1 && slot <= MAXSLOTS) return slot; + if (desc == "current") + return self.current_slot; slot = ItemIDOfName(desc); if (!slot) { @@ -20,8 +35,6 @@ float(string desc) itemtoslot = slot = SlotOfItem(self, slot); if (slot) return slot; - - sprint(self, PRINT_HIGH, "You don't have one of those\n"); return 0; } }; @@ -55,6 +68,7 @@ void(string arg1) Cmd_InvUse = slotno = itemtoslot(arg1); if (!slotno) { + sprint(self, PRINT_MEDIUM, "Can't use - you don't have one\n"); return; } @@ -93,13 +107,29 @@ void(string arg1) Cmd_InvUse = if (iid == IID_BUILD_MRAMMO || iid == IID_BUILD_SHIELDGEN || iid == IID_BUILD_AUTODOC || - iid == IID_BUILD_ROBOFANG) + iid == IID_BUILD_ROBOFANG || + iid == IID_BUILD_TESLA) { if (spawn_station(iid)) DecreaseDestroySlot(slotno); return; } + if (iid == IID_EQUIP_CLIMBINGGEAR) + { + if (self.equipment_slot == slotno) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, "Climbing gear deactivated\n"); + } + else + { + self.equipment_slot = slotno; + sprint(self, PRINT_HIGH, "Climbing gear activated\n"); + } + return; + } + sprint(self, PRINT_HIGH, "Don't know how to 'use' item\n"); }; @@ -110,6 +140,7 @@ void(string arg1) Cmd_InvDrop = slotno = itemtoslot(arg1); if (!slotno) { + sprint(self, PRINT_MEDIUM, "Can't drop - you don't have one\n"); return; } @@ -131,16 +162,21 @@ void(string arg1, string arg2) Cmd_InvSwap = slotno1 = itemtoslot(arg1); if (!slotno1) { + sprint(self, PRINT_HIGH, "No item\n"); return; } slotno2 = itemtoslot(arg2); if (!slotno2) { + sprint(self, PRINT_HIGH, "No item\n"); return; } old1 = ItemInSlot(self, slotno1); old2 = ItemInSlot(self, slotno2); + if (old1 == old2) + return; + if (!FitsInSlot(slotno1, ToIID(old2))) { sprint(self, PRINT_HIGH, "Not allowed to exchange items\n"); @@ -156,6 +192,8 @@ void(string arg1, string arg2) Cmd_InvSwap = if (slotno1 == self.current_slot || slotno2 == self.current_slot) W_SetCurrentAmmo(); + + self.rtime = time + 2; //we don't check this here though - cost to get into inventory. }; void(string arg1, float iid, float num) Cmd_InvGive = @@ -164,6 +202,7 @@ void(string arg1, float iid, float num) Cmd_InvGive = slotno = itemtoslot(arg1); if (!slotno) { + sprint(self, PRINT_MEDIUM, "Can't give to that slot\n"); return; } @@ -181,24 +220,28 @@ void(string line) SV_ParseClientCommand = tokenize(line); cmd = argv(0); - if (self.deadflag) - { //no inventory stuff while dead. - clientcommand(self, line); - } - else if (cmd == "invuse") + if (cmd == "invuse") { + if (self.deadflag) + return; Cmd_InvUse(argv(1)); } else if (cmd == "invdrop") { + if (self.deadflag) + return; Cmd_InvDrop(argv(1)); } else if (cmd == "invswap") { + if (self.deadflag) + return; Cmd_InvSwap(argv(1), argv(2)); } else if (cmd == "invgive") { + if (self.deadflag) + return; Cmd_InvGive(argv(1), stof(argv(2)), stof(argv(3))); } else if (cmd == "god") diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index cce7113f1..3e20f9cd0 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -74,7 +74,7 @@ void(entity targ, entity attacker) Killed = self.enemy = attacker; targ.grab = 0; - targ.equipment_state = 0; //turn off stealth-boys, climbing gear, etc + targ.equipment_slot = 0; //turn off stealth-boys, climbing gear, etc // bump the monster counter if (self.flags & FL_MONSTER) diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 129b3a608..b677a0986 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -624,7 +624,7 @@ float red_armor; .float action_points; .float pcamera; .float pcamera2; -.float equipment_state; +.float equipment_slot; //.float select; //.float grenade_hold; .float grab; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 09b3418a9..8e5bf41d1 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -76,6 +76,10 @@ float IID_BUILD_MRAMMO = 350; float IID_BUILD_SHIELDGEN = 351; float IID_BUILD_AUTODOC = 352; float IID_BUILD_ROBOFANG = 353; +float IID_BUILD_TESLA = 354; +//float IID_BUILD_TELEPAD = 355; + +float IID_EQUIP_CLIMBINGGEAR = 375; #define IsShootable(iid) (IsMelee(iid) || IsRanged(iid) || IsGrenade(iid)) @@ -124,6 +128,10 @@ void() SetupStats = clientstat(2, 45, "islot14"); clientstat(2, 46, "islot15"); clientstat(2, 47, "islot16"); + + clientstat(2, 61, "current_slot"); + clientstat(2, 62, "team"); + clientstat(2, 63, "class"); }; @@ -460,6 +468,14 @@ string(float iid) GetItemVModel = if (iid == IID_WP_MOONLIGHT) return "progs/v_night.mdl"; + + if (iid == IID_WP_SA80) + return "progs/v_sa80.mdl"; + if (iid == IID_WP_GAUSERIFLE) + return "progs/v_gauss.mdl"; + if (iid == IID_WP_PULSERIFLE) + return "progs/v_carbine.mdl"; + if (iid == IID_GREN_FRAG) return "progs/v_handgren.mdl"; if (iid == IID_GREN_EMP) @@ -520,7 +536,7 @@ string(float iid) GetItemWModel = if (iid == IID_WP_GAUSERIFLE) return "progs/w_gauss.mdl"; - if (iid == IID_AM_ENERGYCELL) + if (iid == IID_WP_PULSERIFLE) return "progs/w_carbine.mdl"; if (iid == IID_GREN_FRAG) @@ -857,13 +873,30 @@ string(float iid) GetItemName = if (iid == IID_BUILD_ROBOFANG) return "robofang"; + if (iid == IID_EQUIP_CLIMBINGGEAR) + return "climbing gear"; + bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n"); return strcat("unknown", ftos(iid)); }; string(float iid) GetItemDesc = { + if (iid == IID_NONE) return ""; + + + if (iid == IID_WP_TOOLKIT) + return "a wattz(tm) brand toolkit consisting of many handy instruments, including a wrench. this kit is a repairman's dream, and allows those with the proper knowledge to perform technical tasks."; + if (iid == IID_WP_AK74) + return "the ak74 is the predecessor of the legendary ak-47. it is still the same old killing machine, except that it uses the 5.45mm high-velocity round that was common in the latest assault rifles just before the war."; + if (iid == IID_BUILD_MRAMMO) + return "a military prototype, the mr. ammo was designed to allow soldiers an extra source of ammunition in remote areas, as the handy little machine is capable of churning out ammo from things such as rocks, debris, and metal scraps."; + if (iid == IID_EQUIP_CLIMBINGGEAR) + return "FIXME:\nActivate, and then run at and up a wall. Don't look too far away from the wall!"; + + bprint(PRINT_MEDIUM, ftos(iid), " without a desc!\n"); + return strcat("", ftos(iid)); }; string(float iid) GetItemImage = @@ -932,7 +965,7 @@ string(float iid) GetItemImage = return "556mm.jpg"; if (iid == IID_AM_5MMHIGHVEL) return "5mmhv.jpg"; - if (iid == IID_AM_5MMHIGHVEL) + if (iid == IID_AM_12GAUGESHELLS) return "12gauge.jpg"; if (iid == IID_AM_ENERGYCELL) return "cell.jpg"; @@ -940,7 +973,7 @@ string(float iid) GetItemImage = return "762mm.jpg"; if (iid == IID_AM_44MAGNUM) return "44mag.jpg"; - if (iid == IID_AM_44MAGNUM) + if (iid == IID_AM_45ACP) return "45acp.jpg"; @@ -995,6 +1028,9 @@ string(float iid) GetItemImage = if (iid == IID_BUILD_ROBOFANG) return "robofang.jpg"; + if (iid == IID_EQUIP_CLIMBINGGEAR) + return "robofang.jpg"; + bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n"); return strcat("unknown.jpg", ftos(iid)); }; @@ -1018,10 +1054,14 @@ float(string itname) ItemIDOfName = return IID_WP_USP; if (itname == "desert eagle") return IID_WP_DEAGLE; + if (itname == "deagle") + return IID_WP_DEAGLE; if (itname == "needler") return IID_WP_NEEDLER; if (itname == "alien blaster") return IID_WP_ALIENBLASTER; + if (itname == "blaster") + return IID_WP_ALIENBLASTER; if (itname == "pipe rifle") return IID_WP_PIPERIFLE; if (itname == "winchester") @@ -1106,6 +1146,10 @@ float(string itname) ItemIDOfName = return IID_BUILD_ROBOFANG; if (itname == "doggie") return IID_BUILD_ROBOFANG; + if (itname == "climbinggear") + return IID_EQUIP_CLIMBINGGEAR; + if (itname == "gear") + return IID_EQUIP_CLIMBINGGEAR; return 0; }; diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index 16095006f..06f361bdf 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -3,7 +3,9 @@ void(entity to, float iid, float amount) AddNonStackable = { local float slot; - slot = FindSuitableEmptySlot(to, iid); + slot = SlotOfItem(to, iid); + if (!slot) + slot = FindSuitableEmptySlot(to, iid); if (slot) SetItemSlot(to, slot, SlotVal(iid, amount)); }; @@ -12,9 +14,7 @@ void(entity to, float iid, float amount) AddStackable = { local float slot; - slot = SlotOfItem(to, iid); - if (!slot) - slot = FindSuitableEmptySlot(to, iid); + slot = FindSuitableEmptySlot(to, iid); if (slot) SetItemSlot(to, slot, SlotVal(iid, amount + ToStatus(ItemInSlot(to, slot)))); } @@ -102,6 +102,9 @@ void(float cost, float type) BuyChem = else max = 2; + if (type == IID_CHEM_MEDICALBAG) + max = 50; + alreadygot = TotalQuantity(self, type); if (alreadygot >= max) { @@ -137,42 +140,6 @@ void(string type) ChangeAmmo = self.ammotype2 = type; }; -void() BuyScraps = -{ - local string y; - - if (self.ammo_shells < 5) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "not enough money.\n"); - return; - } - if (self.class != 6) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "not a scientist.\n"); - return; - } - if (self.scraps >= 15) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "too many metal scraps.\n"); - return; - } - - sound (self, CHAN_BODY, "items/armor1.wav", 1, ATTN_NORM); - self.scraps = self.scraps + 5; - self.ammo_shells = self.ammo_shells - 5; - if (self.scraps > 15) - self.scraps = 15; - y = ftos(self.scraps); - sprint(self, PRINT_HIGH, "you now have "); - sprint(self, PRINT_HIGH, y); - sprint(self, PRINT_HIGH, "/15 scraps.\n"); - -}; - - void (float wt, float cost, float wid) BuyWeapon = { local string itname; @@ -682,6 +649,8 @@ void() W_PlayerMenu = if (self.currentmenu == "shop_other") { + if (self.impulse == 1) + BuyChem(5, IID_CHEM_MEDICALBAG); if (self.impulse == 3) BuyStackable(20, IID_BUILD_MRAMMO); if (self.impulse == 4) @@ -788,6 +757,7 @@ void() W_PlayerMenu = { sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; + centerprint(self, ""); PutClientInServer(); self.impulse = 0; return; diff --git a/quakec/fallout2/mod_menus.qc b/quakec/fallout2/mod_menus.qc index a424854b7..5b9a83c83 100644 --- a/quakec/fallout2/mod_menus.qc +++ b/quakec/fallout2/mod_menus.qc @@ -36,57 +36,143 @@ weaponry\n\n string () ShopString = { - return ("--- S H O P -------\n\n1 traits \n2 perks \n3 body armour \n4 protection \n5 weapons \n6 equipment \n7 chems \ne leave \n"); + return ("--- S H O P -------\n" + "\n" + "1 traits \n" + "2 perks \n" + "3 body armour \n" + "4 protection \n" + "5 weapons \n" + "6 equipment \n" + "7 chems \n" + "e leave \n"); }; string () WeaponString = { - return ("weaponry\n\n1 melee \n2 thrown \n3 pistols&smgs \n4 shotguns \n5 rifles \ne leave \n"); + return ("weaponry\n" + "\n" + "1 melee \n" + "2 thrown \n" + "3 pistols&smgs \n" + "4 shotguns \n" + "5 rifles \n" + "e leave \n"); }; string () TraitString = { - return ("traits\n\n1 one handed \n2 small frame \n3 bruiser \n4 heavy handed \n5 bloody mess \n6 bad luck \ne leave \n"); + return ("traits\n" + "\n" + "1 one handed \n" + "2 small frame \n" + "3 bruiser \n" + "4 heavy handed \n" + "5 bloody mess \n" + "6 bad luck \n" + "e leave \n"); }; string () MiscString = { - return ("grenades\n GRENADE | COST \n\n1 plasma grenade 11\n2 frag grenade 5\n3 emp grenade 3\n4 smoke grenade 2\n5 flash bang mark ii 2\ne exit \n"); + return ("grenades\n" + " GRENADE | COST \n" + "\n" + "1 plasma grenade 11\n" + "2 frag grenade 5\n" + "3 emp grenade 3\n" + "4 smoke grenade 2\n" + "5 flash bang mark ii 2\n" + "e exit \n"); }; string () BuildString = { - return ("BUILD A STRUCTURE\n NAME | UPGRADE | COST \n\n1 supply depot ammo/hp 4\n2 arms lab weapons +10% 6\n3 armory armour +10% 10\n4 proto-lab gadgets/hrdwr 15\ne exit \n"); + return ("BUILD A STRUCTURE\n" + " NAME | UPGRADE | COST \n" + "\n" + "1 supply depot ammo/hp 4\n" + "2 arms lab weapons +10% 6\n" + "3 armory armour +10% 10\n" + "4 proto-lab gadgets/hrdwr 15\n" + "e exit \n"); }; string () HelmetString = { - return ("helmets\nprotect you from headshots so\nmake sure you use a decent one\n\n ABS% WT DEFLECT PRC\n1 combat helm -10% 01 5% 05\n2 combat helm 2 +0% 02 5% 20\n3 heavy-duty +20% 03 5% 20\n4 ceramic helm -20% ..."); + return ("helmets\nprotect you from headshots so\n" + "make sure you use a decent one\n" + "\n" + " ABS% WT DEFLECT PRC\n" + "1 combat helm -10% 01 5% 05\n" + "2 combat helm 2 +0% 02 5% 20\n" + "3 heavy-duty +20% 03 5% 20\n" + "4 ceramic helm -20% ..."); }; string () ArmorString1 = { - return ("body armour\n wt abs prc\n\n1 vault suit 03 1/20% 03$\n2 leather armor 07 2/30% 05$\n3 kevlar armor 10 3/35% 08$\n4 combat armor 13 4/40% 11$\n5 brotherhood armor 17 5/45% 15$"); + return ("body armour\n" + " wt abs prc\n" + "\n" + "1 vault suit 03 1/20% 03$\n" + "2 leather armor 07 2/30% 05$\n" + "3 kevlar armor 10 3/35% 08$\n" + "4 combat armor 13 4/40% 11$\n" + "5 brotherhood armor 17 5/45% 15$"); }; string () ArmorString2 = { - return ("body armour\n WT ABS SPEC PRC\n\n1 battle gear 08 57% NONE 50\n2 battle gear ii 09 62% !EXP 60\n3 high-tech suit 09 42% +ALL 60\n4 carbon-fiber mesh 09 56% !ENR 70\n5 pseudo-chitin suit 07..."); + return ("body armour\n" + " WT ABS SPEC PRC\n" + "\n" + "1 battle gear 08 57% NONE 50\n" + "2 battle gear ii 09 62% !EXP 60\n" + "3 high-tech suit 09 42% +ALL 60\n" + "4 carbon-fiber mesh 09 56% !ENR 70\n" + "5 pseudo-chitin suit 07..."); }; string () ArmorString3 = { - return ("special body armour\n WT ABS SPEC PRC\n1 vsn force mail 07 %40 DFLC 95c\n2 super chitin 08 %35 DFLC 95c\n3 suit of mota 14 %70 HEAL 95c\n0 previous \ne exit ..."); + return ("special body armour\n" + " WT ABS SPEC PRC\n" + "1 vsn force mail 07 %40 DFLC 95c\n" + "2 super chitin 08 %35 DFLC 95c\n" + "3 suit of mota 14 %70 HEAL 95c\n" + "0 previous \n" + "e exit ..."); }; string () PlusString = { - return ("perks\n ABILITY | FRAGS NEEDED \n\n1 bonus movement 8\n2 weapons handling 12\n3 quick pockets 14\n4 awareness 15\n5 silent running 17\n6 better criticals 23\n7 bonus ranged damage 26\n8 strong back ..."); + return ("perks\n" + " ABILITY | FRAGS NEEDED \n" + "\n" + "1 bonus movement 8\n" + "2 weapons handling 12\n" + "3 quick pockets 14\n" + "4 awareness 15\n" + "5 silent running 17\n" + "6 better criticals 23\n" + "7 bonus ranged damage 26\n" + "8 strong back ..."); }; string () PlusString2 = { - return ("perks\n ABILITY | FRAGS NEEDED \n\n1 bonus movement 8\n2 weapons handling 12\n3 quick pockets 14\n4 awareness 15\n5 silent running 17\n6 better criticals 23\n7 bonus ranged damage 26\n8 strong back ..."); + return ("perks\n" + " ABILITY | FRAGS NEEDED \n" + "\n" + "1 bonus movement 8\n" + "2 weapons handling 12\n" + "3 quick pockets 14\n" + "4 awareness 15\n" + "5 silent running 17\n" + "6 better criticals 23\n" + "7 bonus ranged damage 26\n" + "8 strong back ..."); }; /* 5 energy shield |front :25% 25 @@ -144,12 +230,28 @@ string () SmallArmString3 = string () DrugString1 = { - return ("drugs\n DRUG | EFFECTS | PRICE\n\n1 stimpack heals 40 3$\n2 medkit+ heals 20+50 5$\n3 superstim* heals 40+60 12$\ne exit \n\n\n+ requires medic \n* requires medic with 7+ kills"); + return ("drugs\n DRUG | EFFECTS | PRICE\n" + "\n""1 stimpack heals 40 3$\n" + "2 medkit+ heals 20+50 5$\n" + "3 superstim* heals 40+60 12$\n" + "e exit \n" + "\n" + "\n" + "+ requires medic \n" + "* requires medic with 7+ kills"); }; string () DrugString2 = { - return ("drugs\n DRUG | EFFECTS | PRICE\n\n1 stimpack heals 40 3$\n2 adrenaline +60 speed/jump 7$\n3 psycho+ +60 hp/no pain 15$\n4 medkit* heals 20+50 12$\n5 berserk* adren+psycho 21$\ne exit \n"); + return ( + "drugs\n DRUG | EFFECTS | PRICE\n" + "\n" + "1 stimpack heals 40 3$\n" + "2 adrenaline +60 speed/jump 7$\n" + "3 psycho+ +60 hp/no pain 15$\n" + "4 medkit* heals 20+50 12$\n" + "5 berserk* adren+psycho 21$\n" + "e exit \n"); }; string () EnergyWeaponsString = diff --git a/quakec/fallout2/ogre.qc b/quakec/fallout2/ogre.qc index 2c7def3b8..e15ad15fe 100644 --- a/quakec/fallout2/ogre.qc +++ b/quakec/fallout2/ogre.qc @@ -14,6 +14,45 @@ void () OgreGrenadeExplode = remove (self); }; +void () LobAGrenade = +{ + newmis = spawn (); + newmis.owner = self; + newmis.movetype = MOVETYPE_BOUNCE; + newmis.solid = SOLID_BBOX; + newmis.classname = "grenade"; + + newmis.skin = 0; + makevectors (self.angles); + + newmis.velocity = v_forward * 800; + newmis.velocity_z = (newmis.velocity_z + 200); + newmis.angles = vectoangles (newmis.velocity); + newmis.avelocity_x = (random () * 300); + newmis.avelocity_y = (random () * 300); + newmis.avelocity_z = (random () * 300); + newmis.touch = HandGrenBounce; + newmis.nextthink = (time + 2.5); + +// if (iid == IID_GREN_FRAG) +// newmis.think = FragExplode; +// else if (iid == IID_GREN_EMP) +// newmis.think = EMPExplode; +// else if (iid == IID_GREN_SMOKE) + + newmis.think = SmokeThink; + if (random() < 0.5) + newmis.think = FlashExplode; + + newmis.frame = 1; + setmodel (newmis, "progs/handgren.mdl"); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, ((self.origin + (v_right * TE_BLOOD)) + (v_up * TE_BLOOD))); +}; + + + + void (float side) chainsaw = { local vector delta; @@ -404,6 +443,7 @@ void () ogre_nail5 = [ 64, ogre_nail6 ] void () ogre_nail6 = [ 65, ogre_nail7 ] { ai_face (); + LobAGrenade(); }; void () ogre_nail7 = [ 66, ogre_run1 ] @@ -434,6 +474,7 @@ void () ogre_naild = [ 63, ogre_naile ] void () ogre_naile = [ 64, ogre_nailf ] { ai_face (); + LobAGrenade(); }; void () ogre_nailf = [ 65, ogre_nailg ] @@ -880,6 +921,7 @@ void () monster_ogre = self.th_run = ogre_run1; self.th_die = ogre_die; self.th_melee = ogre_melee; + self.th_missile = ogre_nail1; self.th_pain = ogre_pain; self.armortype = 0; walkmonster_start (); diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index 9353d5679..622e2978b 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -148,11 +148,13 @@ void () player_run = [ 137, player_run ] if (self.rtime < time && self.attack == 0) self.weaponframe = 0; - if (self.equipment == 7 && self.equipment_state == 1 && self.grab == 1 && !(self.flags & FL_ONGROUND)) - { - player_climb (); - return; - } + if (self.equipment_slot) + if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_CLIMBINGGEAR) + { + player_climb(); + return; + } + if ((!self.velocity_x && !self.velocity_y)) { player_stand1 (); diff --git a/quakec/fallout2/progs.src b/quakec/fallout2/progs.src index f98e098ec..f31ae4d13 100644 --- a/quakec/fallout2/progs.src +++ b/quakec/fallout2/progs.src @@ -5,6 +5,8 @@ inventory.qc subs.qc fight.qc +//tf.qc + ai.qc combat.qc items.qc @@ -35,4 +37,5 @@ dog.qc ogre.qc misc.qc mod_buy.qc +turrets.qc cmds.qc \ No newline at end of file diff --git a/quakec/fallout2/turrets.qc b/quakec/fallout2/turrets.qc new file mode 100644 index 000000000..dd6c64c9a --- /dev/null +++ b/quakec/fallout2/turrets.qc @@ -0,0 +1,87 @@ +void() tesla_think = +{ + local entity e; + local vector org; + + self.nextthink = time + 0.1; + self.frame = self.frame + 1; + + if (!self.aflag) + { + if (!self.enemy || self.enemy.health <= 0) + { + e = findradius(self.origin, 800); + while (e != world) + { + if (e.health > 0) + { + if (e.team != self.team) + { + if (e.solid) + { + if (e.takedamage) + { + traceline (self.origin, e.origin, FALSE, self); + if (trace_ent == e) + { + break; + } + } + } + } + } + e = e.chain; + } + self.enemy = e; + if (e != world) + sound (self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM); + } + if (self.enemy) + { + if (self.frame < 7) + self.frame = 7; + + org = self.origin + '0 0 32'; + + traceline (org, self.enemy.origin, FALSE, self); + + if (self.t_width < time) + { + sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); + self.t_width = time + 0.6; + } + + //mwa ha ha!! + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNING2); + WriteEntity (MSG_MULTICAST, self); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + WriteCoord (MSG_MULTICAST, trace_endpos_x); + WriteCoord (MSG_MULTICAST, trace_endpos_y); + WriteCoord (MSG_MULTICAST, trace_endpos_z); + multicast (org, MULTICAST_PHS); + + if (trace_ent != self.enemy) + self.enemy = world; + trace_endpos = normalize(trace_endpos - org)*8 + trace_endpos; + LightningDamage (self.origin, trace_endpos, self, 10); + + if (self.frame > 12) + self.frame = 0; + return; + } + } + if (self.frame >= 7) + self.frame = 0; +}; + +void() FinishTesla = +{ + self.netname = "tesla turret"; + self.think = tesla_think; + setmodel (self, "progs/coil.mdl"); + setsize (self, '-16 -16 -24', '16 16 32'); + self.nextthink = time + 0.1; +}; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 5e1956e96..dfd64c35d 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -478,12 +478,15 @@ void(vector p1, vector p2, entity from, float damage) LightningDamage = if (trace_ent.takedamage) { LightningHit (from, damage); +/* if (self.classname == "player") { if (other.classname == "player") trace_ent.velocity_z = trace_ent.velocity_z + 400; } +*/ } + e1 = trace_ent; traceline (p1 + f, p2 + f, FALSE, self); @@ -1694,7 +1697,7 @@ void () EMPExplode = { te.owner.pcamera = 0; te.owner.pcamera2 = 0; - te.owner.equipment_state = 0; + te.owner.equipment_slot = 0; sprint (self.owner, 2, te.owner.netname); sprint (self.owner, 2, "'s "); sprint (self.owner, 2, te.classname); @@ -1791,7 +1794,6 @@ void () FlashExplode = { local entity te; local float dot; - local float dot2; local vector vec; self.velocity = VEC_ORIGIN; @@ -1805,22 +1807,23 @@ void () FlashExplode = te = findradius (self.origin, 1200); while (te) { - if (te.classname == "raider") - te.attack_finished = time + 6; - if (te.classname == "radwolf") + if (te.flags & FL_MONSTER && te.classname != te.owner.classname) te.attack_finished = time + 6; if ((te.classname == "player")) { - makevectors (te.angles); +/* makevectors (te.angles); vec = normalize ((self.origin - te.origin)); dot = (vec * v_forward); - - if ((((dot > 0.3) && CanDamage (self, te)) && (dot2 == 0))) +*/ + if (/*dot > 0.3 &&*/ CanDamage (self, te)) { stuffcmd (te, "v_cshift 255 255 255 255\n"); stuffcmd (te, "v_idlescale 10\n"); - te.flash = 6; + if (self.owner.flags & FL_MONSTER) + te.flash = time + 2; + else + te.flash = time + 6; } } te = te.chain; @@ -2435,6 +2438,12 @@ void (float slotnum, float snd, float force) DropFromSlot = return; weap = ItemInSlot(self, slotnum); + if (weap == 0) + { + sprint(self, PRINT_HIGH, "Can't drop nothing\n"); + return; + } + if (snd == 1) sound (self, CHAN_WEAPON, "weapons/lock4.wav", 1, ATTN_NORM); @@ -2507,20 +2516,30 @@ void() Crosshair = stuffcmd(self, "\n"); }; -void (entity healer, entity saved) RevivePlayer = +float (entity healer, entity saved) RevivePlayer = { local entity oself; + oself = self; + self = saved; +/* if (!walkmove(0, 0)) + { + //too close? + return FALSE; + } +*/ saved.deadflag = DEAD_NO; saved.takedamage = DAMAGE_AIM; saved.movetype = MOVETYPE_WALK; - saved.solid = SOLID_SLIDEBOX; - self.materialize = 200; + saved.solid = SOLID_NOT; + + self = oself; + + saved.materialize = 200; saved.ghost = 0; saved.health = 2; saved.air_finished = time + 10; saved.view_ofs = '0 0 22'; - oself = self; self = saved; player_run(); self = oself; @@ -2536,6 +2555,8 @@ void (entity healer, entity saved) RevivePlayer = saved.view2 = world; saved.flags (-) FL_FINDABLE_NONSOLID; + + return TRUE; }; float(float iid) UseBoostingChem = @@ -2631,8 +2652,7 @@ float(float iid) UseHealingChem = { if (trace_ent.health <= 0 && coop == 1) { - RevivePlayer(self, trace_ent); - return true; + return RevivePlayer(self, trace_ent); } if (trace_ent.health <= 0 && coop == 0) return false; @@ -3006,7 +3026,6 @@ void () station_think = local float r; self.nextthink = time + 2; - self.frame = self.buildtype; if (self.track.team != self.team) { @@ -3133,7 +3152,19 @@ void () station_think = if (ammoslot) SetItemSlot(te, ammoslot, SlotVal(ammotype, x + ToStatus(ItemInSlot(te, ammoslot)))); - sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was received from the mr.ammo.\n"); + r = random()*6; + if (r < 1) + sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was received from the mr.ammo.\n"); + else if (r < 2) + sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " potatos were received from the mr.ammo.\n"); + else if (r < 3) + sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was given by the mr.ammo.\n"); + else if (r < 4) + sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was stolen from the mr.ammo.\n"); + else if (r < 5) + sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was extracted from the mr.ammo.\n"); + else + sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was given by the mr.ammo, along with an std\n"); self.chemcount = self.chemcount - 1; } @@ -3198,7 +3229,7 @@ void (entity guy) spawn_dot = hologram.nextthink = (time + 0.01); }; - +void() FinishTesla; float (float iid) spawn_station = { local entity oself; @@ -3327,6 +3358,12 @@ float (float iid) spawn_station = self.think = station_think; self.helmet = 2; self.buildtype = iid; + self.aflag = true; + + self.frame = 4; + + self.chemcount = 75; + if (self.buildtype == IID_BUILD_MRAMMO) self.netname = "mr. ammo"; if (self.buildtype == IID_BUILD_SHIELDGEN) @@ -3339,9 +3376,10 @@ float (float iid) spawn_station = self.netname = "robofang"; setmodel (self, "progs/dog.mdl"); } - self.frame = 4; - - self.chemcount = 75; + if (self.buildtype == IID_BUILD_TESLA) + { + FinishTesla(); + } self = oself; @@ -3381,10 +3419,10 @@ float() FireToolkit = if (trace_ent.health >= trace_ent.max_health) { //it's built! trace_ent.health = trace_ent.max_health; - if (trace_ent.nextthink) + if (!trace_ent.aflag) return true; //already complete + trace_ent.aflag = false; - trace_ent.think = station_think; trace_ent.nextthink = time + 1; sprint (self, PRINT_MEDIUM, "BUILDING COMPLETED.\n"); @@ -3398,6 +3436,12 @@ float() FireToolkit = sprint(self, PRINT_HIGH, "Robofang appears to have malfunctioned\n"); // spawn_dog (self.origin + v_forward * 32); } + if (trace_ent.buildtype == IID_BUILD_AUTODOC) + trace_ent.frame = 1; + if (trace_ent.buildtype == IID_BUILD_MRAMMO) + trace_ent.frame = 0; + if (trace_ent.buildtype == IID_BUILD_SHIELDGEN) + trace_ent.frame = 2; } return true; } @@ -3627,7 +3671,8 @@ void () UseEquipment = centerprint(self, " toolkit mark ii \nbuild, defuse and open doors faster\n"); return; } - if (self.equipment == 7 && self.equipment_state == 0) +/* + if (self.equipment == 7 && self.equipment_slot == 0) { sprint (self, PRINT_HIGH, "climbing gear in place.\n"); sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); @@ -3643,7 +3688,7 @@ void () UseEquipment = self.equipment_state = 0; return; } - +*/ if (self.equipment == 8) { centerprint(self, " enhanced battery \nallows longer cloaking\n"); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 48721abdc..362aee9d9 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -482,6 +482,7 @@ void() worldspawn = precache_model ("progs/v_nailer.mdl"); precache_model ("progs/v_piperifle.mdl"); precache_model ("progs/v_handgren.mdl"); + precache_model ("progs/v_jackhammer.mdl"); precache_model ("progs/handgren.mdl"); precache_model ("progs/plasma.mdl");