From 483b971185cd67d67166e6a00a5bc6990ddf1c1c Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 5 Nov 2009 03:38:42 +0000 Subject: [PATCH 01/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3409 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/invent.qc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 621ef49a4..43c5a9cc4 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -1,7 +1,9 @@ void bprint(float plev, string st, string s2){} float PRINT_MEDIUM = 1; + #include "../inventory.qc" + float show_inventory; vector mousepos; @@ -79,6 +81,7 @@ void() Invent_Draw = drawstring('112 248 0'+('2 0 0'*IMGSIZEF), " ARMOUR ", '8 8 8', '1 1 1', 1); SlotImage('112 256 0'+('2 0 0'*IMGSIZEF), 3); + i = getstati(62); if (i == 1) itname = "team: rangers"; @@ -91,7 +94,7 @@ void() Invent_Draw = if (i == 1) itname = "class: medic"; else if (i == 2) - itname = "class: assasin"; + itname = "class: assassin"; else if (i == 3) itname = "class: soldier"; else if (i == 4) From a9debe4b20b488bd2196c8878507a70dfc6c4576 Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 5 Nov 2009 03:40:39 +0000 Subject: [PATCH 02/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3410 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/ai.qc | 58 +- quakec/fallout2/client.qc | 998 ++++++-- quakec/fallout2/cmds.qc | 624 ++++- quakec/fallout2/combat.qc | 792 ++++++- quakec/fallout2/defs.qc | 130 +- quakec/fallout2/demon.qc | 139 +- quakec/fallout2/dog.qc | 272 ++- quakec/fallout2/doors.qc | 82 +- quakec/fallout2/enforcer.qc | 255 +- quakec/fallout2/fight.qc | 22 +- quakec/fallout2/fish.qc | 21 +- quakec/fallout2/hknight.qc | 13 +- quakec/fallout2/hos.qc | 85 +- quakec/fallout2/inventory.qc | 1660 +++++++++++-- quakec/fallout2/items.qc | 981 ++++++-- quakec/fallout2/knight.qc | 115 +- quakec/fallout2/menus.qc | 342 ++- quakec/fallout2/misc.qc | 241 +- quakec/fallout2/mod_buy.qc | 1105 +++++++-- quakec/fallout2/mod_menus.qc | 3 +- quakec/fallout2/monsters.qc | 16 +- quakec/fallout2/name.qc | 48 +- quakec/fallout2/ogre.qc | 409 +++- quakec/fallout2/player.qc | 773 +++++-- quakec/fallout2/progs.src | 6 +- quakec/fallout2/server.qc | 1 - quakec/fallout2/shalrath.qc | 45 +- quakec/fallout2/shambler.qc | 251 +- quakec/fallout2/soldier.qc | 804 ++++++- quakec/fallout2/triggers.qc | 7 +- quakec/fallout2/weapons.qc | 4229 ++++++++++++++++++++++++++++------ quakec/fallout2/wizard.qc | 73 +- quakec/fallout2/world.qc | 1669 +++++++++++++- quakec/fallout2/zombie.qc | 587 ++++- 34 files changed, 14220 insertions(+), 2636 deletions(-) diff --git a/quakec/fallout2/ai.qc b/quakec/fallout2/ai.qc index 848a58dc3..481ed4f9a 100644 --- a/quakec/fallout2/ai.qc +++ b/quakec/fallout2/ai.qc @@ -149,7 +149,7 @@ local float r; spot2 = targ.origin + targ.view_ofs; r = vlen (spot1 - spot2); - if (r < 120) + if (r < 80) return RANGE_MELEE; if (r < 500) return RANGE_NEAR; @@ -349,7 +349,8 @@ slower noticing monsters. float() FindTarget = { local entity client; - local float r; + local float r, x; + local string y; // if the first spawnflag bit is set, the monster will only wake up on // really seeing the player, not another monster getting angry @@ -378,15 +379,18 @@ float() FindTarget = return FALSE; if (client.items & IT_INVISIBILITY) return FALSE; + if ((client.sneak > 75) && (client.velocity == '0 0 0'))//if you are standing still, hiding, there's no chance + return FALSE; //they will see you, unless they turn into you r = range (client); - if (r == RANGE_FAR) - return FALSE; if (!visible (client)) return FALSE; - if (client.sneak != 0)//sneaking players are invisible + + if (client.team == 0)//client connecting + return FALSE; + if (client.class == 0)//client connecting return FALSE; @@ -397,10 +401,47 @@ float() FindTarget = } else if (r == RANGE_MID) { - if ( /* client.show_hostile < time || */ !infront (client)) + if (!infront (client)) return FALSE; } + if ((self.search_time < time)) + { + if (self.alert == 0 && client.sneak > 5) + self.search_time = time + 2; + else if (self.alert == 0 && client.sneak <= 5) + self.search_time = time + 1; + else if (self.alert > 0) + { + self.search_time = time + 2; + self.alert = self.alert - 1; + } + + //if your sneak level is 70% or higher you will never get caught + //alert guards get the full 100% random roll, otherwise 90% + if (self.alert == 0) + x = random()*80; + else + x = random()*100; + if (client.sneak >= 70 && client.velocity == '0 0 0') + { + sprint(client, 2, self.netname); + sprint(client, 2, " failed to detect you.\n"); + } + else if (client.sneak > 0 && (x > client.sneak + 15)) + { + sprint(client, 2, "you've been detected!\n"); + client.sneak = 0; + } + else if (client.sneak > 0) + { + sprint(client, 2, self.netname); + sprint(client, 2, " failed to detect you.\n"); + } + } + + if (client.sneak > 0)//sneaking players are invisible + return FALSE; // // got one // @@ -477,11 +518,6 @@ void(float dist) ai_walk = { movedist = dist; - if (self.classname == "monster_dragon") - { - movetogoal (dist); - return; - } // check for noticing a player if (FindTarget ()) return; diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 10abc7500..b90367d23 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -10,8 +10,9 @@ void(float slot) WeaponAmmo; void() Identify; void(entity to, float iid, float amount) AddStackable; void(entity to, float iid, float amount) AddNonStackable; +void() shop_face; -float modelindex_dead, modelindex_sneak, modelindex_prone, modelindex_eyes, modelindex_player, modelindex_gone; +float modelindex_dead, modelindex_sneak, modelindex_prone, modelindex_eyes, modelindex_player, modelindex_gone, modelindex_melee; /* ============================================================================= @@ -23,7 +24,6 @@ float modelindex_dead, modelindex_sneak, modelindex_prone, modelindex_eyes, mode string nextmap; -float intermission_running; float intermission_exittime; /*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16) @@ -56,21 +56,12 @@ void() SetChangeParms = self.items = self.items - (self.items & (IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) ); -// parm1 = self.slot1; -// parm2 = self.slot2; -// parm3 = self.armor; -// parm4 = self.protect; -// parm5 = self.equipment; // parm6 = self.chem; -// parm7 = self.chemcount; + if (self.class > 0) + parm7 = self.class; parm8 = self.ammo_shells; - parm9 = self.trait; - parm10 = self.perk; -// parm11 = self.bandages; -// parm12 = self.scraps; - //parm13 = self.class; - parm14 = self.team; -// parm15 = self.grenadetype; + parm9 = self.perk1; + parm10 = self.perk2; @@ -92,6 +83,15 @@ void() SetChangeParms = parm30 = self.islot14; parm31 = self.islot15; parm32 = self.islot16; + parm1 = self.islot17; + parm2 = self.islot18; + parm3 = self.islot19; + parm4 = self.islot20; + parm11 = self.islot21; + parm12 = self.islot22; + parm13 = self.islot23; + parm15 = self.islot24; + }; void() SetNewParms = @@ -100,10 +100,9 @@ void() SetNewParms = // parm2 = IID_WP_KNIFE; // parm3 = IID_ARM_SHIRT; // parm4 = 0; -// parm5 = 0; // parm6 = 0; -// parm7 = 0; - parm8 = 8; //starting cash + parm7 = 0; + parm8 = 300; //starting cash parm9 = 0; parm10 = 0; // parm11 = 0; @@ -112,6 +111,7 @@ void() SetNewParms = parm14 = 0; // parm15 = 0; + parm5 = 0; //score //16 is the current_slot //17 to 32 are inventory slots. @@ -140,21 +140,14 @@ void() DecodeLevelParms = { setspawnparms(self); -// self.slot1 = parm1; -// self.slot2 = parm2; -// self.armor = parm3; -// self.protect = parm4; -// self.equipment = parm5; // self.chem = parm6; -// self.chemcount = parm7; + if (parm7 > 0) + self.class = parm7; self.ammo_shells = parm8; - self.trait = parm9; - self.perk = parm10; -// self.bandages = parm11; -// self.scraps = parm12; -// self.class = parm13; - self.oldteam = parm14; -// self.grenadetype = parm15; + self.perk1 = parm9; + self.perk2 = parm10; + self.score = parm5; + self.current_slot = parm16; @@ -174,6 +167,15 @@ void() DecodeLevelParms = self.islot14 = parm30; self.islot15 = parm31; self.islot16 = parm32; + self.islot17 = parm1; + self.islot18 = parm2; + self.islot19 = parm3; + self.islot20 = parm4; + self.islot21 = parm11; + self.islot22 = parm12; + self.islot23 = parm13; + self.islot24 = parm15; + }; /* @@ -252,6 +254,75 @@ void() IntermissionThink = GotoNextMap (); }; + +void() get_new_map = +{ + if (random()<0.04) + m_map = "e1m1"; + else if (random()<0.04) + m_map = "e2m1"; + else if (random()<0.10) + m_map = "e3m1"; + else if (random()<0.04) + m_map = "e4m1"; + else if (random()<0.04) + m_map = "bbelief1"; + else if (random()<0.15) + m_map = "bbelief1"; + else if (random()<0.15) + m_map = "bbelief2"; + else if (random()<0.15) + m_map = "bbelief3"; + else if (random()<0.15) + m_map = "bbelief4"; + else if (random()<0.15) + m_map = "bbelief5"; + else if (random()<0.15) + m_map = "bbelief6"; + else if (random()<0.15) + m_map = "bbelief7"; + else if (random()<0.15) + m_map = "bbelief8"; + else + m_map = "bbelief1"; + +}; + +void() get_new_mission = +{ + local float x; + local string savemap; + + x = ceil(random()*6); + + if (x == 1) + savemap = "hostage"; + if (x == 2) + savemap = "supplies"; + if (x == 3) + savemap = "shadow"; + if (x == 4) + savemap = "deadtown"; + if (x == 5) + savemap = "destroy"; + if (x == 6) + savemap = "defuse"; + + localcmd("serverinfo objective "); + localcmd(savemap); + localcmd("\n"); + + get_new_map(); + + bprint(2, "new mission has been received: "); + bprint(2, savemap); + bprint(2, "\n"); + bprint(2, "location coordinates are near "); + bprint(2, m_map); + bprint(2, "\n"); + +}; + /* ============ execute_changelevel @@ -262,18 +333,17 @@ Take the players to the intermission spot */ void() execute_changelevel = { + local string savemap; local entity pos; + local float x; intermission_running = 1; // enforce a wait time before allowing changelevel - intermission_exittime = time + 5; + intermission_exittime = time + 15; pos = FindIntermission (); -// play intermission music - WriteByte (MSG_ALL, SVC_CDTRACK); - WriteByte (MSG_ALL, 3); WriteByte (MSG_ALL, SVC_INTERMISSION); WriteCoord (MSG_ALL, pos.origin_x); @@ -283,16 +353,30 @@ void() execute_changelevel = WriteAngle (MSG_ALL, pos.mangle_y); WriteAngle (MSG_ALL, pos.mangle_z); - other = find (world, classname, "player"); - while (other != world) - { - other.takedamage = DAMAGE_NO; - other.solid = SOLID_NOT; - other.movetype = MOVETYPE_NONE; - other.modelindex = 0; - other = find (other, classname, "player"); - } + + x = ceil(random()*6); + + if (x == 1) + savemap = "hostage"; + if (x == 2) + savemap = "supplies"; + if (x == 3) + savemap = "shadow"; + if (x == 4) + savemap = "deadtown"; + if (x == 5) + savemap = "destroy"; + if (x == 6) + savemap = "defuse"; + + if (intermission_exittime < time) + localcmd("map r_bunker"); + + if (infokey(world, "objective") != "return" && infokey(world, "objective") != "start") + localcmd("serverinfo objective return\n"); + + self.nextthink = time + 1; }; @@ -301,19 +385,54 @@ void() changelevel_touch = if (other.classname != "player") return; -// if "noexit" is set, blow up the player trying to leave -//ZOID, 12-13-96, noexit isn't supported in QW. Overload samelevel -// if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start"))) - if ((cvar("samelevel") == 2) || ((cvar("samelevel") == 3) && (mapname != "start"))) + if ((world.map_obj == OBJ_HOSTAGE && hostages > 0) && random()<0.02) { - T_Damage (other, self, self, 50000); + sprint (other, 2,"there are more hostages to save.\n"); return; } + else if ((world.map_obj == OBJ_SUPPLY && supplies > 0) && random()<0.02) + { + sprint (other, 2,"there are more supplies to secure.\n"); + return; + } + else if ((world.map_obj == OBJ_DESTROY && supplies > 0) && random()<0.02) + { + sprint (other, 2,"there are more fuel tanks to destroy.\n"); + return; + } + else if ((world.map_obj == OBJ_DEFUSE && supplies > 0) && random()<0.02) + { + sprint (other, 2,"there are still bombs to disarm.\n"); + return; + } + + if (world.map_obj == OBJ_HOSTAGE && hostages > 0) + return; + else if (world.map_obj == OBJ_SUPPLY && supplies > 0) + return; + else if (world.map_obj == OBJ_DESTROY && supplies > 0) + return; + else if (world.map_obj == OBJ_DEFUSE && supplies > 0) + return; + bprint (PRINT_HIGH, other.netname); bprint (PRINT_HIGH," exited the level\n"); - nextmap = self.map; + other = find (world, classname, "player"); + while (other) + { + stuffcmd(other, "play music/victory\n"); + other.missionbrief = 3; + other.takedamage = DAMAGE_NO; + other.solid = SOLID_NOT; + other.movetype = MOVETYPE_NONE; + other.modelindex = 0; + + other = find (other, classname, "player"); + } + + localcmd("serverinfo objective return\n"); SUB_UseTargets (); @@ -352,9 +471,9 @@ void() set_suicide_frame; void() respawn = { // make a copy of the dead body for appearances sake - CopyToBodyQue (self); + //CopyToBodyQue (self); // set default spawn parms - SetNewParms (); + //SetNewParms (); // respawn PutClientInServer (); }; @@ -369,13 +488,7 @@ Player entered the suicide command */ void() ClientKill = { - bprint (PRINT_MEDIUM, self.netname); - bprint (PRINT_MEDIUM, " suicides\n"); - set_suicide_frame (); - self.modelindex = modelindex_player; - logfrag (self, self); - self.frags = self.frags - 2; // extra penalty - respawn (); + sprint(self, 2, "you chicken out!\n"); }; float(vector v) CheckSpawnPoint = @@ -407,10 +520,12 @@ entity() SelectSpawnPoint = if (spot) return spot; - if (coop == 1) - ent1 = "info_player_coop"; + spot = find (world, classname, "spawn3"); + + if (spot) + ent1 = "spawn3"; else - ent1 = "spawn3"; + ent1 = "info_player_coop"; if (ent1 == "spawn3") { @@ -494,8 +609,33 @@ called each time a player enters a new level */ void() PutClientInServer = { - local entity spot; - local float x; + local entity spot, gun; + local float x, xx; + + self.classname = "player"; + self.health = 100; + self.takedamage = DAMAGE_AIM; + self.movetype = MOVETYPE_WALK; + self.show_hostile = 0; + self.max_health = 100; + self.health = 100; + self.flags = FL_CLIENT; + self.air_finished = time + 12; + self.dmg = 2; // initial water damage + self.super_damage_finished = 0; + self.radsuit_finished = 0; + self.invisible_finished = 0; + self.currentmenu = "none"; + self.invincible_finished = 0; + self.effects = 0; + self.invincible_time = 0; + self.active = 1; + self.solid = SOLID_NOT; + self.materialize = 20; + + + DecodeLevelParms (); + if (self.class == 0 || self.team == 0) { self.deadflag = DEAD_NO; @@ -518,40 +658,36 @@ void() PutClientInServer = player_stand1 (); return; } - self.classname = "player"; - self.health = 100; - self.takedamage = DAMAGE_AIM; - self.movetype = MOVETYPE_WALK; - self.show_hostile = 0; - self.max_health = 100; - self.health = 100; - self.flags = FL_CLIENT; - self.air_finished = time + 12; - self.dmg = 2; // initial water damage - self.super_damage_finished = 0; - self.radsuit_finished = 0; - self.invisible_finished = 0; - self.currentmenu = "none"; - self.invincible_finished = 0; - self.effects = 0; - self.invincible_time = 0; - self.active = 1; - self.solid = SOLID_NOT; - self.materialize = 20; - - DecodeLevelParms (); if (self.current_slot == 0) { - self.current_slot = 1; - self.islot1 = SlotVal(IID_WP_USP, 12); self.islot2 = 0; - self.islot3 = SlotVal(IID_ARM_SHIRT, 1); - self.islot4 = SlotVal(IID_CHEM_STIMPACK, 3); - self.islot5 = SlotVal(IID_AM_10MM, 24); - self.islot6 = 0; - self.islot7 = 0; - self.islot8 = 0; + + self.current_slot = 1; + if (self.class == 1) + self.islot1 = SlotVal(IID_WP_WINCHESTER, 2); + if (self.class == 2) + { + self.islot1 = SlotVal(IID_WP_GLOCK, 15); + self.islot2 = SlotVal(IID_WP_KNIFE, 1); + } + if (self.class == 3) + self.islot1 = SlotVal(IID_WP_USP, 12); + if (self.class == 4) + self.islot1 = SlotVal(IID_WP_PIPERIFLE, 1); + + self.islot3 = 0; + self.islot7 = SlotVal(IID_CHEM_STIMPACK, 3); + + if (self.class == 1) + self.islot8 = SlotVal(IID_AM_12GAUGESHELLS, 20); + if (self.class == 2) + self.islot8 = SlotVal(IID_AM_10MM, 30); + if (self.class == 3) + self.islot8 = SlotVal(IID_AM_45ACP, 24); + if (self.class == 4) + self.islot8 = SlotVal(IID_AM_44MAGNUM, 20); + self.islot9 = 0; self.islot10 = 0; self.islot11 = 0; @@ -560,26 +696,43 @@ void() PutClientInServer = self.islot14 = 0; self.islot15 = 0; self.islot16 = 0; - + self.islot17 = 0; + self.islot18 = 0; + self.islot19 = 0; + self.islot20 = 0; //now give them special items for thier class. //you're fairly screwed if you change class. if (self.class == 1) { x = SlotOfItem(self, IID_CHEM_MEDICALBAG); if (x == 0) - AddNonStackable(self, IID_CHEM_MEDICALBAG, 1); + self.islot5 = SlotVal(IID_CHEM_MEDICALBAG, 100); } if (self.class == 2) { x = SlotOfItem(self, IID_EQUIP_STEALTHBOY); if (x == 0) - AddNonStackable(self, IID_EQUIP_STEALTHBOY, 1); + self.islot4 = SlotVal(IID_EQUIP_STEALTHBOY, 1); } if (self.class == 4) { - x = SlotOfItem(self, IID_WP_TOOLKIT); + x = SlotOfItem(self, IID_WP_WRENCH); if (x == 0) - AddNonStackable(self, IID_WP_TOOLKIT, 1); + self.islot5 = SlotVal(IID_WP_WRENCH, 1); + + TryGiveStackable(self, IID_MISC_STEELPIPE, 1); + TryGiveStackable(self, IID_MISC_DUCKTAPE, 1); + TryGiveStackable(self, IID_MISC_AEROSOL, 2); + TryGiveStackable(self, IID_MISC_JUNK, 2); + + xx = ceil(309+random()*12); + TryGiveStackable(self, xx, 1); + + xx = ceil(309+random()*12); + TryGiveStackable(self, xx, 1); + + xx = ceil(309+random()*12); + TryGiveStackable(self, xx, 1); } } @@ -619,6 +772,9 @@ void() PutClientInServer = setmodel (self, "progs/sneak.mdl"); modelindex_sneak = self.modelindex; + setmodel (self, "progs/melee.mdl"); + modelindex_melee = self.modelindex; + setmodel (self, "progs/dead.mdl"); modelindex_dead = self.modelindex; @@ -633,6 +789,43 @@ void() PutClientInServer = self.view_ofs = '0 0 22'; self.view2 = world; + if (world.model == "maps/r_bunker.bsp") + { + if (infokey(world, "objective") != "return") + { + if (self.ammo_shells == 300) + self.popup = 1; + else + self.popup = 2; + } + } + + if (world.model == "maps/r_bunker.bsp") + { + if (infokey(world, "objective") == "return") + { + if (self.score <= 0) + { + self.popup = 6; + } + if (self.score <= 400) + { + self.ammo_shells = self.ammo_shells + 25; + self.popup = 3; + } + else if (self.score <= 800) + { + self.ammo_shells = self.ammo_shells + 50; + self.popup = 4; + } + else + { + self.ammo_shells = self.ammo_shells + 75; + self.popup = 5; + } + } + } + // Mod - Xian (May.20.97) // Bug where player would have velocity from their last kill @@ -762,6 +955,20 @@ void() info_player_deathmatch = potential spawning position for coop games */ void() info_player_coop = +{ + coop = 1; +}; + + +void() spawn1 = +{ +}; + +void() spawn2 = +{ +}; + +void() spawn3 = { }; @@ -926,7 +1133,7 @@ void() PlayerDeathThink = self.view_ofs = '0 0 -12'; self.modelindex = modelindex_dead; - self.solid = SOLID_NOT; +// self.solid = SOLID_NOT; if ((self.flags & FL_ONGROUND)) { @@ -968,7 +1175,10 @@ void() PlayerJump = { if (self.flags & FL_WATERJUMP) return; - + + if (self.health <= (self.max_health*0.20)) + return; + if (self.waterlevel >= 2) { // play swiming sound @@ -1060,7 +1270,7 @@ void() WaterMove = } else if (self.watertype == CONTENT_SLIME) { // do damage - if (self.dmgtime < time && self.radsuit_finished < time) + if (self.dmgtime < time && self.rage != IID_CHEM_RADX) { self.dmgtime = time + 1; T_Damage (self, world, world, 4*self.waterlevel); @@ -1113,30 +1323,191 @@ void() CheckWaterJump = } }; + +//this is used to check if the player is directly in front of a monster +//or off to the side, on the corner of the monsters vision + +float(entity targ) check_fov = +{ + local vector vec; + local float dot; + + makevectors (targ.angles); + vec = normalize (self.origin - targ.origin); + dot = vec * v_forward; + + if ( dot > 0.9) + { + return TRUE; + } + + return FALSE; +}; + +float(entity targ) check_fov_side = +{ + local vector vec; + local float dot; + + makevectors (targ.angles); + vec = normalize (self.origin - targ.origin); + dot = vec * v_forward; + + if ( dot > 0.6 && dot < 0.9) + { + return TRUE; + } + + return FALSE; +}; + +//determines chance of someone getting detected while sneaking + +void() SneakLevel = +{ + local float sn, st, front, r; + local entity te; + local string report; + + + front = 0; + + te = findradius(self.origin, 1000); + while (te) + { + if (visible(te) && te.classname == "monster" && check_fov(te)) + r = vlen(self.origin - te.origin); + + + te = te.chain; + } + + + sn = 95; + + //sneaking along a wall increases chance by 2% + makevectors(self.angles); + if (pointcontents (self.origin + v_right*64) == CONTENT_SOLID) + sn = sn + 2; + else if (pointcontents (self.origin - v_right*64) == CONTENT_SOLID) + sn = sn + 2; + else if (pointcontents (self.origin + v_forward*64) == CONTENT_SOLID) + sn = sn + 2; + else if (pointcontents (self.origin - v_forward*64) == CONTENT_SOLID) + sn = sn + 2; + + //duck or prone gives a 1% bonus to stealth + if (self.position > 0) + sn = sn + 1; + + //light step perk gives a 1% bonus to stealth + if (getperk(6)) + sn = sn + 1; + + //walking in front of a monster at close range is very bad + //at longer ranges it isn't so bad to do so + //thus even healer and barbarian types can sneak if they do so smartly + + if (r > 0 && r <= 600) + { + r = 600 - r; + + + if (self.class == 1) + sn = sn - r/3; + if (self.class == 2) + sn = sn - r/6; + if (self.class == 3) + sn = sn - r/3; + if (self.class == 4) + sn = sn - r/3; + } + + + //wearing no armor gives a 5% bonus to stealth + st = ToIID(self.islot3); + if (st == 0) + sn = sn + 5; + + //bulletproof shirt gives a 2% bonus to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_SHIRT) + sn = sn + 2; + + //metal armor gives a large penalty to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_METAL) + sn = sn - 5; + + //power armor gives a huge penalty to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_LPOWER) + sn = sn - 10; + + //body snatcher allows for an automatic disguise + st = ToIID(self.islot3); + if (st == IID_ARM_DESERT) + sn = 99; + + //stealthboy allows for an automatic 10-second invisibility + st = ToIID(self.islot4); + if (st == IID_EQUIP_STEALTHBOY && self.ammo_cells > 0) + sn = 99; + + if (sn <= 5) + sn = 5; + + if (sn >= 99) + sn = 99; + + if (self.sneak > 0) + self.sneak = sn; +}; + void() ArmorCheck = { - local float type; + local float type, aid, slow; + aid = ToIID(self.islot3); - local float aid; + if (self.hold > 0) + self.speedmulti = 0; + + slow = self.weight/self.max_weight; + + self.speedmulti = 1.00 - (slow/2); + + if (self.health <= (self.max_health*0.20)) + self.speedmulti = 0.75; + else if (self.health <= (self.max_health*0.10)) + self.speedmulti = 0.50; + + if (self.walk == 1) + self.speedmulti = self.speedmulti * 0.50; //Armor - aid = ToIID(self.islot3); + if (aid == IID_ARM_DESERT) + type = 0.10; if (aid == IID_ARM_SHIRT) - type = 0.20; + type = 0.25; if (aid == IID_ARM_LEATHER) type = 0.30; if (aid == IID_ARM_KEVLAR) - type = 0.35; + type = 0.50; if (aid == IID_ARM_METAL) - type = 0.35; + type = 0.25; if (aid == IID_ARM_COMBAT) type = 0.40; if (aid == IID_ARM_BROTHERHOOD) type = 0.45; if (aid == IID_ARM_FORCE) - type = 0.10; + type = 0.15; if (aid == IID_ARM_LPOWER) type = 0.50; + if (self.class == 3) + type += 0.10; + if (self.rage == IID_CHEM_PSYCHO) + type += 0.20; + if (aid <= IID_ARM_KEVLAR) self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1); @@ -1145,21 +1516,21 @@ void() ArmorCheck = else self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1); - if (aid == 1) + if (aid == IID_ARM_SHIRT) self.armornoise = "misc/thud.wav"; - if (aid == 2) + if (aid == IID_ARM_LEATHER) self.armornoise = "misc/thud.wav"; - if (aid == 3) + if (aid == IID_ARM_KEVLAR) self.armornoise = "misc/thud.wav"; - if (aid == 4) + if (aid == IID_ARM_METAL) self.armornoise = "weapons/ric1.wav"; - if (aid == 5) + if (aid == IID_ARM_COMBAT) self.armornoise = "misc/thud.wav"; - if (aid == 6) + if (aid == IID_ARM_BROTHERHOOD) self.armornoise = "misc/thud.wav"; - if (aid == 7) + if (aid == IID_ARM_FORCE) self.armornoise = "misc/laserdef.wav"; - if (aid == 8) + if (aid == IID_ARM_LPOWER) self.armornoise = "weapons/ric1.wav"; self.armorvalue = type * 100; @@ -1190,19 +1561,19 @@ void () WeightControl = self.weight = wt; if (self.class == 1) - self.max_weight = 50; + self.max_weight = 40; if (self.class == 2) - self.max_weight = 50; + self.max_weight = 40; if (self.class == 3) self.max_weight = 60; if (self.class == 4) - self.max_weight = 40; + self.max_weight = 30; }; void () PositionControl = { - local float exp; + local float exp, slow; if (self.position == 0) self.view_ofs = '0 0 22'; @@ -1226,25 +1597,37 @@ void () PositionControl = } if (self.position == 0) - self.maxspeed = 200; + self.maxspeed = 225; else if (self.position == 1) self.maxspeed = 100; - else //if (self.position == 2) + else if (self.position == 2 && getperk(3))//stunt man + self.maxspeed = 100; + else self.maxspeed = 50; - if (self.weight > self.max_weight) //this is the penalty for being overweight. - { - exp = (self.weight/self.max_weight); - exp = (exp+2)*(exp+2)+(exp*exp*exp*8); //is this enough? - self.maxspeed = self.maxspeed / exp; - } + if (self.health <= (self.max_health*0.20) && random()<0.05) + sound (self, CHAN_AUTO, "player/paina.wav", 1, ATTN_NORM); + else if (self.health <= (self.max_health*0.20) && random()<0.05) + sound (self, CHAN_AUTO, "player/painb.wav", 1, ATTN_NORM); + + if (getperk(2)) + self.maxspeed = self.maxspeed*1.10; + + if (self.rage == IID_CHEM_ADRENALINE) + self.maxspeed = self.maxspeed*1.20; + + if (self.sneak > 0) + self.maxspeed = self.maxspeed*0.50; + + self.maxspeed = self.maxspeed*self.speedmulti; + + if (self.maxspeed < 50) + self.maxspeed = 50; if (self.equipment_slot) { if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_SPRINTKIT) self.maxspeed = self.maxspeed*2; - if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_STEALTHBOY) - self.maxspeed = self.maxspeed/2; } }; @@ -1260,7 +1643,8 @@ Called every frame before physics are run */ void() PlayerPreThink = { - local float r; + local float r, grip; + local entity te; if (intermission_running) { @@ -1280,6 +1664,9 @@ void() PlayerPreThink = } + if (self.hold > 0) + self.hold = self.hold - 1; + if (self.team == 0) self.clientcolors = 0; else if (self.team == 1) @@ -1288,13 +1675,9 @@ void() PlayerPreThink = self.clientcolors = 4 + 4*16; if (self.team == 0 && self.currentmenu == "none") { - if (coop) - self.team = 1; - else - { - self.currentmenu = "select_team"; - DisplayMenu (); - } + self.currentmenu = "display_enter_screen"; + DisplayMenu (); + return; } else if (self.class == 0 && self.currentmenu == "none") { @@ -1319,19 +1702,33 @@ void() PlayerPreThink = PositionControl(); WeightControl(); ArmorCheck(); - Crosshair(); + SneakLevel(); + self.accept = 0; + + local float lgrip, rgrip; + + + //nintendo gamer: player sometimes goes into 'the zone' + if ((self.recoil >= 5) && (getperk(9)) && (random()<=0.10)) + { + sprint(self, 2, "THE ZONE!\n"); + self.rage = 255; + self.ragetime = 15; + } if (self.health > self.max_health) self.health = self.max_health; - if (self.flash < time) + if (self.flash < time || ToIID(self.islot4) == IID_EQUIP_GOGGLES) { - if (self.ragetime > time) + if (ToIID(self.islot4) == IID_EQUIP_GOGGLES) + stuffcmd(self, "v_cshift 25 0 25 25\n"); + else if (self.ragetime > time && self.rage != IID_CHEM_RADX) stuffcmd(self, "v_cshift 75 0 0 75\n"); else if (self.sneak > 0) - stuffcmd(self, "v_cshift 0 75 0 75\n"); - else + stuffcmd(self, "v_cshift 0 0 75 75\n"); + else if (self.zoom == 0) stuffcmd(self, "v_cshift 0 0 0 0\n"); } self.cycle1 = time + 0.5; @@ -1356,17 +1753,9 @@ void() PlayerPreThink = } } - if (self.class == 1) - self.recoil = self.recoil - 0.16; - if (self.class == 2) - self.recoil = self.recoil - 0.14; - if (self.class == 3) - self.recoil = self.recoil - 0.12; - if (self.class == 4) - self.recoil = self.recoil - 0.19; - if (self.recoil <= 0) - self.recoil = 0; + + self.deathtype = ""; @@ -1374,10 +1763,37 @@ void() PlayerPreThink = if (self.cycle2 < time) { - if (self.equipment == 8) - r = 30; - else + if (ToIID(self.islot4) == IID_EQUIP_BATTERY) r = 20; + else + r = 10; + + if (self.ragetime > 0) + self.ragetime -= 1; + + if (self.ragetime <= 0) + self.rage = 0; + + traceline ((self.origin), ((self.origin - (v_right * 24))) + (v_forward * 64), FALSE, self); + if (trace_fraction < 1 && trace_fraction > 0) + lgrip = 1; + + traceline ((self.origin), ((self.origin - (v_right * 48))) + (v_forward * 32), FALSE, self); + if (trace_fraction < 1 && trace_fraction > 0) + lgrip = 1; + + traceline ((self.origin), ((self.origin + (v_right * 24))) + (v_forward * 64), FALSE, self); + if (trace_fraction < 1 && trace_fraction > 0) + rgrip = 1; + + traceline ((self.origin), ((self.origin + (v_right * 48))) + (v_forward * 32), FALSE, self); + if (trace_fraction < 1 && trace_fraction > 0) + rgrip = 1; + + if (rgrip == 1 && lgrip == 0) + self.rage = 777; + if (rgrip == 0 && lgrip == 1) + self.rage = 777; if (self.sneak == 0) { @@ -1387,14 +1803,49 @@ void() PlayerPreThink = if (self.ammo_cells > r) self.ammo_cells = r; } - if (self.sneak >= 1) - { - self.ammo_cells = self.ammo_cells - 1; - if (self.ammo_cells <= 0) + if (self.sneak > 0) + { + if (self.ammo_cells == 3 && ToIID(self.islot4) == IID_EQUIP_STEALTHBOY) + sprint(self, 2, "stealthboy running low!\n"); + + if (self.ammo_cells > 0) + self.ammo_cells = self.ammo_cells - 1; + + if (self.ammo_cells < 0) + self.ammo_cells = 0; + } + + if (getperk(100))//SPIRIT LINK + { + te = findradius(self.origin, 500); + + while (te) { - sprint(self, 2, "uncloaked.\n"); - self.sneak = 0; + if (te.classname == "player" && te != self && (te.health < self.health)) + { + if (self.health > 5 && te.health > 0) + { + + sound (te, CHAN_BODY, "items/r_item1.wav", 1, ATTN_IDLE); + sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_IDLE); + + sprint(self, 2, "!SPIRIT LINK\n"); + sprint(te, 2, "!SPIRIT LINK\n"); + + if ((self.health - te.health) > 10) + { + self.health -= 5; + te.health += 5; + } + else + { + self.health -= 1; + te.health += 1; + } + } + } + te = te.chain; } } @@ -1403,10 +1854,29 @@ void() PlayerPreThink = self.health = self.health + 3; self.regen = self.regen - 1; } + else if (self.rage == IID_CHEM_BESERK && !self.deadflag) //don't come back to life. + self.health = self.health + 1; - if (self.flash < time) + if (self.flash < time || ToIID(self.islot4) == IID_EQUIP_GOGGLES) { - stuffcmd(self, "v_idlescale 0\n"); + if (ToIID(self.islot4) == IID_EQUIP_GOGGLES) + stuffcmd(self, "v_cshift 25 0 25 25\n"); + + if (self.steadyaim == 0) + stuffcmd(self, "v_idlescale 0\n"); + else if (self.recoil >= 4) + stuffcmd(self, "v_idlescale 4\n"); + else if (self.velocity == '0 0 0' && self.health >= self.max_health*0.80 && self.position > 0) + stuffcmd(self, "v_idlescale 0\n"); + else if (self.velocity == '0 0 0' && self.position > 0) + stuffcmd(self, "v_idlescale 1\n"); + else if (self.velocity == '0 0 0' && self.health >= self.max_health*0.80) + stuffcmd(self, "v_idlescale 2\n"); + else if (self.velocity != '0 0 0' || self.health < self.max_health*0.80) + stuffcmd(self, "v_idlescale 4\n"); + else if (self.health < self.max_health*0.50) + stuffcmd(self, "v_idlescale 6\n"); + } self.cycle2 = time + 1; } @@ -1440,18 +1910,26 @@ void() PlayerPreThink = { if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_CLIMBINGGEAR) { - traceline ((self.origin - '0 0 24'), ((self.origin + (v_forward * EF_FLAG2)) - '0 0 24'), FALSE, self); + grip = 0; + + + traceline ((self.origin), ((self.origin + (v_forward * 48))), FALSE, self); if (trace_fraction < 1 && trace_fraction > 0) + grip = 1; + + + if (grip == 1) { + self.attack_finished = time + 0.1; + self.rtime = time + 0.2; self.gravity = 0; self.maxspeed = 50; - self.velocity = v_forward*40 * self.movement_x; + self.velocity = v_forward*20 * self.movement_x; } else { self.gravity = 1; } - self.attack_finished = time + 0.1; } if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_HOVERBOOTS && self.button2) { @@ -1473,6 +1951,8 @@ Check for turning off powerups */ void() CheckPowerups = { + local float weap; + if (self.health <= 0) return; @@ -1516,25 +1996,32 @@ void() CheckPowerups = :beinvis self.items = self.items | IT_INVISIBILITY; - // use the eyes self.frame = 0; - self.modelindex = modelindex_eyes; + self.modelindex = modelindex_sneak; } else { self.items = self.items - (self.items & IT_INVISIBILITY); + if (self.ghost == 1 || self.class == 0 || self.team == 0) + { + self.modelindex = modelindex_gone; + return; + } + + weap = ToIID(self.(SlotField(self.current_slot))); + if (self.position <= 1) self.modelindex = modelindex_player; if (self.position == 2) self.modelindex = modelindex_prone; if (self.sneak == 1 || self.sneak == 3 && coop == 0) self.modelindex = modelindex_gone; - if (self.sneak == 1 || self.sneak == 3 && coop == 1) + if (self.sneak > 0 && coop == 1) self.modelindex = modelindex_sneak; + if (IsMelee(weap)) + self.modelindex = modelindex_melee; if (self.health <= 0) self.modelindex = modelindex_dead; - if (self.ghost == 1 || self.class == 0 || self.team == 0) - self.modelindex = modelindex_gone; } @@ -1715,32 +2202,114 @@ called when a player connects to a server */ void() ClientConnect = { + local entity te; + local float t; + bprint (PRINT_HIGH, self.netname); - bprint (PRINT_HIGH, " entered the game\n"); - + bprint (PRINT_HIGH, " entered the wasteland\n"); + + te = find(world, classname, "player"); + +/* + t = 0; + + while (te) + { + t = t + 1; + + te = find(te, classname, "player"); + }*/ + +/* + if (infokey(world, "total") == "zero") + { + bprint(2, "setting difficulty for one player.\n"); + localcmd("serverinfo total one\n"); + } + else if (infokey(world, "total") == "one") + { + bprint(2, "setting difficulty for two players.\n"); + localcmd("serverinfo total two\n"); + } + else if (infokey(world, "total") == "two") + { + bprint(2, "setting difficulty for three players.\n"); + localcmd("serverinfo total three\n"); + } + else if (infokey(world, "total") == "three") + { + bprint(2, "setting difficulty for four players.\n"); + localcmd("serverinfo total four\n"); + } + else if (infokey(world, "total") == "four") + { + bprint(2, "setting difficulty maxed out.\n"); + localcmd("serverinfo total four\n"); + } +*/ + self.start_time = world.start_time; + self.map_ent1 = world.map_ent1; + self.map_ent2 = world.map_ent2; + self.map_ent3 = world.map_ent3; + self.map_obj = world.map_obj; + self.location = world.location; stuffcmd(self, "v_damagecshift 1\n"); + stuffcmd(self, "alias +walk impulse 66\n"); + stuffcmd(self, "alias -walk impulse 67\n"); stuffcmd(self, "alias duck impulse 200\n"); stuffcmd(self, "alias prone impulse 201\n"); stuffcmd(self, "alias reload impulse 50\n"); stuffcmd(self, "alias chem impulse 51\n"); stuffcmd(self, "alias buy impulse 52\n"); stuffcmd(self, "alias special impulse 53\n"); - stuffcmd(self, "alias exit impulse 54\n"); + stuffcmd(self, "alias exit impulse 100\n"); stuffcmd(self, "alias drop impulse 55\n"); stuffcmd(self, "alias info impulse 56\n"); - stuffcmd(self, "alias equip impulse 57\n"); + stuffcmd(self, "alias zoom impulse 60\n"); + stuffcmd(self, "alias hostage impulse 65\n"); stuffcmd(self, "alias stimpack \"cmd invuse superstims+stimpack+bandages\"\n"); stuffcmd(self, "alias bandages \"cmd invuse bandages+superstims+stimpack\"\n"); + stuffcmd(self, "alias equip \"cmd invuse 4\"\n"); + stuffcmd(self, "alias q1 \"cmd invuse 5\"\n"); + stuffcmd(self, "alias q2 \"cmd invuse 6\"\n"); + stuffcmd(self, "alias quick1 \"cmd invuse 5\"\n"); + stuffcmd(self, "alias quick2 \"cmd invuse 6\"\n"); stuffcmd(self, "alias toolkit \"cmd invswap toolkit 2;impulse 2\"\n"); + stuffcmd (self, "alias radio1 impulse 212\n"); + stuffcmd (self, "alias radio2 impulse 213\n"); + stuffcmd (self, "alias radio3 impulse 214\n"); + stuffcmd (self, "alias radio4 impulse 215\n"); + stuffcmd (self, "alias radio5 impulse 216\n"); + stuffcmd (self, "alias radio6 impulse 217\n"); + stuffcmd (self, "alias radio7 impulse 218\n"); + stuffcmd (self, "alias radio8 impulse 219\n"); + stuffcmd (self, "alias radio9 impulse 220\n"); + stuffcmd (self, "alias radio10 impulse 221\n"); + stuffcmd (self, "alias radio11 impulse 222\n"); + stuffcmd (self, "bind f1 radio1\n"); + stuffcmd (self, "bind f2 radio2\n"); + stuffcmd (self, "bind f3 radio3\n"); + stuffcmd (self, "bind f4 radio4\n"); + stuffcmd (self, "bind f5 radio5\n"); + stuffcmd (self, "bind f6 radio6\n"); + stuffcmd (self, "bind f7 radio7\n"); + stuffcmd (self, "bind f8 radio8\n"); + stuffcmd (self, "bind f9 radio9\n"); + stuffcmd (self, "bind f10 radio10\n"); + stuffcmd (self, "bind f11 radio11\n"); + + stuffcmd(self, "bind 9 impulse 9\n"); + stuffcmd(self, "bind 0 impulse 10\n"); stuffcmd(self, "bind c equip\n"); stuffcmd(self, "bind g drop\n"); stuffcmd(self, "bind e exit\n"); stuffcmd(self, "bind z special\n"); stuffcmd(self, "bind r reload\n"); + stuffcmd(self, "bind h hostage\n"); stuffcmd(self, "bind x stimpack\n"); stuffcmd(self, "bind b buy\n"); stuffcmd(self, "bind q info\n"); @@ -1764,13 +2333,44 @@ called when a player disconnects from a server */ void() ClientDisconnect = { + local entity te; + local float t; + +/* + if (infokey(world, "total") == "zero") + { + bprint(2, "need players to begin map.\n"); + localcmd("serverinfo total zero\n"); + } + else if (infokey(world, "total") == "one") + { + bprint(2, "need players to begin map.\n"); + localcmd("serverinfo total zero\n"); + } + else if (infokey(world, "total") == "two") + { + bprint(2, "setting difficulty for one player.\n"); + localcmd("serverinfo total one\n"); + } + else if (infokey(world, "total") == "three") + { + bprint(2, "setting difficulty for two players.\n"); + localcmd("serverinfo total two\n"); + } + else if (infokey(world, "total") == "four") + { + bprint(2, "setting difficulty for three players.\n"); + localcmd("serverinfo total three\n"); + } +*/ + // let everyone else know bprint (PRINT_HIGH, self.netname); - bprint (PRINT_HIGH, " left the game with "); - bprint (PRINT_HIGH, ftos(self.frags)); - bprint (PRINT_HIGH, " frags\n"); + bprint (PRINT_HIGH, " left the game.\n"); + self.classname = "disconnected"; sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); set_suicide_frame (); + total_players = total_players - 1; }; /* @@ -1835,13 +2435,25 @@ void(entity targ, entity attacker) ClientObituary = bprint (PRINT_MEDIUM, "[ "); if (attacker.critical == 3) //headshot + { bprint (PRINT_MEDIUM, "X "); + attacker.score = attacker.score + 25; + } if (attacker.critical == 777) //through the wall + { bprint (PRINT_MEDIUM, "% "); + attacker.score = attacker.score + 50; + } if (attacker.critical == 778) //wall headshot + { bprint (PRINT_MEDIUM, "& "); + attacker.score = attacker.score + 75; + } if (attacker.velocity_z != 0) + { bprint (PRINT_MEDIUM, "@ "); + attacker.score = attacker.score - 50; + } // if (attacker.current_slot == 1 && attacker.mag1 == 0) // bprint (PRINT_MEDIUM, "! "); @@ -1854,6 +2466,16 @@ void(entity targ, entity attacker) ClientObituary = return; } + if (targ != attacker && (targ.classname == "monster" || targ.classname == "player") && (attacker.classname == "robofang" || attacker.classname == "player")) + { + bprint (PRINT_MEDIUM, "[;;] "); + bprint(2, attacker.owner.netname); + bprint(2, " >>> "); + bprint(2, targ.netname); + bprint(2, "\n"); + return; + } + if (targ.classname == "player") { @@ -2147,19 +2769,19 @@ void() Identify = traceline (self.origin, (self.origin + (v_forward * 2000)), 32, self); if (trace_ent.classname == "player" && self.currentmenu == "none" && self.team == trace_ent.team) { - if (trace_ent.class == 2) - c1 = "^7\nmedic\n"; + if (trace_ent.class == 1) + c1 = "\nfirst aid\n"; + else if (trace_ent.class == 2) + c1 = "\nstealth\n"; else if (trace_ent.class == 3) - c1 = "^7\nassassin\n"; + c1 = "\ncombat\n"; else if (trace_ent.class == 4) - c1 = "^7\nsoldier\n"; - else if (trace_ent.class == 6) - c1 = "^7\nscientist\n"; + c1 = "\nscience\n"; else - c1 = "^7\n"; + c1 = "\n"; if (trace_ent.health <= 0) - c2 = "^1dead^7"; + c2 = "dead"; c2 = ftos (trace_ent.health); c3 = GetItemName (ToIID(ItemInSlot(trace_ent, trace_ent.current_slot))); diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 8e5f9070d..44070214c 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -39,6 +39,35 @@ float(string desc) itemtoslot = } }; +float(entity x, float slotno) DecreaseDestroySlotOther = +{ + local float it; + local float iid; + local float num; + local entity oself; + + oself = self; + self = x; + + it = ItemInSlot(self, slotno); + if (ToStatus(it) <= 1) + { + SetItemSlot(self, slotno, 0); + return true; + } + else + { + iid = ToIID(it); + num = ToStatus(it); + num = num - 1; + it = SlotVal(iid, num); + SetItemSlot(self, slotno, it); + return false; + } + + self = oself; +}; + float(float slotno) DecreaseDestroySlot = { local float it; @@ -64,21 +93,33 @@ float(float slotno) DecreaseDestroySlot = void(string arg1) Cmd_InvUse = { local float it, iid; - local float slotno; + local float slotno, w; slotno = itemtoslot(arg1); if (!slotno) { - sprint(self, PRINT_MEDIUM, "Can't use - you don't have one\n"); + sprint(self, PRINT_MEDIUM, "can't use - you don't have one\n"); return; } it = ItemInSlot(self, slotno); iid = ToIID(it); + w = SlotOfItem(self, iid); if (iid == 0) return; + if (iid >= IID_GREN_FRAG && iid <= IID_GREN_STUN) + { + if (w != 5 && w != 6) + return; + + self.rtime = time + 1; + self.grenslot = w; + player_pull1(); + return; + } + if (WeaponAmmoType(iid)) { //weapons are reloaded @@ -86,17 +127,34 @@ void(string arg1) Cmd_InvUse = return; } - if (iid == IID_CHEM_STIMPACK || - iid == IID_CHEM_MEDICALBAG || - iid == IID_CHEM_SUPERSTIM) + + if (iid == IID_CHEM_MEDICALBAG) { - if (UseHealingChem(iid)) - DecreaseDestroySlot(slotno); + UseMedicalBag(); + return; + } + + if (iid == IID_CHEM_STIMPACK) + { + UseStimpack(); + return; + } + + if (iid == IID_GREN_FLARE) + { + ToggleFlare(); + return; + } + + if (iid == IID_CHEM_SUPERSTIM) + { + UseSuperStim(); return; } if (iid == IID_CHEM_ADRENALINE || iid == IID_CHEM_PSYCHO || + iid == IID_CHEM_RADX || iid == IID_CHEM_BESERK) { if (UseBoostingChem(iid)) @@ -147,16 +205,17 @@ void(string arg1) Cmd_InvUse = } if (iid == IID_EQUIP_STEALTHBOY) { - if (self.equipment_slot == slotno) - { - self.equipment_slot = 0; - sprint(self, PRINT_HIGH, "stealthboy deactivated\n"); - } - else - { - self.equipment_slot = slotno; - sprint(self, PRINT_HIGH, "stealthboy activated, fading into the shadows\n"); - } + Sneak(); + return; + } + if (iid == IID_EQUIP_SILENCER) + { + AttachSilencer(); + return; + } + if (iid == IID_WP_WRENCH) + { + FireToolkit(); return; } if (iid == IID_EQUIP_HOVERBOOTS) @@ -198,6 +257,519 @@ void(string arg1) Cmd_InvDrop = DropFromSlot(slotno, true, false); }; +void(string arg1) Cmd_InvSell = +{ + local float it, iid, x; + local float slotno; + local string y, z; + + slotno = itemtoslot(arg1); + if (!slotno) + { + sprint(self, 2, "can't sell - you don't have one\n"); + return; + } + + if (slotno <= 4) + { + sprint(self, 2, "put it in your inventory first!\n"); + return; + } + + it = ItemInSlot(self, slotno); + iid = ToIID(it); + + if (iid == 0) + return; + + self.missionbrief = 0; + + SetItemSlot(self, slotno, 0); + x = GetBaseValue(iid); + y = ftos(x); + z = GetItemName(iid); + + self.ammo_shells += x; + sprint(self, 2, "you sell "); + sprint(self, 2, z); + sprint(self, 2, " for $"); + sprint(self, 2, y); + sprint(self, 2, ".\n"); + +}; + +void(string arg1) Cmd_InvMix = +{ + local float it, iid; + local float slotno, x; + slotno = itemtoslot(arg1); + + if (!slotno) + { + sprint(self, PRINT_MEDIUM, "Can't drop - you don't have one\n"); + return; + } + + + it = ItemInSlot(self, slotno); + iid = ToIID(it); + + + if (iid == 0) + return; + + if (iid == IID_MISC_NUKACOLA) + { + x = SlotOfItem(self, IID_MISC_CHEMICALS); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need (1) nukacola and (1) chemicals\n"); + return; + } + DecreaseDestroySlot(slotno); + DecreaseDestroySlot(x); + + TryGiveStackable(self, IID_CHEM_STIMPACK, 1); + sprint(self, PRINT_MEDIUM, "stimpack created\n"); + } + if (iid == IID_MISC_AEROSOL) + { + x = SlotOfItem(self, IID_MISC_CHEMICALS); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need (1) aerosol can and (1) chemicals\n"); + return; + } + DecreaseDestroySlot(slotno); + DecreaseDestroySlot(x); + + TryGiveStackable(self, IID_CHEM_RADX, 3); + sprint(self, PRINT_MEDIUM, "rad-x created\n"); + } + if (iid == IID_MISC_RDXCRYSTAL) + { + x = SlotOfItem(self, IID_MISC_CHEMICALS); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need (1) rdx crystal and (1) chemicals\n"); + return; + } + DecreaseDestroySlot(slotno); + DecreaseDestroySlot(x); + + TryGiveStackable(self, IID_CHEM_PSYCHO, 2); + sprint(self, PRINT_MEDIUM, "psycho created\n"); + } + if (iid == IID_CHEM_STIMPACK) + { + if (ToStatus(slotno) <= 1) + { + sprint(self, PRINT_MEDIUM, "you need (2) stimpacks and (1) chemicals\n"); + return; + } + x = SlotOfItem(self, IID_MISC_CHEMICALS); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need (2) stimpacks and (1) chemicals\n"); + return; + } + DecreaseDestroySlot(slotno); + DecreaseDestroySlot(slotno); + DecreaseDestroySlot(x); + + TryGiveStackable(self, IID_CHEM_SUPERSTIM, 1); + sprint(self, PRINT_MEDIUM, "superstim created.\n"); + } + + + +}; + +void(string arg1) Cmd_InvCreate = +{ + local float it, iid; + local float slotno, q, w, x, y, z; + local float weap; + + if (arg1 == "flash") + { + + x = SlotOfItem(self, IID_MISC_NUKACOLA); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals + aerosol can\n"); + return; + } + + y = SlotOfItem(self, IID_MISC_CHEMICALS); + if (y == 0) + { + sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals + aerosol can\n"); + return; + } + + z = SlotOfItem(self, IID_MISC_AEROSOL); + if (z == 0) + { + sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals + aerosol can\n"); + return; + } + + DecreaseDestroySlot(x); + DecreaseDestroySlot(y); + DecreaseDestroySlot(z); + + if ((random()<0.50) && (self.class == 1)) + { + sprint(self, PRINT_MEDIUM, "you failed to create a flash bomb.\n"); + return; + } + if ((random()<0.25) && (self.class == 2)) + { + sprint(self, PRINT_MEDIUM, "you failed to create a flash bomb.\n"); + return; + } + if ((random()<0.75) && (self.class == 3)) + { + sprint(self, PRINT_MEDIUM, "you failed to create a flash bomb.\n"); + return; + } + + TryGiveStackable(self, IID_GREN_FLASH, 1); + sprint(self, PRINT_MEDIUM, "flash bomb created.\n"); + } + if (arg1 == "grenade") + { + x = SlotOfItem(self, IID_MISC_RDXCRYSTAL); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need rdx crystals, chemicals, aerosol can\n"); + return; + } + + y = SlotOfItem(self, IID_MISC_CHEMICALS); + if (y == 0) + { + sprint(self, PRINT_MEDIUM, "you need rdx crystals, chemicals, aerosol can\n"); + return; + } + + z = SlotOfItem(self, IID_MISC_AEROSOL); + if (z == 0) + { + sprint(self, PRINT_MEDIUM, "you need rdx crystals, chemicals, aerosol can\n"); + return; + } + + DecreaseDestroySlot(x); + DecreaseDestroySlot(y); + DecreaseDestroySlot(z); + + if ((random()<0.75) && (self.class == 1)) + { + sprint(self, PRINT_MEDIUM, "you failed to create a grenade.\n"); + return; + } + if ((random()<0.75) && (self.class == 2)) + { + sprint(self, PRINT_MEDIUM, "you failed to create a grenade.\n"); + return; + } + if ((random()<0.75) && (self.class == 3)) + { + sprint(self, PRINT_MEDIUM, "you failed to create a grenade.\n"); + return; + } + + TryGiveStackable(self, IID_GREN_FRAG, 1); + sprint(self, PRINT_MEDIUM, "homemade bomb created.\n"); + } + if (arg1 == "silencer") + { + x = SlotOfItem(self, IID_MISC_DUCKTAPE); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need junk + aerosol can + duck tape\n"); + return; + } + y = SlotOfItem(self, IID_MISC_JUNK); + if (y == 0) + { + sprint(self, PRINT_MEDIUM, "you need junk + aerosol can + duck tape\n"); + return; + } + z = SlotOfItem(self, IID_MISC_AEROSOL); + if (z == 0) + { + sprint(self, PRINT_MEDIUM, "you need junk + aerosol can + duck tape\n"); + return; + } + + DecreaseDestroySlot(x); + DecreaseDestroySlot(y); + DecreaseDestroySlot(z); + + if ((random()<0.25) && (self.class == 1)) + { + sprint(self, PRINT_MEDIUM, "you failed to create a silencer.\n"); + return; + } + if ((random()<0.10) && (self.class == 2)) + { + sprint(self, PRINT_MEDIUM, "you failed to create a silencer.\n"); + return; + } + if ((random()<0.50) && (self.class == 3)) + { + sprint(self, PRINT_MEDIUM, "you failed to create a silencer.\n"); + return; + } + AddNonStackable(self, IID_EQUIP_SILENCER, 1); + sprint(self, PRINT_MEDIUM, "silencer created.\n"); + } + if (arg1 == "stun") + { + x = SlotOfItem(self, IID_MISC_NUKACOLA); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals\n"); + return; + } + + y = SlotOfItem(self, IID_MISC_CHEMICALS); + if (y == 0) + { + sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals\n"); + return; + } + DecreaseDestroySlot(x); + DecreaseDestroySlot(y); + + if ((random()<0.40) && (self.class < 4)) + { + sprint(self, PRINT_MEDIUM, "you failed to create a stun grenade.\n"); + return; + } + + TryGiveStackable(self, IID_GREN_STUN, 1); + sprint(self, PRINT_MEDIUM, "stun grenade created.\n"); + } + if (arg1 == "extender") + { + y = SlotOfItem(self, IID_MISC_STEELPIPE); + if (y == 0) + { + sprint(self, PRINT_MEDIUM, "you need steel pipe + duck tape\n"); + return; + } + + z = SlotOfItem(self, IID_MISC_DUCKTAPE); + if (z == 0) + { + sprint(self, PRINT_MEDIUM, "you need junk, aerosol can\n"); + return; + } + + DecreaseDestroySlot(y); + DecreaseDestroySlot(z); + + AddNonStackable(self, IID_EQUIP_EXTENDER, 1); + sprint(self, PRINT_MEDIUM, "barrel extender created.\n"); + } + if (arg1 == "xray") + { + y = SlotOfItem(self, IID_MISC_LCD); + if (y == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + y = SlotOfItem(self, IID_MISC_CIRCUITBOARD); + if (y == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + + z = SlotOfItem(self, IID_MISC_GUM); + if (z == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + q = SlotOfItem(self, IID_MISC_XRAYTUBE); + if (q == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + w = SlotOfItem(self, IID_MISC_COPPERWIRE); + if (w == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + + DecreaseDestroySlot(q); + DecreaseDestroySlot(w); + DecreaseDestroySlot(x); + DecreaseDestroySlot(y); + DecreaseDestroySlot(z); + + if ((random()<0.90) && (self.class < 4)) + { + sprint(self, PRINT_MEDIUM, "you failed to create an x-ray device.\n"); + return; + } + + AddNonStackable(self, IID_EQUIP_XRAY, 1); + sprint(self, PRINT_MEDIUM, "x-ray device created!\n"); + } + if (arg1 == "modify") + { + weap = ToIID(self.(SlotField(self.current_slot))); + + if (weap == IID_WP_PULSERIFLE) + { + y = SlotOfItem(self, IID_MISC_DUCKTAPE); + if (y == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + x = SlotOfItem(self, IID_MISC_CIRCUITBOARD); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + z = SlotOfItem(self, IID_MISC_NUKACOLA); + if (z == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + q = SlotOfItem(self, IID_MISC_XRAYTUBE); + if (q == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + w = SlotOfItem(self, IID_MISC_COPPERWIRE); + if (w == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + + DecreaseDestroySlot(q); + DecreaseDestroySlot(w); + DecreaseDestroySlot(x); + DecreaseDestroySlot(y); + DecreaseDestroySlot(z); + + if (ToIID(self.islot1) == IID_WP_PULSERIFLE) + SetItemSlot(self, 1, SlotVal(IID_WP_TURBOPLASMA, 40)); + else if (ToIID(self.islot2) == IID_WP_PULSERIFLE) + SetItemSlot(self, 2, SlotVal(IID_WP_TURBOPLASMA, 40)); + + + if ((random()<0.25)) + { + sprint(self, PRINT_MEDIUM, "you try to modify your plasma rifle by hotwiring\n"); + sprint(self, PRINT_MEDIUM, "the bolt carrier and venting off excess gasses \n"); + sprint(self, PRINT_MEDIUM, "but you end up destroying it...\n"); + return; + } + AddNonStackable(self, IID_WP_TURBOPLASMA, 1); + sprint(self, PRINT_MEDIUM, "turbo plasma rifle created\n"); + } + if (weap == IID_WP_AK112) + { + y = SlotOfItem(self, IID_MISC_DUCKTAPE); + if (y == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + x = SlotOfItem(self, IID_MISC_JUNK); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + z = SlotOfItem(self, IID_MISC_AEROSOL); + if (z == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + w = SlotOfItem(self, IID_MISC_COPPERWIRE); + if (w == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + + DecreaseDestroySlot(y); + DecreaseDestroySlot(w); + DecreaseDestroySlot(x); + DecreaseDestroySlot(z); + + if (ToIID(self.islot1) == IID_WP_AK112) + SetItemSlot(self, 1, SlotVal(IID_WP_AK112_M, 50)); + else if (ToIID(self.islot2) == IID_WP_AK112) + SetItemSlot(self, 2, SlotVal(IID_WP_AK112_M, 50)); + + sprint(self, PRINT_MEDIUM, "created expanded magazine for ak-112\n"); + } + if (weap == IID_WP_DEAGLE) + { + y = SlotOfItem(self, IID_MISC_DUCKTAPE); + if (y == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + x = SlotOfItem(self, IID_MISC_JUNK); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + z = SlotOfItem(self, IID_MISC_AEROSOL); + if (z == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + w = SlotOfItem(self, IID_MISC_COPPERWIRE); + if (w == 0) + { + sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); + return; + } + + DecreaseDestroySlot(y); + DecreaseDestroySlot(w); + DecreaseDestroySlot(x); + DecreaseDestroySlot(z); + + if (ToIID(self.islot1) == IID_WP_DEAGLE) + SetItemSlot(self, 1, SlotVal(IID_WP_DEAGLE_M, 10)); + else if (ToIID(self.islot2) == IID_WP_DEAGLE) + SetItemSlot(self, 2, SlotVal(IID_WP_DEAGLE_M, 10)); + + sprint(self, PRINT_MEDIUM, "created expanded magazine for deagle\n"); + } + else + { + sprint(self, PRINT_MEDIUM, "can't modify currently held weapon.\n"); + return; + } + } +}; + void(string arg1, string arg2) Cmd_InvSwap = { local float old1, old2; @@ -288,6 +860,24 @@ void(string line) SV_ParseClientCommand = return; Cmd_InvDrop(argv(1)); } + else if (cmd == "invsell") + { + if (self.deadflag || self.current_slot==0) + return; + Cmd_InvSell(argv(1)); + } + else if (cmd == "invmix") + { + if (self.deadflag) + return; + Cmd_InvMix(argv(1)); + } + else if (cmd == "create") + { + if (self.deadflag) + return; + Cmd_InvCreate(argv(1)); + } else if (cmd == "invswap") { if (self.deadflag || self.current_slot==0) diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 36b7c944e..5faaab5c5 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -3,7 +3,7 @@ void() T_MissileTouch; void() info_player_start; void(entity targ, entity attacker) ClientObituary; void(entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage; - +float (float int) getperk; void() monster_death_use; //============================================================================ @@ -115,7 +115,7 @@ This should be the only function that ever reduces health. void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = { local entity oldself; - local float save; + local float save, dm; local float take, severity, helm; local string attackerteam, targteam; @@ -123,47 +123,230 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (!targ.takedamage) return; + + damage = floor(damage); + targ.health = floor(targ.health); + + if (attacker.classname == "player" && total_players == 4) + damage = floor(damage * 0.75); + if (attacker.classname == "player" && total_players == 3) + damage = floor(damage * 0.80); + else if (attacker.classname == "player" && total_players == 2) + damage = floor(damage * 0.90); + + if (attacker.classname == "monster" && total_players == 4) + damage = floor(damage * 1.30); + if (attacker.classname == "monster" && total_players == 3) + damage = floor(damage * 1.20); + else if (attacker.classname == "monster" && total_players == 2) + damage = floor(damage * 1.10); + +//getting hurt is slightly painful to the score, play cautiously! + if (attacker.classname == "monster" && targ.classname == "player") + targ.score = targ.score - 6; + +//flanking monsters awards points + if (attacker.classname == "player" && targ.classname == "monster" && targ.enemy != attacker) + attacker.score = attacker.score + 5; + +//aimed shots awards points + if (attacker.classname == "player" && targ.classname == "monster" && attacker.recoil <= 5) + attacker.score = attacker.score + 1; + +//attacker a monster from behind awards points + + local vector vec; + local float dot; + + if (attacker.classname == "player" && targ.classname == "monster") + { + makevectors (targ.angles); + vec = normalize (attacker.origin - targ.origin); + dot = (vec * v_forward); + + if (dot > 0.3) + attacker.score = attacker.score + 5; + } + +//attacking a team-mate is a HUGE penalty + if (attacker.classname == "player" && targ.classname == "player") + { + attacker.score = attacker.score - 25; + sprint(attacker, 2, "you just shot a teammate! be careful!\n"); + } + +//attacking a hostage is a HUGE penalty + if (attacker.classname == "player" && targ.classname == "hostage") + { + attacker.score = attacker.score - 25; + sprint(attacker, 2, "you just shot a hostage! be careful!\n"); + } + +//using cover awards points + if (targ.classname == "monster" && attacker.classname == "player" && attacker.rage == 777) + attacker.score = attacker.score + 1; + +//dodge chance + + if (targ.position == 0 && random()<0.05) + { + sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); + return; + } + else if (targ.position == 1 && random()<0.05) + { + sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); + return; + } + else if (targ.position == 2 && random()<0.10) + { + sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); + return; + } + + damage = damage * 1.25; + +//nintendo gamer: going into the zone gives a 50% miss chance + + if (targ.rage == 255) + { + if (random()<0.50) + { + sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); + return; + } + } + + + +//paranoia: if taking cover, 25% miss chance (others get 10% bonus) + if (targ.rage == 777) + { + if (targ.perk1 == 10 || targ.perk2 == 10) + { + if (random()<0.20) + { + sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); + return; + } + } + else + { + if (random()<0.05) + { + sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); + return; + } + } + } + + //master blaster: the more you burst, the higher the damage bonus + if (attacker.perk1 == 18 || attacker.perk2 == 18) + { + if (self.recoil > 10) + { + sprint(self, 2, "!MASTER BLASTER\n"); + damage = damage * (1 + (self.recoil * 0.01)); + } + } + + //sneak attack: if you attack a creature who isn't fighting you, bonus damage + if (attacker.perk1 == 7 || attacker.perk2 == 7) + { + if (targ.enemy != attacker) + { + sprint(attacker, 2, "!SNEAK ATTACK\n"); + if (damage <= 10) + damage = damage * 3; + else if (damage <= 20) + damage = damage * 2; + else if (damage <= 30) + damage = damage * 1.5; + else + damage = damage * 1.25; + } + } + + //death wish: 20% damage bonus to targ, 10% to attacker + if (targ.perk1 == 19 || targ.perk2 == 19) + damage = damage * 1.10; + + //death wish: 20% damage bonus to targ, 10% to attacker + if (attacker.perk1 == 19 || attacker.perk2 == 19) + damage = damage * 1.20; + +//die hard: if below 50% health, 25% damage resistance + if (targ.perk1 == 1 || targ.perk2 == 1) + { + if (targ.health < (targ.max_health*0.5)) + damage = damage * 0.75; + } + + if ((targ.perk1 == 17 || targ.perk2 == 17) && random()<0.02) + { + damage = damage * 0.10; + sprint(self, 2, "!ONE IN A MILLION\n"); + } + // used by buttons and triggers to set activator for target firing damage_attacker = attacker; + if (attacker.classname == "monster") + { + if (random()*100>= 98) + attacker.critical = 3; + else + attacker.critical = 0; + } -// check for quad damage powerup on the attacker - if (attacker.super_damage_finished > time && inflictor.classname != "door") - if (deathmatch == 4) - damage = damage * 8; - else - damage = damage * 4; - - if (attacker.critical == 3)//attacker scored a headshot/critical + if (attacker.critical == 3 && targ.classname != "car")//attacker scored a headshot/critical { if (attacker.critical == 3) { + + if (random()<0.005) + severity = 64; + + severity = 0 + random()*20; - if (attacker.perk == 7) - severity = severity + 4; - if (attacker.class == 3) - severity = severity + 2; + if ((attacker.perk1 == 17 || attacker.perk2 == 17) && random()<0.05) + { + severity = severity + 15; + sprint(self, 2, "!ONE IN A MILLION\n"); + } - if (severity >= 19) + if (attacker.class == 2) + severity = severity + 5; + + if (targ.classname == "player") + damage = (damage * 2); + else if (severity >= 64) + damage = (damage * 10); + else if (severity >= 30) + damage = (damage * 6); + else if (severity >= 20) damage = (damage * 5); - else if (severity >= 14) + else if (severity >= 15) damage = (damage * 4); else damage = (damage * 3); + if (targ.classname == "monster") + attacker.score = attacker.score + 5; + helm = targ.armortype; if (targ.helmet == 0) { - sound (targ, CHAN_BODY, "player/headshot.wav", 1, ATTN_NORM); + sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM); helm = 0; } - if (targ.helmet == AS_STRAIGHT) + if (targ.helmet == 1) { sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); helm = 0.30; } - if (targ.helmet == AS_SLIDING) + if (targ.helmet == 2) { sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); helm = 0.45; @@ -182,22 +365,9 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = return; } - sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); - -// save damage based on the target's armor level - - save = ceil(targ.armortype*damage); - if (save >= targ.armorvalue) - { - save = targ.armorvalue; -/* targ.armortype = 0; // lost all armor - targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); -*/ - } + sound (targ, CHAN_ITEM, targ.armornoise, 1, ATTN_NORM); - take = ceil(damage-save); - // add to the damage total for clients, which will be sent as a single // message at the end of the frame // FIXME: remove after combining shotgun blasts? @@ -263,6 +433,347 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = return; +take = damage; + +// do the damage + //different sorts of armour simply subtract different amounts + //this makes armor like the force armor good against many small rounds + //(SMG, shotguns, swords, etc) but useless against big damage (grenades) + //power armor, which has the best of both worlds, is also the heaviest :p + + //fix: soldiers inherent armor bonus applies to armor absorb + //fix: psycho drug gives similar benefits to a soldiers bonus + + if (targ.class == 3) + take -= 1; + if (self.rage == IID_CHEM_PSYCHO) + take -= 3; + + switch(ToIID(targ.islot3)) + { + case IID_ARM_DESERT: + take -= 1; + break; + case IID_ARM_SHIRT: + take -= 1; + break; + case IID_ARM_LEATHER: + take -= 5; + break; + case IID_ARM_KEVLAR: + take -= 3; + break; + case IID_ARM_METAL: + take -= 9; + break; + case IID_ARM_COMBAT: + take -= 7; + break; + case IID_ARM_BROTHERHOOD: + take -= 10; + break; + case IID_ARM_FORCE: + take -= 13; + break; + case IID_ARM_LPOWER: + take -= 11; + break; + default: + break; + } + + switch(ToIID(targ.islot3)) + { + case IID_ARM_SHIRT: + take = take * 0.80; + break; + case IID_ARM_LEATHER: + take = take * 0.70; + break; + case IID_ARM_KEVLAR: + take = take * 0.50; + break; + case IID_ARM_METAL: + take = take * 0.65; + break; + case IID_ARM_COMBAT: + take = take * 0.60; + break; + case IID_ARM_BROTHERHOOD: + take = take * 0.55; + break; + case IID_ARM_FORCE: + take = take * 0.90; + break; + case IID_ARM_LPOWER: + take = take * 0.50; + break; + default: + break; + } + + if (targ.classname == "player" && targ.zoom > 0) + { + targ.maxspeed = targ.maxspeed * 0.33; + stuffcmd(targ, "v_idlescale 20\n"); + } + else if (take > 20 && targ.classname == "player") + { + targ.maxspeed = targ.maxspeed * 0.25; + stuffcmd(targ, "v_cshift 100 0 0 100\n"); + stuffcmd(targ, "v_idlescale 30\n"); + } + else if (take > 0) + { + targ.maxspeed = targ.maxspeed * 0.50; + stuffcmd(targ, "v_cshift 100 0 0 50\n"); + } + + if (take <= 0) + { + take = 0; + sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); + return; + } + + + targ.health = targ.health - take; + + if (targ.classname == "monster" && targ.enemy.classname != "player" && attacker.classname == "player") + { + targ.enemy = attacker; + targ.think = HuntTarget; + targ.nextthink = time + 0.1; + } + + local string lm; + + if (targ.health <= 0) + { + +//vanquishing a monster earns points for all players + if (attacker.classname == "player" && targ.classname == "monster") + { + local entity te; + te = findradius(attacker.origin, 1000); + while (te) + { + if (te.classname == "player") + te.score = te.score + 10; + + te = te.chain; + } + } + + Killed (targ, attacker); + if (attacker.perk1 == 11 || attacker.perk2 == 11) + { + attacker.lastman += 1.5; + lm = ftos(attacker.lastman); + sprint(self, 2, "!LAST MAN STANDING: "); + sprint(self, 2, lm); + sprint(self, 2, "\n"); + + attacker.health += attacker.lastman; + if (attacker.health > attacker.max_health) + attacker.health = attacker.max_health; + } + return; + } + +// react to the damage + oldself = self; + self = targ; + +//SERVER + + if ( (self.flags & FL_MONSTER) && attacker != world) + { + // get mad unless of the same class (except for soldiers) + if (self != attacker && attacker != self.enemy) + { + if ((self.classname != attacker.classname)) + { + if (self.enemy.classname == "player") + self.oldenemy = self.enemy; + self.enemy = attacker; + FoundTarget (); + } + } + } + + if (self.th_pain) + { + self.th_pain (attacker, take); + } + + self = oldself; +}; + + +/* +============ +J_Damage + +This is a special function that is called for weapons using JHP ammo. +JHP ammo does extra damage against things wearing no armor or little +armor, but less damage against heavily armored foes. +============ +*/ + +void(entity targ, entity inflictor, entity attacker, float damage) J_Damage = +{ + local entity oldself; + local float save; + local float take, severity, helm; + local string attackerteam, targteam; + + + if (!targ.takedamage) + return; + + damage = damage * 1.25; + damage = floor(damage); + +// used by buttons and triggers to set activator for target firing + damage_attacker = attacker; + + if (attacker.critical == 3 && targ.classname != "car")//attacker scored a headshot/critical + { + if (attacker.critical == 3) + { + severity = 0 + random()*20; + + if (attacker.class == 3) + severity = severity + 2; + + if (severity >= 19) + damage = (damage * 5); + else if (severity >= 14) + damage = (damage * 4); + else + damage = (damage * 3); + + if (targ.classname == "monster") + attacker.score = attacker.score + 5; + + helm = targ.armortype; + if (targ.helmet == 0) + { + sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM); + helm = 0; + } + if (targ.helmet == AS_STRAIGHT) + { + sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); + helm = 0.30; + } + if (targ.helmet == AS_SLIDING) + { + sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); + helm = 0.45; + } + + damage = (damage - (damage * helm)); + + makevectors (targ.v_angle); + } + } + + //sneak attack: if you attack a creature who isn't fighting you, bonus damage + if (attacker.perk1 == 7 || attacker.perk2 == 7) + { + if (targ.enemy != attacker) + { + sprint(attacker, 2, "!SNEAK ATTACK\n"); + if (damage <= 10) + damage = damage * 3; + else if (damage <= 20) + damage = damage * 2; + else if (damage <= 30) + damage = damage * 1.5; + else + damage = damage * 1.25; + } + } + + if (damage <= 0) + { + damage = 0; + sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); + return; + } + + sound (targ, CHAN_ITEM, targ.armornoise, 1, ATTN_NORM); + + +// add to the damage total for clients, which will be sent as a single +// message at the end of the frame +// FIXME: remove after combining shotgun blasts? + if (targ.flags & FL_CLIENT) + { + targ.dmg_take = targ.dmg_take + take; + targ.dmg_save = targ.dmg_save + save; + targ.dmg_inflictor = inflictor; + } + + damage_inflictor = inflictor; + +/* +// figure momentum add + if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) ) + { + dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5; + dir = normalize(dir); + // Set kickback for smaller weapons +//Zoid -- use normal NQ kickback +// // Read: only if it's not yourself doing the damage +// if ( (damage < 60) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname != targ.netname)) +// targ.velocity = targ.velocity + dir * damage * 11; +// else + // Otherwise, these rules apply to rockets and grenades + // for blast velocity + targ.velocity = targ.velocity + dir * damage * 8; + + // Rocket Jump modifiers + if ( (rj > 1) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname == targ.netname)) + targ.velocity = targ.velocity + dir * damage * rj; + + }*/ + + + +// check for godmode or invincibility + if (targ.flags & FL_GODMODE) + return; + if (targ.invincible_finished >= time) + { + if (self.invincible_sound < time) + { + sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM); + self.invincible_sound = time + 2; + } + return; + } + +// team play damage avoidance +//ZOID 12-13-96: self.team doesn't work in QW. Use keys + attackerteam = infokey(attacker, "team"); + targteam = infokey(targ, "team"); + + if ((teamplay == 1) && (targteam == attackerteam) && + (attacker.classname == "player") && (attackerteam != "") && + inflictor.classname !="door") + return; + + if ((teamplay == 3) && (targteam == attackerteam) && + (attacker.classname == "player") && (attackerteam != "") && + (targ != attacker)&& inflictor.classname !="door") + return; + + +take = damage; + // do the damage //different sorts of armour simply subtract different ammounts //this makes armor like the force armor good against many small rounds @@ -271,34 +782,84 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = switch(ToIID(targ.islot3)) { + case IID_ARM_DESERT: + take -= 1; + break; case IID_ARM_SHIRT: take -= 1; break; case IID_ARM_LEATHER: - take -= 2; + take -= 10; break; case IID_ARM_KEVLAR: - take -= 3; - break; - case IID_ARM_METAL: - take -= 4; - break; - case IID_ARM_COMBAT: take -= 5; break; + case IID_ARM_METAL: + take -= 25; + break; + case IID_ARM_COMBAT: + take -= 20; + break; case IID_ARM_BROTHERHOOD: - take -= 6; + take -= 20; break; case IID_ARM_FORCE: - take -= 7; + take -= 30; break; case IID_ARM_LPOWER: - take -= 8; + take -= 25; break; default: break; } + switch(ToIID(targ.islot3)) + { + case IID_ARM_SHIRT: + take = take * 0.70; + break; + case IID_ARM_LEATHER: + take = take * 0.60; + break; + case IID_ARM_KEVLAR: + take = take * 0.40; + break; + case IID_ARM_METAL: + take = take * 0.55; + break; + case IID_ARM_COMBAT: + take = take * 0.50; + break; + case IID_ARM_BROTHERHOOD: + take = take * 0.45; + break; + case IID_ARM_FORCE: + take = take * 0.80; + break; + case IID_ARM_LPOWER: + take = take * 0.40; + break; + default: + break; + } + + if (targ.classname == "player" && targ.zoom > 0) + { + targ.maxspeed = targ.maxspeed * 0.20; + stuffcmd(targ, "v_idlescale 20\n"); + } + else if (take > 20 && targ.classname == "player") + { + targ.maxspeed = targ.maxspeed * 0.20; + stuffcmd(targ, "v_cshift 100 0 0 100\n"); + stuffcmd(targ, "v_idlescale 30\n"); + } + else if (take > 0) + { + targ.maxspeed = targ.maxspeed * 0.30; + stuffcmd(targ, "v_cshift 100 0 0 50\n"); + } + if (take <= 0) { @@ -349,8 +910,8 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = ============ X_Damage -The other damage function. - +The purpose of X_Damage is to allow certain weapons to bypass armor +which is a very large part of the game. ============ */ @@ -365,50 +926,46 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage = if (!targ.takedamage) return; + damage = damage * 0.75; + damage = floor(damage); + // used by buttons and triggers to set activator for target firing damage_attacker = attacker; - -// check for quad damage powerup on the attacker - if (attacker.super_damage_finished > time && inflictor.classname != "door") - if (deathmatch == 4) - damage = damage * 8; - else - damage = damage * 4; - - if (attacker.critical == 3)//attacker scored a headshot/critical + if (attacker.critical == 3 && targ.classname != "car")//attacker scored a headshot/critical { if (attacker.critical == 3) { severity = 0 + random()*20; - if (attacker.perk == 7) + + if (attacker.class == 2) severity = severity + 4; - if (attacker.class == 3) - severity = severity + 2; - if (severity >= 19) - damage = (damage * 3.0); + damage = (damage * 5); else if (severity >= 14) - damage = (damage * 2.5); + damage = (damage * 4); else - damage = (damage * 2.0); + damage = (damage * 3); + + if (targ.classname == "monster") + attacker.score = attacker.score + 5; helm = targ.armortype; if (targ.helmet == 0) { - sound (targ, CHAN_BODY, "player/headshot.wav", 1, ATTN_NORM); + sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM); helm = 0; } if (targ.helmet == AS_STRAIGHT) { sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); - helm = 0.10; + helm = 0.15; } if (targ.helmet == AS_SLIDING) { sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); - helm = 0.15; + helm = 0.22; } damage = (damage - (damage * helm)); @@ -417,8 +974,20 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage = } } - if (random()*4<=1) + if (damage <= 0) + { + damage = 0; sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); + return; + } + + sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); + +// save damage based on the target's armor level + + + + take = ceil(damage); // add to the damage total for clients, which will be sent as a single // message at the end of the frame @@ -459,7 +1028,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage = // check for godmode or invincibility if (targ.flags & FL_GODMODE) return; - if (targ.invincible_finished >= time) { if (self.invincible_sound < time) @@ -494,19 +1062,63 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage = switch(ToIID(targ.islot3)) { - case IID_ARM_BROTHERHOOD: - take -= 1; + case IID_ARM_METAL: + take -= 1; + break; + case IID_ARM_BROTHERHOOD: + take -= 1; + break; + case IID_ARM_FORCE: + take -= 3; + break; + case IID_ARM_LPOWER: + take -= 2; + break; + default: + break; + } + + switch(ToIID(targ.islot3)) + { + case IID_ARM_LEATHER: + take = take * 0.90; break; - case IID_ARM_FORCE: - take -= 2; + case IID_ARM_KEVLAR: + take = take * 0.75; + break; + case IID_ARM_METAL: + take = take * 0.90; + break; + case IID_ARM_COMBAT: + take = take * 0.90; + break; + case IID_ARM_BROTHERHOOD: + take = take * 0.80; break; case IID_ARM_LPOWER: - take -= 3; + take = take * 0.75; break; default: break; } + if (targ.classname == "player" && targ.zoom > 0) + { + targ.maxspeed = targ.maxspeed * 0.33; + stuffcmd(targ, "v_idlescale 20\n"); + } + else if (take > 20 && targ.classname == "player") + { + targ.maxspeed = targ.maxspeed * 0.25; + stuffcmd(targ, "v_cshift 100 0 0 100\n"); + stuffcmd(targ, "v_idlescale 30\n"); + } + else if (take > 0) + { + targ.maxspeed = targ.maxspeed * 0.50; + stuffcmd(targ, "v_cshift 100 0 0 50\n"); + } + if (take <= 0) { @@ -560,7 +1172,7 @@ T_RadiusDamage */ void(entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage = { - local float points; + local float points, srange, brange; local entity head; local vector org; @@ -578,13 +1190,12 @@ void(entity inflictor, entity attacker, float damage, entity ignore, string dtyp if (head.takedamage) { org = head.origin + (head.mins + head.maxs)*0.5; - points = 0.5*vlen (inflictor.origin - org); + points = vlen(inflictor.origin - org); + points = points + damage*0.50; if (points < 0) points = 0; points = damage - points; - if (head == attacker) - points = points * 0.5; if (points > 0) { if (CanDamage (head, inflictor)) @@ -599,6 +1210,37 @@ void(entity inflictor, entity attacker, float damage, entity ignore, string dtyp } }; + +void (entity inflictor, entity attacker, float damage, entity ignore, float xrange) T_RadiusDamage2 = +{ + local float points; + local entity head; + local vector org; + local float srange; + local float sub; + local float damaget; + + head = findradius (inflictor.origin, xrange); + while (head) + { + if (head != ignore) + { + if (head.takedamage) + { + org = head.origin; + srange = vlen ((inflictor.origin - org)); + points = (xrange / srange); + sub = (1 / points); + damaget = (damage - (damage * sub)); + if (damaget > 0) + if (CanDamage (head, inflictor)) + T_Damage (head, inflictor, attacker, damaget); + } + } + head = head.chain; + } +}; + /* ============ T_BeamDamage diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 9b268c142..323173b71 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -363,7 +363,7 @@ float TE_EXPLOSION = 3; float TE_TAREXPLOSION = 4; float TE_LIGHTNING1 = 5; float TE_LIGHTNING2 = 6; -float TE_WIZSPIKE = 7; +float TE_WIZSPIKE = 7; float TE_KNIGHTSPIKE = 8; float TE_LIGHTNING3 = 9; float TE_LAVASPLASH = 10; @@ -454,6 +454,16 @@ float MULTICAST_PVS_R = 5; // within sight, reliable #define FL_FINDABLE_NONSOLID 16384 //a cpqwsv feature +// map objectives +float OBJ_NONE = 0; // no objective +float OBJ_HOSTAGE = 1; // rescue hostages +float OBJ_SUPPLY = 2; // capture supplies +float OBJ_SHADOW = 3; // pass without trace +float OBJ_DEADTOWN = 4; // overrun with zombies +float OBJ_DESTROY = 5; // destroy enemy fuel tanks +float OBJ_DEFUSE = 6; // defuse explosives +float OBJ_EXTERMINATE = 6; // destroy deathclaw nest +float OBJ_SHAMBLERHUNT = 7; // destroy shambler hive //================================================ @@ -478,18 +488,28 @@ float teamplay; float timelimit; float fraglimit; float deathmatch; +string m_map; float coop; var float rj = 1; float no_connect; float round_end; float red_kill; float blue_kill; -float teamthatwon; -float team_blue; -float team_red; +float called_in; + +float winningteam; +float t1alive; +float t2alive; +float t1dead; +float t2dead; float bombed; float zombies; float hostages; +float musicplay; +float musictrack; +float supplies; +float commanders; +float rescue; float dead_hostage; float team1win; float team2win; @@ -503,7 +523,17 @@ float max_zombies; float gtimer; float total_players; float endgame_timer; +float time_left; +float s_map_obj; +float s_ent1; +float s_ent2; +float s_ent3; +float s_p1; +float s_p2; +float s_p3; + +float challenge_rating; //================================================ // @@ -575,7 +605,7 @@ float AS_MISSILE = 4; .float rad_time; .float fly_sound; .float axhitme; - +.float duck; .float show_hostile; // set to time+0.2 whenever a client fires a // weapon or takes damage. Used to alert // monsters that otherwise would let the player go @@ -586,8 +616,8 @@ float AS_MISSILE = 4; .string deathtype; // keeps track of how the player died float POS_STAND = 0; -float POS_DUCK = 0; -float POS_PRONE = 0; +float POS_DUCK = 1; +float POS_PRONE = 2; float blue_gadget; float red_gadget; @@ -595,12 +625,19 @@ float blue_weapon; float red_weapon; float blue_armor; float red_armor; +float intermission_running; .float ghost; .float ghostcnt; .float dtime; .float active; .float class; +.float tclass; +.float xclass; +.float zone; +.float missionbrief; +.float silencer; +.float extender; //.float vote1; //.float vote2; //.float vote3; @@ -616,6 +653,8 @@ float red_armor; .float attack; .float position; .float recoil; +.float heat; +.float hold; .float critical; .float helmet; .float rtime; @@ -626,6 +665,9 @@ float red_armor; .float pcamera; .float pcamera2; .float equipment_slot; +.float has_radio; +.float score; + //.float select; //.float grenade_hold; .float grab; @@ -634,8 +676,14 @@ float red_armor; .float weight; .float max_weight; .float hostage; - +.float xregen; .float sneak; + +.float skill_combat; +.float skill_doctor; +.float skill_sneak; +.float skill_science; + .float rescued; .float scale; .float bandages; @@ -643,13 +691,14 @@ float red_armor; .float cycle1; .float cycle2; //.float c4; -.float trait; +.float perk1; +.float perk2; .float protect; -.float perk; .float equipment; .float buildtype; //.float ctimer; .float flash; +.float zoom; .float oldteam; .float dead; .float grenadetoggle; @@ -659,6 +708,8 @@ float red_armor; .float vote_on; .float vote_type; .float vote_num; +.float driftx; +.float drifty; .float vote1; .float vote2; .float vote3; @@ -668,18 +719,57 @@ float red_armor; .float vote7; .float vote8; .float spamdelay; - +.float speedmulti; +.float picking; +.float inplace; +.float alert; +.float searchtime; +.float timer; +.float safezone; +.float pickup; +.float accept; +.float grenslot; +.float connected; .string armornoise; .string ammotype1; .string ammotype2; -//.string deathsound; .string currentmenu; +.entity wielded; +.float walk; +.float steadyaim; +.float lastman; +.float popup; +.float flare; .entity friend; +.entity tumbler1; +.entity tumbler2; +.entity chest; .entity view2; +.entity heal_ent; .vector oldorg; .vector home; +.float location; +.float start_time; +.float map_obj;//hostages, assassinate, rescue, defuse, supply crates +.float map_ent1;//map creature type 1 +.float map_ent2;//map creature type 1 +.float map_ent3;//map creature type 1 +.float map_ent1_percent;//amount of creature type 1 +.float map_ent2_percent;//amount of creature type 2 +.float map_ent3_percent;//amount of creature type 3 + +.float skill_small_guns; +.float skill_big_guns; +.float skill_energy_weapons; +.float skill_melee; +.float skill_unarmed; +.float skill_thrown; + +.entity tag_entity; // entity this is attached to (call setattachment to set this) +.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) + // // object stuff // @@ -811,7 +901,7 @@ vector(entity e, float speed) aim = #44; // returns the shooting float(string s) cvar = #45; // return cvar.value void(string s) localcmd = #46; // put string into local que entity(entity e) nextent = #47; // for looping through all ents -// #48 was removed +void particle(vector org, vector dir, float color, float count) = #48; void() ChangeYaw = #49; // turn towards self.ideal_yaw // at self.yaw_speed // #50 was removed @@ -858,9 +948,23 @@ string(entity e, string key) infokey = #80; // get a key value (world = serv float(string s) stof = #81; // convert string to float void(vector where, float set) multicast = #82; // sends the temp message to a set // of clients, possibly in PVS or PHS +vector(vector org) getlight = #92; +void particle2(vector origin, vector vmin, vector vmax, float color, float effect, float count) = #215; +void particle3(vector mins, vector maxsminusmins, float colour, float effect, float count) = #216; +void particle4(vector center, float radius, float colour, float effect, float count) = #217; string(...) strcat = #115; +float(float stnum) getstati = #331; // (EXT_CSQC) +void(vector org) te_smallflash = #416; +void(vector org) te_gunshot = #418; +void(vector org) te_spike = #419; +void(vector org) te_superspike = #420; +void(vector org) te_tarexplosion = #421; +void(vector org) te_wizspike = #422; +void(vector org) te_knightspike = #423; +void(vector org) te_teleport = #424; +void(entity e, entity tagentity, string tagname) setattachment = #443; //============================================================================ diff --git a/quakec/fallout2/demon.qc b/quakec/fallout2/demon.qc index beefaf6d4..64796fc96 100644 --- a/quakec/fallout2/demon.qc +++ b/quakec/fallout2/demon.qc @@ -29,6 +29,8 @@ $frame death1 death2 death3 death4 death5 death6 death7 death8 death9 $frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8 $frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15 +$frame ram1 ram2 ram3 ram4 ram5 ram6 + //============================================================================ void(float side) Demon_Melee; @@ -149,6 +151,11 @@ void(entity attacker, float damage) demon1_pain = if (self.pain_finished > time) return; + if (self.health < (self.max_health*0.30)) + self.skin = 2; + else if (self.health < (self.max_health*0.60)) + self.skin = 1; + self.pain_finished = time + 10; sound (self, CHAN_VOICE, "demon/dpain1.wav", 1, ATTN_NORM); @@ -158,33 +165,114 @@ void(entity attacker, float damage) demon1_pain = demon1_pain1 (); }; -void() demon1_die1 =[ $death1, demon1_die2 ] { -sound (self, CHAN_VOICE, "demon/death1.wav", 1, ATTN_NORM);}; +void() demon1_die1 =[ $death1, demon1_die2 ] {}; void() demon1_die2 =[ $death2, demon1_die3 ] {}; -void() demon1_die3 =[ $death3, demon1_die4 ] {}; +void() demon1_die3 =[ $death3, demon1_die4 ] { +self.rtime = 1; +setsize (self, '-24 -24 -24', '24 24 -8'); +}; void() demon1_die4 =[ $death4, demon1_die5 ] {}; void() demon1_die5 =[ $death5, demon1_die6 ] {}; -void() demon1_die6 =[ $death6, demon1_die7 ] -{self.solid = SOLID_NOT;}; +void() demon1_die6 =[ $death6, demon1_die7 ] {}; void() demon1_die7 =[ $death7, demon1_die8 ] {}; void() demon1_die8 =[ $death8, demon1_die9 ] {}; void() demon1_die9 =[ $death9, demon1_die9 ] {}; -void() demon_die = +void() demon1_splat1 = { -// check for gib - if (self.health < -80) + self.rtime = 1; + setsize (self, '-24 -24 -24', '24 24 -8'); + if (self.frame < 8) + self.frame = self.frame + 1; + + self.think = demon1_splat1; + self.nextthink = time + 0.1; + + if (self.frame == 8) + self.think = SUB_Null; + +}; + + +void () demon_pain = +{ + local vector dir; + + if (self.rtime > 0) { - sound (self, CHAN_VOICE, "demon/death2.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_demon.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); + self.health = 180; return; } -// regular death - demon1_die1 (); + dir = normalize(self.origin - self.enemy.origin); + self.velocity = dir * 120; + + if (self.frame == 69) + { + self.health = 180; + self.frame = 42; + self.think = demon1_die1; + self.nextthink = time + 0.25; + } + else + { + self.health = 180; + ThrowGib ("progs/zom_gib.mdl", -40); + self.frame = 43; + self.think = demon1_die1; + self.nextthink = time + 0.25; + } + + self.attack = self.attack + 1; + + if (self.attack >= 8) + { + self.attack = 0; + self.health = 180; + ThrowGib ("progs/zom_gib.mdl", -40); + ThrowGib ("progs/zom_gib.mdl", -40); + ThrowGib ("progs/gib1.mdl", -40); + ThrowGib ("progs/h_demon.mdl", -40); + ThrowGib ("progs/zom_gib.mdl", -90); + ThrowGib ("progs/gib1.mdl", -90); + setmodel(self, "progs/x_demon.mdl"); + sound (self, CHAN_VOICE, "player/gib1.wav", 1, ATTN_NORM); + self.think = demon1_splat1; + self.nextthink = time + 0.1; + + } +}; + +void (vector stuff, vector ang) spawn_live_demon = +{ + local entity demon; + + demon = spawn (); + demon.origin = stuff; + demon.enemy = world; + demon.attack_finished = time + 10; + demon.solid = SOLID_SLIDEBOX; + demon.movetype = MOVETYPE_STEP; + demon.takedamage = DAMAGE_YES; + setmodel (demon, "progs/demon.mdl"); + setsize (demon, '-20 -20 -24', '20 20 64'); + demon.classname = "body"; + demon.netname = "dead"; + demon.health = 180; + demon.angles = ang; + demon.max_health = demon.health; + demon.th_pain = demon_pain; + demon.think = demon_pain; + demon.nextthink = time + 0.15; +}; + +void() demon_die = +{ + self.solid = SOLID_NOT; + + spawn_live_demon(self.origin, self.angles); + sound (self, CHAN_VOICE, "demon/death1.wav", 1, ATTN_NORM); + remove(self); }; @@ -195,8 +283,15 @@ void() Demon_MeleeAttack = void() monster_demon1 = { + if (self.zone == 0) + { + load_monster(); + return; + } + precache_model ("progs/demon.mdl"); precache_model ("progs/h_demon.mdl"); + precache_model ("progs/x_demon.mdl"); precache_sound ("demon/dhit2.wav"); precache_sound ("demon/djump.wav"); @@ -215,7 +310,7 @@ void() monster_demon1 = setmodel (self, "progs/demon.mdl"); setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); - self.health = 1200; + self.health = 600; self.team = 3; self.classname = "monster"; self.netname = "deathclaw"; @@ -226,6 +321,7 @@ void() monster_demon1 = self.th_melee = Demon_MeleeAttack; // one of two attacks self.th_missile = demon1_jump1; // jump attack self.th_pain = demon1_pain; + self.armornoise = "misc/thud.wav"; walkmonster_start(); }; @@ -280,7 +376,7 @@ float() CheckDemonJump = d = vlen(dist); - if (d < 100) + if (d < 200) return FALSE; if (d > 200) @@ -329,7 +425,7 @@ void(float side) Demon_Melee = return; sound (self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM); - ldmg = 10 + 5*random(); + ldmg = 5 + 20*random(); T_Damage (self.enemy, self, self, ldmg); makevectors (self.angles); @@ -348,13 +444,8 @@ void() Demon_JumpTouch = { if ( vlen(self.velocity) > 400 ) { - ldmg = 40 + 10*random(); - ldmg = ldmg / 4; + ldmg = 20 + 20*random(); T_Damage (other, self, self, ldmg); - T_Damage (other, self, self, ldmg); - T_Damage (other, self, self, ldmg); - T_Damage (other, self, self, ldmg); - } } diff --git a/quakec/fallout2/dog.qc b/quakec/fallout2/dog.qc index b0beb7cb7..ec7c1270a 100644 --- a/quakec/fallout2/dog.qc +++ b/quakec/fallout2/dog.qc @@ -59,19 +59,22 @@ local float ldmg; delta = self.enemy.origin - self.origin; - if (vlen(delta) > (100*self.scale)) + if (vlen(delta) > (100)) return; - ldmg = 8+random()*8; - - if (self.classname == "robofang") - ldmg = 4+random()*4; + ldmg = 5+random()*5; T_Damage (self.enemy, self, self, ldmg); - T_Damage (self.enemy, self, self, ldmg); + + if (random()*25 <= 5) + { + stuffcmd(self.enemy, "drop\n"); + self.enemy.attack_finished = time + 1; + self.enemy.position = 2; + } }; -void() Dog_JumpTouch = +void() Dog_JumpTouch = { local float ldmg; @@ -164,6 +167,36 @@ void() Sniff = local entity te; local float x; + te = findradius (self.origin, 500); + + if (te.classname == "player" && te.sneak > 0) + { + if (self.rtime < time) + { + sound (self, CHAN_VOICE, "dog/dsight.wav", 1, ATTN_NORM); + + self.rtime = time + 5; + if (te.class == 2 && random()*100 > 99) + { + spawn_excla(te, 1); + te.sneak = 0; + sprint(te, 2, "detected!\n"); + self.enemy = te; + FoundTarget(); + } + else if (te.class != 2 && random()*100 > 80) + { + spawn_excla(te, 1); + te.sneak = 0; + sprint(te, 2, "detected!\n"); + self.enemy = te; + FoundTarget(); + } + + } + return; + } + if (self.classname != "robofang") return; @@ -192,23 +225,23 @@ void() dog_run1 =[ $run1 , dog_run2 ] { if (random() < 0.2) sound (self, CHAN_VOICE, "dog/idle.wav", 1, ATTN_IDLE); -ai_run(16);}; -void() dog_run2 =[ $run2 , dog_run3 ] {ai_run(32);}; -void() dog_run3 =[ $run3 , dog_run4 ] {ai_run(32);}; +ai_run(20);}; +void() dog_run2 =[ $run2 , dog_run3 ] {ai_run(20);}; +void() dog_run3 =[ $run3 , dog_run4 ] {ai_run(20);}; void() dog_run4 =[ $run4 , dog_run5 ] {ai_run(20);}; -void() dog_run5 =[ $run5 , dog_run6 ] {ai_run(64);}; +void() dog_run5 =[ $run5 , dog_run6 ] {ai_run(20);}; void() dog_run6 =[ $run6 , dog_run7 ] { if (self.enemy == self.owner) self.enemy = self.enemy.enemy; ai_run(32);}; -void() dog_run7 =[ $run7 , dog_run8 ] {ai_run(16);}; -void() dog_run8 =[ $run8 , dog_run9 ] {ai_run(32);}; -void() dog_run9 =[ $run9 , dog_run10 ] {ai_run(32);}; +void() dog_run7 =[ $run7 , dog_run8 ] {ai_run(20);}; +void() dog_run8 =[ $run8 , dog_run9 ] {ai_run(20);}; +void() dog_run9 =[ $run9 , dog_run10 ] {ai_run(20);}; void() dog_run10 =[ $run10 , dog_run11 ] {ai_run(20);}; -void() dog_run11 =[ $run11 , dog_run12 ] {ai_run(64);}; -void() dog_run12 =[ $run12 , dog_run1 ] {ai_run(32);}; +void() dog_run11 =[ $run11 , dog_run12 ] {ai_run(20);}; +void() dog_run12 =[ $run12 , dog_run1 ] {ai_run(20);}; void() dog_atta1 =[ $attack1, dog_atta2 ] { @@ -272,69 +305,76 @@ void() dog_pain = { sound (self, CHAN_VOICE, "dog/dpain1.wav", 1, ATTN_NORM); - if (random() > 0.5) + if (random() < 0.1) dog_pain1 (); - else + else if (random() < 0.1) dog_painb1 (); }; void() dog_die1 =[ $death1, dog_die2 ] {}; void() dog_die2 =[ $death2, dog_die3 ] {}; -void() dog_die3 =[ $death3, dog_die4 ] {}; +void() dog_die3 =[ $death3, dog_die4 ] { +self.rtime = 1; +}; void() dog_die4 =[ $death4, dog_die5 ] {}; void() dog_die5 =[ $death5, dog_die6 ] {}; void() dog_die6 =[ $death6, dog_die7 ] {}; void() dog_die7 =[ $death7, dog_die8 ] {}; -void() dog_die8 =[ $death8, dog_die9 ] { -self.solid = SOLID_NOT; +void() dog_die8 =[ $death8, dog_die9 ] {}; +void() dog_die9 =[ $death9, dog_die9 ] { +setsize (self, '-10 -10 -24', '10 10 -16'); }; -void() dog_die9 =[ $death9, dog_die9 ] {}; void() dog_dieb1 =[ $deathb1, dog_dieb2 ] {}; void() dog_dieb2 =[ $deathb2, dog_dieb3 ] {}; -void() dog_dieb3 =[ $deathb3, dog_dieb4 ] {}; +void() dog_dieb3 =[ $deathb3, dog_dieb4 ] { +self.rtime = 1; +}; void() dog_dieb4 =[ $deathb4, dog_dieb5 ] {}; void() dog_dieb5 =[ $deathb5, dog_dieb6 ] {}; void() dog_dieb6 =[ $deathb6, dog_dieb7 ] {}; void() dog_dieb7 =[ $deathb7, dog_dieb8 ] {}; void() dog_dieb8 =[ $deathb8, dog_dieb9 ] { -self.solid = SOLID_NOT; +setsize (self, '-10 -10 -24', '10 10 -16'); }; void() dog_dieb9 =[ $deathb9, dog_dieb9 ] {}; void () woof_pain = { + if (self.rtime > 0) + { + self.health = 180; + return; + } + if (self.frame == 26) { - self.frame = 27; self.health = 180; + self.frame = 27; self.think = dog_die1; self.nextthink = time + 0.12; } else { + self.health = 180; ThrowGib2 ("progs/zom_gib.mdl", -35); self.frame = 26; - self.health = 180; - self.think = dog_dieb1; + self.think = dog_die1; self.nextthink = time + 0.12; } self.attack = self.attack + 1; - if (self.attack >= 4) + if (self.attack == 8) { - if (random()*4 <= 2) - sound (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM); - else - sound (self, CHAN_VOICE, "dog/death2.wav", 1, ATTN_NORM); - - ThrowHead ("progs/h_dog.mdl", -30); - ThrowGib ("progs/gib1.mdl", -30); - ThrowGib ("progs/gib2.mdl", -30); - ThrowGib ("progs/gib3.mdl", -30); - ThrowGib2 ("progs/zom_gib.mdl", -45); - ThrowGib2 ("progs/zom_gib.mdl", -45); + sound (self, CHAN_VOICE, "dog/death2.wav", 1, ATTN_NORM); + self.think = dog_dieb1; + self.nextthink = time + 0.01; + } + if (self.attack >= 16) + { + self.think = dog_dieb1; + self.nextthink = time + 0.01; } }; @@ -350,13 +390,14 @@ void (vector stuff) spawn_live_dog = dog.movetype = MOVETYPE_STEP; dog.takedamage = DAMAGE_YES; setmodel (dog, "progs/dog.mdl"); - setsize (dog, VEC_HULL_MIN, '16 16 40'); + setsize (dog, '-10 -10 -24', '10 10 12'); dog.classname = "body"; dog.netname = "dead"; dog.health = 180; dog.max_health = dog.health; dog.th_pain = woof_pain; dog.think = woof_pain; + dog.th_die = corpse_gib; dog.nextthink = time + 0.05; }; @@ -365,19 +406,10 @@ void () dog_die = if (self.enemy.classname == "player") self.enemy.frags = self.enemy.frags + 1; - if (self.health < -35) - { - self.solid = SOLID_NOT; - sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - dog_die1 (); - } - else - { - sound (self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM); - self.solid = SOLID_NOT; - spawn_live_dog(self.origin); - remove(self); - } + + sound (self, CHAN_VOICE, "dog/ddeath.wav", 1, ATTN_NORM); + spawn_live_dog(self.origin); + remove(self); }; //============================================================================ @@ -453,8 +485,81 @@ float() DogCheckAttack = //=========================================================================== +void (vector jojo) spawn_radbeast = +{ + local entity dog; + local entity te; + + + dog = spawn (); + self = dog; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/dog.mdl"); + setsize (self, '-10 -10 -24', '10 10 12'); + self.health = 90; + self.takedamage = DAMAGE_YES; + self.netname = "rad-beast"; + self.th_stand = dog_stand1; + self.th_walk = dog_walk1; + self.th_run = dog_run1; + self.th_pain = dog_pain; + self.th_die = dog_die; + self.th_melee = dog_atta1; + self.angles_y = random()*360; + + self.origin = jojo + '0 64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + + if (!walkmove(0, 0)) + { + self.origin = jojo + '0 -64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + self.origin = jojo + '64 0 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + self.origin = jojo + '-64 0 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + remove(self); + return; + } + } + } + } + + te = findradius (self.origin, 30); + while (te) + { + if (te.classname == "player" || te.classname == "monster" && te.health > 0) + { + remove(self); + return; + } + + + te = te.chain; + } + + self.classname = "monster"; + walkmonster_start_go (); +}; + void() monster_dog = { + if (self.zone == 0) + { + load_monster(); + return; + } precache_model ("progs/h_dog.mdl"); precache_model ("progs/dog.mdl"); @@ -470,68 +575,27 @@ void() monster_dog = setmodel (self, "progs/dog.mdl"); - setsize (self, '-24 -24 -24', '24 24 24'); - self.health = 75; - self.scale = 1; - self.team = 3; + setsize (self, '-10 -10 -24', '10 10 12'); + self.health = 90; self.takedamage = DAMAGE_YES; self.classname = "monster"; - self.netname = "radwolf"; + self.netname = "rad-beast"; self.th_stand = dog_stand1; self.th_walk = dog_walk1; self.th_run = dog_run1; self.th_pain = dog_pain; self.th_die = dog_die; self.th_melee = dog_atta1; + self.angles_y = random()*360; + +// if (random()<0.75) +// spawn_radbeast(self.origin); + + if (random()<0.25 && world.map_obj == OBJ_HOSTAGE) + spawn_civilian(self.origin); walkmonster_start(); }; -void (vector org) spawn_dog = -{ - local entity dog, oself; - local entity te; - makevectors (self.v_angle); - org = ((org + (v_forward * 96)) + (v_up * 72)); - self.impulse = 0; - te = findradius (org, 80); - while (te) - { - if (te.classname == "player" && te.health > 0) - return; - - te = te.chain; - } - - dog = spawn(); - oself = self; - self = dog; - self.scale = 1; - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - - setmodel (self, "progs/dog.mdl"); - setorigin(self, org); - setsize (self, '-24 -24 -24', '24 24 24'); - self.health = 150; - self.helmet = 1; - self.armortype = 0.3; - self.takedamage = DAMAGE_YES; - self.classname = "robofang"; - self.netname = "robofang"; - self.th_stand = dog_stand1; - self.th_walk = dog_walk1; - self.th_run = dog_run1; - self.th_pain = dog_pain; - self.th_die = station_die; - self.th_melee = dog_atta1; - self.think = self.th_walk; - self.owner = oself; - self.track = oself; - self.nextthink = time + 0.1; - walkmonster_start(); - - self = oself; -}; diff --git a/quakec/fallout2/doors.qc b/quakec/fallout2/doors.qc index 8b0332739..5c1efdedf 100644 --- a/quakec/fallout2/doors.qc +++ b/quakec/fallout2/doors.qc @@ -165,21 +165,23 @@ void () OpenDoorBeep = if (r != RANGE_MELEE) { - self.think = OpenDoorBeep; - self.nextthink = time + 0.5; + self.owner.owner.rtime = 0; + remove(self); return; } - if (random()*3<1) - sound (self, CHAN_BODY, "misc/build1.wav", 1, ATTN_NORM); - else if (random()*3<2) - sound (self, CHAN_BODY, "misc/build2.wav", 1, ATTN_NORM); + if (random()*3<1.5) + sound (self, CHAN_BODY, "items/lockpick1.wav", 1, ATTN_NORM); else - sound (self, CHAN_BODY, "misc/build3.wav", 1, ATTN_NORM); + sound (self, CHAN_BODY, "items/lockpick2.wav", 1, ATTN_NORM); self.think = OpenDoorBeep; self.nextthink = time + 0.5; - self.owner.owner.rtime = self.owner.owner.rtime + 1; + if (ToIID(other.islot4) == IID_EQUIP_TOOLKIT) + self.owner.owner.rtime = self.owner.owner.rtime + 3; + else + self.owner.owner.rtime = self.owner.owner.rtime + 1; + self.frame = floor ((self.owner.owner.rtime / 12) * 7); if (self.owner.owner.rtime >= 12) @@ -239,12 +241,48 @@ void () door_touch = { if (self.size_y <= 128 && self.size_x <= 128) { - if (other.class == 2 || other.class == 4) //assassins as well as scientists - { //can open doors for more freedom + + if (other.perk1 == 4 || other.perk2 == 4) + { + self.owner.rtime = 12; + sound (other, CHAN_VOICE, "player/berserk.wav", 1, ATTN_NORM); + door_use (); + loud_noise(200); + } + else if (self.owner.items == IT_KEY1) + { SpawnOpenDoor(self, other); return; } - + else if (self.owner.items == IT_KEY2) + { + if (other.class == 1) + { + sprint(other, 2, "the lock on this door is too complex for you.\n"); + sound (other, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); + return; + } + if (other.class == 2) + { + sprint(other, 2, "picking...\n"); + other.attack_finished = time + 7; + other.rtime = time + 7.5; + SpawnOpenDoor(self, other); + return; + } + if (other.class == 3) + { + sprint(other, 2, "the lock on this door is too complex for you.\n"); + sound (other, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); + return; + } + if (other.class == 4) + { + sprint(other, 2, "picking...\n"); + SpawnOpenDoor(self, other); + return; + } + } if (self.owner.items == IT_KEY1) sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); @@ -483,23 +521,11 @@ void () func_door = self.blocked = door_blocked; self.use = door_use; - if (coop == 0) - { - if ((self.spawnflags & DOOR_SILVER_KEY)) - self.items = IT_KEY1; - if ((self.spawnflags & DOOR_GOLD_KEY)) - self.items = IT_KEY2; - } - - if (coop == 1) - { - r = random()*10; - - if (r <= 7) - self.items = IT_KEY1; - else - self.items = IT_KEY2; - } + if (random()<0.20) + self.items = IT_KEY1; //easy-to-pick lock + else if (random()<0.60) + self.items = IT_KEY2; //hard-to-pick lock + if (!self.speed) { self.speed = 100; diff --git a/quakec/fallout2/enforcer.qc b/quakec/fallout2/enforcer.qc index 8f347d842..d1f8239da 100644 --- a/quakec/fallout2/enforcer.qc +++ b/quakec/fallout2/enforcer.qc @@ -43,6 +43,7 @@ $frame paind17 paind18 paind19 void () enforcer_assault_rifle; void () enf_reload1; +void () Footstep; void() enforcer_fire = { @@ -69,12 +70,37 @@ void (float tmp, float dam) enforcer_single = { sound (self, CHAN_WEAPON, "weapons/reload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); enf_reload1(); - self.mag1 = self.maxmag1; + self.mag1 = 30; return; } self.mag1 = self.mag1 - 1; + if (self.weapon == 3) + sound (self, CHAN_WEAPON, "weapons/smg_s.wav", 1, ATTN_NORM); + else if (self.weapon == 4) + sound (self, CHAN_WEAPON, "weapons/ak112.wav", 1, ATTN_NORM); + else if (self.weapon == 5) + sound (self, CHAN_WEAPON, "ogre/ak47.wav", 1, ATTN_NORM); + else if (self.weapon == 6 && random()<0.5) + sound (self, CHAN_WEAPON, "weapons/moonlight-1.wav", 1, ATTN_NORM); + else if (self.weapon == 6) + sound (self, CHAN_WEAPON, "weapons/moonlight-2.wav", 1, ATTN_NORM); + + if (self.weapon == 3) + dam = 12; + else if (self.weapon == 4) + dam = 16; + else if (self.weapon == 5) + dam = 18; + else if (self.weapon == 6) + dam = 16; + + self.attack = self.attack + 1; + + if (self.attack > 5) + self.attack = 0; + makevectors (self.angles); src = self.origin + v_forward*10; @@ -87,7 +113,7 @@ void (float tmp, float dam) enforcer_single = direction = dir; - traceline (src, src + direction*4000 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); + traceline (src, src + direction*4000 + v_right*crandom()*tmp*2 + v_up*crandom()*tmp*2, FALSE, self); if (trace_fraction == PLAT_LOW_TRIGGER) return; @@ -95,19 +121,13 @@ void (float tmp, float dam) enforcer_single = if (trace_ent.takedamage) { SpawnBlood (org, PLAT_LOW_TRIGGER); - dam = dam + random()*dam; + dam = dam + random()*dam - 3; dam = dam * (1 - (trace_fraction)); T_Damage (trace_ent, self, self, dam); } else - { - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, trace_endpos_x); - WriteCoord (MSG_MULTICAST, trace_endpos_y); - WriteCoord (MSG_MULTICAST, trace_endpos_z); - multicast (trace_endpos, MULTICAST_PVS); - } + bullet_hole (trace_endpos); + }; //============================================================================ @@ -126,7 +146,9 @@ if (random() < 0.2) ai_walk(2);}; void() enf_walk2 =[ $walk2 , enf_walk3 ] {ai_walk(4);}; void() enf_walk3 =[ $walk3 , enf_walk4 ] {ai_walk(4);}; -void() enf_walk4 =[ $walk4 , enf_walk5 ] {ai_walk(3);}; +void() enf_walk4 =[ $walk4 , enf_walk5 ] {ai_walk(3); +Footstep(); +}; void() enf_walk5 =[ $walk5 , enf_walk6 ] {ai_walk(1);}; void() enf_walk6 =[ $walk6 , enf_walk7 ] {ai_walk(2);}; void() enf_walk7 =[ $walk7 , enf_walk8 ] {ai_walk(2);}; @@ -134,17 +156,23 @@ void() enf_walk8 =[ $walk8 , enf_walk9 ] {ai_walk(1);}; void() enf_walk9 =[ $walk9 , enf_walk10 ] {ai_walk(2);}; void() enf_walk10 =[ $walk10, enf_walk11 ] {ai_walk(4);}; void() enf_walk11 =[ $walk11, enf_walk12 ] {ai_walk(4);}; -void() enf_walk12 =[ $walk12, enf_walk13 ] {ai_walk(1);}; +void() enf_walk12 =[ $walk12, enf_walk13 ] {ai_walk(1); +Footstep(); +}; void() enf_walk13 =[ $walk13, enf_walk14 ] {ai_walk(2);}; void() enf_walk14 =[ $walk14, enf_walk15 ] {ai_walk(3);}; void() enf_walk15 =[ $walk15, enf_walk16 ] {ai_walk(4);}; void() enf_walk16 =[ $walk16, enf_walk1 ] {ai_walk(2);}; void() enf_run1 =[ $run1 , enf_run2 ] {ai_run(18);}; -void() enf_run2 =[ $run2 , enf_run3 ] {ai_run(14);}; +void() enf_run2 =[ $run2 , enf_run3 ] {ai_run(14); +Footstep(); +}; void() enf_run3 =[ $run3 , enf_run4 ] {ai_run(7);}; void() enf_run4 =[ $run4 , enf_run5 ] {ai_run(12);}; -void() enf_run5 =[ $run5 , enf_run6 ] {ai_run(14);}; +void() enf_run5 =[ $run5 , enf_run6 ] {ai_run(14); +Footstep(); +}; void() enf_run6 =[ $run6 , enf_run7 ] {ai_run(14);}; void() enf_run7 =[ $run7 , enf_run8 ] {ai_run(7);}; void() enf_run8 =[ $run8 , enf_run1 ] {ai_run(11);}; @@ -161,17 +189,19 @@ void() enf_atk8 =[ $attack3, enf_atk9 ] {ai_face();}; void() enf_atk9 =[ $attack2, enf_atk10 ] {ai_face();}; void() enf_atk10 =[ $attack1, enf_run1 ] {ai_face();}; -void() enf_burst1 =[ $attack5, enf_burst2 ] {enforcer_single(400, 16);}; -void() enf_burst2 =[ $attack6, enf_burst3 ] {enforcer_single(400, 16);ai_face();}; -void() enf_burst3 =[ $attack5, enf_burst4 ] {enforcer_single(400, 16);}; -void() enf_burst4 =[ $attack6, enf_burst5 ] {enforcer_single(450, 16);ai_face();}; -void() enf_burst5 =[ $attack5, enf_burst6 ] {enforcer_single(450, 16);}; -void() enf_burst6 =[ $attack6, enf_burst7 ] {enforcer_single(500, 16);ai_face();}; -void() enf_burst7 =[ $attack5, enf_burst8 ] {enforcer_single(550, 16);}; -void() enf_burst8 =[ $attack4, enf_burst9 ] {enforcer_single(600, 16);ai_face();}; +void() enf_burst1 =[ $attack5, enf_burst2 ] {enforcer_single(500, 13);}; +void() enf_burst2 =[ $attack6, enf_burst3 ] {enforcer_single(500, 13);ai_face();}; +void() enf_burst3 =[ $attack5, enf_burst4 ] {enforcer_single(50, 13);}; +void() enf_burst4 =[ $attack6, enf_burst5 ] {enforcer_single(550, 13);ai_face();}; +void() enf_burst5 =[ $attack5, enf_burst6 ] {enforcer_single(550, 13);}; +void() enf_burst6 =[ $attack6, enf_burst7 ] {enforcer_single(500, 13);ai_face();}; +void() enf_burst7 =[ $attack5, enf_burst8 ] {enforcer_single(550, 13);}; +void() enf_burst8 =[ $attack4, enf_burst9 ] {enforcer_single(700, 13);ai_face();}; void() enf_burst9 =[ $attack3, enf_burst10 ] {ai_face();}; void() enf_burst10 =[ $attack2, enf_run1 ] {ai_face();}; +void() enf_burst1a =[ $attack5, enf_burst2a ] {enforcer_single(300, 17);}; +void() enf_burst2a =[ $attack6, enf_burst1a ] {enforcer_single(300, 17);}; void() enf_reload1 =[ $attack10, enf_reload2 ] {}; @@ -266,26 +296,25 @@ void(entity attacker, float damage) enf_pain = void() enf_die1 =[ $death1, enf_die2 ] {}; void() enf_die2 =[ $death2, enf_die3 ] {}; -void() enf_die3 =[ $death3, enf_die4 ] -{self.solid = SOLID_NOT;self.ammo_cells = 5;DropBackpack();}; +void() enf_die3 =[ $death3, enf_die4 ] {}; void() enf_die4 =[ $death4, enf_die5 ] {ai_forward(14);}; -void() enf_die5 =[ $death5, enf_die6 ] {ai_forward(2);}; +void() enf_die5 =[ $death5, enf_die6 ] {ai_forward(6);}; void() enf_die6 =[ $death6, enf_die7 ] {}; void() enf_die7 =[ $death7, enf_die8 ] {}; void() enf_die8 =[ $death8, enf_die9 ] {}; -void() enf_die9 =[ $death9, enf_die10 ] {ai_forward(3);}; -void() enf_die10 =[ $death10, enf_die11 ] {ai_forward(5);}; -void() enf_die11 =[ $death11, enf_die12 ] {ai_forward(5);}; -void() enf_die12 =[ $death12, enf_die13 ] {ai_forward(5);}; +void() enf_die9 =[ $death9, enf_die10 ] {ai_forward(6);}; +void() enf_die10 =[ $death10, enf_die11 ] {ai_forward(6);}; +void() enf_die11 =[ $death11, enf_die12 ] {ai_forward(6);}; +void() enf_die12 =[ $death12, enf_die13 ] {ai_forward(6);}; void() enf_die13 =[ $death13, enf_die14 ] {}; -void() enf_die14 =[ $death14, enf_die14 ] {}; - -void() enf_fdie1 =[ $fdeath1, enf_fdie2 ] { - +void() enf_die14 =[ $death14, enf_die14 ] { +setsize (self, '-12 -12 -24', '12 12 -16'); +self.rtime = 1; }; + +void() enf_fdie1 =[ $fdeath1, enf_fdie2 ] {}; void() enf_fdie2 =[ $fdeath2, enf_fdie3 ] {}; -void() enf_fdie3 =[ $fdeath3, enf_fdie4 ] -{self.solid = SOLID_NOT;self.ammo_cells = 5;DropBackpack();}; +void() enf_fdie3 =[ $fdeath3, enf_fdie4 ] {}; void() enf_fdie4 =[ $fdeath4, enf_fdie5 ] {}; void() enf_fdie5 =[ $fdeath5, enf_fdie6 ] {}; void() enf_fdie6 =[ $fdeath6, enf_fdie7 ] {}; @@ -293,56 +322,133 @@ void() enf_fdie7 =[ $fdeath7, enf_fdie8 ] {}; void() enf_fdie8 =[ $fdeath8, enf_fdie9 ] {}; void() enf_fdie9 =[ $fdeath9, enf_fdie10 ] {}; void() enf_fdie10 =[ $fdeath10, enf_fdie11 ] {}; -void() enf_fdie11 =[ $fdeath11, enf_fdie11 ] {}; +void() enf_fdie11 =[ $fdeath11, enf_fdie11 ] { +setsize (self, '-12 -12 -24', '12 12 -16'); +self.rtime = 1; +}; -void() enf_die = +void () enforcer_pain = { -// check for gib - if (self.health < -35) + local vector dir; + + if (self.rtime > 0) { - sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - if (random() > 0.5) - enf_die1 (); - else - enf_fdie1 (); + self.health = 240; return; } -// regular death - sound (self, CHAN_VOICE, "enforcer/death1.wav", 1, ATTN_NORM); - if (random() > 0.5) - enf_die1 (); + dir = normalize(self.origin - self.enemy.origin); + self.velocity = dir * 80; + + if (self.frame == 47) + { + self.frame = 48; + self.think = enf_die1; + self.nextthink = time + 0.2; + } else - enf_fdie1 (); + { + ThrowGib ("progs/zom_gib.mdl", -40); + self.frame = 47; + self.think = enf_fdie1; + self.nextthink = time + 0.2; + } + + self.attack = self.attack + 1; + + if (self.attack == 8) + { + if (random()*4 <= 2) + sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NORM); + } + if (self.attack >= 16) + { + self.solid = SOLID_NOT; + + enf_die1(); + ThrowGib ("progs/zom_gib.mdl", -35); + ThrowGib ("progs/zom_gib.mdl", -35); + ThrowGib ("progs/gib1.mdl", -35); + } +}; + +void (vector stuff, vector ang) spawn_live_enforcer = +{ + local entity grunt; + + grunt = spawn (); + grunt.origin = stuff; + grunt.enemy = self.enemy; + grunt.attack_finished = time + 10; + grunt.solid = SOLID_SLIDEBOX; + grunt.movetype = MOVETYPE_STEP; + grunt.takedamage = DAMAGE_YES; + setmodel (grunt, "progs/enforcer.mdl"); + setsize (grunt, '-12 -12 -24', '12 12 32'); + grunt.classname = "body"; + grunt.netname = "dead"; + grunt.health = 240; + grunt.angles = ang; + grunt.max_health = grunt.health; + grunt.th_pain = enforcer_pain; + grunt.think = enforcer_pain; + grunt.th_die = corpse_gib; + grunt.nextthink = time + 0.05; +}; + +void() enf_die = +{ + if (random()<0.75) + DropMoney(); + if (random()<0.50) + DropMoney(); + if (random()<0.25) + DropMoney(); + + + if (self.weapon == 3) + { + DropFromChest(self, IID_WP_MP7_S, self.mag1); + DropFromChest(self, IID_AM_5MMHIGHVEL, 30+random()*30); + } + else if (self.weapon == 4) + { + DropFromChest(self, IID_WP_AK112, self.mag1); + DropFromChest(self, IID_AM_5MMHIGHVEL, 24+random()*24); + } + else if (self.weapon == 5) + { + DropFromChest(self, IID_WP_AK74, self.mag1); + DropFromChest(self, IID_AM_WARSAW, 30+random()*30); + } + else if (self.weapon == 6) + { + DropFromChest(self, IID_WP_MOONLIGHT, self.mag1); + DropFromChest(self, IID_AM_556MM, 30+random()*30); + } + + self.solid = SOLID_NOT; + spawn_live_enforcer(self.origin, self.angles); + remove(self); }; void () enforcer_assault_rifle = { local float r; - r = range (self.enemy); - - if (r == RANGE_FAR || r == RANGE_MID)//single shot at range - { - if (self.weapon == 5) - sound (self, CHAN_WEAPON, "weapons/ak112.wav", PLAT_LOW_TRIGGER, ATTN_NORM); - if (self.weapon == 6) - sound (self, CHAN_WEAPON, "weapons/ak47.wav", PLAT_LOW_TRIGGER, ATTN_NORM); - enforcer_single(200, 18); - } - if (r == RANGE_NEAR || r == RANGE_MELEE)//open up when close - { - if (self.weapon == 5) - sound (self, CHAN_WEAPON, "weapons/auto.wav", PLAT_LOW_TRIGGER, ATTN_NORM); - if (self.weapon == 6) - sound (self, CHAN_WEAPON, "weapons/auto2.wav", PLAT_LOW_TRIGGER, ATTN_NORM); - enf_burst1(); - } + enf_burst1a(); }; void() monster_enforcer = { + if (self.zone == 0) + { + load_monster(); + return; + } precache_model2 ("progs/enforcer.mdl"); precache_model2 ("progs/h_mega.mdl"); precache_model2 ("progs/laser.mdl"); @@ -378,7 +484,18 @@ void() monster_enforcer = self.th_die = enf_die; self.th_missile = enf_atk1; - self.weapon = 6; + if (random()<0.9) + self.weapon = 5; + else if (random()<0.1) + self.weapon = 3; + else if (random()<0.1) + self.weapon = 4; + + else if (random()<0.1) + self.weapon = 6; + else + self.weapon = 5; + self.th_missile = enf_atk1; self.mag1 = 24; self.maxmag1 = self.mag1; diff --git a/quakec/fallout2/fight.qc b/quakec/fallout2/fight.qc index 6deda3937..c50723796 100644 --- a/quakec/fallout2/fight.qc +++ b/quakec/fallout2/fight.qc @@ -15,6 +15,7 @@ float() DemonCheckAttack; float(float v) anglemod; void(vector dest) ChooseTurn; +void(entity targ, entity inflictor, entity attacker, float damage) X_Damage; void() ai_face; @@ -60,9 +61,9 @@ float() CheckAttack = traceline (spot1, spot2, FALSE, self); - if (trace_ent != targ) - return FALSE; // don't have a clear shot - + //if (trace_ent != targ) + // return FALSE; // don't have a clear shot + if (trace_inopen && trace_inwater) return FALSE; // sight line crossed contents @@ -85,9 +86,6 @@ float() CheckAttack = if (time < self.attack_finished) return FALSE; - if (enemy_range == RANGE_FAR) - return FALSE; - if (enemy_range == RANGE_MELEE) { chance = 0.9; @@ -132,6 +130,12 @@ void() ai_face = { self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); ChangeYaw (); + + if (self.enemy.sneak > 0)//invisible, estimate position + { + self.angles_y += random()*50; + self.angles_y -= random()*50; + } }; /* @@ -172,7 +176,9 @@ void() ai_charge_side = /* ============= ai_melee - +Monster melee weapons will have armor-piercing properties +to make them feared, with the exception of the dogs, which +will have great damage that does not go through armor. ============= */ void() ai_melee = @@ -194,7 +200,7 @@ void() ai_melee = void() ai_melee_side = -{ +{ local vector delta; local float ldmg; diff --git a/quakec/fallout2/fish.qc b/quakec/fallout2/fish.qc index 3b7cfb2ae..4709ef844 100644 --- a/quakec/fallout2/fish.qc +++ b/quakec/fallout2/fish.qc @@ -58,18 +58,18 @@ void() f_walk16 =[ $swim16, f_walk17 ] {ai_walk(8);}; void() f_walk17 =[ $swim17, f_walk18 ] {ai_walk(8);}; void() f_walk18 =[ $swim18, f_walk1 ] {ai_walk(8);}; -void() f_run1 =[ $swim1, f_run2 ] {ai_run(12); +void() f_run1 =[ $swim1, f_run2 ] {ai_run(24); if (random() < 0.5) sound (self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_NORM); }; -void() f_run2 =[ $swim3, f_run3 ] {ai_run(12);}; -void() f_run3 =[ $swim5, f_run4 ] {ai_run(12);}; -void() f_run4 =[ $swim7, f_run5 ] {ai_run(12);}; -void() f_run5 =[ $swim9, f_run6 ] {ai_run(12);}; -void() f_run6 =[ $swim11, f_run7 ] {ai_run(12);}; -void() f_run7 =[ $swim13, f_run8 ] {ai_run(12);}; -void() f_run8 =[ $swim15, f_run9 ] {ai_run(12);}; -void() f_run9 =[ $swim17, f_run1 ] {ai_run(12);}; +void() f_run2 =[ $swim3, f_run3 ] {ai_run(24);}; +void() f_run3 =[ $swim5, f_run4 ] {ai_run(24);}; +void() f_run4 =[ $swim7, f_run5 ] {ai_run(24);}; +void() f_run5 =[ $swim9, f_run6 ] {ai_run(24);}; +void() f_run6 =[ $swim11, f_run7 ] {ai_run(24);}; +void() f_run7 =[ $swim13, f_run8 ] {ai_run(24);}; +void() f_run8 =[ $swim15, f_run9 ] {ai_run(24);}; +void() f_run9 =[ $swim17, f_run1 ] {ai_run(24);}; void() fish_melee = { @@ -165,9 +165,8 @@ void() monster_fish = setsize (self, '-16 -16 -24', '16 16 24'); self.health = 50; self.helmet = 1; - self.corporation = 3; self.classname = "monster"; - self.netname = "pirannah"; + self.netname = "death remora"; self.th_stand = f_stand1; self.th_walk = f_walk1; diff --git a/quakec/fallout2/hknight.qc b/quakec/fallout2/hknight.qc index 50adcdba5..1623526b2 100644 --- a/quakec/fallout2/hknight.qc +++ b/quakec/fallout2/hknight.qc @@ -396,7 +396,11 @@ void() hknight_melee = void() monster_hell_knight = { - + if (self.zone == 0) + { + load_monster(); + return; + } precache_model2 ("progs/hknight.mdl"); precache_model2 ("progs/k_spike.mdl"); precache_model2 ("progs/h_hellkn.mdl"); @@ -420,13 +424,12 @@ void() monster_hell_knight = setmodel (self, "progs/hknight.mdl"); setsize (self, '-16 -16 -24', '16 16 40'); - self.health = 125; - self.islot3 = 10; //hell-knight armor - self.armortype = 0.30; + self.health = 200; + self.islot3 = SlotVal(IID_ARM_FORCE, 1); self.helmet = 1; self.team = 3; self.classname = "monster"; - self.netname = "reaver"; + self.netname = "reaver overlord"; self.th_stand = hknight_stand1; self.th_walk = hknight_walk1; self.th_run = hknight_run1; diff --git a/quakec/fallout2/hos.qc b/quakec/fallout2/hos.qc index 4b7414ac7..b61197b9f 100644 --- a/quakec/fallout2/hos.qc +++ b/quakec/fallout2/hos.qc @@ -197,7 +197,6 @@ void (float xx) hos_forward = rng = range (te); if (((rng <= RANGE_NEAR) && (self.rescued == MULTICAST_ALL))) { - sound (self, CHAN_BODY, "misc/rescued.wav", PLAT_LOW_TRIGGER, ATTN_NONE); te = find (world, classname, "hostage"); while (te) { @@ -217,3 +216,87 @@ void (float xx) hos_forward = } self.oldorg = self.origin; }; + +void (vector jojo) spawn_civilian = +{ + local entity civ, te, oself; + local entity x; + local float stop; + + x = findradius (jojo, 300); + + while (x) + { + if (x.classname == "trigger_teleport") + stop = 1; + + x = x.chain; + } + + if (stop == 1) + { + remove(self); + return; + } + + civ = spawn (); + oself = self; + self = civ; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.takedamage = DAMAGE_AIM; + setmodel (self, "progs/hosfem.mdl"); + setsize (self, VEC_HULL_MIN, '16 16 32'); + self.health = 80; + self.netname = "civilian"; + self.classname = "rhostage"; + self.max_health = self.health; + hos_stand1 (); + self.th_die = hostage_die; + self.th_pain = hostage_pain; + self.rescued = 0; + self.angles_y = random()*360; + + self.origin = jojo + '0 64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + + if (!walkmove(0, 0)) + { + self.origin = jojo + '0 -64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + self.origin = jojo + '64 0 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + self.origin = jojo + '-64 0 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + remove(self); + return; + } + } + } + } + + te = findradius (self.origin, 30); + while (te) + { + if (te.classname == "player" || te.classname == "monster" && te.health > 0) + { + remove(self); + return; + } + + + te = te.chain; + } + + self = oself; +}; \ No newline at end of file diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 2aff70d50..e1c6f6455 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -1,41 +1,62 @@ float IID_NONE = 0; -#define IsMelee(iid) (iid == IID_NONE || (iid >= IID_WP_TOOLKIT && iid <= IID_WP_POWERAXE)) -#define IsGrenade(iid) (iid >= IID_GREN_FRAG && iid <= IID_GREN_FLASH) -#define IsRanged(iid) (iid >= IID_WP_USP && iid <= IID_WP_ROCKETLAUNCHER) +#define IsMelee(iid) (iid == IID_NONE || (iid >= IID_WP_WRENCH && iid <= IID_WP_POWERAXE)) +#define IsGrenade(iid) (iid >= IID_GREN_FRAG && iid <= IID_GREN_STUN) +#define IsRanged(iid) (iid >= IID_WP_GLOCK && iid <= IID_WP_ACR) //weapons with ammo, things with a toggle state #define NotStackable(iid) (IsRanged(iid)) //the ammoless weapons -float IID_WP_TOOLKIT = 400; -float IID_WP_KNIFE = 401; -float IID_WP_AXE = 402; -float IID_WP_VIBROBLADE = 403; -float IID_WP_POWERAXE = 404; +float IID_WP_WRENCH = 399; +float IID_WP_KNIFE = 400; +float IID_WP_AXE = 401; +float IID_WP_SPEAR = 402; +float IID_WP_POWERAXE = 403; //the ammoed weapons +float IID_WP_GLOCK = 404; float IID_WP_USP = 405; float IID_WP_DEAGLE = 406; float IID_WP_NEEDLER = 407; float IID_WP_ALIENBLASTER = 408; -float IID_WP_PIPERIFLE = 409; -float IID_WP_WINCHESTER = 410; -float IID_WP_MOSSBERG = 411; -float IID_WP_JACKHAMMER = 412; -float IID_WP_MP9 = 413; -float IID_WP_MP7 = 414; -float IID_WP_RANGEMASTER = 415; -float IID_WP_AK112 = 416; -float IID_WP_AK74 = 417; -float IID_WP_DKS1 = 418; -float IID_WP_MOONLIGHT = 419; -float IID_WP_SA80 = 420; -float IID_WP_GAUSERIFLE = 421; //2mm EC -float IID_WP_PULSERIFLE = 422; -float IID_WP_FNFAL = 423; //.308 AP -float IID_WP_ROCKETLAUNCHER = 430; +float IID_WP_WINCHESTER = 409; +float IID_WP_MOSSBERG = 410; +float IID_WP_JACKHAMMER = 411; +float IID_WP_MP9 = 412; +float IID_WP_MP7 = 413; +float IID_WP_RANGEMASTER = 414; +float IID_WP_AK112 = 415; +float IID_WP_AK74 = 416; +float IID_WP_DKS1 = 417; +float IID_WP_MOONLIGHT = 418; +float IID_WP_G11 = 419; +float IID_WP_GLOCK_S = 420; +float IID_WP_USP_S = 421; +float IID_WP_MP9_S = 422; +float IID_WP_MP7_S = 423; +float IID_WP_PIPERIFLE = 424; +float IID_WP_PIPERIFLE_R = 425; +float IID_WP_PIPERIFLE_S = 426; +float IID_WP_PIPERIFLE_SCOPE = 427; +float IID_WP_PIPERIFLE_SCOPE_S = 428; +float IID_WP_PIPERIFLE_SCOPE_R = 429; +float IID_WP_PIPERIFLE_SCOPE_S_R = 430; +float IID_WP_PIPERIFLE_S_R = 431; +float IID_WP_DEAGLE_M = 432; +float IID_WP_AK112_M = 433; +float IID_WP_GAUSERIFLE = 434; //2mm EC +float IID_WP_PULSERIFLE = 435; +float IID_WP_PLASMACARBINE = 436; +float IID_WP_TURBOPLASMA = 437; +float IID_WP_FNFAL = 438; //.308 AP +float IID_WP_ROCKETLAUNCHER = 439; +float IID_WP_LASERGATLING = 440; +float IID_WP_DKS1_S = 441; +float IID_WP_RANGEMASTER_SCOPE = 442; +float IID_WP_AK47 = 443; +float IID_WP_ACR = 444; //and ammo for those guns float IID_AM_NEEDLER = 507; @@ -49,15 +70,20 @@ float IID_AM_762MM = 514; //"7.62mm ammo"; float IID_AM_44MAGNUM = 515; //".44 magnum ammo"; float IID_AM_45ACP = 516; //".45 ACP ammo"; float IID_AM_ROCKET = 517; //"explosive rocket" +float IID_AM_CASELESS = 518; //caseless +float IID_AM_WARSAW = 519; //ak-47 ammo //grenade items float IID_GREN_FRAG = 101; float IID_GREN_EMP = 102; float IID_GREN_SMOKE = 103; float IID_GREN_FLASH = 104; +float IID_GREN_STUN = 105; +float IID_GREN_FLARE = 106; //armour -#define IsArmor(iid) (iid >= IID_ARM_SHIRT && iid <= IID_ARM_LPOWER) +#define IsArmor(iid) (iid >= IID_ARM_DESERT && iid <= IID_ARM_LPOWER) +float IID_ARM_DESERT = 200; float IID_ARM_SHIRT = 201; float IID_ARM_LEATHER = 202; float IID_ARM_KEVLAR = 203; @@ -75,6 +101,7 @@ float IID_CHEM_SUPERSTIM = 303; float IID_CHEM_ADRENALINE = 304; float IID_CHEM_PSYCHO = 305; float IID_CHEM_BESERK = 306; +float IID_CHEM_RADX = 307; float IID_BUILD_MRAMMO = 350; float IID_BUILD_SHIELDGEN = 351; @@ -85,15 +112,41 @@ float IID_BUILD_TELEPAD = 355; float IID_BUILD_RTURRET = 356; float IID_BUILD_GTURRET = 357; -float IID_EQUIP_CLIMBINGGEAR = 375; -float IID_EQUIP_STEALTHBOY = 376; -float IID_EQUIP_SPRINTKIT = 377; -float IID_EQUIP_HOVERBOOTS = 378; +#define IsEquip(iid) (iid >= IID_EQUIP_MEDIC_BAG && iid <= IID_EQUIP_EXTENDER) +#define IsJunk(iid) (iid >= IID_MISC_JUNK && iid <= IID_MISC_XRAYTUBE) + +float IID_EQUIP_MEDIC_BAG = 375; +float IID_EQUIP_GOGGLES = 376; +float IID_EQUIP_BELTPOUCH = 378; +float IID_EQUIP_BACKPACK = 379; +float IID_EQUIP_TOOLKIT = 380; +float IID_EQUIP_CLIMBINGGEAR = 381; +float IID_EQUIP_BATTERY = 382; +float IID_EQUIP_STEALTHBOY = 383; +float IID_EQUIP_SPRINTKIT = 384; +float IID_EQUIP_HOVERBOOTS = 385; +float IID_EQUIP_XRAY = 386; +float IID_EQUIP_EXTENDER = 387; + + +float IID_MISC_JUNK = 310; +float IID_MISC_NUKACOLA = 311; +float IID_MISC_CHEMICALS = 312; +float IID_MISC_AEROSOL = 313; +float IID_MISC_RDXCRYSTAL = 314; +float IID_MISC_STEELPIPE = 315; +float IID_MISC_DUCKTAPE = 316; +float IID_MISC_LCD = 317; +float IID_MISC_CIRCUITBOARD = 318; +float IID_MISC_COPPERWIRE = 319; +float IID_MISC_HMXCOMPOUND = 320; +float IID_MISC_GUM = 321; +float IID_MISC_XRAYTUBE = 322; + +float IID_EQUIP_SILENCER = 323; + #define IsShootable(iid) (IsMelee(iid) || IsRanged(iid) || IsGrenade(iid)) -#define ToIID(it) floor(it/512) -#define ToStatus(it) (it&511) -#define SlotVal(iid,st) ((iid*512) | (st&511)) float(float slotno, float iid) FitsInSlot; @@ -101,9 +154,6 @@ float(float slotno, float iid) FitsInSlot; //slot3 is the armour slot. //the other slots are for misilaneous things. -#define MAXSLOTS 16 - -#ifndef CSQC .float islot1; .float islot2; .float islot3; @@ -120,34 +170,101 @@ float(float slotno, float iid) FitsInSlot; .float islot14; .float islot15; .float islot16; +.float islot17; +.float islot18; +.float islot19; +.float islot20; +.float islot21; +.float islot22; +.float islot23; +.float islot24; +.float xslot1; +.float xslot2; +.float xslot3; +.float xslot4; +.float xslot5; +.float xslot6; +.float xslot7; +.float xslot8; -void(float stnum, float sttype, .float fieldname) clientstatf = #232; +#define MAXSLOTS 24 + +void(float sttype, float stnum, string fieldname) clientstat = #232; void() SetupStats = { //2 is ev_float //32 is the first stat we are allowed to use - clientstatf(32, 2, islot1); - clientstatf(33, 2, islot2); - clientstatf(34, 2, islot3); - clientstatf(35, 2, islot4); - clientstatf(36, 2, islot5); - clientstatf(37, 2, islot6); - clientstatf(38, 2, islot7); - clientstatf(39, 2, islot8); - clientstatf(40, 2, islot9); - clientstatf(41, 2, islot10); - clientstatf(42, 2, islot11); - clientstatf(43, 2, islot12); - clientstatf(44, 2, islot13); - clientstatf(45, 2, islot14); - clientstatf(46, 2, islot15); - clientstatf(47, 2, islot16); - - clientstatf(61, 2, current_slot); - clientstatf(62, 2, team); - clientstatf(63, 2, class); + clientstat(2, 32, "islot1"); + clientstat(2, 33, "islot2"); + clientstat(2, 34, "islot3"); + clientstat(2, 35, "islot4"); + clientstat(2, 36, "islot5"); + clientstat(2, 37, "islot6"); + clientstat(2, 38, "islot7"); + clientstat(2, 39, "islot8"); + clientstat(2, 40, "islot9"); + clientstat(2, 41, "islot10"); + clientstat(2, 42, "islot11"); + clientstat(2, 43, "islot12"); + clientstat(2, 44, "islot13"); + clientstat(2, 45, "islot14"); + clientstat(2, 46, "islot15"); + clientstat(2, 47, "islot16"); + clientstat(2, 48, "health"); + clientstat(2, 49, "max_health"); + clientstat(2, 50, "ammo_shells"); + clientstat(2, 51, "ammo_cells"); + clientstat(2, 52, "weight"); + clientstat(2, 53, "max_weight"); + clientstat(2, 54, "position"); + clientstat(2, 55, "rage"); + clientstat(2, 56, "regen"); + clientstat(2, 57, "missionbrief"); + clientstat(2, 58, "sneak"); + clientstat(2, 59, "perk2"); + clientstat(2, 60, "perk1"); + clientstat(2, 61, "current_slot"); + clientstat(2, 62, "team"); + clientstat(2, 63, "class"); + clientstat(2, 64, "start_time"); + clientstat(2, 65, "location"); + clientstat(2, 66, "map_obj"); + clientstat(2, 67, "map_ent1"); + clientstat(2, 68, "map_ent2"); + clientstat(2, 69, "map_ent3"); + clientstat(2, 70, "silencer"); + clientstat(2, 71, "extender"); + clientstat(2, 91, "islot17"); + clientstat(2, 92, "islot18"); + clientstat(2, 93, "islot19"); + clientstat(2, 94, "islot20"); + clientstat(2, 95, "islot21"); + clientstat(2, 96, "islot22"); + clientstat(2, 97, "islot23"); + clientstat(2, 98, "islot24"); + clientstat(2, 99, "recoil"); + clientstat(2, 100, "xslot1"); + clientstat(2, 101, "xslot2"); + clientstat(2, 102, "xslot3"); + clientstat(2, 103, "xslot4"); + clientstat(2, 104, "xslot5"); + clientstat(2, 105, "xslot6"); + clientstat(2, 106, "xslot7"); + clientstat(2, 107, "xslot8"); + clientstat(2, 108, "safezone"); + clientstat(2, 109, "connected"); + clientstat(2, 110, "steadyaim"); + clientstat(2, 125, "timer"); + clientstat(2, 126, "popup"); + clientstat(2, 127, "score"); }; + +#define ToIID(it) floor(it/512) +#define ToStatus(it) (it&511) +#define SlotVal(iid,st) ((iid*512) | (st&511)) + + float(entity e, float slotno) ItemInSlot = { if (slotno == 1) @@ -182,6 +299,22 @@ float(entity e, float slotno) ItemInSlot = return e.islot15; if (slotno == 16) return e.islot16; + if (slotno == 17) + return e.islot17; + if (slotno == 18) + return e.islot18; + if (slotno == 19) + return e.islot19; + if (slotno == 20) + return e.islot20; + if (slotno == 21) + return e.islot21; + if (slotno == 22) + return e.islot22; + if (slotno == 23) + return e.islot23; + if (slotno == 24) + return e.islot24; return 0; }; @@ -220,6 +353,22 @@ void(entity e, float slotno, float item) SetItemSlot = e.islot15 = item; else if (slotno == 16) e.islot16 = item; + else if (slotno == 17) + e.islot17 = item; + else if (slotno == 18) + e.islot18 = item; + else if (slotno == 19) + e.islot19 = item; + else if (slotno == 20) + e.islot20 = item; + else if (slotno == 21) + e.islot21 = item; + else if (slotno == 22) + e.islot22 = item; + else if (slotno == 23) + e.islot23 = item; + else if (slotno == 24) + e.islot24 = item; }; float(entity e, float iid) SlotOfItem = @@ -256,7 +405,76 @@ float(entity e, float iid) SlotOfItem = return 15; if (ToIID(e.islot16) == iid) return 16; + if (ToIID(e.islot17) == iid) + return 17; + if (ToIID(e.islot18) == iid) + return 18; + if (ToIID(e.islot19) == iid) + return 19; + if (ToIID(e.islot20) == iid) + return 20; + if (ToIID(e.islot21) == iid) + return 21; + if (ToIID(e.islot22) == iid) + return 22; + if (ToIID(e.islot23) == iid) + return 23; + if (ToIID(e.islot24) == iid) + return 24; + return 0; +}; +float(entity e, float iid) ShadowSlotOfItem = +{ + if (ToIID(getstati(32)) == iid) + return 1; + if (ToIID(getstati(33)) == iid) + return 2; + if (ToIID(getstati(34)) == iid) + return 3; + if (ToIID(getstati(35)) == iid) + return 4; + if (ToIID(getstati(36)) == iid) + return 5; + if (ToIID(getstati(37)) == iid) + return 6; + if (ToIID(getstati(38)) == iid) + return 7; + if (ToIID(getstati(39)) == iid) + return 8; + if (ToIID(getstati(40)) == iid) + return 9; + if (ToIID(getstati(41)) == iid) + return 10; + if (ToIID(getstati(42)) == iid) + return 11; + if (ToIID(getstati(43)) == iid) + return 12; + if (ToIID(getstati(44)) == iid) + return 13; + if (ToIID(getstati(45)) == iid) + return 14; + if (ToIID(getstati(46)) == iid) + return 15; + if (ToIID(getstati(47)) == iid) + return 16; + + if (ToIID(getstati(91)) == iid) + return 17; + if (ToIID(getstati(92)) == iid) + return 18; + if (ToIID(getstati(93)) == iid) + return 19; + if (ToIID(getstati(94)) == iid) + return 20; + if (ToIID(getstati(95)) == iid) + return 21; + if (ToIID(getstati(96)) == iid) + return 22; + if (ToIID(getstati(97)) == iid) + return 23; + if (ToIID(getstati(98)) == iid) + return 24; return 0; }; @@ -295,6 +513,22 @@ float(entity e, float iid) TotalQuantity = ret += ToStatus(e.islot15); if (ToIID(e.islot16) == iid) ret += ToStatus(e.islot16); + if (ToIID(e.islot17) == iid) + ret += ToStatus(e.islot17); + if (ToIID(e.islot18) == iid) + ret += ToStatus(e.islot18); + if (ToIID(e.islot19) == iid) + ret += ToStatus(e.islot19); + if (ToIID(e.islot20) == iid) + ret += ToStatus(e.islot20); + if (ToIID(e.islot21) == iid) + ret += ToStatus(e.islot21); + if (ToIID(e.islot22) == iid) + ret += ToStatus(e.islot22); + if (ToIID(e.islot23) == iid) + ret += ToStatus(e.islot23); + if (ToIID(e.islot24) == iid) + ret += ToStatus(e.islot24); return ret; }; @@ -327,32 +561,14 @@ float(entity e) FindEmptySlot = return 14; if (ToIID(e.islot15) == IID_NONE) return 15; - if (ToIID(e.islot16) == IID_NONE) - return 16; return 0; }; float(entity e, float iid) FindSuitableEmptySlot = { - if (ToIID(e.islot1) == IID_NONE) - if (FitsInSlot(1, iid)) - return 1; - if (ToIID(e.islot2) == IID_NONE) - if (FitsInSlot(2, iid)) - return 2; - if (ToIID(e.islot3) == IID_NONE) - if (FitsInSlot(3, iid)) - return 3; - if (ToIID(e.islot4) == IID_NONE) - if (FitsInSlot(4, iid)) - return 4; - if (ToIID(e.islot5) == IID_NONE) - if (FitsInSlot(5, iid)) - return 5; - if (ToIID(e.islot6) == IID_NONE) - if (FitsInSlot(6, iid)) - return 6; + if (!IsJunk(iid)) + { if (ToIID(e.islot7) == IID_NONE) if (FitsInSlot(7, iid)) return 7; @@ -383,7 +599,26 @@ float(entity e, float iid) FindSuitableEmptySlot = if (ToIID(e.islot16) == IID_NONE) if (FitsInSlot(16, iid)) return 16; - + } + else if (IsJunk(iid)) + { + if (ToIID(e.islot17) == IID_NONE) + return 17; + if (ToIID(e.islot18) == IID_NONE) + return 18; + if (ToIID(e.islot19) == IID_NONE) + return 19; + if (ToIID(e.islot20) == IID_NONE) + return 20; + if (ToIID(e.islot21) == IID_NONE) + return 21; + if (ToIID(e.islot22) == IID_NONE) + return 22; + if (ToIID(e.islot23) == IID_NONE) + return 23; + if (ToIID(e.islot24) == IID_NONE) + return 24; + } return 0; }; @@ -422,76 +657,114 @@ slot_t(float slot) SlotField = return islot15; if (slot == 16) return islot16; + if (slot == 17) + return islot17; + if (slot == 18) + return islot18; + if (slot == 19) + return islot19; + if (slot == 20) + return islot20; + if (slot == 21) + return islot21; + if (slot == 22) + return islot22; + if (slot == 23) + return islot23; + if (slot == 24) + return islot24; bprint(PRINT_MEDIUM, "ERROR: Invalid slot number (", ftos(slot), ")\n"); return islot1; }; -#endif string(float iid) GetItemVModel = { if (iid == IID_NONE) return "progs/v_fist.mdl"; - if (iid == IID_WP_TOOLKIT) + if (iid == IID_WP_WRENCH) return "progs/v_span.mdl"; if (iid == IID_WP_KNIFE) return "progs/v_knife.mdl"; if (iid == IID_WP_AXE) return "progs/v_axe.mdl"; - if (iid == IID_WP_VIBROBLADE) - return "progs/v_knife.mdl"; + if (iid == IID_WP_SPEAR) + return "progs/v_spear.mdl"; if (iid == IID_WP_POWERAXE) return "progs/v_axe.mdl"; if (iid == IID_WP_USP) return "progs/v_1911.mdl"; - + if (iid == IID_WP_USP_S) + return "progs/v_1911.mdl"; + if (iid == IID_WP_GLOCK) + return "progs/v_glock.mdl"; + if (iid == IID_WP_GLOCK_S) + return "progs/v_glock.mdl"; if (iid == IID_WP_DEAGLE) return "progs/v_deagle.mdl"; if (iid == IID_WP_NEEDLER) - return "progs/v_1911.mdl"; + return "progs/v_needler.mdl"; if (iid == IID_WP_ALIENBLASTER) - return "progs/v_alien.mdl"; - if (iid == IID_WP_PIPERIFLE) - return "progs/v_piperifle.mdl"; + return "progs/v_blaster.mdl"; + if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) + return "progs/v_pipe.mdl"; if (iid == IID_WP_WINCHESTER) return "progs/v_double.mdl"; if (iid == IID_WP_MOSSBERG) - return "progs/v_shotgun.mdl"; + return "progs/v_combat.mdl"; if (iid == IID_WP_JACKHAMMER) return "progs/v_jackhammer.mdl"; if (iid == IID_WP_MP9) - return "progs/v_mp9.mdl"; + return "progs/v_ump.mdl"; if (iid == IID_WP_MP7) return "progs/v_smg.mdl"; + if (iid == IID_WP_MP9_S) + return "progs/v_ump.mdl"; + if (iid == IID_WP_MP7_S) + return "progs/v_smg.mdl"; if (iid == IID_WP_RANGEMASTER) return "progs/v_rangem.mdl"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "progs/v_rangem_s.mdl"; if (iid == IID_WP_AK112) return "progs/v_ak47.mdl"; if (iid == IID_WP_AK74) return "progs/v_ak47.mdl"; + if (iid == IID_WP_ACR) + return "progs/v_acr.mdl"; if (iid == IID_WP_DKS1) return "progs/v_srifle.mdl"; + if (iid == IID_WP_DKS1_S) + return "progs/v_srifle.mdl"; if (iid == IID_WP_MOONLIGHT) return "progs/v_night.mdl"; if (iid == IID_WP_FNFAL) - return "progs/v_rangem.mdl"; + return "progs/v_fnfal.mdl"; + if (iid == IID_WP_AK112_M) + return "progs/v_ak47.mdl"; - - if (iid == IID_WP_SA80) - return "progs/v_sa80.mdl"; + if (iid == IID_WP_G11) + return "progs/v_g11.mdl"; if (iid == IID_WP_GAUSERIFLE) return "progs/v_gauss.mdl"; if (iid == IID_WP_PULSERIFLE) + return "progs/v_plasma.mdl"; + if (iid == IID_WP_TURBOPLASMA) + return "progs/v_plasma.mdl"; + if (iid == IID_WP_PLASMACARBINE) return "progs/v_carbine.mdl"; - if (iid == IID_WP_ROCKETLAUNCHER) return "progs/v_rocket.mdl"; + if (iid == IID_WP_LASERGATLING) + return "progs/v_chain.mdl"; if (iid == IID_GREN_FRAG) return "progs/v_handgren.mdl"; + if (iid == IID_GREN_STUN) + return "progs/v_handgren.mdl"; if (iid == IID_GREN_EMP) return "progs/v_handgren.mdl"; if (iid == IID_GREN_SMOKE) @@ -507,56 +780,87 @@ string(float iid) GetItemWModel = { if (iid == IID_WP_KNIFE) return "progs/w_knife.mdl"; + if (iid == IID_WP_WRENCH) + return "progs/w_span.mdl"; if (iid == IID_WP_AXE) return "progs/w_knife.mdl"; - if (iid == IID_WP_VIBROBLADE) - return "progs/w_axe.mdl"; + if (iid == IID_WP_SPEAR) + return "progs/w_spear.mdl"; if (iid == IID_WP_POWERAXE) return "progs/w_axe.mdl"; if (iid == IID_WP_USP) return "progs/w_1911.mdl"; + if (iid == IID_WP_USP_S) + return "progs/w_1911.mdl"; + if (iid == IID_WP_GLOCK) + return "progs/w_glock.mdl"; + if (iid == IID_WP_GLOCK_S) + return "progs/w_glock.mdl"; if (iid == IID_WP_DEAGLE) return "progs/w_deagle.mdl"; + if (iid == IID_WP_DEAGLE_M) + return "progs/w_deagle.mdl"; if (iid == IID_WP_NEEDLER) return "progs/w_1911.mdl"; if (iid == IID_WP_ALIENBLASTER) return "progs/w_alien.mdl"; - if (iid == IID_WP_PIPERIFLE) - return "progs/w_pipe.mdl"; + if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) + return "progs/w_rangem.mdl"; if (iid == IID_WP_WINCHESTER) - return "progs/w_shotgun.mdl"; + return "progs/w_double.mdl"; if (iid == IID_WP_MOSSBERG) - return "progs/w_pipe.mdl"; + return "progs/w_combat.mdl"; if (iid == IID_WP_JACKHAMMER) return "progs/w_jackhammer.mdl"; if (iid == IID_WP_MP9) return "progs/w_mp9.mdl"; if (iid == IID_WP_MP7) + return "progs/w_mp5.mdl"; + if (iid == IID_WP_MP9_S) + return "progs/w_mp9.mdl"; + if (iid == IID_WP_MP7_S) return "progs/w_mp7.mdl"; if (iid == IID_WP_RANGEMASTER) return "progs/w_rangem.mdl"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "progs/w_rangem.mdl"; if (iid == IID_WP_AK112) return "progs/w_ak47.mdl"; + if (iid == IID_WP_AK112_M) + return "progs/w_ak47.mdl"; if (iid == IID_WP_AK74) return "progs/w_ak47.mdl"; + if (iid == IID_WP_ACR) + return "progs/w_acr.mdl"; if (iid == IID_WP_DKS1) return "progs/w_srifle.mdl"; + if (iid == IID_WP_DKS1_S) + return "progs/w_srifle.mdl"; if (iid == IID_WP_MOONLIGHT) return "progs/w_night.mdl"; - if (iid == IID_WP_SA80) - return "progs/w_sa80.mdl"; + if (iid == IID_WP_G11) + return "progs/w_g11.mdl"; if (iid == IID_WP_FNFAL) - return "progs/w_rangem.mdl"; + return "progs/w_fnfal.mdl"; if (iid == IID_WP_GAUSERIFLE) return "progs/w_gauss.mdl"; if (iid == IID_WP_PULSERIFLE) + return "progs/w_plasma.mdl"; + if (iid == IID_WP_TURBOPLASMA) + return "progs/w_plasma.mdl"; + if (iid == IID_WP_PLASMACARBINE) return "progs/w_carbine.mdl"; + if (iid == IID_WP_ROCKETLAUNCHER) return "progs/w_rocket.mdl"; + if (iid == IID_WP_LASERGATLING) + return "progs/w_chain.mdl"; + if (iid == IID_GREN_STUN) + return "progs/grenade2.mdl"; if (iid == IID_GREN_FRAG) return "progs/grenade2.mdl"; if (iid == IID_GREN_EMP) @@ -573,6 +877,9 @@ string(float iid) GetItemWModel = if (iid == IID_CHEM_SUPERSTIM) return "maps/b_bh100.bsp"; + if (iid >= IID_AM_NEEDLER && iid <= IID_AM_WARSAW) + return "progs/ammobox.mdl"; + //fixme if (iid == IID_CHEM_ADRENALINE) return "maps/b_bh10.bsp"; @@ -580,6 +887,11 @@ string(float iid) GetItemWModel = return "maps/b_bh25.bsp"; if (iid == IID_CHEM_BESERK) return "maps/b_bh100.bsp"; + if (iid == IID_CHEM_RADX) + return "maps/b_bh25.bsp"; + + if (iid >= IID_MISC_JUNK && iid <= IID_MISC_XRAYTUBE) + return "progs/junk1.mdl"; return "progs/s_light.spr"; //no model. :/ @@ -587,16 +899,38 @@ string(float iid) GetItemWModel = float(float iid) WeaponAmmoType = { + if (iid == IID_GREN_STUN) + return IID_GREN_STUN; + if (iid == IID_GREN_FRAG) + return IID_GREN_FRAG; + if (iid == IID_GREN_EMP) + return IID_GREN_EMP; + if (iid == IID_GREN_SMOKE) + return IID_GREN_SMOKE; + if (iid == IID_GREN_FLASH) + return IID_GREN_FLASH; + + if (iid == IID_WP_USP) + return IID_AM_45ACP; + if (iid == IID_WP_USP_S) + return IID_AM_45ACP; + if (iid == IID_WP_GLOCK) + return IID_AM_10MM; + if (iid == IID_WP_GLOCK_S) return IID_AM_10MM; if (iid == IID_WP_DEAGLE) return IID_AM_44MAGNUM; + if (iid == IID_WP_AK47) + return IID_AM_WARSAW; + if (iid == IID_WP_DEAGLE_M) + return IID_AM_44MAGNUM; if (iid == IID_WP_NEEDLER) return IID_AM_NEEDLER; if (iid == IID_WP_ALIENBLASTER) return IID_AM_ENERGYCELL; - if (iid == IID_WP_PIPERIFLE) - return IID_AM_10MM; + if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) + return IID_AM_44MAGNUM; if (iid == IID_WP_WINCHESTER) return IID_AM_12GAUGESHELLS; if (iid == IID_WP_MOSSBERG) @@ -604,21 +938,35 @@ float(float iid) WeaponAmmoType = if (iid == IID_WP_JACKHAMMER) return IID_AM_12GAUGESHELLS; if (iid == IID_WP_MP9) - return IID_AM_10MM; + return IID_AM_45ACP; if (iid == IID_WP_MP7) return IID_AM_10MM; + if (iid == IID_WP_MP9_S) + return IID_AM_45ACP; + if (iid == IID_WP_MP7_S) + return IID_AM_10MM; if (iid == IID_WP_RANGEMASTER) return IID_AM_556MM; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return IID_AM_556MM; if (iid == IID_WP_AK112) return IID_AM_5MMHIGHVEL; - if (iid == IID_WP_AK74) + if (iid == IID_WP_AK47) + return IID_AM_WARSAW; + if (iid == IID_WP_AK112_M) return IID_AM_5MMHIGHVEL; + if (iid == IID_WP_AK74) + return IID_AM_WARSAW; + if (iid == IID_WP_ACR) + return IID_AM_NEEDLER; if (iid == IID_WP_DKS1) return IID_AM_762MM; + if (iid == IID_WP_DKS1_S) + return IID_AM_762MM; if (iid == IID_WP_MOONLIGHT) return IID_AM_556MM; - if (iid == IID_WP_SA80) - return IID_AM_556MM; + if (iid == IID_WP_G11) + return IID_AM_CASELESS; if (iid == IID_WP_FNFAL) return IID_AM_762MM; @@ -626,8 +974,16 @@ float(float iid) WeaponAmmoType = return IID_AM_2MMEC; if (iid == IID_WP_PULSERIFLE) return IID_AM_ENERGYCELL; + if (iid == IID_WP_PULSERIFLE) + return IID_AM_ENERGYCELL; + if (iid == IID_WP_TURBOPLASMA) + return IID_AM_ENERGYCELL; + if (iid == IID_WP_PLASMACARBINE) + return IID_AM_ENERGYCELL; if (iid == IID_WP_ROCKETLAUNCHER) return IID_AM_ROCKET; + if (iid == IID_WP_LASERGATLING) + return IID_AM_ENERGYCELL; return IID_NONE; }; @@ -636,44 +992,72 @@ float(float iid) WeaponMagQuant = { if (iid == IID_WP_USP) return 12; + if (iid == IID_WP_USP_S) + return 12; + if (iid == IID_WP_GLOCK) + return 15; + if (iid == IID_WP_GLOCK_S) + return 15; if (iid == IID_WP_DEAGLE) return 7; + if (iid == IID_WP_DEAGLE_M) + return 11; if (iid == IID_WP_NEEDLER) return 15; if (iid == IID_WP_ALIENBLASTER) return 6; - if (iid == IID_WP_PIPERIFLE) + if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) return 1; if (iid == IID_WP_WINCHESTER) return 2; if (iid == IID_WP_MOSSBERG) - return 6; + return 8; if (iid == IID_WP_JACKHAMMER) - return 10; + return 12; if (iid == IID_WP_MP9) - return 30; + return 25; if (iid == IID_WP_MP7) return 30; + if (iid == IID_WP_MP9_S) + return 25; + if (iid == IID_WP_MP7_S) + return 30; if (iid == IID_WP_RANGEMASTER) return 10; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return 10; + if (iid == IID_WP_AK47) + return 30; if (iid == IID_WP_AK112) return 24; + if (iid == IID_WP_AK112_M) + return 40; if (iid == IID_WP_AK74) return 30; + if (iid == IID_WP_ACR) + return 24; if (iid == IID_WP_DKS1) return 8; + if (iid == IID_WP_DKS1_S) + return 8; if (iid == IID_WP_MOONLIGHT) return 30; - if (iid == IID_WP_SA80) - return 30; + if (iid == IID_WP_G11) + return 50; if (iid == IID_WP_GAUSERIFLE) return 10; if (iid == IID_WP_PULSERIFLE) return 40; + if (iid == IID_WP_TURBOPLASMA) + return 40; + if (iid == IID_WP_PLASMACARBINE) + return 50; if (iid == IID_WP_FNFAL) return 20; if (iid == IID_WP_ROCKETLAUNCHER) return 1; + if (iid == IID_WP_LASERGATLING) + return 120; return 0; }; @@ -685,15 +1069,23 @@ float(float iid) GetItemWeight = if (iid == IID_WP_KNIFE) return 1; if (iid == IID_WP_AXE) - return 2; - if (iid == IID_WP_VIBROBLADE) + return 8; + if (iid == IID_WP_SPEAR) return 8; if (iid == IID_WP_POWERAXE) return 6; if (iid == IID_WP_USP) return 1; + if (iid == IID_WP_USP_S) + return 1; + if (iid == IID_WP_GLOCK) + return 1; + if (iid == IID_WP_GLOCK_S) + return 1; if (iid == IID_WP_DEAGLE) - return 2; + return 3; + if (iid == IID_WP_DEAGLE_M) + return 4; if (iid == IID_WP_NEEDLER) return 2; if (iid == IID_WP_ALIENBLASTER) @@ -708,28 +1100,48 @@ float(float iid) GetItemWeight = return 6; if (iid == IID_WP_MP9) return 3; + if (iid == IID_WP_MP9_S) + return 3; if (iid == IID_WP_MP7) return 3; + if (iid == IID_WP_MP7_S) + return 3; if (iid == IID_WP_RANGEMASTER) return 5; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return 5; if (iid == IID_WP_AK112) return 5; + if (iid == IID_WP_AK47) + return 6; + if (iid == IID_WP_AK112_M) + return 7; if (iid == IID_WP_AK74) return 5; + if (iid == IID_WP_ACR) + return 5; if (iid == IID_WP_DKS1) - return 7; + return 9; + if (iid == IID_WP_DKS1_S) + return 9; if (iid == IID_WP_MOONLIGHT) return 5; - if (iid == IID_WP_SA80) - return 5; + if (iid == IID_WP_G11) + return 6; if (iid == IID_WP_GAUSERIFLE) return 9; if (iid == IID_WP_PULSERIFLE) - return 12; + return 11; + if (iid == IID_WP_TURBOPLASMA) + return 11; + if (iid == IID_WP_PLASMACARBINE) + return 08; if (iid == IID_WP_FNFAL) - return 9; + return 8; if (iid == IID_WP_ROCKETLAUNCHER) return 10; + if (iid == IID_WP_LASERGATLING) + return 25; if (iid == IID_ARM_SHIRT) @@ -786,27 +1198,49 @@ string(float iid) GetItemName = return "nothing"; - if (iid == IID_WP_TOOLKIT) - return "toolkit"; + if (iid == IID_WP_WRENCH) + return "WRENCH"; if (iid == IID_WP_KNIFE) return "knife"; if (iid == IID_WP_AXE) return "axe"; - if (iid == IID_WP_VIBROBLADE) - return "ripper"; + if (iid == IID_WP_SPEAR) + return "spear"; if (iid == IID_WP_POWERAXE) - return "poweraxe"; + return "disruptor"; if (iid == IID_WP_USP) - return "1911 (10mm)"; + return "usp (45 acp)"; + if (iid == IID_WP_USP_S) + return "usp (silenced)"; + if (iid == IID_WP_GLOCK) + return "glock 21 (10mm)"; + if (iid == IID_WP_GLOCK_S) + return "glock 21 (silenced)"; if (iid == IID_WP_DEAGLE) return "desert eagle (.44mag)"; + if (iid == IID_WP_DEAGLE_M) + return "desert eagle (silenced)"; if (iid == IID_WP_NEEDLER) return "needler"; if (iid == IID_WP_ALIENBLASTER) return "alien blaster (energy)"; if (iid == IID_WP_PIPERIFLE) - return "pipe rifle (10mm)"; + return "pipe rifle (.44mag)"; + if (iid == IID_WP_PIPERIFLE_S) + return "pipe rifle (silenced)"; + if (iid == IID_WP_PIPERIFLE_R) + return "pipe rifle (rod&spring)"; + if (iid == IID_WP_PIPERIFLE_SCOPE) + return "pipe rifle (scope)"; + if (iid == IID_WP_PIPERIFLE_S_R) + return "pipe rifle (silenced, rod&spring)"; + if (iid == IID_WP_PIPERIFLE_SCOPE_R) + return "pipe rifle (scope, rod&spring)"; + if (iid == IID_WP_PIPERIFLE_SCOPE_S) + return "pipe rifle (scope, silenced)"; + if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) + return "pipe rifle (scope, silenced, rod&spring)"; if (iid == IID_WP_WINCHESTER) return "winchester (12g)"; if (iid == IID_WP_MOSSBERG) @@ -814,56 +1248,82 @@ string(float iid) GetItemName = if (iid == IID_WP_JACKHAMMER) return "jackhammer (12g)"; if (iid == IID_WP_MP9) - return "mp9 (10mm)"; + return "h&k ump (.45 acp)"; + if (iid == IID_WP_MP9_S) + return "h&k ump (silenced)"; if (iid == IID_WP_MP7) - return "grease gun (10mm)"; + return "h&k mp10 (10mm)"; + if (iid == IID_WP_MP7_S) + return "h&k mp10 (silenced)"; if (iid == IID_WP_RANGEMASTER) return "rangemaster (5.56mm)"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "rangemaster (x2 SUSAT scope)"; + if (iid == IID_WP_AK47) + return "ak-47 (7.62mm warsaw pact)"; if (iid == IID_WP_AK112) - return "ak-112 (5mm-hv)"; + return "ak-112 (5mm jhp)"; + if (iid == IID_WP_AK112_M) + return "ak-112 (extended magazine)"; if (iid == IID_WP_AK74) - return "ak-74 (5mm-hv)"; + return "ak-47 (7.62mm warsaw pact)"; + if (iid == IID_WP_ACR) + return "steyr acr (5mm flechette)"; if (iid == IID_WP_DKS1) - return "dks-1 (7.62mm)"; + return "knight sr-25 widowmaker (7.62mm)"; + if (iid == IID_WP_DKS1_S) + return "knight sr-25 widowmaker (silenced)"; if (iid == IID_WP_MOONLIGHT) return "moonlight (5.56mm)"; - if (iid == IID_WP_SA80) - return "sa-80 (5.56mm)"; + if (iid == IID_WP_G11) + return "hk g11 (4mm)"; if (iid == IID_WP_GAUSERIFLE) return "gauss rifle (2mm EC)"; if (iid == IID_WP_PULSERIFLE) - return "laser carbine (energy)"; + return "phased plasma rifle (energy)"; + if (iid == IID_WP_TURBOPLASMA) + return "turbo plasma rifle (energy)"; + if (iid == IID_WP_PLASMACARBINE) + return "plasma carbine (energy)"; if (iid == IID_WP_FNFAL) - return "fn-fal (7.62mm)"; + return "fn fal (7.62mm)"; if (iid == IID_WP_ROCKETLAUNCHER) return "rocket launcher"; + if (iid == IID_WP_LASERGATLING) + return "laser minigun (energy)"; if (iid == IID_AM_NEEDLER) return "needler cartidge"; if (iid == IID_AM_2MMEC) - return "2mm EC ammo"; + return "2mm AP"; if (iid == IID_AM_10MM) - return "10mm FMJ"; + return "10mm JHP"; if (iid == IID_AM_556MM) return "5.56mm FMJ"; if (iid == IID_AM_5MMHIGHVEL) return "5mm JHP"; if (iid == IID_AM_12GAUGESHELLS) - return "12-guage shotgun shells"; + return "12GA shotgun shells"; if (iid == IID_AM_ENERGYCELL) return "small energy cell"; if (iid == IID_AM_762MM) return "7.62mm AP"; if (iid == IID_AM_44MAGNUM) - return ".44 magnum ammo"; + return ".44 magnum FMJ"; + if (iid == IID_AM_WARSAW) + return "7.62mmx38 Warsaw Pact"; if (iid == IID_AM_45ACP) - return ".45 ACP ammo"; + return ".45 ACP"; if (iid == IID_AM_ROCKET) return "explosive rocket"; + if (iid == IID_AM_CASELESS) + return "4.7mm caseless"; + if (iid == IID_GREN_STUN) + return "stun grenade"; if (iid == IID_GREN_FRAG) return "frag grenade"; if (iid == IID_GREN_EMP) @@ -871,17 +1331,20 @@ string(float iid) GetItemName = if (iid == IID_GREN_SMOKE) return "smoke grenade"; if (iid == IID_GREN_FLASH) - return "flashbang"; - + return "flash grenade"; + if (iid == IID_GREN_FLARE) + return "ultra-light flare"; + if (iid == IID_ARM_DESERT) + return "desert armor"; if (iid == IID_ARM_SHIRT) - return "bulletproof shirt"; + return "kevlar shirt"; if (iid == IID_ARM_LEATHER) return "leather armor"; if (iid == IID_ARM_KEVLAR) - return "kevlar armor"; + return "double kevlar"; if (iid == IID_ARM_METAL) - return "metal armor"; + return "ceramic armor"; if (iid == IID_ARM_COMBAT) return "combat armor"; if (iid == IID_ARM_BROTHERHOOD) @@ -889,7 +1352,7 @@ string(float iid) GetItemName = if (iid == IID_ARM_FORCE) return "force armor"; if (iid == IID_ARM_LPOWER) - return "light power armor"; + return "power armor"; if (iid == IID_CHEM_STIMPACK) @@ -904,7 +1367,8 @@ string(float iid) GetItemName = return "psycho"; if (iid == IID_CHEM_BESERK) return "beserk"; - + if (iid == IID_CHEM_RADX) + return "rad-x"; if (iid == IID_BUILD_MRAMMO) return "mr. ammo"; @@ -921,36 +1385,547 @@ string(float iid) GetItemName = if (iid == IID_BUILD_GTURRET) return "machine-gun turret"; + + if (iid == IID_EQUIP_MEDIC_BAG) + return "medics bag"; + if (iid == IID_EQUIP_GOGGLES) + return "ghost goggles"; + if (iid == IID_EQUIP_SILENCER) + return "universal silencer"; + if (iid == IID_EQUIP_BELTPOUCH) + return "belt pouch"; + if (iid == IID_EQUIP_TOOLKIT) + return "super WRENCH"; + if (iid == IID_EQUIP_BACKPACK) + return "haversack"; if (iid == IID_EQUIP_CLIMBINGGEAR) return "climbing gear"; + if (iid == IID_EQUIP_BATTERY) + return "enhanced battery"; if (iid == IID_EQUIP_STEALTHBOY) return "stealthboy"; if (iid == IID_EQUIP_SPRINTKIT) return "lucozade sport!"; if (iid == IID_EQUIP_HOVERBOOTS) return "hover boots"; + if (iid == IID_EQUIP_EXTENDER) + return "barrel extender"; + if (iid == IID_EQUIP_XRAY) + return "x-ray device"; + + if (iid == IID_MISC_JUNK) + return "random junk"; + if (iid == IID_MISC_NUKACOLA) + return "nuka-cola"; + if (iid == IID_MISC_CHEMICALS) + return "chemicals"; + if (iid == IID_MISC_AEROSOL) + return "aerosol can"; + if (iid == IID_MISC_RDXCRYSTAL) + return "rdx crystals"; + if (iid == IID_MISC_STEELPIPE) + return "steel pipe"; + if (iid == IID_MISC_DUCKTAPE) + return "duct tape"; + if (iid == IID_MISC_LCD) + return "liquid crystal display"; + if (iid == IID_MISC_CIRCUITBOARD) + return "circuit board"; + if (iid == IID_MISC_COPPERWIRE) + return "copper wire"; + if (iid == IID_MISC_HMXCOMPOUND) + return "hmx compound"; + if (iid == IID_MISC_GUM) + return "chewing gum"; + if (iid == IID_MISC_XRAYTUBE) + return "x-ray tube"; + bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n"); return strcat("unknown", ftos(iid)); }; +float(float iid) GetBaseValue = +{ + if (iid == IID_NONE) + return 0; + + + if (iid == IID_WP_WRENCH) + return 1; + if (iid == IID_WP_KNIFE) + return 1; + if (iid == IID_WP_AXE) + return 1; + if (iid == IID_WP_SPEAR) + return 1; + + + if (iid == IID_WP_USP) + return 25; + if (iid == IID_WP_USP_S) + return 30; + if (iid == IID_WP_GLOCK) + return 20; + if (iid == IID_WP_GLOCK_S) + return 25; + if (iid == IID_WP_DEAGLE) + return 35; + if (iid == IID_WP_DEAGLE_M) + return 40; + if (iid == IID_WP_NEEDLER) + return 10; + if (iid == IID_WP_ALIENBLASTER) + return 20; + if (iid == IID_WP_PIPERIFLE) + return 5; + if (iid == IID_WP_PIPERIFLE_S) + return 5; + if (iid == IID_WP_PIPERIFLE_R) + return 6; + if (iid == IID_WP_PIPERIFLE_SCOPE) + return 6; + if (iid == IID_WP_PIPERIFLE_S_R) + return 7; + if (iid == IID_WP_PIPERIFLE_SCOPE_R) + return 7; + if (iid == IID_WP_PIPERIFLE_SCOPE_S) + return 7; + if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) + return 8; + if (iid == IID_WP_WINCHESTER) + return 30; + if (iid == IID_WP_MOSSBERG) + return 150; + if (iid == IID_WP_JACKHAMMER) + return 200; + if (iid == IID_WP_MP9) + return 75; + if (iid == IID_WP_MP9_S) + return 75; + if (iid == IID_WP_MP7) + return 75; + if (iid == IID_WP_MP7_S) + return 75; + if (iid == IID_WP_RANGEMASTER) + return 50; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return 50; + if (iid == IID_WP_AK47) + return 25; + if (iid == IID_WP_AK112) + return 80; + if (iid == IID_WP_AK112_M) + return 90; + if (iid == IID_WP_AK74) + return 30; + if (iid == IID_WP_ACR) + return 100; + if (iid == IID_WP_DKS1) + return 120; + if (iid == IID_WP_DKS1_S) + return 125; + if (iid == IID_WP_MOONLIGHT) + return 140; + if (iid == IID_WP_G11) + return 150; + if (iid == IID_WP_GAUSERIFLE) + return 200; + if (iid == IID_WP_PULSERIFLE) + return 200; + if (iid == IID_WP_TURBOPLASMA) + return 200; + if (iid == IID_WP_PLASMACARBINE) + return 105; + if (iid == IID_WP_FNFAL) + return 50; + if (iid == IID_WP_ROCKETLAUNCHER) + return 100; + if (iid == IID_WP_LASERGATLING) + return 150; + + + + if (iid == IID_AM_NEEDLER) + return 1; + if (iid == IID_AM_2MMEC) + return 1; + if (iid == IID_AM_10MM) + return 1; + if (iid == IID_AM_556MM) + return 1; + if (iid == IID_AM_5MMHIGHVEL) + return 1; + if (iid == IID_AM_12GAUGESHELLS) + return 1; + if (iid == IID_AM_ENERGYCELL) + return 1; + if (iid == IID_AM_762MM) + return 1; + if (iid == IID_AM_44MAGNUM) + return 1; + if (iid == IID_AM_WARSAW) + return 1; + if (iid == IID_AM_45ACP) + return 1; + if (iid == IID_AM_ROCKET) + return 1; + if (iid == IID_AM_CASELESS) + return 1; + + + if (iid == IID_GREN_STUN) + return 1; + if (iid == IID_GREN_FRAG) + return 1; + if (iid == IID_GREN_EMP) + return 1; + if (iid == IID_GREN_SMOKE) + return 1; + if (iid == IID_GREN_FLASH) + return 1; + if (iid == IID_GREN_FLARE) + return 1; + + if (iid == IID_ARM_DESERT) + return 1; + if (iid == IID_ARM_SHIRT) + return 1; + if (iid == IID_ARM_LEATHER) + return 2; + if (iid == IID_ARM_KEVLAR) + return 3; + if (iid == IID_ARM_METAL) + return 4; + if (iid == IID_ARM_COMBAT) + return 5; + if (iid == IID_ARM_BROTHERHOOD) + return 8; + if (iid == IID_ARM_FORCE) + return 10; + if (iid == IID_ARM_LPOWER) + return 15; + + + if (iid == IID_CHEM_STIMPACK) + return 1; + if (iid == IID_CHEM_MEDICALBAG) + return 1; + if (iid == IID_CHEM_SUPERSTIM) + return 1; + if (iid == IID_CHEM_ADRENALINE) + return 1; + if (iid == IID_CHEM_PSYCHO) + return 1; + if (iid == IID_CHEM_BESERK) + return 1; + if (iid == IID_CHEM_RADX) + return 1; + + if (iid == IID_EQUIP_MEDIC_BAG) + return 1; + if (iid == IID_EQUIP_GOGGLES) + return 1; + if (iid == IID_EQUIP_SILENCER) + return 1; + if (iid == IID_EQUIP_BELTPOUCH) + return 1; + if (iid == IID_EQUIP_TOOLKIT) + return 1; + if (iid == IID_EQUIP_BACKPACK) + return 1; + if (iid == IID_EQUIP_CLIMBINGGEAR) + return 1; + if (iid == IID_EQUIP_BATTERY) + return 1; + if (iid == IID_EQUIP_STEALTHBOY) + return 1; + if (iid == IID_EQUIP_SPRINTKIT) + return 1; + if (iid == IID_EQUIP_HOVERBOOTS) + return 1; + if (iid == IID_EQUIP_EXTENDER) + return 1; + if (iid == IID_EQUIP_XRAY) + return 1; + + if (iid == IID_MISC_JUNK) + return 0; + if (iid == IID_MISC_NUKACOLA) + return 0; + if (iid == IID_MISC_CHEMICALS) + return 0; + if (iid == IID_MISC_AEROSOL) + return 0; + if (iid == IID_MISC_RDXCRYSTAL) + return 0; + if (iid == IID_MISC_STEELPIPE) + return 0; + if (iid == IID_MISC_DUCKTAPE) + return 0; + if (iid == IID_MISC_LCD) + return 0; + if (iid == IID_MISC_CIRCUITBOARD) + return 0; + if (iid == IID_MISC_COPPERWIRE) + return 0; + if (iid == IID_MISC_HMXCOMPOUND) + return 0; + if (iid == IID_MISC_GUM) + return 0; + if (iid == IID_MISC_XRAYTUBE) + return 0; + + + bprint(PRINT_MEDIUM, ftos(iid), " without a sell price!\n"); + return 0; +}; + string(float iid) GetItemDesc = { if (iid == IID_NONE) return ""; - if (iid == IID_WP_TOOLKIT) - return "a wattz(tm) brand toolkit consisting of many handy instruments, including a wrench. this kit is a repairman's dream, and allows those with the proper knowledge to perform technical tasks."; - if (iid == IID_WP_AK74) - return "the ak74 is the predecessor of the legendary ak-47. it is still the same old killing machine, except that it uses the 5.45mm high-velocity round that was common in the latest assault rifles just before the war."; + if (iid == IID_WP_WRENCH) + return "a heavy multi-function wrench"; + if (iid == IID_WP_KNIFE) + return "great for stealth attacks"; + if (iid == IID_WP_AXE) + return "a futuristic battle axe"; + if (iid == IID_WP_SPEAR) + return "a long, sharp polearm"; + if (iid == IID_WP_POWERAXE) + return "a futuristic axe of some sort"; + + if (iid == IID_WP_USP) + return "uses 45 acp, a solid round"; + if (iid == IID_WP_USP_S) + return "this usp has a silencer attached for maximum stealth"; + if (iid == IID_WP_GLOCK) + return "a rugged, reliable sidearm"; + if (iid == IID_WP_GLOCK_S) + return "silencer allows for hit-and-run tactics"; + if (iid == IID_WP_DEAGLE) + return "the favorite of late 20th century action heroes"; + if (iid == IID_WP_DEAGLE_M) + return "a modified desert eagle with extended magazines"; + if (iid == IID_WP_NEEDLER) + return "an experimental weapon of some sort"; + if (iid == IID_WP_ALIENBLASTER) + return "this gun is of an unknown origin"; + if (iid == IID_WP_PIPERIFLE) + return "a homemade rifle made out of a steel pipe"; + if (iid == IID_WP_PIPERIFLE_S) + return "this pipe rifle has a silencer attached"; + if (iid == IID_WP_PIPERIFLE_SCOPE) + return "a crude scope has been attached to this pipe rifle"; + if (iid == IID_WP_PIPERIFLE_R) + return "a modified pipe rifle with a rod&spring replacement"; + if (iid == IID_WP_PIPERIFLE_S_R) + return "pipe rifle with a silencer and rod&spring replacement"; + if (iid == IID_WP_PIPERIFLE_SCOPE_R) + return "pipe rifle with a scope and rod&spring replacement"; + if (iid == IID_WP_PIPERIFLE_SCOPE_S) + return "pipe rifle with a scope and silencer"; + if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) + return "pipe rifle with a scope, silencer, and rod&spring"; + if (iid == IID_WP_WINCHESTER) + return "double-barrelled and sawed off"; + if (iid == IID_WP_MOSSBERG) + return "semi-auto combat shotgun, magazine fed"; + if (iid == IID_WP_JACKHAMMER) + return "the ultimate for close range battles"; + if (iid == IID_WP_MP9) + return "higher recoil due to larger .45 acp round"; + if (iid == IID_WP_MP9_S) + return "higher recoil due to larger .45 acp round"; + if (iid == IID_WP_MP7) + return "great all-around weapon; good burst fire"; + if (iid == IID_WP_MP7_S) + return "silenced 10mm smg; less recoil"; + if (iid == IID_WP_RANGEMASTER) + return "civilian battle rifle. sturdy and effective"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "civilian battle rifle. this one has a scope"; + if (iid == IID_WP_AK47) + return "an outdated assault rifle with extreme durability"; + if (iid == IID_WP_AK112) + return "a common assault rifle with extreme durability"; + if (iid == IID_WP_AK112_M) + return "this rifle has been modified to accept larger magazines"; + if (iid == IID_WP_DKS1) + return "this sturdy rifle fires .308, a larger, more reliable round"; + if (iid == IID_WP_DKS1_S) + return ".308 sniper rifle, silenced for stealth-ops"; + if (iid == IID_WP_DKS1) + return "semi-auto sniper rifle"; + if (iid == IID_WP_MOONLIGHT) + return "decent rifle with extra utility"; + if (iid == IID_WP_G11) + return "a prototype rifle that uses caseless ammo"; + if (iid == IID_WP_GAUSERIFLE) + return "fires extremely high-velocity rounds"; + if (iid == IID_WP_PULSERIFLE) + return "high-tech plasma weapon released just before the war"; + if (iid == IID_WP_TURBOPLASMA) + return "modified plasma rifle for greater heat and pressure dissipation"; + if (iid == IID_WP_PLASMACARBINE) + return "prototype plasma rifle released during the final stages of the war"; + if (iid == IID_WP_FNFAL) + return "rifle designed for longer range; high recoil"; + if (iid == IID_WP_ROCKETLAUNCHER) + return "great for devastating tactical strikes"; + if (iid == IID_WP_LASERGATLING) + return "quite simply, the ultimate in heavy firepower"; + + + + if (iid == IID_AM_NEEDLER) + return "good armor-peircing properties"; + if (iid == IID_AM_2MMEC) + return "virtually ignores armor"; + if (iid == IID_AM_10MM) + return "jacketed hollow-points for good damage"; + if (iid == IID_AM_556MM) + return "standard rifle round, moderate recoil"; + if (iid == IID_AM_5MMHIGHVEL) + return "experimental high-velocity rifle ammo"; + if (iid == IID_AM_12GAUGESHELLS) + return "the old standard, has trouble with heavy armor"; + if (iid == IID_AM_ENERGYCELL) + return "this energy cell comes from an unknown origin"; + if (iid == IID_AM_762MM) + return "good stopping power and armor-piercing performance"; + if (iid == IID_AM_44MAGNUM) + return "full metal jacket, hit 'em hard"; + if (iid == IID_AM_WARSAW) + return "ancient soviet rifle round, used in the ak47"; + if (iid == IID_AM_45ACP) + return "a common pistol round with good stopping power"; + if (iid == IID_AM_ROCKET) + return "expensive and extremely lethal"; + if (iid == IID_AM_CASELESS) + return "a brick of small-caliber caseless ammo"; + + + if (iid == IID_GREN_FRAG) + return "all-purpose fragmentation grenade"; + if (iid == IID_GREN_EMP) + return "useful against robots and cyborgs"; + if (iid == IID_GREN_SMOKE) + return "very useful for a quick getaway!"; + if (iid == IID_GREN_FLASH) + return "temporarily blinds nearby enemies"; + if (iid == IID_GREN_STUN) + return "delivers a forceful shock to nearby enemies"; + if (iid == IID_GREN_FLARE) + return "provides a blue light for shadowy areas"; + + if (iid == IID_ARM_DESERT) + return "the light armor of a raider; makes a great disguise"; + if (iid == IID_ARM_SHIRT) + return "featherweight body armor with good stealth and mobility"; + if (iid == IID_ARM_LEATHER) + return "made of thick, tanned brahmin hide"; + if (iid == IID_ARM_KEVLAR) + return "a suit of dragon skin(tm), reduces all damage to blunt trauma"; + if (iid == IID_ARM_METAL) + return "metal plates deflect smaller attacks easily"; + if (iid == IID_ARM_COMBAT) + return "made from defensive polymers, the yardstick of armors"; + if (iid == IID_ARM_BROTHERHOOD) + return "enhanced combat armor with anti-explosive plating"; + if (iid == IID_ARM_FORCE) + return "experimental energy-field armor, very low absorb"; + if (iid == IID_ARM_LPOWER) + return "this heavy armor contains servos that assist with movement"; + + + if (iid == IID_CHEM_STIMPACK) + return "advanced healing chem that replaces lost blood"; + if (iid == IID_CHEM_MEDICALBAG) + return "first aid kit with many high-tech supplies"; + if (iid == IID_CHEM_SUPERSTIM) + return "contains nanobots that heal very fast"; + if (iid == IID_CHEM_ADRENALINE) + return "boosts the metabolism, increasing jump and run speed"; + if (iid == IID_CHEM_PSYCHO) + return "unknown chemicals, probably of military origin"; + if (iid == IID_CHEM_BESERK) + return "unknown chemicals, probably of military origin"; + if (iid == IID_CHEM_RADX) + return "powerful anti-radiation pills"; + + if (iid == IID_BUILD_MRAMMO) - return "a military prototype, the mr. ammo was designed to allow soldiers an extra source of ammunition in remote areas, as the handy little machine is capable of churning out ammo from things such as rocks, debris, and metal scraps."; + return "provides extra ammunition"; + if (iid == IID_BUILD_SHIELDGEN) + return "protects all nearby allies"; + if (iid == IID_BUILD_AUTODOC) + return "the auto-doc will repair injuries"; + if (iid == IID_BUILD_ROBOFANG) + return "robofang guardian unit"; + if (iid == IID_BUILD_TTURRET) + return "dispatches hostile intruders"; + if (iid == IID_BUILD_RTURRET) + return "rocket turret"; + if (iid == IID_BUILD_GTURRET) + return "machine-gun turret"; + + + if (iid == IID_EQUIP_MEDIC_BAG) + return "allows more chems to be carried"; + if (iid == IID_EQUIP_GOGGLES) + return "protects against visual impairments"; + if (iid == IID_EQUIP_SILENCER) + return "attaches to any smallarm"; + if (iid == IID_EQUIP_BELTPOUCH) + return "useful for carrying extra grenades"; + if (iid == IID_EQUIP_TOOLKIT) + return "for picking all sorts of locks"; + if (iid == IID_EQUIP_BACKPACK) + return "this handy bag lets you carry more ammunition"; if (iid == IID_EQUIP_CLIMBINGGEAR) - return "FIXME:\nActivate, and then run at and up a wall. Don't look too far away from the wall!"; + return "for those hard to reach places"; + if (iid == IID_EQUIP_BATTERY) + return "provides prolonged battery life"; + if (iid == IID_EQUIP_STEALTHBOY) + return "makes user blurry and hard to see"; + if (iid == IID_EQUIP_EXTENDER) + return "gives a weapon slightly longer range and damage"; + if (iid == IID_EQUIP_XRAY) + return "allows for enemy detection through walls"; + + if (iid == IID_MISC_NUKACOLA) + return "a bottle of tasty nuka-cola"; + if (iid == IID_MISC_JUNK) + return "metallic bits, pipe and other debris"; + if (iid == IID_MISC_CHEMICALS) + return "standard household cleaner"; + if (iid == IID_MISC_AEROSOL) + return "a half-full aerosol can"; + if (iid == IID_MISC_RDXCRYSTAL) + return "a batch of highly unstable explosive crystals"; + if (iid == IID_MISC_STEELPIPE) + return "a slightly rusted steel pipe"; + if (iid == IID_MISC_DUCKTAPE) + return "ancient, but still highly functional"; + if (iid == IID_MISC_LCD) + return "an lcd from a Lameboy DS videogame unit"; + if (iid == IID_MISC_CIRCUITBOARD) + return "a corroded circuit board from a remote control"; + if (iid == IID_MISC_COPPERWIRE) + return "a small spool of thin copper wire"; + if (iid == IID_MISC_HMXCOMPOUND) + return "a small amount of high-grade military explosive"; + if (iid == IID_MISC_GUM) + return "trident chewing gum, limited edition watermelon flavor"; + if (iid == IID_MISC_XRAYTUBE) + return "??? a strange device ???"; bprint(PRINT_MEDIUM, ftos(iid), " without a desc!\n"); - return strcat("", ftos(iid)); + return strcat("", ftos(iid)); }; string(float iid) GetItemImage = @@ -959,63 +1934,91 @@ string(float iid) GetItemImage = return "blank.jpg"; - if (iid == IID_WP_TOOLKIT) - return "toolkit.jpg"; + if (iid == IID_WP_WRENCH) + return "wrench.jpg"; if (iid == IID_WP_KNIFE) return "knife.jpg"; if (iid == IID_WP_AXE) - return "axe.jpg"; - if (iid == IID_WP_VIBROBLADE) - return "ripper.jpg"; + return "disruptor.jpg"; + if (iid == IID_WP_SPEAR) + return "spear.jpg"; if (iid == IID_WP_POWERAXE) - return "poweraxe.jpg"; + return "disruptor.jpg"; if (iid == IID_WP_USP) return "usp.jpg"; + if (iid == IID_WP_USP_S) + return "usp.jpg"; + if (iid == IID_WP_GLOCK) + return "glock.jpg"; + if (iid == IID_WP_GLOCK_S) + return "glock.jpg"; if (iid == IID_WP_DEAGLE) return "deagle.jpg"; + if (iid == IID_WP_DEAGLE_M) + return "deagle.jpg"; if (iid == IID_WP_NEEDLER) return "needler.jpg"; if (iid == IID_WP_ALIENBLASTER) - return "blaster.jpg"; - if (iid == IID_WP_PIPERIFLE) + return "ppistol.jpg"; + if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) return "prifle.jpg"; if (iid == IID_WP_WINCHESTER) return "double.jpg"; if (iid == IID_WP_MOSSBERG) - return "mossberg.jpg"; + return "citykiller.jpg"; if (iid == IID_WP_JACKHAMMER) return "jackhammer.jpg"; if (iid == IID_WP_MP9) return "mp9.jpg"; if (iid == IID_WP_MP7) return "ggun.jpg"; + if (iid == IID_WP_MP9_S) + return "mp9.jpg"; + if (iid == IID_WP_MP7_S) + return "ggun.jpg"; if (iid == IID_WP_RANGEMASTER) return "rangem.jpg"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "rangem_s.jpg"; + if (iid == IID_WP_AK47) + return "ak47.jpg"; if (iid == IID_WP_AK112) return "ak112.jpg"; + if (iid == IID_WP_AK112_M) + return "ak112.jpg"; if (iid == IID_WP_AK74) - return "ak74.jpg"; + return "ak47.jpg"; + if (iid == IID_WP_ACR) + return "acr.jpg"; if (iid == IID_WP_DKS1) return "dks1.jpg"; + if (iid == IID_WP_DKS1_S) + return "dks1_s.jpg"; if (iid == IID_WP_MOONLIGHT) return "moonlight.jpg"; - if (iid == IID_WP_SA80) - return "sa80.jpg"; + if (iid == IID_WP_G11) + return "g11.jpg"; if (iid == IID_WP_GAUSERIFLE) return "grifle.jpg"; if (iid == IID_WP_PULSERIFLE) - return "lcarbine.jpg"; + return "plasmar.jpg"; + if (iid == IID_WP_TURBOPLASMA) + return "turbo.jpg"; + if (iid == IID_WP_PULSERIFLE) + return "carbine.jpg"; if (iid == IID_WP_FNFAL) return "fnfal.jpg"; if (iid == IID_WP_ROCKETLAUNCHER) return "rpg.jpg"; + if (iid == IID_WP_LASERGATLING) + return "gatling.jpg"; if (iid == IID_AM_NEEDLER) return "needles.jpg"; if (iid == IID_AM_2MMEC) - return "2mm.jpg"; + return "2mmec.jpg"; if (iid == IID_AM_10MM) return "10mm.jpg"; if (iid == IID_AM_556MM) @@ -1030,11 +2033,14 @@ string(float iid) GetItemImage = return "762mm.jpg"; if (iid == IID_AM_44MAGNUM) return "44mag.jpg"; + if (iid == IID_AM_WARSAW) + return "762mm.jpg"; if (iid == IID_AM_45ACP) return "45acp.jpg"; if (iid == IID_AM_ROCKET) return "rocket.jpg"; - + if (iid == IID_AM_CASELESS) + return "caseless.jpg"; if (iid == IID_GREN_FRAG) return "frag.jpg"; @@ -1044,16 +2050,21 @@ string(float iid) GetItemImage = return "smoke.jpg"; if (iid == IID_GREN_FLASH) return "flash.jpg"; + if (iid == IID_GREN_STUN) + return "stun.jpg"; + if (iid == IID_GREN_FLARE) + return "flare.jpg"; - + if (iid == IID_ARM_DESERT) + return "desert.jpg"; if (iid == IID_ARM_SHIRT) return "shirt.jpg"; if (iid == IID_ARM_LEATHER) return "leather.jpg"; if (iid == IID_ARM_KEVLAR) - return "kevlar.jpg"; + return "doublek.jpg"; if (iid == IID_ARM_METAL) - return "metal.jpg"; + return "ceramic.jpg"; if (iid == IID_ARM_COMBAT) return "combat.jpg"; if (iid == IID_ARM_BROTHERHOOD) @@ -1067,13 +2078,15 @@ string(float iid) GetItemImage = if (iid == IID_CHEM_STIMPACK) return "stimpack.jpg"; if (iid == IID_CHEM_MEDICALBAG) - return "medbag.jpg"; + return "medkit.jpg"; if (iid == IID_CHEM_SUPERSTIM) return "superstim.jpg"; if (iid == IID_CHEM_ADRENALINE) return "adrenaline.jpg"; if (iid == IID_CHEM_PSYCHO) return "psycho.jpg"; + if (iid == IID_CHEM_RADX) + return "radx.jpg"; if (iid == IID_CHEM_BESERK) return "beserk.jpg"; @@ -1093,12 +2106,56 @@ string(float iid) GetItemImage = if (iid == IID_BUILD_GTURRET) return "gturret.jpg"; + if (iid == IID_EQUIP_MEDIC_BAG) + return "equip/medbag.jpg"; + if (iid == IID_EQUIP_GOGGLES) + return "equip/goggles.jpg"; + if (iid == IID_EQUIP_SILENCER) + return "equip/silencer.jpg"; + if (iid == IID_EQUIP_BELTPOUCH) + return "equip/beltpouch.jpg"; + if (iid == IID_EQUIP_TOOLKIT) + return "equip/WRENCH2.jpg"; + if (iid == IID_EQUIP_BACKPACK) + return "equip/haversack.jpg"; if (iid == IID_EQUIP_CLIMBINGGEAR) - return "robofang.jpg"; + return "equip/cgear.jpg"; + if (iid == IID_EQUIP_BATTERY) + return "equip/battery.jpg"; if (iid == IID_EQUIP_STEALTHBOY) - return "stealthboy.jpg"; - if (iid == IID_EQUIP_SPRINTKIT) - return "sprintkit.jpg"; + return "equip/stealthboy.jpg"; + if (iid == IID_EQUIP_EXTENDER) + return "equip/silencer.jpg"; + if (iid == IID_EQUIP_XRAY) + return "equip/xray.jpg"; + + + if (iid == IID_MISC_NUKACOLA) + return "junk/nukacola.jpg"; + if (iid == IID_MISC_JUNK) + return "junk/junk.jpg"; + if (iid == IID_MISC_CHEMICALS) + return "junk/chemicals.jpg"; + if (iid == IID_MISC_AEROSOL) + return "junk/aerosol.jpg"; + if (iid == IID_MISC_RDXCRYSTAL) + return "junk/rdxcrystal.jpg"; + if (iid == IID_MISC_STEELPIPE) + return "junk/pipe.jpg"; + if (iid == IID_MISC_DUCKTAPE) + return "junk/tape.jpg"; + if (iid == IID_MISC_LCD) + return "junk/lcd.jpg"; + if (iid == IID_MISC_CIRCUITBOARD) + return "junk/board.jpg"; + if (iid == IID_MISC_COPPERWIRE) + return "junk/wire.jpg"; + if (iid == IID_MISC_HMXCOMPOUND) + return "junk/hmx.jpg"; + if (iid == IID_MISC_GUM) + return "junk/gum.jpg"; + if (iid == IID_MISC_XRAYTUBE) + return "junk/tube.jpg"; bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n"); return strcat("unknown.jpg", ftos(iid)); @@ -1109,18 +2166,20 @@ float(string itname) ItemIDOfName = { if (itname == "nothing") return IID_NONE; - if (itname == "toolkit") - return IID_WP_TOOLKIT; + if (itname == "WRENCH") + return IID_WP_WRENCH; if (itname == "knife") return IID_WP_KNIFE; - if (itname == "axe") + if (itname == "hand-axe") return IID_WP_AXE; - if (itname == "ripper") - return IID_WP_VIBROBLADE; + if (itname == "spear") + return IID_WP_SPEAR; if (itname == "poweraxe") return IID_WP_POWERAXE; - if (itname == "1911") + if (itname == "usp") return IID_WP_USP; + if (itname == "glock") + return IID_WP_GLOCK; if (itname == "desert eagle") return IID_WP_DEAGLE; if (itname == "deagle") @@ -1145,31 +2204,51 @@ float(string itname) ItemIDOfName = return IID_WP_MP7; if (itname == "rangemaster") return IID_WP_RANGEMASTER; + if (itname == "rangemaster (scope)") + return IID_WP_RANGEMASTER_SCOPE; if (itname == "fnfal") return IID_WP_FNFAL; + if (itname == "ak-47") + return IID_WP_AK112; if (itname == "ak-112") return IID_WP_AK112; + if (itname == "ak-112 m") + return IID_WP_AK112_M; if (itname == "ak-74") return IID_WP_AK74; + if (itname == "acr") + return IID_WP_ACR; if (itname == "dks-1") return IID_WP_DKS1; + if (itname == "dks-1 silenced") + return IID_WP_DKS1_S; if (itname == "moonlight") return IID_WP_MOONLIGHT; - if (itname == "sa-80") - return IID_WP_SA80; + if (itname == "g11") + return IID_WP_G11; if (itname == "gauss rifle") return IID_WP_GAUSERIFLE; - if (itname == "laser carbine") + if (itname == "phased plasma rifle") return IID_WP_PULSERIFLE; + if (itname == "plasma carbine") + return IID_WP_PLASMACARBINE; + if (itname == "turbo plasma rifle") + return IID_WP_TURBOPLASMA; if (itname == "rocket") return IID_WP_ROCKETLAUNCHER; + if (itname == "laser minigun") + return IID_WP_LASERGATLING; if (itname == "frag grenade") return IID_GREN_FRAG; + if (itname == "stun grenade") + return IID_GREN_STUN; + if (itname == "stun flare") + return IID_GREN_FLARE; if (itname == "emp grenade") return IID_GREN_EMP; if (itname == "smoke grenade") return IID_GREN_SMOKE; - if (itname == "flashbang") + if (itname == "flash grenade") return IID_GREN_FLASH; if (itname == "bulletproof shirt") return IID_ARM_SHIRT; @@ -1201,6 +2280,8 @@ float(string itname) ItemIDOfName = return IID_CHEM_ADRENALINE; if (itname == "psycho") return IID_CHEM_PSYCHO; + if (itname == "rad-x") + return IID_CHEM_RADX; if (itname == "beserk") return IID_CHEM_BESERK; if (itname == "mr.ammo") @@ -1225,6 +2306,39 @@ float(string itname) ItemIDOfName = return IID_EQUIP_CLIMBINGGEAR; if (itname == "stealthboy") return IID_EQUIP_STEALTHBOY; + if (itname == "xray") + return IID_EQUIP_XRAY; + if (itname == "extender") + return IID_EQUIP_EXTENDER; + + if (itname == "nukacola") + return IID_MISC_NUKACOLA; + if (itname == "junk") + return IID_MISC_JUNK; + if (itname == "chemicals") + return IID_MISC_CHEMICALS; + if (itname == "aerosol") + return IID_MISC_AEROSOL; + if (itname == "rdx") + return IID_MISC_RDXCRYSTAL; + if (itname == "steelpipe") + return IID_MISC_STEELPIPE; + if (itname == "duct-tape") + return IID_MISC_DUCKTAPE; + if (itname == "lcd") + return IID_MISC_LCD; + if (itname == "circuit board") + return IID_MISC_CIRCUITBOARD; + if (itname == "copper wire") + return IID_MISC_COPPERWIRE; + if (itname == "nukacola") + return IID_MISC_NUKACOLA; + if (itname == "hmx compound") + return IID_MISC_HMXCOMPOUND; + if (itname == "chewing gum") + return IID_MISC_GUM; + if (itname == "x-ray tube") + return IID_MISC_XRAYTUBE; if (itname == "sprintkit") return IID_EQUIP_SPRINTKIT; @@ -1239,11 +2353,177 @@ float(string itname) ItemIDOfName = float(float slotno, float iid) FitsInSlot = { + if (IsEquip(iid)) + return false; + if (!iid) //nothing can be put in every slot. return true; if (slotno == 1 || slotno == 2) return IsShootable(iid); if (slotno == 3) return IsArmor(iid); + if (slotno == 4) + return IsEquip(iid); + if (slotno == 17) + return IsJunk(iid); + if (slotno == 18) + return IsJunk(iid); + if (slotno == 19) + return IsJunk(iid); + if (slotno == 20) + return IsJunk(iid); + if (slotno == 21) + return IsJunk(iid); + if (slotno == 22) + return IsJunk(iid); + if (slotno == 23) + return IsJunk(iid); + if (slotno == 24) + return IsJunk(iid); + return true; +}; + +string (float slot, float int) PerkName = +{ + if (int == 1) + return "unbreakable"; + if (int == 2) + return "feral swiftness"; + if (int == 3) + return "stunt man"; + if (int == 4) + return "kick in the door!"; + if (int == 5) + return "quick draw"; + if (int == 6) + return "light step"; + if (int == 7) + return "surprise attack"; + if (int == 8) + return "large and in charge"; + if (int == 9) + return "nintendo gamer"; + if (int == 10) + return "duck and cover"; + if (int == 11) + return "last man standing"; + if (int == 12) + return "bodysnatcher"; + if (int == 13) + return "natural aim"; + if (int == 14) + return "dark alchemist"; + if (int == 15) + return "commando"; + if (int == 16) + return "power shot"; + if (int == 17) + return "one in a million"; + if (int == 18) + return "master blaster"; + if (int == 19) + return "death wish"; +}; + +string(float int) GetPerkImage = +{ + if (int == 1) + return "gui/perks/ironman.jpg"; + else if (int == 2) + return "gui/perks/swiftness.jpg"; + else if (int == 3) + return "gui/perks/stuntman.jpg"; + else if (int == 4) + return "gui/perks/kickin.jpg"; + else if (int == 5) + return "gui/perks/quickdraw.jpg"; + else if (int == 6) + return "gui/perks/lightstep.jpg"; + else if (int == 7) + return "gui/perks/surprise.jpg"; + else if (int == 8) + return "gui/perks/large.jpg"; + else if (int == 9) + return "gui/perks/nintendo.jpg"; + else if (int == 10) + return "gui/perks/redscare.jpg"; + else if (int == 11) + return "gui/perks/lastman.jpg"; + else if (int == 12) + return "gui/perks/bodysnatcher.jpg"; + else if (int == 13) + return "gui/perks/sixthsense.jpg"; + else if (int == 14) + return "gui/perks/alchemist.jpg"; + else if (int == 15) + return "gui/perks/eastern.jpg"; + else if (int == 16) + return "gui/perks/powershot.jpg"; + else if (int == 17) + return "gui/perks/million.jpg"; + else if (int == 18) + return "gui/perks/demoman.jpg"; + else if (int == 19) + return "gui/perks/lightning.jpg"; + else + return "gui/perks/none.jpg"; + +}; + + +string(float int) GetPerkDesc = +{ + if (int == 1) + return "25% damage resist bonus while at half health"; + else if (int == 2) + return "provides a flat 10% bonus movement speed"; + else if (int == 3) + return "instant stance change, fast prone movement"; + else if (int == 4) + return "smash down locked doors and chests very loudly"; + else if (int == 5) + return "fast reloading, instant weapon switching"; + else if (int == 6) + return "reduced footsteps, +10% sneak, don't trip traps"; + else if (int == 7) + return "25% damage bonus to any enemy not targetting you"; + else if (int == 8) + return "gain melee knockback and berserker speed"; + else if (int == 9) + return "you'll sometimes enter 'the zone'!"; + else if (int == 10) + return "+25% miss chance when taking cover"; + else if (int == 11) + return "recover hit points as you mow down foes"; + else if (int == 12) + return "become a master of disguise by looting dead bodies"; + else if (int == 13) + return "you can perform quicker aimed shots"; + else if (int == 14) + return "mix chems together to make better ones"; + else if (int == 15) + return "you have mastered martial arts and kick attacks"; + else if (int == 16) + return "25% damage bonus to your aimed shots"; + else if (int == 17) + return "you sometimes get very, very lucky with anything"; + else if (int == 18) + return "bigger crosshairs means even bigger damage bonus"; + else if (int == 19) + return "20% damage bonus and you also take 20% more damage"; + else + return ""; + +}; + +float (float int) getperk = +{ + + if (self.perk1 == int) + return TRUE; + else if (self.perk2 == int) + return TRUE; + else + return FALSE; }; \ No newline at end of file diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index c8c319d2b..7d938a498 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -3,6 +3,9 @@ void() W_SetCurrentAmmo; BE .8 .3 .4 IN COLOR */ void(entity to, float iid, float count) AddStackable; +void (entity jeb, float time) spawn_excla; +void() AmmoTouch; +void() shop_face; void() SUB_regen = { @@ -12,10 +15,321 @@ void() SUB_regen = setorigin (self, self.origin); }; +float() crandom; +void () Levelshake = +{ + local entity te; + + te = findradius (self.origin, 1400); + while (te) + { + if (te.classname == "player") + stuffcmd (te, "v_idlescale 4\n"); + + if (te.classname == "monster") + te.alert = 120; + + te = te.chain; + } +}; + +void(vector pos) throw_debris = +{ + local entity tank, oself; + local float oldz; + + oself = self; + tank = spawn(); + self = tank; + + self.origin = pos; + + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_BOUNCE; + self.takedamage = DAMAGE_NO; + + if (random()<0.5) + setmodel (self, "progs/junk1.mdl"); + else + setmodel (self, "progs/junk2.mdl"); + + setsize (self, '0 0 0', '0 0 0'); + + self.velocity_y = random()*900 - random()*900; + self.velocity_x = random()*900 - random()*900; + self.velocity_z = 400 + random()*400; + + self.avelocity_x = random()*600; + self.avelocity_y = random()*600; + self.avelocity_z = random()*600; + + self.think = SUB_Remove; + self.nextthink = time + 2+random()*2; + + self = oself; + +}; + +void() fueltank_explode = +{ + throw_debris(self.origin); + throw_debris(self.origin); + throw_debris(self.origin); + throw_debris(self.origin); + throw_debris(self.origin); + + bprint(2, "an enemy fuel tank has been destroyed!\n"); + self.takedamage = DAMAGE_NO; + self.classname = "explo_box"; + Levelshake(); + T_RadiusDamage2 (self, self.owner, 50+random()*100, other, 200); + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_EXPLOSION); + WriteCoord (MSG_MULTICAST, self.origin_x); + WriteCoord (MSG_MULTICAST, self.origin_y); + WriteCoord (MSG_MULTICAST, self.origin_z+32); + multicast (self.origin, MULTICAST_PHS); + supplies = supplies - 1; + remove (self); +}; + +void(vector pos) FuelTankSmall = +{ + local entity item, oself; + precache_model ("maps/b_exbox2.bsp"); + + item = spawn(); + oself = self; + self = item; + setorigin (self, pos); + setmodel (self, "maps/b_exbox2.bsp"); + supplies += 1; + self.rtime = 1; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -16', '16 16 24'); + self.health = 50; + self.th_die = fueltank_explode; + self.takedamage = DAMAGE_AIM; + self.classname = "fueltank"; + self.netname = "fuel tank"; + self.movetype = MOVETYPE_STEP; + self = oself; +}; + +void() FuelTankLarge = +{ + local entity item, oself; + precache_model ("maps/b_explob.bsp"); + + item = spawn(); + oself = self; + self = item; + setmodel (self, "maps/b_explob.bsp"); + supplies += 1; + self.rtime = 1; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -16', '16 16 48'); + self.health = 50; + self.th_die = fueltank_explode; + self.takedamage = DAMAGE_AIM; + self.classname = "fueltank"; + self.netname = "fuel tank"; + self.movetype = MOVETYPE_STEP; + self = oself; +}; + + +void(vector pos) obj_fueltank = +{ + FuelTankLarge(); + + if (random()<0.25) + FuelTankSmall(pos + '0 64 0'); + if (random()<0.25) + FuelTankSmall(pos + '0 -64 0'); + if (random()<0.25) + FuelTankSmall(pos + '64 0 0'); + if (random()<0.25) + FuelTankSmall(pos + '-64 0 0'); +}; + + +void () food_touch = +{ + if (other.classname != "player") + return; + + if (self.rtime > 0) + { + self.rtime = 0; + bprint(2, "food crate has been secured.\n"); + + other.score = other.score + 10; + + if (random()<0.25) + sound (self, CHAN_BODY, "effects/radio1.wav", 1, ATTN_NONE); + else if (random()<0.25) + sound (self, CHAN_BODY, "effects/radio2.wav", 1, ATTN_NONE); + else if (random()<0.25) + sound (self, CHAN_BODY, "effects/radio3.wav", 1, ATTN_NONE); + else + sound (self, CHAN_BODY, "effects/radio4.wav", 1, ATTN_NONE); + + supplies = supplies - 1; + spawn_excla(self, 3000); + } + +}; + +void() FoodCrate = +{ + setmodel (self, "maps/crate.bsp"); + self.touch = food_touch; + supplies += 1; + self.rtime = 1; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 0', '16 16 16'); + self.takedamage = DAMAGE_NO; + self.touch = food_touch; + self.movetype = MOVETYPE_STEP; + self.classname = "foodcrate"; +}; + +void() treasure_touch = +{ + if (other.classname != "player") + return; + if (self.picking > 0) + return; + + if (self.attack_finished < time) + { + sound (self, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); + sprint(other, 2, "this metal box is locked.\n"); + if (other.class == 2 || other.class == 4) + { + sprint(other, 2, "you may attempt to pick this\n"); + sprint(other, 2, "by pressing your 'action' key\n"); + } + } + self.attack_finished = time + 2; + return; +}; + + +void() bomb_touch = +{ + if (other.classname != "player") + return; + if (self.picking > 0) + return; + + if (self.attack_finished < time) + { + sound (self, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); + sprint(other, 2, "this is a high-tech bomb.\n"); + if (other.class == 4) + { + sprint(other, 2, "you may attempt to deactivate this\n"); + sprint(other, 2, "bomb by pressing your 'action' key\n"); + } + } + self.attack_finished = time + 2; + return; +}; + +void() Explosive = +{ + if (random()*100<=25) + { + remove(self); + return; + } + + setmodel (self, "progs/bomb.mdl"); + self.touch = bomb_touch; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 0', '16 16 16'); + self.takedamage = DAMAGE_NO; + self.movetype = MOVETYPE_STEP; + self.classname = "bomb"; + droptofloor(); +}; + +void() TreasureChest = +{ + setorigin(self, self.origin + '0 0 64'); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_x = crandom()*200; + self.velocity_y = crandom()*200; + self.velocity_z = -200; + + self.avelocity_y = crandom()*200; + + setmodel (self, "progs/ammobox2.mdl"); + self.touch = treasure_touch; + self.solid = SOLID_BBOX; + setsize (self, '-12 -12 0', '12 12 12'); + self.takedamage = DAMAGE_NO; + self.classname = "treasure_chest"; +}; + +void() car_rock = +{ + self.frame = self.frame + 1; + + if (self.frame >= 11) + self.frame = 0; + + self.nextthink = time + 0.1 + (self.cnt*0.025); + self.think = car_rock; + self.cnt = self.cnt + 1; +}; + +void() car_rock2 = +{ + if (random()<0.5) + sound (self, CHAN_BODY, "effects/metal-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "effects/metal-2.wav", 1, ATTN_NORM); +}; + +void() car_touch = +{ + if (other.classname != "player") + return; + + if (self.attack_finished < time) + { + self.think = car_rock; + self.nextthink = time + 0.1; + self.cnt = 1; + } + self.attack_finished = time + 4; + return; +}; + +void() BlownUpCar = +{ + setmodel (self, "progs/BlownUp.mdl"); + self.origin = self.origin + '0 0 32'; + self.touch = car_touch; + self.solid = SOLID_SLIDEBOX; + self.helmet = 2; + setsize (self, '-32 -32 0', '32 32 32'); + self.islot3 = SlotVal(IID_ARM_METAL, 1); + self.takedamage = DAMAGE_AIM; + self.health = 90000; + self.th_pain = car_rock2; + self.movetype = MOVETYPE_BOUNCE; + self.classname = "car"; +}; /*QUAKED noclass (0 0 0) (-8 -8 -8) (8 8 8) prints a warning message when spawned +376 5857 +354 8501 */ void() noclass = { @@ -95,6 +409,182 @@ void(float timeleft) DropQuad = void() r_touch; +void () BombBeep = +{ + local float r; + + r = range (self.enemy); + + if (r != RANGE_MELEE || self.enemy.health <= 0) + { + self.owner.picking = 0; + self.enemy.picking = 0; + self.enemy.currentmenu = "none"; + remove(self.tumbler1); + remove(self.tumbler2); + remove(self); + return; + } + + self.inplace = 0; + self.tumbler1.inplace = 0; + self.tumbler2.inplace = 0; + self.model = ""; + self.tumbler1.model = ""; + self.tumbler2.model = ""; + + if (random() < 0.75) + { + self.inplace = 1; + self.model = "progs/radio.spr"; + } + if (random() < 0.75) + { + self.tumbler1.inplace = 1; + self.tumbler1.model = "progs/radio.spr"; + } + if (random() < 0.75) + { + self.tumbler2.inplace = 1; + self.tumbler2.model = "progs/radio.spr"; + } + + + self.think = BombBeep; + self.nextthink = time + 0.3+random()*0.6; + self.enemy.chest = self; + self.enemy.currentmenu = "menu_defuse"; + + if (random() < 0.5) + sound (self, CHAN_BODY, "items/lockpick1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "items/lockpick2.wav", 1, ATTN_NORM); + +}; + + +void (entity portal, entity toucher) SpawnBomb = +{ + local entity open, t1, t2; + + makevectors (toucher.v_angle); + + open = spawn(); + setmodel(open, "progs/radio.spr"); + setorigin (open, toucher.origin + '0 0 48' + v_forward*64); + setsize (open, VEC_ORIGIN, VEC_ORIGIN); + open.think = BombBeep; + open.nextthink = time + random()*0.2; + open.enemy = toucher; + open.owner = portal; + open.owner.rtime = 3; + + t1 = spawn(); + setmodel(t1, "progs/radio.spr"); + setorigin (t1, toucher.origin + '0 0 48' + v_forward*64 + v_right*32); + setsize (t1, VEC_ORIGIN, VEC_ORIGIN); + t1.enemy = toucher; + t1.owner = portal; + + t2 = spawn(); + setmodel(t2, "progs/radio.spr"); + setorigin (t2, toucher.origin + '0 0 48' + v_forward*64 - v_right*32); + setsize (t2, VEC_ORIGIN, VEC_ORIGIN); + t2.enemy = toucher; + t2.owner = portal; + + open.tumbler1 = t1; + open.tumbler2 = t2; +}; + +void () OpenChestBeep = +{ + local float r; + + r = range (self.enemy); + + if (r != RANGE_MELEE || self.enemy.health <= 0) + { + self.owner.picking = 0; + self.enemy.picking = 0; + self.enemy.currentmenu = "none"; + remove(self.tumbler1); + remove(self.tumbler2); + remove(self); + return; + } + + self.inplace = 0; + self.tumbler1.inplace = 0; + self.tumbler2.inplace = 0; + self.model = ""; + self.tumbler1.model = ""; + self.tumbler2.model = ""; + + if (random() < 0.5) + { + self.inplace = 1; + self.model = "progs/radio.spr"; + } + if (random() < 0.5) + { + self.tumbler1.inplace = 1; + self.tumbler1.model = "progs/radio.spr"; + } + if (random() < 0.5) + { + self.tumbler2.inplace = 1; + self.tumbler2.model = "progs/radio.spr"; + } + + + self.think = OpenChestBeep; + self.nextthink = time + 0.2+random()*0.4; + self.enemy.chest = self; + self.enemy.currentmenu = "menu_lockpick"; + + if (random() < 0.5) + sound (self, CHAN_BODY, "items/lockpick1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "items/lockpick2.wav", 1, ATTN_NORM); + +}; + + +void (entity portal, entity toucher) SpawnOpenChest = +{ + local entity open, t1, t2; + + makevectors (toucher.v_angle); + + open = spawn(); + setmodel(open, "progs/radio.spr"); + setorigin (open, toucher.origin + '0 0 48' + v_forward*64); + setsize (open, VEC_ORIGIN, VEC_ORIGIN); + open.think = OpenChestBeep; + open.nextthink = time + random()*0.2; + open.enemy = toucher; + open.owner = portal; + + t1 = spawn(); + setmodel(t1, "progs/radio.spr"); + setorigin (t1, toucher.origin + '0 0 48' + v_forward*64 + v_right*32); + setsize (t1, VEC_ORIGIN, VEC_ORIGIN); + t1.enemy = toucher; + t1.owner = portal; + + t2 = spawn(); + setmodel(t2, "progs/radio.spr"); + setorigin (t2, toucher.origin + '0 0 48' + v_forward*64 - v_right*32); + setsize (t2, VEC_ORIGIN, VEC_ORIGIN); + t2.enemy = toucher; + t2.owner = portal; + + open.tumbler1 = t1; + open.tumbler2 = t2; +}; + + void() r_touch = { local string s; @@ -235,39 +725,27 @@ void() item_megahealth_rot; void() item_health = { - self.touch = health_touch; - if (self.spawnflags & H_ROTTEN) - { - precache_model("maps/b_bh10.bsp"); - - precache_sound("items/r_item1.wav"); - setmodel(self, "maps/b_bh10.bsp"); - self.noise = "items/r_item1.wav"; - self.healamount = 15; - self.healtype = 0; - } - else if (self.spawnflags & H_MEGA) - { - precache_model("maps/b_bh100.bsp"); - precache_sound("items/r_item2.wav"); - setmodel(self, "maps/b_bh100.bsp"); - self.noise = "items/r_item2.wav"; - self.healamount = 100; - self.healtype = 2; - } + TreasureChest(); else { + if (random()*100<=75) + { + remove(self); + return; + } + + self.touch = health_touch; precache_model("maps/b_bh25.bsp"); precache_sound("items/health1.wav"); setmodel(self, "maps/b_bh25.bsp"); self.noise = "items/health1.wav"; self.healamount = 25; self.healtype = 1; + setsize (self, '0 0 0', '32 32 56'); + StartItem (); } - setsize (self, '0 0 0', '32 32 56'); - StartItem (); }; @@ -275,14 +753,21 @@ float (entity to, float iid, float quant) TryGiveStackable = { local float slot; local float item; + local float x; + + x = 300; + + if (ToIID(self.islot4) == IID_EQUIP_BACKPACK) + x = 600; + slot = SlotOfItem(to, iid); - if (slot > 2) + if (slot > 4) { item = ItemInSlot(to, slot); - if (ToStatus(item) + quant > 500) //500 is our maxstack value here + if (ToStatus(item) + quant > x) //300 is our maxstack value here { - quant = quant + ToStatus(item) - 500; - SetItemSlot(to, slot, SlotVal(iid, 500)); + quant = quant + ToStatus(item) - x; + SetItemSlot(to, slot, SlotVal(iid, x)); slot = 0; return false; } @@ -303,6 +788,7 @@ float (entity to, float iid, float quant) TryGiveStackable = return true; }; + void () health_touch = { if (!triggercantouch(self, other)) @@ -319,13 +805,9 @@ void () health_touch = if (other.ghost != 0) return; - if (!TryGiveStackable(other, IID_CHEM_STIMPACK, 1)) - { - if (self.spamdelay < time) - sprint(other, 2, "full inventory.\n"); - self.spamdelay = time + 1; + if (!TryGiveStackable(other, IID_CHEM_STIMPACK, 1)) return; - } + sprint (other, PRINT_HIGH, "picked up a stimpack.\n"); if (random()*4 <= 2) @@ -434,7 +916,22 @@ void() armor_touch = /*QUAKED item_armor1 (0 .5 .8) (-16 -16 0) (16 16 32) */ -void() item_armor1_finish = +void() buyzone1 = +{ + SUB_UseTargets (); + + + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/enforcer.mdl"); + self.skin = 0; + setsize (self, '-16 -16 -24', '16 16 32'); + setorigin(self, self.origin + '0 0 24'); + self.classname = "merchant"; +}; + +void() buyzone2 = { SUB_UseTargets (); @@ -447,11 +944,31 @@ void() item_armor1_finish = setorigin(self, self.origin + '0 0 24'); self.classname = "merchant"; }; + +void() item_armor1_finish = +{ + SUB_UseTargets (); + + + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/enforcer.mdl"); + self.skin = 0; + setsize (self, '-16 -16 -24', '16 16 32'); + setorigin(self, self.origin + '0 0 24'); + self.classname = "merchant"; + self.think = shop_face; + self.nextthink = time + 0.5; +}; void() item_armor1 = { - precache_model ("progs/enforcer.mdl"); - self.think = item_armor1_finish; - self.nextthink = time + 0.1; + if (random()<0.50) + { + precache_model ("progs/enforcer.mdl"); + self.think = item_armor1_finish; + self.nextthink = time + 0.1; + } }; /*QUAKED item_armor2 (0 .5 .8) (-16 -16 0) (16 16 32) @@ -459,12 +976,19 @@ void() item_armor1 = void() item_armor2 = { - self.touch = armor_touch; - precache_model ("progs/armor.mdl"); - setmodel (self, "progs/armor.mdl"); - self.skin = 1; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); + if (random()<0.50) + { + precache_model ("progs/enforcer.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + setmodel (self, "progs/enforcer.mdl"); + self.skin = 0; + setsize (self, '-16 -16 -24', '16 16 32'); + setorigin(self, self.origin + '0 0 24'); + self.classname = "merchant"; + self.think = shop_face; + self.nextthink = time + 0.5; + } }; /*QUAKED item_armorInv (0 .5 .8) (-16 -16 0) (16 16 32) @@ -472,12 +996,19 @@ void() item_armor2 = void() item_armorInv = { - self.touch = armor_touch; - precache_model ("progs/armor.mdl"); - setmodel (self, "progs/armor.mdl"); - self.skin = 2; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); + if (random()<0.50) + { + precache_model ("progs/enforcer.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + setmodel (self, "progs/enforcer.mdl"); + self.skin = 0; + setsize (self, '-16 -16 -24', '16 16 32'); + setorigin(self, self.origin + '0 0 24'); + self.classname = "merchant"; + self.think = shop_face; + self.nextthink = time + 0.5; + } }; /* @@ -490,14 +1021,7 @@ WEAPONS void() bound_other_ammo = { - if (other.ammo_shells > 100) - other.ammo_shells = 100; - if (other.ammo_nails > 200) - other.ammo_nails = 200; - if (other.ammo_rockets > 100) - other.ammo_rockets = 100; - if (other.ammo_cells > 100) - other.ammo_cells = 100; + }; @@ -696,21 +1220,20 @@ void() weapon_touch = }; +void(vector place) hostage_new; + /*QUAKED weapon_supershotgun (0 .5 .8) (-16 -16 0) (16 16 32) */ + + void() weapon_supershotgun = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_shot.mdl"); - setmodel (self, "progs/g_shot.mdl"); - self.weapon = IT_SUPER_SHOTGUN; - self.netname = "Double-barrelled Shotgun"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + //weapon spawns are now either treasure chests + //or hostages that need to be rescued + + if (random()<0.25) + TreasureChest(); }; /*QUAKED weapon_nailgun (0 .5 .8) (-16 -16 0) (16 16 32) @@ -718,16 +1241,14 @@ if (deathmatch <= 3) void() weapon_nailgun = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_nail.mdl"); - setmodel (self, "progs/g_nail.mdl"); - self.weapon = IT_NAILGUN; - self.netname = "nailgun"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + if (world.map_obj == 2) + FoodCrate(); + else if (world.map_obj == 5) + obj_fueltank(self.origin); + else if (world.map_obj == 6) + Explosive(); + else + TreasureChest(); }; /*QUAKED weapon_supernailgun (0 .5 .8) (-16 -16 0) (16 16 32) @@ -735,16 +1256,14 @@ if (deathmatch <= 3) void() weapon_supernailgun = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_nail2.mdl"); - setmodel (self, "progs/g_nail2.mdl"); - self.weapon = IT_SUPER_NAILGUN; - self.netname = "Super Nailgun"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + if (world.map_obj == 2) + FoodCrate(); + else if (world.map_obj == 5) + obj_fueltank(self.origin); + else if (world.map_obj == 6) + Explosive(); + else if (random()*100 <= 40) + TreasureChest(); }; /*QUAKED weapon_grenadelauncher (0 .5 .8) (-16 -16 0) (16 16 32) @@ -752,16 +1271,16 @@ if (deathmatch <= 3) void() weapon_grenadelauncher = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_rock.mdl"); - setmodel (self, "progs/g_rock.mdl"); - self.weapon = 3; - self.netname = "Grenade Launcher"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + + if (world.map_obj == 2) + FoodCrate(); + else if (world.map_obj == 5) + obj_fueltank(self.origin); + else if (world.map_obj == 6) + Explosive(); + else if (random()*100 <= 40) + TreasureChest(); + }; /*QUAKED weapon_rocketlauncher (0 .5 .8) (-16 -16 0) (16 16 32) @@ -769,16 +1288,15 @@ if (deathmatch <= 3) void() weapon_rocketlauncher = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_rock2.mdl"); - setmodel (self, "progs/g_rock2.mdl"); - self.weapon = 3; - self.netname = "Rocket Launcher"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + if (world.map_obj == 2) + FoodCrate(); + else if (world.map_obj == 5) + obj_fueltank(self.origin); + else if (world.map_obj == 6) + Explosive(); + else if (random()*100 <= 40) + TreasureChest(); + }; @@ -787,16 +1305,16 @@ if (deathmatch <= 3) void() weapon_lightning = { -if (deathmatch <= 3) -{ - precache_model ("progs/g_light.mdl"); - setmodel (self, "progs/g_light.mdl"); - self.weapon = 3; - self.netname = "Thunderbolt"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); - StartItem (); -} + + if (world.map_obj == 2) + FoodCrate(); + else if (world.map_obj == 5) + obj_fueltank(self.origin); + else if (world.map_obj == 6) + Explosive(); + else if (random()*100 <= 40) + TreasureChest(); + }; @@ -812,29 +1330,30 @@ float() GetRandomAmmo = { local float r; - r = random()*20; + r = random()*42; - if (r <= 2) - return IID_AM_NEEDLER; - else if (r <= 6) + if (r <= 5) return IID_AM_10MM; - else if (r <= 8) - return IID_AM_556MM; else if (r <= 10) - return IID_AM_5MMHIGHVEL; - else if (r <= 13) - return IID_AM_12GAUGESHELLS; - else if (r <= 14) - return IID_AM_ENERGYCELL; + return IID_AM_45ACP; else if (r <= 15) - return IID_AM_2MMEC; - else if (r <= 16) - return IID_AM_762MM; - else if (r <= 18) + return IID_AM_12GAUGESHELLS; + else if (r <= 20) return IID_AM_44MAGNUM; + else if (r <= 24) + return IID_AM_556MM; + else if (r <= 28) + return IID_AM_5MMHIGHVEL; + else if (r <= 32) + return IID_AM_762MM; + else if (r <= 36) + return IID_AM_NEEDLER; + else if (r <= 38) + return IID_AM_ENERGYCELL; + else if (r <= 40) + return IID_AM_2MMEC; else - return IID_AM_10MM; - + return IID_AM_CASELESS; }; float(float ammotype) GetAmmoCount = @@ -844,11 +1363,11 @@ float(float ammotype) GetAmmoCount = if (ammotype == IID_AM_NEEDLER) ammocount = 2 + random()*7; if (ammotype == IID_AM_10MM) - ammocount = 5 + random()*10; + ammocount = 5 + random()*5; if (ammotype == IID_AM_556MM) ammocount = 3 + random()*8; if (ammotype == IID_AM_5MMHIGHVEL) - ammocount = 5 + random()*10; + ammocount = 5 + random()*8; if (ammotype == IID_AM_12GAUGESHELLS) ammocount = 2 + random()*6; if (ammotype == IID_AM_ENERGYCELL) @@ -899,6 +1418,10 @@ void() ammo_touch = ammoname = GetItemName(ammotype); ammocountftos = ftos(ammocount); + if (random()*4 <= 2) + sound (other, CHAN_ITEM, "misc/item1.wav", 1, ATTN_NORM); + else + sound (other, CHAN_ITEM, "misc/item2.wav", 1, ATTN_NORM); // shotgun if (self.weapon == 1) @@ -912,11 +1435,8 @@ void() ammo_touch = if (random()*20 <= 10) { - other.ammo_shells = other.ammo_shells + 2; - if (coop == 1 && total_players == 1) - other.ammo_shells = other.ammo_shells + 2; - - sprint (other, 2, " and bottle caps.\n"); + other.ammo_shells = other.ammo_shells + ceil(10+random()*10); + sprint (other, 2, "& money.\n"); } else sprint (other, 2, "\n"); @@ -935,8 +1455,8 @@ void() ammo_touch = if (random()*20 <= 10) { - other.ammo_shells = other.ammo_shells + 2; - sprint (other, 2, " and bottle caps.\n"); + other.ammo_shells = other.ammo_shells + ceil(10+random()*10); + sprint (other, 2, " & money.\n"); } else sprint (other, 2, "\n"); @@ -954,8 +1474,8 @@ void() ammo_touch = if (random()*20 <= 10) { - other.ammo_shells = other.ammo_shells + 2; - sprint (other, 2, " and bottle caps.\n"); + other.ammo_shells = other.ammo_shells + ceil(5+random()*25); + sprint (other, 2, " & money.\n"); } else sprint (other, 2, "\n"); @@ -974,8 +1494,8 @@ void() ammo_touch = if (random()*20 <= 10) { - other.ammo_shells = other.ammo_shells + 2; - sprint (other, 2, " and bottle caps.\n"); + other.ammo_shells = other.ammo_shells + ceil(5+random()*25); + sprint (other, 2, " & money.\n"); } else sprint (other, 2, "\n"); @@ -1031,7 +1551,14 @@ void() item_shells = if (coop == 1 && random()*4 <= 2) return; - self.touch = ammo_touch; + self.islot1 = GetRandomAmmo(); + self.islot1 = self.islot1 * 512; + self.flash = ceil(random()*30); + self.touch = AmmoTouch; + if (random()<0.5) + self.islot2 = ceil(random()*20); + + if (self.spawnflags & WEAPON_BIG2) { @@ -1062,7 +1589,13 @@ void() item_spikes = if (coop == 1 && random()*4 <= 1) return; - self.touch = ammo_touch; + self.islot1 = GetRandomAmmo(); + self.islot1 = self.islot1 * 512; + self.flash = ceil(random()*30); + self.touch = AmmoTouch; + if (random()<0.5) + self.islot2 = ceil(random()*20); + if (self.spawnflags & WEAPON_BIG2) { @@ -1094,7 +1627,13 @@ void() item_rockets = if (coop == 1 && random()*4 <= 3) return; - self.touch = ammo_touch; + self.islot1 = GetRandomAmmo(); + self.islot1 = self.islot1 * 512; + self.flash = ceil(random()*30); + self.touch = AmmoTouch; + if (random()<0.5) + self.islot2 = ceil(random()*20); + if (self.spawnflags & WEAPON_BIG2) { @@ -1127,7 +1666,13 @@ void() item_cells = if (coop == 1 && random()*4 <= 2) return; - self.touch = ammo_touch; + self.islot1 = GetRandomAmmo(); + self.islot1 = self.islot1 * 512; + self.flash = ceil(random()*30); + self.touch = AmmoTouch; + if (random()<0.5) + self.islot2 = ceil(random()*20); + if (self.spawnflags & WEAPON_BIG2) { @@ -1162,11 +1707,16 @@ void() item_weapon = if (coop == 1 && random()*4 <= 3) return; - self.touch = ammo_touch; - - precache_model ("maps/b_shell0.bsp"); - setmodel (self, "maps/b_shell0.bsp"); + self.islot1 = GetRandomAmmo(); + self.islot1 = self.islot1 * 512; + self.flash = ceil(random()*30); + self.touch = AmmoTouch; + if (random()<0.5) + self.islot2 = ceil(random()*20); + precache_model ("progs/ammobox.mdl"); + setmodel (self, "progs/ammobox.mdl"); + self.skin = 2; setsize (self, '0 0 0', '32 32 56'); StartItem (); @@ -1479,17 +2029,8 @@ Player takes no damage from water or slime for 30 seconds */ void() item_artifact_envirosuit = { - self.touch = powerup_touch; - - precache_model ("progs/suit.mdl"); - precache_sound ("items/suit.wav"); - precache_sound ("items/suit2.wav"); - self.noise = "items/suit.wav"; - setmodel (self, "progs/suit.mdl"); - self.netname = "Biosuit"; - self.items = IT_SUIT; - setsize (self, '-16 -16 -24', '16 16 32'); - StartItem (); + remove(self); + return; }; @@ -1498,18 +2039,8 @@ Player is invisible for 30 seconds */ void() item_artifact_invisibility = { - self.touch = powerup_touch; - - precache_model ("progs/invisibl.mdl"); - precache_sound ("items/inv1.wav"); - precache_sound ("items/inv2.wav"); - precache_sound ("items/inv3.wav"); - self.noise = "items/inv1.wav"; - setmodel (self, "progs/invisibl.mdl"); - self.netname = "Ring of Shadows"; - self.items = IT_INVISIBILITY; - setsize (self, '-16 -16 -24', '16 16 32'); - StartItem (); + remove(self); + return; }; @@ -1518,22 +2049,8 @@ The next attack from the player will do 4x damage */ void() item_artifact_super_damage = { - self.touch = powerup_touch; - precache_model ("progs/quaddama.mdl"); - precache_sound ("items/damage.wav"); - precache_sound ("items/damage2.wav"); - precache_sound ("items/damage3.wav"); - self.noise = "items/damage.wav"; - setmodel (self, "progs/quaddama.mdl"); - if (deathmatch == 4) - self.netname = "OctaPower"; - else - self.netname = "Quad Damage"; - self.items = IT_QUAD; - self.effects = self.effects | EF_BLUE; - setsize (self, '-16 -16 -24', '16 16 32'); - StartItem (); + remove(self); }; @@ -1558,22 +2075,22 @@ void() BackpackTouch = if (self.weapon == 1) { - TryGiveStackable(other, IID_AM_10MM, floor(9+random()*9)); + TryGiveStackable(other, IID_AM_10MM, floor(9+random()*20)); sprint(other, 2, " 10mm ammo"); } else if (self.weapon == 2) { - TryGiveStackable(other, IID_AM_556MM, floor(5+random()*5)); + TryGiveStackable(other, IID_AM_556MM, floor(5+random()*15)); sprint(other, 2, " 5mm ammo"); } else if (self.weapon == 3) { - TryGiveStackable(other, IID_AM_12GAUGESHELLS, floor(3+random()*3)); + TryGiveStackable(other, IID_AM_12GAUGESHELLS, floor(3+random()*6)); sprint(other, 2, " 12 gauge ammo"); } else if (self.weapon == 4) { - TryGiveStackable(other, IID_AM_10MM, floor(9+random()*9)); + TryGiveStackable(other, IID_AM_10MM, floor(9+random()*20)); sprint(other, 2, " 10mm ammo"); } else @@ -1583,16 +2100,15 @@ void() BackpackTouch = ammoname = GetItemName(ammotype); sprint(other, 2, " "); sprint(other, 2, ammoname); + TryGiveStackable(other, ammotype, ammocount); } if (random()*4 <= 2) { - self.ammo_shells = self.ammo_shells + 3; - sprint(other, 2, " and some caps.\n"); - if (total_players == 1) - self.ammo_shells = self.ammo_shells + 3; + other.ammo_shells = other.ammo_shells + ceil(5+random()*20); + sprint(other, 2, " & money.\n"); } else sprint(other, 2, ".\n"); @@ -1601,12 +2117,28 @@ void() BackpackTouch = return; }; + /* =============== -DropBackpack +DropMoney =============== */ -void() DropBackpack = + +void() MoneyTouch = +{ + if (other.classname != "player") + return; + + if (other.health <= 0) + return; + + sound (self, CHAN_VOICE, "items/item1.wav", 1, ATTN_IDLE); + sprint(other, 2, "a small amount of wasteland currency.\n"); + other.ammo_shells += self.islot1; + remove(self); +}; + +void() DropMoney = { local entity item; @@ -1622,10 +2154,49 @@ void() DropBackpack = item.flags = FL_ITEM; item.solid = SOLID_TRIGGER; item.movetype = MOVETYPE_TOSS; - setmodel (item, "progs/backpack.mdl"); + setmodel (item, "progs/money.mdl"); setsize (item, '-16 -16 0', '16 16 56'); - item.touch = BackpackTouch; - + item.islot1 = 2 + random()*5; + item.skin = ToIID(item.islot1) - 506; + + item.touch = MoneyTouch; + + item.nextthink = time + 120; // remove after 2 minutes + item.think = SUB_Remove; +}; + + +/* +=============== +DropBackpack +=============== +*/ +void() DropBackpack = +{ + local entity item; + + + item = spawn(); + item.origin = self.origin - '0 0 24'; + + item.weapon = self.weapon; + + item.velocity_z = 300; + item.velocity_x = -100 + (random() * 200); + item.velocity_y = -100 + (random() * 200); + + item.flags = FL_ITEM; + item.solid = SOLID_TRIGGER; + item.movetype = MOVETYPE_TOSS; + setmodel (item, "progs/ammobox.mdl"); + setsize (item, '-16 -16 0', '16 16 56'); + item.islot1 = GetRandomAmmo(); + item.islot1 = item.islot1 * 512; + item.skin = ToIID(item.islot1) - 506; + + item.flash = ceil(random()*30); + item.touch = AmmoTouch; + item.nextthink = time + 120; // remove after 2 minutes item.think = SUB_Remove; }; diff --git a/quakec/fallout2/knight.qc b/quakec/fallout2/knight.qc index 8baa4a0a7..2f21e509f 100644 --- a/quakec/fallout2/knight.qc +++ b/quakec/fallout2/knight.qc @@ -45,6 +45,18 @@ $frame death9 death10 $frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 $frame deathb9 deathb10 deathb11 +void() go_invisible = +{ + setmodel (self, ""); + sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); +}; + +void() go_visible = +{ + setmodel (self, "progs/knight.mdl"); + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); +}; + void() knight_stand1 =[ $stand1, knight_stand2 ] {ai_stand();}; void() knight_stand2 =[ $stand2, knight_stand3 ] {ai_stand();}; void() knight_stand3 =[ $stand3, knight_stand4 ] {ai_stand();}; @@ -75,16 +87,18 @@ void() knight_walk14 =[ $walk14, knight_walk1 ] {ai_walk(3);}; void() knight_run1 =[ $runb1, knight_run2 ] { -if (random() < 0.2) +if ((random() < 0.6) && self.model != "") + go_invisible(); +else if (random() < 0.2) sound (self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE); -ai_run(16);}; -void() knight_run2 =[ $runb2, knight_run3 ] {ai_run(20);}; -void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(13);}; -void() knight_run4 =[ $runb4, knight_run5 ] {ai_run(7);}; -void() knight_run5 =[ $runb5, knight_run6 ] {ai_run(16);}; -void() knight_run6 =[ $runb6, knight_run7 ] {ai_run(20);}; -void() knight_run7 =[ $runb7, knight_run8 ] {ai_run(14);}; -void() knight_run8 =[ $runb8, knight_run1 ] {ai_run(6);}; +ai_run(21);}; +void() knight_run2 =[ $runb2, knight_run3 ] {ai_run(25);}; +void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(18);}; +void() knight_run4 =[ $runb4, knight_run5 ] {ai_run(12);}; +void() knight_run5 =[ $runb5, knight_run6 ] {ai_run(21);}; +void() knight_run6 =[ $runb6, knight_run7 ] {ai_run(25);}; +void() knight_run7 =[ $runb7, knight_run8 ] {ai_run(19);}; +void() knight_run8 =[ $runb8, knight_run1 ] {ai_run(11);}; void() knight_runatk1 =[ $runattack1, knight_runatk2 ] @@ -94,6 +108,7 @@ if (random() > 0.5) else sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); ai_charge(20); +go_visible(); }; void() knight_runatk2 =[ $runattack2, knight_runatk3 ] {ai_charge_side();}; void() knight_runatk3 =[ $runattack3, knight_runatk4 ] {ai_charge_side();}; @@ -108,23 +123,71 @@ void() knight_runatk11 =[ $runattack11, knight_run1 ] {ai_charge(10);}; void() knight_atk1 =[ $attackb1, knight_atk2 ] { + +if (self.takedamage == DAMAGE_NO) +{ + remove(self); + return; +} + sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); -ai_charge(0);}; -void() knight_atk2 =[ $attackb2, knight_atk3 ] {ai_charge(7);}; -void() knight_atk3 =[ $attackb3, knight_atk4 ] {ai_charge(4);}; -void() knight_atk4 =[ $attackb4, knight_atk5 ] {ai_charge(0);}; -void() knight_atk5 =[ $attackb5, knight_atk6 ] {ai_charge(3);}; -void() knight_atk6 =[ $attackb6, knight_atk7 ] {ai_charge(4); ai_melee();}; -void() knight_atk7 =[ $attackb7, knight_atk8 ] {ai_charge(1); ai_melee();}; -void() knight_atk8 =[ $attackb8, knight_atk9 ] {ai_charge(3); +ai_charge(0); +go_visible(); +}; +void() knight_atk2 =[ $attackb2, knight_atk3 ] {ai_charge(9);}; +void() knight_atk3 =[ $attackb3, knight_atk4 ] {ai_charge(6);}; +void() knight_atk4 =[ $attackb4, knight_atk5 ] {ai_charge(2);}; +void() knight_atk5 =[ $attackb5, knight_atk6 ] {ai_charge(5);}; +void() knight_atk6 =[ $attackb6, knight_atk7 ] {ai_charge(6); ai_melee();}; +void() knight_atk7 =[ $attackb7, knight_atk8 ] {ai_charge(3); ai_melee();}; +void() knight_atk8 =[ $attackb8, knight_atk9 ] {ai_charge(5); ai_melee();}; -void() knight_atk9 =[ $attackb9, knight_atk10] {ai_charge(1);}; -void() knight_atk10=[ $attackb10, knight_run1 ] {ai_charge(5);}; +void() knight_atk9 =[ $attackb9, knight_atk10] {ai_charge(3);}; +void() knight_atk10=[ $attackb10, knight_run1 ] {ai_charge(9);}; //void() knight_atk9 =[ $attack9, knight_atk10 ] {}; //void() knight_atk10 =[ $attack10, knight_atk11 ] {}; //void() knight_atk11 =[ $attack11, knight_run1 ] {}; + + +void() knight_laser = +{ + local vector offang; + local vector org, vec; + + offang = vectoangles (self.enemy.origin - self.origin); + + makevectors (offang); + + org = self.origin + self.mins + self.size*0.5 + v_forward * 20; + +// set missile speed + vec = normalize (v_forward); + vec_z = 0 - vec_z + (random() - 0.5)*0.1; + + launch_spike (org, vec); + newmis.classname = "knightspike"; + setmodel (newmis, "progs/k_spike.mdl"); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.velocity = vec*300; + sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM); +}; + + +void() knight_ratk1 =[ $attackb1, knight_ratk2 ] {}; +void() knight_ratk2 =[ $attackb2, knight_ratk3 ] {}; +void() knight_ratk3 =[ $attackb3, knight_ratk4 ] {}; +void() knight_ratk4 =[ $attackb4, knight_ratk5 ] {}; +void() knight_ratk5 =[ $attackb5, knight_ratk6 ] {}; +void() knight_ratk6 =[ $attackb6, knight_ratk7 ] {}; +void() knight_ratk7 =[ $attackb7, knight_ratk8 ] { +knight_laser(); +}; +void() knight_ratk8 =[ $attackb8, knight_ratk9 ] {}; +void() knight_ratk9 =[ $attackb9, knight_ratk10 ] {}; +void() knight_ratk10 =[ $attackb10, knight_run1 ] {}; + //=========================================================================== void() knight_pain1 =[ $pain1, knight_pain2 ] {}; @@ -166,6 +229,7 @@ void(entity attacker, float damage) knight_pain = }; + //=========================================================================== void() knight_bow1 =[ $kneel1, knight_bow2 ] {ai_turn();}; @@ -233,13 +297,15 @@ void() knight_die = void() monster_knight = { - if (deathmatch) + if (self.zone == 0) { - remove(self); + load_monster(); return; } + precache_model ("progs/knight.mdl"); precache_model ("progs/h_knight.mdl"); + precache_model ("progs/k_spike.mdl"); precache_sound ("knight/kdeath.wav"); precache_sound ("knight/khurt.wav"); @@ -255,14 +321,15 @@ void() monster_knight = setsize (self, '-16 -16 -24', '16 16 40'); self.health = 75; - + self.islot3 = SlotVal(IID_ARM_METAL, 1); + self.armornoise = "weapons/ric1.wav"; self.th_stand = knight_stand1; self.th_walk = knight_walk1; self.th_run = knight_run1; self.th_melee = knight_atk1; self.th_pain = knight_pain; self.th_die = knight_die; - self.armornoise = "weapons/ric1.wav"; - + self.classname = "monster"; + self.netname = "reaver"; walkmonster_start (); }; diff --git a/quakec/fallout2/menus.qc b/quakec/fallout2/menus.qc index 0f9998670..6953b3c8b 100644 --- a/quakec/fallout2/menus.qc +++ b/quakec/fallout2/menus.qc @@ -36,12 +36,12 @@ weaponry\n\n string () ShopString = { - return ("--- S H O P -------\n" + return ("‘‘‘ supply merchant ‘‘‘\n" "\n" - "1‘ traits \n" - "2‘ perks \n" + "1‘ perk [slot 1] \n" + "2‘ perk [slot 2] \n" "3‘ body armour \n" - "4‘ protection \n" + "4‘ ammunition \n" "5‘ weapons \n" "6‘ equipment \n" "7‘ chems \n" @@ -54,7 +54,7 @@ string () WeaponString = return ("weaponry\n" "\n" "1‘ melee \n" - "2‘ thrown \n" + "2‘ explosives \n" "3‘ pistols&smgs \n" "4‘ shotguns \n" "5‘ rifles \n" @@ -66,36 +66,41 @@ string () TraitString = { return ("traits\n" "\n" - "1‘ one handed \n" - "2‘ small frame \n" - "3‘ bruiser \n" - "4‘ heavy handed \n" - "5‘ bloody mess \n" - "6‘ bad luck \n" - "e‘ leave \n"); + "1‘ unidextrous \n" + "2‘ ruthless \n" + "3‘ chem addict \n" + "4‘ red scare \n" + "5‘ living lightning \n" + "6‘ one in a million \n" + "e‘ leave \n"); }; + string () ThrownString = { - return ("grenades\n" - " GRENADE | COST \n" + return ("!‘ explosives !‘\n" "\n" - "1‘ smoke grenade 3$\n" - "2‘ frag grenade 4$\n" - "3‘ emp grenade 5$\n" - "4‘ flashbang 7$\n" - "e‘ exit \n"); + "1‘ flash bomb 8$\n" + "2‘ frag grenade 12$\n" + "3‘ ultra-light necklace 3$\n" + "4‘ hmx compound 2$\n" + "5‘ rdx crystals 2$\n" + "6‘ explosive rocket 10$\n" + "e‘ exit \n"); }; string () BuildString = { return ("BUILD A STRUCTURE\n" - " NAME | UPGRADE | SCRAPS\n" + " NAME COST IN JUNK\n" "\n" - "1‘ Mr. Ammo 4\n" - "2‘ Barricade 6\n" - "3‘ AutoDoc(tm) 10\n" - "4‘ Robo-Fang 11\n" + "1‘ Super Flash Bomb 4\n" + "2‘ Homemade Grenade 5\n" + "3‘ Needler Scope 5\n" + "4‘ Ghost Goggles 7\n" + "5‘ Gas Bomb 10\n" + "6‘ Deflector Ring 15\n" + "7‘ Auto-Doc 20\n" "e‘ exit \n"); }; @@ -116,45 +121,75 @@ string () ArmorString = { return ("body armour wt abs prc\n" "\n" - "1‘ light kevlar 03 1/20% 03$\n" - "2‘ leather armor 05 2/30% 08$\n" - "3‘ kevlar armor 09 3/35% 10$\n" - "4‘ metal armor 15 5/35% 12$\n" - "5‘ combat armor 12 4/40% 25$\n" - "6‘ brotherhood armor 17 5/45% 35$\n" - "7‘ force armor 06 7/10% 45$\n" - "8‘ metal armor mkii 20 8/50% 55$\n"); + "1‘ kevlar shirt 04 1/25% 50$\n" + "2‘ leather armor 07 3/30% 100$\n" + "3‘ double kevlar 09 1/50% 125$\n" + "4‘ ceramic armor 15 7/25% 150$\n" + "5‘ combat armor 12 6/40% 200$\n" + "6‘ brotherhood 17 7/45% 250$\n" + "7‘ force armor 06 9/15% 300$\n" + "8‘ power armor 25 8/50% 400$\n"); }; string () PerkString = { return ("perks\n" - " ABILITY | FRAGS NEEDED \n" "\n" - "1‘ bonus movement 2\n" - "2‘ strong back 2\n" - "3‘ quick pockets 2\n" - "4‘ awareness 2\n" - "5‘ silent running 3\n" - "6‘ better criticals 3\n" - "7‘ bonus ranged damage 3\n" - "8‘ divine favor 3\n" - "9‘ slayer 3\n" - "0‘ sharpshooter 4\n"); + " 1‘ unbreakable \n" + " 2‘ feral swiftness \n" + " 3‘ stunt man \n" + " 4‘ kick in the door! \n" + " 5‘ quick draw \n" + " 6‘ light step \n" + " 7‘ surprise attack \n" + " 8‘ large and in charge \n" + " 9‘ nintendo gamer \n" + " 0‘ extrasensory paranoia\n" + "F1‘ last man standing \n" + "F2‘ bodysnatcher \n" + "F3‘ natural aim \n" + "F4‘ dark alchemist \n" + "F5‘ renegade commando \n" + "F6‘ power shot \n" + "F7‘ one in a million \n" + "F8‘ master blaster \n" + "F9‘ death wish \n"); }; -string () ProtectString = + +string () AmmoString = { - return ("++ high-tech protective devices ++ \n" + return ("++ ammunition ++\n" "\n" - " HARDWARE | SHIELDS VS | PRICE \n" - "1‘ energy amulet |damage: 7% 15‘\n" - "2‘ force field |front: 15% 20‘\n" - "3‘ safety ring |absorb: 3 35‘\n" - "4‘ smokescreen |obscures 40‘\n" - "5‘ sentient cube |regenerate 45‘\n"); + " AMMO | POWER | TYPE | COST[50]\n" + "1‘ 10mm 2 FMJ 015‘\n" + "2‘ 12gauge 4 SHOT 025‘\n" + "3‘ 44 mag 3 AP 030‘\n" + "4‘ 45 acp 3 JHP 020‘\n" + "5‘ .223 3 FMJ 030‘\n" + "6‘ 5mm 3 JHP 025‘\n" + "7‘ .308 4 AP 040‘\n" + "8‘ needle 2 AP 035‘\n" + "9‘ caseless 3 FMJ 040‘\n" + "0‘ energycell 4 CELL 055‘\n"); }; +string () AmmoString2 = +{ + return ("++ ammunition ++\n" + "you get a discount when fighting ghouls!\n" + " AMMO | POWER | TYPE | COST[50]\n" + "1‘ 10mm 2 FMJ 005‘\n" + "2‘ 12gauge 4 N/A 008‘\n" + "3‘ 44 mag 3 AP 010‘\n" + "4‘ 45 acp 3 JHP 007‘\n" + "5‘ .223 3 FMJ 010‘\n" + "6‘ 5mm 3 JHP 008‘\n" + "7‘ .308 4 AP 015‘\n" + "8‘ needle 2 AP 010‘\n" + "9‘ caseless 3 FMJ 020‘\n" + "0‘ energycell 4 N/A 015‘\n"); +}; /*return ("++ high-tech protective devices ++ \n\n HARDWARE | SHIELDS VS | PRICE \n @@ -167,17 +202,18 @@ string () ProtectString = string () OtherString = { - return - "++ miscellaneous items ++\n" - " ITEM | CLASS | PRICE \n" + return ("?‘ miscellaneous ?‘\n" "\n" - "\n" - "1‘ (25) bandages for medic 2$\n" - "3‘ (20) mr.ammo 20$\n" - "4‘ (20) auto-doc 20$\n" - "5‘ (20) shield-gen 20$\n" - "6‘ (20) tesla-turret 20$\n" - ; + "1‘ junk 1$\n" + "2‘ nuka-cola 1$\n" + "3‘ chemicals 2$\n" + "4‘ aerosol can 2$\n" + "5‘ circuitboard 5$\n" + "6‘ steel pipe 3$\n" + "7‘ duct tape 1$\n" + "8‘ chewing gum 1$\n" + "9‘ copper wire 1$\n" + "0‘ x-ray tube 7$\n"); }; @@ -186,10 +222,10 @@ string () MeleeString = return ("MELEE WEAPONS\n" "WEAPON | TYPE | WT | PRICE \n" "\n" - "1‘ knife melee 01 01$\n" - "2‘ hand axe melee 08 03$\n" - "3‘ vibroblade melee 04 10$\n" - "4‘ power axe melee 07 15$\n" + "1‘ knife 01 06$\n" + "2‘ wrench 03 08$\n" + "3‘ axe 08 09$\n" + "4‘ spear 04 12$\n" "e‘ exit \n"); }; @@ -209,12 +245,12 @@ string () PistolString = return ("Pistols and Submachineguns\n" " WEAPON | CAL | WEIGHT | PRICE \n" "\n" - "1‘ mk23 socom .45 01 5$\n" - "2‘ d. eagle .44 02 7$\n" - "3‘ needler pistol 02 9$\n" - "4‘ h&k mp7 4mm 03 14$\n" - "5‘ grease gun 9mm 03 17$\n" - "6‘ alien blaster 02 21$\n"); + "1‘ usp socom .45 01 50$\n" + "2‘ d. eagle .44 02 70$\n" + "3‘ glock 21 10mm 01 40$\n" + "4‘ needler pistol 02 120$\n" + "5‘ h&k mp10 10mm 03 150$\n" + "6‘ h&k ump .45 03 170$\n"); }; string () ShotgunString = @@ -222,10 +258,10 @@ string () ShotgunString = return ("shotguns\n" " WEAPON | TYPE | WEIGHT | PRICE \n" "\n" - "1‘ pipe rifle .44 02 4$\n" - "2‘ winchester 12g 03 8$\n" - "3‘ mossberg 12g 04 14$\n" - "4‘ citykiller 12g 05 35$\n"); + "1‘ pipe rifle .44 02 15$\n" + "2‘ winchester 12g 03 60$\n" + "3‘ citykiller 12g 04 240$\n" + "4‘ jackhammer 12g 07 350$\n"); }; /* @@ -241,13 +277,12 @@ string () RifleString = return ("rifles\n" " RIFLE | TYPE | WEIGHT | PRICE \n" "\n" - "1‘ rangemaster 7mm 03 11$\n" - "2‘ ak-112 5mm 04 21$\n" - "3‘ remington .308 05 24$\n" - "4‘ ak-74 5mm 04 27$\n" - "5‘ moonlight .223 05 36$\n" - "6‘ sa-80 5mm 05 32$\n" - "7‘ fn-fal .308 09 25$\n"); + "1‘ rangemaster 223 03 110$\n" + "2‘ ak-112 5mm 04 180$\n" + "3‘ fn fal 308 08 190$\n" + "4‘ widowmaker 308 10 270$\n" + "5‘ moonlight 223 05 280$\n" + "6‘ hk g11 4mm 06 220$\n"); }; string () HeavyString = @@ -255,40 +290,43 @@ string () HeavyString = return ("other weaponry\n" " WEAPON | TYPE | WEIGHT | PRICE \n" "\n" - "1‘ rocket launcher 10 30$\n" - "2‘ gauss rifle 07 32$\n" - "3‘ laser carbine 12 45$\n"); + "1‘ rpg-7 missile launcher 10 350$\n" + "2‘ m72 gauss rifle 07 550$\n" + "3‘ plasma pistol 02 250$\n" + "4‘ m25a2 phased plasma rifle 11 450$\n" + "5‘ m95a1 plasma carbine 08 550$\n" + "6‘ rsb-80 heavy plasma gun 25 650$\n"); }; string () ChemString = { return ("drugs\n DRUG | EFFECTS | PRICE\n" "\n" - "1‘ stimpack heals 05+20 3$\n" - "2‘ medkit+ heals 10+50 5$\n" - "3‘ superstim* heals 20+60 12$\n" - "4‘ adrenaline*+speed/jump 10$\n" - "5‘ jet* aim better 18$\n" - "e‘ exit \n" + "1‘ stimpack heal over time 10$\n" + "2‘ rad-x anti-radiation 15$\n" + "3‘ adrenaline*+speed/jump 15$\n" + "4‘ medkit* endless heal 25$\n" + "5‘ superstim* instant heal 25$\n" + "6‘ psycho* +resist damage 25$\n" + "7‘ berserk* +strength 25$\n" "\n" - "+ requires medic \n" - "* requires advanced medic \n"); + "* requires medic \n"); }; string () ChemString2 = { return ("chems\n DRUG | EFFECTS | PRICE\n" "\n" - "1‘ adrenaline +60 speed/jump 3$\n" - "2‘ stimpack heals 40 5$\n" - "3‘ psycho+ +60 hp/no pain 11$\n" - "4‘ medkit* heals 20+50 12$\n" - "5‘ berserk* adren+psycho 12$\n" + "1‘ adrenaline +60 speed/jump 5$\n" + "2‘ stimpack heals 40 10$\n" + "3‘ psycho+ +60 hp/no pain 15$\n" + "4‘ medkit* heals 20+50 15$\n" + "5‘ berserk* adren+psycho 15$\n" "6‘ jet* aim better 15$\n" "e‘ exit \n" "\n" - "+ requires shaman \n" - "* requires advanced shaman \n"); + "+ requires medic \n" + "* requires advanced medic \n"); }; string () EnergyWeaponsString = @@ -348,16 +386,98 @@ string () de_dust = string () EquipmentString = { return ("+ special equipment +\n" - "press your c key to activate!\n" - "\n" - "1‘ medic's bag 15c‘\n" - "2‘ security alarm 15c‘\n" - "3‘ remote camera 15c‘\n" - "4‘ belt pouch 15c‘\n" - "5‘ backpack 15c‘\n" - "6‘ toolkit mark ii 15c‘\n" - "7‘ climbing gear 15c‘\n" - "8‘ enhanced battery 15c‘\n" - "9‘ stealth boy 45c‘\n" + "we only let you use one of these!\n" + "1‘ medic's bag 5c‘\n" + "2‘ ghost goggles 5c‘\n" + "3‘ stealth boy 5c‘\n" + "4‘ belt pouch 5c‘\n" + "5‘ backpack 5c‘\n" + "6‘ toolkit mark ii 5c‘\n" + "7‘ climbing gear 5c‘\n" + "8‘ enhanced battery 5c‘\n" "\n"); }; + + +string () EnterString = +{ + return ("‘‘‘‘ fallout ‘‘‘‘\n" + "‘ a post-nuclear fps ‘\n" + "\n" + "scour the wastes with your friends!\n" + "this quake mod is entirely based on\n" + "the fallout series of computer rpgs\n" + "for best performance the fte client\n" + "is required for play, available at:\n" + " ‘ www.fteqw.com ‘ \n" + "\n" + "press 1 to continue‘\n" + "\n" + + "\n"); +}; + + +string () WaitString = +{ + return ("‘‘‘‘ fallout ‘‘‘‘\n" + "‘ a post-nuclear fps ‘\n" + "\n" + "scour the wastes with your friends!\n" + "this quake mod is entirely based on\n" + "the fallout series of computer rpgs\n" + "for best performance the fte client\n" + "is required for play, available at:\n" + " ‘ www.fteqw.com ‘ \n" + "\n" + "wait until next round‘\n" + "\n" + + "\n"); +}; + +string () LockpickString = +{ + return ("‘ Picking ‘\n" + "\n\n" + "this is tricky business! wait until\n" + "all three tumblers are in place by \n" + "watching for three [!] symbols. but\n" + "you have to be quick! failure means\n" + "you jam the lock.\n\n" + "press 1 to pick‘\n" + "press 2 to quit‘\n"); +}; + +string () DefuseString = +{ + return ("‘ Defuse ‘\n" + "\n\n" + "this is tricky business! wait until\n" + "all three circuits are in place by \n" + "watching for three [!] symbols. but\n" + "you have to be quick! failure means\n" + "you reset the switch bypass.\n\n" + "press 1 to pick‘\n" + "press 2 to quit‘\n"); +}; + + + +string () MissionString = +{ + return ("‘‘‘ mission select ‘‘‘\n" + "\n" + "\n" + "1‘ get new mission\n" + "2‘ grab one later \n\n\n"); +}; + +string () DepartString = +{ + return ("‘‘‘ saddle up! ‘‘‘\n" + "\n" + "\n" + "1‘ take off to mission site\n" + "2‘ wait a second \n\n\n"); +}; \ No newline at end of file diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index ab5ed4477..55dc05bbd 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -216,8 +216,7 @@ void() barrel_explode = { self.takedamage = DAMAGE_NO; self.classname = "explo_box"; - // did say self.owner - T_RadiusDamage (self, self, 160, world, ""); + T_RadiusDamage2 (self, self.owner, 65+random()*65, other, 800); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_EXPLOSION); WriteCoord (MSG_MULTICAST, self.origin_x); @@ -262,35 +261,27 @@ void() misc_explobox = void () hostage_die = { - self.enemy.frags = (self.enemy.frags - START_OFF); - self.enemy.ammo_shells = (self.enemy.ammo_shells - MULTICAST_PVS_R); - if ((self.enemy.team == START_OFF)) - { - blue_kill = (blue_kill + START_OFF); - } - if ((self.enemy.team == SILENT)) - { - red_kill = (red_kill + START_OFF); - } - if ((self.enemy.frags <= MULTICAST_ALL)) - { - self.enemy.frags = MULTICAST_ALL; - } - if ((self.enemy.ammo_shells <= MULTICAST_ALL)) - { - self.enemy.ammo_shells = MULTICAST_ALL; - } + local entity ze; + self.frame = START_OFF; - if ((self.model == "progs/hosfem.mdl")) - { - sound (self, CHAN_VOICE, "misc/hosdie2.wav", START_OFF, ATTN_NORM); - } + if (self.model == "progs/hosfem.mdl") + sound (self, CHAN_VOICE, "misc/hosdie2.wav", 1, ATTN_NONE); else - { - sound (self, CHAN_VOICE, "misc/hosdie1.wav", START_OFF, ATTN_NORM); - } - sound (self, CHAN_BODY, "misc/hosdown.wav", START_OFF, ATTN_NONE); + sound (self, CHAN_VOICE, "misc/hosdie1.wav", 1, ATTN_NONE); + + + ze = find (world, classname, "player"); + + while (ze) + { + if (ze.classname == "player") + ze.score = ze.score - 100; + + ze = find(ze, classname, "player"); + } + hos_deatha1 (); + setsize (self, VEC_ORIGIN, VEC_ORIGIN); }; @@ -338,6 +329,40 @@ void () sci_think = return; }; +void (vector place) hostage_new = +{ + local entity te; + local float qq; + + precache_model ("progs/hosfem.mdl"); + precache_model ("progs/hosguy.mdl"); + precache_sound ("misc/hosdie1.wav"); + precache_sound ("misc/hosdie2.wav"); + precache_sound ("misc/hosdown.wav"); + precache_sound ("misc/rescued.wav"); + + hostages = hostages + 1; + setorigin(self, place + '0 0 24'); + hos_stand1 (); + self.movetype = MOVETYPE_STEP; + self.velocity = VEC_ORIGIN; + self.touch = SUB_Null; + self.classname = "rhostage"; + self.takedamage = DAMAGE_AIM; + setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); + self.home = self.origin; + setmodel (self, "progs/hosfem.mdl"); + self.health = 70; + self.think = hostage_think; + self.nextthink = (time + START_OFF); + self.solid = SOLID_BBOX; + self.th_die = hostage_die; + self.th_pain = hostage_pain; + self.rescued = MULTICAST_ALL; + self.angles_y = floor ((random () * 360)); + self.netname = "citizen"; +}; + void () hostage_spawn = { local entity te; @@ -882,3 +907,163 @@ void() misc_noisemaker = self.nextthink = time + 0.1 + random(); self.think = noise_think; }; + + +void() brotherhood_merchant = +{ + setorigin(self, self.origin + '0 0 64'); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_z = -200; + + setmodel (self, "progs/enforcer.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -24', '16 16 32'); + self.takedamage = DAMAGE_NO; + self.classname = "merchant"; + self.think = shop_face; + self.nextthink = time + 0.5; +}; + +void() brotherhood_sergeant = +{ + setorigin(self, self.origin + '0 0 64'); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_z = -200; + + setmodel (self, "progs/enforcer.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -24', '16 16 32'); + self.takedamage = DAMAGE_NO; +}; + +void() brotherhood_soldier = +{ + setorigin(self, self.origin + '0 0 64'); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_z = -200; + + setmodel (self, "progs/enforcer.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -24', '16 16 32'); + self.takedamage = DAMAGE_NO; +}; + +void() brotherhood_guard = +{ + precache_model ("progs/enforcer.mdl"); + precache_sound ("enforcer/sight1.wav"); + precache_sound ("enforcer/sight2.wav"); + precache_sound ("enforcer/sight3.wav"); + precache_sound ("enforcer/sight4.wav"); + + setorigin(self, self.origin + '0 0 64'); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_z = -200; + + setmodel (self, "progs/enforcer.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -24', '16 16 32'); + self.takedamage = DAMAGE_NO; +}; + +void() brotherhood_doctor = +{ + setorigin(self, self.origin + '0 0 64'); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_z = -200; + + setmodel (self, "progs/enforcer.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -24', '16 16 32'); + self.takedamage = DAMAGE_NO; +}; + + +void() computer_noise = +{ + + if (random()<0.10) + sound (self, CHAN_WEAPON, "effects/beep1.wav", 1, ATTN_IDLE); + else if (random()<0.10) + sound (self, CHAN_WEAPON, "effects/beep2.wav", 1, ATTN_IDLE); + else if (random()<0.10) + sound (self, CHAN_WEAPON, "effects/beep3.wav", 1, ATTN_IDLE); + else if (random()<0.10) + sound (self, CHAN_WEAPON, "effects/beep4.wav", 1, ATTN_IDLE); + + self.nextthink = time + 5; +}; + +void() misc_computer = +{ + precache_sound ("effects/beep1.wav"); + precache_sound ("effects/beep2.wav"); + precache_sound ("effects/beep3.wav"); + precache_sound ("effects/beep4.wav"); + + self.nextthink = time + 5; + self.think = computer_noise; +}; + +void() medical_noise = +{ + + sound (self, CHAN_WEAPON, "effects/beep5.wav", 1, ATTN_IDLE); + + self.nextthink = time + 2.50; +}; + +void() misc_medical = +{ + precache_sound ("effects/beep5.wav"); + + self.nextthink = time + 2.50; + self.think = medical_noise; +}; + +void() radio_noise = +{ + + if (random()<0.10) + sound (self, CHAN_WEAPON, "effects/radio1.wav", 1, ATTN_NORM); + else if (random()<0.10) + sound (self, CHAN_WEAPON, "effects/radio2.wav", 1, ATTN_NORM); + else if (random()<0.10) + sound (self, CHAN_WEAPON, "effects/radio3.wav", 1, ATTN_NORM); + else if (random()<0.10) + sound (self, CHAN_WEAPON, "effects/radio4.wav", 1, ATTN_NORM); + + self.nextthink = time + 4; +}; + +void() misc_radio = +{ + self.nextthink = time + 5; + self.think = radio_noise; +}; + +void() brotherhood_wounded = +{ + remove(self); +}; + +void() func_tank = +{ + precache_model ("progs/x_tank.mdl"); + setmodel (self, "progs/x_tank.mdl"); + setorigin(self, self.origin + '0 0 64'); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_z = -200; + + self.touch = SUB_Null; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-64 -64 -32', '64 64 32'); + self.takedamage = DAMAGE_NO; +}; + + diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index 2f4ce1d5b..67d761afe 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -1,4 +1,6 @@ +void (entity chest, float iid, float num) DropFromChest; + void(entity to, float iid, float amount) AddNonStackable = { local float slot; @@ -30,6 +32,40 @@ void(float cost, float iid) BuyStackable = return; } + if (!TryGiveStackable(self, iid)) + { + sprint(self, 2, "full inventory.\n"); + return; + } + + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + self.ammo_shells = self.ammo_shells - cost; + + sprint(self, PRINT_HIGH, "you bought a "); + + z = GetItemName(iid); + sprint(self, PRINT_HIGH, z); + sprint(self, PRINT_HIGH, "\n"); + self.impulse = 0; +}; + +void(float cost, float iid, float amount) BuyStackableMulti = +{ + local string z; + + if (self.ammo_shells < cost) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "not enough money.\n"); + return; + } + + if (!TryGiveStackable(self, iid)) + { + sprint(self, 2, "full inventory.\n"); + return; + } + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); self.ammo_shells = self.ammo_shells - cost; @@ -41,8 +77,6 @@ void(float cost, float iid) BuyStackable = //put grenade in inventory //finds existing grenades, otherwise, empty slot - - TryGiveStackable(self, iid, 1); }; void() BuyBandages = @@ -79,11 +113,12 @@ void() BuyBandages = sprint(self, PRINT_HIGH, "/50 bandages.\n"); }; -void(float cost, float type) BuyChem = +void(float cost, float type, float count) BuyChem = { local string chemname; local float max; local float alreadygot; + local float typex; if (self.ammo_shells < cost) { @@ -91,25 +126,120 @@ void(float cost, float type) BuyChem = sprint(self, PRINT_HIGH, "not enough money.\n"); return; } - if (type != IID_CHEM_STIMPACK && self.class != 1) + + //only medics and engineers can buy superstims + if (type == IID_CHEM_SUPERSTIM && self.class != 1 && self.class != 4) { self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "not a medic.\n"); + sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); + sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); return; } - if (self.equipment == 1) - max = 4; - else - max = 2; + //only medics and engineers can buy adrenaline + if (type == IID_CHEM_ADRENALINE && self.class != 1 && self.class != 4) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); + sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); + return; + } + + //only medics can buy psycho + if (type == IID_CHEM_PSYCHO && self.class != 1) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); + sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); + return; + } + + //only medics can buy berserk + if (type == IID_CHEM_BESERK && self.class != 1) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); + sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); + return; + } + + //only medics can buy the doctor bag + if (type == IID_CHEM_MEDICALBAG && self.class != 1) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "you will need a higher doctor skill\n"); + sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); + return; + } + + if (type == IID_CHEM_STIMPACK) + max = 4; + if (type == IID_CHEM_SUPERSTIM) + max = 1; if (type == IID_CHEM_MEDICALBAG) max = 50; + if (type == IID_CHEM_ADRENALINE) + max = 25; + if (type == IID_CHEM_PSYCHO) + max = 25; + if (type == IID_CHEM_BESERK) + max = 25; + if (type == IID_CHEM_RADX) + max = 5; + + if (self.class == 1) + max = max + 1; + + if (ToIID(self.islot4) == IID_EQUIP_MEDIC_BAG) + max = max * 2; alreadygot = TotalQuantity(self, type); if (alreadygot >= max) { self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "you can't hold any more chems.\n"); + sprint(self, PRINT_HIGH, "you can't hold any more of those chems.\n"); + return; + } + + //can only carry two types of chem + typex = 0; + if (SlotOfItem(self, IID_CHEM_STIMPACK) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_SUPERSTIM) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_MEDICALBAG) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_ADRENALINE) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_PSYCHO) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_BESERK) > 0) + typex = typex + 1; + if (SlotOfItem(self, IID_CHEM_RADX) > 0) + typex = typex + 1; + + max = 2; + + if (self.class == 1) + max = 4; + if (ToIID(self.islot4) == IID_EQUIP_MEDIC_BAG) + max = 4; + + if (typex >= max) + { + self.currentmenu = "none"; + sprint(self, PRINT_HIGH, "only authorized to carry "); + if (max == 2) + sprint(self, PRINT_HIGH, "two types of chems (non-medic)\n"); + else + sprint(self, PRINT_HIGH, "four types of chems (medic)\n"); + + return; + } + + if (!TryGiveStackable(self, type, count)) + { + sprint(self, 2, "full inventory.\n"); return; } @@ -118,7 +248,6 @@ void(float cost, float type) BuyChem = chemname = GetItemName(type); sprint(self, PRINT_HIGH, chemname); sprint(self, PRINT_HIGH, " purchased.\n"); - TryGiveStackable(self, type, 1); }; void(string type) ChangeAmmo = @@ -189,59 +318,30 @@ void (float wt, float cost, float wid) BuyWeapon = }; -void (float cost, float item) BuyPerk = +void (float cost, float item, float slot) BuyPerk = { - if (self.frags < cost) + + if (slot == 1 && self.perk2 == item) { - sprint (self, PRINT_HIGH, "not enough kills\n"); - self.currentmenu = "none"; + sprint (self, PRINT_HIGH, "you already know that ability!\n"); return; } - sprint (self, PRINT_HIGH, "ok, ability gained.\n"); - self.perk = item; + if (slot == 2 && self.perk1 == item) + { + sprint (self, PRINT_HIGH, "you already know that ability!\n"); + return; + } + + sprint (self, PRINT_HIGH, "you have learned a new ability in the wastes.\n"); + + if (slot == 1) + self.perk1 = item; + else if (slot == 2) + self.perk2 = item; self.currentmenu = "none"; return; }; -/* -void (float wt, float cost, float item) BuyArmor = -{ - - local float curr; - local float lbs; - local string x; - - lbs = weightx (); - if (((item >= TE_LIGHTNING2) && (self.protect >= SPAWNFLAG_SUPERSPIKE))) - { - sprint (self, PRINT_HIGH, "remove your hardware before buying\nany kind of advanced armor!\ntoo much interference otherwise."); - self.currentmenu = "none"; - return; - } - if ((cost > self.ammo_shells)) - { - sprint (self, PRINT_HIGH, "not enough money.\n"); - self.currentmenu = "none"; - return; - } - if ((((lbs + wt) - GetItemsWeight(self.islot3)) > self.max_weight)) - { - sprint (self, PRINT_HIGH, "you can't carry that much.\n"); - self.currentmenu = "none"; - return; - } - sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); - self.ammo_shells = (self.ammo_shells - cost); -// self.armor_weight = wt; - self.armor = item; - x = GetArmorName(); - sprint (self, PRINT_HIGH, x); - sprint (self, PRINT_HIGH, " purchased.\n"); - - return; - -};*/ - void (float wt, float cost, float item) BuyArmor = { local string z; @@ -269,11 +369,11 @@ void (float wt, float cost, float item) BuyArmor = x = FindEmptySlot(self); - if (x == 0) - sprint(self, 2, "no more room. giving armor to merchant.\n"); +// if (x == 0) +// sprint(self, 2, "no more room. giving armor to merchant.\n"); - if (x != 0) //found a place to stick old armor - SetItemSlot(self, x, SlotVal(self.islot3, 1)); +// if (x != 0) //found a place to stick old armor +// SetItemSlot(self, x, SlotVal(self.islot3, 1)); SetItemSlot(self, 3, SlotVal(item, 1)); }; @@ -291,8 +391,10 @@ void (float cost, float item) BuyEquipment = return; } sound (self, CHAN_BODY, "items/item1.wav", 1, ATTN_NORM); - self.equipment = item; - x = GetEquipmentName(); + + x = GetItemName(item); + SetItemSlot(self, 4, SlotVal(item, 1)); + sprint (self, PRINT_HIGH, x); sprint (self, PRINT_HIGH, " purchased.\n"); self.ammo_shells = (self.ammo_shells - cost); @@ -335,66 +437,58 @@ float (float input) overweight = tmp = input + self.weight; max = self.max_weight; - if (self.class == TE_LIGHTNING2) - { - max = max + SPAWNFLAG_LASER; - } - if (self.perk == TE_LAVASPLASH) - { - return (FALSE); - } + if (tmp > max) - { return (TRUE); - } else - { return (FALSE); - } }; void () W_GetClass = { if ((self.currentmenu == "select_skill")) { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); if (self.impulse == 1) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 80; - self.class = 1; + self.tclass = 1; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nMedic - OK?\n1‘ Yes \n2‘ No \n"); self.ghost = 0; return; } if ((self.impulse == 2)) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 70; - self.class = 2; + self.tclass = 2; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nAssassin - OK?\n1‘ Yes \n2‘ No \n"); self.ghost = 0; return; } if (self.impulse == 3) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 100; - self.class = 3; + self.tclass = 3; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nSoldiier - OK?\n1‘ Yes \n2‘ No \n"); self.ghost = 0; return; } if (self.impulse == 4) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.max_health = 80; self.currentmenu = "none"; - self.class = 4; + self.tclass = 4; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nScientist - OK?\n1‘ Yes \n2‘ No \n"); self.ghost = 0; return; } @@ -407,19 +501,21 @@ void () W_GetClass = void() W_PlayerMenu = { + local float xx; + local string yy, q, x; + if (self.currentmenu == "none") return; - - if (self.currentmenu == "shop_list") + else if (self.currentmenu == "shop_list") { if (self.impulse == 1) - self.currentmenu = "shop_trait"; + self.currentmenu = "shop_perk1"; if (self.impulse == 2) - self.currentmenu = "shop_perk"; + self.currentmenu = "shop_perk2"; if (self.impulse == 3) self.currentmenu = "shop_armor"; if (self.impulse == 4) - self.currentmenu = "shop_protect"; + self.currentmenu = "shop_ammo"; if (self.impulse == 5) self.currentmenu = "shop_weapons"; if (self.impulse == 6) @@ -432,89 +528,175 @@ void() W_PlayerMenu = DisplayMenu(); return; } - - if (self.currentmenu == "shop_trait") + else if (self.currentmenu == "shop_perk1") { if (self.impulse == 1) - self.currentmenu = "shop_trait"; + BuyPerk(1, 1, 1); if (self.impulse == 2) - self.currentmenu = "shop_perk"; + BuyPerk(1, 2, 1); if (self.impulse == 3) - self.currentmenu = "shop_armor"; + BuyPerk(1, 3, 1); if (self.impulse == 4) - self.currentmenu = "shop_protect"; + BuyPerk(2, 4, 1); if (self.impulse == 5) - self.currentmenu = "shop_weapons"; + BuyPerk(2, 5, 1); if (self.impulse == 6) - self.currentmenu = "shop_equipment"; + BuyPerk(2, 6, 1); if (self.impulse == 7) - self.currentmenu = "shop_chems"; + BuyPerk(2, 7, 1); if (self.impulse == 8) - self.currentmenu = "shop_other"; - - DisplayMenu(); - return; - } - if (self.currentmenu == "shop_perk") - { - if (self.impulse == 1) - BuyPerk(1, 1); - if (self.impulse == 2) - BuyPerk(1, 2); - if (self.impulse == 3) - BuyPerk(1, 3); - if (self.impulse == 4) - BuyPerk(2, 4); - if (self.impulse == 5) - BuyPerk(2, 5); - if (self.impulse == 6) - BuyPerk(2, 6); - if (self.impulse == 7) - BuyPerk(2, 7); - if (self.impulse == 8) - BuyPerk(3, 8); + BuyPerk(3, 8, 1); if (self.impulse == 9) - BuyPerk(4, 9); + BuyPerk(4, 9, 1); + if (self.impulse == 10) + BuyPerk(4, 10, 1); + if (self.impulse == 212) + BuyPerk(4, 11, 1); + if (self.impulse == 213) + BuyPerk(4, 12, 1); + if (self.impulse == 214) + BuyPerk(4, 13, 1); + if (self.impulse == 215) + BuyPerk(4, 14, 1); + if (self.impulse == 216) + BuyPerk(4, 15, 1); + if (self.impulse == 217) + BuyPerk(4, 16, 1); + if (self.impulse == 218) + BuyPerk(4, 17, 1); + if (self.impulse == 219) + BuyPerk(4, 18, 1); + if (self.impulse == 220) + BuyPerk(4, 19, 1); + return; } - if (self.currentmenu == "shop_armor") + if (self.currentmenu == "shop_perk2") { if (self.impulse == 1) - BuyArmor(3, 03, IID_ARM_SHIRT); //weight, cost, item + BuyPerk(1, 1, 2); if (self.impulse == 2) - BuyArmor(7, 05, IID_ARM_LEATHER); //weight, cost, item + BuyPerk(1, 2, 2); if (self.impulse == 3) - BuyArmor(9, 10, IID_ARM_KEVLAR); //weight, cost, item + BuyPerk(1, 3, 2); if (self.impulse == 4) - BuyArmor(15, 12, IID_ARM_METAL); //weight, cost, item + BuyPerk(2, 4, 2); if (self.impulse == 5) - BuyArmor(12, 25, IID_ARM_COMBAT); //weight, cost, item + BuyPerk(2, 5, 2); if (self.impulse == 6) - BuyArmor(17, 35, IID_ARM_BROTHERHOOD); //weight, cost, item + BuyPerk(2, 6, 2); if (self.impulse == 7) - BuyArmor(5, 45, IID_ARM_FORCE); //weight, cost, item + BuyPerk(2, 7, 2); if (self.impulse == 8) - BuyArmor(20, 55, IID_ARM_LPOWER); //weight, cost, item + BuyPerk(3, 8, 2); + if (self.impulse == 9) + BuyPerk(4, 9, 2); + if (self.impulse == 10) + BuyPerk(4, 10, 2); + if (self.impulse == 212) + BuyPerk(4, 11, 2); + if (self.impulse == 213) + BuyPerk(4, 12, 2); + if (self.impulse == 214) + BuyPerk(4, 13, 2); + if (self.impulse == 215) + BuyPerk(4, 14, 2); + if (self.impulse == 216) + BuyPerk(4, 15, 2); + if (self.impulse == 217) + BuyPerk(4, 16, 2); + if (self.impulse == 218) + BuyPerk(4, 17, 2); + if (self.impulse == 219) + BuyPerk(4, 18, 2); + if (self.impulse == 220) + BuyPerk(4, 19, 2); return; } - if (self.currentmenu == "shop_protect") + else if (self.currentmenu == "shop_armor") { if (self.impulse == 1) - BuyProtect(20, 1); + BuyArmor(3, 50, IID_ARM_SHIRT); //weight, cost, item if (self.impulse == 2) - BuyProtect(20, 2); + BuyArmor(7, 100, IID_ARM_LEATHER); //weight, cost, item if (self.impulse == 3) - BuyProtect(30, 3); + BuyArmor(9, 125, IID_ARM_KEVLAR); //weight, cost, item if (self.impulse == 4) - BuyProtect(30, 4); + BuyArmor(15, 150, IID_ARM_METAL); //weight, cost, item if (self.impulse == 5) - BuyProtect(40, 5); + BuyArmor(12, 200, IID_ARM_COMBAT); //weight, cost, item + if (self.impulse == 6) + BuyArmor(17, 250, IID_ARM_BROTHERHOOD); //weight, cost, item + if (self.impulse == 7) + BuyArmor(5, 300, IID_ARM_FORCE); //weight, cost, item + if (self.impulse == 8) + BuyArmor(20, 400, IID_ARM_LPOWER); //weight, cost, item return; } - if (self.currentmenu == "shop_weapons") + else if (self.currentmenu == "shop_ammo" && world.map_obj != 4) + { + if (self.impulse == 1) + BuyStackableMulti(15,IID_AM_10MM,50); + if (self.impulse == 2) + BuyStackableMulti(25,IID_AM_12GAUGESHELLS,50); + if (self.impulse == 3) + BuyStackableMulti(30,IID_AM_44MAGNUM,50); + if (self.impulse == 4) + BuyStackableMulti(20,IID_AM_45ACP,50); + if (self.impulse == 5) + BuyStackableMulti(30,IID_AM_556MM,50); + if (self.impulse == 6) + BuyStackableMulti(25,IID_AM_5MMHIGHVEL,50); + if (self.impulse == 7) + BuyStackableMulti(40,IID_AM_762MM,50); + if (self.impulse == 8) + BuyStackableMulti(35,IID_AM_NEEDLER,50); + if (self.impulse == 9) + BuyStackableMulti(40,IID_AM_CASELESS, 50); + if (self.impulse == 10) + BuyStackableMulti(55,IID_AM_ENERGYCELL,50); + + if (random() < 0.5) + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + + return; + } + else if (self.currentmenu == "shop_ammo" && world.map_obj == 4) + { + if (self.impulse == 1) + BuyStackableMulti(5,IID_AM_10MM,50); + if (self.impulse == 2) + BuyStackableMulti(8,IID_AM_12GAUGESHELLS,50); + if (self.impulse == 3) + BuyStackableMulti(10,IID_AM_44MAGNUM,50); + if (self.impulse == 4) + BuyStackableMulti(7,IID_AM_45ACP,50); + if (self.impulse == 5) + BuyStackableMulti(10,IID_AM_556MM,50); + if (self.impulse == 6) + BuyStackableMulti(8,IID_AM_5MMHIGHVEL,50); + if (self.impulse == 7) + BuyStackableMulti(15,IID_AM_762MM,50); + if (self.impulse == 8) + BuyStackableMulti(10,IID_AM_NEEDLER,50); + if (self.impulse == 9) + BuyStackableMulti(20,IID_AM_CASELESS, 50); + if (self.impulse == 10) + BuyStackableMulti(15,IID_AM_ENERGYCELL,50); + + if (random() < 0.5) + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); + + return; + } + else if (self.currentmenu == "shop_weapons") { if (self.impulse == 1) self.currentmenu = "shop_melee"; @@ -532,154 +714,168 @@ void() W_PlayerMenu = DisplayMenu(); return; } - if (self.currentmenu == "shop_melee") + else if (self.currentmenu == "shop_melee") { if (self.impulse == 1) - BuyWeapon(1, 1, IID_WP_KNIFE); //weight, cost, item + BuyWeapon(1, 6, IID_WP_KNIFE); //weight, cost, item if (self.impulse == 2) - BuyWeapon(6, 3, IID_WP_AXE); //weight, cost, item + BuyWeapon(3, 8, IID_WP_WRENCH); //weight, cost, item if (self.impulse == 3) - BuyWeapon(3, 10, IID_WP_VIBROBLADE); //weight, cost, item + BuyWeapon(8, 9, IID_WP_AXE); //weight, cost, item if (self.impulse == 4) - BuyWeapon(10, 15, IID_WP_POWERAXE); //weight, cost, item + BuyWeapon(4, 12, IID_WP_SPEAR); //weight, cost, item return; } - if (self.currentmenu == "shop_thrown") + else if (self.currentmenu == "shop_thrown") { if (self.impulse == 1) - BuyStackable(3, IID_GREN_SMOKE); //weight, cost, item + BuyStackableMulti(8, IID_GREN_FLASH, 1); //weight, cost, item if (self.impulse == 2) - BuyStackable(4, IID_GREN_FRAG); //weight, cost, item + BuyStackableMulti(12, IID_GREN_FRAG, 1); //weight, cost, item if (self.impulse == 3) - BuyStackable(5, IID_GREN_EMP); //weight, cost, item + BuyStackableMulti(1, IID_GREN_FLARE, 1); //weight, cost, item if (self.impulse == 4) - BuyStackable(6, IID_GREN_FLASH); //weight, cost, item - - return; - } - if (self.currentmenu == "shop_pistols") - { - if (self.impulse == 1) - BuyWeapon(1, 5, IID_WP_USP); //weight, cost, item - if (self.impulse == 2) - BuyWeapon(2, 7, IID_WP_DEAGLE); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(2, 9, IID_WP_NEEDLER); //weight, cost, item - if (self.impulse == 4) - BuyWeapon(3, 14, IID_WP_MP9); //weight, cost, item + BuyStackableMulti(2, IID_MISC_HMXCOMPOUND, 1); //weight, cost, item if (self.impulse == 5) - BuyWeapon(3, 17, IID_WP_MP7); //weight, cost, item + BuyStackableMulti(2, IID_MISC_RDXCRYSTAL, 1); //weight, cost, item if (self.impulse == 6) - BuyWeapon(2, 21, IID_WP_ALIENBLASTER); //weight, cost, item + BuyStackableMulti(10, IID_AM_ROCKET, 1); //weight, cost, item return; } - if (self.currentmenu == "shop_shotguns") + else if (self.currentmenu == "shop_pistols") { if (self.impulse == 1) - BuyWeapon(3, 4, IID_WP_PIPERIFLE); //weight, cost, item + BuyWeapon(1, 50, IID_WP_USP); //weight, cost, item if (self.impulse == 2) - BuyWeapon(4, 8, IID_WP_WINCHESTER); //weight, cost, item + BuyWeapon(2, 70, IID_WP_DEAGLE); //weight, cost, item if (self.impulse == 3) - BuyWeapon(5, 12, IID_WP_MOSSBERG); //weight, cost, item + BuyWeapon(1, 40, IID_WP_GLOCK); //weight, cost, item if (self.impulse == 4) - BuyWeapon(7, 34, IID_WP_JACKHAMMER); //weight, cost, item - - return; - } - if (self.currentmenu == "shop_rifles") - { - if (self.impulse == 1) - BuyWeapon(3, 11, IID_WP_RANGEMASTER); //weight, cost, item - if (self.impulse == 2) - BuyWeapon(4, 21, IID_WP_AK112); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(5, 25, IID_WP_AK74); //weight, cost, item - if (self.impulse == 4) - BuyWeapon(6, 28, IID_WP_DKS1); //weight, cost, item + BuyWeapon(2, 120, IID_WP_NEEDLER); //weight, cost, item if (self.impulse == 5) - BuyWeapon(5, 30, IID_WP_MOONLIGHT); //weight, cost, item + BuyWeapon(3, 170, IID_WP_MP7); //weight, cost, item if (self.impulse == 6) - BuyWeapon(4, 32, IID_WP_SA80); //weight, cost, item + BuyWeapon(3, 150, IID_WP_MP9); //weight, cost, item + + return; + } + else if (self.currentmenu == "shop_shotguns") + { + if (self.impulse == 1) + BuyWeapon(3, 15, IID_WP_PIPERIFLE); //weight, cost, item + if (self.impulse == 2) + BuyWeapon(4, 60, IID_WP_WINCHESTER); //weight, cost, item + if (self.impulse == 3) + BuyWeapon(5, 240, IID_WP_MOSSBERG); //weight, cost, item + if (self.impulse == 4) + BuyWeapon(7, 350, IID_WP_JACKHAMMER); //weight, cost, item + + return; + } + else if (self.currentmenu == "shop_rifles") + { + if (self.impulse == 1) + BuyWeapon(3, 110, IID_WP_RANGEMASTER); //weight, cost, item + if (self.impulse == 2) + BuyWeapon(4, 180, IID_WP_AK112); //weight, cost, item + if (self.impulse == 3) + BuyWeapon(8, 190, IID_WP_FNFAL); //weight, cost, item + if (self.impulse == 4) + BuyWeapon(9, 270, IID_WP_DKS1); //weight, cost, item + if (self.impulse == 5) + BuyWeapon(5, 280, IID_WP_MOONLIGHT); //weight, cost, item + if (self.impulse == 6) + BuyWeapon(6, 220, IID_WP_G11); //weight, cost, item + + return; + } + else if (self.currentmenu == "shop_heavy") + { + if (self.impulse == 1) + BuyWeapon(10, 650, IID_WP_ROCKETLAUNCHER); //weight, cost, item + if (self.impulse == 2) + BuyWeapon(7, 550, IID_WP_GAUSERIFLE); //weight, cost, item + if (self.impulse == 3) + BuyWeapon(2, 250, IID_WP_ALIENBLASTER); //weight, cost, item + if (self.impulse == 4) + BuyWeapon(11, 450, IID_WP_PULSERIFLE); //weight, cost, item + if (self.impulse == 5) + BuyWeapon(8, 550, IID_WP_PLASMACARBINE); //weight, cost, item + if (self.impulse == 6) + BuyWeapon(25, 650, IID_WP_LASERGATLING); //weight, cost, item + } + else if (self.currentmenu == "shop_equipment") + { + if (self.impulse == 1) + BuyEquipment(5, IID_EQUIP_MEDIC_BAG); //cost, item + if (self.impulse == 2) + BuyEquipment(5, IID_EQUIP_GOGGLES); //cost, item + if (self.impulse == 3) + BuyEquipment(5, IID_EQUIP_STEALTHBOY); //cost, item + if (self.impulse == 4) + BuyEquipment(5, IID_EQUIP_BELTPOUCH); //cost, item + if (self.impulse == 5) + BuyEquipment(5, IID_EQUIP_BACKPACK); //cost, item + if (self.impulse == 6) + BuyEquipment(5, IID_EQUIP_TOOLKIT); //cost, item if (self.impulse == 7) - BuyWeapon(9, 25, IID_WP_FNFAL); //weight, cost, item - - return; - } - if (self.currentmenu == "shop_heavy") - { - if (self.impulse == 1) - BuyWeapon(10, 30, IID_WP_ROCKETLAUNCHER);//weight, cost, item - if (self.impulse == 2) - BuyWeapon(7, 32, IID_WP_GAUSERIFLE); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(12, 45, IID_WP_PULSERIFLE); //weight, cost, item - } - - if (self.currentmenu == "shop_equipment") - { - if (self.impulse == 1) - BuyEquipment(20, 1); //cost, item - if (self.impulse == 2) - BuyEquipment(20, 2); //cost, item - if (self.impulse == 3) - BuyEquipment(20, 3); //cost, item - if (self.impulse == 4) - BuyEquipment(20, 4); //cost, item - if (self.impulse == 5) - BuyEquipment(20, 5); //cost, item - if (self.impulse == 6) - BuyEquipment(20, 6); //cost, item - if (self.impulse == 7) - BuyEquipment(20, 7); //cost, item + BuyEquipment(5, IID_EQUIP_CLIMBINGGEAR); //cost, item if (self.impulse == 8) - BuyEquipment(20, 8); //cost, item - if (self.impulse == 9) - BuyEquipment(20, 9); //cost, item - if (self.impulse == 10) - BuyEquipment(20, 10); //cost, item + BuyEquipment(5, IID_EQUIP_BATTERY); //cost, item return; } - - if (self.currentmenu == "shop_chems") + else if (self.currentmenu == "shop_chems") { if (self.impulse == 1) - BuyChem(3, IID_CHEM_STIMPACK); //cost, item + BuyChem(5, IID_CHEM_STIMPACK, 1); //cost, item if (self.impulse == 2) - BuyChem(5, IID_CHEM_MEDICALBAG); //cost, item + BuyChem(15, IID_CHEM_RADX, 5); //cost, item if (self.impulse == 3) - BuyChem(10, IID_CHEM_SUPERSTIM); //cost, item + BuyChem(15, IID_CHEM_ADRENALINE, 25); //cost, item if (self.impulse == 4) - BuyChem(12, IID_CHEM_ADRENALINE); //cost, item + BuyChem(25, IID_CHEM_MEDICALBAG, 100); //cost, item if (self.impulse == 5) - BuyChem(18, IID_CHEM_PSYCHO); //cost, item + BuyChem(25, IID_CHEM_SUPERSTIM, 1); //cost, item if (self.impulse == 6) - BuyChem(21, IID_CHEM_BESERK); //cost, item + BuyChem(25, IID_CHEM_PSYCHO, 25); //cost, item + if (self.impulse == 7) + BuyChem(25, IID_CHEM_BESERK, 25); //cost, item + return; } - - if (self.currentmenu == "shop_other") + else if (self.currentmenu == "shop_other") { if (self.impulse == 1) - BuyChem(5, IID_CHEM_MEDICALBAG); + BuyStackableMulti(1, IID_MISC_JUNK, 1); //weight, cost, item + if (self.impulse == 2) + BuyStackableMulti(1, IID_MISC_NUKACOLA, 1); //weight, cost, item if (self.impulse == 3) - BuyStackable(20, IID_BUILD_MRAMMO); + BuyStackableMulti(2, IID_MISC_CHEMICALS, 1); //weight, cost, item if (self.impulse == 4) - BuyStackable(20, IID_BUILD_AUTODOC); + BuyStackableMulti(2, IID_MISC_AEROSOL, 1); //weight, cost, item if (self.impulse == 5) - BuyStackable(20, IID_BUILD_SHIELDGEN); + BuyStackableMulti(5, IID_MISC_CIRCUITBOARD, 1); //weight, cost, item if (self.impulse == 6) - BuyStackable(20, IID_BUILD_TTURRET); + BuyStackableMulti(3, IID_MISC_STEELPIPE, 1); //weight, cost, item + if (self.impulse == 7) + BuyStackableMulti(1, IID_MISC_DUCKTAPE, 1); //weight, cost, item + if (self.impulse == 8) + BuyStackableMulti(1, IID_MISC_GUM, 1); //weight, cost, item + if (self.impulse == 9) + BuyStackableMulti(1, IID_MISC_COPPERWIRE, 1); //weight, cost, item + if (self.impulse == 10) + BuyStackableMulti(7, IID_MISC_XRAYTUBE, 1); //weight, cost, item + return; } - - - if (self.currentmenu == "select_team") + else if (self.currentmenu == "select_team") { if (self.impulse == 1) { + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); bprint(2, self.netname); bprint(2, " has joined the rangers.\n"); self.currentmenu = "confirm_team"; @@ -689,6 +885,7 @@ void() W_PlayerMenu = } if (self.impulse == 2) { + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); bprint(2, self.netname); bprint(2, " has joined the raiders.\n"); self.currentmenu = "confirm_team"; @@ -698,59 +895,62 @@ void() W_PlayerMenu = } } - - if (self.currentmenu == "select_skill") + else if (self.currentmenu == "select_skill") { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); - if (self.impulse == 1) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 80; - self.class = 1; + self.tclass = 1; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nMedic - OK?\n1‘ Yes \n2‘ No \n"); + centerprint (self, "your skill-set will be‘\n\nfirst aid - OK?\n1‘ Yes \n2‘ No \n\nprimary: first aid\nsecondary: buff allies\n"); self.ghost = 0; return; } if ((self.impulse == 2)) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 70; - self.class = 2; + self.tclass = 2; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nAssassin - OK?\n1‘ Yes \n2‘ No \n"); + centerprint (self, "your skill-set will be‘\n\nstealth - OK?\n1‘ Yes \n2‘ No \n\nprimary: stealth\nsecondary: damage"); self.ghost = 0; return; } if (self.impulse == 3) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; self.max_health = 100; - self.class = 3; + self.tclass = 3; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nSoldiier - OK?\n1‘ Yes \n2‘ No \n"); + centerprint (self, "your skill-set will be‘\n\ncombat - OK?\n1‘ Yes \n2‘ No \n\nprimary: survival\nsecondary: damage"); self.ghost = 0; return; } if (self.impulse == 4) { + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.max_health = 80; self.currentmenu = "none"; - self.class = 4; + self.tclass = 4; self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nScientist - OK?\n1‘ Yes \n2‘ No \n"); + centerprint (self, "your skill-set will be‘\n\nscience - OK?\n1‘ Yes \n2‘ No \n\nprimary: create\nsecondary: bypass"); self.ghost = 0; return; } } - - - if (self.currentmenu == "confirm_team") + else if (self.currentmenu == "confirm_team") { if (self.impulse == 1) { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "select_skill"; DisplayMenu(); self.impulse = 0; @@ -758,7 +958,7 @@ void() W_PlayerMenu = } if (self.impulse == 2) { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "select_team"; DisplayMenu(); self.impulse = 0; @@ -766,20 +966,26 @@ void() W_PlayerMenu = return; } } - if (self.currentmenu == "confirm_skill") + else if (self.currentmenu == "confirm_skill") { if (self.impulse == 1) { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); + self.missionbrief = 0; + self.class = self.tclass; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; centerprint(self, ""); PutClientInServer(); + bprint(2, self.netname); + bprint(2, " has entered the wasteland.\n"); + self.class = self.tclass; + total_players = total_players + 1; self.impulse = 0; return; } if (self.impulse == 2) { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "select_skill"; DisplayMenu(); self.impulse = 0; @@ -787,5 +993,394 @@ void() W_PlayerMenu = return; } } + else if (self.currentmenu == "display_enter_screen") + { + if (self.impulse == 1 && coop == 1) + { + if (time > 3000) + { + self.currentmenu = "display_wait_screen"; + return; + } + self.missionbrief = 1; + self.team = 1; + self.connected = 1; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); + centerprint(self, "\n"); + self.currentmenu = "display_brief"; + DisplayMenu(); + self.impulse = 0; + return; + } + else if (self.impulse == 1 && coop == 0) + { + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); + self.connected = 1; + self.currentmenu = "select_team"; + DisplayMenu(); + self.impulse = 0; + return; + } + } + else if (self.currentmenu == "display_brief") + { + if (self.impulse == 1) + { + if (self.class > 0) + { + self.missionbrief = 0; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); + self.currentmenu = "none"; + centerprint(self, ""); + PutClientInServer(); + bprint(2, self.netname); + bprint(2, " has entered the wasteland.\n"); + total_players = total_players + 1; + return; + } + self.team = 1; + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); + self.currentmenu = "select_skill"; + DisplayMenu(); + self.impulse = 0; + return; + } + } + else if (self.currentmenu == "select_mission") + { + if (self.impulse == 1) + { + if (infokey(world, "objective") == "return" || infokey(world, "objective") == "start") + get_new_mission(); + else + { + sprint(self, 2, "you're already on a mission!\n"); + self.currentmenu = "none"; + return; + } + self.team = 1; + sound (self, CHAN_WEAPON, "effects/radio2.wav", TRUE, ATTN_IDLE); + centerprint(self, "mission obtained\n"); + self.currentmenu = "none"; + self.impulse = 0; + return; + } + else if (self.impulse == 2) + { + centerprint(self, "\n"); + self.currentmenu = "none"; + self.impulse = 0; + return; + } + } + else if (self.currentmenu == "confirm_depart") + { + if (self.impulse == 1) + { + if (infokey(world, "objective") == "return") + { + sprint(self, 2, "you're not on a mission!\n"); + self.currentmenu = "none"; + return; + } + else + { + changelevel(m_map); + return; + } + } + else if (self.impulse == 2) + { + centerprint(self, "\n"); + self.currentmenu = "none"; + self.impulse = 0; + return; + } + } + else if (self.currentmenu == "menu_lockpick") + { + if (self.impulse == 1) + { + if (self.chest.inplace == 1 && self.chest.tumbler1.inplace == 1 && self.chest.tumbler2.inplace == 1) + { + local entity te; + local float greed; + te = findradius (self.origin, 600); + while (te) + { + if (te.classname == "player" && te != self) + greed = 0; + else + greed = 1; + + te = te.chain; + } + /* + if (greed == 1) + self.score = self.score - 50; + else + self.score = self.score - 25;*/ + + self.chest.solid = SOLID_NOT; + + sound (self, CHAN_WEAPON, "effects/openlock.wav", TRUE, ATTN_NORM); + sprint(self, 2, "you manage to pick the lock. you find:\n"); + if (random()<1) + { + sprint(self, 2, "‘ money ("); + xx = 10 + ceil(random()*30); + yy = ftos(xx); + sprint(self, 2, yy); + sprint(self, 2, ")\n"); + self.ammo_shells = self.ammo_shells + xx; + } + if (random()<0.5) + { + xx = ceil(random()*2); + DropFromChest(self.chest.owner, IID_CHEM_STIMPACK, xx); + sprint(self, 2, "‘ stimpacks ("); + yy = ftos(xx); + sprint(self, 2, yy); + sprint(self, 2, ")\n"); + } + if (random()<0.75) + { + xx = ceil(309+random()*12); + yy = GetItemName(xx); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, xx, 1); + //TryGiveStackable(self, xx, 1); + } + if (random()<0.75) + { + xx = ceil(309+random()*12); + yy = GetItemName(xx); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, xx, 1); + //TryGiveStackable(self, xx, 1); + } + if (random()<0.75) + { + xx = ceil(309+random()*12); + yy = GetItemName(xx); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, xx, 1); + //TryGiveStackable(self, xx, 1); + } + if (random()<0.75) + { + xx = ceil(309+random()*12); + yy = GetItemName(xx); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, xx, 1); + //TryGiveStackable(self, xx, 1); + } + if (random()<0.05) + { + yy = GetItemName(IID_WP_MP9); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_WP_MP9, 30); + //AddNonStackable(self, IID_WP_MP9, 30); + } + if (random()<0.05) + { + yy = GetItemName(IID_WP_NEEDLER); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_WP_NEEDLER, 10); + //AddNonStackable(self, IID_WP_NEEDLER, 10); + } + if (random()<0.50) + { + yy = GetItemName(IID_ARM_LEATHER); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_ARM_LEATHER, 1); + //AddNonStackable(self, IID_ARM_LEATHER, 1); + } + if (random()<0.05) + { + yy = GetItemName(IID_WP_PIPERIFLE_SCOPE_S); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_WP_PIPERIFLE_SCOPE_S, 1); + //AddNonStackable(self, IID_WP_PIPERIFLE_SCOPE_S, 1); + //AddNonStackable(self, IID_AM_44MAGNUM, 12); + } + if (random()<0.05) + { + yy = GetItemName(IID_WP_USP); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_WP_USP, 12); + //AddNonStackable(self, IID_WP_USP, 10); + //AddNonStackable(self, IID_AM_45ACP, 12); + } + if (random()<0.05) + { + yy = GetItemName(IID_WP_WINCHESTER); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_WP_WINCHESTER, 2); + //AddNonStackable(self, IID_WP_WINCHESTER, 2); + //AddNonStackable(self, IID_AM_12GAUGESHELLS, 18); + } + if (random()<0.75) + { + xx = ceil(309+random()*12); + yy = GetItemName(xx); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, xx, 1); + //TryGiveStackable(self, xx, 1); + } + if (random()<0.25) + { + yy = GetItemName(IID_GREN_FRAG); + sprint(self, 2, "‘ "); + sprint(self, 2, yy); + sprint(self, 2, "\n"); + DropFromChest(self.chest.owner, IID_GREN_FRAG, 1); + //TryGiveStackable(self, IID_GREN_FRAG, 1); + } + self.picking = 0; + self.chest.owner.picking = 2; + self.chest.owner.frame = 1; + self.currentmenu = "none"; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + return; + } + else + { + if (random()<0.90) + { + sprint(self, 2, "failed to pick the lock.\n"); + self.chest.owner.picking = 0; + } + else if (ToIID(self.islot4) == IID_EQUIP_TOOLKIT) + { + sprint(self, 2, "failed, almost jammed but super toolkit prevented.\n"); + self.chest.owner.picking = 0; + } + else + { + sprint(self, 2, "failed. lock is jammed.\n"); + self.chest.owner.picking = 3; + } + self.picking = 0; + self.currentmenu = "none"; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + return; + } + } + else if (self.impulse == 2) + { + self.picking = 0; + self.chest.owner.picking = 0; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + self.currentmenu = "none"; + self.impulse = 0; + return; + } + } + else if (self.currentmenu == "menu_defuse") + { + if (self.impulse == 1) + { + if (self.chest.inplace == 1 && self.chest.tumbler1.inplace == 1 && self.chest.tumbler2.inplace == 1) + { + + if (self.chest.owner.rtime <= 0) + { + sound (self, CHAN_WEAPON, "effects/beep1.wav", TRUE, ATTN_NORM); + sprint(self, 2, "you manage to disarm the bomb\n"); + + self.score = self.score + 75; + spawn_excla(self.chest.owner, 3000); + remove(self.chest.owner); + self.picking = 0; + self.chest.owner.picking = 2; + self.chest.owner.frame = 1; + self.currentmenu = "none"; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + return; + } + else + { + sprint(self, 2, "almost got it... "); + self.chest.owner.rtime = self.chest.owner.rtime - 1; + x = ftos(self.chest.owner.rtime); + sprint(self, 2, x); + sprint(self, 2, " circuits left\n"); + + return; + } + } + else + { + if (random()<0.75) + { + sprint(self, 2, "oops! slipped...\n"); + self.chest.owner.picking = 0; + } + else if (ToIID(self.islot4) == IID_EQUIP_TOOLKIT) + { + sprint(self, 2, "failed, almost jammed but super toolkit prevented.\n"); + self.chest.owner.picking = 0; + } + else + { + sprint(self, 2, "oops! circuits have been shorted. "); + self.chest.owner.rtime = self.chest.owner.rtime + 1; + self.chest.owner.picking = 0; + x = ftos(self.chest.owner.rtime); + sprint(self, 2, x); + sprint(self, 2, " circuits left\n"); + } + self.picking = 0; + self.currentmenu = "none"; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + return; + } + } + else if (self.impulse == 2) + { + self.picking = 0; + self.chest.owner.picking = 0; + remove(self.chest.tumbler1); + remove(self.chest.tumbler2); + remove(self.chest); + self.currentmenu = "none"; + self.impulse = 0; + return; + } + } }; \ No newline at end of file diff --git a/quakec/fallout2/mod_menus.qc b/quakec/fallout2/mod_menus.qc index 5b9a83c83..602f371f1 100644 --- a/quakec/fallout2/mod_menus.qc +++ b/quakec/fallout2/mod_menus.qc @@ -225,9 +225,10 @@ string () SmallArmString2 = */ string () SmallArmString3 = { - return ("rifles\n RIFLE | TYPE | WEIGHT | PRICE \n\n1‘ rangemaster 7mm 03 11$\n2‘ ak-112 5mm 04 21$\n3‘ remington .308 05 24$\n4‘ ak-74 5mm 04 27$\n5‘ moonlight .223 05 36$\n6‘ sa-80 5mm 05 23$\n7‘ plasma rifle 07 41$\n8‘ gauss rifle 2mm 08 51$\n"); + return ("rifles\n RIFLE | TYPE | WEIGHT | PRICE \n\n1‘ rangemaster 7mm 03 11$\n2‘ ak-112 5mm 04 21$\n3‘ fn-fal .308 08 27$\n4‘ widowmaker .308 09 24$\n5‘ moonlight .223 05 36$\n6‘ hk g11 5mm 05 23$\n"); }; + string () DrugString1 = { return ("drugs\n DRUG | EFFECTS | PRICE\n" diff --git a/quakec/fallout2/monsters.qc b/quakec/fallout2/monsters.qc index 6321e7362..f12dfd54f 100644 --- a/quakec/fallout2/monsters.qc +++ b/quakec/fallout2/monsters.qc @@ -66,6 +66,9 @@ void() monster_death_use = void() walkmonster_start_go = { + local float replace; + local vector back; + self.origin_z = self.origin_z + 1; // raise off floor a bit droptofloor(); @@ -74,6 +77,17 @@ void() walkmonster_start_go = dprint ("walkmonster in wall at: "); dprint (vtos(self.origin)); dprint ("\n"); + back = self.origin; + replace = 90; + while (!walkmove(0,0) && replace > 0) + { + setorigin(self, back); + self.origin_x = self.origin_x + crandom()*600; + self.origin_y = self.origin_y + crandom()*600; + self.origin_z = self.origin_z + 1; // raise off floor a bit + droptofloor(); + replace = replace - 1; + } } self.takedamage = DAMAGE_AIM; @@ -97,7 +111,7 @@ void() walkmonster_start_go = dprint ("\n"); } // this used to be an objerror - if (self.movetarget.classname == "path_corner") + if (self.movetarget.classname == "path_corner" || self.movetarget.classname == "rhostage") self.th_walk (); else self.pausetime = 99999999; diff --git a/quakec/fallout2/name.qc b/quakec/fallout2/name.qc index ccc15d2f8..bded5efbe 100644 --- a/quakec/fallout2/name.qc +++ b/quakec/fallout2/name.qc @@ -61,29 +61,8 @@ string () GetPerkName = local string name; local float slot; - slot = self.perk; - if (slot == 0) - name = "none"; - if (slot == 1) - name = "medic's bag"; - else if (slot == 2) - name = "security alarm"; - else if (slot == 3) - name = "remote camera"; - else if (slot == 4) - name = "belt pouch"; - else if (slot == 5) - name = "backpack"; - else if (slot == 6) - name = "toolkit mark ii"; - else if (slot == 7) - name = "climbing gear"; - else if (slot == 8) - name = "enhanced battery"; - else if (slot == 9) - name = "stealth-boy"; - return name; + return "perk"; }; string () GetTraitName = @@ -91,28 +70,5 @@ string () GetTraitName = local string name; local float slot; - slot = self.trait; - - if (slot == 0) - name = "none"; - else if (slot == 1) - name = "medic's bag"; - else if (slot == 2) - name = "security alarm"; - else if (slot == 3) - name = "remote camera"; - else if (slot == 4) - name = "belt pouch"; - else if (slot == 5) - name = "backpack"; - else if (slot == 6) - name = "toolkit mark ii"; - else if (slot == 7) - name = "climbing gear"; - else if (slot == 8) - name = "enhanced battery"; - else if (slot == 9) - name = "stealth-boy"; - - return name; + return "trait"; }; \ No newline at end of file diff --git a/quakec/fallout2/ogre.qc b/quakec/fallout2/ogre.qc index e15ad15fe..b49b6e6da 100644 --- a/quakec/fallout2/ogre.qc +++ b/quakec/fallout2/ogre.qc @@ -1,3 +1,169 @@ +#define mag1 currentammo +#define maxmag1 cnt + +void () OgreFirePlasma = +{ + + local float x; + local vector dist, vec; + + newmis = spawn (); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + newmis.classname = "grenade"; + + newmis.skin = 0; + makevectors (self.angles); + sound (self, CHAN_WEAPON, "weapons/energy2.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + + newmis.touch = PlasmaBolt; + newmis.velocity = v_forward * 1200; + newmis.angles = vectoangles (newmis.velocity); + newmis.touch = PlasmaBolt; + newmis.voided = 0; + + + makevectors (self.enemy.angles); + dist = self.enemy.origin - x*self.movedir; + + vec = normalize(dist - self.origin); + sound (self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); + launch_spike (self.origin, vec); + newmis.velocity = vec*600; + newmis.owner = self.owner; + newmis.classname = "wizspike"; + newmis.touch = wizspike_touch; + setmodel (newmis, "progs/w_spike.mdl"); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + + + newmis.nextthink = time + 5; + newmis.think = SUB_Remove; + newmis.nextthink = (time + 1.5); + + newmis.effects = EF_BLUE; + setmodel (newmis, "progs/plasma.mdl"); + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + setorigin (newmis, ((self.origin + (v_right * TE_BLOOD)) + (v_up * TE_BLOOD))); +}; + + +void () ogre_load1 = [ 136, ogre_load2 ] +{ +}; +void () ogre_load2 = [ 136, ogre_load3 ] +{ +}; +void () ogre_load3 = [ 137, ogre_load4 ] +{ +}; +void () ogre_load4 = [ 137, ogre_load5 ] +{ +}; +void () ogre_load5 = [ 138, ogre_load6 ] +{ +}; +void () ogre_load6 = [ 138, ogre_load7 ] +{ +}; +void () ogre_load7 = [ 139, ogre_load8 ] +{ +}; +void () ogre_load8 = [ 139, ogre_load9 ] +{ +}; +void () ogre_load9 = [ 140, ogre_load10 ] +{ +}; +void () ogre_load10 = [ 140, ogre_load11 ] +{ +}; +void () ogre_load11 = [ 141, ogre_load12 ] +{ +}; +void () ogre_load12 = [ 141, ogre_load13 ] +{ +}; +void () ogre_load13 = [ 142, ogre_load14 ] +{ +}; +void () ogre_load14 = [ 142, ogre_load16 ] +{ +}; +void () ogre_load15 = [ 143, ogre_load16 ] +{ +}; +void () ogre_load16 = [ 143, ogre_run1 ] +{ +}; + +//SMG +void (float tmp, float dam) ogre_smg = +{ + local vector src; + local vector dir; + local vector direction; + local entity en; + local vector org; + + if (self.mag1 <= 0) + { + sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + ogre_load1(); + self.mag1 = 60; + return; + } + + muzzleflash (); + + self.weapon = 5; + + sound (self, CHAN_WEAPON, "weapons/mp7.wav", 1, ATTN_NORM); + + + tmp = 350; + + + dam = 15; + + if (self.enemy.sneak == 1) + tmp = tmp * 2; + + self.mag1 = self.mag1 - 1; + + makevectors (self.angles); + + src = self.origin + v_forward*10; + src_z = self.absmin_z + self.size_z * 0.7; + + en = self.enemy; + + dir = en.origin - en.velocity*0.2; + if (en.position == 1) + dir = dir - '0 0 16'; + if (en.position == 2) + dir = dir - '0 0 32'; + dir = normalize (dir - self.origin); + + direction = dir; + + + traceline (src, src + direction*2000 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); + + if (trace_fraction == PLAT_LOW_TRIGGER) + return; + + if (trace_ent.takedamage) + { + SpawnBlood (org, PLAT_LOW_TRIGGER); + dam = 1 + random()*dam + random()*dam; + dam = dam * (1 - (trace_fraction)); + T_Damage (trace_ent, self, self, dam); + } + else + bullet_hole (trace_endpos); +}; void () OgreGrenadeExplode = { @@ -25,24 +191,30 @@ void () LobAGrenade = newmis.skin = 0; makevectors (self.angles); - newmis.velocity = v_forward * 800; - newmis.velocity_z = (newmis.velocity_z + 200); - newmis.angles = vectoangles (newmis.velocity); - newmis.avelocity_x = (random () * 300); - newmis.avelocity_y = (random () * 300); - newmis.avelocity_z = (random () * 300); - newmis.touch = HandGrenBounce; - newmis.nextthink = (time + 2.5); - -// if (iid == IID_GREN_FRAG) -// newmis.think = FragExplode; -// else if (iid == IID_GREN_EMP) -// newmis.think = EMPExplode; -// else if (iid == IID_GREN_SMOKE) - - newmis.think = SmokeThink; if (random() < 0.5) + { + newmis.think = StunExplode; + newmis.velocity = v_forward * 600; + newmis.velocity_z = (newmis.velocity_z + 200); + newmis.angles = vectoangles (newmis.velocity); + newmis.avelocity_x = (random () * 200); + newmis.avelocity_y = (random () * 200); + newmis.avelocity_z = (random () * 200); + newmis.touch = HandGrenBounce; + newmis.nextthink = (time + 1.5); + } + else + { newmis.think = FlashExplode; + newmis.velocity = v_forward * 80; + newmis.velocity_z = (newmis.velocity_z + 20); + newmis.angles = vectoangles (newmis.velocity); + newmis.avelocity_x = (random () * 30); + newmis.avelocity_y = (random () * 30); + newmis.avelocity_z = (random () * 30); + newmis.touch = HandGrenBounce; + newmis.nextthink = (time + 3); + } newmis.frame = 1; setmodel (newmis, "progs/handgren.mdl"); @@ -59,33 +231,19 @@ void (float side) chainsaw = local float ldmg; if (!self.enemy) - { return; - } + if (!CanDamage (self.enemy, self)) - { return; - } + ai_charge (TE_LAVASPLASH); delta = (self.enemy.origin - self.origin); if ((vlen (delta) > 100)) - { return; - } - ldmg = (TE_LIGHTNING3 + (random () * IDLE6A)); + + ldmg = (6 + (random()*6)); + T_Damage (self.enemy, self, self, ldmg); T_Damage (self.enemy, self, self, ldmg); - if (side) - { - makevectors (self.angles); - if ((side == PLAT_LOW_TRIGGER)) - { - SpawnMeatSpray ((self.origin + (v_forward * SECRET_YES_SHOOT)), ((crandom () * 100) * v_right)); - } - else - { - SpawnMeatSpray ((self.origin + (v_forward * SECRET_YES_SHOOT)), (side * v_right)); - } - } }; void () ogre_stand1 = [ 0, ogre_stand2 ] @@ -427,6 +585,7 @@ void () ogre_nail2 = [ 62, ogre_nail3 ] void () ogre_nail3 = [ 62, ogre_nail4 ] { + OgreFirePlasma(); ai_face (); }; @@ -443,7 +602,6 @@ void () ogre_nail5 = [ 64, ogre_nail6 ] void () ogre_nail6 = [ 65, ogre_nail7 ] { ai_face (); - LobAGrenade(); }; void () ogre_nail7 = [ 66, ogre_run1 ] @@ -463,26 +621,69 @@ void () ogre_nailb = [ 62, ogre_nailc ] void () ogre_nailc = [ 62, ogre_naild ] { - ai_face (); + ogre_smg(110, 17); + + if (visible(self.enemy)) + ai_face (); }; -void () ogre_naild = [ 63, ogre_naile ] +void () ogre_naild = [ 63, ogre_nailc ] { - ai_face (); + ogre_smg(110, 17); + + if (visible(self.enemy)) + ai_face (); }; -void () ogre_naile = [ 64, ogre_nailf ] +void () ogre_naile = [ 63, ogre_nailf ] { - ai_face (); - LobAGrenade(); + ogre_smg(120, 17); + if (visible(self.enemy)) + ai_face (); }; -void () ogre_nailf = [ 65, ogre_nailg ] +void () ogre_nailf = [ 62, ogre_nailg ] { - ai_face (); + ogre_smg(120, 17); + if (visible(self.enemy)) + ai_face (); }; -void () ogre_nailg = [ 66, ogre_run1 ] +void () ogre_nailg = [ 62, ogre_nailh ] +{ + ogre_smg(130, 17); + if (visible(self.enemy)) + ai_face (); +}; + +void () ogre_nailh = [ 63, ogre_naili ] +{ + ogre_smg(130, 17); + if (visible(self.enemy)) + ai_face (); +}; +void () ogre_naili = [ 63, ogre_nailj ] +{ + ogre_smg(140, 17); + if (visible(self.enemy)) + ai_face (); +}; + +void () ogre_nailj = [ 63, ogre_nailk ] +{ + ogre_smg(140, 17); + if (visible(self.enemy)) + ai_face (); +}; + +void () ogre_nailk = [ 63, ogre_naill ] +{ + ogre_smg(150, 17); + if (visible(self.enemy)) + ai_face (); +}; + +void () ogre_naill = [ 64, ogre_run1 ] { ai_face (); }; @@ -689,7 +890,6 @@ void (entity attacker, float damage) ogre_pain = void () ogre_die1 = [ 112, ogre_die2 ] { - self.solid = SOLID_NOT; }; void () ogre_die2 = [ 113, ogre_die3 ] @@ -698,9 +898,8 @@ void () ogre_die2 = [ 113, ogre_die3 ] void () ogre_die3 = [ 114, ogre_die4 ] { - DropBackpack (); - DropBackpack (); - DropBackpack (); + + self.rtime = 1; }; void () ogre_die4 = [ 115, ogre_die5 ] @@ -758,9 +957,8 @@ void () ogre_bdie2 = [ 127, ogre_bdie3 ] void () ogre_bdie3 = [ 128, ogre_bdie4 ] { - self.solid = SOLID_NOT; + self.rtime = 1; self.ammo_rockets = SILENT; - DropBackpack (); }; void () ogre_bdie4 = [ 129, ogre_bdie5 ] @@ -798,57 +996,49 @@ void () ogre_bdie10 = [ 135, ogre_bdie10 ] void () mutant_pain = { + local vector dir; + + if (self.rtime > 0) + { + self.health = 180; + return; + } + + dir = normalize(self.origin - self.enemy.origin); + self.velocity = dir * 10; + if (self.frame == 69) { - self.frame = 70; self.health = 180; - self.think = army_die1; - self.nextthink = time + 0.12; + self.frame = 70; self.think = ogre_die1; + self.nextthink = time + 0.12; } else { + self.health = 180; ThrowGib ("progs/zom_gib.mdl", -40); self.frame = 69; - self.health = 180; - self.think = ogre_die1; + self.think = ogre_bdie1; self.nextthink = time + 0.12; } self.attack = self.attack + 1; - - if (self.attack == 8) - { - if (random()*4 <= 2) - sound (self, CHAN_VOICE, "player/agdie1.wav", 1, ATTN_NORM); - else - sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - } - if (self.attack >= 16) - { - self.solid = SOLID_NOT; - - self.think = ogre_bdie1; - ThrowGib ("progs/zom_gib.mdl", -35); - ThrowGib ("progs/zom_gib.mdl", -35); - ThrowGib ("progs/gib1.mdl", -35); - } }; - void (vector stuff, vector ang) spawn_live_ogre = { local entity ogre; ogre = spawn (); ogre.origin = stuff; - ogre.enemy = world; + ogre.enemy = self.enemy; ogre.attack_finished = time + 10; ogre.solid = SOLID_SLIDEBOX; ogre.movetype = MOVETYPE_STEP; ogre.takedamage = DAMAGE_YES; setmodel (ogre, "progs/ogre.mdl"); - setsize (ogre, '-20 -20 -24', '20 20 36'); + setsize (self, '-16 -16 -24', '16 16 48'); ogre.classname = "body"; ogre.netname = "dead"; ogre.health = 180; @@ -856,30 +1046,44 @@ void (vector stuff, vector ang) spawn_live_ogre = ogre.max_health = ogre.health; ogre.th_pain = mutant_pain; ogre.think = mutant_pain; + ogre.th_die = corpse_gib; ogre.nextthink = time + 0.05; }; void () ogre_die = { - if (self.enemy.classname == "player") - self.enemy.frags = self.enemy.frags + 1; - if (self.health <= -35) + if (random()<0.75) + DropMoney(); + if (random()<0.50) + DropMoney(); + if (random()<0.25) + DropMoney(); + + sound (self, CHAN_VOICE, "ogre/ogdth.wav", PLAT_LOW_TRIGGER, ATTN_IDLE); + +/* + spawn_live_ogre(self.origin, self.angles); + remove(self);*/ + + + self.solid = SOLID_NOT; + + if (self.frame == 69) { - self.solid = SOLID_NOT; - sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowGib ("progs/zom_gib.mdl", -30); - ThrowGib ("progs/zom_gib.mdl", -35); - ogre_bdie1 (); + self.health = 180; + self.frame = 70; + self.think = ogre_die1; + self.nextthink = time + 0.05; } else { - self.solid = SOLID_NOT; - spawn_live_ogre(self.origin, self.angles); - remove(self); + self.health = 180; + ThrowGib ("progs/zom_gib.mdl", -40); + self.frame = 69; + self.think = ogre_bdie1; + self.nextthink = time + 0.05; } - - sound (self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM); }; void () ogre_melee = @@ -896,6 +1100,11 @@ void () ogre_melee = void () monster_ogre = { + if (self.zone == 0) + { + load_monster(); + return; + } precache_model ("progs/ogre.mdl"); precache_model ("progs/h_ogre.mdl"); precache_model ("progs/grenade.mdl"); @@ -906,24 +1115,36 @@ void () monster_ogre = precache_sound ("ogre/ogpain1.wav"); precache_sound ("ogre/ogsawatk.wav"); precache_sound ("ogre/ogwake.wav"); + + + self.weapon = 1;//ak47 + + self.solid = SOLID_SLIDEBOX; self.movetype = MOVETYPE_STEP; setmodel (self, "progs/ogre.mdl"); self.netname = "mutant"; self.classname = "monster"; - setsize (self, '-24 -24 -24', '24 24 48'); - self.health = 280; + setsize (self, '-16 -16 -24', '16 16 48'); + self.health = 200; self.team = 3; - self.armorvalue = 0; + self.islot3 = SlotVal(IID_ARM_SHIRT, 1); self.armornoise = "misc/thud.wav"; self.th_stand = ogre_stand1; self.th_walk = ogre_walk1; self.th_run = ogre_run1; self.th_die = ogre_die; self.th_melee = ogre_melee; - self.th_missile = ogre_nail1; self.th_pain = ogre_pain; - self.armortype = 0; + + if (self.weapon == 1) + self.th_missile = ogre_naila; + else if (self.weapon == 2) + self.th_missile = ogre_nail1; + + self.mag1 = 30; + self.maxmag1 = 30; + self.weapon = ceil(random()*3); walkmonster_start (); }; diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index fde7e68ed..6edea438c 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -3,6 +3,85 @@ void () make_bubbles; void () bubble_remove; void () PlayerDead; void () player_diea1; +void () player_walk; +void () player_slow; + +$cd /raid/quake/id1/models/enforcer +$origin 0 -6 24 +$base base +$skin skin + +void() corpse_gib = +{ + self.solid = SOLID_NOT; +}; + + +// +// running +// +$frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 + +$frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6 + +// +// standing +// +$frame stand1 stand2 stand3 stand4 stand5 + +$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 +$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 + + +// +// pain +// +$frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6 + +$frame pain1 pain2 pain3 pain4 pain5 pain6 + + +// +// death +// + +$frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6 +$frame axdeth7 axdeth8 axdeth9 + +$frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8 +$frame deatha9 deatha10 deatha11 + +$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8 +$frame deathb9 + +$frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8 +$frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15 + +$frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7 +$frame deathd8 deathd9 + +$frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7 +$frame deathe8 deathe9 + +// +// attacks +// +$frame nailatt1 nailatt2 + +$frame light1 light2 + +$frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6 + +$frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6 + +$frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6 + +$frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6 + +$frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6 + +$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6 + void () player_duck = [ 45, player_run ] { @@ -12,6 +91,153 @@ void () player_lay = [ 45, player_run ] { }; +void () player_single_shot = [ 89, player_single_shot2 ]{}; +void () player_single_shot2 = [ 90, player_run ]{}; +void () player_single_shot_duck = [ 183, player_single_shot_duck2 ]{}; +void () player_single_shot_duck2 = [ 184, player_run ]{}; + + +void() idle_frames = +{ + local float weap; + local string x; + + self.weaponframe = 0; + return; + +}; + + + +void() army_radio1; +void (vector org) spawn_tracer; + +void (float db) loud_noise = +{ + //db is loudness factor + //10 is low and 50 is high + //10 would be a footstep + //50 would be a gunshot + + local vector dir, start, org; + local entity te; + local string z, dt; + local float x, y, d, t, v, md; + + if (db >= 50)//big rifles and guns can be heard through thick walls + md = 3; + else if (db >= 30)//things like SMGs and pistols, a little less + md = 2; + else if (db >= 15)//miscellaneous, richochets, silenced guns + md = 1; + else//very quiet things cannot be heard through doors + md = 0; + + te = findradius(self.origin, db*40); + + while (te) + { + if (te.classname == "monster" && te.enemy.classname != "player") + { + dir = normalize(te.origin - self.origin); + v = vlen(te.origin - self.origin); + t = 32; + d = 0; + + while (t < v) + { + start = (self.origin + (dir*t)); + + if (pointcontents (start) == CONTENT_SOLID) + d = d + 1; + + //spawn_tracer(start); + t = t + 32; + } + + if (x < db*20 && d <= md) + { + te.enemy = self; + te.think = HuntTarget; + te.nextthink = time + 0.25; + te.alert = 20; + + if (world.map_obj == OBJ_SHADOW && self.has_radio == 1) + { + spawn_excla(self, 8); + bprint(2, self.netname); + bprint(2, " is calling for help! silence him!\n"); + self.rtime = 0; + army_radio1(); + return; + } + } + else + te.alert = 20; + } + + te = te.chain; + } + + traceline (self.origin, te.origin, FALSE, self); + if (trace_fraction == 1.0) + return; + +}; + +void (float db) monster_noise = +{ + //db is loudness factor + //10 is low and 50 is high + //10 would be a footstep + //50 would be a gunshot + + local vector dir, start, org; + local entity te; + local string z, dt; + local float x, y, d, t, v, md; + + if (db >= 50) + md = 3; + else if (db >= 30) + md = 2; + else if (db >= 15) + md = 1; + else + md = 0; + + te = findradius(self.origin, db*40); + + while (te) + { + if (te.classname == "monster" && te.enemy.classname == "world") + { + dir = normalize(te.origin - self.origin); + v = vlen(te.origin - self.origin); + t = 32; + d = 0; + + while (t < v) + { + start = (self.origin + (dir*t)); + + if (pointcontents (start) == CONTENT_SOLID) + d = d + 1; + + t = t + 32; + } + } + + te = te.chain; + } + + traceline (self.origin, te.origin, FALSE, self); + if (trace_fraction == 1.0) + return; + +}; + + void () Footstep = { local float rand; @@ -22,13 +248,17 @@ void () Footstep = if (self.sneak != 0) return; - if (self.perk == 5) + if (getperk(6)) r = 0.5; else - { r = 1; - if (random()*4<=1) - self.show_hostile = time + 0.1; + + if (self.classname == "player") + { + if (getperk(6)) + loud_noise(10); + else + loud_noise(20); } if (world.worldtype == 1 || world.worldtype == 2) @@ -63,8 +293,8 @@ float (entity guy) holding_melee = if (iid == IID_NONE || iid == IID_WP_KNIFE || iid == IID_WP_AXE || - iid == IID_WP_VIBROBLADE || - iid == IID_WP_POWERAXE) + iid == IID_WP_SPEAR || + iid == IID_WP_WRENCH) return true; return false; }; @@ -73,7 +303,8 @@ void () player_crouch; void () player_stand1 = [ 149, player_stand1 ] { if (self.rtime < time && self.attack == 0) - self.weaponframe = 0; + idle_frames(); + if (self.position == 1) { @@ -94,7 +325,7 @@ void () player_stand1 = [ 149, player_stand1 ] player_run (); return; } - if (self.walkframe >= 5) + if (self.walkframe >= 4) self.walkframe = 0; self.frame = 149 + self.walkframe; @@ -119,12 +350,15 @@ void () player_crouch = [ 45, player_run ] return; } } - self.frame = (36 + self.walkframe); - if ((self.walkframe >= TE_TELEPORT)) - { - self.walkframe = MULTICAST_ALL; - } - self.walkframe = (self.walkframe + WEAPON_SHOTGUN); + + idle_frames(); + + self.frame = (35 + self.walkframe); + + if (self.walkframe == 11) + self.walkframe = 0; + + self.walkframe = (self.walkframe + 1); }; void () player_climb = [ 23, player_run ] @@ -145,14 +379,17 @@ void () player_climb = [ 23, player_run ] void () player_run = [ 137, player_run ] { - if (self.rtime < time) - self.weaponframe = 0; + if (self.rtime <= time) + idle_frames(); if (self.equipment_slot) if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_CLIMBINGGEAR) { - player_climb(); - return; + if (self.gravity == 0) + { + player_climb(); + return; + } } if ((!self.velocity_x && !self.velocity_y)) @@ -173,17 +410,150 @@ void () player_run = [ 137, player_run ] return; } } - if (self.walkframe == 1 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0) + + if (self.speedmulti <= 0.60) + { + player_slow (); + return; + } + else if (self.speedmulti <= 0.80) + { + player_walk (); + return; + } + + if (self.walkframe == 2 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0) + Footstep (); + if (self.walkframe == 5 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0) Footstep (); - if (self.walkframe == 4 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0) + idle_frames(); + + self.frame = (137 + self.walkframe*2); + + self.walkframe = self.walkframe + 1; + + if (self.walkframe == 6) + self.walkframe = 0; +}; + +void () player_walk = [ 170, player_walk ] +{ + if (self.rtime <= time) + self.weaponframe = 0; + + if (self.equipment_slot) + if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_CLIMBINGGEAR) + { + if (self.gravity == 0) + { + player_climb(); + return; + } + } + + if (!self.velocity_x && !self.velocity_y) + { + player_stand1 (); + return; + } + if (self.position == 1) + { + player_crouch (); + return; + } + else + { + if (self.position == 2) + { + player_lay (); + return; + } + } + + if (self.speedmulti > 0.80) + { + player_run (); + return; + } + else if (self.speedmulti <= 0.60) + { + player_slow (); + return; + } + + if (self.walkframe == 3 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0) Footstep (); - if (self.walkframe == 7 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0) + if (self.walkframe == 8 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0) Footstep (); - self.frame = (137 + self.walkframe); - if (self.walkframe >= 9) + idle_frames(); + + self.frame = (170 + self.walkframe); + + if (self.walkframe == 11) + self.walkframe = 0; + + self.walkframe = (self.walkframe + 1); +}; + +void () player_slow = [ 170, player_slow ] +{ + if (self.rtime <= time) + self.weaponframe = 0; + + if (self.equipment_slot) + if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_CLIMBINGGEAR) + { + if (self.gravity == 0) + { + player_climb(); + return; + } + } + + if (!self.velocity_x && !self.velocity_y) + { + player_stand1 (); + return; + } + if (self.position == 1) + { + player_crouch (); + return; + } + else + { + if (self.position == 2) + { + player_lay (); + return; + } + } + + if (self.speedmulti > 0.80) + { + player_run (); + return; + } + else if (self.speedmulti > 0.60) + { + player_walk (); + return; + } + + if (self.walkframe == 6 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0) + Footstep (); + + if (self.walkframe == 18 && self.ghost == 0 && self.position == 0 && self.velocity_z == 0) + Footstep (); + + idle_frames(); + + self.frame = (170 + floor(self.walkframe/2)); + + if (self.walkframe == 22) self.walkframe = 0; self.walkframe = (self.walkframe + 1); @@ -449,6 +819,17 @@ void () player_jump8 = [ 49, player_jump9 ] void () player_jump9 = [ 48, player_run ] { }; +void() player_singlex = [89, player_singlex2 ] {muzzleflash();}; +void() player_singlex2 = [89, player_run ] {muzzleflash();}; + +void() player_singley = [90, player_singley2 ] {muzzleflash();}; +void() player_singley2 = [90, player_run ] {muzzleflash();}; + +void() player_auto_duck1 = [182, player_auto_duck2 ] {muzzleflash();}; +void() player_auto_duck2 = [182, player_run ] {muzzleflash();}; + +void() player_auto_ducka1 = [183, player_auto_ducka2 ] {muzzleflash();}; +void() player_auto_ducka2 = [183, player_run ] {muzzleflash();}; void () player_single1_left = [ 88, player_single2_left ] { @@ -530,12 +911,13 @@ void () player_shotty4 = [ 91, player_run ] void () player_pull1 = [ 155, player_pull2 ] { - self.weaponframe = WEAPON_SHOTGUN; + self.weaponframe = 1; }; void () player_pull2 = [ 156, player_pull3 ] { - self.weaponframe = WEAPON_ROCKET; + self.weaponframe = 2; + sound (self, CHAN_WEAPON, "weapons/gpull.wav", WEAPON_SHOTGUN, ATTN_IDLE); }; void () player_pull3 = [ 157, player_pull4 ] @@ -556,7 +938,6 @@ void () player_pull5 = [ 157, player_pull6 ] void () player_pull6 = [ 156, player_pull7 ] { self.weaponframe = TE_LIGHTNING2; - sound (self, CHAN_WEAPON, "weapons/gpull.wav", WEAPON_SHOTGUN, ATTN_IDLE); }; void () player_pull7 = [ 155, player_pull8 ] @@ -580,81 +961,33 @@ void () player_pull10 = [ 155, player_pull11 ] self.weaponframe = 10; }; -void () player_pull11 = [ 155, player_run ] +void () player_pull11 = [ 155, player_throw1 ] { self.weaponframe = 11; }; void () player_throw1 = [ 155, player_throw2 ] { + if (self.attack_finished > time) + return; + self.attack_finished = time + 1; - self.weaponframe = 12; + self.weaponframe = 13; if (((random () * WEAPON_BIG) <= WEAPON_SPIKES)) sound (self, CHAN_VOICE, "radio/grenade.wav", 0.7, ATTN_NORM); else sound (self, CHAN_VOICE, "radio/lookout.wav", 0.7, ATTN_NORM); }; -void () player_throw2 = [ 156, player_throw3 ] +void () player_throw2 = [ 156, player_run ] { - self.weaponframe = TE_LIGHTNINGBLOOD; + self.weaponframe = 14; + if (self.grenslot == 0) + self.grenslot = self.current_slot; + FireHandGrenade (); self.attack_finished = time + 1; -}; - -void () player_throw3 = [ 157, player_throw4 ] -{ - self.weaponframe = IDLE2A; - self.attack_finished = time + 1; -}; - -void () player_throw4 = [ 158, player_throw5 ] -{ - self.weaponframe = IDLE3A; - self.attack_finished = time + 1; -}; - -void () player_throw5 = [ 157, player_throw6 ] -{ - self.weaponframe = EF_FLAG1; - self.attack_finished = time + 1; -}; - -void () player_throw6 = [ 156, player_throw7 ] -{ - self.weaponframe = IDLE5A; - self.attack_finished = time + 1; -}; - -void () player_throw7 = [ 155, player_throw8 ] -{ - self.weaponframe = IDLE6A; - self.attack_finished = time + 1; -}; - -void () player_throw8 = [ 159, player_throw9 ] -{ - self.weaponframe = IDLE7A; - self.attack_finished = time + 1; -}; - -void () player_throw9 = [ 160, player_throw10 ] -{ - self.weaponframe = IDLE8A; - self.attack_finished = time + 1; -}; - -void () player_throw10 = [ 161, player_throw11 ] -{ - self.weaponframe = IDLE9A; - self.attack_finished = time + 1; -}; - -void () player_throw11 = [ 162, player_run ] -{ - self.weaponframe = IDLE10A; - self.attack_finished = self.nextthink; W_SetCurrentAmmo(); }; @@ -678,36 +1011,220 @@ void () player_shotty4b = [ 184, player_run ] self.weaponframe = WEAPON_ROCKET; }; -void () player_knife1 = [ 155, player_knife2 ] +void () player_punch1 = [ 155, player_run ] { - self.weaponframe = WEAPON_SHOTGUN; + self.weaponframe = 1; + W_FireMelee (); }; - -void () player_knife2 = [ 156, player_knife3 ] +void () player_punch2 = [ 156, player_run ] { - self.weaponframe = WEAPON_ROCKET; + self.weaponframe = 2; W_FireMelee (); }; -void () player_knife3 = [ 157, player_run ] -{ - self.weaponframe = AS_MELEE; -}; -void () player_knifea = [ 155, player_knifeb ] +void () player_swing1 = [ 155, player_run ] { - self.weaponframe = WEAPON_SPIKES; -}; - -void () player_knifeb = [ 156, player_knifec ] -{ - self.weaponframe = MULTICAST_PVS_R; + self.attack_finished = time + 0.30; + self.weaponframe = 1; W_FireMelee (); }; -void () player_knifec = [ 157, player_run ] +void () player_swing1a = [ 155, player_run ] { - self.weaponframe = TE_LIGHTNING2; + self.attack_finished = time + 0.30; + self.weaponframe = 2; + W_FireMelee (); +}; + + +void () player_kick1 = [ 155, player_kick2 ] +{ + self.attack_finished = time + 0.40; + self.weaponframe = 7; +}; +void () player_kick2 = [ 156, player_kick3 ] +{ + self.weaponframe = 8; + W_FireMelee (); + W_FireMelee (); +}; +void () player_kick3 = [ 157, player_run ] +{ + self.weaponframe = 9; +}; + + + + +void () player_kick1a = [ 155, player_kick2a ] +{ + self.attack_finished = time + 0.40; + self.weaponframe = 10; +}; +void () player_kick2a = [ 156, player_kick3a ] +{ + self.weaponframe = 11; + W_FireMelee (); + W_FireMelee (); +}; +void () player_kick3a = [ 157, player_run ] +{ + self.weaponframe = 12; +}; + +void () player_kick1b = [ 155, player_kick2b ] +{ + self.attack_finished = time + 1; + self.weaponframe = 10; +}; +void () player_kick2b = [ 156, player_kick3b ] +{ + self.weaponframe = 10; + +}; +void () player_kick3b = [ 155, player_kick4b ] +{ + self.weaponframe = 11; + W_FireMelee (); + W_FireMelee (); +}; +void () player_kick4b = [ 156, player_kick5b ] +{ + self.weaponframe = 11; + W_FireMelee (); + W_FireMelee (); +}; +void () player_kick5b = [ 155, player_kick6b ] +{ + self.weaponframe = 12; + W_FireMelee (); + W_FireMelee (); +}; +void () player_kick6b = [ 156, player_run ] +{ + W_FireMelee (); + W_FireMelee (); + self.attack_finished = time + 1; + self.weaponframe = 12; +}; + +void () player_dragon_kick = +{ + self.velocity = self.velocity * 1.50; + self.velocity_x = self.velocity_x * 1.50; + self.velocity_y = self.velocity_y * 1.50; + + self.recoil = 30; + player_kick1b(); +}; + +void () player_knife1 = [ 91, player_knife2 ] +{ + self.weaponframe = 5; +}; + +void () player_knife2 = [ 92, player_knife3] +{ + self.weaponframe = 6; +}; + +void () player_knife3 = [ 93, player_run ] +{ + self.weaponframe = 7; + W_FireMelee (); +}; + +void () player_spear1 = [ 89, player_spear2 ] +{ + self.weaponframe = 5; +}; + +void () player_spear2 = [ 90, player_spear3 ] +{ + self.weaponframe = 6; +}; + +void () player_spear3 = [ 89, player_run ] +{ + self.weaponframe = 7; + W_FireMelee (); +}; + +void () player_spear1a = [ 89, player_spear2a ] +{ + self.weaponframe = 5; +}; +void () player_spear2a = [ 90, player_spear3a ] +{ + self.weaponframe = 6; +}; +void () player_spear3a = [ 89, player_run ] +{ + self.weaponframe = 7; + W_FireMelee (); +}; + +void () player_knifea = [ 91, player_knifeb ] +{ + self.weaponframe = 8; +}; + +void () player_knifeb = [ 92, player_knifec ] +{ + self.weaponframe = 9; +}; + +void () player_knifec = [ 93, player_run ] +{ + self.weaponframe = 10; + W_FireMelee (); +}; + +void () player_axe1 = [ 89, player_axe2 ] +{ + self.weaponframe = 1; +}; +void () player_axe2 = [ 89, player_axe3 ] +{ + self.weaponframe = 1; +}; +void () player_axe3 = [ 90, player_axe4 ] +{ + sound (self, CHAN_WEAPON, "effects/axe_swing.wav", TRUE, ATTN_NORM); + self.weaponframe = 2; +}; +void () player_axe4 = [ 90, player_axe5 ] +{ + self.weaponframe = 3; + W_FireMelee (); +}; +void () player_axe5 = [ 89, player_run ] +{ + self.weaponframe = 7; +}; + +void () player_axeb1 = [ 89, player_axeb2 ] +{ + self.weaponframe = 4; +}; +void () player_axeb2 = [ 89, player_axeb3 ] +{ + self.weaponframe = 4; +}; +void () player_axeb3 = [ 90, player_axeb4 ] +{ + sound (self, CHAN_WEAPON, "effects/axe_swing.wav", TRUE, ATTN_NORM); + self.weaponframe = 5; +}; +void () player_axeb4 = [ 90, player_axeb5 ] +{ + self.weaponframe = 6; + W_FireMelee (); +}; +void () player_axeb5 = [ 89, player_run ] +{ + self.weaponframe = 8; }; void () player_nail1 = [ 88, player_nail2 ] @@ -877,16 +1394,24 @@ void () player_pain6 = [ 19, player_run ] void () player_pain = { + self.pain_finished = time + 0.1; + self.missionbrief = 6; + if (self.pain_finished > time) { sound (self, CHAN_VOICE, self.armornoise, 1, ATTN_NORM); return; } - self.pain_finished = time + 0.5; + if ((self.health <= 40) && (getperk(9)) && (random()<=0.10)) + { + sprint(self, 2, "THE ZONE!\n"); + self.rage = 255; + self.ragetime = 10; + } - if (self.weaponframe) - return; + + self.pain_finished = time + 0.1; if (random () * WEAPON_BIG < WEAPON_SPIKES) sound (self, CHAN_VOICE, "player/paina.wav", WEAPON_SHOTGUN, ATTN_NORM); @@ -897,9 +1422,14 @@ void () player_pain = if (self.invisible_finished > time) return; - self.maxspeed = (self.maxspeed * 0.6); + if (getperk(1)) + self.maxspeed = (self.maxspeed * 0.9); + else + self.maxspeed = (self.maxspeed * 0.6); + player_pain1 (); }; + void () player_dieb1; void () player_diec1; @@ -1144,42 +1674,23 @@ void () PlayerDie = local float i; local float r; - //self.solid = SOLID_NOT; - self.dead = self.dead + 1; - if ((self.deathtype == "fall")) - { - sound (self, CHAN_VOICE, "player/agdie4.wav", WEAPON_SHOTGUN, ATTN_NONE); - self.deathtype = ""; - } - if ((self.waterlevel == AS_MELEE)) - { - DeathBubbles (IDLE8A); - sound (self, CHAN_VOICE, "player/drown2.wav", WEAPON_SHOTGUN, ATTN_NONE); - } r = random (); self.noise = "player/agdie2.wav"; sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); self.items = (self.items - (self.items & IT_INVISIBILITY)); - self.invisible_finished = MULTICAST_ALL; - self.invincible_finished = MULTICAST_ALL; - self.super_damage_finished = MULTICAST_ALL; - self.radsuit_finished = MULTICAST_ALL; + self.invisible_finished = 0; + self.invincible_finished = 0; + self.super_damage_finished = 0; + self.radsuit_finished = 0; self.modelindex = modelindex_player; self.weaponmodel = ""; self.view_ofs = '0 0 -8'; self.deadflag = DEAD_DYING; self.flags = (self.flags - (self.flags & FL_ONGROUND)); - self.movetype = MOVETYPE_TOSS; - if ((self.velocity_z < TE_LAVASPLASH)) - { - self.velocity_z = (self.velocity_z + (random () * 300)); - } - self.angles_x = 0; - self.angles_y = 0; + self.movetype = MOVETYPE_WALK; + self.angles_z = 0; - i = (WEAPON_SHOTGUN + floor ((random () * WEAPON_ROCKET))); - self.angles_z = MULTICAST_ALL; if (self.position == 1 || self.position == 2) player_diec1 (); else diff --git a/quakec/fallout2/progs.src b/quakec/fallout2/progs.src index a1b29d710..353a3519b 100644 --- a/quakec/fallout2/progs.src +++ b/quakec/fallout2/progs.src @@ -31,11 +31,13 @@ boss.qc knight.qc hknight.qc shalrath.qc -shambler.qc wizard.qc +shambler.qc dog.qc ogre.qc misc.qc +tarbaby.qc mod_buy.qc turrets.qc -cmds.qc \ No newline at end of file +cmds.qc +fish.qc \ No newline at end of file diff --git a/quakec/fallout2/server.qc b/quakec/fallout2/server.qc index 465bf4e8b..2b0bd6803 100644 --- a/quakec/fallout2/server.qc +++ b/quakec/fallout2/server.qc @@ -1,5 +1,4 @@ -void() monster_tarbaby = {remove(self);}; void() monster_oldone = {remove(self);}; void() event_lightning = {remove(self);}; diff --git a/quakec/fallout2/shalrath.qc b/quakec/fallout2/shalrath.qc index 812d23a24..487db6eb6 100644 --- a/quakec/fallout2/shalrath.qc +++ b/quakec/fallout2/shalrath.qc @@ -175,28 +175,36 @@ void() ShalMissileTouch = if (other == self.owner) return; // don't explode on owner - if (other.classname == "monster_zombie") - T_Damage (other, self, self, 110); - T_RadiusDamage (self, self.owner, 40, world, "vore"); - sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); - - WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte (MSG_BROADCAST, TE_EXPLOSION); - WriteCoord (MSG_BROADCAST, self.origin_x); - WriteCoord (MSG_BROADCAST, self.origin_y); - WriteCoord (MSG_BROADCAST, self.origin_z); - - self.velocity = '0 0 0'; - self.touch = SUB_Null; - setmodel (self, "progs/s_explod.spr"); - self.solid = SOLID_NOT; - Explosion(2); + if (random()<0.1) + { + other.islot3 = SlotVal(IID_ARM_LEATHER, 1); + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_TAREXPLOSION); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + T_Damage (other, self, self, 25+random()*25); + other.hold = 20; + remove(self); + } + else + { + T_Damage (other, self, self, 25+random()*25); + te_smallflash(other.origin); + remove(self); + } }; //================================================================= void() monster_shalrath = { + if (self.zone == 0) + { + load_monster(); + return; + } + precache_model2 ("progs/shalrath.mdl"); precache_model2 ("progs/h_shal.mdl"); precache_model2 ("progs/v_spike.mdl"); @@ -213,10 +221,9 @@ void() monster_shalrath = setmodel (self, "progs/shalrath.mdl"); setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); - self.health = 800; + self.health = 300; self.team = 3; - self.islot3 = 11; //vore armor - self.armortype = 0.1; + self.islot3 = SlotVal(IID_ARM_FORCE, 1); self.helmet = 1; self.classname = "monster"; self.netname = "experiment"; diff --git a/quakec/fallout2/shambler.qc b/quakec/fallout2/shambler.qc index 5165ec436..3322a08cb 100644 --- a/quakec/fallout2/shambler.qc +++ b/quakec/fallout2/shambler.qc @@ -105,7 +105,7 @@ local float ldmg; if (!CanDamage (self.enemy, self)) return; - ldmg = (random() + random() + random()) * 40; + ldmg = 40*random()*10*random()*10; T_Damage (self.enemy, self, self, ldmg); sound (self, CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM); @@ -179,9 +179,9 @@ void() sham_melee = local float chance; chance = random(); - if (chance > 0.6 || self.health == 600) + if (self.class == 3) sham_smash1 (); - else if (chance > 0.3) + else if (self.class == 5 && chance > 0.3) sham_swingr1 (); else sham_swingl1 (); @@ -213,12 +213,190 @@ void() CastLightning = WriteCoord (MSG_BROADCAST, trace_endpos_y); WriteCoord (MSG_BROADCAST, trace_endpos_z); - LightningDamage (org, trace_endpos, self, 10); + LightningDamage (org, trace_endpos, self, 5+random()*10); }; -void() sham_magic1 =[ $magic1, sham_magic2 ] {ai_face(); - sound (self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM); + +void (vector spot) summon_wizard = +{ + local entity wiz; + local entity te; + + + wiz = spawn (); + self = wiz; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/wizard.mdl"); + setsize (self, '-8 -8 -12', '8 8 20'); + self.scale = 0.5; + self.health = 90; + self.netname = "floater"; + self.max_health = self.health; + self.th_stand = wiz_stand1; + self.th_walk = wiz_walk1; + self.th_run = wiz_run1; + self.th_missile = Wiz_Missile; + self.th_pain = Wiz_Pain; + self.th_die = wiz_die; + + self.flags = self.flags | FL_FLY; + self.flags = self.flags | FL_MONSTER; + + self.origin = spot; + + if (!walkmove(0, 0)) + { + self.origin = spot + '0 -64 0'; + if (!walkmove(0, 0)) + { + self.origin = spot + '64 0 0'; + if (!walkmove(0, 0)) + { + self.origin = spot + '-64 0 0'; + if (!walkmove(0, 0)) + { + remove(self); + return; + } + } + } + } + + te = findradius (self.origin, 30); + while (te) + { + if (te.classname == "player" || te.classname == "monster" && te.health > 0) + { + remove(self); + return; + } + + + te = te.chain; + } + + te_smallflash(self.origin); + self.classname = "monster"; + flymonster_start_go (); }; + +void() shambler_summon_magic = +{ + local vector point; + local entity wiz; + + makevectors (self.v_angle); + + point = self.origin + '0 0 64' + v_up*crandom()*128 + v_right*crandom()*128; + + summon_wizard(point); + + if (random()<0.75) + summon_wizard(point); + if (random()<0.75) + summon_wizard(point); +}; + +void() sham_heal1; +void() sham_magic1; +void() sham_summon1; + +void () sham_cast_magic = +{ + local entity te; + local string cast_type; + local vector org; + + + self.heal_ent = world; + + te = findradius (self.origin, 600); + while (te) + { + if (te.classname == "monster") + { + if (te.health < te.max_health*0.5) + { + self.heal_ent = te; + } + } + + te = te.chain; + } + if (self.heal_ent.classname == "monster" && random()<0.8) + { + org = self.origin + '0 0 32'; + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_WIZSPIKE); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + multicast (self.origin, MULTICAST_PHS); + sham_heal1(); + sound (self, CHAN_WEAPON, "shambler/heal.wav", 1, ATTN_NORM); + te_smallflash(self.origin); + return; + } + else if (random()<0.25) + { + sham_summon1(); + sound (self, CHAN_WEAPON, "shambler/summon.wav", 1, ATTN_NORM); + } + else + sham_magic1(); + +}; + +void() sham_summon1 =[ $magic1, sham_summon2 ] {ai_face();}; +void() sham_summon2 =[ $magic1, sham_summon3 ] {ai_face();}; +void() sham_summon3 =[ $magic1, sham_summon4 ] {ai_face();}; +void() sham_summon4 =[ $magic1, sham_summon5 ] {ai_face();}; +void() sham_summon5 =[ $magic1, sham_summon6 ] {ai_face();}; +void() sham_summon6 =[ $magic2, sham_summon7 ] {ai_face();}; +void() sham_summon7 =[ $magic2, sham_summon8 ] {ai_face();}; +void() sham_summon8 =[ $magic2, sham_summon9 ] {ai_face();}; +void() sham_summon9 =[ $magic2, sham_summon10 ] {ai_face();}; +void() sham_summon10 =[ $magic2, sham_summon11 ] {ai_face();}; +void() sham_summon11 =[ $magic3, sham_summon12 ] {ai_face();}; +void() sham_summon12 =[ $magic3, sham_summon13 ] {ai_face();}; +void() sham_summon13 =[ $magic3, sham_summon14 ] {ai_face();}; +void() sham_summon14 =[ $magic3, sham_summon15 ] {ai_face();}; +void() sham_summon15 =[ $magic3, sham_summon16 ] {ai_face();}; +void() sham_summon16 =[ $magic4, sham_summon17 ] {ai_face();}; +void() sham_summon17 =[ $magic4, sham_summon18 ] {ai_face();}; +void() sham_summon18 =[ $magic4, sham_summon19 ] {ai_face();}; +void() sham_summon19 =[ $magic4, sham_summon20 ] {ai_face(); +shambler_summon_magic(); +}; +void() sham_summon20 =[ $magic4, sham_run1 ] {ai_face();}; + + +void() sham_heal1 =[ $magic1, sham_heal2 ] {ai_face();}; +void() sham_heal2 =[ $magic2, sham_heal3 ] {ai_face();}; +void() sham_heal3 =[ $magic3, sham_heal4 ] {ai_face();}; +void() sham_heal4 =[ $magic4, sham_heal5 ] {ai_face();}; +void() sham_heal5 =[ $magic5, sham_heal6 ] {ai_face(); + + if (self.heal_ent.classname == "monster") + { + self.heal_ent.health = self.heal_ent.health + 200; + if (self.heal_ent.health > self.heal_ent.max_health) + self.heal_ent.health = self.heal_ent.max_health; + + self.heal_ent = world; + + te_smallflash(self.heal_ent.origin); + } +}; + +void() sham_heal6 =[ $magic1, sham_run1 ] {ai_face();}; + +void() sham_magic1 =[ $magic1, sham_magic2 ] {ai_face(); +sound (self, CHAN_WEAPON, "shambler/sboom.wav", 1, ATTN_NORM); + +}; + void() sham_magic2 =[ $magic2, sham_magic3 ] {ai_face();}; void() sham_magic3 =[ $magic3, sham_magic4 ] {ai_face();self.nextthink = self.nextthink + 0.2; local entity o; @@ -277,6 +455,7 @@ void(entity attacker, float damage) sham_pain = if (self.pain_finished > time) return; + self.pain_finished = time + 2; sham_pain1 (); @@ -299,15 +478,13 @@ void() sham_death11 =[ $death11, sham_death11 ] {}; void() sham_die = { -// check for gib +// check for gurgling death sound if (self.health < -60) { sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_shams.mdl", self.health); ThrowGib ("progs/gib1.mdl", self.health); ThrowGib ("progs/gib2.mdl", self.health); ThrowGib ("progs/gib3.mdl", self.health); - return; } // regular death @@ -319,11 +496,12 @@ void() sham_die = void() monster_shambler = { - if (deathmatch) + if (self.zone == 0) { - remove(self); + load_monster(); return; } + precache_model ("progs/shambler.mdl"); precache_model ("progs/s_light.mdl"); precache_model ("progs/h_shams.mdl"); @@ -338,21 +516,46 @@ void() monster_shambler = precache_sound ("shambler/melee1.wav"); precache_sound ("shambler/melee2.wav"); precache_sound ("shambler/smack.wav"); + precache_sound ("shambler/heal.wav"); + precache_sound ("shambler/summon.wav"); - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - setmodel (self, "progs/shambler.mdl"); + if (random() < 0.001)//shambler warrior + { + self.class = 3; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/shambler.mdl"); + self.classname = "monster"; + self.netname = "shambler warrior"; + setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); + self.health = 2200; + self.islot3 = SlotVal(IID_ARM_FORCE, 1); + self.th_stand = sham_stand1; + self.th_walk = sham_walk1; + self.th_run = sham_run1; + self.th_die = sham_die; + self.th_melee = sham_melee; + self.th_pain = sham_pain; + } + else //shambler shaman + { + self.class = 5; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/shambler.mdl"); + self.classname = "monster"; + self.netname = "shambler shaman"; + setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); + self.health = 1800; - setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); - self.health = 600; + self.th_stand = sham_stand1; + self.th_walk = sham_walk1; + self.th_run = sham_run1; + self.th_die = sham_die; + self.th_melee = sham_melee; + self.th_missile = sham_cast_magic; + self.th_pain = sham_pain; + } - self.th_stand = sham_stand1; - self.th_walk = sham_walk1; - self.th_run = sham_run1; - self.th_die = sham_die; - self.th_melee = sham_melee; - self.th_missile = sham_magic1; - self.th_pain = sham_pain; - walkmonster_start(); }; diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index 68a1afe02..a35260edf 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -1,8 +1,47 @@ #define mag1 currentammo #define maxmag1 cnt +.entity objective; + +void () LobAGrenade; +void (vector jojo) spawn_civilian; +void (entity jeb, float time) spawn_excla; +void(float db) monster_noise; +void () find_hide; void () army_load1; +void () army_radio1; +void () Footstep; +void () monster_commander; + +void () DeathThroes = +{ + local entity te; + + te = findradius (self.origin, 300); + while (te) + { + if (te.classname == "monster" && te.health > 0 && te != self) + te.enemy = self; + + te = te.chain; + } +}; + +//RADIO +void() fire_radio = +{ + if (world.map_obj == OBJ_SHADOW && self.has_radio == 1) + { + spawn_excla(self, 8); + bprint(2, self.netname); + bprint(2, " is calling for help! silence him!\n"); + self.rtime = 0; + army_radio1(); + return; + } +}; + //PISTOL void (float tmp, float dam) army_fire = @@ -16,11 +55,22 @@ void (float tmp, float dam) army_fire = if (self.enemy.sneak == 1) tmp = tmp * 2; - if (self.mag1 == 0) + //soldiers call for help on shadow ops + if (world.map_obj == OBJ_SHADOW && self.has_radio == 1) { + spawn_excla(self, 8); + bprint(2, self.netname); + bprint(2, " is calling for help! silence him!\n"); + self.rtime = 0; + army_radio1(); + return; + } + + if (self.mag1 <= 0) + { + self.mag1 = 12; sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); army_load1(); - self.mag1 = self.maxmag1; return; } @@ -29,7 +79,7 @@ void (float tmp, float dam) army_fire = makevectors (self.angles); - sound (self, CHAN_WEAPON, "weapons/1911.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/usp.wav", PLAT_LOW_TRIGGER, ATTN_NORM); src = self.origin + v_forward*10; src_z = self.absmin_z + self.size_z * 0.7; @@ -37,31 +87,29 @@ void (float tmp, float dam) army_fire = en = self.enemy; dir = en.origin - en.velocity*0.2; + if (en.position == 1) + dir = dir - '0 0 8'; + if (en.position == 2) + dir = dir - '0 0 16'; + dir = normalize (dir - self.origin); direction = dir; traceline (src, src + direction*2048 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); - if (trace_fraction == PLAT_LOW_TRIGGER) + if (trace_fraction == 1) return; if (trace_ent.takedamage) { dam = 1 + random()*dam + random()*dam; - dam = dam * (1 - (trace_fraction/2)); + dam = dam - (1 - (trace_fraction/2)); SpawnBlood (org, PLAT_LOW_TRIGGER); T_Damage (trace_ent, self, self, dam); } else - { - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, trace_endpos_x); - WriteCoord (MSG_MULTICAST, trace_endpos_y); - WriteCoord (MSG_MULTICAST, trace_endpos_z); - multicast (trace_endpos, MULTICAST_PVS); - } + bullet_hole (trace_endpos); }; @@ -77,11 +125,24 @@ void (float tmp, float dam) army_fire1 = if (self.enemy.sneak == 1) tmp = tmp * 2; - if (self.mag1 == 0) + //soldiers call for help on shadow ops + if (world.map_obj == OBJ_SHADOW && self.has_radio == 1) { + spawn_excla(self, 8); + bprint(2, self.netname); + bprint(2, " is calling for help! silence him!\n"); + self.rtime = 0; + army_radio1(); + return; + } + + monster_noise(60); + + if (self.mag1 <= 0) + { + self.mag1 = 1; sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); army_load1(); - self.mag1 = self.maxmag1; return; } @@ -96,14 +157,19 @@ void (float tmp, float dam) army_fire1 = en = self.enemy; - dir = en.origin - en.velocity*0.2; + dir = en.origin - en.velocity*0.05; + if (en.position == 1) + dir = dir - '0 0 8'; + if (en.position == 2) + dir = dir - '0 0 16'; + dir = normalize (dir - self.origin); direction = dir; - traceline (src, src + direction*2048 + v_right*crandom()*100 + v_up*crandom()*100, FALSE, self); + traceline (src, src + direction*2048 + v_right*crandom()*150 + v_up*crandom()*150, FALSE, self); - if (trace_fraction == PLAT_LOW_TRIGGER) + if (trace_fraction == 1) return; if (trace_ent.takedamage) @@ -111,17 +177,10 @@ void (float tmp, float dam) army_fire1 = SpawnBlood (org, PLAT_LOW_TRIGGER); dam = 10 + random()*dam + random()*dam; dam = dam * (1 - (trace_fraction/2)); - T_Damage (trace_ent, self, self, dam); + X_Damage (trace_ent, self, self, dam); } else - { - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, trace_endpos_x); - WriteCoord (MSG_MULTICAST, trace_endpos_y); - WriteCoord (MSG_MULTICAST, trace_endpos_z); - multicast (trace_endpos, MULTICAST_PVS); - } + bullet_hole (trace_endpos); }; @@ -139,11 +198,22 @@ void (float tmp, float dam) army_fire2 = if (self.enemy.sneak == 1) tmp = tmp * 2; - if (self.mag1 == 0) + if (self.mag1 <= 0) { + self.mag1 = 6; sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); army_load1(); - self.mag1 = self.maxmag1; + return; + } + + //soldiers call for help on shadow ops + if (world.map_obj == OBJ_SHADOW && self.has_radio == 1) + { + spawn_excla(self, 8); + bprint(2, self.netname); + bprint(2, " is calling for help! silence him!\n"); + self.rtime = 0; + army_radio1(); return; } @@ -151,7 +221,9 @@ void (float tmp, float dam) army_fire2 = makevectors (self.angles); - sound (self, CHAN_WEAPON, "weapons/shotgun2.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/shotgun1.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + + monster_noise(50); src = self.origin + v_forward*10; src_z = self.absmin_z + self.size_z * 0.7; @@ -159,6 +231,11 @@ void (float tmp, float dam) army_fire2 = en = self.enemy; dir = en.origin - en.velocity*0.2; + if (en.position == 1) + dir = dir - '0 0 8'; + if (en.position == 2) + dir = dir - '0 0 16'; + dir = normalize (dir - self.origin); direction = dir; @@ -198,7 +275,7 @@ void (float tmp, float dam) army_fire2 = shot = (shot - 1); - if (trace_fraction == PLAT_LOW_TRIGGER) + if (trace_fraction == 1) return; if (trace_ent.takedamage) @@ -209,14 +286,7 @@ void (float tmp, float dam) army_fire2 = T_Damage (trace_ent, self, self, dam); } else - { - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, trace_endpos_x); - WriteCoord (MSG_MULTICAST, trace_endpos_y); - WriteCoord (MSG_MULTICAST, trace_endpos_z); - multicast (trace_endpos, MULTICAST_PVS); - } + bullet_hole (trace_endpos); } }; @@ -229,17 +299,32 @@ void (float tmp, float dam) army_fire3 = local entity en; local vector org; - if (self.mag1 == 0) + if (self.mag1 <= 0) { - sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + self.mag1 = 30; + sound (self, CHAN_WEAPON, "misc/greload.wav", 1, ATTN_NORM); army_load1(); - self.mag1 = self.maxmag1; return; } + //soldiers call for help on shadow ops + if (world.map_obj == OBJ_SHADOW && self.has_radio == 1) + { + spawn_excla(self, 8); + bprint(2, self.netname); + bprint(2, " is calling for help! silence him!\n"); + self.rtime = 0; + army_radio1(); + return; + } + + monster_noise(40); + if (self.enemy.sneak == 1) tmp = tmp * 2; + sound (self, CHAN_WEAPON, "weapons/mp5.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + self.mag1 = self.mag1 - 1; makevectors (self.angles); @@ -250,13 +335,18 @@ void (float tmp, float dam) army_fire3 = en = self.enemy; dir = en.origin - en.velocity*0.2; + if (en.position == 1) + dir = dir - '0 0 8'; + if (en.position == 2) + dir = dir - '0 0 16'; + dir = normalize (dir - self.origin); direction = dir; traceline (src, src + direction*1024 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); - if (trace_fraction == PLAT_LOW_TRIGGER) + if (trace_fraction == 1) return; if (trace_ent.takedamage) @@ -267,14 +357,8 @@ void (float tmp, float dam) army_fire3 = T_Damage (trace_ent, self, self, dam); } else - { - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, trace_endpos_x); - WriteCoord (MSG_MULTICAST, trace_endpos_y); - WriteCoord (MSG_MULTICAST, trace_endpos_z); - multicast (trace_endpos, MULTICAST_PVS); - } + bullet_hole (trace_endpos); + }; //Assault Rifle @@ -286,34 +370,41 @@ void (float tmp, float dam) army_fire4 = local entity en; local vector org; - if (self.mag1 == 0) + if (self.mag1 <= 0) { + self.mag1 = 24; sound (self, CHAN_WEAPON, "misc/greload.wav", PLAT_LOW_TRIGGER, ATTN_NORM); army_load1(); - self.mag1 = self.maxmag1; return; } - if (self.enemy.sneak == 1) - tmp = tmp * 2; self.mag1 = self.mag1 - 1; makevectors (self.angles); + sound (self, CHAN_WEAPON, "weapons/ak112.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + src = self.origin + v_forward*10; src_z = self.absmin_z + self.size_z * 0.7; en = self.enemy; dir = en.origin - en.velocity*0.2; + if (en.position == 1) + dir = dir - '0 0 8'; + if (en.position == 2) + dir = dir - '0 0 16'; + dir = normalize (dir - self.origin); direction = dir; traceline (src, src + direction*2048 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self); - if (trace_fraction == PLAT_LOW_TRIGGER) + monster_noise(60); + + if (trace_fraction == 1) return; if (trace_ent.takedamage) @@ -325,15 +416,73 @@ void (float tmp, float dam) army_fire4 = } else { - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, trace_endpos_x); - WriteCoord (MSG_MULTICAST, trace_endpos_y); - WriteCoord (MSG_MULTICAST, trace_endpos_z); - multicast (trace_endpos, MULTICAST_PVS); + if (en.classname == "player" && random()*20 <= 5) + stuffcmd(en, "play effects/miss\n"); + + bullet_hole (trace_endpos); } }; +void () army_run1; + +void () army_radio1 = [ 29, army_radio2 ] +{ + if (self.health <= 0) + { + self.think = SUB_Null; + return; + } + + self.rtime = self.rtime + 1; + ai_stand (); +}; + +void () army_radio2 = [ 29, army_radio3 ] +{ + ai_stand (); +}; + +void () army_radio3 = [ 29, army_radio1 ] +{ + if (self.rtime > 15) + { + if (random()<0.25) + sound (self, CHAN_VOICE, "effects/radio1.wav", 1, ATTN_NONE); + else if (random()<0.25) + sound (self, CHAN_VOICE, "effects/radio2.wav", 1, ATTN_NONE); + else if (random()<0.25) + sound (self, CHAN_VOICE, "effects/radio3.wav", 1, ATTN_NONE); + else + sound (self, CHAN_VOICE, "effects/radio4.wav", 1, ATTN_NONE); + + called_in += 1; + self.has_radio = 0; + army_run1(); + bprint(2, "soldier reported suspicious activity!\n"); + if (called_in == 1) + bprint(2, "threat level: low\n"); + if (called_in == 2) + bprint(2, "threat level: rising\n"); + if (called_in == 3) + bprint(2, "threat level: alert\n"); + if (called_in == 4) + bprint(2, "threat level: paranoid\n"); + if (called_in >= 5) + bprint(2, "threat level: discovered\n"); + + } + else + { + if (random()<0.5) + sound (self, CHAN_VOICE, "effects/blip1.wav", 1, ATTN_IDLE); + else + sound (self, CHAN_VOICE, "effects/blip2.wav", 1, ATTN_IDLE); + } + ai_stand (); +}; + + + void () army_load1 = [ 29, army_load2 ] { @@ -508,6 +657,9 @@ void () army_walk8 = [ 80, army_walk1 ] void () army_run1 = [ 73, army_run2 ] { + if (random()<0.25 || self.health <= 25) + find_hide(); + ai_run (TE_TELEPORT); }; @@ -518,8 +670,15 @@ void () army_run2 = [ 74, army_run3 ] void () army_run3 = [ 75, army_run4 ] { - if (self.active == 1) - self.action_points = self.action_points - 1; + if (world.map_obj == OBJ_SHADOW && self.has_radio == 1) + { + spawn_excla(self, 8); + bprint(2, self.netname); + bprint(2, " is calling for help! silence him!\n"); + self.rtime = 0; + army_radio1(); + return; + } ai_run (TE_LAVASPLASH); }; @@ -551,6 +710,12 @@ void () army_run8 = [ 80, army_run1 ] void () army_atk1 = [ 81, army_atk2 ] { + if (self.grenadetoggle > 0 && random()*4 <= 1) + { + LobAGrenade(); + self.grenadetoggle = self.grenadetoggle - 1; + } + ai_face (); }; @@ -582,7 +747,7 @@ void () army_atk6 = [ 86, army_atk7 ] void () army_atk7 = [ 87, army_atk8 ] { ai_face (); - army_fire (120, 14); + army_fire (120, 19); }; void () army_atk8 = [ 88, army_atk9 ] @@ -597,6 +762,12 @@ void () army_atk9 = [ 89, army_run1 ] void () army_atka1 = [ 81, army_atka2 ] { + if (self.grenadetoggle > 0 && self.health < 70) + { + LobAGrenade(); + self.grenadetoggle = self.grenadetoggle - 1; + } + ai_face (); }; @@ -618,7 +789,7 @@ void () army_atka4 = [ 84, army_atka5 ] void () army_atka5 = [ 85, army_atka6 ] { ai_face (); - army_fire2 (200, 4); + army_fire2 (200, 7); }; void () army_atka6 = [ 86, army_atka7 ] @@ -643,6 +814,12 @@ void () army_atka9 = [ 89, army_run1 ] void () army_atkb1 = [ 81, army_atkb2 ] { + if (self.grenadetoggle > 0 && self.health < 70) + { + LobAGrenade(); + self.grenadetoggle = self.grenadetoggle - 1; + } + ai_face (); }; @@ -673,12 +850,7 @@ void () army_atkb5 = [ 85, army_atkb6 ] if (r == RANGE_NEAR || r == RANGE_MELEE) self.recoil = 1; - if (self.recoil == 1) - sound (self, CHAN_WEAPON, "weapons/burst.wav", PLAT_LOW_TRIGGER, ATTN_NORM); - else - sound (self, CHAN_WEAPON, "weapons/mp7.wav", PLAT_LOW_TRIGGER, ATTN_NORM); - - army_fire3 (150, 13); + army_fire3 (100, 15); }; void () army_atkb6 = [ 86, army_atkb7 ] @@ -686,8 +858,8 @@ void () army_atkb6 = [ 86, army_atkb7 ] ai_face (); if (self.recoil == 1) { - army_fire3 (170, 11); - army_fire3 (190, 9); + army_fire3 (150, 14); + army_fire3 (150, 14); } }; @@ -695,7 +867,7 @@ void () army_atkb7 = [ 87, army_atkb8 ] { ai_face (); if (self.recoil == 1) - army_fire3 (210, 11); + army_fire3 (150, 14); }; void () army_atkb8 = [ 88, army_atkb9 ] @@ -703,8 +875,8 @@ void () army_atkb8 = [ 88, army_atkb9 ] ai_face (); if (self.recoil == 1) { - army_fire3 (230, 11); - army_fire3 (250, 9); + army_fire3 (150, 14); + army_fire3 (150, 14); } }; @@ -713,13 +885,19 @@ void () army_atkb9 = [ 89, army_run1 ] ai_face (); if (self.recoil == 1) { - army_fire3 (270, 11); - army_fire3 (290, 9); + army_fire3 (150, 14); + army_fire3 (150, 14); } }; void () army_atkcs1 = [ 81, army_atkcs2 ] { + if (self.grenadetoggle > 0 && self.health < 70) + { + LobAGrenade(); + self.grenadetoggle = self.grenadetoggle - 1; + } + ai_face (); }; @@ -742,7 +920,7 @@ void () army_atkcs5 = [ 85, army_atkcs6 ] { ai_face (); sound (self, CHAN_WEAPON, "weapons/ak112.wav", PLAT_LOW_TRIGGER, ATTN_NORM); - army_fire4 (100, 16); + army_fire4 (100, 20); }; void () army_atkcs6 = [ 85, army_atkcs7 ] @@ -794,9 +972,9 @@ void () army_assault_rifle = r = range (self.enemy); - if (r == RANGE_FAR || r == RANGE_MID)//single shot at range + if (r == RANGE_FAR)//single shot at range army_atkcs1(); - if (r == RANGE_NEAR || r == RANGE_MELEE)//open up when close + else//full-auto army_atkc1(); }; @@ -872,6 +1050,12 @@ void () army_atkc16 = [ 89, army_run1 ] void () army_atkp1 = [ 81, army_atkp2 ] { + if (self.grenadetoggle > 0 && self.health < 70) + { + LobAGrenade(); + self.grenadetoggle = self.grenadetoggle - 1; + } + ai_face (); }; @@ -893,7 +1077,7 @@ void () army_atkp4 = [ 84, army_atkp5 ] void () army_atkp5 = [ 85, army_atkp6 ] { ai_face (); - army_fire1 (200, 15); + army_fire1 (300, 22); }; void () army_atkp6 = [ 86, army_atkp7 ] @@ -1098,7 +1282,8 @@ void () army_die1 = [ 8, army_die2 ] void () army_die2 = [ 9, army_die3 ] { - self.solid = SOLID_NOT; + self.rtime = 1; + self.velocity_z = 50+random()*50; }; void () army_die3 = [ 10, army_die4 ] @@ -1107,6 +1292,7 @@ void () army_die3 = [ 10, army_die4 ] void () army_die4 = [ 11, army_die5 ] { + setsize (self, '-12 -12 -24', '12 12 -16'); }; void () army_die5 = [ 12, army_die6 ] @@ -1139,7 +1325,8 @@ void () army_cdie1 = [ 18, army_cdie2 ] void () army_cdie2 = [ 19, army_cdie3 ] { - self.solid = SOLID_NOT; + self.rtime = 1; + self.velocity_z = 50+random()*50; ai_back (MULTICAST_PVS_R); }; @@ -1150,6 +1337,7 @@ void () army_cdie3 = [ 20, army_cdie4 ] void () army_cdie4 = [ 21, army_cdie5 ] { + setsize (self, '-12 -12 -24', '12 12 -16'); ai_back (TE_LIGHTNINGBLOOD); }; @@ -1186,31 +1374,42 @@ void () army_cdie11 = [ 28, army_cdie11 ] void () grunt_pain = { + local vector dir; + + if (self.rtime > 0) + { + if (random()*100<50) + sound (self, CHAN_VOICE, "player/headshot.wav", 0.75, ATTN_NORM); + else + sound (self, CHAN_VOICE, "misc/thud.wav", 1, ATTN_NORM); + + SpawnBlood (self.origin + '0 0 8', 4); + + self.health = 180; + return; + } + + dir = normalize(self.origin - self.enemy.origin); + self.velocity = dir * 120; + if (self.frame == 41) { - self.frame = 42; self.health = 180; + self.frame = 42; self.think = army_die1; self.nextthink = time + 0.12; } else { + self.health = 180; ThrowGib ("progs/zom_gib.mdl", -40); self.frame = 41; - self.health = 180; self.think = army_cdie1; self.nextthink = time + 0.12; } self.attack = self.attack + 1; - if (self.attack == 8) - { - if (random()*4 <= 2) - sound (self, CHAN_VOICE, "player/agdie1.wav", 1, ATTN_NORM); - else - sound (self, CHAN_VOICE, "player/agdie5.wav", 1, ATTN_NORM); - } if (self.attack >= 16) { self.solid = SOLID_NOT; @@ -1228,13 +1427,13 @@ void (vector stuff, vector ang) spawn_live_grunt = grunt = spawn (); grunt.origin = stuff; - grunt.enemy = world; + grunt.enemy = self.enemy; grunt.attack_finished = time + 10; grunt.solid = SOLID_SLIDEBOX; grunt.movetype = MOVETYPE_STEP; grunt.takedamage = DAMAGE_YES; setmodel (grunt, "progs/soldier.mdl"); - setsize (grunt, VEC_HULL_MIN, '16 16 40'); + setsize (grunt, '-12 -12 -24', '12 12 28'); grunt.classname = "body"; grunt.netname = "dead"; grunt.health = 180; @@ -1242,33 +1441,202 @@ void (vector stuff, vector ang) spawn_live_grunt = grunt.max_health = grunt.health; grunt.th_pain = grunt_pain; grunt.think = grunt_pain; + grunt.th_die = corpse_gib; grunt.nextthink = time + 0.05; }; void () army_die = { - DropBackpack (); + local float r; - if (self.health <= -35) - { - self.solid = SOLID_NOT; - sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - army_die1 (); - } + r = random(); + + if (random()<0.75) + DropMoney(); + + if (r <= 0.20) + sound (self, CHAN_VOICE, "player/agdie1.wav", 1, ATTN_NORM); + else if (r <= 0.40) + sound (self, CHAN_VOICE, "player/agdie2.wav", 1, ATTN_NORM); + else if (r <= 0.60) + sound (self, CHAN_VOICE, "player/agdie3.wav", 1, ATTN_NORM); + else if (r <= 0.80) + sound (self, CHAN_VOICE, "player/agdie4.wav", 1, ATTN_NORM); else + sound (self, CHAN_VOICE, "player/agdie5.wav", 1, ATTN_NORM); + + DeathThroes(); + + sound (self, CHAN_BODY, "", 1, ATTN_NORM); + + if (self.weapon == 1) + DropFromChest(self, IID_WP_PIPERIFLE, 1); + if (self.weapon == 2) + DropFromChest(self, IID_WP_USP, 6); + if (self.weapon == 3) + DropFromChest(self, IID_WP_WINCHESTER, 1); + if (self.weapon == 4) + DropFromChest(self, IID_WP_MP9, 15); + if (self.weapon == 5) + DropFromChest(self, IID_WP_AK112, 12); + + if (self.weapon == 1) + DropFromChest(self, IID_AM_44MAGNUM, 10); + if (self.weapon == 2) + DropFromChest(self, IID_AM_45ACP, 12); + if (self.weapon == 3) + DropFromChest(self, IID_AM_12GAUGESHELLS, 8); + if (self.weapon == 4) + DropFromChest(self, IID_AM_10MM, 15); + if (self.weapon == 4) + DropFromChest(self, IID_AM_10MM, 30); + if (self.weapon == 5) + DropFromChest(self, IID_AM_5MMHIGHVEL, 24); + + self.solid = SOLID_NOT; + spawn_live_grunt(self.origin, self.angles); + remove(self); +}; + +void (vector jojo, entity friend) spawn_soldier = +{ + local entity soldier; + local entity te; + + + soldier = spawn (); + self = soldier; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/soldier.mdl"); + setsize (self, '-12 -12 -24', '12 12 28'); + self.health = 60+random()*30; + self.netname = "raider"; + self.max_health = self.health; + self.armornoise = "misc/thud.wav"; + self.th_stand = army_stand1; + self.th_walk = army_walk1; + self.th_run = army_run1; + if (random()<0.3) + self.has_radio = 1; + if (self.has_radio == 0) + self.th_missile = army_atk1; + if (self.has_radio == 1) + self.th_missile = army_radio1; + self.th_pain = army_pain; + self.th_die = army_die; + + self.origin = jojo + '0 64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + + if (!walkmove(0, 0)) { - self.solid = SOLID_NOT; - spawn_live_grunt(self.origin, self.angles); - remove(self); + self.origin = jojo + '0 -64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + self.origin = jojo + '64 0 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + self.origin = jojo + '-64 0 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + remove(self); + return; + } + } + } } + + te = findradius (self.origin, 30); + while (te) + { + if (te.classname == "player" || te.classname == "monster" && te.health > 0) + { + remove(self); + return; + } + + + te = te.chain; + } + +//soldiers have either 0, 1 or 2 grenades + self.grenadetoggle = floor(random()*2); + +//soldiers have either pistol, smg, shotgun or rifle + self.weapon = ceil(random()*4); + + if (self.weapon == 1) + self.th_missile = army_atkp1; //rifle + if (self.weapon == 2) + self.th_missile = army_atk1; //pistol + if (self.weapon == 3) + self.th_missile = army_atka1; //shotgun + if (self.weapon == 4) + self.th_missile = army_atkb1; //smg + + self.mag1 = 8; + + if (self.weapon == 1) + self.mag1 = 6+random()*6; + if (self.weapon == 2) + self.mag1 = 12+random()*12; + if (self.weapon == 3) + self.mag1 = 3+random()*3; + if (self.weapon == 4) + self.mag1 = 15+random()*15; + + self.maxmag1 = self.mag1; + + self.classname = "monster"; + walkmonster_start_go (); + self.angles_y = friend.angles_y; }; void () monster_army = { + local float com; + local entity te; + + if (self.zone == 0) + { + load_monster(); + return; + } + local float x; + local entity te; x = total_players; + te = find(world, classname, "monster"); + while (te) + { + if (te.netname == "commander") + com = com + 1; + + te = find(te, classname, "monster"); + } + + if (com == 0 && random()<0.50 && world.map_obj == OBJ_SHADOW) + { + monster_commander(); + return; + } + + else if (com == 1 && random()<0.25 && world.map_obj == OBJ_SHADOW) + { + monster_commander(); + return; + } + if (random()*10 <= x*0.5) { precache_model2 ("progs/enforcer.mdl"); @@ -1294,10 +1662,11 @@ void () monster_army = self.classname = "monster"; self.netname = "enforcer"; - setsize (self, '-16 -16 -24', '16 16 32'); + setsize (self, '-12 -12 -24', '12 12 28'); self.health = 120; self.islot3 = SlotVal(IID_ARM_COMBAT, 1); self.armortype = 35; + self.helmet = 1; self.th_stand = enf_stand1; self.th_walk = enf_walk1; self.th_run = enf_run1; @@ -1330,47 +1699,246 @@ void () monster_army = precache_sound ("soldier/sight1.wav"); precache_sound ("player/udeath.wav"); + self.ammo_shells = 1; self.solid = SOLID_SLIDEBOX; self.classname = "monster"; self.netname = "raider"; self.movetype = MOVETYPE_STEP; setmodel (self, "progs/soldier.mdl"); - setsize (self, '-16 -16 -24', '16 16 28'); - self.health = 90; + setsize (self, '-12 -12 -24', '12 12 28'); + self.health = 70+random()*30; self.team = 3; - self.islot3 = SlotVal(IID_ARM_LEATHER, 1); + self.islot3 = SlotVal(IID_ARM_LEATHER, 1); self.armortype = 0.2; self.armornoise = "misc/thud.wav"; self.th_stand = army_stand1; self.th_walk = army_walk1; self.th_run = army_run1; - self.th_missile = army_atk1; + if (random()<0.3) + self.has_radio = 1; + if (self.has_radio == 0) + self.th_missile = army_atk1; + if (self.has_radio == 1) + self.th_missile = army_radio1; + self.th_pain = army_pain; self.th_die = army_die; + + te = find (world, classname, "rhostage"); + self.movetarget = te; + walkmonster_start (); - self.weapon = ceil(random()*4); +//soldiers have either 0, 1 or 2 grenades + self.grenadetoggle = floor(random()*2); + +//soldiers have either pistol, smg, shotgun or rifle + + if (random()*100 >= 80) + self.weapon = ceil(random()*4); + else + self.weapon = 2; if (self.weapon == 1) - self.th_missile = army_atkp1; //pistol + self.th_missile = army_atkp1; //pipe rifle if (self.weapon == 2) - self.th_missile = army_atk1; //rifle + self.th_missile = army_atk1; //pistol if (self.weapon == 3) self.th_missile = army_atka1; //shotgun if (self.weapon == 4) self.th_missile = army_atkb1; //smg + self.mag1 = 8; + if (self.weapon == 1) - self.mag1 = 12; + self.mag1 = 1; if (self.weapon == 2) - self.mag1 = 10; + self.mag1 = 6+random()*6; if (self.weapon == 3) - self.mag1 = 6; + self.mag1 = 3+random()*3; if (self.weapon == 4) - self.mag1 = 30; + self.mag1 = 15+random()*15; + +//soldiers on shadow missions have full combat armor & assault rifles + if (world.map_obj == OBJ_SHADOW) + { + if (random()<0.5) + self.islot3 = SlotVal(IID_ARM_LEATHER, 1); + else if (random()<0.5) + self.islot3 = SlotVal(IID_ARM_METAL, 1); + else + self.islot3 = SlotVal(IID_ARM_COMBAT, 1); + + if (random()<0.25) + self.weapon = 3; + else if (random()<0.5) + self.weapon = 4; + else + self.weapon = 5; + + if (self.weapon == 3) + self.th_missile = army_atka1; //shotgun + if (self.weapon == 4) + self.th_missile = army_atkb1; //smg + if (self.weapon == 5) + self.th_missile = army_assault_rifle; //ak-112 assault rifle + + self.mag1 = 24; + } self.maxmag1 = self.mag1; + + if (random()<0.25 && (world.map_obj != OBJ_SHADOW)) + spawn_soldier(self.origin, self); + if (random()<0.25 && world.map_obj == OBJ_HOSTAGE) + spawn_civilian(self.origin); }; +void() WalkTo_Think = +{ + local entity ent; + + ent = nextent(world); + + while(ent) + { + if((ent.goalentity == self) || (ent.objective == self)) + { + self.nextthink = time + 2; + return; + } + ent = nextent(ent); + } + + remove(self); + +}; + + +float(vector vec) hide_search = +{ + local float flo; + local vector vic; + local entity ent; + + flo = random() * 1000; + + traceline(self.origin, self.origin + vec * flo, TRUE, self); + vic = trace_endpos - normalize(trace_endpos - self.origin) * 32; + traceline(vic, self.enemy.origin, TRUE, self); + + if (vlen(trace_endpos - self.enemy.origin) > 50) + { + makevectors(vec); + + ent = spawn(); +// setmodel(ent, "progs/lavaball.mdl"); + setorigin(ent, vic - v_forward * 8); + ent.think = WalkTo_Think; + ent.nextthink = time + 8; + ent.classname = "runner"; + +// self.objective = ent; + self.angles_y = vectoyaw(ent.origin - self.origin); + self.goalentity = ent; +// self.think = self.th_run; + return TRUE; + } + + return FALSE; +}; + + +void() find_hide = +{ + local float flo; + local vector vec, vac; + + flo = 5; + makevectors(self.angles); + while(flo) + { + vec = crandom() * v_right; + vac = crandom() * v_forward; + vec = vec + vac; + if (hide_search(vec)) + return; + flo = flo - 1; + } +}; + + +void () monster_commander = +{ + if (self.zone == 0) + { + load_monster(); + return; + } + + precache_model2 ("progs/enforcer.mdl"); + precache_model2 ("progs/h_mega.mdl"); + precache_model2 ("progs/laser.mdl"); + + precache_sound2 ("enforcer/death1.wav"); + precache_sound2 ("enforcer/enfire.wav"); + precache_sound2 ("enforcer/enfstop.wav"); + precache_sound2 ("enforcer/idle1.wav"); + precache_sound2 ("enforcer/pain1.wav"); + precache_sound2 ("enforcer/pain2.wav"); + precache_sound2 ("enforcer/sight1.wav"); + precache_sound2 ("enforcer/sight2.wav"); + precache_sound2 ("enforcer/sight3.wav"); + precache_sound2 ("enforcer/sight4.wav"); + + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + self.team = 3; + + setmodel (self, "progs/enforcer.mdl"); + self.classname = "monster"; + self.netname = "commander"; + commanders = commanders + 1; + + setsize (self, '-12 -12 -24', '12 12 32'); + self.health = 120; + self.islot3 = SlotVal(IID_ARM_COMBAT, 1); + self.armortype = 0.5; + self.helmet = 1; + self.th_stand = enf_stand1; + self.th_walk = enf_walk1; + self.th_run = enf_run1; + self.th_pain = enf_pain; + self.th_die = enf_die; + self.th_missile = enf_atk1; + + if (random()<0.9) + self.weapon = 5; + else if (random()<0.1) + self.weapon = 3; + else if (random()<0.1) + self.weapon = 4; + + else if (random()<0.1) + self.weapon = 6; + else + self.weapon = 5; + + self.th_missile = enf_atk1; + self.mag1 = 24; + self.maxmag1 = self.mag1; + + walkmonster_start(); + + spawn_soldier(self.origin, self); + spawn_soldier(self.origin, self); + spawn_soldier(self.origin, self); + spawn_soldier(self.origin, self); + + return; + +}; + + #undef mag1 #undef maxmag1 diff --git a/quakec/fallout2/triggers.qc b/quakec/fallout2/triggers.qc index 42a6ec7b2..551e5587a 100644 --- a/quakec/fallout2/triggers.qc +++ b/quakec/fallout2/triggers.qc @@ -88,7 +88,10 @@ void() multi_touch = if (other.classname != "player") return; - +//PERK_ED: light step doesnt trigger trigger_multiple/trigger_once + if (other.perk1 == 6 || other.perk2 == 6) + return; + // if the trigger has an angles field, check player's facing direction if (self.movedir != '0 0 0') { @@ -417,7 +420,7 @@ local vector org; org = t.origin + 32 * v_forward; spawn_tfog (org); - spawn_tdeath(t.origin, other); + //spawn_tdeath(t.origin, other); if (self.classname == "player") { self.solid = SOLID_NOT; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index b3e9ef28c..c3907981f 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1,26 +1,58 @@ /* */ +void() show_light_level; +void() UseStimpack; +void() UseSuperStim; +void() UseMedicalBag; +void (entity chest, float iid, float num) DropFromChest; +void() AddClone; +void() SpawnGModel; +void (string snd, float type) function_radio; +void () MapInfo; void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; void () player_run; void(entity bomb, entity attacker, float rad, entity ignore, string dtype) T_RadiusDamage; +void(entity bomb, entity attacker, float rad, entity ignore, float xrange) T_RadiusDamage2; +void() ZoomIn; +void (float dam, float xrecoil, string snd, float rng, float rate) FireMinigun; +void(float db) loud_noise; +void() player_auto_duck1; +void() player_auto_ducka1; void(vector org, float damage) SpawnBlood; +void(vector org, float damage) SpawnNonBlood; void() SuperDamageSound; -void (float rec, float number, float dam, float var, float ran, float auto) W_FireShotgun; +void (float rec, float speed, float dam, float type) FirePulseRifle; +void (float rec, float number, float dam, float var, float ran, float auto, string snd) W_FireShotgun; void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle; void (float dam, float rec, string snd, float rng, float rate) FirePistol; void (float dam, float rec, string snd, float rng, float rate) FireSMG; float() FireToolkit; +void () HostageReport; +void (entity jeb, float time) spawn_excla; void () FireAlienBlaster; void () W_PlayerMenu; +void () player_single_shot; +void () player_single_shot_duck; //void () UseChem; void () Special; void () BuyMenu; void() Sneak; //void() Bandage; void() Shield; -void () player_throw1; +void () player_pull1; +void() player_dragon_kick; +void() player_kick1; +void() player_kick1a; +void() player_swing1; +void() player_swing1a; +void() player_punch1; +void() player_punch2; void() player_knife1; void() player_knifea; +void() player_spear1; +void() player_spear1a; +void() player_axe1; +void() player_axeb1; void() ExitScreen; void() CharacterSheet; void() UseEquipment; @@ -32,10 +64,14 @@ float(float iid) UseBoostingChem; float(float iid) UseHealingChem; float(float slotno) DecreaseDestroySlot; void () DropAmmo; +void() player_singlex; +void() player_singley; +void(string arg1) Cmd_InvUse; #define weightx() (self.weight) + // called by worldspawn void() W_Precache = { @@ -60,6 +96,57 @@ float() crandom = return 2*(random() - 0.5); }; +void() muzzleflash = +{ + WriteByte (MSG_MULTICAST, SVC_MUZZLEFLASH); + WriteEntity (MSG_MULTICAST, self); + multicast (self.origin, MULTICAST_PVS); +}; + + +float (entity healer, entity saved) RevivePlayer = +{ + local entity oself; + oself = self; + + self = saved; +/* if (!walkmove(0, 0)) + { + //too close? + return FALSE; + } +*/ + saved.deadflag = DEAD_NO; + saved.takedamage = DAMAGE_AIM; + saved.movetype = MOVETYPE_WALK; +// saved.solid = SOLID_NOT; + + self = oself; + +// saved.materialize = 200; + saved.ghost = 0; + saved.health = 1; + saved.air_finished = time + 10; + saved.view_ofs = '0 0 22'; + self = saved; + player_run(); + self = oself; + stuffcmd(saved, "impulse 1\n"); + if (healer.classname == "player") + { + sprint (healer, PRINT_HIGH, "you revive "); + sprint (healer, PRINT_HIGH, trace_ent.netname); + sprint (healer, PRINT_HIGH, ".\n "); + } + sprint (saved, PRINT_HIGH, healer.netname); + sprint (saved, PRINT_HIGH, " saves you from death.\n"); + saved.view2 = world; + + saved.flags (-) FL_FINDABLE_NONSOLID; + + return TRUE; +}; + /* ================ W_FireMelee @@ -67,8 +154,34 @@ W_FireMelee */ void(float damage, float dist, float rate) FireMelee = { - local vector source; - local vector org; + local vector source, org, vec, dir; + local float weap, dot, tdam; + local string sdam; + + if (getperk(16))//power shot adds a small bonus to the first shot fired + { + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + damage = damage * 1.20; + } + } + + self.recoil = self.recoil + 5; + + weap = ToIID(self.(SlotField(self.current_slot))); + + //large and in charge! adds a small burst of adrenalnie + if ((getperk(8)) && ((weap == IID_WP_SPEAR || weap == IID_WP_AXE || weap == IID_WP_WRENCH))) + { + if (self.ragetime <= 0) + { + sprint(self, 2, "!LARGE AND IN CHARGE\n"); + sound (self, CHAN_VOICE, "player/berserk.wav", 1, ATTN_NORM); + self.rage = IID_CHEM_ADRENALINE; + self.ragetime = 3; + } + } makevectors (self.v_angle); source = self.origin + '0 0 16'; @@ -78,24 +191,136 @@ void(float damage, float dist, float rate) FireMelee = org = trace_endpos - v_forward*4; - if (trace_ent.takedamage) + if (self.sneak > 0 && weap == IID_WP_KNIFE) { + makevectors (trace_ent.angles); + vec = normalize ((self.origin - trace_ent.origin)); + dot = (vec * v_forward); + + if (dot < 0.5 && trace_ent.takedamage) + { + tdam = self.sneak*random()*3; + if (getperk(7)) + tdam = self.sneak*random()*6; + + if (self.steadyaim == 0) + tdam = tdam * 5; + + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + SpawnBlood (org, 1); + else + SpawnNonBlood (org, 1); + + T_Damage (trace_ent, self, self, tdam); + self.attack_finished = time + 2; + + if (trace_ent.health > 0)//victim survived the attack + { + bprint(2, self.netname); + bprint(2, " ambushes "); + bprint(2, trace_ent.netname); + bprint(2, "!\n"); + + if (random()*4<2) + sound (trace_ent, CHAN_WEAPON, "player/headshot.wav", 1, ATTN_NONE); + else + sound (trace_ent, CHAN_WEAPON, "player/udeath.wav", 1, ATTN_NONE); + + loud_noise(15); + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); + } + else + { + bprint(2, self.netname); + bprint(2, " assassinates "); + bprint(2, trace_ent.netname); + bprint(2, "!\n"); + self.score = self.score + 25; + + if (random()*4<2) + sound (trace_ent, CHAN_WEAPON, "player/headshot.wav", 0.25, ATTN_IDLE); + else + sound (trace_ent, CHAN_WEAPON, "player/udeath.wav", 0.25, ATTN_IDLE); + } + return; + } + else if (trace_ent.takedamage) + { + loud_noise(15); + tdam = (30*(random()*30)); + sdam = ftos(tdam); + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + SpawnBlood (org, 1); + else + SpawnNonBlood (org, 1); T_Damage (trace_ent, self, self, tdam); + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); + return; + } + } + else if (trace_ent.takedamage) + { + //soldiers and assassins do more melee damage + if (self.class == 2 || self.class == 3) + damage = damage * 1.25; + + if (weap == IID_WP_AXE || weap == IID_WP_SPEAR || weap == IID_WP_KNIFE) + SpawnBlood (org, 1); + + if ((getperk(8)) && (weap == IID_WP_AXE || weap == IID_WP_SPEAR || weap == IID_WP_WRENCH)) + { + sprint(self, 2, "!LARGE AND IN CHARGE\n"); + dir = normalize(trace_ent.origin - self.origin); + trace_ent.velocity = dir * 600; + trace_ent.velocity_z = 100+random()*200; + } + trace_ent.axhitme = 1; - SpawnBlood (org, 1); + if (trace_ent.classname != "car") + { + if (weap == IID_NONE) + { + if (random()<0.5) + sound (self, CHAN_BODY, "weapons/brawl-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "weapons/brawl-2.wav", 1, ATTN_NORM); + } + else + sound (trace_ent, CHAN_VOICE, "player/headshot.wav", 0.5, ATTN_IDLE); + } T_Damage (trace_ent, self, self, damage+random()*damage); - sound (self, CHAN_WEAPON, trace_ent.armornoise, 1, ATTN_NORM); + } + + else if (weap == IID_NONE) + { + if (random()<0.5) + sound (self, CHAN_BODY, "weapons/brawl-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "weapons/brawl-2.wav", 1, ATTN_NORM); + } + else if (weap == IID_WP_AXE || weap == IID_WP_WRENCH) + { + if (random()<0.5) + sound (self, CHAN_BODY, "effects/axe_hit1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "effects/axe_hit2.wav", 1, ATTN_NORM); + } + else if (weap == IID_WP_SPEAR) + { + if (random()<0.5) + sound (self, CHAN_BODY, "effects/spear_hit1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "effects/spear_hit2.wav", 1, ATTN_NORM); } else - { // hit wall - sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); - - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, org_x); - WriteCoord (MSG_MULTICAST, org_y); - WriteCoord (MSG_MULTICAST, org_z); - multicast (self.origin, MULTICAST_PHS); - } + sound (self, CHAN_WEAPON, "weapons/knifehit.wav", 1, ATTN_NORM); }; void() W_FireMelee = @@ -103,27 +328,27 @@ void() W_FireMelee = local float iid; iid = ToIID(self.(SlotField(self.current_slot))); if (iid == IID_NONE) - FireMelee(3, 32, 0.6); - else if (iid == IID_WP_TOOLKIT) - FireMelee(5, 32, 0.2); + FireMelee(5+random()*10, 64, 0.6); + else if (iid == IID_WP_WRENCH) + FireMelee(5+random()*30, 64, 1.2); else if (iid == IID_WP_KNIFE) - FireMelee(5, 32, 0.2); + FireMelee(5+random()*20, 64, 0.4); else if (iid == IID_WP_AXE) - FireMelee(10, 64, 0.2); - else if (iid == IID_WP_VIBROBLADE) - FireMelee(25, 64, 0.2); - else if (iid == IID_WP_POWERAXE) - FireMelee(50, 96, 0.2); + FireMelee(5+random()*80, 96, 1); + else if (iid == IID_WP_SPEAR) + FireMelee(5+random()*60, 160, 0.8); else if (iid == IID_CHEM_STIMPACK || iid == IID_CHEM_MEDICALBAG || - iid == IID_CHEM_SUPERSTIM) + iid == IID_CHEM_SUPERSTIM || + iid == IID_MISC_NUKACOLA) { if (UseHealingChem(iid)) DecreaseDestroySlot(self.current_slot); } else if (iid == IID_CHEM_ADRENALINE || iid == IID_CHEM_PSYCHO || + iid == IID_CHEM_RADX || iid == IID_CHEM_BESERK) { if (UseBoostingChem(iid)) @@ -133,6 +358,27 @@ void() W_FireMelee = dprint(strcat("W_FireMelee - ", ftos(iid), "not implemented\n")); }; +void () player_single1 = [ 89, player_single2 ] +{ + self.weaponframe = 1; + muzzleflash (); +}; + +void () player_single2 = [ 90, player_run ] +{ + self.weaponframe = 2; +}; + +void () player_single1_s = [ 182, player_single2_s ] +{ + self.weaponframe = 1; + muzzleflash (); +}; + +void () player_single2_s = [ 183, player_run ] +{ + self.weaponframe = 2; +}; //============================================================================ @@ -195,6 +441,28 @@ void(vector org, float damage) SpawnBlood = multicast (org, MULTICAST_PVS); }; +void(vector org, float damage) SpawnNonBlood = +{ + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_KNIGHTSPIKE); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + multicast (org, MULTICAST_PVS); +}; + +void(vector org, float damage) MassBlood = +{ + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_GUNSHOT); + WriteByte (MSG_MULTICAST, 1); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + multicast (org, MULTICAST_PVS); +}; + + /* ================ spawn_touchblood @@ -357,32 +625,15 @@ void() T_MissileTouch = if (other == self.owner) return; // don't explode on owner - if (self.voided) { - return; - } - self.voided = 1; - if (pointcontents(self.origin) == CONTENT_SKY) { remove(self); return; } - damg = 100 + random()*20; - - if (other.health) - { - other.deathtype = "rocket"; - T_Damage (other, self, self.owner, damg ); - } - // don't do radius damage to the other, because all the damage - // was done in the impact + T_RadiusDamage2 (self, self.owner, 100+random()*100, world, 600); - - T_RadiusDamage (self, self.owner, 120, other, "rocket"); - -// sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); self.origin = self.origin - 8 * normalize(self.velocity); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); @@ -396,6 +647,126 @@ void() T_MissileTouch = }; +/* +================ +W_FirePlasma +================ +*/ +void () PlasmaBolt = +{ + local float dam; + local float zdif; + local float ydif; + local float xdif; + local float tru; + + if (other.solid == SOLID_TRIGGER) + return; //they're not really solid + + if (pointcontents (self.origin) == CONTENT_SKY) + { + remove (self); + return; + } + + if (other.takedamage) + { + dam = 30 + (random () * 30); + + T_Damage (other, self, self.owner, dam); + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNINGBLOOD); + WriteCoord (MSG_MULTICAST, self.origin_x); + WriteCoord (MSG_MULTICAST, self.origin_y); + WriteCoord (MSG_MULTICAST, self.origin_z); + multicast (self.origin, MULTICAST_PHS); + sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_NORM); + } + else + { + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNINGBLOOD); + WriteCoord (MSG_MULTICAST, self.origin_x); + WriteCoord (MSG_MULTICAST, self.origin_y); + WriteCoord (MSG_MULTICAST, self.origin_z); + multicast (self.origin, MULTICAST_PHS); + sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_NORM); + } + remove (self); +}; + +void() FirePlasmaBolt = +{ + local float tmp; + local vector adjust; + + if (self.attack >= 3) + return; + + DropAmmo (); + self.attack_finished = time + 0.1; + + sound (self, CHAN_WEAPON, "weapons/energy2.wav", 1, ATTN_NORM); + + msg_entity = self; + WriteByte (MSG_ONE, SVC_SMALLKICK); + + self.recoil = self.recoil + 4; + self.attack = self.attack + 1; + + if (random()*3<=2) + self.driftx = self.driftx + 72; + else + self.driftx = self.driftx - 72; + + if (random()*2<=1) + self.drifty = self.drifty + 72; + else + self.drifty = self.drifty - 72; + + newmis = spawn (); + newmis.owner = self; + newmis.movetype = MOVETYPE_FLYMISSILE; + newmis.solid = SOLID_BBOX; + + makevectors (self.v_angle); + newmis.velocity = aim(self, 2000); + newmis.velocity = newmis.velocity * 2000; + newmis.angles = vectoangles(newmis.velocity); + + newmis.touch = PlasmaBolt; + newmis.voided = 0; + + newmis.nextthink = time + 5; + newmis.think = SUB_Remove; + newmis.classname = "rocket"; + + if (self.position == 0) + player_single1(); + if (self.position == 1) + player_single1_s(); + if (self.position == 2) + player_single1_s(); + + + if (self.position == 0) + adjust = '0 0 0'; + if (self.position == 1) + adjust = '0 0 -16'; + if (self.position == 2) + adjust = '0 0 -32'; + + newmis.effects = EF_BLUE; + setmodel (newmis, "progs/plasma.mdl"); + setsize (newmis, '0 0 0', '0 0 0'); + setorigin (newmis, self.origin + v_forward*8 + '0 0 16' + adjust); + + tmp = 60; + tmp = tmp + self.velocity_y + self.velocity_x; + + newmis.velocity = newmis.velocity + (v_right * crandom () * tmp) + (v_up * crandom () * tmp); + +}; /* ================ @@ -453,6 +824,8 @@ void(entity from, float damage) LightningHit = multicast (trace_endpos, MULTICAST_PVS); T_Damage (trace_ent, from, from, damage); + if (trace_ent.classname == "player") + trace_ent.hold = 120; }; /* @@ -938,6 +1311,9 @@ float() W_BestWeapon = return IT_AXE; }; +void() player_reload1; +void() player_creload1; + void (float slotno) ReloadWeapon = { local float at; @@ -946,12 +1322,16 @@ void (float slotno) ReloadWeapon = local float ac; local float x; local float wid; + local float r; local .float wslot; if (self.rtime > time || self.attack_finished > time) return; + if (self.zoom > 0) + ZoomIn(); + wslot = SlotField(slotno); if (self.wslot == 0) @@ -987,13 +1367,38 @@ void (float slotno) ReloadWeapon = self.wslot = SlotVal(wid, x + ToStatus(self.wslot)); - if (wid == IID_WP_ROCKETLAUNCHER || wid == IID_WP_PIPERIFLE || wid == IID_WP_WINCHESTER || wid == IID_WP_MOSSBERG) + r = 3; + + if (wid == IID_WP_ROCKETLAUNCHER || wid == IID_WP_WINCHESTER || wid == IID_WP_MOSSBERG) { - sound (self, CHAN_WEAPON, "weapons/shell.wav", TRUE, ATTN_NORM); - self.attack_finished = time + 1; - self.rtime = time + 1; + sound (self, CHAN_VOICE, "weapons/shell.wav", TRUE, ATTN_NORM); + r = 1; if (self.current_slot == slotno) self.currentammo = ToStatus(ItemInSlot(self, slotno)); + self.attack_finished = time + r; + self.rtime = time + r; + + return; + } + else if (wid == IID_WP_PIPERIFLE_R || wid == IID_WP_PIPERIFLE_S_R || wid == IID_WP_PIPERIFLE_SCOPE_R || wid == IID_WP_PIPERIFLE_SCOPE_S_R) + { + sound (self, CHAN_VOICE, "weapons/shell.wav", TRUE, ATTN_NORM); + r = 0.5; + if (self.current_slot == slotno) + self.currentammo = ToStatus(ItemInSlot(self, slotno)); + self.attack_finished = time + r; + self.rtime = time + r; + + return; + } + else if (wid >= IID_WP_PIPERIFLE && wid <= IID_WP_PIPERIFLE_S_R) + { + sound (self, CHAN_VOICE, "weapons/shell.wav", TRUE, ATTN_NORM); + r = 1; + if (self.current_slot == slotno) + self.currentammo = ToStatus(ItemInSlot(self, slotno)); + self.attack_finished = time + r; + self.rtime = time + r; return; } @@ -1002,16 +1407,17 @@ void (float slotno) ReloadWeapon = sprint(self, 2, "reloading...\n"); - if (self.perk == 3) - { - self.attack_finished = time + 1; - self.rtime = time + 1; - } - else - { - self.attack_finished = time + 2; - self.rtime = time + 2; - } + if (self.position == 0) + player_reload1(); + else if (self.position == 1) + player_creload1(); + + if (getperk(5)) + r = r * 0.5; + + + self.attack_finished = time + r; + self.rtime = time + r; if (self.current_slot == slotno) self.currentammo = ToStatus(ItemInSlot(self, slotno)); @@ -1054,6 +1460,22 @@ float() W_CheckNoAmmo = return FALSE; }; +void() ToggleFlare = +{ + if (self.flare == 0) + { + sound (self, CHAN_BODY, "weapons/flare.wav", 1, ATTN_NORM); + self.flare = 1; + self.effects = EF_BLUE; + } + else if (self.flare == 1) + { + sound (self, CHAN_BODY, "weapons/gpull.wav", 1, ATTN_NORM); + self.flare = 0; + self.effects = self.effects - EF_BLUE; + } +}; + /* ============ W_Attack @@ -1066,11 +1488,26 @@ void() W_Attack = { local float weap; + if (self.hold > 0) + return; + + if (self.popup > 0) + { + self.popup = 0; + self.attack_finished = time + 5; + stuffcmd(self, "-attack\n"); + return; + } + makevectors (self.v_angle); // calculate forward angle for velocity self.show_hostile = time + 1; // wake monsters up if (self.rtime > time) return; + if (self.class == 0) + return; + if (self.team == 0) + return; if (self.attack_finished > time) return; @@ -1079,72 +1516,183 @@ void() W_Attack = weap = ToIID(self.(SlotField(self.current_slot))); + self.safezone = 0; - if (weap == IID_NONE || - weap == IID_WP_KNIFE || - weap == IID_WP_AXE || - weap == IID_WP_VIBROBLADE || - weap == IID_WP_POWERAXE) + if (weap == IID_NONE) + { + if (getperk(15)) + { + if ((self.velocity_z > 0) && self.recoil == 0) + player_dragon_kick (); + else + { + if (random()<0.25) + player_swing1 (); + else if (random()<0.25) + player_swing1a (); + else if (random()<0.25) + player_kick1 (); + else if (random()<0.25) + player_kick1a (); + } + + sound (self, CHAN_WEAPON, "effects/axe_swing.wav", TRUE, ATTN_IDLE); + } + else + { + self.attack_finished = time + 0.50; + if (random()<0.5) + player_punch1 (); + else + player_punch2 (); + + sound (self, CHAN_WEAPON, "weapons/ax1.wav", TRUE, ATTN_IDLE); + } + } + else if (weap == IID_WP_KNIFE) { self.attack_finished = time + 0.50; - player_knife1 (); + if (random()<0.5) + player_knife1 (); + else + player_knifea (); + + sound (self, CHAN_WEAPON, "weapons/ax1.wav", TRUE, ATTN_NORM); + + } + else if (weap == IID_WP_SPEAR) + { + self.attack_finished = time + 0.80; + + if (random()<0.5) + player_spear1 (); + else + player_spear1a (); + + sound (self, CHAN_WEAPON, "effects/miss.wav", TRUE, ATTN_NORM); + + } + else if (weap == IID_WP_AXE || weap == IID_WP_WRENCH) + { + if (random()<0.75) + { + player_axeb1 (); + self.attack_finished = time + 1; + } + else + { + player_axe1 (); + self.attack_finished = time + 1.25; + } } else if (weap == IID_WP_USP) - FirePistol(12, 2, "weapons/1911.wav", 2000, 0.25); + FirePistol(14, 6, "weapons/usp.wav", 2000, 0.1); + else if (weap == IID_WP_USP_S) + FirePistol(12, 6, "weapons/smg_s.wav", 2000, 0.1); else if (weap == IID_WP_DEAGLE) - FirePistol(15, 2, "weapons/deagle.wav", 2000, 0.25); + FirePistol(18, 9, "weapons/deagle.wav", 3000, 0.1); + else if (weap == IID_WP_DEAGLE_M) + FirePistol(18, 9, "weapons/deagle.wav", 3000, 0.1); else if (weap == IID_WP_NEEDLER) - FirePistol(10, 2, "weapons/needler.wav", 2000, 0.25); + FirePistol(16, 2, "weapons/needler.wav", 2000, 0.1); + else if (weap == IID_WP_GLOCK) + FirePistol(12, 6, "weapons/glock.wav", 2000, 0.1); + else if (weap == IID_WP_GLOCK_S) + FirePistol(10, 6, "weapons/smg_s.wav", 2000, 0.1); else if (weap == IID_WP_ALIENBLASTER) - FireAlienBlaster(); + FirePulseRifle(16, 0.1, 48, 2); else if (weap == IID_WP_PIPERIFLE) - FireAssaultRifle(18, 2, "weapons/rangem.wav", 3000, 0.1); + FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_S) + FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_S_R) + FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_SCOPE_S_R) + FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_SCOPE_S) + FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_R) + FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_SCOPE) + FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + else if (weap == IID_WP_PIPERIFLE_SCOPE_R) + FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + else if (weap == IID_WP_DKS1_S) + FireAssaultRifle(35, 3, "weapons/moonlight1.wav", 5000, 0.25); else if (weap == IID_WP_WINCHESTER) - W_FireShotgun (1, 5, 6, 160, 3000, 0); + W_FireShotgun (2, 4, 8, 30, 1500, 0, "weapons/shotgun1.wav"); else if (weap == IID_WP_MOSSBERG) - W_FireShotgun (1, 5, 6, 160, 3000, 0); + W_FireShotgun (2, 4, 8, 20, 2000, 1, "weapons/citykiller.wav"); else if (weap == IID_WP_JACKHAMMER) - W_FireShotgun (1, 5, 6, 160, 3000, 1); + W_FireShotgun (1, 4, 9, 25, 1750, 2, "weapons/citykiller.wav"); else if (weap == IID_WP_MP9) - FireSMG(12, 2, "weapons/burst.wav", 2000, 0.09); + FireSMG(14, 0, "weapons/mp7.wav", 1500, 0.10); else if (weap == IID_WP_MP7) - FireSMG(12, 2, "weapons/mp7.wav", 2000, 0.09); + FireSMG(12, 0, "weapons/mp5.wav", 1500, 0.08); + else if (weap == IID_WP_MP9_S) + FireSMG(12, 0, "weapons/smg_s.wav", 1500, 0.10); + else if (weap == IID_WP_MP7_S) + FireSMG(10, 0, "weapons/smg_s.wav", 1500, 0.08); else if (weap == IID_WP_RANGEMASTER) - FireAssaultRifle(14, 2, "weapons/rangem.wav", 4000, 0.5); + FireAssaultRifle(18, 4, "weapons/rangem.wav", 4000, 0.1); else if (weap == IID_WP_AK112) - FireAssaultRifle(14, 2, "weapons/ak112.wav", 4000, 0.09); + FireAssaultRifle(16, 10, "weapons/ak112.wav", 4000, 0.095); + else if (weap == IID_WP_AK112_M) + FireAssaultRifle(16, 10, "weapons/ak112.wav", 4000, 0.095); + else if (weap == IID_WP_ACR) + FireAssaultRifle(16, 7, "weapons/auto2.wav", 9000, 0.090); else if (weap == IID_WP_AK74) - FireAssaultRifle(18, 2, "weapons/ak47.wav", 4000, 0.1); + FireAssaultRifle(20, 12, "ogre/ak47.wav", 3500, 0.090); else if (weap == IID_WP_DKS1) - FireAssaultRifle(24, 2, "weapons/dks-1.wav", 8000, 0.5); - else if (weap == IID_WP_MOONLIGHT) - FireAssaultRifle(14, 2, "weapons/m4-nw.wav", 4000, 0.09); - else if (weap == IID_WP_SA80) - FireAssaultRifle(17, 2, "weapons/sa80.wav", 4000, 0.08); + FireAssaultRifle(40, 3, "weapons/dks-1.wav", 8000, 0.2); + else if (weap == IID_WP_MOONLIGHT && self.zoom == 0) + FireAssaultRifle(16, 10, "weapons/m4-nw.wav", 4000, 0.09); + else if (weap == IID_WP_MOONLIGHT && self.zoom == 1) + FireAssaultRifle(16, 5, "weapons/m4-nw.wav", 4000, 0.20); + else if (weap == IID_WP_G11 && self.zoom == 0) + FireAssaultRifle(14, 7, "weapons/g11.wav", 4000, 0.11); + else if (weap == IID_WP_G11 && self.zoom == 1) + FireAssaultRifle(14, 7, "weapons/g11.wav", 4000, 0.02); else if (weap == IID_WP_FNFAL) - FireAssaultRifle(12, 3, "weapons/fnfal.wav", 6000, 0.12); + FireAssaultRifle(30, 6, "weapons/fnfal.wav", 7000, 0.11); + else if (weap == IID_WP_PULSERIFLE) + FirePulseRifle(12, 0.8, 36, 2); + else if (weap == IID_WP_TURBOPLASMA) + FirePulseRifle(8, 0.4, 30, 2); + else if (weap == IID_WP_PLASMACARBINE) + FirePlasmaBolt(); + else if (weap == IID_WP_GAUSERIFLE) + FireAssaultRifle(30, 80, "weapons/gauss.wav", 9000, 0.2); + else if (weap == IID_WP_LASERGATLING) + FireMinigun(16, 20, "weapons/ak112.wav", 4000, 0.05); + + //FirePulseRifle(2, 0.1, 30, 3); + //float IID_WP_GAUSERIFLE = 421; //float IID_WP_PULSERIFLE = 422; else if (weap == IID_GREN_FRAG) - player_throw1(); + player_pull1(); else if (weap == IID_GREN_EMP) - player_throw1(); + player_pull1(); else if (weap == IID_GREN_SMOKE) - player_throw1(); + player_pull1(); else if (weap == IID_GREN_FLASH) - player_throw1(); + player_pull1(); else if (weap == IID_WP_ROCKETLAUNCHER) W_FireRocket(); - else if (weap == IID_WP_TOOLKIT) + else if (weap == IID_WP_WRENCH) { if (!FireToolkit()) { - self.attack_finished = time + 0.25; - player_knife1 (); + self.attack_finished = time + 1; + if (random()<0.5) + player_knife1 (); + else + player_knifea (); } } else if (IsChem(weap)) @@ -1168,16 +1716,33 @@ void() W_ChangeWeapon = it = self.items; am = 0; - - if (self.impulse == 1) + + + if (self.impulse == 1 && self.current_slot != 1) { + if (!getperk(5)) + { + self.weaponframe = 4; + self.attack_finished = time + 1; + self.rtime = time + 1; + } fl = IT_NAILGUN; - self.current_slot = 1; + self.current_slot = 1; + if (IsMelee(ToIID(self.islot1))) + SpawnGModel(); } - if (self.impulse == 2) + else if (self.impulse == 2 && self.current_slot != 2) { + if (!getperk(5)) + { + self.weaponframe = 4; + self.attack_finished = time + 1; + self.rtime = time + 1; + } fl = IT_SUPER_NAILGUN; self.current_slot = 2; + if (IsMelee(ToIID(self.islot2))) + SpawnGModel(); } self.weapon = fl; @@ -1191,6 +1756,16 @@ CheatCommand */ void() CheatCommand = { + local float x; + local string y; + + x = self.waterlevel; + y = ftos(x); + + sprint(self, 2, "waterlevel: "); + sprint(self, 2, y); + sprint(self, 2, "\n"); + self.ammo_shells = 900; }; @@ -1275,7 +1850,8 @@ void () ProneOff = { setsize(self, '-16 -16 -24', '16 16 32'); - if (!walkmove(0, 0)) + //if (!walkmove(0, 0) && self.waterlevel == 0) + if (pointcontents (self.origin + '0 0 32') == CONTENT_SOLID) //not enough room to stand up { sprint (self, 2, "not enough room to stand up.\n"); setsize(self, '-16 -16 -24', '16 16 0'); @@ -1283,6 +1859,16 @@ void () ProneOff = } sprint (self, 2, "position: stand.\n"); + if (getperk(3)) + { + self.attack_finished = time + 0.5; + self.rtime = time + 0.5; + } + else + { + self.attack_finished = time + 1.5; + self.rtime = time + 1.5; + } self.position = 0; PositionControl(); player_run (); @@ -1290,7 +1876,16 @@ void () ProneOff = void () ProneOn = { - if (self.velocity_z != 0) + if (self.waterlevel > 0) + { + sprint (self, 2, "position: stand.\n"); + self.position = 0; + PositionControl(); + player_run (); + return; + } + + if (!getperk(3) && self.velocity_z != 0) return; if (self.position == 2) @@ -1299,10 +1894,22 @@ void () ProneOn = return; } + self.walk = 0; + self.speedmulti = 1.00; self.maxspeed = (self.maxspeed * 0.25); self.position = 2; self.view_ofs = '0 0 -10'; sprint (self, 2, "position: prone.\n"); + if (getperk(3)) + { + self.attack_finished = time + 0.5; + self.rtime = time + 0.5; + } + else + { + self.attack_finished = time + 1.5; + self.rtime = time + 1.5; + } PositionControl(); }; @@ -1311,13 +1918,19 @@ void () DuckOff = { setsize(self, '-16 -16 -24', '16 16 32'); - if (!walkmove(0, 0)) + //if (!walkmove(0, 0) && self.waterlevel == 0) + if (pointcontents (self.origin + '0 0 16') == CONTENT_SOLID) //not enough room to stand up { sprint (self, 2, "not enough room to stand up.\n"); setsize(self, '-16 -16 -24', '16 16 16'); return; } sprint (self, 2, "position: stand.\n"); + if (!getperk(3)) + { + self.attack_finished = time + 0.2; + self.rtime = time + 0.2; + } self.view_ofs = '0 0 22'; self.position = 0; PositionControl(); @@ -1327,97 +1940,59 @@ void () DuckOff = void () DuckOn = { + if (self.waterlevel > 0) + { + if (!getperk(3)) + { + self.attack_finished = time + 0.5; + self.rtime = time + 0.5; + } + sprint (self, 2, "position: stand.\n"); + self.view_ofs = '0 0 22'; + self.position = 0; + PositionControl(); + player_run (); + self.position = 0; + return; + } + if (self.velocity_z != 0) return; - + if (self.position == 1) { DuckOff(); return; } + if (!getperk(3)) + { + self.attack_finished = time + 0.5; + self.rtime = time + 0.5; + } + self.walk = 0; + self.speedmulti = 1.00; self.maxspeed = (self.maxspeed * 0.50); self.position = 1; sprint (self, 2, "position: duck.\n"); PositionControl(); }; - -/* -============ -CycleWeaponReverseCommand - -Go to the prev weapon with ammo -============ -*/ -void() CycleWeaponReverseCommand = +void () WalkOff = { - local float it, am; - - it = self.items; - self.impulse = 0; - - while (1) - { - am = 0; - - if (self.weapon == IT_LIGHTNING) - { - self.weapon = IT_ROCKET_LAUNCHER; - if (self.ammo_rockets < 1) - am = 1; - } - else if (self.weapon == IT_ROCKET_LAUNCHER) - { - self.weapon = IT_GRENADE_LAUNCHER; - if (self.ammo_rockets < 1) - am = 1; - } - else if (self.weapon == IT_GRENADE_LAUNCHER) - { - self.weapon = IT_SUPER_NAILGUN; - if (self.ammo_nails < 2) - am = 1; - } - else if (self.weapon == IT_SUPER_NAILGUN) - { - self.weapon = IT_NAILGUN; - if (self.ammo_nails < 1) - am = 1; - } - else if (self.weapon == IT_NAILGUN) - { - self.weapon = IT_SUPER_SHOTGUN; - if (self.ammo_shells < 2) - am = 1; - } - else if (self.weapon == IT_SUPER_SHOTGUN) - { - self.weapon = IT_SHOTGUN; - if (self.ammo_shells < 1) - am = 1; - } - else if (self.weapon == IT_SHOTGUN) - { - self.weapon = IT_AXE; - } - else if (self.weapon == IT_AXE) - { - self.weapon = IT_LIGHTNING; - if (self.ammo_cells < 1) - am = 1; - } - - if ( (it & self.weapon) && am == 0) - { - W_SetCurrentAmmo (); - return; - } - } - + sprint (self, 2, "position: run.\n"); + self.walk = 0; + self.speedmulti = 1.00; }; +void () WalkOn = +{ + sprint (self, 2, "position: walk.\n"); + self.walk = 1; + self.speedmulti = 0.50; +}; + /* ============ @@ -1440,21 +2015,48 @@ ImpulseCommands */ void() ImpulseCommands = { - if (self.impulse >= 1 && self.impulse <= 4 && self.currentmenu == "none") + if (self.hold > 0) + return; + + if (self.impulse >= 1 && self.impulse <= 2 && self.currentmenu == "none") W_ChangeWeapon (); - if (self.impulse >= 1 && self.impulse <= 10 && self.currentmenu != "none") + if (self.impulse == 3 && self.currentmenu == "none") + Cmd_InvUse("5"); + if (self.impulse == 4 && self.currentmenu == "none") + Cmd_InvUse("6"); + + if (self.impulse >= 1 && self.currentmenu == "shop_perk1") + { W_PlayerMenu (); + self.impulse = 0; + return; + } + else if (self.impulse >= 1 && self.currentmenu == "shop_perk2") + { + W_PlayerMenu (); + self.impulse = 0; + return; + } + else if (self.impulse >= 1 && self.impulse <= 10 && self.currentmenu != "none") + { + W_PlayerMenu (); + self.impulse = 0; + return; + } + if (self.impulse == 11) ServerflagsCommand (); - if (self.impulse == 12) - CycleWeaponReverseCommand (); + if (self.impulse == 200) DuckOn (); if (self.impulse == 201) ProneOn (); + if (self.impulse == 240) + AddClone (); + if (self.impulse == 50) ReloadWeapon (self.current_slot); // if (self.impulse == 51) @@ -1463,7 +2065,7 @@ void() ImpulseCommands = BuyMenu (); if (self.impulse == 53) Special (); - if (self.impulse == 54) + if (self.impulse == 100) ExitScreen (); if (self.impulse == 55) DropFromSlot (self.current_slot, 1, 0); @@ -1471,6 +2073,48 @@ void() ImpulseCommands = CharacterSheet (); if (self.impulse == 57) UseEquipment (); + if (self.impulse == 60) + ZoomIn (); + if (self.impulse == 65) + HostageReport (); + + if (self.impulse == 66) + WalkOn (); + if (self.impulse == 67) + WalkOff (); + + if (self.impulse == 212) + function_radio ("radio/1_yes.wav", 1); + if (self.impulse == 213) + function_radio ("radio/2_no.wav", 2); + if (self.impulse == 214) + function_radio ("radio/3_letsgo.wav", 3); + if (self.impulse == 215) + function_radio ("radio/4_cover.wav", 4); + if (self.impulse == 216) + function_radio ("radio/5_recon.wav", 5); + if (self.impulse == 217) + function_radio ("radio/6_backup.wav", 6); + if (self.impulse == 218) + function_radio ("radio/7_hold.wav", 7); + if (self.impulse == 219) + function_radio ("radio/8_behind.wav", 8); + if (self.impulse == 220) + function_radio ("radio/9_secure.wav", 9); + if (self.impulse == 221) + function_radio ("radio/10_suppressing.wav", 10); + if (self.impulse == 222) + function_radio ("radio/11_quiet.wav", 11); + if (self.impulse == 223) + CheatCommand(); + if (self.impulse == 224) + show_light_level(); + if (self.impulse == 225) + UseStimpack(); + if (self.impulse == 226) + UseSuperStim(); + if (self.impulse == 227) + UseMedicalBag(); if (self.impulse == 255) self.ammo_shells = 200; @@ -1487,6 +2131,8 @@ Called every frame so impulse events can be handled as well as possible */ void() W_WeaponFrame = { + local float weap; + if (time < self.attack_finished) return; @@ -1500,6 +2146,7 @@ void() W_WeaponFrame = } if (!self.button0) { + if (self.attack > 0) player_run (); @@ -1539,14 +2186,29 @@ void () DropAmmo = self.currentammo = ToStatus(self.wslot); }; -void() muzzleflash = + +void() autofire = { - WriteByte (MSG_MULTICAST, SVC_MUZZLEFLASH); - WriteEntity (MSG_MULTICAST, self); - multicast (self.origin, MULTICAST_PVS); + if (self.attack == 0) + self.cnt = 0; + + if (self.weaponframe == 1) + self.weaponframe = 2; + else + self.weaponframe = 1; + + if (self.cnt == 0) + player_singlex(); + else if (self.cnt == 1) + player_singley(); + + self.cnt = self.cnt + 1; + + if (self.cnt == 2) + self.cnt = 0; }; -void () autofire = +/*void () autofire = { if (self.frame == 88) self.frame = 89; @@ -1560,46 +2222,30 @@ void () autofire = self.weaponframe = 1; muzzleflash (); -}; +};*/ -void () autofire_s = +void() autofire_s = { - if (self.frame == 88) - self.frame = 89; - else - self.frame = 88; + if (self.attack == 0) + self.cnt = 0; if (self.weaponframe == 1) self.weaponframe = 2; else self.weaponframe = 1; - muzzleflash (); + if (self.cnt == 0) + player_auto_duck1(); + else if (self.cnt == 1) + player_auto_ducka1(); + + self.cnt = self.cnt + 1; + + if (self.cnt == 2) + self.cnt = 0; }; -void () player_single1 = [ 88, player_single2 ] -{ - self.weaponframe = 1; - muzzleflash (); -}; - -void () player_single2 = [ 89, player_run ] -{ - self.weaponframe = 2; -}; - -void () player_single1_s = [ 183, player_single2_s ] -{ - self.weaponframe = 1; - muzzleflash (); -}; - -void () player_single2_s = [ 184, player_run ] -{ - self.weaponframe = 2; -}; - void (vector org) bullet_hole = { local float r; @@ -1712,7 +2358,8 @@ void () EMPExplode = WriteCoord (MSG_BROADCAST, self.origin_z); sound (self, CHAN_BODY, "misc/flash.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "misc/flash.wav", 0.2, ATTN_NONE); - te = findradius (self.origin, 300); + + te = findradius (self.origin, 600); while (te) { if ((((te.classname == "camera") || (te.classname == "alarm")) && (te.owner.pcamera == 0))) @@ -1726,9 +2373,16 @@ void () EMPExplode = sprint (self.owner, 2, " was wiped out!\n"); remove (te); } + if (te.has_radio == 1) + { + te.has_radio = 0; + sprint (self.owner, 2, te.netname); + sprint (self.owner, 2, "'s radio was wiped out!\n"); + } + te = te.chain; } - T_RadiusDamage (self, self.owner, 45+random()*45, other, ""); + T_RadiusDamage (self, self.owner, 30+random()*30, other, ""); remove (self); }; @@ -1763,36 +2417,97 @@ void () SmokeThink = WriteCoord (MSG_MULTICAST, self.origin_z); multicast (self.origin, MULTICAST_PVS); + if (self.cnt == 1) + sound (self, CHAN_VOICE, "weapons/smoke.wav", 1, ATTN_NORM); + self.nextthink = (time + 0.33); if (self.cnt >= 90) remove (self); }; -void () FragExplode = +void () Screenshake = +{ + local entity te; + + te = findradius (self.origin, 700); + while (te) + { + if (te.classname == "player") + stuffcmd (te, "v_idlescale 5\n"); + te = te.chain; + } +}; + + +void () ExplosionFrames = +{ + self.avelocity = '300 300 250'; + self.nextthink = (time + 0.02); + self.frame = self.frame + 1; + if (self.frame == 60) + remove (self); + + self.nextthink = (time + 0.02); +}; + +void () Explosion = { local float r; - sound (self, CHAN_VOICE, "ambience/gunfire7.wav", 1, ATTN_NONE); - self.origin = (self.origin + '0 0 16'); + self.effects = EF_DIMLIGHT; + self.touch = SUB_Null; + + r = random (); + if (r < 0.33) + sound (self, CHAN_BODY, "misc/exp1.wav", 1, ATTN_NORM); + if (r < 0.66) + sound (self, CHAN_BODY, "misc/exp2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "misc/exp3.wav", 1, ATTN_NORM); + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); WriteByte (MSG_BROADCAST, TE_EXPLOSION); WriteCoord (MSG_BROADCAST, self.origin_x); WriteCoord (MSG_BROADCAST, self.origin_y); WriteCoord (MSG_BROADCAST, self.origin_z); - r = random (); - if ((r < 0.3)) + Screenshake (); + self.frame = 3; + self.velocity = VEC_ORIGIN; + self.avelocity = '300 300 250'; + self.think = ExplosionFrames; + self.nextthink = (time + 0.02); +}; + +void () FragExplode = +{ + local float r; + local entity te; + local vector dir; + + sound (self, CHAN_VOICE, "ambience/gunfire7.wav", 1, ATTN_NONE); + self.origin = (self.origin + '0 0 16'); + setmodel (self, "progs/blast.mdl"); + setorigin (self, self.origin); + setsize (self, '0 0 0', '0 0 0'); + + bprint(2, "fragex\n"); + Explosion(); + + te = findradius(self.origin, 400); + while (te)//bodies fly { - sound (self, CHAN_BODY, "misc/exp1.wav", 1, ATTN_NORM); + if (te.classname == "body") + { + dir = normalize(te.origin - self.origin); + te.velocity = dir * 100; + te.velocity_z = 100; + te.avelocity_y = (random()* 300); + } + + te = te.chain; } - if ((r < 0.65)) - { - sound (self, CHAN_BODY, "misc/exp2.wav", 1, ATTN_NORM); - } - else - { - sound (self, CHAN_BODY, "misc/exp3.wav", 1, ATTN_NORM); - } - T_RadiusDamage (self, self.owner, 50+random()*50, other, ""); + + T_RadiusDamage2 (self, self.owner, 65+random()*65, other, 400); remove (self); }; @@ -1826,26 +2541,65 @@ void () FlashExplode = WriteCoord (0, self.origin_y); WriteCoord (0, self.origin_z); sound (self, CHAN_BODY, "misc/flash.wav", 1, ATTN_NORM); - te = findradius (self.origin, 1200); + + te = findradius (self.origin, 200); while (te) { - if (te.flags & FL_MONSTER && te.classname != te.owner.classname) - te.attack_finished = time + 6; + if (te.flags & FL_MONSTER) + { + if (CanDamage (self, te)) + { + te.flash = 4; + te.attack_finished = time + 4; + spawn_excla(te, 4); + } + } if ((te.classname == "player")) { -/* makevectors (te.angles); + if (CanDamage (self, te)) + { + te.missionbrief = 5; + stuffcmd (te, "v_cshift 255 255 255 255\n"); + stuffcmd (te, "v_idlescale 3\n"); + te.flash = time + 4; + + spawn_excla(te, 4); + } + } + te = te.chain; + } + + te = findradius (self.origin, 800); + while (te) + { + if (te.flags & FL_MONSTER) + { + makevectors (te.angles); vec = normalize ((self.origin - te.origin)); dot = (vec * v_forward); -*/ - if (/*dot > 0.3 &&*/ CanDamage (self, te)) + + if (dot > 0.3 && CanDamage (self, te)) + { + te.flash = 4; + te.attack_finished = time + 4; + spawn_excla(te, 4); + } + + } + if ((te.classname == "player")) + { + makevectors (te.angles); + vec = normalize ((self.origin - te.origin)); + dot = (vec * v_forward); + + if (dot > 0.3 && CanDamage (self, te)) { stuffcmd (te, "v_cshift 255 255 255 255\n"); - stuffcmd (te, "v_idlescale 10\n"); - if (self.owner.flags & FL_MONSTER) - te.flash = time + 2; - else - te.flash = time + 6; + stuffcmd (te, "v_idlescale 3\n"); + te.flash = time + 4; + + spawn_excla(te, 4); } } te = te.chain; @@ -1853,6 +2607,39 @@ void () FlashExplode = remove (self); }; +void () FlashThink = +{ + local entity te; + + te = findradius(self.origin, 600); + + while (te) + { + if (te.classname == "player" && te.sneak > 0) + te.sneak = 0; + + te = te.chain; + } + + self.nextthink = time + 1; + self.score = self.score + 1; + + if (self.score == 120) + remove(self); +}; + +void () StunExplode = +{ + local entity te; + local float dot; + local vector vec; + + self.effects = EF_BLUE; + self.think = FlashThink; + self.nextthink = time + 1; + sound (self, CHAN_BODY, "misc/flash.wav", 1, ATTN_NORM); +}; + /* void () HandGrenExplode = { @@ -1870,6 +2657,7 @@ void () HandGrenExplode = { if ((self.cnt == 2)) { + sound (self, CHAN_VOICE, "weapons/smoke.wav", 1, ATTN_NORM); self.nextthink = (time + 0.5); self.think = SmokeThink; } @@ -1917,26 +2705,23 @@ void () HandGrenBounce = } }; - void () FireHandGrenade = { local float item, iid; local float amcount; + local float w, x; - item = ItemInSlot(self, self.current_slot); + item = ItemInSlot(self, self.grenslot); iid = ToIID(item); amcount = ToStatus(item); if (iid == 0) return; - self.currentammo = amcount-1; - if (amcount <= 1) - SetItemSlot(self, self.current_slot, 0); - else - SetItemSlot(self, self.current_slot, SlotVal(iid, self.currentammo)); - + w = SlotOfItem(self, iid); + DecreaseDestroySlot(w); + //SetItemSlot(self, self.current_slot, w); msg_entity = self; WriteByte (MSG_ONE, SVC_SMALLKICK); @@ -1962,6 +2747,8 @@ void () FireHandGrenade = newmis.think = FragExplode; else if (iid == IID_GREN_EMP) newmis.think = EMPExplode; + else if (iid == IID_GREN_STUN) + newmis.think = StunExplode; else if (iid == IID_GREN_SMOKE) newmis.think = SmokeThink; else //if (iid == IID_GREN_FLASH) @@ -1970,7 +2757,8 @@ void () FireHandGrenade = newmis.frame = 1; setmodel (newmis, "progs/handgren.mdl"); setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); - setorigin (newmis, ((self.origin + (v_right * TE_BLOOD)) + (v_up * TE_BLOOD))); + setorigin (newmis, self.origin); + self.grenslot = 0; }; @@ -2003,7 +2791,9 @@ void(float slot, float magazine) GiveAmmo = }; -void (float dam, float rec, string snd, float rng, float rate) FirePistol = + + +void (float dam, float ap, string snd, float rng, float rate) FirePistol = { local float weap, tmp, zdif, xdif, ydif, is_headshot; local vector dir, source, targ, org, org2, org3, adjust; @@ -2011,14 +2801,53 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol = weap = ToIID(self.(SlotField(self.current_slot))); stuffcmd(self, "-attack\n"); - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); self.attack_finished = (time + rate); + if (getperk(16))//power shot adds a small bonus to the first shot fired + { + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + dam = dam * 1.20; + } + } + + if (self.extender == weap && self.silencer != weap) + dam = dam * 1.10; + + + sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); + + if (weap == IID_WP_NEEDLER) + loud_noise(5); + else if (weap == IID_WP_USP) + loud_noise(40); + else if (weap == IID_WP_GLOCK) + loud_noise(40); + else if (weap == IID_WP_DEAGLE) + loud_noise(50); + else if (weap == IID_WP_USP_S) + loud_noise(10); + else if (weap == IID_WP_GLOCK_S) + loud_noise(10); + + //only silenced weapons do not break stealth + if (weap != IID_WP_NEEDLER && weap != IID_WP_USP_S && weap != IID_WP_GLOCK_S && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + } + + if (self.position == 0) + player_single1(); + if (self.position == 1) + player_single1_s(); + if (self.position == 2) + player_single1_s(); - if (self.position == POS_STAND) - player_single1 (); - if (self.position >= POS_DUCK) - player_single1_s (); if (self.position == 0) adjust = '0 0 0'; @@ -2030,25 +2859,23 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol = DropAmmo (); makevectors (self.v_angle); - if (self.recoil >= 15) - self.recoil = 15; + if (self.recoil >= 10) + self.recoil = 10; + tmp = 50; - if (self.velocity != '0 0 0') - tmp = 400; + if (self.velocity == '0 0 0') + tmp = tmp + (20 * self.recoil); + else + tmp = tmp + (40 * self.recoil); - tmp = tmp + (40 * self.recoil); - - if (self.attack <= 3 && self.position == 1 && self.velocity_z == 0) - tmp = (tmp * 0.75); - - if (self.attack <= 3 && self.position == 2 && self.velocity_z == 0) - tmp = (tmp * 0.5); + if (self.steadyaim == 0) + tmp = tmp * 0.50; self.attack = self.attack + 1; - self.recoil = self.recoil + 4; + self.recoil = self.recoil + ap; source = self.origin + '0 0 22'; @@ -2072,59 +2899,94 @@ void (float dam, float rec, string snd, float rng, float rate) FirePistol = is_headshot = 0; - if (((ydif >= CONTENT_SKY) && (ydif <= TE_LIGHTNING2))) + if (((ydif >= -6) && (ydif <= 6))) is_headshot = 1; - if (((xdif >= CONTENT_SKY) && (xdif <= TE_LIGHTNING2))) + if (((xdif >= -6) && (xdif <= 6))) is_headshot = 1; if (self.attack <= 5 && is_headshot == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) self.critical = 3; dam = (dam * (1 - trace_fraction)); - if (trace_ent.solid != SOLID_BSP) + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) SpawnBlood (org, 1); - - if (trace_ent.solid == SOLID_BSP) + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + else if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") SpawnWood (trace_ent, org, 1); dam = dam + random()*dam; + if (weap == IID_WP_NEEDLER) X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_USP) + J_Damage (trace_ent, self, self, dam); else T_Damage (trace_ent, self, self, dam); + loud_noise(5);//hit flesh + + //victim survived the ambush + if (random()*10 < 8 && trace_ent.health > 0 && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); + } + self.critical = 0; } else { + te_smallflash(org); bullet_hole (org); dir = vectoangles (source - targ); return; } }; -void (float dam, float rec, string snd, float rng, float rate) FireSMG = +void (float dam, float ap, string snd, float rng, float rate) FireSMG = { local float weap, tmp, zdif, xdif, ydif, is_headshot; local vector dir, source, targ, org, org2, adjust; weap = ToIID(self.(SlotField(self.current_slot))); - if (weap != IID_WP_MP9) - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); - if (weap == IID_WP_MP9 && self.attack == 0) - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); - if (weap == IID_WP_MP9 && self.attack == 6) + if (getperk(16))//power shot adds a small bonus to the first shot fired { - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); - self.attack = 1; + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + dam = dam * 1.20; + } + } + + sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); + if (weap == IID_WP_MP9) + loud_noise(50); + else if (weap == IID_WP_MP7) + loud_noise(40); + else if (weap == IID_WP_MP9_S) + loud_noise(5); + else if (weap == IID_WP_MP7_S) + loud_noise(5); + + //only silenced weapons do not break stealth + if (weap != IID_WP_MP9_S && weap != IID_WP_MP7_S && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); } self.attack_finished = (time + rate); - - if (self.position == POS_STAND) + if (self.position == 0) autofire (); - if (self.position >= POS_DUCK) + if (self.position >= 1) autofire_s (); if (self.position == 0) @@ -2135,30 +2997,43 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG = adjust = '0 0 -32'; + if (self.attack > 0) + { + if (random()*3<=2) + self.driftx = self.driftx + 90; + else + self.driftx = self.driftx - 90; + + if (random()*2<=1) + self.drifty = self.drifty + 90; + else + self.drifty = self.drifty - 90; + } + DropAmmo (); makevectors (self.v_angle); - if (self.recoil >= 15) - self.recoil = 15; - tmp = 200; + if (self.recoil >= 10) + self.recoil = 10; - if (self.velocity != '0 0 0') - tmp = 200; + tmp = 150; - tmp = tmp + (40 * self.recoil); - - if (self.attack <= 3 && self.position == 1 && self.velocity_z == 0) - tmp = (tmp * 0.75); - - if (self.attack <= 3 && self.position == 2 && self.velocity_z == 0) - tmp = (tmp * 0.5); + if (self.velocity == '0 0 0') + tmp = tmp + (15*self.recoil); + else + tmp = tmp + (20*self.recoil); self.attack = self.attack + 1; - self.recoil = self.recoil + 3; + self.recoil = self.recoil + 4; source = self.origin + '0 0 22'; - targ = self.origin + '0 0 22' + v_right*crandom()* tmp + v_up*crandom()*tmp; + tmp = tmp * 0.50; + + if (self.steadyaim == 0) + tmp = tmp * 0.50; + + targ = self.origin + '0 0 22' + v_right*self.driftx + v_up*self.drifty + v_right*crandom()* tmp + v_up*random()*(tmp*2); traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); if (trace_fraction == 1) @@ -2173,25 +3048,37 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG = ydif = org2_y - trace_ent.origin_y; xdif = org2_x - trace_ent.origin_x; is_headshot = 0; - if (((ydif >= CONTENT_SKY) && (ydif <= TE_LIGHTNING2))) + if (((ydif >= -5) && (ydif <= 5))) is_headshot = 1; - if (((xdif >= CONTENT_SKY) && (xdif <= TE_LIGHTNING2))) + if (((xdif >= -5) && (xdif <= 5))) is_headshot = 1; - if (self.attack <= 5 && is_headshot == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) + if (self.attack == 1 && is_headshot == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) self.critical = 3; dam = (dam * (1 - trace_fraction)); - if (trace_ent.solid != SOLID_BSP) + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) SpawnBlood (org, 1); - - if (trace_ent.solid == SOLID_BSP) + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") SpawnWood (trace_ent, org, 1); + dam = dam + random()*dam; + + if (weap == IID_WP_MP9) + J_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_MP7) + T_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_MP9_S) + J_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_MP7_S) + T_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); self.critical = 0; - if (trace_ent.solid == SOLID_BSP) + if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") penetrate (org, (dam / 2), (dam / 2)); } else @@ -2203,14 +3090,259 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG = } }; -void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle = +void (float rec, float speed, float dam, float type) FirePulseRifle = { - local float weap, hs, tmp, zdif, is_headshot, z; - local vector dir, source, targ, org, adjust, headshot_check; + local float dam, weap, tmp, zdif, xdif, ydif, is_headshot; + local vector dir, source, targ, org, org2, adjust; + local entity zap; weap = ToIID(self.(SlotField(self.current_slot))); - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); + if (weap != IID_WP_ALIENBLASTER) + { + if (self.recoil >= 15) + { + loud_noise(60); + sound (self, CHAN_WEAPON, "weapons/blowoff-1.wav", 1, ATTN_NORM); + self.attack_finished = (time + (1 + random()*1.5)); + return; + } + else if (weap != IID_WP_LASERGATLING) + { + loud_noise(60); + sound (self, CHAN_AUTO, "weapons/blowoff-2.wav", 0.5, ATTN_IDLE); + } + } + + + if (weap == IID_WP_ALIENBLASTER) + stuffcmd (self, "-attack\n"); + + if (weap != IID_WP_LASERGATLING) + { + loud_noise(20); + + if (random()<0.5) + sound (self, CHAN_WEAPON, "weapons/plasma-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "weapons/plasma-2.wav", 1, ATTN_NORM); + } + else if (weap == IID_WP_LASERGATLING && self.attack == 1) + { + loud_noise(40); + sound (self, CHAN_WEAPON, "weapons/laserburst1.wav", 1, ATTN_NORM); + } + + if (self.attack >= 6) + self.attack = 0; + + self.attack_finished = time + (speed*0.5) + (random()*speed*0.5); + + +//only silenced weapons do not break stealth + if (self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + } + + if (self.position == 0) + autofire (); + if (self.position >= 1) + autofire_s (); + + if (self.position == 0) + adjust = '0 0 -4'; + if (self.position == 1) + adjust = '0 0 -20'; + if (self.position == 2) + adjust = '0 0 -36'; + + + DropAmmo (); + makevectors (self.v_angle); + + if (self.recoil >= 20) + self.recoil = 20; + + tmp = 50; + + if (self.velocity != '0 0 0') + tmp = 100; + + tmp = tmp + (5*self.recoil); + + if (self.recoil <= 1 && self.velocity_z == 0) + tmp = (tmp * 0.5); + + self.attack = self.attack + 1; + self.recoil = self.recoil + rec; + + + source = self.origin + '0 0 22' + v_right*6 + v_forward*14; + source = source + adjust; + + tmp = tmp * 0.60; + + if (self.position == 2) + tmp = tmp * 0.60; + + targ = source + v_right*crandom()* tmp + v_up*crandom()*(tmp*2); + + traceline (source, targ+adjust+v_forward*2000, FALSE, self); + if (trace_fraction == 1) + return; + + org = trace_endpos - v_forward * 2; + org2 = trace_endpos + (v_forward * ((trace_ent.size_y / 2) + (trace_ent.size_x / 2))); + + zap = spawn(); + zap.origin = self.origin + v_right*16 + adjust; + zap.velocity = self.velocity; + zap.angles = self.angles; + zap.v_angle = self.v_angle; + + if (type == 1) + { + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNING1); + WriteEntity (MSG_MULTICAST, zap); + WriteCoord (MSG_MULTICAST, source_x); + WriteCoord (MSG_MULTICAST, source_y); + WriteCoord (MSG_MULTICAST, source_z); + WriteCoord (MSG_MULTICAST, trace_endpos_x); + WriteCoord (MSG_MULTICAST, trace_endpos_y); + WriteCoord (MSG_MULTICAST, trace_endpos_z); + multicast (org, MULTICAST_PHS); + } + if (type == 2) + { + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNING2); + WriteEntity (MSG_MULTICAST, zap); + WriteCoord (MSG_MULTICAST, source_x); + WriteCoord (MSG_MULTICAST, source_y); + WriteCoord (MSG_MULTICAST, source_z); + WriteCoord (MSG_MULTICAST, trace_endpos_x); + WriteCoord (MSG_MULTICAST, trace_endpos_y); + WriteCoord (MSG_MULTICAST, trace_endpos_z); + multicast (org, MULTICAST_PHS); + } + if (type == 3) + { + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNING3); + WriteEntity (MSG_MULTICAST, zap); + WriteCoord (MSG_MULTICAST, source_x); + WriteCoord (MSG_MULTICAST, source_y); + WriteCoord (MSG_MULTICAST, source_z); + WriteCoord (MSG_MULTICAST, trace_endpos_x); + WriteCoord (MSG_MULTICAST, trace_endpos_y); + WriteCoord (MSG_MULTICAST, trace_endpos_z); + multicast (org, MULTICAST_PHS); + } + remove(zap); + + if (trace_ent.takedamage) + { + + dam = (dam * (1 - trace_fraction)); + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + SpawnBlood (org, 1); + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + else if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") + SpawnWood (trace_ent, org, 1); + + + dam = dam + random()*dam; + + T_Damage (trace_ent, self, self, dam); + self.critical = 0; + + if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") + penetrate (org, (dam / 2), (dam / 2)); + } +}; + +void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultRifle = +{ + local float weap, hs, tmp, zdif, is_headshot, z, y; + local vector dir, source, targ, org, adjust, headshot_check; + local float xrecoil; + + //xrecoil: 8 is average, 12 high, 6 low + + weap = ToIID(self.(SlotField(self.current_slot))); + + if (getperk(16))//power shot adds a small bonus to the first shot fired + { + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + dam = dam * 1.20; + } + } + + if (self.extender == weap && self.silencer != weap) + dam = dam * 1.10; + + if (self.silencer == weap) + { + sound (self, CHAN_WEAPON, "weapons/needler.wav", 1, ATTN_NORM); + loud_noise(20); + } + else + { + if (weap == IID_WP_MOONLIGHT) + { + if (random()<0.5) + sound (self, CHAN_WEAPON, "weapons/moonlight-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "weapons/moonlight-2.wav", 1, ATTN_NORM); + } + else if (weap == IID_WP_DKS1_S) + sound (self, CHAN_WEAPON, "ogre/ak74.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); + + if (weap == IID_WP_DKS1) + loud_noise(100); + else if (weap == IID_WP_MOONLIGHT) + loud_noise(5); + else if (weap == IID_WP_DKS1_S) + loud_noise(15); + else if (weap == IID_WP_PIPERIFLE_S) + loud_noise(5); + else if (weap == IID_WP_PIPERIFLE_S_R) + loud_noise(5); + else if (weap == IID_WP_PIPERIFLE_SCOPE_S) + loud_noise(5); + else if (weap == IID_WP_PIPERIFLE_SCOPE_S_R) + loud_noise(5); + else + loud_noise(80); + + if (weap == IID_WP_DKS1) + stuffcmd(self, "v_idlescale 10\n"); + else if (weap == IID_WP_FNFAL) + stuffcmd(self, "v_idlescale 10\n"); + else if (weap == IID_WP_DKS1_S) + stuffcmd(self, "v_idlescale 10\n"); + + //only silenced weapons do not break stealth + if (weap != IID_WP_MOONLIGHT && weap != IID_WP_DKS1_S && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + } + } self.attack_finished = (time + rate); @@ -2223,8 +3355,8 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle DropAmmo (); makevectors (self.v_angle); - if (self.recoil >= 15) - self.recoil = 15; + if (self.recoil >= 10) + self.recoil = 10; if (self.attack == 0) { @@ -2245,6 +3377,204 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle player_single1 (); } + tmp = accuracy * 10; + xrecoil = dam / 2; + + //for the snipers + if (self.position == 2 && self.recoil == 0) + tmp = tmp * 0.75; + + if (self.steadyaim == 0) + tmp = tmp * 0.25; + + self.attack = self.attack + 1; + self.recoil = self.recoil + xrecoil; + + if (self.zoom > 0 && weap == IID_WP_G11 && self.attack == 3) + { + self.recoil = self.recoil + 10; + self.attack_finished = time + 1; + } + + if (tmp > 500) + tmp = 500; + + source = self.origin + '0 0 22'; + + targ = self.origin + '0 0 22' + v_right*self.driftx + v_up*self.drifty + v_right*crandom()* tmp + v_up*random()*tmp + v_up*random()*tmp; + + y = xrecoil * 12; + + if (self.attack == 0) + y = y * 0.90; + if (self.velocity == '0 0 0') + y = y * 0.90; + if (self.position == 2) + y = y * 0.80; + if (self.position == 1) + y = y * 0.90; + + if (random()*3<=2) + self.driftx = self.driftx + y; + else + self.driftx = self.driftx - y; + + if (random()*2<=1) + self.drifty = self.drifty + y; + else + self.drifty = self.drifty - y; + + traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); + if (trace_fraction == 1) + return; + + org = trace_endpos - v_forward * 2; + headshot_check = trace_endpos + v_forward * (trace_ent.size_x / 2); + + if (weap == IID_WP_PIPERIFLE) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_RANGEMASTER) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_DKS1) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_FNFAL && self.zoom == 1) + stuffcmd (self, "-attack\n"); + if (self.zoom > 0 && weap != IID_WP_G11 && weap != IID_WP_MOONLIGHT) + stuffcmd (self, "-attack\n"); + if (self.zoom > 0 && weap == IID_WP_G11 && self.attack >= 3 && weap != IID_WP_MOONLIGHT) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_GAUSERIFLE) + stuffcmd (self, "-attack\n"); + + if (trace_ent.takedamage) + { + + + if (self.attack <= 3) + { + is_headshot = 0; + hs = headshot_check_x - trace_ent.origin_x; + hs = hs + headshot_check_y - trace_ent.origin_y; + + if (hs < 0) + hs = hs * -1; + + if (hs <= 8) + is_headshot = 1; + + zdif = trace_endpos_z - trace_ent.origin_z; + + if (is_headshot == 1 && zdif >= (trace_ent.size_z / 2 * 0.8)) + self.critical = 3; + } + + + dam = (dam * (1 - trace_fraction)); + + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + SpawnBlood (org, 1); + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + else if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") + SpawnWood (trace_ent, org, 1); + + dam = dam + random()*dam; + + if (weap == IID_WP_DKS1 || weap == IID_WP_FNFAL || weap == IID_WP_ACR) + X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_AK112) + J_Damage (trace_ent, self, self, dam); + else + T_Damage (trace_ent, self, self, dam); + + loud_noise(5);//hit flesh + + //victim survived the ambush + if (random()*10 < 7.5 && trace_ent.health > 0 && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); + } + + + self.critical = 0; + + if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") + penetrate (org, (dam / 2), (dam / 2)); + } + else + { + loud_noise(15); + bullet_hole (org); + dir = vectoangles (source - targ); + penetrate (org, (dam / 2), (dam / 2)); + return; + } +}; + + + +void (float dam, float xrecoil, string snd, float rng, float rate) FireMinigun = +{ + local float weap, hs, tmp, zdif, is_headshot, z; + local vector dir, source, targ, org, adjust, headshot_check; + + //xrecoil: 40 is average, 60 high, 30 low + + weap = ToIID(self.(SlotField(self.current_slot))); + + if (self.attack <= 3) + { + self.weaponframe = self.attack; + self.attack_finished = time + 0.10; + self.attack = self.attack + 1; + return; + } + + if (self.attack == 4) + self.weaponframe = 5; + if (self.attack == 5) + self.weaponframe = 6; + if (self.attack == 6) + self.weaponframe = 7; + if (self.attack == 7) + self.weaponframe = 8; + if (self.attack == 8) + { + self.attack = 4; + self.weaponframe = 9; + } + + if (getperk(16))//power shot adds a small bonus to the first shot fired + { + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + dam = dam * 1.20; + } + } + + loud_noise(50); + + sound (self, CHAN_WEAPON, "weapons/ak112.wav", 0.8, ATTN_NORM); + + self.attack_finished = (time + rate); + + if (self.position == 0) + adjust = '0 0 0'; + if (self.position == 1) + adjust = '0 0 -16'; + if (self.position == 2) + adjust = '0 0 -32'; + + DropAmmo (); + makevectors (self.v_angle); + if (self.recoil >= 15) + self.recoil = 15; + tmp = 50; if (self.velocity_y < 0) @@ -2258,7 +3588,7 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle z = z + (self.velocity_x); tmp = tmp + z; - tmp = tmp + (40 * self.recoil); + tmp = tmp + (xrecoil * self.recoil); if (self.attack <= 3 && self.position == 1 && self.velocity_z == 0) tmp = (tmp * 0.75); @@ -2271,7 +3601,7 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle source = self.origin + '0 0 22'; - targ = self.origin + '0 0 22' + v_right*crandom()* tmp + v_up*crandom()*tmp; + targ = self.origin + '0 0 22' + v_right*crandom()* tmp + v_up*random()*tmp; traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); if (trace_fraction == 1) @@ -2280,6 +3610,21 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle org = trace_endpos - v_forward * 2; headshot_check = trace_endpos + v_forward * (trace_ent.size_x / 2); + if (weap == IID_WP_PIPERIFLE) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_RANGEMASTER) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_DKS1) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_FNFAL && self.zoom == 1) + stuffcmd (self, "-attack\n"); + if (self.zoom > 0 && weap != IID_WP_G11 && weap != IID_WP_MOONLIGHT) + stuffcmd (self, "-attack\n"); + if (self.zoom > 0 && weap == IID_WP_G11 && self.attack >= 3 && weap != IID_WP_MOONLIGHT) + stuffcmd (self, "-attack\n"); + if (weap == IID_WP_GAUSERIFLE) + stuffcmd (self, "-attack\n"); + if (trace_ent.takedamage) { @@ -2302,25 +3647,50 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle dam = (dam * (1 - trace_fraction)); - if (trace_ent.solid != SOLID_BSP && self.critical == 3) - SpawnBlood (org, 1); - if (trace_ent.solid == SOLID_BSP) + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + SpawnBlood (org, 1); + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + else if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") SpawnWood (trace_ent, org, 1); dam = dam + random()*dam; - if (weap != IID_WP_DKS1 && weap != IID_WP_FNFAL) - T_Damage (trace_ent, self, self, dam); - else if (weap == IID_WP_DKS1 || weap == IID_WP_FNFAL) + if (weap == IID_WP_DKS1) X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_FNFAL) + X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_DKS1_S) + X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_AK112) + X_Damage (trace_ent, self, self, dam); + else if (weap == IID_WP_AK112_M) + X_Damage (trace_ent, self, self, dam); + else + T_Damage (trace_ent, self, self, dam); + + loud_noise(5);//hit flesh + + //victim survived the ambush + if (random()*10 < 7.5 && trace_ent.health > 0 && self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); + } + + self.critical = 0; - if (trace_ent.solid == SOLID_BSP) + if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") penetrate (org, (dam / 2), (dam / 2)); } else { + loud_noise(15); bullet_hole (org); dir = vectoangles (source - targ); penetrate (org, (dam / 2), (dam / 2)); @@ -2329,84 +3699,22 @@ void (float dam, float rec, string snd, float rng, float rate) FireAssaultRifle }; -void () Screenshake = -{ - local entity te; - - te = findradius (self.origin, 700); - while (te) - { - if (((te.classname == "player") && (te.ghost == 0))) - { - stuffcmd (te, "v_iyaw_level 2\n"); - stuffcmd (te, "v_iyaw_cycle 32\n"); - stuffcmd (te, "v_ipitch_level 2\n"); - stuffcmd (te, "v_ipitch_cycle 32\n"); - stuffcmd (te, "v_iroll_level 2\n"); - stuffcmd (te, "v_iroll_cycle 32\n"); - stuffcmd (te, "v_idlescale 1\n"); - } - te = te.chain; - } -}; - -void () ScreenshakeSingle = -{ - stuffcmd (self, "v_iyaw_level 2\n"); - stuffcmd (self, "v_iyaw_cycle 32\n"); - stuffcmd (self, "v_ipitch_level 2\n"); - stuffcmd (self, "v_ipitch_cycle 32\n"); - stuffcmd (self, "v_iroll_level 2\n"); - stuffcmd (self, "v_iroll_cycle 32\n"); - stuffcmd (self, "v_idlescale 1\n"); -}; - -void () ExplosionFrames = -{ - self.avelocity = '300 300 250'; - self.nextthink = (time + 0.02); - self.frame = (self.frame + 1); - if (self.frame == 16) - remove (self); -}; - -void (float input) Explosion = -{ - local float r; - - self.effects = EF_DIMLIGHT; - self.touch = SUB_Null; - setmodel (self, "progs/blast.mdl"); - r = random (); - if ((r < 0.3)) - sound (self, CHAN_BODY, "misc/exp1.wav", 1, ATTN_NORM); - if ((r < 0.65)) - sound (self, CHAN_BODY, "misc/exp2.wav", 1, ATTN_NORM); - else - sound (self, CHAN_BODY, "misc/exp3.wav", 1, ATTN_NORM); - - WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte (MSG_BROADCAST, TE_EXPLOSION); - WriteCoord (MSG_BROADCAST, self.origin_x); - WriteCoord (MSG_BROADCAST, self.origin_y); - WriteCoord (MSG_BROADCAST, self.origin_z); - Screenshake (); - self.frame = AS_MELEE; - self.velocity = VEC_ORIGIN; - self.avelocity = '300 300 250'; - self.think = ExplosionFrames; - self.nextthink = (time + 0.02); -}; - - void () WeaponTouch = { - local float slotnum; + local float slotnum, x; if (other.classname != "player") return; - if (other.ghost != 0) return; + if (other.accept == 0) + return; + + other.accept = 0; + + x = (ToIID(self.islot1)); + + if (IsJunk(x) && other.class != 4) + return; if (ItemInSlot(other, other.current_slot) == 0 && FitsInSlot(other.current_slot, ToIID(self.islot1))) slotnum = other.current_slot; @@ -2429,6 +3737,82 @@ void () WeaponTouch = W_SetCurrentAmmo (); }; +void () AmmoTouch = +{ + local float slotnum,x,y,z; + + if (other.classname != "player") + return; + + if (other.ghost != 0) + return; + + x = ToIID(other.islot1); + y = ToIID(other.islot2); + z = ToIID(self.islot1); + + x = WeaponAmmoType(x); + y = WeaponAmmoType(y); + + + if ((x != z) && (y != z) && (other.accept == 0)) + return; + + other.accept = 0; + + if (!TryGiveStackable(other, ToIID(self.islot1), self.flash)) + { + sprint(other, PRINT_MEDIUM, "inventory full.\n"); + return; + } + + sound (other, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + + sprint(other, PRINT_MEDIUM, "found "); + sprint(other, PRINT_MEDIUM, GetItemName(ToIID(self.islot1))); + sprint(other, PRINT_MEDIUM, ".\n"); + + remove (self); + + self = other; + if (self.current_slot == slotnum) + W_SetCurrentAmmo (); +}; + +void () MultiTouch = +{ + local float slotnum,x,y,z; + + if (other.classname != "player") + return; + + if (other.ghost != 0) + return; + + if (other.accept == 0) + return; + + other.accept = 0; + + if (!TryGiveStackable(other, ToIID(self.islot1), self.flash)) + { + sprint(other, PRINT_MEDIUM, "inventory full.\n"); + return; + } + + sound (other, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + + sprint(other, PRINT_MEDIUM, "found "); + sprint(other, PRINT_MEDIUM, GetItemName(ToIID(self.islot1))); + sprint(other, PRINT_MEDIUM, ".\n"); + + remove (self); + + self = other; + if (self.current_slot == slotnum) + W_SetCurrentAmmo (); +}; + void (float slotnum, float snd, float force) DropFromSlot = { local float weap; @@ -2472,10 +3856,28 @@ void (float slotnum, float snd, float force) DropFromSlot = newmis.origin_z = self.origin_z; newmis.nextthink = (time + 180); newmis.think = SUB_Remove; - newmis.touch = WeaponTouch; - newmis.islot1 = weap; + if (ToIID(weap) >= IID_AM_NEEDLER && ToIID(weap) <= IID_AM_WARSAW) + { + newmis.flash = ToStatus(ItemInSlot(self, slotnum)); + newmis.touch = AmmoTouch; + newmis.skin = 1; + } + else if (ToIID(weap) >= IID_MISC_JUNK && ToIID(weap) <= IID_MISC_XRAYTUBE) + { + newmis.flash = ToStatus(ItemInSlot(self, slotnum)); + newmis.touch = MultiTouch; + } + else if (ToIID(weap) >= IID_CHEM_STIMPACK && ToIID(weap) <= IID_CHEM_RADX) + { + newmis.flash = ToStatus(ItemInSlot(self, slotnum)); + newmis.touch = MultiTouch; + } + else + newmis.touch = WeaponTouch; + + SetItemSlot(self, slotnum, 0); if (self.attack_finished < time+0.6) @@ -2489,6 +3891,65 @@ void (float slotnum, float snd, float force) DropFromSlot = }; +void (entity chest, float iid, float num) DropFromChest = +{ + local float weap; + local string mdel; + + makevectors (self.v_angle); + newmis = spawn (); + newmis.owner = self; + newmis.classname = "dropped_weapon"; + newmis.movetype = MOVETYPE_TOSS; + newmis.solid = SOLID_TRIGGER; + newmis.flags = FL_ITEM; //item makes it bigger to player touches. + newmis.velocity = aim (self, 500); + newmis.velocity = (newmis.velocity * 500); + newmis.angles_y = (random () * 360); + newmis.angles_x = (random () * 360); + newmis.velocity_x = (random () * 360); + newmis.velocity_x = (random () * 360); + + + mdel = GetItemWModel(iid); + + setmodel (newmis, mdel); + setsize (newmis, '-2 -2 0', '2 2 1'); + makevectors (self.v_angle); + setorigin (newmis, self.origin + '0 0 48'); + newmis.origin_z = self.origin_z; + newmis.nextthink = (time + 180); + newmis.think = SUB_Remove; + newmis.islot1 = iid*512; + + if (iid >= IID_AM_NEEDLER && iid <= IID_AM_WARSAW) + { + newmis.flash = num; + newmis.touch = AmmoTouch; + newmis.skin = ToIID(weap) - 506; + } + else if (iid >= IID_MISC_JUNK && iid <= IID_MISC_XRAYTUBE) + { + newmis.flash = num; + newmis.touch = MultiTouch; + } + else if (iid >= IID_CHEM_STIMPACK && iid <= IID_CHEM_RADX) + { + newmis.flash = num; + newmis.touch = MultiTouch; + } + else if (iid >= IID_ARM_SHIRT && iid <= IID_ARM_LPOWER) + { + newmis.flash = num; + newmis.touch = MultiTouch; + } + else + { + newmis.islot1 = (iid*512) + num; + newmis.touch = WeaponTouch; + } +}; + void (float slot) WeaponAmmo = { local float weap, amount; @@ -2499,73 +3960,6 @@ void (float slot) WeaponAmmo = GiveAmmo (slot, amount); }; -void() Crosshair = -{ - local float r; - local string new; - - r = 32 + (self.recoil*8); - if (r > 256) - r = 256; - if (r < 0) - r = 0; - - new = ftos(r); - stuffcmd(self, "crosshairsize "); - stuffcmd(self, new); - stuffcmd(self, "\n"); - r = 0.75 - (self.recoil*0.03); - if (r <= 0.25) - r = 0.25; - - new = ftos(r); - stuffcmd(self, "crosshairalpha "); - stuffcmd(self, new); - stuffcmd(self, "\n"); -}; - -float (entity healer, entity saved) RevivePlayer = -{ - local entity oself; - oself = self; - - self = saved; -/* if (!walkmove(0, 0)) - { - //too close? - return FALSE; - } -*/ - saved.deadflag = DEAD_NO; - saved.takedamage = DAMAGE_AIM; - saved.movetype = MOVETYPE_WALK; - saved.solid = SOLID_NOT; - - self = oself; - - saved.materialize = 200; - saved.ghost = 0; - saved.health = 2; - saved.air_finished = time + 10; - saved.view_ofs = '0 0 22'; - self = saved; - player_run(); - self = oself; - stuffcmd(saved, "impulse 1\n"); - if (healer.classname == "player") - { - sprint (healer, PRINT_HIGH, "you revive "); - sprint (healer, PRINT_HIGH, trace_ent.netname); - sprint (healer, PRINT_HIGH, ".\n "); - } - sprint (saved, PRINT_HIGH, healer.netname); - sprint (saved, PRINT_HIGH, " saves you from death.\n"); - saved.view2 = world; - - saved.flags (-) FL_FINDABLE_NONSOLID; - - return TRUE; -}; float(float iid) UseBoostingChem = { @@ -2578,17 +3972,23 @@ float(float iid) UseBoostingChem = x = GetItemName (iid); if (iid == IID_CHEM_ADRENALINE) - duration = 30+random()*30; + duration = 30; else if (iid == IID_CHEM_PSYCHO) - duration = 30+random()*30; + duration = 30; else if (iid == IID_CHEM_BESERK) - duration = 30+random()*30; + duration = 60; + else if (iid == IID_CHEM_RADX) + duration = 120; else { sprint (self, PRINT_HIGH, "Not a boosting chem\n"); return false; } + //chem addict: any self-used chem functions better + if (getperk(15)) + duration = duration * 2; + self.attack_finished = time + 1; makevectors (self.v_angle); @@ -2609,14 +4009,22 @@ float(float iid) UseBoostingChem = sprint (trace_ent, PRINT_HIGH, " used a "); sprint (trace_ent, PRINT_HIGH, x); sprint (trace_ent, PRINT_HIGH, " on you.\n"); - sound (trace_ent, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); + if (iid != IID_CHEM_RADX) + sound (trace_ent, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); + if (iid == IID_CHEM_RADX) + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + stuffcmd(trace_ent, "v_cshift 200 0 0 200\n"); trace_ent.rage = iid; trace_ent.ragetime = duration; return true; } if (self.health < self.max_health && self.rage == 0) { - sound (self, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); + stuffcmd(self, "v_cshift 200 0 0 200\n"); + if (iid != IID_CHEM_RADX) + sound (self, CHAN_BODY, "player/berserk.wav", 1, ATTN_NORM); + if (iid == IID_CHEM_RADX) + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); self.rage = iid; self.ragetime = duration; return true; @@ -2637,14 +4045,14 @@ float(float iid) UseHealingChem = x = GetItemName (iid); if (iid == IID_CHEM_STIMPACK) - heal = 2*5; + heal = 10; else if (iid == IID_CHEM_MEDICALBAG) { - heal = 3*5; - x = "bandage"; + heal = 5; + x = "medkit"; } else if (iid == IID_CHEM_SUPERSTIM) - heal = 4*5; + heal = 50; else { sprint (self, PRINT_HIGH, "Not a healing chem\n"); @@ -2653,11 +4061,12 @@ float(float iid) UseHealingChem = self.attack_finished = time + 1; + self.rtime = time + 0.9; makevectors (self.v_angle); source = self.origin + '0 0 0'; - traceline (source, source + v_forward*64, 32, self); - if (trace_ent.classname == "player" && trace_ent.team == self.team) + traceline (source, source + v_forward*64, FALSE, self); + if (trace_ent.classname == "player") { if (coop) friendly = true; //all players are friendly in coop @@ -2670,7 +4079,7 @@ float(float iid) UseHealingChem = if (!friendly) return false; - if (trace_ent.regen >= 1) + if (trace_ent.regen >= 1 && trace_ent.health > 0) { sprint (self, PRINT_HIGH, trace_ent.netname); sprint (self, PRINT_HIGH, " is already healing.\n"); @@ -2682,6 +4091,21 @@ float(float iid) UseHealingChem = sprint(self, PRINT_HIGH, " isn't injured.\n"); return false; } + + if (self.perk1 == 13 || self.perk2 == 13) + { + sprint(self, 2, "MEDICINE MAN\n"); + heal = heal * 1.25; + } + if (self.perk1 == 17 || self.perk2 == 17) + { + if (random()<0.05) + { + sprint(self, 2, "ONE IN A MILLION\n"); + heal = heal * 5; + } + } + sprint (trace_ent, PRINT_HIGH, self.netname); sprint (trace_ent, PRINT_HIGH, " used a "); sprint (trace_ent, PRINT_HIGH, x); @@ -2693,25 +4117,376 @@ float(float iid) UseHealingChem = sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); return true; } - if (self.health < self.max_health && self.regen == 0) + else if (self.health < self.max_health && self.regen == 0) { + sprint (self, PRINT_HIGH, "you heal yourself with a "); + sprint (self, PRINT_HIGH, x); + sprint (self, PRINT_HIGH, ".\n"); + + if (self.perk1 == 13 || self.perk2 == 13) + { + sprint(self, 2, "MEDICINE MAN\n"); + heal = heal * 1.25; + } + if (self.perk1 == 17 || self.perk2 == 17) + { + if (random()<0.05) + { + sprint(self, 2, "ONE IN A MILLION\n"); + heal = heal * 5; + } + } + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); self.health = self.health + heal; self.regen = heal; return true; } + return false; }; +float(entity x, float slotno) DecreaseDestroySlotOther; + +void () UseStimpack = +{ + local float x; + local vector source; + local entity thing; + + + if (self.attack_finished > time) + return; + + self.attack_finished = time + 1; + self.rtime = time + 1; + + makevectors (self.v_angle); + source = self.origin + '0 0 16'; + traceline (source, source + v_forward*64, FALSE, self); + + if (trace_fraction == 1.0)//nobody in front of user, so heal self + { + x = SlotOfItem(self, IID_CHEM_STIMPACK); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you don't have a stimpack\n"); + return; + } + + if (self.regen > 0) + sprint(self, PRINT_MEDIUM, "you are already affected by a stimpack\n"); + else if (self.health >= self.max_health) + sprint(self, PRINT_MEDIUM, "you are not injured.\n"); + else if (self.health < self.max_health) + { + DecreaseDestroySlot(x);//take away a stimpack + + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + sprint(self, PRINT_MEDIUM, "you heal yourself with a stimpack\n"); + + thing = findradius(self.origin, 400); + while (thing) + { + if (thing.classname == "player" && thing.health < self.health) + self.score = self.score - 50; + + thing = thing.chain; + } + + self.health = self.health + 10; + self.regen = self.regen + 10; + } + } + else if (trace_ent.classname == "player")//healing another team-mate + { + if (trace_ent.regen >= 1 && trace_ent.health > 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is already healing from a stimpack.\n"); + } + else if (trace_ent.health >= trace_ent.max_health) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is not injured.\n"); + } + else if (trace_ent.health < trace_ent.max_health) + { + x = SlotOfItem(self, IID_CHEM_STIMPACK); + if (x > 0) + DecreaseDestroySlot(x);//take away a stimpack + else if (x == 0) + { + sprint(self, PRINT_MEDIUM, "no stims! searching "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, "'s body...\n"); + + x = SlotOfItem(trace_ent, IID_CHEM_STIMPACK); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had no stims!\n"); + return; + } + else + { + self.score = self.score + 50; + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had a stim. using it to heal.\n"); + DecreaseDestroySlotOther(trace_ent, x);//take away a stimpack + } + } + + if (trace_ent.deadflag) + { + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + RevivePlayer(self, trace_ent); + } + else + { + sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + self.score = self.score + 50; + sprint(trace_ent, PRINT_MEDIUM, self.netname); + sprint(trace_ent, PRINT_MEDIUM, " heals you with a stimpack\n"); + sprint(self, PRINT_MEDIUM, "you heal "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " with a stimpack\n"); + + trace_ent.health = trace_ent.health + 10; + trace_ent.regen = trace_ent.regen + 10; + } + } + } +}; + +void () UseSuperStim = +{ + local float x; + local vector source; + + + if (self.attack_finished > time) + return; + + self.attack_finished = time + 1; + self.rtime = time + 1; + + makevectors (self.v_angle); + source = self.origin + '0 0 16'; + traceline (source, source + v_forward*64, FALSE, self); + + if (trace_fraction == 1.0)//nobody in front of user, so heal self + { + x = SlotOfItem(self, IID_CHEM_SUPERSTIM); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you don't have a superstim\n"); + return; + } + + if (self.regen > 0) + sprint(self, PRINT_MEDIUM, "you are already affected by a healing chem\n"); + else if (self.health >= self.max_health) + sprint(self, PRINT_MEDIUM, "you are not injured.\n"); + else if (self.health < self.max_health) + { + local entity thing; + thing = findradius(self.origin, 400); + while (thing) + { + if (thing.classname == "player" && (thing.health+20) < self.health) + self.score = self.score - 50; + + thing = thing.chain; + } + + DecreaseDestroySlot(x);//take away a stimpack + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + sprint(self, PRINT_MEDIUM, "you heal yourself with a superstim\n"); + self.xregen = 100; + } + } + else if (trace_ent.classname == "player")//healing another team-mate + { + if (trace_ent.regen >= 1 && trace_ent.health > 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is already healing from a healing chem.\n"); + } + else if (trace_ent.health >= trace_ent.max_health) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is not injured.\n"); + } + else if (trace_ent.health < trace_ent.max_health) + { + x = SlotOfItem(self, IID_CHEM_STIMPACK); + if (x > 0) + DecreaseDestroySlot(x);//take away a stimpack + else if (x == 0) + { + sprint(self, PRINT_MEDIUM, "no stims! searching "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, "'s body...\n"); + + x = SlotOfItem(trace_ent, IID_CHEM_SUPERSTIM); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had no stims!\n"); + return; + } + else + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had a superstim. using it to heal.\n"); + DecreaseDestroySlotOther(trace_ent, x);//take away a stimpack + } + } + + if (trace_ent.deadflag) + { + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + RevivePlayer(self, trace_ent); + } + else + { + sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + + self.score = self.score + 50; + sprint(trace_ent, PRINT_MEDIUM, self.netname); + sprint(trace_ent, PRINT_MEDIUM, " heals you with a superstim!\n"); + sprint(self, PRINT_MEDIUM, "you heal "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " with a superstim\n"); + + trace_ent.xregen = 100; + } + } + } +}; + +void () UseMedicalBag = +{ + local float x; + local vector source; + + + if (self.attack_finished > time) + return; + + self.attack_finished = time + 1; + self.rtime = time + 1; + + makevectors (self.v_angle); + source = self.origin + '0 0 16'; + traceline (source, source + v_forward*64, FALSE, self); + + if (trace_fraction == 1.0)//nobody in front of user, so heal self + { + x = SlotOfItem(self, IID_CHEM_MEDICALBAG); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you don't have a medkit\n"); + return; + } + + if (self.regen > 0) + sprint(self, PRINT_MEDIUM, "you are already affected by a healing chem\n"); + else if (self.health >= self.max_health) + sprint(self, PRINT_MEDIUM, "you are not injured.\n"); + else if (self.health < self.max_health) + { + DecreaseDestroySlot(x);//take away a medkit + + local entity thing; + thing = findradius(self.origin, 400); + while (thing) + { + if (thing.classname == "player" && (thing.health+20) < self.health) + self.score = self.score - 50; + + thing = thing.chain; + } + + sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + sprint(self, PRINT_MEDIUM, "you heal yourself with your medkit\n"); + self.health = self.health + 5; + self.regen = self.regen + 5; + } + } + else if (trace_ent.classname == "player")//healing another team-mate + { + if (trace_ent.regen >= 1 && trace_ent.health > 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is already healing from a healing chem.\n"); + } + else if (trace_ent.health >= trace_ent.max_health) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is not injured.\n"); + } + else if (trace_ent.health < trace_ent.max_health) + { + x = SlotOfItem(self, IID_CHEM_MEDICALBAG); + if (x > 0) + DecreaseDestroySlot(x);//take away a medkit + else if (x == 0) + { + sprint(self, PRINT_MEDIUM, "no stims! searching "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, "'s body...\n"); + + x = SlotOfItem(trace_ent, IID_CHEM_MEDICALBAG); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had no medkit!\n"); + return; + } + else + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had a medkit. using it to heal.\n"); + DecreaseDestroySlotOther(trace_ent, x);//take away a medkit + } + } + + if (trace_ent.deadflag) + { + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + RevivePlayer(self, trace_ent); + } + else + { + sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + self.score = self.score + 10; + sprint(trace_ent, PRINT_MEDIUM, self.netname); + sprint(trace_ent, PRINT_MEDIUM, " heals you with a stimpack\n"); + sprint(self, PRINT_MEDIUM, "you heal "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " with a stimpack\n"); + + trace_ent.health = trace_ent.health + 10; + trace_ent.regen = trace_ent.regen + 10; + } + } + } +}; + void () DisplayMenu = { local string menu; + local entity ze; + local float gotm, gotc, gots, gote; if (self.currentmenu == "none") return; if (self.currentmenu == "shop_list") { + self.missionbrief = 4; menu = ShopString (); centerprint (self, menu); } @@ -2720,19 +4495,38 @@ void () DisplayMenu = menu = TraitString (); centerprint (self, menu); } - if (self.currentmenu == "shop_perks") + if (self.currentmenu == "select_mission") + { + menu = MissionString (); + centerprint (self, menu); + } + if (self.currentmenu == "confirm_depart") + { + menu = DepartString (); + centerprint (self, menu); + } + if (self.currentmenu == "shop_perk1") { menu = PerkString (); centerprint (self, menu); } + if (self.currentmenu == "shop_perk2") + { + menu = PerkString (); + centerprint (self, menu); + } + if (self.currentmenu == "shop_armor") { menu = ArmorString (); centerprint (self, menu); } - if (self.currentmenu == "shop_protect") + if (self.currentmenu == "shop_ammo") { - menu = ProtectString (); + if (world.map_obj != 4) + menu = AmmoString (); + else + menu = AmmoString2 (); centerprint (self, menu); } if (self.currentmenu == "shop_melee") @@ -2780,19 +4574,53 @@ void () DisplayMenu = menu = EquipmentString (); centerprint (self, menu); } + if (self.currentmenu == "menu_lockpick") + { + menu = LockpickString (); + centerprint (self, menu); + } + if (self.currentmenu == "menu_defuse") + { + menu = DefuseString (); + centerprint (self, menu); + } + if (self.currentmenu == "display_enter_screen") + { + menu = EnterString (); + centerprint (self, menu); + } + if (self.currentmenu == "display_wait_screen") + { + menu = WaitString (); + centerprint (self, menu); + } if (self.currentmenu == "shop_weapons") { menu = WeaponString (); centerprint (self, menu); } - if (((self.currentmenu == "select_skill") && (self.team == 1))) + + if (self.currentmenu == "select_skill") { - centerprint (self, "CHOOSE SKILL SET‘\n\n1‘ Medic \n2‘ Assassin \n3‘ Soldier \n4‘ Scientist\n"); - } - if (((self.currentmenu == "select_skill") && (self.team == 2))) - { - centerprint (self, "CHOOSE SKILL SET‘\n\n1‘ Medic \n2‘ Assassin \n3‘ Soldier \n4‘ Scientist\n"); + ze = find (world, classname, "player"); + + while (ze) + { + if (ze.class == 1) + gotm += 1; + if (ze.class == 2) + gots += 1; + if (ze.class == 3) + gotc += 1; + if (ze.class == 4) + gote += 1; + + ze = find(ze, classname, "player"); + } + + centerprint (self, "choose skill set‘\n\n1‘ first aid \n2‘ stealth \n3‘ combat \n4‘ science \n"); } + if ((self.currentmenu == "select_team")) { if (self.class == 0) @@ -2804,8 +4632,6 @@ void () DisplayMenu = } if (self.currentmenu == "confirm_team") { - sound (self, CHAN_BODY, "player/yourturn.wav", 1, ATTN_NORM); - if (self.team == 1) centerprint (self, "you will respawn as‘\n\nRanger - OK?\n1‘ Yes \n2‘ No \n"); if (self.team == 2) @@ -2813,16 +4639,14 @@ void () DisplayMenu = } if (self.currentmenu == "confirm_skill") { - sound (self, CHAN_BODY, "player/yourturn.wav", 1, ATTN_NORM); - - if (self.class == 1) - centerprint (self, "your class will be‘\n\nMedic - OK?\n1‘ Yes \n2‘ No \n"); - if (self.class == 2) - centerprint (self, "your class will be‘\n\nAssassin - OK?\n1‘ Yes \n2‘ No \n"); - if (self.class == 3) - centerprint (self, "your class will be‘\n\nSoldiier - OK?\n1‘ Yes \n2‘ No \n"); - if (self.class == 4) - centerprint (self, "your class will be‘\n\nScientist - OK?\n1‘ Yes \n2‘ No \n"); + if (self.tclass == 1) + centerprint (self, "your skill-set will be‘\n\nfirst aid - OK?\n1‘ Yes \n2‘ No \n\nprimary: first aid\nsecondary: buff allies\n"); + if (self.tclass == 2) + centerprint (self, "your skill-set will be‘\n\nstealth - OK?\n1‘ Yes \n2‘ No \n\nprimary: stealth\nsecondary: damage"); + if (self.tclass == 3) + centerprint (self, "your skill-set will be‘\n\ncombat - OK?\n1‘ Yes \n2‘ No \n\nprimary: survival\nsecondary: damage"); + if (self.tclass == 4) + centerprint (self, "your skill-set will be‘\n\nscience - OK?\n1‘ Yes \n2‘ No \n\nprimary: create\nsecondary: bypass"); } if (self.currentmenu == "menu_build") @@ -2835,38 +4659,114 @@ void () DisplayMenu = void () Special = { -#if 0 -<<<< <<< weapons.qc -/* -==== === if (self.class == 1) - Bandage (); ->>>> >>> 1.2 - if (self.class == 2) -<<< <<<< weapons.qc - Cmd_InvUse(GetItemName(IID_CHEM_MEDICALBAG)); - if (self.class == 3) - Cmd_InvUse("sneak-boy"); - if (self.class == 4) - Cmd_InvUse(GetItemName(IID_GREN_FRAG)); - if (self.class == 6) - Cmd_InvUse("shield"); -*/ - -===== == - Sneak (); - if (self.class == 4) - self.currentmenu = "menu_build"; ->>>> >>> 1.2 -#endif + UseMedicalBag(); + else + Sneak(); }; void () hos_run1; void () hos_stand1; float (float iid) spawn_station; +.float gravity; + + +void () pickup_body = +{ + local float x, z, forward_okay, down_okay, fp; + local vector dir, org; + local entity te; + + makevectors(self.enemy.v_angle); + traceline (self.enemy.origin, self.enemy.origin + v_forward*64, TRUE, self); + org = trace_endpos - v_forward*24; + + self.movetype = MOVETYPE_TOSS; + + if (self.enemy.pickup == 1) + { + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.gravity = 0; + dir = normalize(self.origin - (self.enemy.origin+'0 0 48')); + self.angles_y = dir; + self.velocity_z += 30; + self.goalentity = self.enemy; + self.velocity = dir * -100; + self.enemy.maxspeed = 100; + self.nextthink = time + 0.01; + return; + } + else if (self.enemy.pickup == 0) + { + self.velocity = '0 0 0'; + self.velocity_z = -250; + self.gravity = 800; + self.enemy = world; + return; + } +}; + +void () pickup_body2 = +{ + local float x, z; + local vector dir; + + x = vlen(self.origin - self.enemy.origin); + dir = normalize(self.origin - self.enemy.origin); + + self.movetype = MOVETYPE_STEP; + + z = self.origin_z - self.enemy.origin_z; + + if ((x >= 32 && x <= 96) && self.enemy.pickup == 1) + { + self.velocity = (dir * (-30)); + self.velocity_z = 1; + self.enemy.maxspeed = 50; + self.angles = dir; + self.nextthink = time + 0.01; + } + else if (x > 96 && self.enemy.pickup == 1) + { + self.velocity = '0 0 0'; + self.enemy.pickup = 0; + sprint(self.enemy, 2, "dropped body.\n"); + } +}; + +void () hos_face = +{ + local entity te; + + te = findradius (self.origin, 250); + while (te) + { + if (te.classname == "player") + { + self.enemy = te; + te.safezone = 1; + } + te = te.chain; + } + + self.angles_y = vectoyaw(self.enemy.origin - self.origin); + + self.nextthink = time + 0.1; + + if (vlen(self.origin - self.enemy.origin) > 250) + self.enemy = world; +}; + void () ExitScreen = { + local vector vec, dir; + local string ammoname, ammocountftos, rep; + local float best, ammotype, ammocount, dot; + local entity save; + + self.impulse = 0; + if (self.class == 0) return; @@ -2879,6 +4779,264 @@ void () ExitScreen = if (self.attack_finished > time) return; + self.accept = 1; + + if (self.currentmenu != "menu_none") + self.missionbrief = 0; + + makevectors (self.v_angle); + traceline (self.origin, self.origin + v_forward*128, FALSE, self); + + if (self.pickup == 1) + { + self.pickup = 0; + return; + } + if (trace_ent.classname == "body" && self.pickup == 0) + { + if ((self.perk1 == 12 || self.perk2 == 12) && (ToIID(self.islot3) != IID_ARM_DESERT)) + { + sprint(self, 2, "you loot the raider's desert armor\n"); + SetItemSlot(self, 3, SlotVal(IID_ARM_DESERT, 1)); + return; + } + + trace_ent.movetype = MOVETYPE_BOUNCE; + dir = normalize(trace_ent.origin - self.origin); + trace_ent.velocity = dir * 100; + trace_ent.velocity_z = 100; + trace_ent.avelocity_y = (random()* 30); + trace_ent.think = pickup_body; + trace_ent.enemy = self; + trace_ent.nextthink = time + 0.01; + self.pickup = 1; + sound (self, CHAN_BODY, "player/land.wav", 1, ATTN_IDLE); + sprint(self, 2, "grabbed body.\n"); + return; + } + else if (self.pickup == 1) + self.pickup = 0; + + if (trace_ent.classname == "bomb") + { + if (trace_ent.picking == 1) + { + sprint(self, 2, "already being defused.\n"); + return; + } + if (trace_ent.picking == 2) + { + sprint(self, 2, "that bomb is disarmed\n"); + return; + } + if (trace_ent.picking == 3) + { + sprint(self, 2, "circuits are jammed.\n"); + return; + } + + self.picking = 1; + trace_ent.picking = 1; + self.currentmenu = "menu_defuse"; + SpawnBomb(trace_ent, self); + return; + } + + if (trace_ent.classname == "brotherhood_guard") + { + + if (random()<0.25) + sound (self, CHAN_BODY, "enforcer/sight2.wav", 1, ATTN_NORM); + else if (random()<0.25) + sound (self, CHAN_BODY, "enforcer/sight2.wav", 1, ATTN_NORM); + else if (random()<0.25) + sound (self, CHAN_BODY, "enforcer/sight3.wav", 1, ATTN_NORM); + else + sound (self, CHAN_BODY, "enforcer/sight4.wav", 1, ATTN_NORM); + + sprint(self, 2, "guard: back off, grunts ain't allowed in here.\n"); + return; + } + + if (trace_ent.classname == "brotherhood_doctor") + { + sprint(self, 2, "doctor: if you are hurt, lie down and rest\n"); + return; + } + + if (trace_ent.classname == "brotherhood_soldier") + { + if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "make sure you buy ammo before going out\n"); + sprint(self, 2, "into the wastes, you'll use alot of it!\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "have team mates whose skills cover up your\n"); + sprint(self, 2, "weaknesses. first-aid and science-oriented\n"); + sprint(self, 2, "team members are crucial to a team.\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "those skilled in science & repair can make \n"); + sprint(self, 2, "make useful objects out of junk. this helps\n"); + sprint(self, 2, "improve your squad as a whole.\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "jhp stands for jacketed hollow-point, which\n"); + sprint(self, 2, "means the ammo spreads for a great deal of \n"); + sprint(self, 2, "stopping power against unarmored foes.\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "ap stands for armor-piercing, which means the \n"); + sprint(self, 2, "rounds will tear through armor like paper. use\n"); + sprint(self, 2, "such rounds when fighting heavily-armored foes\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "you can improve your stealth level by being\n"); + sprint(self, 2, "quiet, hugging walls, ducking, silencers, &\n"); + sprint(self, 2, "wearing light armor. \n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "perks are useful abilities. make sure you have\n"); + sprint(self, 2, "perks that complement your skills and playing \n"); + sprint(self, 2, "style. some perks even go really well together\n"); + } + else if (random()<0.12) + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "proper positioning of all squad members is key\n"); + sprint(self, 2, "to success in the battles you will face. make \n"); + sprint(self, 2, "sure to duck, prone and sneak when necessary \n"); + } + else + { + sprint(self, 2, "\n\n\n"); + sprint(self, 2, "if you are trained in first aid, do not forget\n"); + sprint(self, 2, "about your chems. psycho can provide temporary\n"); + sprint(self, 2, "armor bonus, and adrenaline lets you run fast.\n"); + } + return; + } + + if (trace_ent.classname == "brotherhood_sergeant") + { + sprint(self, 2, "sergeant: ready for your next mission?\n"); + self.currentmenu = "select_mission"; + return; + } + if (trace_ent.classname == "func_tank") + { + sprint(self, 2, "get ready to gear up!\n"); + self.currentmenu = "confirm_depart"; + return; + } + if (trace_ent.classname == "treasure_chest") + { + if (trace_ent.picking == 1) + { + sprint(self, 2, "already being picked.\n"); + return; + } + if (trace_ent.picking == 2) + { + sprint(self, 2, "that chest is empty!\n"); + return; + } + if (trace_ent.picking == 3) + { + sprint(self, 2, "lock is jammed.\n"); + return; + } + if (self.class != 2 && self.class != 4) + { + sound (self, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); + sprint(self, 2, "locked!\n"); + return; + } + + self.attack_finished = time + 0.5; + self.rtime = time + 4; + self.picking = 1; + trace_ent.picking = 1; + self.currentmenu = "menu_lockpick"; + SpawnOpenChest(trace_ent, self); + return; + } + + if (trace_ent.classname == "rhostage" && trace_ent.health > 0 && trace_ent.rescued == 0) + { + if (self.team != 1) + return; + + if (self.currentmenu != "none") + return; + + bprint (2, "hostage has been located.\n"); + rescue = rescue + 1; + //remove(trace_ent); + spawn_excla(trace_ent, 3000); + trace_ent.rescued = 1; + trace_ent.think = hos_face; + trace_ent.nextthink = time + 1; + + return; + } + if (trace_ent.classname == "monster" && trace_ent.health > 0) + { + if (self.sneak == 0) + return; + + if (self.class != 2) + return; + + if (self.currentmenu != "none") + return; + + + if (random()*100 <= 75) + { + if (trace_ent.ammo_shells == 0) + { + sprint(self, 2, "nothing to steal!\n"); + return; + } + sprint (self, 2, "success! stole "); + + ammotype = GetRandomAmmo(); + ammocount = GetAmmoCount(ammotype); + ammocount = ceil(ammocount); + ammoname = GetItemName(ammotype); + ammocountftos = ftos(ammocount); + sprint (self, 2, ammoname); + sprint (self, 2, "("); + sprint (self, 2, ammocountftos); + sprint (self, 2, ") "); + TryGiveStackable(self, ammotype, ammocount); + + sound (self, CHAN_WEAPON, "weapons/ax1", 1, ATTN_NORM); + trace_ent.ammo_shells = 0; + return; + } + else + { + sound (self, CHAN_WEAPON, "weapons/ax1", 1, ATTN_NORM); + sprint (self, 2, "pilfer failed...\n"); + return; + } + } if (trace_ent.classname == "hostage" && trace_ent.health > 0 && trace_fraction < 1) { if (self.team != 1) @@ -2918,6 +5076,35 @@ void () ExitScreen = } }; +void () disappear = +{ + local entity te; + local float nearby; + //this allows an assassin to vanish, making monsters aggro + //those who are visible + + te = findradius(self.origin, 500); + while (te) + { + if (te.classname == "player" && te.sneak == 0 && te != self) + nearby = 1; + + te = te.chain; + } + + if (nearby == 1) + { + te = findradius(self.origin, 1000); + while (te) + { + if (te.enemy == self) + te.enemy = world; + + te = te.chain; + } + } +}; + void () Sneak = { local float w; @@ -2932,33 +5119,14 @@ void () Sneak = self.sneak = 0; return; } - if (self.ammo_cells < 20) - { - sprint (self, PRINT_HIGH, "wait for stealth-boy to recharge.\n"); - return; - } - if (self.sneak == 0 && self.class == 2) + if (self.sneak == 0) { + disappear(); sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); - centerprint (self, " cloaked and sneaking \n(1% detection chance)"); + centerprint (self, " sneaking \n"); self.sneak = 1; return; } - else if (self.sneak == 0 && self.class != 2) - { - sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); - centerprint (self, " cloaked \n(15% detection chance)"); - self.sneak = 3; - return; - } - else if (self.sneak == 0 && w > 20) - { - sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); - centerprint (self, " too much gear \n"); - setmodel (self, "progs/guy.mdl"); - self.sneak = 0; - return; - } }; void () Shield = @@ -3170,9 +5338,8 @@ void () station_think = if (ammoslot) SetItemSlot(te, ammoslot, SlotVal(ammotype, x + ToStatus(ItemInSlot(te, ammoslot)))); - r = random()*6; - if (r < 1) - sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was received from the mr.ammo.\n"); + sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was received from the mr.ammo.\n"); +/* else if (r < 2) sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " potatos were received from the mr.ammo.\n"); else if (r < 3) @@ -3182,7 +5349,7 @@ void () station_think = else if (r < 5) sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was extracted from the mr.ammo.\n"); else - sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was given by the mr.ammo, along with an std\n"); + sprint (te, PRINT_MEDIUM, ftos(ceil(x)), " ammo was given by the mr.ammo, along with an std\n");*/ self.chemcount = self.chemcount - 1; } @@ -3419,12 +5586,10 @@ float() FireToolkit = //play a random build sound rr = random (); - if (rr < 0.3) - sound (self, CHAN_WEAPON, "misc/build1.wav", TRUE, ATTN_NORM); - else if (rr < 0.6) - sound (self, CHAN_WEAPON, "misc/build2.wav", TRUE, ATTN_NORM); + if (rr < 0.5) + sound (self, CHAN_WEAPON, "items/lockpick1.wav", TRUE, ATTN_NORM); else - sound (self, CHAN_WEAPON, "misc/build3.wav", TRUE, ATTN_NORM); + sound (self, CHAN_WEAPON, "items/lockpick2.wav", TRUE, ATTN_NORM); if (!trace_ent.nextthink) @@ -3452,7 +5617,6 @@ float() FireToolkit = trace_ent.nextthink = time; makevectors (self.v_angle); sprint(self, PRINT_HIGH, "Robofang appears to have malfunctioned\n"); -// spawn_dog (self.origin + v_forward * 32); } if (trace_ent.buildtype == IID_BUILD_AUTODOC) trace_ent.frame = 1; @@ -3466,6 +5630,30 @@ sprint(self, PRINT_HIGH, "Robofang appears to have malfunctioned\n"); return false; }; + +void () shop_face = +{ + local entity te; + + te = findradius (self.origin, 250); + while (te) + { + if (te.classname == "player") + { + self.enemy = te; + te.safezone = 1; + } + te = te.chain; + } + + self.angles_y = vectoyaw(self.enemy.origin - self.origin); + + self.nextthink = time + 0.1; + + if (vlen(self.origin - self.enemy.origin) > 500) + self.enemy = world; +}; + void () BuyMenu = { local float is_shop; @@ -3500,8 +5688,12 @@ void () BuyMenu = if (te.classname == "buyzone") is_shop = 1; if (te.classname == "merchant") + { + te.enemy = self; + te.think = shop_face; + te.nextthink = time + 0.5; is_shop = 1; - + } te = te.chain; } } @@ -3513,6 +5705,7 @@ void () BuyMenu = } if ((is_shop == 1)) { + self.missionbrief = 4; menu = ShopString (); centerprint (self, menu); self.currentmenu = "shop_list"; @@ -3578,20 +5771,7 @@ void () CharacterSheet = x = ftos (self.ammo_shells); sprint (self, 2, x); sprint (self, PRINT_HIGH, "$\n"); - if (self.class == 2) - { - sprint (self, PRINT_HIGH, "Bandages ‘ "); - x = ftos (self.bandages); - sprint (self, 2, x); - sprint (self, PRINT_HIGH, "\n"); - } - if (self.class == 6) - { - sprint (self, PRINT_HIGH, "Scraps ‘ "); - x = ftos (self.scraps); - sprint (self, 2, x); - sprint (self, PRINT_HIGH, "\n"); - } + /* sprint (self, PRINT_HIGH, "\nArmor ‘ "); x = GetArmorName(); @@ -3752,9 +5932,11 @@ void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 = dam = ((random () * dam) + dam); dam = (dam * (1 - trace_fraction)); - if (trace_ent.solid != SOLID_BSP) + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) SpawnBlood (org, 1); - if (trace_ent.solid == SOLID_BSP) + else if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && trace_ent.islot3 > 0) + SpawnNonBlood (org, 1); + else if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") SpawnWood (trace_ent, org, 1); zdif = (org_z - trace_ent.origin_z); @@ -3779,15 +5961,17 @@ void (vector s_aim, float dam, float tmp, float ran) W_FireBuckshotSpread1 = dam = dam + random()*dam; T_Damage (trace_ent, self, self, dam); + loud_noise(5);//hit flesh self.critical = 0; } else { + loud_noise(15);//richochet bullet_hole (org); } }; -void (float rec, float number, float dam, float spread, float ran, float auto) W_FireShotgun = +void (float rec, float number, float dam, float spread, float ran, float auto, string snd) W_FireShotgun = { local vector dir; local vector p_aim; @@ -3795,77 +5979,88 @@ void (float rec, float number, float dam, float spread, float ran, float auto) W local float var2; local float var3; local float var4; + local float weap; - if (self.velocity != '0 0 0') + if (getperk(16))//power shot adds a small bonus to the first shot fired { - var1 = ((random () * 48) * (6 + self.recoil * 1.5)); - var2 = ((random () * 48) * (6 + self.recoil * 1.5)); - var3 = ((random () * 48) * (6 + self.recoil * 1.5)); - var4 = ((random () * 48) * (6 + self.recoil * 1.5)); - } - if (self.position == 2) - { - var1 = ((random () * 12) * (6 + self.recoil * 1.5)); - var2 = ((random () * 12) * (6 + self.recoil * 1.5)); - var3 = ((random () * 12) * (6 + self.recoil * 1.5)); - var4 = ((random () * 12) * (6 + self.recoil * 1.5)); - } - if (self.position == 1) - { - var1 = ((random () * IDLE3A) * (6 + self.recoil * 1.5)); - var2 = ((random () * IDLE3A) * (6 + self.recoil * 1.5)); - var3 = ((random () * IDLE3A) * (6 + self.recoil * 1.5)); - var4 = ((random () * IDLE3A) * (6 + self.recoil * 1.5)); - } - if (self.position == 0) - { - var1 = ((random () * IDLE10A) * (6 + (self.recoil * 3))); - var2 = ((random () * IDLE10A) * (6 + (self.recoil * 3))); - var3 = ((random () * IDLE10A) * (6 + (self.recoil * 3))); - var4 = ((random () * IDLE10A) * (6 + (self.recoil * 3))); + if (self.steadyaim == 0) + { + sprint(self, 2, "!POWER SHOT\n"); + dam = dam * 1.20; + } } + weap = ToIID(self.(SlotField(self.current_slot))); + + var1 = (16 + (random () * 12) * (self.recoil)); + var2 = (16 + (random () * 12) * (self.recoil)); + var3 = (16 + (random () * 12) * (self.recoil)); + var4 = (16 + (random () * 12) * (self.recoil)); + if (self.position == 0) player_single1 (); - if (self.position == 2) - player_single1 (); - if (self.position == 1) + else player_single1_s (); + if (self.steadyaim == 0) + { + var1 = (8 + (random () * 6) * (self.recoil)); + var2 = (8 + (random () * 6) * (self.recoil)); + var3 = (8 + (random () * 6) * (self.recoil)); + var4 = (8 + (random () * 6) * (self.recoil)); + } + stuffcmd (self, "+lookup\n"); stuffcmd (self, "wait\n"); stuffcmd (self, "-lookup\n"); - sound (self, CHAN_WEAPON, "weapons/shotgun1.wav", 1.5, ATTN_NORM); + sound (self, CHAN_WEAPON, snd, 1.5, ATTN_NORM); + + //only silenced weapons do not break stealth + if (self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); + } + + + loud_noise(40); - p_aim = (((((self.origin + '0 0 20') + (v_right * var1)) - (v_right * var2)) + (v_up * var3)) - (v_up * var4)); msg_entity = self; WriteByte (MSG_ONE, SVC_BIGKICK); DropAmmo (); self.attack = (self.attack + 1); - self.recoil = (self.recoil + 8); - Crosshair(); + self.recoil = (self.recoil + 8*rec); if (self.recoil >= 30) self.recoil = 30; if (auto == 0) + { self.attack_finished = (time + 0.5); - + stuffcmd (self, "-attack\n"); + } if (auto == 1) + { + self.attack_finished = (time + 0.25); + stuffcmd (self, "-attack\n"); + } + if (auto == 2) self.attack_finished = (time + 0.2); dir = aim (self, 10000); - spread = 30; if ((number == MULTICAST_PVS_R)) { - W_FireBuckshotSpread1 (p_aim, dam, spread, ran); - W_FireBuckshotSpread1 ((p_aim + (v_right * 80)), dam, spread, ran); - W_FireBuckshotSpread1 ((p_aim - (v_right * 80)), dam, spread, ran); - W_FireBuckshotSpread1 ((p_aim + (v_up * 80)), dam, spread, ran); - W_FireBuckshotSpread1 ((p_aim - (v_up * 80)), dam, spread, ran); + W_FireBuckshotSpread1 (p_aim, dam, 30, ran); + W_FireBuckshotSpread1 ((p_aim + (v_right * spread)), dam, 30, ran); + W_FireBuckshotSpread1 ((p_aim - (v_right * spread)), dam, 30, ran); + W_FireBuckshotSpread1 ((p_aim + (v_up * spread)), dam, 30, ran); + W_FireBuckshotSpread1 ((p_aim - (v_up * spread)), dam, 30, ran); } else { @@ -3878,49 +6073,33 @@ void (float rec, float number, float dam, float spread, float ran, float auto) W } }; -void () PlasmaBolt = + + + +void (vector org) spawn_tracer = { - local float dam; - local float zdif; - local float ydif; - local float xdif; - local float tru; + local entity tracer; + local float x; + local string y; - if (other.solid == SOLID_TRIGGER) - return; //they're not really solid + x = 0; - if (pointcontents (self.origin) == CONTENT_SKY) - { - remove (self); - return; - } + tracer = spawn(); + setmodel(tracer, "progs/handgren.mdl"); + setorigin(tracer, org); + setsize(tracer, '0 0 0', '0 0 0'); + tracer.think = SUB_Remove; + tracer.nextthink = time + 2; - if (other.takedamage) - { - dam = 30 + (random () * 30); - - T_Damage (other, self, self.owner, dam); - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_LIGHTNINGBLOOD); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); - sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_NORM); - } - else - { - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_LIGHTNINGBLOOD); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); - sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_NORM); - } - remove (self); + if (pointcontents (org) == CONTENT_SOLID) + x = x + 1; + + y = ftos(x); + bprint(2, y); + bprint(2, "\n"); }; + //the alien blaster void () FireAlienBlaster = { @@ -3961,7 +6140,773 @@ void () FireAlienBlaster = setsize (newmis, '0 0 0', '0 0 0'); setorigin (newmis, self.origin + (v_right * WEAPON_BIG) + (v_forward * WEAPON_ROCKET) + '0 0 20'); + newmis.velocity = newmis.velocity + (v_right * random () * tmp) - (v_right * random () * tmp) + (v_up * random () * tmp) - (v_up * random () * tmp); self.attack_finished = time + 0.5; }; + + + +void () radio_think = +{ + self.cnt = self.cnt - 1; + setorigin (self, (self.owner.origin + '0 0 48')); + self.nextthink = (time + 0.01); + if (self.cnt <= 0) + remove (self); +}; + +void (entity jeb, float length) spawn_excla = +{ + local entity hologram; + + hologram = spawn (); + hologram.movetype = MOVETYPE_NONE; + hologram.solid = SOLID_NOT; + hologram.owner = jeb; + setmodel (hologram, "progs/radio.spr"); + setorigin (hologram, jeb.origin); + setsize (hologram, VEC_ORIGIN, VEC_ORIGIN); + hologram.angles = jeb.angles; + hologram.colormap = jeb.colormap; + hologram.cnt = 100*length; + hologram.think = radio_think; + hologram.nextthink = (time + 0.01); +}; + +void (string color) ZoomInLarge = +{ + if (self.attack_finished > time) + return; + + self.weaponmodel = "progs/v_scope1.mdl"; + self.zoom = 1; + stuffcmd (self, "fov 30\n"); + + if (color == "red") + stuffcmd (self, "v_cshift 100 0 0 50\n"); + if (color == "blue") + stuffcmd (self, "v_cshift 0 0 100 75\n"); + if (color == "green") + stuffcmd (self, "v_cshift 0 100 0 100\n"); + if (color == "yellow") + stuffcmd (self, "v_cshift 100 100 0 50\n"); + if (color == "purple") + stuffcmd (self, "v_cshift 100 0 100 100\n"); +}; + +void (string color) ZoomInSmall = +{ + if (self.attack_finished > time) + return; + + self.weaponmodel = "progs/v_scope2.mdl"; + self.zoom = 1; + stuffcmd (self, "fov 60\n"); + + if (color == "red") + stuffcmd (self, "v_cshift 100 0 0 50\n"); + if (color == "blue") + stuffcmd (self, "v_cshift 0 0 100 75\n"); + if (color == "green") + stuffcmd (self, "v_cshift 0 100 0 100\n"); + if (color == "yellow") + stuffcmd (self, "v_cshift 100 100 0 50\n"); + if (color == "purple") + stuffcmd (self, "v_cshift 100 0 100 100\n"); +}; + +void () ZoomOut = +{ + SetWeaponModel(); + self.zoom = 0; + stuffcmd (self, "fov 90\n"); + stuffcmd (self, "v_cshift 0 0 0 0\n"); +}; + +void () ZoomIn = +{ + local float weap; + + weap = ToIID(self.(SlotField(self.current_slot))); + + if (self.zoom > 0) + { + ZoomOut (); + return; + } + + if (weap == IID_WP_DKS1) + ZoomInLarge("purple"); + if (weap == IID_WP_ACR) + ZoomInLarge("pink"); + if (weap == IID_WP_DKS1_S) + ZoomInLarge("purple"); + if (weap == IID_WP_FNFAL) + ZoomInSmall("red"); + if (weap == IID_WP_G11) + ZoomInSmall("blue"); + if (weap == IID_WP_MOONLIGHT) + ZoomInSmall("green"); + + if (weap == IID_WP_PIPERIFLE_SCOPE) + ZoomInLarge("green"); + if (weap == IID_WP_PIPERIFLE_SCOPE_R) + ZoomInLarge("green"); + if (weap == IID_WP_PIPERIFLE_SCOPE_S) + ZoomInLarge("green"); + if (weap == IID_WP_PIPERIFLE_SCOPE_S_R) + ZoomInLarge("green"); +}; + + +void () HostageReport = +{ + local float acount, dcount; + local entity te; + local string ah, dh, rh; + local vector dir, org; + + hostages = 0; + dead_hostage = 0; + + org = self.origin; + + te = find (world, classname, "rhostage"); + while (te) + { + if (te.health > 0) + acount = acount + 1; + + if (te.health <= 0) + dcount = dcount + 1; + + te = find (te, classname, "rhostage"); + } + + te = find (world, classname, "rhostage"); + while (te) + { + if (te.health > 0) + { + dir = normalize(te.origin - self.origin); + traceline (self.origin, self.origin+dir*2000, FALSE, self); + + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_LIGHTNING2); + WriteEntity (MSG_MULTICAST, self); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + WriteCoord (MSG_MULTICAST, trace_endpos_x); + WriteCoord (MSG_MULTICAST, trace_endpos_y); + WriteCoord (MSG_MULTICAST, trace_endpos_z); + multicast (org, MULTICAST_PHS); + } + te = find (te, classname, "rhostage"); + } + + + hostages = acount; + dead_hostage = dcount; + + ah = ftos(acount); + dh = ftos(dcount); + rh = ftos(rescue); + + sprint (self, PRINT_HIGH, "*** HOSTAGE REPORT ***\n"); + sprint (self, PRINT_HIGH, "rescued: "); + sprint (self, PRINT_HIGH, rh); + sprint (self, PRINT_HIGH, "\n"); + sprint (self, PRINT_HIGH, "alive: "); + sprint (self, PRINT_HIGH, ah); + sprint (self, PRINT_HIGH, "\n"); + sprint (self, PRINT_HIGH, "dead: "); + sprint (self, PRINT_HIGH, dh); + sprint (self, PRINT_HIGH, "\n"); + + rh = ftos(supplies); + sprint (self, PRINT_HIGH, "*** SUPPLY REPORT ***\n"); + sprint (self, PRINT_HIGH, "supplies: "); + sprint (self, PRINT_HIGH, rh); + sprint (self, PRINT_HIGH, "\n"); +}; + + +void () clone_think = +{ + self.model = self.owner.model; + self.frame = self.owner.frame; + self.nextthink = time + 0.01; +}; + +void () AddClone = +{ + local entity clone; + + clone = spawn (); + setmodel(clone, "progs/guy.mdl"); + clone.owner = self; + clone.movetype = MOVETYPE_BOUNCE; + clone.solid = SOLID_NOT; + clone.touch = SUB_Null; + clone.owner = self; + clone.think = clone_think; + setsize(clone, '-16 -16 -24', '16 16 32'); + setorigin(clone, self.origin); + clone.nextthink = time + 0.01; + sprint(self, 2, "clone added.\n"); + self.health = 9000; +}; + +float (float x) find_percent = +{ + if (x == 1) + return world.map_ent1_percent; + if (x == 2) + return world.map_ent2_percent; + if (x == 3) + return world.map_ent3_percent; +}; + +float(vector org) light_level = +{ + local vector light; + local float brightness; + + light = getlight(self.origin); + brightness = light_x*0.3 + light_y*0.51 + light_z*0.2; + + return brightness; +}; + +void() show_light_level = +{ + local float x; + local string y; + + x = light_level(self.origin); + y = ftos(x); + + bprint(2, "light level: "); + bprint(2, y); + bprint(2, "\n"); +}; + +void() AttachSilencer = +{ + local float weap, x, y; + + weap = ToIID(self.(SlotField(self.current_slot))); + + y = SlotOfItem(self, IID_EQUIP_SILENCER); + + if (weap == IID_WP_USP) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_USP_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_USP_S, x)); + return; + } + } + else if (weap == IID_WP_DKS1) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_DKS1_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_DKS1_S, x)); + return; + } + } + else if (weap == IID_WP_GLOCK) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_GLOCK_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_GLOCK_S, x)); + return; + } + } + else if (weap == IID_WP_MP7) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_MP7_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_MP7_S, x)); + return; + } + } + else if (weap == IID_WP_MP9) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_MP9_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_MP9_S, x)); + return; + } + } + else if (weap == IID_WP_PIPERIFLE) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_S, x)); + return; + } + } + else if (weap == IID_WP_PIPERIFLE_R) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_S_R, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_S_R, x)); + return; + } + } + else if (weap == IID_WP_PIPERIFLE_SCOPE) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_SCOPE_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_SCOPE_S, x)); + return; + } + } + else if (weap == IID_WP_PIPERIFLE_SCOPE_R) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_SCOPE_S_R, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_SCOPE_S_R, x)); + return; + } + } + else + { + sprint(self, 2, "cannot be silenced.\n"); + return; + } + +}; + + +void() AttachExtender = +{ + local float weap; + + weap = ToIID(self.(SlotField(self.current_slot))); + + if (weap == IID_WP_NEEDLER || weap == IID_WP_MOONLIGHT) + { + sprint(self, 2, "that weapon already has a silencer attached\n"); + return; + } + if (weap == IID_WP_ALIENBLASTER) + { + sprint(self, 2, "how exactly do you extend that???\n"); + return; + } + if (self.silencer == weap) + { + sprint(self, 2, "that weapon already has a silencer attached\n"); + return; + } + else if (ToIID(self.islot4) == IID_EQUIP_EXTENDER && self.extender == 0) + { + self.extender = weap; + sprint(self, 2, "extender attached.\n"); + self.islot4 = 0; + self.attack_finished = time + 1; + self.rtime = time + 1; + return; + } +/* + else if (ToIID(self.islot4) == IID_EQUIP_EXTENDER && self.extender > 0) + { + self.extender = 0; + sprint(self, 2, "removing extender...\n"); + self.attack_finished = time + 1; + return; + }*/ +}; + +void (float iid) RemoveSilencer = +{ + if (ToIID(self.islot4) == 0) + { + SetItemSlot(self, 4, SlotVal(IID_EQUIP_SILENCER, 1)); + sprint(self, 2, "removing silencer...\n"); + self.attack_finished = time + 1; + self.rtime = time + 1; + self.silencer = 0; + } + else if (ToIID(self.islot4) > 0) + { + sprint(self, 2, "can't remove silencer, equipment slot is full\n"); + return; + } +}; + +void (float iid) RemoveExtender = +{ + if (ToIID(self.islot4) == 0) + { + SetItemSlot(self, 4, SlotVal(IID_EQUIP_EXTENDER, 1)); + sprint(self, 2, "removing extender...\n"); + self.attack_finished = time + 1; + self.rtime = time + 1; + self.extender = 0; + } + else if (ToIID(self.islot4) > 0) + { + sprint(self, 2, "can't remove extender, equipment slot is full\n"); + return; + } +}; + + +void (string snd, float type) function_radio = +{ + local entity te; + local vector dir; + local vector vec; + local float dot1; + local float dot2; + local float dot3; + local float dot4; + local float dot5; + local float dot6; + + if (!self.attack_finished) + { + return; + } + self.attack_finished = (time + 2); + spawn_excla (self, 2); + te = find (world, classname, "player"); + while (te) + { + if (te.team == self.team) + { + sprint (te, 2, "radio"); + makevectors (te.angles); + vec = normalize ((te.origin - self.origin)); + dot1 = ((vec * v_forward) * 1); + dot2 = ((vec * v_right) * CONTENT_EMPTY); + dot3 = ((vec * v_right) * 1); + dot4 = ((vec * v_forward) * CONTENT_EMPTY); + dot5 = ((vec * v_up) * 1); + dot6 = ((vec * v_up) * CONTENT_EMPTY); + if ((te == self)) + { + sprint (te, 2, "(talk)"); + } + else + { + if ((dot1 > 0.3)) + { + sprint (te, 2, "(ahead)"); + } + else + { + if ((dot2 > 0.3)) + { + sprint (te, 2, "(left)"); + } + else + { + if ((dot3 > 0.3)) + { + sprint (te, 2, "(right)"); + } + else + { + if ((dot4 > 0.3)) + { + sprint (te, 2, "(behind)"); + } + else + { + if ((dot5 > 0.3)) + { + sprint (te, 2, "(above)"); + } + else + { + if ((dot6 > 0.3)) + { + sprint (te, 2, "(below)"); + } + else + { + sprint (te, 2, "(???)"); + } + } + } + } + } + } + } + sprint (te, 2, self.netname); + if ((type == 1)) + { + sprint (te, 2, ": affirmative"); + } + else + { + if ((type == 2)) + { + sprint (te, 2, ": negative"); + } + else + { + if ((type == 3)) + { + sprint (te, 2, ": lets go"); + } + else + { + if ((type == 4)) + { + sprint (te, 2, ": team, take cover"); + } + else + { + if ((type == 5)) + { + sprint (te, 2, ": team, get in formation!"); + } + else + { + if ((type == 6)) + { + sprint (te, 2, ": need backup!"); + } + else + { + if ((type == 7)) + { + sprint (te, 2, ": hold this position"); + } + else + { + if ((type == 8)) + { + sprint (te, 2, ": check your six"); + } + else + { + if ((type == 9)) + { + sprint (te, 2, ": secure this area"); + } + else + { + if ((type == 10)) + { + sprint (te, 2, ": squad, use suppressing fire!"); + } + else + { + if ((type == 11)) + { + sprint (te, 2, ": team, silence"); + } + } + } + } + } + } + } + } + } + } + } + sprint (te, 2, "\n"); + sound (self, CHAN_VOICE, snd, 0.55, ATTN_IDLE); + } + te = find (te, classname, "player"); + } +}; + + +void () GModelThink = +{ + local float weap; + + weap = ToIID(self.(SlotField(self.owner.current_slot))); + + local float dot1; + + if (self.owner.health <= 0) + { + remove (self); + return; + } + if (!IsMelee(weap)) + { + setmodel(self, ""); + return; + } + if (self.owner.health >= 1) + { + self.frame = self.owner.weaponframe; + self.nextthink = (time + 0.01); + } + + self.nextthink = time + 0.01; + +}; + +void() SpawnGModel = +{ + local entity hologram; + local float weap; + + weap = ToIID(self.(SlotField(self.current_slot))); + + if (!self.wielded) + { + hologram = spawn (); + hologram.movetype = MOVETYPE_NONE; + hologram.solid = SOLID_NOT; + hologram.owner = self; + if (weap == IID_WP_KNIFE) + setmodel (hologram, "progs/g_knife.mdl"); + if (weap == IID_WP_WRENCH) + setmodel (hologram, "progs/g_wrench.mdl"); + if (weap == IID_WP_AXE) + setmodel (hologram, "progs/g_axe.mdl"); + if (weap == IID_WP_SPEAR) + setmodel (hologram, "progs/g_spear.mdl"); + + setsize (hologram, VEC_ORIGIN, VEC_ORIGIN); + + setattachment(hologram, self, ""); + hologram.nextthink = time + 0.01; + hologram.think = GModelThink; + self.wielded = hologram; + } + else + { + hologram = self.wielded; + hologram.movetype = MOVETYPE_NONE; + hologram.solid = SOLID_NOT; + hologram.owner = self; + if (weap == IID_WP_KNIFE) + setmodel (hologram, "progs/g_knife.mdl"); + if (weap == IID_WP_WRENCH) + setmodel (hologram, "progs/g_wrench.mdl"); + if (weap == IID_WP_AXE) + setmodel (hologram, "progs/g_axe.mdl"); + if (weap == IID_WP_SPEAR) + setmodel (hologram, "progs/g_spear.mdl"); + + setsize (hologram, VEC_ORIGIN, VEC_ORIGIN); + + setattachment(hologram, self, ""); + hologram.nextthink = time + 0.01; + hologram.think = GModelThink; + } +}; diff --git a/quakec/fallout2/wizard.qc b/quakec/fallout2/wizard.qc index b2047fffd..c9c096a92 100644 --- a/quakec/fallout2/wizard.qc +++ b/quakec/fallout2/wizard.qc @@ -187,15 +187,54 @@ FAST ATTACKS ============================================================================== */ +void() wizspike_touch = +{ + if (other == self.owner) + return; + + self.voided = 1; + + if (other.solid == SOLID_TRIGGER) + return; // trigger field, do nothing + + if (pointcontents(self.origin) == CONTENT_SKY) + { + remove(self); + return; + } + +// hit something that bleeds + if (other.takedamage) + { + T_Damage (other, self, self.owner, 12+random()*12); + other.maxspeed = other.maxspeed * 0.25; + } + else + { + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_WIZSPIKE); + WriteCoord (MSG_MULTICAST, self.origin_x); + WriteCoord (MSG_MULTICAST, self.origin_y); + WriteCoord (MSG_MULTICAST, self.origin_z); + multicast (self.origin, MULTICAST_PHS); + } + + remove(self); + +}; + void() Wiz_FastFire = { local vector vec; local vector dst; + local float x, y; + + x = random()*24; if (self.owner.health > 0) { makevectors (self.enemy.angles); - dst = self.enemy.origin - 13*self.movedir; + dst = self.enemy.origin - x*self.movedir; vec = normalize(dst - self.origin); sound (self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); @@ -203,6 +242,7 @@ void() Wiz_FastFire = newmis.velocity = vec*600; newmis.owner = self.owner; newmis.classname = "wizspike"; + newmis.touch = wizspike_touch; setmodel (newmis, "progs/w_spike.mdl"); setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); } @@ -244,9 +284,15 @@ void() Wiz_StartFast = void() Wiz_idlesound = { -local float wr; + local float wr; wr = random() * 5; + if (self.takedamage == DAMAGE_NO) + { + remove(self); + return; + } + if (self.waitmin < time) { self.waitmin = time + 2; @@ -255,6 +301,7 @@ local float wr; if (wr < 1.5) sound (self, CHAN_VOICE, "wizard/widle2.wav", 1, ATTN_IDLE); } + return; }; @@ -342,15 +389,10 @@ void() wiz_die = if (self.health < -40) { sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_wizard.mdl", -10); ThrowGib ("progs/gib2.mdl", -10); ThrowGib ("progs/gib2.mdl", -10); - ThrowGib ("progs/gib2.mdl", -10); - ThrowGib ("progs/gib3.mdl", -10); ThrowGib ("progs/gib1.mdl", -10); - return; } - wiz_death1 (); }; @@ -372,6 +414,12 @@ void() Wiz_Missile = void() monster_wizard = { + if (self.zone == 0) + { + load_monster(); + return; + } + precache_model ("progs/wizard.mdl"); precache_model ("progs/h_wizard.mdl"); precache_model ("progs/w_spike.mdl"); @@ -389,8 +437,12 @@ void() monster_wizard = setmodel (self, "progs/wizard.mdl"); - setsize (self, '-16 -16 -24', '16 16 40'); - self.health = 150; + setsize (self, '-16 -16 -16', '16 16 40'); + self.health = 80; + self.max_health = 80; + self.islot3 = SlotVal(IID_ARM_LEATHER, 1); + self.armornoise = "misc/thud.wav"; + self.team = 3; self.classname = "monster"; self.netname = "floater"; @@ -400,7 +452,6 @@ void() monster_wizard = self.th_missile = Wiz_Missile; self.th_pain = Wiz_Pain; self.th_die = wiz_die; - self.armornoise = "misc/thud.wav"; - flymonster_start (); + walkmonster_start (); }; diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 0b98cda6b..76a205e33 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -1,3 +1,303 @@ +void () monster_dog; +void () monster_zombie; +void () monster_tarbaby; +void () monster_army; +void () monster_ogre; +void () monster_wizard; +void () monster_knight; +void () monster_demon1; +void () monster_enforcer; +void () monster_shalrath; +void () monster_shambler; +void () monster_fish; + +void (vector jojo) spawn_ghoul; + +//assesses all current players +void() get_difficulty = +{ + local entity te; + local float cr; + + //challenge rating system + // + //0-24 level of difficulty + //0 = barely equipped players + //24 = using the best arms and equipment + + challenge_rating = 0; + + te = find (world, classname, "player"); + while (te) + { + + if (te.ammo_shells > 200)//money + challenge_rating += 1; + if (te.ammo_shells > 500)//money + challenge_rating += 1; + if (ToIID(te.islot1) >= IID_WP_AK112 || ToIID(te.islot2) >= IID_WP_AK112)//good weapon + challenge_rating += 1; + if (ToIID(te.islot3) >= IID_ARM_COMBAT)//good armor + challenge_rating += 1; + + te = te.chain; + } + + if (challenge_rating > 24) + challenge_rating = 24; +}; + +void() load_monster = +{ + local float x, y, z; + +/* + if (infokey(world, "total") == "one") + bprint(2, "test - one player\n"); + + if (infokey(world, "total") == "two") + bprint(2, "test - two players\n"); + + if (infokey(world, "total") == "three") + bprint(2, "test - three players\n"); + + if (infokey(world, "total") == "four") + bprint(2, "test - four players\n");*/ + + + if (infokey(world, "total") == "one" && random()<0.40) + return; + + if (infokey(world, "total") == "two" && random()<0.30) + return; + + if (infokey(world, "total") == "three" && random()<0.20) + return; + + if (infokey(world, "total") == "four" && random()<0.10) + return; + + if (self.waterlevel > 2) + { + monster_fish(); + return; + } + + x = random()*100; + y = random()*100; + + if (x <= world.map_ent1_percent) + { + self.zone = 1; + + monster_ogre(); +/* + if (world.map_ent1 == 1) + monster_dog(); + if (world.map_ent1 == 2) + monster_zombie(); + if (world.map_ent1 == 3) + monster_tarbaby(); + if (world.map_ent1 == 4 || world.map_ent1 == 5) + monster_army(); + if (world.map_ent1 == 6) + monster_ogre(); + if (world.map_ent1 == 7) + monster_wizard(); + if (world.map_ent1 == 8) + monster_knight(); + if (world.map_ent1 == 9) + monster_demon1(); + if (world.map_ent1 == 10) + monster_enforcer(); + if (world.map_ent1 == 11) + monster_shalrath(); + if (world.map_ent1 == 12) + monster_shambler();*/ + } + else if (y <= world.map_ent2_percent) + { + self.zone = 1; + + if (world.map_ent2 == 1) + monster_dog(); + if (world.map_ent2 == 2) + monster_zombie(); + if (world.map_ent2 == 3) + monster_tarbaby(); + if (world.map_ent2 == 4 || world.map_ent2 == 5) + monster_army(); + if (world.map_ent2 == 6) + monster_ogre(); + if (world.map_ent2 == 7) + monster_wizard(); + if (world.map_ent2 == 8) + monster_knight(); + if (world.map_ent2 == 9) + monster_demon1(); + if (world.map_ent2 == 10) + monster_enforcer(); + if (world.map_ent2 == 11) + monster_shalrath(); + if (world.map_ent2 == 12) + monster_shambler(); + } + else + { + self.zone = 1; + + if (random()<0.10) + monster_dog(); + else if (random()<0.10) + monster_zombie(); + else if (random()<0.10) + monster_army(); + else if (random()<0.10) + monster_ogre(); + else if (random()<0.10) + monster_wizard(); + else if (random()<0.10) + monster_knight(); + + if (world.map_obj == OBJ_DEADTOWN) + spawn_ghoul(self.origin + '128 0 0'); + if (world.map_obj == OBJ_DEADTOWN) + spawn_ghoul(self.origin + '0 128 0'); + + } +}; + +//the big one +//randomly generates map information +//objective, monsters, etc +//1=dog, 2=ghoul, 3=soldier, 4=mutant, 5=scrag, 6=knight, 7=deathclaw,8=shalrath + +void() map_startup = +{ + local float r, x, t, e1, e2, e3, d; + local string savemap; + + if (s_map_obj != 0) + return; + + r = random(); + + get_difficulty(); + d = challenge_rating; + + + localcmd("serverinfo total zero\n"); + + if (infokey(world, "objective") == "return") + world.map_obj = 0; + if (infokey(world, "objective") == "hostage") + world.map_obj = 1; + if (infokey(world, "objective") == "supplies") + world.map_obj = 2; + if (infokey(world, "objective") == "shadow") + world.map_obj = 3; + if (infokey(world, "objective") == "deadtown") + world.map_obj = 4; + if (infokey(world, "objective") == "destroy") + world.map_obj = 5; + if (infokey(world, "objective") == "defuse") + world.map_obj = 6; + + if (infokey(world, "objective") == "hostage") + time_left = 400; + if (infokey(world, "objective") == "supplies") + time_left = 500; + if (infokey(world, "objective") == "shadow") + time_left = 300; + if (infokey(world, "objective") == "deadtown") + time_left = 300; + if (infokey(world, "objective") == "destroy") + time_left = 500; + if (infokey(world, "objective") == "defuse") + time_left = 400; + +/* + if (world.map_obj == 0) + savemap = "return"; + if (world.map_obj == 1) + savemap = "hostage"; + if (world.map_obj == 2) + savemap = "supplies"; + if (world.map_obj == 3) + savemap = "shadow"; + if (world.map_obj == 4) + savemap = "deadtown"; + if (world.map_obj == 5) + savemap = "destroy"; + if (world.map_obj == 6) + savemap = "defuse"; + + + localcmd("serverinfo objective "); + localcmd(savemap); + localcmd("\n");*/ + + x = 100; + t = floor(30+random()*30); + x -= t; + + world.map_ent1_percent = t; + + t = floor(15+random()*15); + x -= t; + + world.map_ent2_percent = t; + world.map_ent3_percent = x; + +if (challenge_rating < 4) +{ + world.map_ent1 = 2 + ceil(random()*6); + world.map_ent2 = ceil(random()*8); + world.map_ent3 = ceil(random()*8); +} +else if (challenge_rating < 8) +{ + world.map_ent1 = 2 + ceil(random()*8); + world.map_ent2 = 4 + ceil(random()*6); + world.map_ent3 = 6 + ceil(random()*4); +} +else +{ + world.map_ent1 = 4 + ceil(random()*8); + world.map_ent2 = 6 + ceil(random()*6); + world.map_ent3 = 8 + ceil(random()*4); +} + + if (world.map_obj == OBJ_HOSTAGE) + world.map_ent2 = 5; + if (world.map_obj == OBJ_SUPPLY) + world.map_ent2 = 5; + if (world.map_obj == OBJ_SHADOW) + world.map_ent1 = 5; + if (world.map_obj == OBJ_DEADTOWN) + { + world.map_ent1 = 3; + world.map_ent2 = 3; + world.map_ent3 = 8; + } + if (world.map_obj == OBJ_DESTROY) + world.map_ent2 = 5; + if (world.map_obj == OBJ_DEFUSE) + { + world.map_ent1 = 7; + world.map_ent2 = 16; + world.map_ent3 = 7; + } + s_map_obj = world.map_obj; + s_ent1 = world.map_ent1; + s_ent2 = world.map_ent2; + s_ent3 = world.map_ent3; + s_p1 = world.map_ent1_percent; + s_p2 = world.map_ent2_percent; + s_p3 = world.map_ent3_percent; + +}; + void() InitBodyQue; @@ -7,7 +307,9 @@ void() hostage_think; void() hostage_die; void(entity stuff) spawn_zombie; void() GameControl; -void() VoteBoy; +void() RespawnPlayer; + + void () create_referees = { @@ -22,18 +324,6 @@ void () create_referees = newmis.nextthink = (time + WEAPON_SHOTGUN); newmis.think = GameControl; newmis.classname = "referee"; - newmis = spawn (); - newmis.owner = self; - newmis.movetype = MOVETYPE_NONE; - setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); - newmis.solid = SOLID_BBOX; - newmis.velocity = VEC_ORIGIN; - newmis.touch = SUB_Null; - setorigin (newmis, '0 0 -300'); - newmis.nextthink = (time + MULTICAST_PVS_R); - newmis.think = VoteBoy; - newmis.classname = "voteboy"; - newmis.vote_time = (time + MULTICAST_PVS_R); }; void() main = @@ -188,11 +478,908 @@ void() main = precache_file2 ("maps/dm6.bsp"); }; +entity() SelectSpawnPoint; + +void () RespawnPlayer = +{ + local entity spot; + + bprint(2, "test\n"); + spot = SelectSpawnPoint (); + self.origin = spot.origin + '0 0 1'; + self.angles = spot.angles; + + self.deadflag = DEAD_NO; + self.takedamage = DAMAGE_AIM; + self.movetype = MOVETYPE_WALK; + self.solid = SOLID_NOT; + self.materialize = 200; + self.ghost = 0; + self.air_finished = time + 10; + self.view_ofs = '0 0 22'; + self.health = self.max_health; + + player_run(); +}; + +void () ResetMap = +{ + local entity te; + + te = find(world, classname, "player"); + while (te) + { + te.nextthink = time + 1; + te.think = RespawnPlayer; + + te = find(te, classname, "player"); + } + +}; + void () GameControl = { - local float pcount, pdead; - local entity te; + local float pcount, pdead, hcount, hdead, bcount; + local entity te, ze; + + if (world.model == "maps/r_bunker.bsp") + return; + + if (world.model == "maps/r_wastes1.bsp") + return; + + if (random()<0.05) + sound (self, CHAN_AUTO, "ambience/gunfire1.wav", 0.75, ATTN_NONE); + else if (random()<0.05) + sound (self, CHAN_AUTO, "ambience/gunfire5.wav", 0.75, ATTN_NONE); + +if (coop == 1) // Players vs Monsters +{ + local float combat; + + combat = 0; + get_difficulty(); + + te = find(world, classname, "monster"); + while (te) + { + + if (te.enemy != world && te.enemy.classname == "player" && te.health > 0) + combat = 1; + + te = find(te, classname, "monster"); + } + + if (musicplay == 0) + { + musicplay = 1; + musictrack = 1; + + bprint(2, "the battle begins!\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + if (musictrack == 1) + stuffcmd(ze, "play music/battle\n"); + + ze = find (ze, classname, "player"); + } + + } + else if (musicplay < 100) + musicplay = musicplay + 1; + else if (musicplay >= 100) + musicplay = 0; + + te = find(world, classname, "player"); + while (te) + { + + if (te.health > 0 && te.class > 0) + pcount = pcount + 1; + if (te.health <= 0) + pdead = pdead + 1; + + te = find(te, classname, "player"); + } + +// if (pcount > 0) +// self.timer = self.timer + 0.5; + + if (pcount == 0 && self.timer > 5) + localcmd("restart\n"); + + if (world.map_obj == OBJ_HOSTAGE) + { + time_left = time_left - 1; + + te = find(world, classname, "rhostage"); + while (te) + { + + if (te.health > 0 && te.rescued == 0) + hcount = hcount + 1; + if (te.health <= 0) + hdead = hdead + 1; + + te = find(te, classname, "rhostage"); + } + + hostages = hcount; + dead_hostage = hdead; + + if (pcount == 0 && pdead > 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE PLAYERS WERE SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bTHIS AREA WILL RESTART^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); + } + else if (hdead >= 2) //hostages killed + { + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE HOSTAGES WERE KILLED!!!^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bYOU HAVE FAILED THE MISSION^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (hcount == 0 && hdead <= rescue) //hostages rescued + { + if (endgame_timer == 0) + { + bprint(2, "^4** ^bTHE HOSTAGES WERE SAVED!!!^b **\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + } + else if (time_left <= 0) //time ran out + { + if (endgame_timer == 0) + bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + if (hcount == 0 && hdead <= rescue) + endgame_timer = endgame_timer + 1; + } + if (world.map_obj == OBJ_DEFUSE) + { + time_left = time_left - 1; + + bcount = 0; + + te = find(world, classname, "bomb"); + while (te) + { + if (self.owner.picking != 2) + bcount = bcount + 1; + + te = find(te, classname, "bomb"); + } + + local string xx; + + if (random()*10 <= 1) + { + xx = ftos(bcount); + bprint(2, xx); + bprint(2, " bombs left!!\n"); + } + + if (pcount == 0 && pdead > 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE PLAYERS WERE SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bTHIS AREA WILL RESTART^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); + } + else if (bcount == 0) //bombs defused + { + if (endgame_timer == 0) + { + bprint(2, "^4** ^bTHE FUEL TANKS WERE DESTROYED!!!^b **\n"); + bprint(2, "^4** ^b RETURNING TO BASE!!!^b **\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } + + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + } + + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + else if (time_left == 0) //time ran out + { + if (endgame_timer == 0) + sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); + if (endgame_timer == 2) + sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); + if (endgame_timer == 3) + sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); + if (endgame_timer == 4) + sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); + + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE EXPLOSIVES WERE NOT DEFUSED^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^b!!! MISSION SITE DESTROYED !!!^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); + } + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + if (bcount == 0) + endgame_timer = endgame_timer + 1; + if (self.timer >= 300) + endgame_timer = endgame_timer + 1; + } + else if (world.map_obj == OBJ_SUPPLY) + { + time_left = time_left - 1; + + if (pcount == 0 && pdead > 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + } + else if (time_left <= 0) //time ran out + { + if (endgame_timer == 0) + bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + else if (supplies == 0) //supplies secured + { + if (endgame_timer == 0) + { + bprint(2, "^4** ^bTHE SUPPLIES WERE SECURED!!!^b **\n"); + bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + } + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + else if (supplies == 0) + endgame_timer = endgame_timer + 1; + } + else if (world.map_obj == OBJ_SHADOW) + { + time_left = time_left - 1; + + if (pcount == 0 && pdead > 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + } + else if (commanders == 0) //commanders assassinated + { + if (endgame_timer == 0) + { + bprint(2, "^4** ^bTHE COMMANDERS WERE NEUTRALIZED!!!^b **\n"); + bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + } + else if (time_left <= 0 && intermission_running == 0) //time ran out + { + if (endgame_timer == 0) + bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + else if (called_in >= 5) //soldier radioed in + { + if (endgame_timer == 0) + bprint(2, "^4** ^bYOUR SQUAD WAS DISCOVERED^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 5) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 6) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 7) + localcmd("restart\n"); + } + + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + else if (called_in >= 5) + endgame_timer = endgame_timer + 1; + } + else if (world.map_obj == OBJ_DEADTOWN) + { + time_left = time_left - 1; + + if (time_left <= 0 && intermission_running == 0) //time ran out + { + if (endgame_timer == 0) + bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + else if (pcount == 0 && pdead > 0 && called_in == 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + } + + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + else if (called_in == 1) + endgame_timer = endgame_timer + 1; + } + else if (world.map_obj == OBJ_DESTROY) + { + time_left = time_left - 1; + + if (pcount == 0 && pdead > 0 && called_in == 0) //everyone died + { + if (endgame_timer == 0) + bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + } + else if (supplies == 0) //fuel tanks destroyed + { + if (endgame_timer == 0) + { + bprint(2, "^4** ^bTHE FUEL TANKS WERE DESTROYED!!!^b **\n"); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + } + else if (time_left <= 0) //time ran out + { + if (endgame_timer == 0) + bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bMISSION FAILED^b **\n"); + if (endgame_timer == 2) + bprint(2, "^4** 3 **\n"); + if (endgame_timer == 3) + bprint(2, "^4** 2 **\n"); + if (endgame_timer == 4) + bprint(2, "^4** 1 **\n"); + if (endgame_timer == 5) + localcmd("restart\n"); + + endgame_timer = endgame_timer + 1; + } + else if (time_left == 480) //time ran out + bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); + else if (time_left == 450) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); + else if (time_left == 420) //time ran out + bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); + else if (time_left == 390) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); + else if (time_left == 360) //time ran out + bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); + else if (time_left == 330) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); + else if (time_left == 300) //time ran out + bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); + else if (time_left == 270) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); + else if (time_left == 240) //time ran out + bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); + else if (time_left == 210) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); + else if (time_left == 180) //time ran out + bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); + else if (time_left == 150) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); + else if (time_left == 120) //time ran out + bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); + else if (time_left == 90) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); + else if (time_left == 60) //time ran out + bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); + else if (time_left == 45) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); + else if (time_left == 30) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); + else if (time_left == 15) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); + else if (time_left == 10) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); + else if (time_left == 9) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); + else if (time_left == 8) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); + else if (time_left == 7) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); + else if (time_left == 6) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); + else if (time_left == 5) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); + else if (time_left == 4) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); + else if (time_left == 3) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); + else if (time_left == 2) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); + else if (time_left == 1) //time ran out + bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + + if (pcount == 0 && pdead > 0) + endgame_timer = endgame_timer + 1; + else if (supplies == 0) + endgame_timer = endgame_timer + 1; + } + self.think = GameControl; + self.nextthink = time + 1; + return; +} +if (coop == 0) // Players vs Players +{ + t1alive = 0; + t1dead = 0; + t2alive = 0; + t2dead = 0; + + pcount = 0; + pdead = 0; + + bprint(2, "gc test\n"); te = find(world, classname, "player"); while (te) @@ -206,29 +1393,88 @@ void () GameControl = te = find(te, classname, "player"); } - if (pcount == 0 && pdead > 0) //everyone died + if (pcount == 0 || (pcount == 1 && pdead == 0)) { - if (endgame_timer == 0) - bprint(2, "^4** ^bTHE PLAYERS WERE SLAIN^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bTHIS AREA WILL RESTART^b **\n"); - if (endgame_timer == 7) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 8) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 9) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 10) - localcmd("restart\n"); - - sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); + bprint(2, "^4** ^bTHE ROUND WILL NOT BEGIN UNTIL^b **\n"); + bprint(2, "^4** ^bBOTH TEAMS HAVE ENOUGH PLAYERS^b **\n"); + self.think = GameControl; + self.nextthink = time + 10; + return; } - if (pcount == 0 && pdead > 0) + te = find(world, classname, "player"); + while (te) + { + if (te.team == 1) + { + if (te.health > 0) + t1alive = t1alive + 1; + if (te.health <= 0) + t1dead = t1dead + 1; + } + if (te.team == 2) + { + if (te.health > 0) + t2alive = t2alive + 1; + if (te.health <= 0) + t2dead = t2dead + 1; + } + te = find(te, classname, "player"); + } + + if (t1alive > 0 && t2alive == 0) //team 1 has won + { + self.think = GameControl; + self.nextthink = time + 1; + + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE RANGERS HAVE WON!^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bTHIS MAP WILL RESTART^b **\n"); + if (endgame_timer == 5) + ResetMap(); + + winningteam = 1; + sound (world, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NONE); endgame_timer = endgame_timer + 1; + } + if (t2alive > 0 && t1alive == 0) //team 2 has won + { + self.think = GameControl; + self.nextthink = time + 1; + + if (endgame_timer == 0) + bprint(2, "^4** ^bTHE RAIDERS HAVE WON!^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bTHIS MAP WILL RESTART^b **\n"); + if (endgame_timer == 5) + ResetMap(); + + winningteam = 2; + sound (world, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NONE); + endgame_timer = endgame_timer + 1; + } + if (t2alive == 0 && t1alive == 0) //team 2 has won + { + self.think = GameControl; + self.nextthink = time + 1; + + if (endgame_timer == 0) + bprint(2, "^4** ^bBOTH SIDES ARE DEFEATED!^b **\n"); + if (endgame_timer == 1) + bprint(2, "^4** ^bTHIS MAP WILL RESTART^b **\n"); + if (endgame_timer == 5) + ResetMap(); + + winningteam = 0; + sound (world, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NONE); + endgame_timer = endgame_timer + 1; + } self.think = GameControl; self.nextthink = time + 1; + return; +} }; void () GameTimer = @@ -332,6 +1578,163 @@ void () create_timer = newmis.classname = "referee"; }; + +void () RecoilControl = +{ + local entity te, ze; + local float switched; + local float c, z; + + + self.think = RecoilControl; + self.nextthink = time + 0.01; + + te = find (world, classname, "player"); + + while (te) + { + + te.lastman = te.lastman - 0.01; + + if (te.lastman < 0) + te.lastman = 0; + + //superstims: heal at an incredible rate! + if ((te.xregen > 0 && te.health < te.max_health) && random()<0.5) + { + te.health = te.health + 1; + te.xregen = te.xregen - 1; + + if (te.health > te.max_health) + te.health = te.max_health; + } + + //superstims: decay if not healing + + if ((te.xregen > 0 && te.health >= te.max_health) && random()<0.05) + { + te.xregen = te.xregen - 1; + + if (te.health > te.max_health) + te.health = te.max_health; + } + + te.lastman = te.lastman - 0.01; + + //steady aim: for power shot, and aimed shots by standing still + if (te.recoil != 0) + te.steadyaim = 6; + else if (te.recoil == 0 && te.steadyaim > 0) + { + te.steadyaim = te.steadyaim - 0.05; + + if (te.perk1 == 13 || te.perk2 == 13) + te.steadyaim = te.steadyaim - 0.05; + } + + if (te.steadyaim > 0 && te.steadyaim <= 0.10) + te.steadyaim = 0; + + + if (te.pain_finished < time && te.missionbrief == 6) // remove pain + te.missionbrief = 0; + else if (te.flash < time && te.missionbrief == 5) // remove flash + te.missionbrief = 0; + else if (te.currentmenu == "menu_none" && te.missionbrief == 4) // remove shop + te.missionbrief = 0; + if (te.velocity == '0 0 0') + { + if (te.attack == 0) + { + if (te.driftx >= 1) + te.driftx = te.driftx - 1; + if (te.driftx <= -1) + te.driftx = te.driftx + 1; + + if (te.drifty >= 1) + te.drifty = te.drifty - 1; + if (te.drifty <= -1) + te.drifty = te.drifty + 1; + + } + + if (te.class == 1) + te.recoil = te.recoil - 0.20; + if (te.class == 2) + te.recoil = te.recoil - 0.20; + if (te.class == 3) + te.recoil = te.recoil - 0.25; + if (te.class == 4) + te.recoil = te.recoil - 0.15; + } + else + { + if (te.attack == 0) + { + if (te.driftx >= 0.5) + te.driftx = te.driftx - 0.5; + if (te.driftx <= -0.5) + te.driftx = te.driftx + 0.5; + + if (te.drifty >= 0.5) + te.drifty = te.drifty - 0.5; + if (te.drifty <= -0.5) + te.drifty = te.drifty + 0.5; + } + + if (te.recoil > 5) + te.recoil = te.recoil - 0.05; + + if (te.recoil <= 5) + { + te.recoil = te.recoil + 0.10; + + if (te.recoil >= 5) + te.recoil = 5; + } + } + + if (te.driftx > 250) + te.driftx = 250; + if (te.drifty > 250) + te.drifty = 250; + + //nintendo gamer: going into the zone gives a -5 recoil bonus + if (te.rage == 255) + te.recoil = te.recoil - 0.05; + + + //prone: going prone gives a -5 recoil bonus + + if (self.position == 2) + te.recoil = te.recoil - 0.05; + + if (te.recoil <= 0) + { + te.recoil = 0; + te.driftx = 0; + te.drifty = 0; + } + + te = find (te, classname, "player"); + } +}; + +void () recoil_control = +{ + newmis = spawn (); + newmis.owner = self; + newmis.movetype = MOVETYPE_NONE; + setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); + newmis.solid = SOLID_BBOX; + newmis.velocity = VEC_ORIGIN; + newmis.touch = SUB_Null; + setorigin (newmis, '0 0 -300'); + newmis.nextthink = (time + 1); + newmis.think = RecoilControl; + newmis.classname = "recoil"; +}; + entity lastspawn; //======================= @@ -348,21 +1751,34 @@ World Types: //======================= void() worldspawn = { + local entity te; + local string x; + lastspawn = world; InitBodyQue (); coop = !cvar("deathmatch"); + recoil_control(); create_referees(); SetupStats(); // custom map attributes - if (self.model == "maps/e1m8.bsp") - cvar_set ("sv_gravity", "100"); - else - cvar_set ("sv_gravity", "800"); + cvar_set ("skill", "3"); + world.location = ceil(random()*5); + total_players = 0; + te = find (world, classname, "player"); + while (te) + { + if (te.classname == "player") + total_players = total_players + 1; + + te = find(te, classname, "player"); + } + + map_startup(); // the area based ambient sounds MUST be the first precache_sounds // player precaches @@ -373,7 +1789,6 @@ void() worldspawn = precache_sound ("misc/h2ohit1.wav"); // landing splash // setup precaches allways needed - precache_sound ("items/itembk2.wav"); // item respawn sound precache_sound ("player/plyrjmp8.wav"); // player jump precache_sound ("player/land.wav"); // player landing precache_sound ("player/land2.wav"); // player hurt landing @@ -383,18 +1798,13 @@ void() worldspawn = precache_sound ("player/gasp2.wav"); // taking breath precache_sound ("player/h2odeath.wav"); // drowning death + precache_sound ("radio/9_secure.wav"); // drowning death precache_sound ("misc/talk.wav"); // talk precache_sound ("player/teledth1.wav"); // telefrag - precache_sound ("misc/r_tele1.wav"); // teleport sounds - precache_sound ("misc/r_tele2.wav"); - precache_sound ("misc/r_tele3.wav"); - precache_sound ("misc/r_tele4.wav"); - precache_sound ("misc/r_tele5.wav"); + + precache_sound ("items/inv1.wav"); precache_sound ("weapons/lock4.wav"); // ammo pick up precache_sound ("weapons/pkup.wav"); // weapon up - precache_sound ("items/armor1.wav"); // armor up - precache_sound ("weapons/lhit.wav"); //lightning - precache_sound ("weapons/lstart.wav"); //lightning start precache_sound ("items/damage3.wav"); precache_sound ("misc/power.wav"); //lightning for boss @@ -413,19 +1823,15 @@ void() worldspawn = precache_sound ("player/pain5.wav"); precache_sound ("player/pain6.wav"); -// player death sounds - precache_sound ("player/death1.wav"); - precache_sound ("player/death2.wav"); - precache_sound ("player/death3.wav"); - precache_sound ("player/death4.wav"); - precache_sound ("player/death5.wav"); - precache_sound ("boss1/sight1.wav"); // ax sounds + precache_sound ("weapons/knifehit.wav"); // ax swoosh precache_sound ("weapons/ax1.wav"); // ax swoosh precache_sound ("player/axhit1.wav"); // ax hit meat precache_sound ("player/axhit2.wav"); // ax hit world + precache_sound ("weapons/brawl-1.wav"); // ax hit world + precache_sound ("weapons/brawl-2.wav"); // ax hit world precache_sound ("player/h2ojump.wav"); // player jumping into water precache_sound ("player/slimbrn2.wav"); // player enter slime @@ -444,7 +1850,7 @@ void() worldspawn = precache_sound ("items/protect2.wav"); precache_sound ("items/protect3.wav"); - precache_model ("progs/player.mdl"); + precache_model ("progs/melee.mdl"); precache_model ("progs/guy.mdl"); precache_model ("progs/lay.mdl"); precache_model ("progs/eyes.mdl"); @@ -455,35 +1861,55 @@ void() worldspawn = precache_model ("progs/s_bubble.spr"); // drowning bubbles precache_model ("progs/s_explod.spr"); // sprite explosion + precache_model ("progs/ammobox.mdl"); + precache_model ("progs/ammobox2.mdl"); precache_model ("progs/v_axe.mdl"); - precache_model ("progs/v_shot.mdl"); precache_model ("progs/v_span.mdl"); precache_model ("progs/v_nail.mdl"); precache_model ("progs/v_rock.mdl"); - precache_model ("progs/v_shot2.mdl"); precache_model ("progs/v_nail2.mdl"); precache_model ("progs/v_rock2.mdl"); precache_model ("progs/v_fist.mdl"); precache_model ("progs/v_knife.mdl"); + precache_model ("progs/v_spear.mdl"); precache_model ("progs/v_1911.mdl"); - precache_model ("progs/v_ak47.mdl"); + precache_model ("progs/v_needler.mdl"); + precache_model ("progs/v_glock.mdl"); + precache_model ("progs/v_fnfal.mdl"); precache_model ("progs/v_smg.mdl"); precache_model ("progs/v_rangem.mdl"); precache_model ("progs/v_pipe.mdl"); - precache_model ("progs/v_shotgun.mdl"); precache_model ("progs/v_double.mdl"); - precache_model ("progs/v_mp9.mdl"); - precache_model ("progs/v_sa80.mdl"); + precache_model ("progs/v_combat.mdl"); + precache_model ("progs/v_ump.mdl"); + precache_model ("progs/v_g11.mdl"); + precache_model ("progs/v_ak47.mdl"); + precache_model ("progs/v_acr.mdl"); precache_model ("progs/v_deagle.mdl"); - precache_model ("progs/v_alien.mdl"); + precache_model ("progs/v_blaster.mdl"); precache_model ("progs/v_srifle.mdl"); precache_model ("progs/v_night.mdl"); - precache_model ("progs/v_piperifle.mdl"); precache_model ("progs/v_handgren.mdl"); precache_model ("progs/v_jackhammer.mdl"); precache_model ("progs/v_rocket.mdl"); + precache_model ("progs/v_pipe.mdl"); + precache_model ("progs/v_gauss.mdl"); + precache_model ("progs/v_carbine.mdl"); + precache_model ("progs/v_plasma.mdl"); + precache_model ("progs/v_scope1.mdl"); + precache_model ("progs/v_scope2.mdl"); + precache_model ("progs/v_chain.mdl"); + precache_model ("progs/g_spear.mdl"); + precache_model ("progs/g_knife.mdl"); + precache_model ("progs/g_axe.mdl"); + precache_model ("progs/g_wrench.mdl"); + precache_model ("progs/junk1.mdl"); + precache_model ("progs/junk2.mdl"); + precache_model ("progs/chest.mdl"); + precache_model ("progs/hosfem.mdl"); + precache_model ("progs/hosguy.mdl"); precache_model ("progs/handgren.mdl"); precache_model ("progs/plasma.mdl"); precache_model ("progs/ray.mdl"); @@ -491,23 +1917,26 @@ void() worldspawn = precache_model ("progs/dead.mdl"); precache_model ("progs/hbar.spr"); precache_model ("progs/blast.mdl"); - precache_model ("progs/station.mdl"); - precache_model ("progs/camera.mdl"); - precache_model ("progs/tehghoul.mdl"); precache_model ("progs/ray.mdl"); + precache_model ("progs/radio.spr"); + precache_model ("progs/w_spear.mdl"); + precache_model ("progs/w_span.mdl"); precache_model ("progs/w_knife.mdl"); precache_model ("progs/w_pipe.mdl"); - precache_model ("progs/w_shotgun.mdl"); + precache_model ("progs/w_double.mdl"); + precache_model ("progs/w_combat.mdl"); precache_model ("progs/w_axe.mdl"); + precache_model ("progs/w_glock.mdl"); precache_model ("progs/w_1911.mdl"); precache_model ("progs/w_deagle.mdl"); precache_model ("progs/w_alien.mdl"); - precache_model ("progs/w_mp7.mdl"); precache_model ("progs/w_mp9.mdl"); + precache_model ("progs/w_mp5.mdl"); precache_model ("progs/w_jackhammer.mdl"); precache_model ("progs/w_rangem.mdl"); - precache_model ("progs/w_sa80.mdl"); + precache_model ("progs/w_g11.mdl"); + precache_model ("progs/w_acr.mdl"); precache_model ("progs/w_ak47.mdl"); precache_model ("progs/w_night.mdl"); precache_model ("progs/w_srifle.mdl"); @@ -515,6 +1944,14 @@ void() worldspawn = precache_model ("progs/w_carbine.mdl"); precache_model ("progs/w_laser.mdl"); precache_model ("progs/w_rocket.mdl"); + precache_model ("progs/w_plasma.mdl"); + precache_model ("progs/w_chain.mdl"); + precache_model ("progs/money.mdl"); + + precache_model ("progs/turrgun.mdl"); + precache_model ("progs/turrbase.mdl"); + precache_model ("progs/miniturr.mdl"); + precache_model ("progs/minibase.mdl"); precache_model ("progs/grenade2.mdl"); precache_model ("maps/b_bh10.bsp"); @@ -522,7 +1959,60 @@ void() worldspawn = precache_model ("maps/b_bh100.bsp"); precache_model ("progs/s_light.spr"); + precache_sound ("misc/basekey.wav"); precache_sound ("misc/thud.wav"); + precache_sound ("misc/exp1.wav"); + precache_sound ("misc/exp2.wav"); + precache_sound ("misc/exp3.wav"); + precache_sound ("effects/openlock.wav"); + precache_sound ("effects/miss.wav"); + precache_sound ("effects/radio1.wav"); + precache_sound ("effects/radio2.wav"); + precache_sound ("effects/radio3.wav"); + precache_sound ("effects/radio4.wav"); + precache_sound ("effects/blip1.wav"); + precache_sound ("effects/blip2.wav"); + precache_sound ("effects/axe_hit1.wav"); + precache_sound ("effects/axe_hit2.wav"); + precache_sound ("effects/axe_swing.wav"); + precache_sound ("effects/metal-1.wav"); + precache_sound ("effects/metal-2.wav"); + precache_sound ("effects/spear_hit1.wav"); + precache_sound ("effects/spear_hit2.wav"); + + precache_sound ("misc/item1.wav"); + precache_sound ("misc/item2.wav"); + precache_sound ("items/r_item1.wav"); + precache_sound ("items/r_item2.wav"); + precache_sound ("items/locked.wav"); + precache_sound ("items/lockpick1.wav"); + precache_sound ("items/lockpick2.wav"); + + + precache_sound ("radio/1_yes.wav"); + precache_sound ("radio/2_no.wav"); + precache_sound ("radio/3_letsgo.wav"); + precache_sound ("radio/4_cover.wav"); + precache_sound ("radio/5_recon.wav"); + precache_sound ("radio/6_backup.wav"); + precache_sound ("radio/7_hold.wav"); + precache_sound ("radio/8_behind.wav"); + precache_sound ("radio/9_secure.wav"); + precache_sound ("radio/10_suppressing.wav"); + precache_sound ("radio/11_silence.wav"); + precache_sound ("radio/medic.wav"); + precache_sound ("radio/grenade.wav"); + + precache_sound ("ambience/gunfire1.wav"); + precache_sound ("ambience/gunfire5.wav"); + + precache_sound ("weapons/smoke.wav"); + precache_sound ("weapons/energy2.wav"); + + precache_sound ("misc/hosdie1.wav"); + precache_sound ("misc/hosdie2.wav"); + + precache_sound ("player/gib1.wav"); precache_sound ("player/step1.wav"); precache_sound ("player/step2.wav"); precache_sound ("player/step3.wav"); @@ -536,39 +2026,36 @@ void() worldspawn = precache_sound ("dog/dpain1.wav"); precache_sound ("dog/dsight.wav"); precache_sound ("dog/idle.wav"); - precache_sound ("weapons/1911.wav"); - precache_sound ("weapons/auto.wav"); + precache_sound ("ogre/ak74.wav"); + precache_sound ("ogre/ak47.wav"); + precache_sound ("weapons/usp.wav"); + precache_sound ("weapons/glock.wav"); precache_sound ("weapons/auto2.wav"); precache_sound ("weapons/ak112.wav"); - precache_sound ("weapons/ak47.wav"); precache_sound ("weapons/amr.wav"); - precache_sound ("weapons/blaster.wav"); - precache_sound ("weapons/blaster2.wav"); - precache_sound ("weapons/blowoff.wav"); - precache_sound ("weapons/bounce.wav"); + precache_sound ("weapons/blowoff-1.wav"); + precache_sound ("weapons/blowoff-2.wav"); + precache_sound ("misc/bounce_1.wav"); + precache_sound ("misc/bounce_2.wav"); + precache_sound ("misc/bounce_3.wav"); precache_sound ("weapons/burst.wav"); - precache_sound ("weapons/caws.wav"); precache_sound ("weapons/click.wav"); precache_sound ("weapons/deagle.wav"); precache_sound ("weapons/dks-1.wav"); - precache_sound ("weapons/energy1.wav"); - precache_sound ("weapons/energy2.wav"); - precache_sound ("weapons/energy3.wav"); - precache_sound ("weapons/energy4.wav"); - precache_sound ("weapons/flamer.wav"); precache_sound ("weapons/fnfal.wav"); precache_sound ("weapons/g11.wav"); precache_sound ("weapons/gauss.wav"); - precache_sound ("weapons/gl-1.wav"); precache_sound ("weapons/gpull.wav"); - precache_sound ("weapons/helmet.wav"); - precache_sound ("weapons/jackhammer.wav"); + precache_sound ("weapons/citykiller.wav"); precache_sound ("weapons/laser.wav"); - precache_sound ("weapons/m249.wav"); - precache_sound ("weapons/m4-nw.wav"); + precache_sound ("weapons/laserburst1.wav"); + precache_sound ("weapons/plasma-1.wav"); + precache_sound ("weapons/plasma-2.wav"); + precache_sound ("weapons/moonlight-1.wav"); + precache_sound ("weapons/moonlight-2.wav"); precache_sound ("weapons/needler.wav"); + precache_sound ("weapons/smg_s.wav"); precache_sound ("weapons/shotgun1.wav"); - precache_sound ("weapons/shotgun2.wav"); precache_sound ("weapons/mp5.wav"); precache_sound ("weapons/mp7.wav"); precache_sound ("weapons/rangem.wav"); @@ -578,9 +2065,10 @@ void() worldspawn = precache_sound ("weapons/ric4.wav"); precache_sound ("weapons/ric5.wav"); precache_sound ("weapons/tink1.wav"); - precache_sound ("weapons/sa80-1.wav"); precache_sound ("weapons/shell.wav"); precache_sound ("weapons/reload.wav"); + precache_sound ("weapons/silenced.wav"); + precache_sound ("misc/greload.wav"); precache_sound ("misc/build1.wav"); precache_sound ("misc/build2.wav"); precache_sound ("misc/build3.wav"); @@ -590,16 +2078,19 @@ void() worldspawn = precache_sound ("player/agdie4.wav"); precache_sound ("player/agdie5.wav"); precache_sound ("player/berserk.wav"); - precache_sound ("player/breathe.wav"); precache_sound ("player/headshot.wav"); precache_sound ("player/hit1.wav"); + precache_sound ("player/paina.wav"); precache_sound ("player/painb.wav"); + precache_sound ("player/yourturn.wav"); precache_model ("progs/bolt.mdl"); // for lightning gun precache_model ("progs/bolt2.mdl"); // for lightning gun precache_model ("progs/bolt3.mdl"); // for boss shock precache_model ("progs/lavaball.mdl"); // for testing - + + + precache_model ("progs/bomb.mdl"); precache_model ("progs/missile.mdl"); precache_model ("progs/grenade.mdl"); precache_model ("progs/spike.mdl"); @@ -610,8 +2101,8 @@ void() worldspawn = precache_model ("progs/zom_gib.mdl"); precache_model ("progs/v_light.mdl"); - + precache_model ("maps/crate.bsp"); // // Setup light animation tables. 'a' is total darkness, 'z' is maxbright. diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index 504917987..d485f4b8b 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -81,46 +81,46 @@ void() zombie_cruc4 = [ $cruc_4, zombie_cruc5 ] {self.nextthink = time + 0.1 + void() zombie_cruc5 = [ $cruc_5, zombie_cruc6 ] {self.nextthink = time + 0.1 + random()*0.1;}; void() zombie_cruc6 = [ $cruc_6, zombie_cruc1 ] {self.nextthink = time + 0.1 + random()*0.1;}; -void() zombie_walk1 =[ $walk1, zombie_walk2 ] {ai_walk(0);}; -void() zombie_walk2 =[ $walk2, zombie_walk3 ] {ai_walk(2);}; +void() zombie_walk1 =[ $walk1, zombie_walk2 ] {ai_walk(3);}; +void() zombie_walk2 =[ $walk2, zombie_walk3 ] {ai_walk(3);}; void() zombie_walk3 =[ $walk3, zombie_walk4 ] {ai_walk(3);}; -void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(2);}; -void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(1);}; -void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(0);}; -void() zombie_walk7 =[ $walk7, zombie_walk8 ] {ai_walk(0);}; -void() zombie_walk8 =[ $walk8, zombie_walk9 ] {ai_walk(0);}; -void() zombie_walk9 =[ $walk9, zombie_walk10 ] {ai_walk(0);}; -void() zombie_walk10 =[ $walk10, zombie_walk11 ] {ai_walk(0);}; -void() zombie_walk11 =[ $walk11, zombie_walk12 ] {ai_walk(2);}; -void() zombie_walk12 =[ $walk12, zombie_walk13 ] {ai_walk(2);}; -void() zombie_walk13 =[ $walk13, zombie_walk14 ] {ai_walk(1);}; -void() zombie_walk14 =[ $walk14, zombie_walk15 ] {ai_walk(0);}; -void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(0);}; -void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(0);}; -void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(0);}; -void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(0);}; +void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(3);}; +void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(3);}; +void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(3);}; +void() zombie_walk7 =[ $walk7, zombie_walk8 ] {ai_walk(3);}; +void() zombie_walk8 =[ $walk8, zombie_walk9 ] {ai_walk(3);}; +void() zombie_walk9 =[ $walk9, zombie_walk10 ] {ai_walk(3);}; +void() zombie_walk10 =[ $walk10, zombie_walk11 ] {ai_walk(3);}; +void() zombie_walk11 =[ $walk11, zombie_walk12 ] {ai_walk(3);}; +void() zombie_walk12 =[ $walk12, zombie_walk13 ] {ai_walk(3);}; +void() zombie_walk13 =[ $walk13, zombie_walk14 ] {ai_walk(3);}; +void() zombie_walk14 =[ $walk14, zombie_walk15 ] {ai_walk(3);}; +void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(3);}; +void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(3);}; +void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(3);}; +void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(3);}; void() zombie_walk19 =[ $walk19, zombie_walk1 ] { -ai_walk(0); +ai_walk(6); if (random() < 0.2) sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);}; -void() zombie_run1 =[ $run1, zombie_run2 ] {ai_run(1);self.inpain = 0;}; -void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(1);}; -void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(0);}; -void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(1);}; -void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(2);}; -void() zombie_run6 =[ $run6, zombie_run7 ] {ai_run(3);}; +void() zombie_run1 =[ $run1, zombie_run2 ] {ai_run(4);self.inpain = 0;}; +void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(4);}; +void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(4);}; +void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(4);}; +void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(4);}; +void() zombie_run6 =[ $run6, zombie_run7 ] {ai_run(4);}; void() zombie_run7 =[ $run7, zombie_run8 ] {ai_run(4);}; void() zombie_run8 =[ $run8, zombie_run9 ] {ai_run(4);}; -void() zombie_run9 =[ $run9, zombie_run10 ] {ai_run(2);}; -void() zombie_run10 =[ $run10, zombie_run11 ] {ai_run(0);}; -void() zombie_run11 =[ $run11, zombie_run12 ] {ai_run(0);}; -void() zombie_run12 =[ $run12, zombie_run13 ] {ai_run(0);}; -void() zombie_run13 =[ $run13, zombie_run14 ] {ai_run(2);}; +void() zombie_run9 =[ $run9, zombie_run10 ] {ai_run(4);}; +void() zombie_run10 =[ $run10, zombie_run11 ] {ai_run(4);}; +void() zombie_run11 =[ $run11, zombie_run12 ] {ai_run(4);}; +void() zombie_run12 =[ $run12, zombie_run13 ] {ai_run(4);}; +void() zombie_run13 =[ $run13, zombie_run14 ] {ai_run(4);}; void() zombie_run14 =[ $run14, zombie_run15 ] {ai_run(4);}; -void() zombie_run15 =[ $run15, zombie_run16 ] {ai_run(6);}; -void() zombie_run16 =[ $run16, zombie_run17 ] {ai_run(7);}; -void() zombie_run17 =[ $run17, zombie_run18 ] {ai_run(3);}; +void() zombie_run15 =[ $run15, zombie_run16 ] {ai_run(4);}; +void() zombie_run16 =[ $run16, zombie_run17 ] {ai_run(4);}; +void() zombie_run17 =[ $run17, zombie_run18 ] {ai_run(4);}; void() zombie_run18 =[ $run18, zombie_run1 ] { ai_run(8); if (random() < 0.2) @@ -141,17 +141,35 @@ void() ZombieGrenadeTouch = { if (other == self.owner) return; // don't explode on owner + if (other.netname == "ghoul") + return; // don't explode on owner + if (other.takedamage) { - T_Damage (other, self, self.owner, 10 ); - sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); - remove (self); + T_Damage (other, self, self.owner, 8+random()*8 ); + + self.velocity = self.velocity * 0.50; + self.touch = SUB_Null; + self.solid = SOLID_NOT; return; } - sound (self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound - self.velocity = '0 0 0'; - self.avelocity = '0 0 0'; - self.touch = SUB_Remove; + if (random() < 0.5) + sound (self, CHAN_WEAPON, "misc/rock1.wav", 0.5, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "misc/rock2.wav", 0.5, ATTN_NORM); + + self.velocity = self.velocity * 0.50; +}; + + +void() Molotov = +{ + if (random()<0.75) + return; // don't explode every time + + Explosion(); + T_RadiusDamage2 (self, self.owner, 25+random()*25, world, 300); + }; /* @@ -162,9 +180,16 @@ ZombieFireGrenade void(vector st) ZombieFireGrenade = { local entity missile; - local vector org; + local vector org, t; + local float fire; - sound (self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM); + + if (random()<0.15) + fire = 1; + else + fire = 0; + + sound (self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM); missile = spawn (); missile.owner = self; @@ -173,24 +198,47 @@ void(vector st) ZombieFireGrenade = // calc org org = self.origin + st_x * v_forward + st_y * v_right + (st_z - 24) * v_up; - + t = self.enemy.origin; // set missile speed makevectors (self.angles); - missile.velocity = normalize(self.enemy.origin - org); + + if (self.enemy.sneak > 0) + t = t + v_right*crandom()*128; + + missile.velocity = normalize(t - org); missile.velocity = missile.velocity * 600; missile.velocity_z = 200; + if ((self.enemy.origin_z - 32) > (self.origin_z)) + missile.velocity_z += 128; + else if ((self.enemy.origin_z - 64) > (self.origin_z)) + missile.velocity_z += 256; + missile.avelocity = '3000 1000 2000'; missile.touch = ZombieGrenadeTouch; -// set missile duration - missile.nextthink = time + 2.5; - missile.think = SUB_Remove; + if (random()*9 <= 8) + fire = 0; + else + fire = 1; - setmodel (missile, "progs/zom_gib.mdl"); + if (fire == 0) + { +// set missile duration + setmodel (missile, "progs/rock.mdl"); + missile.nextthink = time + 2.5; + missile.think = SUB_Remove; + } + else if (fire == 1) + { + setmodel (missile, "progs/homemade.mdl"); + missile.nextthink = time + 2.5; + missile.think = SUB_Remove; + missile.touch = Molotov; + } setsize (missile, '0 0 0', '0 0 0'); setorigin (missile, org); }; @@ -238,8 +286,82 @@ void() zombie_attc10 =[ $attc10, zombie_attc11 ] {ai_face();}; void() zombie_attc11 =[ $attc11, zombie_attc12 ] {ai_face();}; void() zombie_attc12 =[ $attc12, zombie_run1 ] {ai_face();ZombieFireGrenade('-12 -19 29');}; + +void() zombie_claw = +{ +local vector delta; +local float ldmg; + + if (!self.enemy) + return; + + self.goalentity = self.enemy; + + ai_charge(10); + + if (!CanDamage (self.enemy, self)) + return; + + delta = self.enemy.origin - self.origin; + + if (vlen(delta) > (80)) + return; + + ldmg = 5+random()*15; + + T_Damage (self.enemy, self, self, ldmg); +}; + +void() zombie_attm1 =[ $attb12, zombie_attm2 ] {ai_face();}; +void() zombie_attm2 =[ $attb12, zombie_attm3 ] {ai_face();}; +void() zombie_attm3 =[ $attb12, zombie_attm4 ] {ai_face();}; +void() zombie_attm4 =[ $attb12, zombie_attm5 ] {ai_face();}; +void() zombie_attm5 =[ $attb13, zombie_attm6 ] {ai_face();}; +void() zombie_attm6 =[ $attb13, zombie_attm7 ] {ai_face();}; +void() zombie_attm7 =[ $attb14, zombie_run1 ] {ai_face(); +zombie_claw(); +}; + +void() zombie_attn1 =[ $attc11, zombie_attn2 ] {ai_face();}; +void() zombie_attn2 =[ $attc11, zombie_attn3 ] {ai_face();}; +void() zombie_attn3 =[ $attc11, zombie_attn4 ] {ai_face();}; +void() zombie_attn4 =[ $attc12, zombie_attn5 ] {ai_face();}; +void() zombie_attn5 =[ $attc12, zombie_attn6 ] {ai_face();}; +void() zombie_attn6 =[ $attc12, zombie_attn7 ] {ai_face();}; +void() zombie_attn7 =[ $attc12, zombie_run1 ] {ai_face(); +zombie_claw(); +}; + + + + +void() zombie_melee = +{ + local float r; + + r = random(); + + if (r < 0.5) + { + sound (self, CHAN_WEAPON, "effects/axe_swing.wav", 1, ATTN_NORM); + zombie_attm1 (); + } + else + { + sound (self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM); + zombie_attn1 (); + } +}; + void() zombie_missile = { + local float x; + + x = vlen(self.origin - self.enemy.origin); + + if (x > 400) + return; + local float r; r = random(); @@ -338,7 +460,6 @@ void() zombie_paind13 =[ $paind13, zombie_run1 ] {}; void() zombie_paine1 =[ $paine1, zombie_paine2 ] { sound (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM); -self.health = 60; }; void() zombie_paine2 =[ $paine2, zombie_paine3 ] {ai_pain(8);}; void() zombie_paine3 =[ $paine3, zombie_paine4 ] {ai_pain(5);}; @@ -355,7 +476,6 @@ self.solid = SOLID_NOT; void() zombie_paine11 =[ $paine11, zombie_paine12 ] {self.nextthink = self.nextthink + 5;self.health = 60;}; void() zombie_paine12 =[ $paine12, zombie_paine13 ]{ // see if ok to stand up -self.health = 60; sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); self.solid = SOLID_SLIDEBOX; if (!walkmove (0, 0)) @@ -384,16 +504,112 @@ void() zombie_paine28 =[ $paine28, zombie_paine29 ] {ai_pain(1);}; void() zombie_paine29 =[ $paine29, zombie_paine30 ] {}; void() zombie_paine30 =[ $paine30, zombie_run1 ] {}; + +void() zdie1 =[ $painb1, zdie2 ] {}; +void() zdie2 =[ $painb2, zdie3 ] { +self.rtime = 1; +setsize (self, '-8 -8 -24', '8 8 -20'); +}; +void() zdie3 =[ $painb3, zdie4 ] {}; +void() zdie4 =[ $painb4, zdie5 ] {}; +void() zdie5 =[ $painb5, zdie6 ] {}; +void() zdie6 =[ $painb6, zdie7 ] {}; +void() zdie7 =[ $painb7, zdie8 ] {}; +void() zdie8 =[ $painb8, zdie9 ] {}; +void() zdie9 =[ $painb9, zdie10] {}; +void() zdie10 =[ $painb10, zdie10] {}; + + +void () zombie_death = +{ + if (self.rtime > 0) + { + if (random()*100<50) + sound (self, CHAN_VOICE, "player/headshot.wav", 0.75, ATTN_NORM); + else + sound (self, CHAN_VOICE, "misc/thud.wav", 1, ATTN_NORM); + + SpawnBlood (self.origin + '0 0 4', 4); + + self.think = SUB_Remove; + self.nextthink = time + 30; + self.health = 180; + return; + } + if (self.frame == 153) + { + self.frame = 152; + self.health = 180; + self.think = zdie1; + self.nextthink = time + 0.12; + } + else + { + ThrowGib ("progs/zom_gib.mdl", -40); + self.frame = 153; + self.health = 180; + self.think = zdie1; + self.nextthink = time + 0.12; + } + + self.attack = self.attack + 1; +}; + +void (vector stuff, vector ang) spawn_live_zombie = +{ + local entity zombie; + + zombie = spawn (); + zombie.origin = stuff; + zombie.enemy = world; + zombie.attack_finished = time + 10; + zombie.solid = SOLID_SLIDEBOX; + zombie.movetype = MOVETYPE_STEP; + zombie.takedamage = DAMAGE_YES; + setmodel (zombie, "progs/ghoul.mdl"); + setsize (zombie, '-8 -8 -24', '8 8 24'); + zombie.classname = "body"; + zombie.netname = "dead"; + zombie.health = 180; + zombie.angles = ang; + zombie.max_health = zombie.health; + zombie.th_pain = zombie_death; + zombie.think = zombie_death; + zombie.th_die = corpse_gib; + zombie.nextthink = time + 0.12; +}; + +void() DropBackpack; + void() zombie_die = { - sound (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM); - ThrowHead ("progs/h_zombie.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); + local float r; + + if (random()<0.25) + DropMoney(); + if (random()<0.25) + DropMoney(); + + r = random(); + + if (r <= 0.20) + sound (self, CHAN_VOICE, "player/agdie1.wav", 1, ATTN_NORM); + else if (r <= 0.40) + sound (self, CHAN_VOICE, "player/agdie2.wav", 1, ATTN_NORM); + else if (r <= 0.60) + sound (self, CHAN_VOICE, "player/agdie3.wav", 1, ATTN_NORM); + else if (r <= 0.80) + sound (self, CHAN_VOICE, "player/agdie4.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "player/agdie5.wav", 1, ATTN_NORM); + + spawn_live_zombie(self.origin, self.angles); + remove(self); + return; }; /* + ================= zombie_pain @@ -416,21 +632,11 @@ void(entity attacker, float take) zombie_pain = { local float r; - self.health = 60; // allways reset health - if (take < 9) return; // totally ignore if (self.inpain == 2) return; // down on ground, so don't reset any counters - -// go down immediately if a big enough hit - if (take >= 25) - { - self.inpain = 2; - zombie_paine1 (); - return; - } if (self.inpain) { @@ -439,26 +645,18 @@ void(entity attacker, float take) zombie_pain = return; // currently going through an animation, don't change } - if (self.pain_finished > time) - { -// hit again, so drop down - self.inpain = 2; - zombie_paine1 (); - return; - } // gp into one of the fast pain animations self.inpain = 1; r = random(); - if (r < 0.25) + if (r < 0.33) zombie_paina1 (); - else if (r < 0.5) - zombie_painb1 (); - else if (r < 0.75) + else if (r < 0.66) zombie_painc1 (); - else + else zombie_paind1 (); + }; //============================================================================ @@ -483,8 +681,8 @@ void (entity stuff) spawn_zombie = self.solid = SOLID_SLIDEBOX; self.movetype = MOVETYPE_STEP; setmodel (self, "progs/tehghoul.mdl"); - setsize (self, VEC_HULL_MIN, '16 16 40'); - self.health = 180; + setsize (self, '-8 -8 -24', '8 8 24'); + self.health = 60; self.classname = "ighoul"; self.netname = "ghoul"; self.max_health = self.health; @@ -498,11 +696,206 @@ void (entity stuff) spawn_zombie = walkmonster_start_go (); }; +void () spawn_ghoul_copy = +{ + local entity zombie, lair; + local entity te, ze; + local vector jojo; + local float zomc, pcount; + + ze = find (world, netname, "ghoul"); + + zomc = 0; + + while (ze) + { + + zomc = zomc + 1; + + ze = find (ze, netname, "ghoul"); + } + + ze = find(world, classname, "player"); + while (ze) + { + if (ze.health > 0) + pcount = pcount + 1; + + ze = find(ze, classname, "player"); + } + + if (zomc > 25*pcount) + return; + + zombie = spawn (); + self = zombie; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/ghoul.mdl"); + setsize (self, '-8 -8 -24', '8 8 24'); + self.health = 60; + self.netname = "ghoul"; + self.max_health = self.health; + self.th_stand = zombie_stand1; + self.th_walk = zombie_walk1; + self.th_run = zombie_run1; + self.th_pain = zombie_pain; + self.th_die = zombie_die; + if (random()<0.1) + self.th_missile = zombie_missile; + self.angles_y = random()*360; + + self.origin = self.origin + '0 64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + + if (!walkmove(0, 0)) + { + self.origin = self.origin + '0 -64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + self.origin = self.origin + '64 0 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + self.origin = self.origin + '-64 0 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + remove(self); + return; + } + } + } + } + + te = findradius (self.origin, 30); + while (te) + { + if (te.classname == "player" || te.classname == "monster" && te.health > 0) + { + remove(self); + return; + } + + te = te.chain; + } + + + self.classname = "monster"; + walkmonster_start_go (); +}; + +void (vector jojo) spawn_ghoul = +{ + local entity zombie, lair; + local entity te, ze; + local float stop; + + + ze = findradius(jojo, 256); + while (ze) + { + + if (ze.classname == "lair") + stop = 1; + + ze = ze.chain; + } + + if (stop == 0) + { + lair = spawn (); + self = lair; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_STEP; + setsize (self, '0 0 0', '0 0 0'); + self.netname = "lair"; + self.nextthink = time + 30; + self.think = spawn_ghoul_copy; + self.nextthink = time + 30; + } + + zombie = spawn (); + self = zombie; + self.solid = SOLID_SLIDEBOX; + self.movetype = MOVETYPE_STEP; + setmodel (self, "progs/ghoul.mdl"); + setsize (self, '-8 -8 -24', '8 8 24'); + self.health = 60; + self.netname = "ghoul"; + self.max_health = self.health; + self.th_stand = zombie_stand1; + self.th_walk = zombie_walk1; + self.th_run = zombie_run1; + self.th_pain = zombie_pain; + self.th_die = zombie_die; + if (random()<0.1) + self.th_missile = zombie_missile; + self.angles_y = random()*360; + + self.origin = jojo + '0 64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + + if (!walkmove(0, 0)) + { + self.origin = jojo + '0 -64 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + self.origin = jojo + '64 0 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + self.origin = jojo + '-64 0 0'; + self.origin_z = self.origin_z + 1; + droptofloor(); + if (!walkmove(0, 0)) + { + remove(self); + return; + } + } + } + } + + te = findradius (self.origin, 30); + while (te) + { + if (te.classname == "player" || te.classname == "monster" && te.health > 0) + { + remove(self); + return; + } + + + te = te.chain; + } + + self.classname = "monster"; + walkmonster_start_go (); +}; + void() monster_zombie = { - precache_model ("progs/zombie.mdl"); + if (self.zone == 0) + { + load_monster(); + return; + } + + precache_model ("progs/ghoul.mdl"); precache_model ("progs/h_zombie.mdl"); precache_model ("progs/zom_gib.mdl"); + precache_model ("progs/rock.mdl"); + precache_model ("progs/homemade.mdl"); precache_sound ("zombie/z_idle.wav"); precache_sound ("zombie/z_idle1.wav"); @@ -514,27 +907,45 @@ void() monster_zombie = precache_sound ("zombie/z_miss.wav"); precache_sound ("zombie/z_hit.wav"); precache_sound ("zombie/idle_w2.wav"); + precache_sound ("misc/rock1.wav"); + precache_sound ("misc/rock2.wav"); self.solid = SOLID_SLIDEBOX; self.movetype = MOVETYPE_STEP; - setmodel (self, "progs/zombie.mdl"); + setmodel (self, "progs/ghoul.mdl"); - setsize (self, '-16 -16 -24', '16 16 40'); + setsize (self, '-8 -8 -24', '8 8 24'); self.health = 60; - + self.classname = "monster"; + self.netname = "ghoul"; self.th_stand = zombie_stand1; self.th_walk = zombie_walk1; self.th_run = zombie_run1; - self.th_pain = zombie_pain; self.th_die = zombie_die; - self.th_missile = zombie_missile; + self.th_melee = zombie_melee; - if (self.spawnflags & SPAWN_CRUCIFIED) + if (world.map_obj == OBJ_DEADTOWN) { - self.movetype = MOVETYPE_NONE; - zombie_cruc1 (); + if (random()<0.5) + self.th_missile = zombie_missile; } else - walkmonster_start(); + self.th_missile = zombie_missile; + + self.angles_y = random()*360; + + walkmonster_start(); + + + + if (random()<0.25 || world.map_obj == OBJ_DEADTOWN) + spawn_ghoul(self.origin); + if (world.map_obj == OBJ_DEADTOWN && random()<0.25) + spawn_ghoul(self.origin + '128 128 0'); + if (world.map_obj == OBJ_DEADTOWN && random()<0.25) + spawn_ghoul(self.origin + '128 0 0'); + + if (random()<0.25 && world.map_obj == 1) + spawn_civilian(self.origin); }; From d50246e7ca2272d219c9d53e32adcc1846eb8950 Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 5 Nov 2009 04:20:47 +0000 Subject: [PATCH 03/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3411 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/cmds.qc | 2 + quakec/fallout2/csprogs.src | 2 +- quakec/fallout2/inventory.qc | 81 +---------------------------------- quakec/fallout2/world.qc | 82 ++++++++++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+), 80 deletions(-) diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 44070214c..21624ed8b 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -5,6 +5,8 @@ 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; diff --git a/quakec/fallout2/csprogs.src b/quakec/fallout2/csprogs.src index fce4ad945..aca467894 100644 --- a/quakec/fallout2/csprogs.src +++ b/quakec/fallout2/csprogs.src @@ -1,4 +1,4 @@ -../csprogs.dat +csprogs.dat csqc/system.qc csqc/stdbuiltins.qc diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index e1c6f6455..0f0937098 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -7,6 +7,7 @@ float IID_NONE = 0; //weapons with ammo, things with a toggle state #define NotStackable(iid) (IsRanged(iid)) + //the ammoless weapons float IID_WP_WRENCH = 399; float IID_WP_KNIFE = 400; @@ -189,75 +190,7 @@ float(float slotno, float iid) FitsInSlot; #define MAXSLOTS 24 -void(float sttype, float stnum, string fieldname) clientstat = #232; -void() SetupStats = -{ - //2 is ev_float - //32 is the first stat we are allowed to use - clientstat(2, 32, "islot1"); - clientstat(2, 33, "islot2"); - clientstat(2, 34, "islot3"); - clientstat(2, 35, "islot4"); - clientstat(2, 36, "islot5"); - clientstat(2, 37, "islot6"); - clientstat(2, 38, "islot7"); - clientstat(2, 39, "islot8"); - clientstat(2, 40, "islot9"); - clientstat(2, 41, "islot10"); - clientstat(2, 42, "islot11"); - clientstat(2, 43, "islot12"); - clientstat(2, 44, "islot13"); - clientstat(2, 45, "islot14"); - clientstat(2, 46, "islot15"); - clientstat(2, 47, "islot16"); - clientstat(2, 48, "health"); - clientstat(2, 49, "max_health"); - clientstat(2, 50, "ammo_shells"); - clientstat(2, 51, "ammo_cells"); - clientstat(2, 52, "weight"); - clientstat(2, 53, "max_weight"); - clientstat(2, 54, "position"); - clientstat(2, 55, "rage"); - clientstat(2, 56, "regen"); - clientstat(2, 57, "missionbrief"); - clientstat(2, 58, "sneak"); - clientstat(2, 59, "perk2"); - clientstat(2, 60, "perk1"); - clientstat(2, 61, "current_slot"); - clientstat(2, 62, "team"); - clientstat(2, 63, "class"); - clientstat(2, 64, "start_time"); - clientstat(2, 65, "location"); - clientstat(2, 66, "map_obj"); - clientstat(2, 67, "map_ent1"); - clientstat(2, 68, "map_ent2"); - clientstat(2, 69, "map_ent3"); - clientstat(2, 70, "silencer"); - clientstat(2, 71, "extender"); - clientstat(2, 91, "islot17"); - clientstat(2, 92, "islot18"); - clientstat(2, 93, "islot19"); - clientstat(2, 94, "islot20"); - clientstat(2, 95, "islot21"); - clientstat(2, 96, "islot22"); - clientstat(2, 97, "islot23"); - clientstat(2, 98, "islot24"); - clientstat(2, 99, "recoil"); - clientstat(2, 100, "xslot1"); - clientstat(2, 101, "xslot2"); - clientstat(2, 102, "xslot3"); - clientstat(2, 103, "xslot4"); - clientstat(2, 104, "xslot5"); - clientstat(2, 105, "xslot6"); - clientstat(2, 106, "xslot7"); - clientstat(2, 107, "xslot8"); - clientstat(2, 108, "safezone"); - clientstat(2, 109, "connected"); - clientstat(2, 110, "steadyaim"); - clientstat(2, 125, "timer"); - clientstat(2, 126, "popup"); - clientstat(2, 127, "score"); -}; + #define ToIID(it) floor(it/512) @@ -2517,13 +2450,3 @@ string(float int) GetPerkDesc = }; -float (float int) getperk = -{ - - if (self.perk1 == int) - return TRUE; - else if (self.perk2 == int) - return TRUE; - else - return FALSE; -}; \ No newline at end of file diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 76a205e33..0e63fea3c 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -13,6 +13,88 @@ void () monster_fish; void (vector jojo) spawn_ghoul; + + +float (float int) getperk = +{ + if (self.perk1 == int) + return TRUE; + else if (self.perk2 == int) + return TRUE; + else + return FALSE; +}; + +void(float stnum, float sttype, .float fieldname) clientstat = #232; +void() SetupStats = +{ + //2 is ev_float + //32 is the first stat we are allowed to use + clientstat(32, 2, islot1); + clientstat(33, 2, islot2); + clientstat(34, 2, islot3); + clientstat(35, 2, islot4); + clientstat(36, 2, islot5); + clientstat(37, 2, islot6); + clientstat(38, 2, islot7); + clientstat(39, 2, islot8); + clientstat(40, 2, islot9); + clientstat(41, 2, islot10); + clientstat(42, 2, islot11); + clientstat(43, 2, islot12); + clientstat(44, 2, islot13); + clientstat(45, 2, islot14); + clientstat(46, 2, islot15); + clientstat(47, 2, islot16); + clientstat(48, 2, health); + clientstat(49, 2, max_health); + clientstat(50, 2, ammo_shells); + clientstat(51, 2, ammo_cells); + clientstat(52, 2, weight); + clientstat(53, 2, max_weight); + clientstat(54, 2, position); + clientstat(55, 2, rage); + clientstat(56, 2, regen); + clientstat(57, 2, missionbrief); + clientstat(58, 2, sneak); + clientstat(59, 2, perk2); + clientstat(60, 2, perk1); + clientstat(61, 2, current_slot); + clientstat(62, 2, team); + clientstat(63, 2, class); + clientstat(64, 2, start_time); + clientstat(65, 2, location); + clientstat(66, 2, map_obj); + clientstat(67, 2, map_ent1); + clientstat(68, 2, map_ent2); + clientstat(69, 2, map_ent3); + clientstat(70, 2, silencer); + clientstat(71, 2, extender); + clientstat(91, 2, islot17); + clientstat(92, 2, islot18); + clientstat(93, 2, islot19); + clientstat(94, 2, islot20); + clientstat(95, 2, islot21); + clientstat(96, 2, islot22); + clientstat(97, 2, islot23); + clientstat(98, 2, islot24); + clientstat(99, 2, recoil); + clientstat(100, 2, xslot1); + clientstat(101, 2, xslot2); + clientstat(102, 2, xslot3); + clientstat(103, 2, xslot4); + clientstat(104, 2, xslot5); + clientstat(105, 2, xslot6); + clientstat(106, 2, xslot7); + clientstat(107, 2, xslot8); + clientstat(108, 2, safezone); + clientstat(109, 2, connected); + clientstat(110, 2, steadyaim); + clientstat(125, 2, timer); + clientstat(126, 2, popup); + clientstat(127, 2, score); +}; + //assesses all current players void() get_difficulty = { From 4063e40d2e3dccfbb0af67b3aa58e6910da8fe65 Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 5 Nov 2009 05:12:06 +0000 Subject: [PATCH 04/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3412 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/invent.qc | 639 +++++++++++++++++++++++++++++++-- 1 file changed, 613 insertions(+), 26 deletions(-) diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 43c5a9cc4..7a747ea85 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -1,8 +1,6 @@ void bprint(float plev, string st, string s2){} float PRINT_MEDIUM = 1; - -#include "../inventory.qc" - +#include "inventory.qc" float show_inventory; @@ -26,9 +24,120 @@ float mouseisdown; #define IMGSIZEF 64 #define IMGSIZEV ('1 1 0'*IMGSIZEF) +#define IMGSIZEK 32 +#define IMGSIZEH ('1 1 0'*IMGSIZEK) +#define IMGSIZEX 48 +#define IMGSIZEZ ('1 1 0'*IMGSIZEX) +#define IMGSIZEQ ('1 1 0'*2) + #define CURSORSIZE 8 void(vector pos, float slotno) SlotImage = +{ + local float it, mod_s, mod_e; + local string itname; + + + if (slotno == downslotnum && slotnum) + slotno = slotnum; + else if (slotno == slotnum && downslotnum) + slotno = downslotnum; + + if (slotno <= 16) + it = getstati(31+slotno); + else + { + if (slotno == 17) + it = getstati(91); + if (slotno == 18) + it = getstati(92); + if (slotno == 19) + it = getstati(93); + if (slotno == 20) + it = getstati(94); + if (slotno == 21) + it = getstati(95); + if (slotno == 22) + it = getstati(96); + if (slotno == 23) + it = getstati(97); + if (slotno == 24) + it = getstati(98); + + } + + itname = GetItemImage(ToIID(it)); + drawpic(pos, strcat("gui/", itname), IMGSIZEV, '1 1 1', 1); + + mod_s = getstati(70); + mod_e = getstati(71); + + it = ToStatus(it); + if (it < 1) + return; + itname = ftos(it); + it = strlen(itname); + drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); +}; + +void(vector pos, float slotno) SlotImageSmall = +{ + local float it, mod_s, mod_e; + local string itname; + + + if (slotno == downslotnum && slotnum) + slotno = slotnum; + else if (slotno == slotnum && downslotnum) + slotno = downslotnum; + + if (slotno <= 16) + it = getstati(31+slotno); + else + { + if (slotno == 17) + it = getstati(91); + if (slotno == 18) + it = getstati(92); + if (slotno == 19) + it = getstati(93); + if (slotno == 20) + it = getstati(94); + if (slotno == 21) + it = getstati(95); + if (slotno == 22) + it = getstati(96); + if (slotno == 23) + it = getstati(97); + if (slotno == 24) + it = getstati(98); + } + + itname = GetItemImage(ToIID(it)); + drawpic(pos, strcat("gui/", itname), IMGSIZEZ, '1 1 1', 1); + + mod_s = getstati(70); + mod_e = getstati(71); + + + if (it > 0) + { + if (mod_s == it) + drawstring(pos, "sil", '8 8 8', '1 1 1', 1); + + if (mod_e == it) + drawstring(pos, "ext", '8 8 8', '1 1 1', 1); + } + + it = ToStatus(it); + if (it <= 1) + return; + itname = ftos(it); + it = strlen(itname); + drawstring(pos + IMGSIZEZ - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); +}; + +void(vector pos, float slotno) QuickImage = { local float it; local string itname; @@ -41,32 +150,228 @@ void(vector pos, float slotno) SlotImage = it = getstati(31+slotno); itname = GetItemImage(ToIID(it)); - drawpic(pos, strcat("gui/", itname), IMGSIZEV, '1 1 1', 1); + drawpic(pos, strcat("gui/", itname), IMGSIZEH, '1 1 1', 1); it = ToStatus(it); if (it <= 1) return; itname = ftos(it); it = strlen(itname); - drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); + drawstring(pos + IMGSIZEH - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); +}; + +void() ScreenImage = +{ + float width,height; + vector w; + + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + w = '1 1 0'*width; + + if (getstati(57) == 0) + drawpic('0 0 0', "gui/screen.jpg", w, '1 1 1', 1); + else if (getstati(57) == 2) + drawpic('0 0 0', "gui/moveout.jpg", w, '1 1 1', 1); + else if (getstati(57) == 3) + drawpic('0 0 0', "gui/complete.jpg", w, '1 1 1', 1); + else if (getstati(57) == 4) + drawpic('0 0 0', "gui/none.jpg", w, '1 1 1', 1); + else if (getstati(57) == 5) + drawpic('0 0 0', "gui/xflash.jpg", w, '1 1 1', 1); + else if (getstati(57) == 6) + drawpic('0 0 0', "gui/xcarnage.jpg", w, '1 1 1', 1); + +}; + +string(float x) GetMonsterName = +{ + if (x == 1 || x == 2) + return "wild dogs"; + else if (x == 3 || x == 4) + return "ghouls"; + else if (x == 5 || x == 6 || x == 7) + return "raiders"; + else if (x == 8 || x == 9) + return "mutants"; + else if (x == 10 || x == 11) + return "scrags"; + else if (x == 12 || x == 13) + return "enclave"; + else if (x == 14 || x == 15) + return "deathclaws"; + else + return "multiple unknowns"; +}; + +void() BriefImage = +{ + float width,height, t, o, e1, e2, e3, loca; + vector w; + string m, x, m4, loc; + + t = getstati(64); + loca = getstati(65); + o = getstati(66); + e1 = getstati(67); + e2 = getstati(68); + e3 = getstati(69); + + width = cvar("vid_conwidth"); + width = width * 0.5; + height = cvar("vid_conheight"); + w = '1 1 0'*width; + + if (loca == 1) + m4 = "gui/brief/map1.jpg"; + else if (loca == 2) + m4 = "gui/brief/map2.jpg"; + else if (loca == 3) + m4 = "gui/brief/map3.jpg"; + else if (loca == 4) + m4 = "gui/brief/map4.jpg"; + else + m4 = "gui/brief/map5.jpg"; + + if (loca == 1) + loc = "Eastgate"; + else if (loca == 2) + loc = "Moonbrook"; + else if (loca == 3) + loc = "Malan"; + else if (loca == 4) + loc = "Military Base"; + else + loc = "D Zone"; + + if (o == 0) + drawpic('0 0 0', "gui/brief/brief1.jpg", w, '1 1 1', 1); + if (o == 1) + drawpic('0 0 0', "gui/brief/brief1.jpg", w, '1 1 1', 1); + if (o == 2) + drawpic('0 0 0', "gui/brief/brief2.jpg", w, '1 1 1', 1); + if (o == 3) + drawpic('0 0 0', "gui/brief/brief3.jpg", w, '1 1 1', 1); + if (o == 4) + drawpic('0 0 0', "gui/brief/brief4.jpg", w, '1 1 1', 1); + if (o == 5) + drawpic('0 0 0', "gui/brief/brief5.jpg", w, '1 1 1', 1); + if (o == 6) + drawpic('0 0 0', "gui/brief/brief6.jpg", w, '1 1 1', 1); + if (o == 7) + drawpic('0 0 0', "gui/brief/brief7.jpg", w, '1 1 1', 1); + if (o == 8) + drawpic('0 0 0', "gui/brief/brief8.jpg", w, '1 1 1', 1); + + drawpic('0 0 0'+('1 0 0'*(width)), "gui/brief/icon.jpg", w, '1 1 1', 1); + drawpic('0 0 0'+('0 1 0'*(width)), "gui/brief/intel.jpg", w, '1 1 1', 1); + drawpic('0 0 0'+('1 1 0'*(width)), m4, w, '1 1 1', 1); + + drawstring('0 0 0'+('1 0 0'*(width*0.40))+('0 1 0'*(height*0.69)), loc, '8 8 8', '1 1 1', 1); + m = GetMonsterName(e1); + drawstring('0 20 0'+('1 0 0'*(width*0.10))+('0 1 0'*(height*0.85)), m, '8 8 8', '1 1 1', 1); + m = GetMonsterName(e2); + drawstring('0 35 0'+('1 0 0'*(width*0.10))+('0 1 0'*(height*0.85)), m, '8 8 8', '1 1 1', 1); + m = GetMonsterName(e3); + drawstring('0 50 0'+('1 0 0'*(width*0.10))+('0 1 0'*(height*0.85)), m, '8 8 8', '1 1 1', 1); + +}; + +void(vector pos, float slotno) BlankImage = +{ + drawpic(pos, strcat("gui/", "none.jpg"), IMGSIZEV, '1 1 1', 1); +}; + +void(vector pos, float hpcolor, string image) HealthImage = +{ + float height, width, o, tyme, min, sec; + local string itname, ts, tm, t; + + if (hpcolor == 0) + drawpic(pos, strcat("gui/hnum/", image), IMGSIZEH, '1 1 1', 1); + else if (hpcolor == 1) + drawpic(pos, strcat("gui/ynum/", image), IMGSIZEH, '1 1 1', 1); + else + drawpic(pos, strcat("gui/rnum/", image), IMGSIZEH, '1 1 1', 1); + + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + o = getstati(66); + if (o == 1) + drawstring('0 16 0'+('1 0 0'*(width*0.10))+('0 1 0'*(height*0.90)), "mission: civilian rescue", '8 8 8', '1 1 1', 1); + if (o == 2) + drawstring('0 16 0'+('1 0 0'*(width*0.10))+('0 1 0'*(height*0.90)), "mission: secure supply line", '8 8 8', '1 1 1', 1); + if (o == 3) + drawstring('0 16 0'+('1 0 0'*(width*0.10))+('0 1 0'*(height*0.90)), "mission: shadow op", '8 8 8', '1 1 1', 1); + if (o == 4) + drawstring('0 16 0'+('1 0 0'*(width*0.10))+('0 1 0'*(height*0.90)), "mission: deadtown", '8 8 8', '1 1 1', 1); + if (o == 5) + drawstring('0 16 0'+('1 0 0'*(width*0.10))+('0 1 0'*(height*0.90)), "mission: destroy fuel tanks", '8 8 8', '1 1 1', 1); + if (o == 6) + drawstring('0 16 0'+('1 0 0'*(width*0.10))+('0 1 0'*(height*0.90)), "mission: defuse explosives", '8 8 8', '1 1 1', 1); +}; + +void(vector pos, float img) PosImage = +{ + if (img == 1) + drawpic(pos, strcat("gui/", "sneak.jpg"), IMGSIZEH, '1 1 1', 1); + if (img == 2) + drawpic(pos, strcat("gui/", "prone.jpg"), IMGSIZEH, '1 1 1', 1); + +}; + +void(vector pos, float img) ChemImage = +{ + if (img == 0) + drawpic(pos, strcat("gui/chem/", "zone.jpg"), IMGSIZEH, '1 1 1', 1); + if (img == 1) + drawpic(pos, strcat("gui/chem/", "rage1.jpg"), IMGSIZEH, '1 1 1', 1); + if (img == 2) + drawpic(pos, strcat("gui/chem/", "rage2.jpg"), IMGSIZEH, '1 1 1', 1); + if (img == 3) + drawpic(pos, strcat("gui/chem/", "rage3.jpg"), IMGSIZEH, '1 1 1', 1); + if (img == 4) + drawpic(pos, strcat("gui/chem/", "heal.jpg"), IMGSIZEH, '1 1 1', 1); + if (img == 5) + drawpic(pos, strcat("gui/chem/", "paranoia.jpg"), IMGSIZEH, '1 1 1', 1); + +}; + +void(vector pos, string image) MoneyImage = +{ + local string itname; + + + drawpic(pos, strcat("gui/", image), IMGSIZEH, '1 1 1', 1); +}; + + +void(vector pos, string image) Crosshair = +{ + local string itname; + + + drawpic(pos, image, IMGSIZEQ, '1 1 1', 1); }; void() Invent_Draw = { local float i; local float it; - local string itname; + local string itname, s1, s2, s3, s4, s5, s6, s7, s8, s9, perki, perk2i, p1, p2, pn, pd; local float op; - local float height; + local float height,width; height = cvar("vid_conheight"); + width = cvar("vid_conwidth"); //how much space have we got for the slider? local float slotofs; - slotofs = sliderpos*(height - (IMGSIZEF*3)) + (IMGSIZEF*3); + slotofs = sliderpos*(height - (IMGSIZEF*6)) + (IMGSIZEF*6); - for (i = 3; i < MAXSLOTS; i++) + for (i = 6; i <= MAXSLOTS; i++) { SlotImage(((i*IMGSIZEF-slotofs) * '0 1 0'), i+1); @@ -74,14 +379,46 @@ void() Invent_Draw = // drawstring(toppos + ((i*8-slotofs) * '0 1 0'), strcat(itname, " (", ftos(ToStatus(it)), ")"), '8 8 0', '1 1 1', 1); } - drawstring('112 248 0', " HAND 1 ", '8 8 8', '1 1 1', 1); + drawstring('112 248 0', " HAND1 ", '8 8 8', '1 1 1', 1); SlotImage('112 256 0', 1); - drawstring('112 248 0'+('1 0 0'*IMGSIZEF), " HAND 2 ", '8 8 8', '1 1 1', 1); + drawstring('112 248 0'+('1 0 0'*IMGSIZEF), " HAND2 ", '8 8 8', '1 1 1', 1); SlotImage('112 256 0'+('1 0 0'*IMGSIZEF), 2); - drawstring('112 248 0'+('2 0 0'*IMGSIZEF), " ARMOUR ", '8 8 8', '1 1 1', 1); + drawstring('112 248 0'+('2 0 0'*IMGSIZEF), " ARMOUR ", '8 8 8', '1 1 1', 1); SlotImage('112 256 0'+('2 0 0'*IMGSIZEF), 3); + drawstring('112 120 0', " EQUIP ", '8 8 8', '1 1 1', 1); + SlotImage('112 128 0', 4); + drawstring('112 120 0'+('1 0 0'*IMGSIZEF), " POUCH1 ", '8 8 8', '1 1 1', 1); + SlotImage('112 128 0'+('1 0 0'*IMGSIZEF), 5); + drawstring('112 120 0'+('2 0 0'*IMGSIZEF), " POUCH2 ", '8 8 8', '1 1 1', 1); + SlotImage('112 128 0'+('2 0 0'*IMGSIZEF), 6); + + drawstring('120 72 0'+('4 0 0'*IMGSIZEF), " JUNK ", '8 8 8', '1 1 1', 1); + SlotImageSmall('112 80 0'+('4 0 0'*IMGSIZEF), 17); + SlotImageSmall('112 128 0'+('4 0 0'*IMGSIZEF), 18); + SlotImageSmall('112 176 0'+('4 0 0'*IMGSIZEF), 19); + SlotImageSmall('112 224 0'+('4 0 0'*IMGSIZEF), 20); + SlotImageSmall('96 80 0'+('5 0 0'*IMGSIZEF), 21); + SlotImageSmall('96 128 0'+('5 0 0'*IMGSIZEF), 22); + SlotImageSmall('96 176 0'+('5 0 0'*IMGSIZEF), 23); + SlotImageSmall('96 224 0'+('5 0 0'*IMGSIZEF), 24); + + + perki = GetPerkImage(getstati(60)); + perk2i = GetPerkImage(getstati(59)); + + drawstring('112 328 0'+('3 0 0'*IMGSIZEF), " PERK1 ", '8 8 8', '1 1 1', 1); + drawpic('112 336 0'+('3 0 0'*IMGSIZEF), perki, IMGSIZEV, '1 1 1', 1); + drawstring('112 328 0'+('5 0 0'*IMGSIZEF), " PERK2 ", '8 8 8', '1 1 1', 1); + drawpic('112 336 0'+('5 0 0'*IMGSIZEF), perk2i, IMGSIZEV, '1 1 1', 1); + + p1 = PerkName(1, getstati(60)); + p2 = PerkName(2, getstati(59)); + + drawstring('112 408 0'+('3 0 0'*IMGSIZEF), p1, '8 8 8', '1 1 1', 1); + drawstring('112 408 0'+('5 0 0'*IMGSIZEF), p2, '8 8 8', '1 1 1', 1); + i = getstati(62); if (i == 1) itname = "team: rangers"; @@ -92,16 +429,80 @@ void() Invent_Draw = drawstring('112 264 0'+('0 1 0'*IMGSIZEF), itname, '8 8 8', '1 1 1', 1); i = getstati(63); if (i == 1) - itname = "class: medic"; + { + itname = "skill set: first aid"; + s1 = "small arms: 65%"; + s2 = "big guns: 35%"; + s3 = "melee: 45%"; + s4 = "sneak: 40%"; + s5 = "first aid: 90%"; + s6 = "doctor: 75%"; + s7 = "science: 25%"; + s8 = "repair: 35%"; + s9 = "thrown: 50%"; + } else if (i == 2) - itname = "class: assassin"; + { + itname = "skill set: stealth"; + s1 = "small arms: 75%"; + s2 = "big guns: 25%"; + s3 = "melee: 80%"; + s4 = "sneak: 95%"; + s5 = "first aid: 55%"; + s6 = "doctor: 15%"; + s7 = "science: 55%"; + s8 = "repair: 25%"; + s9 = "thrown: 75%"; + } else if (i == 3) - itname = "class: soldier"; + { + itname = "skill set: combat"; + s1 = "small arms: 90%"; + s2 = "big guns: 75%"; + s3 = "melee: 80%"; + s4 = "sneak: 55%"; + s5 = "first aid: 55%"; + s6 = "doctor: 15%"; + s7 = "science: 15%"; + s8 = "repair: 15%"; + s9 = "thrown: 75%"; + } else if (i == 4) - itname = "class: scientist"; + { + itname = "skill set: science"; + s1 = "small arms: 25%"; + s2 = "big guns: 10%"; + s3 = "melee: 15%"; + s4 = "sneak: 35%"; + s5 = "first aid: 65%"; + s6 = "doctor: 25%"; + s7 = "science: 95%"; + s8 = "repair: 90%"; + s9 = "thrown: 25%"; + } else + { itname = "class: none"; + s1 = "small arms: 10%"; + s2 = "big guns: 5%"; + s3 = "melee: 5%"; + s4 = "sneak: 10%"; + s5 = "first aid: 10%"; + s6 = "doctor: 5%"; + s7 = "science: 15%"; + s8 = "repair: 5%"; + } + drawstring('112 272 0'+('0 1 0'*IMGSIZEF), itname, '8 8 8', '1 1 1', 1); + drawstring('112 280 0'+('0 1 0'*IMGSIZEF), s1, '8 8 8', '1 1 1', 1); + drawstring('112 288 0'+('0 1 0'*IMGSIZEF), s2, '8 8 8', '1 1 1', 1); + drawstring('112 296 0'+('0 1 0'*IMGSIZEF), s3, '8 8 8', '1 1 1', 1); + drawstring('112 304 0'+('0 1 0'*IMGSIZEF), s4, '8 8 8', '1 1 1', 1); + drawstring('112 312 0'+('0 1 0'*IMGSIZEF), s5, '8 8 8', '1 1 1', 1); + drawstring('112 320 0'+('0 1 0'*IMGSIZEF), s6, '8 8 8', '1 1 1', 1); + drawstring('112 328 0'+('0 1 0'*IMGSIZEF), s7, '8 8 8', '1 1 1', 1); + drawstring('112 336 0'+('0 1 0'*IMGSIZEF), s8, '8 8 8', '1 1 1', 1); + drawstring('112 344 0'+('0 1 0'*IMGSIZEF), s9, '8 8 8', '1 1 1', 1); @@ -115,11 +516,29 @@ void() Invent_Draw = if (showcontextmenu) { + drawfill(contextpos - '8 8 0', '88 24 0'+'96 96 0', '0 0 0', 0.9); + op = floor((mousepos_y - contextpos_y)/8); - drawfill(contextpos - '8 8 0', '88 24 0'+'16 16 0', '0 0 0', 0.7); - drawstring(contextpos + (0 * '0 8 0'), "Use/Reload", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1); - drawstring(contextpos + (1 * '0 8 0'), "Put In Hand", '8 8 0', '1 1 0' + (op!=1)*'0 0 1', 1); - drawstring(contextpos + (2 * '0 8 0'), "Drop", '8 8 0', '1 1 0' + (op!=2)*'0 0 1', 1); + drawstring(contextpos + (0 * '0 8 0'), "use/reload", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1); + drawstring(contextpos + (1 * '0 8 0'), "put in hand", '8 8 0', '1 1 0' + (op!=1)*'0 0 1', 1); + if (getstati(108) == 0) + drawstring(contextpos + (2 * '0 8 0'), "drop", '8 8 0', '1 1 0' + (op!=2)*'0 0 1', 1); + if (getstati(108) == 1) + drawstring(contextpos + (2 * '0 8 0'), "sell", '8 8 0', '1 1 0' + (op!=2)*'0 0 1', 1); + if (getstati(60) == 14 || getstati(59) == 14) + drawstring(contextpos + (3 * '0 8 0'), "mix chems", '8 8 0', '1 1 0' + (op!=3)*'0 0 1', 1); + + drawstring(contextpos + (4 * '0 8 0'), "build: flash bomb", '8 8 0', '1 1 0' + (op!=4)*'0 0 1', 1); + drawstring(contextpos + (5 * '0 8 0'), "build: frag grenade", '8 8 0', '1 1 0' + (op!=5)*'0 0 1', 1); + drawstring(contextpos + (6 * '0 8 0'), "build: stun grenade", '8 8 0', '1 1 0' + (op!=6)*'0 0 1', 1); + drawstring(contextpos + (7 * '0 8 0'), "build: silencer", '8 8 0', '1 1 0' + (op!=7)*'0 0 1', 1); + + if (getstati(63) == 4) + { + drawstring(contextpos + (8 * '0 8 0'), "build: scope", '8 8 0', '1 1 0' + (op!=8)*'0 0 1', 1); + drawstring(contextpos + (9 * '0 8 0'), "build: x-ray device", '8 8 0', '1 1 0' + (op!=9)*'0 0 1', 1); + drawstring(contextpos + (10 * '0 8 0'), "build: modification", '8 8 0', '1 1 0' + (op!=10)*'0 0 1', 1); + } } else { @@ -129,6 +548,27 @@ void() Invent_Draw = if (mousepos_x >= 112 && mousepos_x <= 112+3*IMGSIZEF) if (mousepos_y >= 256 && mousepos_y <= 256+IMGSIZEF) slotnum = floor((mousepos_x - 112)/IMGSIZEF) + 1; + + if (mousepos_x >= 112 && mousepos_x <= 112+3*IMGSIZEF) + if (mousepos_y >= 128 && mousepos_y <= 128+IMGSIZEF) + slotnum = floor((mousepos_x - 112)/IMGSIZEF) + 4; + + if (mousepos_x >= 112+3*IMGSIZEF && mousepos_x <= 112+4*IMGSIZEF) + if (mousepos_y >= 336 && mousepos_y <= 336+IMGSIZEF) + slotnum = 98; + + if (mousepos_x >= 112+5*IMGSIZEF && mousepos_x <= 112+6*IMGSIZEF) + if (mousepos_y >= 336 && mousepos_y <= 336+IMGSIZEF) + slotnum = 99; + + + if (mousepos_x >= 112+4*IMGSIZEF && mousepos_x <= 112+5*IMGSIZEF) + if (mousepos_y >= 80 && mousepos_y <= 80+4*IMGSIZEX) + slotnum = floor((mousepos_y - 80)/IMGSIZEX) + 17; + + if (mousepos_x >= 112+5*IMGSIZEF && mousepos_x <= 112+6*IMGSIZEF) + if (mousepos_y >= 80 && mousepos_y <= 80+4*IMGSIZEX) + slotnum = floor((mousepos_y - 80)/IMGSIZEX) + 21; } else { @@ -139,13 +579,52 @@ void() Invent_Draw = drawstring('128 0 0', ftos(slotnum), '8 8 0', '1 1 1', 1); - it = getstati(31+slotnum); + drawfill('120 24 0', '512 40 0', '0 0 0', 0.7); + +if (slotnum <= 24) +{ + + if (slotnum <= 16) + it = getstati(31+slotnum); + else + { + if (slotnum == 17) + it = getstati(91); + if (slotnum == 18) + it = getstati(92); + if (slotnum == 19) + it = getstati(93); + if (slotnum == 20) + it = getstati(94); + if (slotnum == 21) + it = getstati(95); + if (slotnum == 22) + it = getstati(96); + if (slotnum == 23) + it = getstati(97); + if (slotnum == 24) + it = getstati(98); + } + itname = GetItemName(ToIID(it)); drawstring('128 32 0', itname, '8 8 0', '1 1 1', 1); itname = GetItemDesc(ToIID(it)); drawstring('128 48 0', itname, '8 8 0', '1 1 1', 1); - - +} +else if (slotnum == 98) +{ + pn = PerkName(1, getstati(60)); + pd = GetPerkDesc(getstati(60)); + drawstring('128 32 0', pn, '8 8 0', '1 1 1', 1); + drawstring('128 48 0', pd, '8 8 0', '1 1 1', 1); +} +else if (slotnum == 99) +{ + pn = PerkName(2, getstati(59)); + pd = GetPerkDesc(getstati(59)); + drawstring('128 32 0', pn, '8 8 0', '1 1 1', 1); + drawstring('128 48 0', pd, '8 8 0', '1 1 1', 1); +} // drawfill(mousepos, '8 8 0', '0 0 0', 0.7); // drawstring(mousepos, "^", '8 8 0', '1 1 1', 1); drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); @@ -209,9 +688,26 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = localcmd(strcat("cmd invuse ", ftos(slotnum), "\n")); else if (op == 1) localcmd(strcat("cmd invswap 1 ", ftos(slotnum), "\nimpulse 1\n")); - else if (op == 2) + else if ((op == 2) && (getstati(108) == 0)) localcmd(strcat("cmd invdrop ", ftos(slotnum), "\n")); - + else if ((op == 2) && (getstati(108) == 1)) + localcmd(strcat("cmd invsell ", ftos(slotnum), "\n")); + else if (op == 3) + localcmd(strcat("cmd invmix ", ftos(slotnum), "\n")); + else if (op == 4) + localcmd("cmd create flash\n"); + else if (op == 5) + localcmd("cmd create grenade\n"); + else if (op == 6) + localcmd("cmd create stun\n"); + else if (op == 7) + localcmd("cmd create silencer\n"); + else if (op == 8) + localcmd("cmd create extender\n"); + else if (op == 9) + localcmd("cmd create xray\n"); + else if (op == 10) + localcmd("cmd create modify\n"); showcontextmenu = false; } @@ -224,7 +720,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = else if (downslotnum == slotnum) //mouse didn't move away { - if (slotnum >= 1 && slotnum <= MAXSLOTS) + if (slotnum >= 1 && slotnum <= 24) { if (getstati(32+slotnum-1) != 0) //if there's actually an item there { @@ -276,3 +772,94 @@ void() FigureOutButtons = k_mwheelup = stringtokeynum("K_MWHEELUP"); k_mwheeldown = stringtokeynum("K_MWHEELDOWN"); }; + + +void(vector pos, float slotno) ShopImage = +{ + local float it, mod_s, mod_e; + local string itname; + + + if (slotno == downslotnum && slotnum) + slotno = slotnum; + else if (slotno == slotnum && downslotnum) + slotno = downslotnum; + + + it = getstati(99+slotno); + itname = GetItemImage(ToIID(it)); + drawpic(pos, "gui/blank.jpg", IMGSIZEV, '1 1 1', 1); + + it = ToStatus(it); + if (it <= 1) + return; + itname = ftos(it); + it = strlen(itname); + drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); +}; + +void() Invent_Draw2 = +{ + local float i; + local float it; + local string itname; + local float op; + + local float width, height; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + //how much space have we got for the slider? + + + local float slotofs; + slotofs = sliderpos*IMGSIZEF*8 + IMGSIZEF*3; + + for (i = 1; i < 8; i++) + { + ShopImage(((i*(width-64)-slotofs) * '0 1 0'), i+1); + } + + + + + drawpic(('1 0 0'*(width-64)), "gui/scrollup.jpg", '16 16 0', '1 1 1', 1); + for (i = 0; i < height; i+=16) + drawpic('1 0 0'*(width-64)+'0 16 0'+i*'0 1 0', "gui/scrollbar.jpg", '16 16 0', '1 1 1', 1); + drawpic(('1 0 0'*(width-64))+(height-16)*'0 1 0', "gui/scrolldown.jpg", '16 16 0', '1 1 1', 1); + + drawpic(('1 0 0'*(width-64))+'0 16 0'+sliderpos*(height-48)*'0 1 0', "gui/scrollbox.jpg", '16 16 0', '1 1 1', 1); + + + if (showcontextmenu) + { + op = floor((mousepos_y - contextpos_y)/8); + drawfill(contextpos - '8 8 0', '88 24 0'+'16 16 0', '0 0 0', 0.7); + drawstring(contextpos + (0 * '0 8 0'), "Purchase", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1); + drawstring(contextpos + (1 * '0 8 0'), "Barter", '8 8 0', '1 1 0' + (op!=1)*'0 0 1', 1); + } + else + { + if (mousepos_x >= IMGSIZEF) + { + slotnum = 0; + if (mousepos_x >= 112 && mousepos_x <= 112+3*IMGSIZEF) + if (mousepos_y >= 256 && mousepos_y <= 256+IMGSIZEF) + slotnum = floor((mousepos_x - 112)/IMGSIZEF) + 1; + } + else + { + slotnum = floor((mousepos_y + slotofs)/IMGSIZEF) + 1; + } +// slotnum = floor((mousepos_y - toppos_y)/8) + 1; + } + + drawstring('128 0 0', ftos(slotnum), '8 8 0', '1 1 1', 1); + + it = getstati(99+slotnum); + itname = GetItemName(ToIID(it)); + drawstring('128 32 0', itname, '8 8 0', '1 1 1', 1); + itname = GetItemDesc(ToIID(it)); + drawstring('128 48 0', itname, '8 8 0', '1 1 1', 1); + + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); +}; \ No newline at end of file From 0598a6d3c275f4700487d517cad395c937644f3a Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 5 Nov 2009 05:12:48 +0000 Subject: [PATCH 05/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3413 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/main.qc | 384 ++++++++++++++++++++++++++++++++++- 1 file changed, 382 insertions(+), 2 deletions(-) diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index 51fa9a601..99aa501c7 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -3,6 +3,361 @@ float viewmodelindex; .float lerptime; + +void() Quick_Draw = +{ + float width,height; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + drawstring('32 -80 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " q1 ", '8 8 8', '1 1 1', 1); + QuickImage('32 -72 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 5); + + drawstring('64 -80 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " q2 ", '8 8 8', '1 1 1', 1); + QuickImage('64 -72 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 6); +}; + +void() DrawScreen = +{ + float width,height; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + ScreenImage(); +}; + +void() Weapon_Draw = +{ + float width,height; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + local float hand; + + hand = getstati(61); + + if (hand == 1) + { + drawstring('0 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " HAND 1 ", '8 8 8', '1 1 1', 1); + SlotImage('0 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 1); + } + if (hand == 2) + { + drawstring('0 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " HAND 2 ", '8 8 8', '1 1 1', 1); + SlotImage('0 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 2); + } +}; + +void() Crosshair_Draw = +{ + float width,height; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + local float x, a; + local vector y; + + + if (getstati(54) == 0) + a = 16; + else if (getstati(54) == 1) + a = 12; + else if (getstati(54) == 2) + a = 8; + + y = '1 0 0'*width*0.50 + '0 1 0'*height*0.50; + + x = a + (4 * getstati(99)); + Crosshair(y + '1 0 0'*x, "gui/xhair.jpg"); + Crosshair(y + '-1 0 0'*x, "gui/xhair.jpg"); + Crosshair(y + '0 1 0'*x, "gui/xhair.jpg"); + Crosshair(y + '0 -1 0'*x, "gui/xhair.jpg"); + + x = (a+2) + (4 * getstati(99)); + Crosshair(y + '1 0 0'*x, "gui/xhair.jpg"); + Crosshair(y + '-1 0 0'*x, "gui/xhair.jpg"); + Crosshair(y + '0 1 0'*x, "gui/xhair.jpg"); + Crosshair(y + '0 -1 0'*x, "gui/xhair.jpg"); + + x = (a-2) + (4 * getstati(99)); + Crosshair(y + '1 0 0'*x, "gui/xhair.jpg"); + Crosshair(y + '-1 0 0'*x, "gui/xhair.jpg"); + Crosshair(y + '0 1 0'*x, "gui/xhair.jpg"); + Crosshair(y + '0 -1 0'*x, "gui/xhair.jpg"); + +}; + +void() Position_Draw = +{ + float width,height; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + float pos, s; + string sn; + + pos = getstati(54); + s = getstati(58); + sn = ftos(s); + + if (s > 0) + { + drawstring('0 -32 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), "sneak", '8 8 8', '1 1 1', 1); + PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), 1); + drawstring('0 8 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), strcat("%", sn), '8 8 8', '1 1 1', 1); + } + else if (pos == 1) + { + drawstring('0 -32 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), "duck", '8 8 8', '1 1 1', 1); + PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), 1); + } + else if (pos == 2) + { + drawstring('0 -32 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), "prone", '8 8 8', '1 1 1', 1); + PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), 2); + } +}; + +void() Chem_Draw = +{ + float width,height; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + local float rage, heal; + + rage = getstati(55); + heal = getstati(56); + + if (rage == 255) + ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 0); + else if (rage == IID_CHEM_ADRENALINE) + ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 1); + else if (rage == IID_CHEM_PSYCHO) + ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 2); + else if (rage == IID_CHEM_BESERK) + ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 3); + else if (heal > 0) + ChemImage('32 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 4); + else if (rage == 777) + ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 5); + +}; + +void() Ammo_Draw = +{ + local float hand, weap, ammo, amount; + local string reveal; + float width,height; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + hand = getstati(61); + + if (hand == 1) + { + weap = ToIID(getstati(32)); + ammo = WeaponAmmoType(weap); + amount = ShadowSlotOfItem(self, ammo); + //drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1); + //SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount); + drawstring('-64 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " AMMO ", '8 8 8', '1 1 1', 1); + if (amount > 0) + SlotImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), amount); + else + BlankImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 0); + } + else if (hand == 2) + { + weap = ToIID(getstati(33)); + ammo = WeaponAmmoType(weap); + amount = ShadowSlotOfItem(self, ammo); + reveal = ftos(amount); + //drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1); + //SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount); + drawstring('-64 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " AMMO ", '8 8 8', '1 1 1', 1); + if (amount > 0) + SlotImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), amount); + else + BlankImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 0); + } +}; + +void() Money_Draw = +{ + float width,height; + string cash; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + cash = ftos(getstati(50)); + + drawstring('64 -32 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), cash, '8 8 8', '1 1 1', 1); + MoneyImage('64 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), "money.jpg"); + +}; + +void() Energy_Draw = +{ + float width,height; + string cash; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + cash = ftos(getstati(51)); + + drawstring('34 -32 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), cash, '8 8 8', '1 1 1', 1); + MoneyImage('32 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), "energy.jpg"); + +}; + +void() Weight_Draw = +{ + float width,height,carry,max,enc; + string image; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + carry = getstati(52); + max = getstati(53); + + enc = carry/max; + + if (enc <= 0.10) + image = "weight/weight_zero.jpg"; + else if (enc <= 0.20) + image = "weight/weight_one.jpg"; + else if (enc <= 0.35) + image = "weight/weight_two.jpg"; + else if (enc <= 0.50) + image = "weight/weight_three.jpg"; + else if (enc <= 0.65) + image = "weight/weight_four.jpg"; + else if (enc <= 0.80) + image = "weight/weight_five.jpg"; + else if (enc <= 0.95) + image = "weight/weight_six.jpg"; + else + image = "weight/weight_seven.jpg"; + + MoneyImage('0 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), image); + +}; + +void() Armor_Draw = +{ + float width,height; + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + + //drawstring('300 350 0'+('3 0 0'*IMGSIZEF), " ARMOR ", '8 8 8', '1 1 1', 1); + //SlotImage('300 358 0'+('3 0 0'*IMGSIZEF), 3); + drawstring('64 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " ARMOR ", '8 8 8', '1 1 1', 1); + SlotImage('64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 3); + +}; + +void() Health_Draw = +{ + float width,height; + height = cvar("vid_conheight"); + float hp, maxhp, status, perc, hpos, tpos, opos, ostatus, ones; + string string_hpos, string_tpos, string_opos; + + hp = getstati(48); + maxhp = getstati(49); + + status = (floor(hp) * 100) / maxhp; + perc = status; + + if (hp >= maxhp) + string_hpos = "one.jpg"; + else + string_hpos = "zero.jpg"; + + ostatus = status; + status = status * 0.10; + status = floor(status); + + if (status == 0) + string_tpos = "zero.jpg"; + if (status == 1) + string_tpos = "one.jpg"; + if (status == 2) + string_tpos = "two.jpg"; + if (status == 3) + string_tpos = "three.jpg"; + if (status == 4) + string_tpos = "four.jpg"; + if (status == 5) + string_tpos = "five.jpg"; + if (status == 6) + string_tpos = "six.jpg"; + if (status == 7) + string_tpos = "seven.jpg"; + if (status == 8) + string_tpos = "eight.jpg"; + if (status == 9) + string_tpos = "nine.jpg"; + if (status == 10) + string_tpos = "zero.jpg"; + + ones = (ostatus - (status*10)); + ones = floor(ones); + + if (ones == 0) + string_opos = "zero.jpg"; + if (ones == 1) + string_opos = "one.jpg"; + if (ones == 2) + string_opos = "two.jpg"; + if (ones == 3) + string_opos = "three.jpg"; + if (ones == 4) + string_opos = "four.jpg"; + if (ones == 5) + string_opos = "five.jpg"; + if (ones == 6) + string_opos = "six.jpg"; + if (ones == 7) + string_opos = "seven.jpg"; + if (ones == 8) + string_opos = "eight.jpg"; + if (ones == 9) + string_opos = "nine.jpg"; + if (status == 10) + string_opos = "zero.jpg"; + + if (hp <= 0) + { + string_hpos = "zero.jpg"; + string_tpos = "zero.jpg"; + string_opos = "zero.jpg"; + } + + if (perc > 50) + { + HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 0, "percent.jpg"); + HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 0, string_hpos); + HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 0, string_tpos); + HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 0, string_opos); + } + else if (perc > 25) + { + HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 1, "percent.jpg"); + HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 1, string_hpos); + HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 1, string_tpos); + HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 1, string_opos); + } + else + { + HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 2, "percent.jpg"); + HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 2, string_hpos); + HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 2, string_tpos); + HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 2, string_opos); + } +}; + void() DoThatViewModelThing = { float newframe, newmodel; @@ -37,7 +392,6 @@ void() CSQC_Init = viewentity.drawmask = MASK_NORMAL; viewentity.renderflags = RF_VIEWMODEL | RF_DEPTHHACK; - FigureOutButtons(); }; @@ -76,6 +430,32 @@ void(float do2d) CSQC_UpdateView = // if (usehud) // Hud_Draw(); - if (show_inventory) + if (getstati(57) == 1) + BriefImage(); + else if (getstati(57) == 2) + DrawScreen(); + else if (getstati(57) == 3) + DrawScreen(); + else if (getstati(57) == 4)//pain + DrawScreen(); + else if (getstati(57) == 5)//flash + DrawScreen(); + else if (getstati(109) == 0) + DrawScreen(); + else if (show_inventory) Invent_Draw(); + else + { + Health_Draw(); + Weight_Draw(); + Money_Draw(); + Ammo_Draw(); + Energy_Draw(); + Weapon_Draw(); + Armor_Draw(); + Position_Draw(); + Quick_Draw(); + Chem_Draw(); + Crosshair_Draw(); + } }; \ No newline at end of file From 43fff592e8422f33b56ca16de849239cc0b9072b Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 5 Nov 2009 05:15:57 +0000 Subject: [PATCH 06/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3414 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/system.qc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/quakec/fallout2/csqc/system.qc b/quakec/fallout2/csqc/system.qc index 7519dd044..6036df5ff 100644 --- a/quakec/fallout2/csqc/system.qc +++ b/quakec/fallout2/csqc/system.qc @@ -28,6 +28,7 @@ float servercommandframe; //clientframe echoed off the server string mapname; //current brief map name float intermission; //non-zero if the server sent an svc_intermission. + // // global variables set by built in functions // @@ -102,10 +103,22 @@ void end_sys_globals; // flag for structure dumping .float renderflags; .string model; .float frame; +.float health; +.float ammo_shells; +.float ammo_cells; +.float weight; +.float max_weight; +.float max_health; +.float rage; +.float regen; +.float position; +.float missionbrief; +.float sneak; +.float perk2; +.float perk1; .float frame2; .float lerpfrac; //the ammount of frame2 to use. .float skin; - .vector mins, maxs; // bounding box extents reletive to origin .vector size; // maxs - mins @@ -129,3 +142,16 @@ void end_sys_globals; // flag for structure dumping //================================================ void end_sys_fields; // flag for structure dumping //================================================ + +.float map_ent1; +.float map_ent2; +.float map_ent3; +.float map_obj; +.float location; +.float start_time; +.float recoil; + +.float silencer; +.float extender; +.float timer; + From 51c2b140ceeb8f9baa6c8094d1dc0facc498231d Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 5 Nov 2009 05:16:43 +0000 Subject: [PATCH 07/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3415 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/inventory.qc | 116 +++++++++++++++-------------------- 1 file changed, 51 insertions(+), 65 deletions(-) diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 0f0937098..8e60cb560 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -7,7 +7,6 @@ float IID_NONE = 0; //weapons with ammo, things with a toggle state #define NotStackable(iid) (IsRanged(iid)) - //the ammoless weapons float IID_WP_WRENCH = 399; float IID_WP_KNIFE = 400; @@ -118,6 +117,7 @@ float IID_BUILD_GTURRET = 357; float IID_EQUIP_MEDIC_BAG = 375; float IID_EQUIP_GOGGLES = 376; +float IID_EQUIP_SILENCER = 377; float IID_EQUIP_BELTPOUCH = 378; float IID_EQUIP_BACKPACK = 379; float IID_EQUIP_TOOLKIT = 380; @@ -129,7 +129,6 @@ float IID_EQUIP_HOVERBOOTS = 385; float IID_EQUIP_XRAY = 386; float IID_EQUIP_EXTENDER = 387; - float IID_MISC_JUNK = 310; float IID_MISC_NUKACOLA = 311; float IID_MISC_CHEMICALS = 312; @@ -144,8 +143,6 @@ float IID_MISC_HMXCOMPOUND = 320; float IID_MISC_GUM = 321; float IID_MISC_XRAYTUBE = 322; -float IID_EQUIP_SILENCER = 323; - #define IsShootable(iid) (IsMelee(iid) || IsRanged(iid) || IsGrenade(iid)) @@ -192,7 +189,6 @@ float(float slotno, float iid) FitsInSlot; - #define ToIID(it) floor(it/512) #define ToStatus(it) (it&511) #define SlotVal(iid,st) ((iid*512) | (st&511)) @@ -642,7 +638,7 @@ string(float iid) GetItemVModel = if (iid == IID_WP_ALIENBLASTER) return "progs/v_blaster.mdl"; if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) - return "progs/v_pipe.mdl"; + return "progs/v_pipe.mdl"; if (iid == IID_WP_WINCHESTER) return "progs/v_double.mdl"; if (iid == IID_WP_MOSSBERG) @@ -739,7 +735,7 @@ string(float iid) GetItemWModel = if (iid == IID_WP_ALIENBLASTER) return "progs/w_alien.mdl"; if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) - return "progs/w_rangem.mdl"; + return "progs/w_pipe.mdl"; if (iid == IID_WP_WINCHESTER) return "progs/w_double.mdl"; if (iid == IID_WP_MOSSBERG) @@ -810,7 +806,7 @@ string(float iid) GetItemWModel = if (iid == IID_CHEM_SUPERSTIM) return "maps/b_bh100.bsp"; - if (iid >= IID_AM_NEEDLER && iid <= IID_AM_WARSAW) + if (iid >= IID_AM_NEEDLER && iid <= IID_AM_CASELESS) return "progs/ammobox.mdl"; //fixme @@ -843,7 +839,6 @@ float(float iid) WeaponAmmoType = if (iid == IID_GREN_FLASH) return IID_GREN_FLASH; - if (iid == IID_WP_USP) return IID_AM_45ACP; if (iid == IID_WP_USP_S) @@ -944,9 +939,9 @@ float(float iid) WeaponMagQuant = if (iid == IID_WP_WINCHESTER) return 2; if (iid == IID_WP_MOSSBERG) - return 8; - if (iid == IID_WP_JACKHAMMER) return 12; + if (iid == IID_WP_JACKHAMMER) + return 20; if (iid == IID_WP_MP9) return 25; if (iid == IID_WP_MP7) @@ -964,7 +959,7 @@ float(float iid) WeaponMagQuant = if (iid == IID_WP_AK112) return 24; if (iid == IID_WP_AK112_M) - return 40; + return 90; if (iid == IID_WP_AK74) return 30; if (iid == IID_WP_ACR) @@ -1265,8 +1260,7 @@ string(float iid) GetItemName = return "smoke grenade"; if (iid == IID_GREN_FLASH) return "flash grenade"; - if (iid == IID_GREN_FLARE) - return "ultra-light flare"; + if (iid == IID_ARM_DESERT) return "desert armor"; @@ -1395,17 +1389,17 @@ float(float iid) GetBaseValue = if (iid == IID_WP_USP) - return 25; + return 7; if (iid == IID_WP_USP_S) - return 30; + return 7; if (iid == IID_WP_GLOCK) - return 20; + return 6; if (iid == IID_WP_GLOCK_S) - return 25; + return 6; if (iid == IID_WP_DEAGLE) - return 35; + return 9; if (iid == IID_WP_DEAGLE_M) - return 40; + return 9; if (iid == IID_WP_NEEDLER) return 10; if (iid == IID_WP_ALIENBLASTER) @@ -1427,47 +1421,47 @@ float(float iid) GetBaseValue = if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) return 8; if (iid == IID_WP_WINCHESTER) - return 30; + return 10; if (iid == IID_WP_MOSSBERG) - return 150; + return 15; if (iid == IID_WP_JACKHAMMER) - return 200; - if (iid == IID_WP_MP9) - return 75; - if (iid == IID_WP_MP9_S) - return 75; - if (iid == IID_WP_MP7) - return 75; - if (iid == IID_WP_MP7_S) - return 75; - if (iid == IID_WP_RANGEMASTER) - return 50; - if (iid == IID_WP_RANGEMASTER_SCOPE) - return 50; - if (iid == IID_WP_AK47) return 25; + if (iid == IID_WP_MP9) + return 10; + if (iid == IID_WP_MP9_S) + return 10; + if (iid == IID_WP_MP7) + return 11; + if (iid == IID_WP_MP7_S) + return 11; + if (iid == IID_WP_RANGEMASTER) + return 12; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return 12; + if (iid == IID_WP_AK47) + return 20; if (iid == IID_WP_AK112) - return 80; + return 15; if (iid == IID_WP_AK112_M) - return 90; + return 17; if (iid == IID_WP_AK74) - return 30; + return 20; if (iid == IID_WP_ACR) - return 100; + return 24; if (iid == IID_WP_DKS1) - return 120; + return 25; if (iid == IID_WP_DKS1_S) - return 125; + return 25; if (iid == IID_WP_MOONLIGHT) - return 140; + return 30; if (iid == IID_WP_G11) - return 150; + return 75; if (iid == IID_WP_GAUSERIFLE) - return 200; + return 75; if (iid == IID_WP_PULSERIFLE) - return 200; + return 85; if (iid == IID_WP_TURBOPLASMA) - return 200; + return 100; if (iid == IID_WP_PLASMACARBINE) return 105; if (iid == IID_WP_FNFAL) @@ -1517,8 +1511,7 @@ float(float iid) GetBaseValue = return 1; if (iid == IID_GREN_FLASH) return 1; - if (iid == IID_GREN_FLARE) - return 1; + if (iid == IID_ARM_DESERT) return 1; @@ -1752,8 +1745,6 @@ string(float iid) GetItemDesc = return "temporarily blinds nearby enemies"; if (iid == IID_GREN_STUN) return "delivers a forceful shock to nearby enemies"; - if (iid == IID_GREN_FLARE) - return "provides a blue light for shadowy areas"; if (iid == IID_ARM_DESERT) return "the light armor of a raider; makes a great disguise"; @@ -1985,8 +1976,6 @@ string(float iid) GetItemImage = return "flash.jpg"; if (iid == IID_GREN_STUN) return "stun.jpg"; - if (iid == IID_GREN_FLARE) - return "flare.jpg"; if (iid == IID_ARM_DESERT) return "desert.jpg"; @@ -2175,8 +2164,6 @@ float(string itname) ItemIDOfName = return IID_GREN_FRAG; if (itname == "stun grenade") return IID_GREN_STUN; - if (itname == "stun flare") - return IID_GREN_FLARE; if (itname == "emp grenade") return IID_GREN_EMP; if (itname == "smoke grenade") @@ -2338,17 +2325,17 @@ string (float slot, float int) PerkName = if (int == 9) return "nintendo gamer"; if (int == 10) - return "duck and cover"; + return "esp"; if (int == 11) return "last man standing"; if (int == 12) return "bodysnatcher"; if (int == 13) - return "natural aim"; + return "medicine man"; if (int == 14) return "dark alchemist"; if (int == 15) - return "commando"; + return "renegade commando"; if (int == 16) return "power shot"; if (int == 17) @@ -2386,7 +2373,7 @@ string(float int) GetPerkImage = else if (int == 12) return "gui/perks/bodysnatcher.jpg"; else if (int == 13) - return "gui/perks/sixthsense.jpg"; + return "gui/perks/healingway.jpg"; else if (int == 14) return "gui/perks/alchemist.jpg"; else if (int == 15) @@ -2414,7 +2401,7 @@ string(float int) GetPerkDesc = else if (int == 3) return "instant stance change, fast prone movement"; else if (int == 4) - return "smash down locked doors and chests very loudly"; + return "smash down locked doors and chests, very loud"; else if (int == 5) return "fast reloading, instant weapon switching"; else if (int == 6) @@ -2422,17 +2409,17 @@ string(float int) GetPerkDesc = else if (int == 7) return "25% damage bonus to any enemy not targetting you"; else if (int == 8) - return "gain melee knockback and berserker speed"; + return "gain melee knockback and berserker rage bonus"; else if (int == 9) return "you'll sometimes enter 'the zone'!"; else if (int == 10) - return "+25% miss chance when taking cover"; + return "+10% miss chance to you and any nearby allies"; else if (int == 11) return "recover hit points as you mow down foes"; else if (int == 12) return "become a master of disguise by looting dead bodies"; else if (int == 13) - return "you can perform quicker aimed shots"; + return "25% bonus to all chems used on yourself and others"; else if (int == 14) return "mix chems together to make better ones"; else if (int == 15) @@ -2448,5 +2435,4 @@ string(float int) GetPerkDesc = else return ""; -}; - +}; \ No newline at end of file From db4e721a9ce80597c18de1c1d0b242534559767a Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 5 Nov 2009 05:19:19 +0000 Subject: [PATCH 08/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3416 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/invent.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 7a747ea85..cd6393209 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -1,6 +1,6 @@ void bprint(float plev, string st, string s2){} float PRINT_MEDIUM = 1; -#include "inventory.qc" +#include "../inventory.qc" float show_inventory; From 83c7939f959758887874c78b67ee6702852238a5 Mon Sep 17 00:00:00 2001 From: Magnus Date: Fri, 6 Nov 2009 02:23:49 +0000 Subject: [PATCH 09/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3417 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 38 +++-- quakec/fallout2/csqc/invent.qc | 256 ++++++++++++++++----------------- quakec/fallout2/csqc/main.qc | 2 + quakec/fallout2/mod_buy.qc | 13 +- quakec/fallout2/world.qc | 5 + 5 files changed, 169 insertions(+), 145 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index b90367d23..3b166e2c7 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -52,13 +52,22 @@ void() SetChangeParms = } */ -// remove items + self.items = self.items - (self.items & (IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) ); -// parm6 = self.chem; - if (self.class > 0) - parm7 = self.class; + + if (self.skill_combat > 0) + parm5 = self.skill_combat; + if (self.skill_doctor > 0) + parm6 = self.skill_doctor; + if (self.skill_sneak > 0) + parm7 = self.skill_sneak; + if (self.skill_science > 0) + parm14 = self.skill_science; + + + parm8 = self.ammo_shells; parm9 = self.perk1; parm10 = self.perk2; @@ -140,14 +149,19 @@ void() DecodeLevelParms = { setspawnparms(self); -// self.chem = parm6; + + if (parm5 > 0) + self.skill_combat = parm5; + if (parm6 > 0) + self.skill_doctor = parm6; if (parm7 > 0) - self.class = parm7; + self.skill_sneak = parm7; + if (parm14 > 0) + self.skill_science = parm14; + self.ammo_shells = parm8; self.perk1 = parm9; self.perk2 = parm10; - self.score = parm5; - self.current_slot = parm16; @@ -170,11 +184,11 @@ void() DecodeLevelParms = self.islot17 = parm1; self.islot18 = parm2; self.islot19 = parm3; - self.islot20 = parm4; + self.islot20 = parm4; self.islot21 = parm11; self.islot22 = parm12; self.islot23 = parm13; - self.islot24 = parm15; + self.islot24 = parm15; }; @@ -636,7 +650,7 @@ void() PutClientInServer = DecodeLevelParms (); - if (self.class == 0 || self.team == 0) + if (self.skill_combat == 0 && self.skill_sneak == 0 && self.skill_doctor == 0 && self.skill_science == 0) { self.deadflag = DEAD_NO; self.health = 200; @@ -1679,7 +1693,7 @@ void() PlayerPreThink = DisplayMenu (); return; } - else if (self.class == 0 && self.currentmenu == "none") + else if (self.skill_combat == 0 && self.skill_sneak == 0 && self.skill_doctor == 0 && self.skill_science == 0 && self.currentmenu == "none") { self.currentmenu = "select_skill"; DisplayMenu (); diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index cd6393209..46d5125a9 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -3,6 +3,7 @@ float PRINT_MEDIUM = 1; #include "../inventory.qc" float show_inventory; +float show_pipboy; vector mousepos; @@ -32,6 +33,7 @@ float mouseisdown; #define CURSORSIZE 8 + void(vector pos, float slotno) SlotImage = { local float it, mod_s, mod_e; @@ -114,7 +116,7 @@ void(vector pos, float slotno) SlotImageSmall = } itname = GetItemImage(ToIID(it)); - drawpic(pos, strcat("gui/", itname), IMGSIZEZ, '1 1 1', 1); + drawpic(pos, strcat("gui/", itname), IMGSIZEH, '1 1 1', 1); mod_s = getstati(70); mod_e = getstati(71); @@ -134,7 +136,7 @@ void(vector pos, float slotno) SlotImageSmall = return; itname = ftos(it); it = strlen(itname); - drawstring(pos + IMGSIZEZ - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); + drawstring(pos + IMGSIZEZ - '0 16 0' - '16 0 0'*it, itname, '8 8 8', '1 1 1', 1); }; void(vector pos, float slotno) QuickImage = @@ -355,6 +357,61 @@ void(vector pos, string image) Crosshair = drawpic(pos, image, IMGSIZEQ, '1 1 1', 1); }; + +void() Pipboy_Draw = +{ + float width,height,lvl,bar; + vector w; + + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + w = '1 1 0'*height; + + + + + 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); + bar = 0; + lvl = getstati(81); + while (bar <= lvl) + { + drawpic('3 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); + bar = 0; + lvl = getstati(82); + 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); + bar = bar + 1; + } + + + drawstring('2 2.4 0'*IMGSIZEF, "SNEAK", '8 8 8', '1 1 1', 1); + bar = 0; + lvl = getstati(83); + 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); + bar = bar + 1; + } + + drawstring('2 2.6 0'*IMGSIZEF, "SCIENCE", '8 8 8', '1 1 1', 1); + bar = 0; + lvl = getstati(84); + 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); + bar = bar + 1; + } + +}; + + void() Invent_Draw = { local float i; @@ -363,37 +420,54 @@ void() Invent_Draw = local float op; local float height,width; + vector w; height = cvar("vid_conheight"); 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); local float slotofs; slotofs = sliderpos*(height - (IMGSIZEF*6)) + (IMGSIZEF*6); - +/* for (i = 6; i <= MAXSLOTS; i++) { SlotImage(((i*IMGSIZEF-slotofs) * '0 1 0'), i+1); // itname = GetItemName(ToIID(it)); // drawstring(toppos + ((i*8-slotofs) * '0 1 0'), strcat(itname, " (", ftos(ToStatus(it)), ")"), '8 8 0', '1 1 1', 1); - } + }*/ - drawstring('112 248 0', " HAND1 ", '8 8 8', '1 1 1', 1); - SlotImage('112 256 0', 1); - drawstring('112 248 0'+('1 0 0'*IMGSIZEF), " HAND2 ", '8 8 8', '1 1 1', 1); - SlotImage('112 256 0'+('1 0 0'*IMGSIZEF), 2); - drawstring('112 248 0'+('2 0 0'*IMGSIZEF), " ARMOUR ", '8 8 8', '1 1 1', 1); - SlotImage('112 256 0'+('2 0 0'*IMGSIZEF), 3); + SlotImage('2 1 0'*IMGSIZEF, 5); + SlotImage('2 2 0'*IMGSIZEF, 6); + SlotImage('2 3 0'*IMGSIZEF, 7); + 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); + SlotImage('3 4 0'*IMGSIZEF, 14); + SlotImage('3 5 0'*IMGSIZEF, 15); + SlotImage('3 6 0'*IMGSIZEF, 16); - drawstring('112 120 0', " EQUIP ", '8 8 8', '1 1 1', 1); - SlotImage('112 128 0', 4); - drawstring('112 120 0'+('1 0 0'*IMGSIZEF), " POUCH1 ", '8 8 8', '1 1 1', 1); - SlotImage('112 128 0'+('1 0 0'*IMGSIZEF), 5); - drawstring('112 120 0'+('2 0 0'*IMGSIZEF), " POUCH2 ", '8 8 8', '1 1 1', 1); - SlotImage('112 128 0'+('2 0 0'*IMGSIZEF), 6); + SlotImage('5.5 1 0'*IMGSIZEF, 1); + SlotImage('5.5 3 0'*IMGSIZEF, 2); + SlotImage('5.5 5.5 0'*IMGSIZEF, 3); + SlotImageSmall('1 3 0'*IMGSIZEK, 17); + SlotImageSmall('1 4 0'*IMGSIZEK, 18); + SlotImageSmall('1 5 0'*IMGSIZEK, 19); + 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); + +/* drawstring('120 72 0'+('4 0 0'*IMGSIZEF), " JUNK ", '8 8 8', '1 1 1', 1); SlotImageSmall('112 80 0'+('4 0 0'*IMGSIZEF), 17); SlotImageSmall('112 128 0'+('4 0 0'*IMGSIZEF), 18); @@ -402,9 +476,9 @@ void() Invent_Draw = SlotImageSmall('96 80 0'+('5 0 0'*IMGSIZEF), 21); SlotImageSmall('96 128 0'+('5 0 0'*IMGSIZEF), 22); SlotImageSmall('96 176 0'+('5 0 0'*IMGSIZEF), 23); - SlotImageSmall('96 224 0'+('5 0 0'*IMGSIZEF), 24); - + SlotImageSmall('96 224 0'+('5 0 0'*IMGSIZEF), 24);*/ +/* perki = GetPerkImage(getstati(60)); perk2i = GetPerkImage(getstati(59)); @@ -419,99 +493,18 @@ void() Invent_Draw = drawstring('112 408 0'+('3 0 0'*IMGSIZEF), p1, '8 8 8', '1 1 1', 1); drawstring('112 408 0'+('5 0 0'*IMGSIZEF), p2, '8 8 8', '1 1 1', 1); - i = getstati(62); - if (i == 1) - itname = "team: rangers"; - else if (i == 2) - itname = "team: raiders"; - else - itname = "team: none"; - drawstring('112 264 0'+('0 1 0'*IMGSIZEF), itname, '8 8 8', '1 1 1', 1); - i = getstati(63); - if (i == 1) - { - itname = "skill set: first aid"; - s1 = "small arms: 65%"; - s2 = "big guns: 35%"; - s3 = "melee: 45%"; - s4 = "sneak: 40%"; - s5 = "first aid: 90%"; - s6 = "doctor: 75%"; - s7 = "science: 25%"; - s8 = "repair: 35%"; - s9 = "thrown: 50%"; - } - else if (i == 2) - { - itname = "skill set: stealth"; - s1 = "small arms: 75%"; - s2 = "big guns: 25%"; - s3 = "melee: 80%"; - s4 = "sneak: 95%"; - s5 = "first aid: 55%"; - s6 = "doctor: 15%"; - s7 = "science: 55%"; - s8 = "repair: 25%"; - s9 = "thrown: 75%"; - } - else if (i == 3) - { - itname = "skill set: combat"; - s1 = "small arms: 90%"; - s2 = "big guns: 75%"; - s3 = "melee: 80%"; - s4 = "sneak: 55%"; - s5 = "first aid: 55%"; - s6 = "doctor: 15%"; - s7 = "science: 15%"; - s8 = "repair: 15%"; - s9 = "thrown: 75%"; - } - else if (i == 4) - { - itname = "skill set: science"; - s1 = "small arms: 25%"; - s2 = "big guns: 10%"; - s3 = "melee: 15%"; - s4 = "sneak: 35%"; - s5 = "first aid: 65%"; - s6 = "doctor: 25%"; - s7 = "science: 95%"; - s8 = "repair: 90%"; - s9 = "thrown: 25%"; - } - else - { - itname = "class: none"; - s1 = "small arms: 10%"; - s2 = "big guns: 5%"; - s3 = "melee: 5%"; - s4 = "sneak: 10%"; - s5 = "first aid: 10%"; - s6 = "doctor: 5%"; - s7 = "science: 15%"; - s8 = "repair: 5%"; - } - - drawstring('112 272 0'+('0 1 0'*IMGSIZEF), itname, '8 8 8', '1 1 1', 1); - drawstring('112 280 0'+('0 1 0'*IMGSIZEF), s1, '8 8 8', '1 1 1', 1); - drawstring('112 288 0'+('0 1 0'*IMGSIZEF), s2, '8 8 8', '1 1 1', 1); - drawstring('112 296 0'+('0 1 0'*IMGSIZEF), s3, '8 8 8', '1 1 1', 1); - drawstring('112 304 0'+('0 1 0'*IMGSIZEF), s4, '8 8 8', '1 1 1', 1); - drawstring('112 312 0'+('0 1 0'*IMGSIZEF), s5, '8 8 8', '1 1 1', 1); - drawstring('112 320 0'+('0 1 0'*IMGSIZEF), s6, '8 8 8', '1 1 1', 1); - drawstring('112 328 0'+('0 1 0'*IMGSIZEF), s7, '8 8 8', '1 1 1', 1); - drawstring('112 336 0'+('0 1 0'*IMGSIZEF), s8, '8 8 8', '1 1 1', 1); - drawstring('112 344 0'+('0 1 0'*IMGSIZEF), s9, '8 8 8', '1 1 1', 1); +*/ + +/* drawpic(('1 0 0'*IMGSIZEF), "gui/scrollup.jpg", '16 16 0', '1 1 1', 1); for (i = 0; i < height; i+=16) drawpic('1 0 0'*IMGSIZEF+'0 16 0'+i*'0 1 0', "gui/scrollbar.jpg", '16 16 0', '1 1 1', 1); drawpic(('1 0 0'*IMGSIZEF)+(height-16)*'0 1 0', "gui/scrolldown.jpg", '16 16 0', '1 1 1', 1); - drawpic(('1 0 0'*IMGSIZEF)+'0 16 0'+sliderpos*(height-48)*'0 1 0', "gui/scrollbox.jpg", '16 16 0', '1 1 1', 1); + drawpic(('1 0 0'*IMGSIZEF)+'0 16 0'+sliderpos*(height-48)*'0 1 0', "gui/scrollbox.jpg", '16 16 0', '1 1 1', 1);*/ if (showcontextmenu) @@ -542,44 +535,45 @@ void() Invent_Draw = } else { - if (mousepos_x >= IMGSIZEF) + if ((mousepos_y >= 12.5*IMGSIZEH && mousepos_y <= 13*IMGSIZEH) && mousepos_x <= IMGSIZEF) + { + slotnum = 4; + } + else if (mousepos_x >= IMGSIZEF) { slotnum = 0; - if (mousepos_x >= 112 && mousepos_x <= 112+3*IMGSIZEF) - if (mousepos_y >= 256 && mousepos_y <= 256+IMGSIZEF) - slotnum = floor((mousepos_x - 112)/IMGSIZEF) + 1; + if (mousepos_x >= 2*IMGSIZEF && mousepos_x <= 3*IMGSIZEF) + if (mousepos_y >= 1*IMGSIZEF && mousepos_y <= 7*IMGSIZEF) + slotnum = floor((mousepos_y)/IMGSIZEF) + 4; - if (mousepos_x >= 112 && mousepos_x <= 112+3*IMGSIZEF) - if (mousepos_y >= 128 && mousepos_y <= 128+IMGSIZEF) - slotnum = floor((mousepos_x - 112)/IMGSIZEF) + 4; + if (mousepos_x >= 3*IMGSIZEF && mousepos_x <= 4*IMGSIZEF) + if (mousepos_y >= 1*IMGSIZEF && mousepos_y <= 7*IMGSIZEF) + slotnum = floor((mousepos_y)/IMGSIZEF) + 10; - if (mousepos_x >= 112+3*IMGSIZEF && mousepos_x <= 112+4*IMGSIZEF) - if (mousepos_y >= 336 && mousepos_y <= 336+IMGSIZEF) - slotnum = 98; + if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.5*IMGSIZEF) + 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) + slotnum = 2; - if (mousepos_x >= 112+5*IMGSIZEF && mousepos_x <= 112+6*IMGSIZEF) - if (mousepos_y >= 336 && mousepos_y <= 336+IMGSIZEF) - slotnum = 99; - - - if (mousepos_x >= 112+4*IMGSIZEF && mousepos_x <= 112+5*IMGSIZEF) - if (mousepos_y >= 80 && mousepos_y <= 80+4*IMGSIZEX) - slotnum = floor((mousepos_y - 80)/IMGSIZEX) + 17; - - if (mousepos_x >= 112+5*IMGSIZEF && mousepos_x <= 112+6*IMGSIZEF) - if (mousepos_y >= 80 && mousepos_y <= 80+4*IMGSIZEX) - slotnum = floor((mousepos_y - 80)/IMGSIZEX) + 21; + if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.5*IMGSIZEF) + if (mousepos_y >= 5.5*IMGSIZEF && mousepos_y <= 6.5*IMGSIZEF) + slotnum = 3; } else { - slotnum = floor((mousepos_y + slotofs)/IMGSIZEF) + 1; + slotnum = floor((mousepos_y)/IMGSIZEK) + 14; + if (slotnum <= 16) + slotnum = 0; + if (slotnum >= 25) + slotnum = 0; } // slotnum = floor((mousepos_y - toppos_y)/8) + 1; } drawstring('128 0 0', ftos(slotnum), '8 8 0', '1 1 1', 1); - drawfill('120 24 0', '512 40 0', '0 0 0', 0.7); if (slotnum <= 24) { @@ -606,10 +600,8 @@ if (slotnum <= 24) it = getstati(98); } - itname = GetItemName(ToIID(it)); - drawstring('128 32 0', itname, '8 8 0', '1 1 1', 1); itname = GetItemDesc(ToIID(it)); - drawstring('128 48 0', itname, '8 8 0', '1 1 1', 1); + drawstring('32 16 0', itname, '8 8 0', '1 1 1', 1); } else if (slotnum == 98) { @@ -648,6 +640,10 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = { show_inventory = !show_inventory; } + if (param1 == 'p') + { + show_pipboy = !show_pipboy; + } else if (!show_inventory) return false; else if (param1 == k_mouse1) diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index 99aa501c7..eb37e3d7a 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -444,6 +444,8 @@ void(float do2d) CSQC_UpdateView = DrawScreen(); else if (show_inventory) Invent_Draw(); + else if (show_pipboy) + Pipboy_Draw(); else { Health_Draw(); diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index 67d761afe..696afab3a 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -972,6 +972,14 @@ void() W_PlayerMenu = { self.missionbrief = 0; self.class = self.tclass; + if (self.class == 1) + self.skill_doctor = 1; + if (self.class == 2) + self.skill_sneak = 1; + if (self.class == 3) + self.skill_combat = 1; + if (self.class == 4) + self.skill_science = 1; sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; centerprint(self, ""); @@ -1117,13 +1125,12 @@ void() W_PlayerMenu = te = te.chain; } - /* + if (greed == 1) self.score = self.score - 50; else - self.score = self.score - 25;*/ + self.score = self.score - 25; - self.chest.solid = SOLID_NOT; sound (self, CHAN_WEAPON, "effects/openlock.wav", TRUE, ATTN_NORM); sprint(self, 2, "you manage to pick the lock. you find:\n"); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 0e63fea3c..f2fcd2c6c 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -70,6 +70,10 @@ void() SetupStats = clientstat(69, 2, map_ent3); clientstat(70, 2, silencer); clientstat(71, 2, extender); + clientstat(81, 2, skill_combat); + clientstat(82, 2, skill_doctor); + clientstat(83, 2, skill_sneak); + clientstat(84, 2, skill_science); clientstat(91, 2, islot17); clientstat(92, 2, islot18); clientstat(93, 2, islot19); @@ -93,6 +97,7 @@ void() SetupStats = clientstat(125, 2, timer); clientstat(126, 2, popup); clientstat(127, 2, score); + }; //assesses all current players From 810a3c15a0a32f108cc3fa880b29e585cf27cb4c Mon Sep 17 00:00:00 2001 From: Magnus Date: Fri, 6 Nov 2009 02:49:54 +0000 Subject: [PATCH 10/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3418 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 124 +++++++++----------------------------- 1 file changed, 28 insertions(+), 96 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 3b166e2c7..c848e36c2 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -44,13 +44,6 @@ void() SetChangeParms = if (!self.current_slot) //changing without spawning? DecodeLevelParms(); //make sure we have our inventory! -/* - if (self.health <= 0) - { - SetNewParms (); - return; - } - */ self.items = self.items - (self.items & @@ -71,10 +64,6 @@ void() SetChangeParms = parm8 = self.ammo_shells; parm9 = self.perk1; parm10 = self.perk2; - - - - parm16 = self.current_slot; parm17 = self.islot1; parm18 = self.islot2; @@ -104,28 +93,27 @@ void() SetChangeParms = }; void() SetNewParms = -{ //remember, don't use self! -// parm1 = IID_WP_USP; -// parm2 = IID_WP_KNIFE; -// parm3 = IID_ARM_SHIRT; -// parm4 = 0; -// parm6 = 0; - parm7 = 0; - parm8 = 300; //starting cash - parm9 = 0; - parm10 = 0; -// parm11 = 0; -// parm12 = 0; - //parm13 = 0; - parm14 = 0; -// parm15 = 0; - - parm5 = 0; //score +{ //16 is the current_slot //17 to 32 are inventory slots. //the assignments were moved into PutClientInServer //on account of changing maps before spawning was resulting in no inventory. + parm1 = 0; + parm2 = 0; + parm3 = 0; + parm4 = 0; + parm5 = 0; + parm6 = 0; + parm7 = 0; + parm8 = 300; + parm9 = 0; + parm10 = 0; + parm11 = 0; + parm12 = 0; + parm13 = 0; + parm14 = 0; + parm15 = 0; parm16 = 0; parm17 = 0; parm18 = 0; @@ -675,33 +663,12 @@ void() PutClientInServer = if (self.current_slot == 0) { + self.islot1 = SlotVal(IID_WP_GLOCK, 15); self.islot2 = 0; - - self.current_slot = 1; - if (self.class == 1) - self.islot1 = SlotVal(IID_WP_WINCHESTER, 2); - if (self.class == 2) - { - self.islot1 = SlotVal(IID_WP_GLOCK, 15); - self.islot2 = SlotVal(IID_WP_KNIFE, 1); - } - if (self.class == 3) - self.islot1 = SlotVal(IID_WP_USP, 12); - if (self.class == 4) - self.islot1 = SlotVal(IID_WP_PIPERIFLE, 1); - self.islot3 = 0; - self.islot7 = SlotVal(IID_CHEM_STIMPACK, 3); - - if (self.class == 1) - self.islot8 = SlotVal(IID_AM_12GAUGESHELLS, 20); - if (self.class == 2) - self.islot8 = SlotVal(IID_AM_10MM, 30); - if (self.class == 3) - self.islot8 = SlotVal(IID_AM_45ACP, 24); - if (self.class == 4) - self.islot8 = SlotVal(IID_AM_44MAGNUM, 20); - + self.islot5 = SlotVal(IID_CHEM_STIMPACK, 3); + self.islot7 = SlotVal(IID_AM_10MM, 30); + self.islot8 = 0; self.islot9 = 0; self.islot10 = 0; self.islot11 = 0; @@ -713,41 +680,11 @@ void() PutClientInServer = self.islot17 = 0; self.islot18 = 0; self.islot19 = 0; - self.islot20 = 0; -//now give them special items for thier class. -//you're fairly screwed if you change class. - if (self.class == 1) - { - x = SlotOfItem(self, IID_CHEM_MEDICALBAG); - if (x == 0) - self.islot5 = SlotVal(IID_CHEM_MEDICALBAG, 100); - } - if (self.class == 2) - { - x = SlotOfItem(self, IID_EQUIP_STEALTHBOY); - if (x == 0) - self.islot4 = SlotVal(IID_EQUIP_STEALTHBOY, 1); - } - if (self.class == 4) - { - x = SlotOfItem(self, IID_WP_WRENCH); - if (x == 0) - self.islot5 = SlotVal(IID_WP_WRENCH, 1); - - TryGiveStackable(self, IID_MISC_STEELPIPE, 1); - TryGiveStackable(self, IID_MISC_DUCKTAPE, 1); - TryGiveStackable(self, IID_MISC_AEROSOL, 2); - TryGiveStackable(self, IID_MISC_JUNK, 2); - - xx = ceil(309+random()*12); - TryGiveStackable(self, xx, 1); - - xx = ceil(309+random()*12); - TryGiveStackable(self, xx, 1); - - xx = ceil(309+random()*12); - TryGiveStackable(self, xx, 1); - } + self.islot20 = 0; + self.islot21 = 0; + self.islot22 = 0; + self.islot23 = 0; + self.islot24 = 0; } self.attack_finished = time; @@ -764,14 +701,9 @@ void() PutClientInServer = self.angles = spot.angles; self.fixangle = TRUE; // turn this way immediately - if (self.class == 1) - self.max_health = 80; - if (self.class == 2) - self.max_health = 80; - if (self.class == 3) - self.max_health = 100; - if (self.class == 4) - self.max_health = 60; + + self.max_health = 100; + self.equipment_slot = 0; self.health = self.max_health; From 003f374e500428c392cdb157fa9afdd2a2dbc776 Mon Sep 17 00:00:00 2001 From: Magnus Date: Fri, 6 Nov 2009 04:34:08 +0000 Subject: [PATCH 11/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3419 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 6 +- quakec/fallout2/mod_buy.qc | 114 +++++++++---------------------------- quakec/fallout2/modbuy.qc | 56 +----------------- quakec/fallout2/weapons.qc | 24 ++------ quakec/fallout2/world.qc | 6 +- 5 files changed, 40 insertions(+), 166 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index c848e36c2..4dee1b8d5 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -151,6 +151,7 @@ void() DecodeLevelParms = self.perk1 = parm9; self.perk2 = parm10; + self.class = 1; self.current_slot = parm16; self.islot1 = parm17; @@ -1625,9 +1626,10 @@ void() PlayerPreThink = DisplayMenu (); return; } - else if (self.skill_combat == 0 && self.skill_sneak == 0 && self.skill_doctor == 0 && self.skill_science == 0 && self.currentmenu == "none") + else if (self.score >= 20 && self.currentmenu == "none") { - self.currentmenu = "select_skill"; + self.currentmenu = "gain_skill"; + self.missionbrief = 2; DisplayMenu (); } diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index 696afab3a..5e2e3d2ff 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -444,60 +444,6 @@ float (float input) overweight = return (FALSE); }; -void () W_GetClass = -{ - if ((self.currentmenu == "select_skill")) - { - if (self.impulse == 1) - { - self.missionbrief = 2; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "none"; - self.max_health = 80; - self.tclass = 1; - self.currentmenu = "confirm_skill"; - self.ghost = 0; - return; - } - if ((self.impulse == 2)) - { - self.missionbrief = 2; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "none"; - self.max_health = 70; - self.tclass = 2; - self.currentmenu = "confirm_skill"; - self.ghost = 0; - return; - } - if (self.impulse == 3) - { - self.missionbrief = 2; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "none"; - self.max_health = 100; - self.tclass = 3; - self.currentmenu = "confirm_skill"; - self.ghost = 0; - return; - } - if (self.impulse == 4) - { - self.missionbrief = 2; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.max_health = 80; - self.currentmenu = "none"; - self.tclass = 4; - self.currentmenu = "confirm_skill"; - self.ghost = 0; - return; - } - } - if (self.impulse > 4) - return; - -}; - void() W_PlayerMenu = { @@ -895,17 +841,15 @@ void() W_PlayerMenu = } } - else if (self.currentmenu == "select_skill") + else if (self.currentmenu == "gain_skill") { if (self.impulse == 1) { self.missionbrief = 2; sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; - self.max_health = 80; self.tclass = 1; self.currentmenu = "confirm_skill"; - centerprint (self, "your skill-set will be‘\n\nfirst aid - OK?\n1‘ Yes \n2‘ No \n\nprimary: first aid\nsecondary: buff allies\n"); self.ghost = 0; return; } @@ -914,10 +858,8 @@ void() W_PlayerMenu = self.missionbrief = 2; sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; - self.max_health = 70; self.tclass = 2; self.currentmenu = "confirm_skill"; - centerprint (self, "your skill-set will be‘\n\nstealth - OK?\n1‘ Yes \n2‘ No \n\nprimary: stealth\nsecondary: damage"); self.ghost = 0; return; } @@ -926,10 +868,8 @@ void() W_PlayerMenu = self.missionbrief = 2; sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; - self.max_health = 100; self.tclass = 3; self.currentmenu = "confirm_skill"; - centerprint (self, "your skill-set will be‘\n\ncombat - OK?\n1‘ Yes \n2‘ No \n\nprimary: survival\nsecondary: damage"); self.ghost = 0; return; } @@ -937,11 +877,9 @@ void() W_PlayerMenu = { self.missionbrief = 2; sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.max_health = 80; self.currentmenu = "none"; self.tclass = 4; self.currentmenu = "confirm_skill"; - centerprint (self, "your skill-set will be‘\n\nscience - OK?\n1‘ Yes \n2‘ No \n\nprimary: create\nsecondary: bypass"); self.ghost = 0; return; } @@ -973,28 +911,28 @@ void() W_PlayerMenu = self.missionbrief = 0; self.class = self.tclass; if (self.class == 1) - self.skill_doctor = 1; + self.skill_doctor = self.skill_doctor + 1; if (self.class == 2) - self.skill_sneak = 1; + self.skill_sneak = self.skill_sneak + 1; if (self.class == 3) - self.skill_combat = 1; + self.skill_combat = self.skill_combat + 1; if (self.class == 4) - self.skill_science = 1; + self.skill_science = self.skill_science + 1; + + self.score = 0; sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; centerprint(self, ""); - PutClientInServer(); bprint(2, self.netname); - bprint(2, " has entered the wasteland.\n"); + bprint(2, " has gained a level.\n"); self.class = self.tclass; - total_players = total_players + 1; self.impulse = 0; return; } if (self.impulse == 2) { sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "select_skill"; + self.currentmenu = "gain_skill"; DisplayMenu(); self.impulse = 0; self.class = 0; @@ -1005,19 +943,14 @@ void() W_PlayerMenu = { if (self.impulse == 1 && coop == 1) { - if (time > 3000) - { - self.currentmenu = "display_wait_screen"; - return; - } - self.missionbrief = 1; + self.missionbrief = 0; self.team = 1; self.connected = 1; sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); centerprint(self, "\n"); - self.currentmenu = "display_brief"; - DisplayMenu(); - self.impulse = 0; + self.currentmenu = "none"; + //DisplayMenu(); + self.impulse = 1; return; } else if (self.impulse == 1 && coop == 0) @@ -1034,8 +967,19 @@ void() W_PlayerMenu = { if (self.impulse == 1) { - if (self.class > 0) + if (self.skill_combat == 0 && self.skill_sneak == 0 && self.skill_doctor == 0 && self.skill_science == 0) { + self.team = 1; + self.missionbrief = 2; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); + self.currentmenu = "select_skill"; + DisplayMenu(); + self.impulse = 0; + return; + } + else + { + self.missionbrief = 0; sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); self.currentmenu = "none"; @@ -1046,13 +990,7 @@ void() W_PlayerMenu = total_players = total_players + 1; return; } - self.team = 1; - self.missionbrief = 2; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "select_skill"; - DisplayMenu(); - self.impulse = 0; - return; + } } else if (self.currentmenu == "select_mission") diff --git a/quakec/fallout2/modbuy.qc b/quakec/fallout2/modbuy.qc index 7b42d24fa..e397f4645 100644 --- a/quakec/fallout2/modbuy.qc +++ b/quakec/fallout2/modbuy.qc @@ -392,56 +392,6 @@ float () weightx = return tmp; }; -void () W_GetClass = -{ - if ((self.currentmenu == "select_skill")) - { - sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); - if (self.impulse == 1) - { - self.currentmenu = "none"; - self.max_health = 80; - self.class = 1; - self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nMedic - OK?\n1‘ Yes \n2‘ No \n"); - self.ghost = 0; - return; - } - if ((self.impulse == 2)) - { - self.currentmenu = "none"; - self.max_health = 70; - self.class = 2; - self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nAssassin - OK?\n1‘ Yes \n2‘ No \n"); - self.ghost = 0; - return; - } - if (self.impulse == 3) - { - self.currentmenu = "none"; - self.max_health = 100; - self.class = 3; - self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nSoldiier - OK?\n1‘ Yes \n2‘ No \n"); - self.ghost = 0; - return; - } - if (self.impulse == 4) - { - self.max_health = 80; - self.currentmenu = "none"; - self.class = 4; - self.currentmenu = "confirm_skill"; - centerprint (self, "your class will be‘\n\nScientist - OK?\n1‘ Yes \n2‘ No \n"); - self.ghost = 0; - return; - } - } - if (self.impulse > 4) - return; - -}; void() W_PlayerMenu = @@ -716,7 +666,7 @@ void() W_PlayerMenu = } - if (self.currentmenu == "select_skill") + if (self.currentmenu == "gain_skill") { sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); @@ -768,7 +718,7 @@ void() W_PlayerMenu = if (self.impulse == 1) { sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); - self.currentmenu = "select_skill"; + self.currentmenu = "gain_skill"; DisplayMenu(); self.impulse = 0; return; @@ -796,7 +746,7 @@ void() W_PlayerMenu = if (self.impulse == 2) { sound (self, CHAN_WEAPON, "buttons/switch02.wav", TRUE, ATTN_NORM); - self.currentmenu = "select_skill"; + self.currentmenu = "gain_skill"; DisplayMenu(); self.impulse = 0; self.class = 0; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index c3907981f..06d71c19b 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1766,6 +1766,7 @@ void() CheatCommand = sprint(self, 2, y); sprint(self, 2, "\n"); self.ammo_shells = 900; + self.score = 21; }; @@ -4600,25 +4601,10 @@ void () DisplayMenu = centerprint (self, menu); } - if (self.currentmenu == "select_skill") + if (self.currentmenu == "gain_skill") { - ze = find (world, classname, "player"); - while (ze) - { - if (ze.class == 1) - gotm += 1; - if (ze.class == 2) - gots += 1; - if (ze.class == 3) - gotc += 1; - if (ze.class == 4) - gote += 1; - - ze = find(ze, classname, "player"); - } - - centerprint (self, "choose skill set‘\n\n1‘ first aid \n2‘ stealth \n3‘ combat \n4‘ science \n"); + centerprint (self, "choose skill to gain‘\n\n1‘ doctor \n2‘ sneak \n3‘ combat \n4‘ science \n"); } if ((self.currentmenu == "select_team")) @@ -5747,13 +5733,13 @@ void () CharacterSheet = sprint (self, 2, "Raiders\n"); sprint (self, PRINT_HIGH, "Score ‘ "); - r1 = (self.dead); + r1 = (self.score); r2 = (self.kills); if (r1 == 0) r1 = 1; ratio = (r2 / r1); - x = ftos (ratio); + x = ftos (r1); sprint (self, 2, x); sprint (self, 2, " ("); x = ftos (self.kills); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index f2fcd2c6c..13c2d84f0 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -177,7 +177,7 @@ void() load_monster = { self.zone = 1; - monster_ogre(); + monster_army(); /* if (world.map_ent1 == 1) monster_dog(); @@ -210,9 +210,7 @@ void() load_monster = monster_dog(); if (world.map_ent2 == 2) monster_zombie(); - if (world.map_ent2 == 3) - monster_tarbaby(); - if (world.map_ent2 == 4 || world.map_ent2 == 5) + if (world.map_ent2 == 3 || world.map_ent2 == 4 || world.map_ent2 == 5) monster_army(); if (world.map_ent2 == 6) monster_ogre(); From 7dfc0e99a4c3f59df7e9153bd9691bead656f76f Mon Sep 17 00:00:00 2001 From: Magnus Date: Sat, 7 Nov 2009 03:43:48 +0000 Subject: [PATCH 12/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3421 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 68 ++++++++-------- quakec/fallout2/combat.qc | 27 +++---- quakec/fallout2/csqc/invent.qc | 143 +++++++++++++++------------------ quakec/fallout2/csqc/main.qc | 2 + quakec/fallout2/dog.qc | 5 ++ quakec/fallout2/doors.qc | 41 ++++------ quakec/fallout2/hos.qc | 2 +- quakec/fallout2/inventory.qc | 18 ++++- quakec/fallout2/items.qc | 5 +- quakec/fallout2/knight.qc | 24 +++--- quakec/fallout2/misc.qc | 3 + quakec/fallout2/mod_buy.qc | 5 +- quakec/fallout2/plats.qc | 20 +++++ quakec/fallout2/soldier.qc | 5 ++ quakec/fallout2/weapons.qc | 84 ++++++++++++------- quakec/fallout2/world.qc | 61 +++++++------- quakec/fallout2/zombie.qc | 30 ++++--- 17 files changed, 304 insertions(+), 239 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 4dee1b8d5..3e67377a1 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -153,7 +153,9 @@ void() DecodeLevelParms = self.class = 1; - self.current_slot = parm16; + if (parm16 > 0) + self.current_slot = parm16; + self.islot1 = parm17; self.islot2 = parm18; self.islot3 = parm19; @@ -620,7 +622,7 @@ void() PutClientInServer = self.takedamage = DAMAGE_AIM; self.movetype = MOVETYPE_WALK; self.show_hostile = 0; - self.max_health = 100; + self.max_health = 100 + self.skill_combat; self.health = 100; self.flags = FL_CLIENT; self.air_finished = time + 12; @@ -638,7 +640,7 @@ void() PutClientInServer = DecodeLevelParms (); - +/* if (self.skill_combat == 0 && self.skill_sneak == 0 && self.skill_doctor == 0 && self.skill_science == 0) { self.deadflag = DEAD_NO; @@ -660,7 +662,7 @@ void() PutClientInServer = self.active = 1; player_stand1 (); return; - } + }*/ if (self.current_slot == 0) { @@ -703,7 +705,7 @@ void() PutClientInServer = self.fixangle = TRUE; // turn this way immediately - self.max_health = 100; + self.max_health = 100 + self.skill_combat; self.equipment_slot = 0; @@ -1312,7 +1314,7 @@ float(entity targ) check_fov_side = void() SneakLevel = { - local float sn, st, front, r; + local float sn, st, front, r, q; local entity te; local string report; @@ -1330,7 +1332,7 @@ void() SneakLevel = } - sn = 95; + sn = 90 + self.skill_sneak*0.5; //sneaking along a wall increases chance by 2% makevectors(self.angles); @@ -1358,16 +1360,9 @@ void() SneakLevel = if (r > 0 && r <= 600) { r = 600 - r; + q = 3 + (self.skill_sneak/5); - - if (self.class == 1) - sn = sn - r/3; - if (self.class == 2) - sn = sn - r/6; - if (self.class == 3) - sn = sn - r/3; - if (self.class == 4) - sn = sn - r/3; + sn = sn - r/q; } @@ -1431,6 +1426,8 @@ void() ArmorCheck = if (self.walk == 1) self.speedmulti = self.speedmulti * 0.50; + self.speedmulti = self.speedmulti*(1+(self.skill_sneak*0.01)); + //Armor if (aid == IID_ARM_DESERT) type = 0.10; @@ -1450,8 +1447,6 @@ void() ArmorCheck = type = 0.15; if (aid == IID_ARM_LPOWER) type = 0.50; - if (self.class == 3) - type += 0.10; if (self.rage == IID_CHEM_PSYCHO) type += 0.20; @@ -1506,15 +1501,9 @@ void () WeightControl = wt = wt + GetItemsWeight(self.islot16); self.weight = wt; + self.max_weight = 30; - if (self.class == 1) - self.max_weight = 40; - if (self.class == 2) - self.max_weight = 40; - if (self.class == 3) - self.max_weight = 60; - if (self.class == 4) - self.max_weight = 30; + self.max_weight = self.max_weight + self.skill_combat; }; @@ -1571,11 +1560,7 @@ void () PositionControl = if (self.maxspeed < 50) self.maxspeed = 50; - if (self.equipment_slot) - { - if ((ToIID(ItemInSlot(self, self.equipment_slot))) == IID_EQUIP_SPRINTKIT) - self.maxspeed = self.maxspeed*2; - } + }; .float clientcolors; @@ -1626,14 +1611,30 @@ void() PlayerPreThink = DisplayMenu (); return; } - else if (self.score >= 20 && self.currentmenu == "none") + else if (self.score >= 500 && self.score <= 1550 && self.currentmenu == "none") + { + self.score = self.score + 1; + } + else if (self.score >= 1551 && self.currentmenu == "none") { self.currentmenu = "gain_skill"; self.missionbrief = 2; DisplayMenu (); } + else if (self.score >= 200 && self.currentmenu == "none") + { + self.score = 500; + } + if ((self.skill_combat + self.skill_sneak + self.skill_doctor + self.skill_science) <= 5) + { + if (self.currentmenu == "none") + { + self.currentmenu = "gain_skill"; + return; + } + } @@ -2217,8 +2218,7 @@ void() ClientConnect = stuffcmd(self, "alias zoom impulse 60\n"); stuffcmd(self, "alias hostage impulse 65\n"); - stuffcmd(self, "alias stimpack \"cmd invuse superstims+stimpack+bandages\"\n"); - stuffcmd(self, "alias bandages \"cmd invuse bandages+superstims+stimpack\"\n"); + stuffcmd(self, "alias stimpack impulse 225\n"); stuffcmd(self, "alias equip \"cmd invuse 4\"\n"); stuffcmd(self, "alias q1 \"cmd invuse 5\"\n"); stuffcmd(self, "alias q2 \"cmd invuse 6\"\n"); diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 5faaab5c5..80675a8fb 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -134,20 +134,17 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = else if (attacker.classname == "player" && total_players == 2) damage = floor(damage * 0.90); - if (attacker.classname == "monster" && total_players == 4) - damage = floor(damage * 1.30); - if (attacker.classname == "monster" && total_players == 3) - damage = floor(damage * 1.20); - else if (attacker.classname == "monster" && total_players == 2) - damage = floor(damage * 1.10); + if (attacker.classname == "monster") + damage = floor(damage * 0.80); + //getting hurt is slightly painful to the score, play cautiously! if (attacker.classname == "monster" && targ.classname == "player") - targ.score = targ.score - 6; + targ.score = targ.score - 1; //flanking monsters awards points if (attacker.classname == "player" && targ.classname == "monster" && targ.enemy != attacker) - attacker.score = attacker.score + 5; + attacker.score = attacker.score + 1; //aimed shots awards points if (attacker.classname == "player" && targ.classname == "monster" && attacker.recoil <= 5) @@ -165,20 +162,20 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = dot = (vec * v_forward); if (dot > 0.3) - attacker.score = attacker.score + 5; + attacker.score = attacker.score + 1; } //attacking a team-mate is a HUGE penalty if (attacker.classname == "player" && targ.classname == "player") { - attacker.score = attacker.score - 25; + attacker.score = attacker.score - 3; sprint(attacker, 2, "you just shot a teammate! be careful!\n"); } //attacking a hostage is a HUGE penalty if (attacker.classname == "player" && targ.classname == "hostage") { - attacker.score = attacker.score - 25; + attacker.score = attacker.score - 3; sprint(attacker, 2, "you just shot a hostage! be careful!\n"); } @@ -333,7 +330,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = damage = (damage * 3); if (targ.classname == "monster") - attacker.score = attacker.score + 5; + attacker.score = attacker.score + 1; helm = targ.armortype; if (targ.helmet == 0) @@ -559,7 +556,7 @@ take = damage; while (te) { if (te.classname == "player") - te.score = te.score + 10; + te.score = te.score + 2; te = te.chain; } @@ -655,7 +652,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) J_Damage = damage = (damage * 3); if (targ.classname == "monster") - attacker.score = attacker.score + 5; + attacker.score = attacker.score + 1; helm = targ.armortype; if (targ.helmet == 0) @@ -949,7 +946,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage = damage = (damage * 3); if (targ.classname == "monster") - attacker.score = attacker.score + 5; + attacker.score = attacker.score + 1; helm = targ.armortype; if (targ.helmet == 0) diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 46d5125a9..8d75307e9 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -4,6 +4,7 @@ float PRINT_MEDIUM = 1; float show_inventory; float show_pipboy; +float show_trader; vector mousepos; @@ -34,6 +35,37 @@ float mouseisdown; #define CURSORSIZE 8 + + + + +void(vector pos, float slotno) TraderImage = +{ + local float it, mod_s, mod_e; + local string itname; + + + if (slotno == downslotnum && slotnum) + slotno = slotnum; + else if (slotno == slotnum && downslotnum) + slotno = downslotnum; + + if (slotno <= 20) + it = getstati(70+slotno); + + + itname = GetItemImage(ToIID(it)); + drawpic(pos, strcat("gui/", itname), IMGSIZEV, '1 1 1', 1); + + it = ToStatus(it); + if (it < 1) + return; + itname = ftos(it); + it = strlen(itname); + drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); +}; + + void(vector pos, float slotno) SlotImage = { local float it, mod_s, mod_e; @@ -71,9 +103,6 @@ void(vector pos, float slotno) SlotImage = itname = GetItemImage(ToIID(it)); drawpic(pos, strcat("gui/", itname), IMGSIZEV, '1 1 1', 1); - mod_s = getstati(70); - mod_e = getstati(71); - it = ToStatus(it); if (it < 1) return; @@ -118,18 +147,6 @@ void(vector pos, float slotno) SlotImageSmall = itname = GetItemImage(ToIID(it)); drawpic(pos, strcat("gui/", itname), IMGSIZEH, '1 1 1', 1); - mod_s = getstati(70); - mod_e = getstati(71); - - - if (it > 0) - { - if (mod_s == it) - drawstring(pos, "sil", '8 8 8', '1 1 1', 1); - - if (mod_e == it) - drawstring(pos, "ext", '8 8 8', '1 1 1', 1); - } it = ToStatus(it); if (it <= 1) @@ -358,6 +375,25 @@ void(vector pos, string image) Crosshair = }; +void() Trader_Draw = +{ + float width,height,lvl,bar; + vector w; + + width = cvar("vid_conwidth"); + height = cvar("vid_conheight"); + //w = '1 1 0'*height; + + + + + 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(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); +}; + void() Pipboy_Draw = { float width,height,lvl,bar; @@ -365,7 +401,7 @@ void() Pipboy_Draw = width = cvar("vid_conwidth"); height = cvar("vid_conheight"); - w = '1 1 0'*height; + @@ -429,14 +465,7 @@ void() Invent_Draw = local float slotofs; slotofs = sliderpos*(height - (IMGSIZEF*6)) + (IMGSIZEF*6); -/* - for (i = 6; i <= MAXSLOTS; i++) - { - SlotImage(((i*IMGSIZEF-slotofs) * '0 1 0'), i+1); -// itname = GetItemName(ToIID(it)); -// drawstring(toppos + ((i*8-slotofs) * '0 1 0'), strcat(itname, " (", ftos(ToStatus(it)), ")"), '8 8 0', '1 1 1', 1); - }*/ SlotImage('2 1 0'*IMGSIZEF, 5); SlotImage('2 2 0'*IMGSIZEF, 6); @@ -467,16 +496,6 @@ void() Invent_Draw = SlotImageSmall('1 12.5 0'*IMGSIZEK, 4); -/* - drawstring('120 72 0'+('4 0 0'*IMGSIZEF), " JUNK ", '8 8 8', '1 1 1', 1); - SlotImageSmall('112 80 0'+('4 0 0'*IMGSIZEF), 17); - SlotImageSmall('112 128 0'+('4 0 0'*IMGSIZEF), 18); - SlotImageSmall('112 176 0'+('4 0 0'*IMGSIZEF), 19); - SlotImageSmall('112 224 0'+('4 0 0'*IMGSIZEF), 20); - SlotImageSmall('96 80 0'+('5 0 0'*IMGSIZEF), 21); - SlotImageSmall('96 128 0'+('5 0 0'*IMGSIZEF), 22); - SlotImageSmall('96 176 0'+('5 0 0'*IMGSIZEF), 23); - SlotImageSmall('96 224 0'+('5 0 0'*IMGSIZEF), 24);*/ /* perki = GetPerkImage(getstati(60)); @@ -498,13 +517,7 @@ void() Invent_Draw = -/* - drawpic(('1 0 0'*IMGSIZEF), "gui/scrollup.jpg", '16 16 0', '1 1 1', 1); - for (i = 0; i < height; i+=16) - drawpic('1 0 0'*IMGSIZEF+'0 16 0'+i*'0 1 0', "gui/scrollbar.jpg", '16 16 0', '1 1 1', 1); - drawpic(('1 0 0'*IMGSIZEF)+(height-16)*'0 1 0', "gui/scrolldown.jpg", '16 16 0', '1 1 1', 1); - drawpic(('1 0 0'*IMGSIZEF)+'0 16 0'+sliderpos*(height-48)*'0 1 0', "gui/scrollbox.jpg", '16 16 0', '1 1 1', 1);*/ if (showcontextmenu) @@ -513,25 +526,11 @@ void() Invent_Draw = op = floor((mousepos_y - contextpos_y)/8); drawstring(contextpos + (0 * '0 8 0'), "use/reload", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1); - drawstring(contextpos + (1 * '0 8 0'), "put in hand", '8 8 0', '1 1 0' + (op!=1)*'0 0 1', 1); - if (getstati(108) == 0) - drawstring(contextpos + (2 * '0 8 0'), "drop", '8 8 0', '1 1 0' + (op!=2)*'0 0 1', 1); + drawstring(contextpos + (1 * '0 8 0'), "drop", '8 8 0', '1 1 0' + (op!=1)*'0 0 1', 1); + drawstring(contextpos + (2 * '0 8 0'), "mix", '8 8 0', '1 1 0' + (op!=2)*'0 0 1', 1); if (getstati(108) == 1) - drawstring(contextpos + (2 * '0 8 0'), "sell", '8 8 0', '1 1 0' + (op!=2)*'0 0 1', 1); - if (getstati(60) == 14 || getstati(59) == 14) - drawstring(contextpos + (3 * '0 8 0'), "mix chems", '8 8 0', '1 1 0' + (op!=3)*'0 0 1', 1); + drawstring(contextpos + (3 * '0 8 0'), "sell", '8 8 0', '1 1 0' + (op!=3)*'0 0 1', 1); - drawstring(contextpos + (4 * '0 8 0'), "build: flash bomb", '8 8 0', '1 1 0' + (op!=4)*'0 0 1', 1); - drawstring(contextpos + (5 * '0 8 0'), "build: frag grenade", '8 8 0', '1 1 0' + (op!=5)*'0 0 1', 1); - drawstring(contextpos + (6 * '0 8 0'), "build: stun grenade", '8 8 0', '1 1 0' + (op!=6)*'0 0 1', 1); - drawstring(contextpos + (7 * '0 8 0'), "build: silencer", '8 8 0', '1 1 0' + (op!=7)*'0 0 1', 1); - - if (getstati(63) == 4) - { - drawstring(contextpos + (8 * '0 8 0'), "build: scope", '8 8 0', '1 1 0' + (op!=8)*'0 0 1', 1); - drawstring(contextpos + (9 * '0 8 0'), "build: x-ray device", '8 8 0', '1 1 0' + (op!=9)*'0 0 1', 1); - drawstring(contextpos + (10 * '0 8 0'), "build: modification", '8 8 0', '1 1 0' + (op!=10)*'0 0 1', 1); - } } else { @@ -644,6 +643,10 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = { show_pipboy = !show_pipboy; } + if (param1 == 'b' && (getstati(108) == 1)) + { + show_trader = !show_trader; + } else if (!show_inventory) return false; else if (param1 == k_mouse1) @@ -672,7 +675,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = return false; return true; } - if (eventtype == 1 && show_inventory) //key up + if (eventtype == 1 && (show_inventory || show_trader || show_pipboy)) //key up { if (param1 == k_mouse1) { @@ -682,28 +685,12 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = if (op == 0) localcmd(strcat("cmd invuse ", ftos(slotnum), "\n")); - else if (op == 1) - localcmd(strcat("cmd invswap 1 ", ftos(slotnum), "\nimpulse 1\n")); - else if ((op == 2) && (getstati(108) == 0)) + else if ((op == 1)) localcmd(strcat("cmd invdrop ", ftos(slotnum), "\n")); - else if ((op == 2) && (getstati(108) == 1)) - localcmd(strcat("cmd invsell ", ftos(slotnum), "\n")); - else if (op == 3) + else if (op == 2) localcmd(strcat("cmd invmix ", ftos(slotnum), "\n")); - else if (op == 4) - localcmd("cmd create flash\n"); - else if (op == 5) - localcmd("cmd create grenade\n"); - else if (op == 6) - localcmd("cmd create stun\n"); - else if (op == 7) - localcmd("cmd create silencer\n"); - else if (op == 8) - localcmd("cmd create extender\n"); - else if (op == 9) - localcmd("cmd create xray\n"); - else if (op == 10) - localcmd("cmd create modify\n"); + else if ((op == 3) && (getstati(108) == 1)) + localcmd(strcat("cmd invsell ", ftos(slotnum), "\n")); showcontextmenu = false; } @@ -744,7 +731,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = return false; return true; } - if (eventtype == 2 && show_inventory) //mouse + if (eventtype == 2 && (show_inventory || show_trader || show_pipboy)) //mouse { mousepos_x += param1; mousepos_y += param2; diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index eb37e3d7a..bbbad3372 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -442,6 +442,8 @@ void(float do2d) CSQC_UpdateView = DrawScreen(); else if (getstati(109) == 0) DrawScreen(); + else if (show_trader) + Trader_Draw(); else if (show_inventory) Invent_Draw(); else if (show_pipboy) diff --git a/quakec/fallout2/dog.qc b/quakec/fallout2/dog.qc index ec7c1270a..8e945196a 100644 --- a/quakec/fallout2/dog.qc +++ b/quakec/fallout2/dog.qc @@ -343,6 +343,11 @@ void () woof_pain = { if (self.rtime > 0) { + if (random()*100<10) + { + remove(self); + return; + } self.health = 180; return; } diff --git a/quakec/fallout2/doors.qc b/quakec/fallout2/doors.qc index 5c1efdedf..9294bd0f7 100644 --- a/quakec/fallout2/doors.qc +++ b/quakec/fallout2/doors.qc @@ -8,6 +8,12 @@ void () door_go_up; void () door_blocked = { + if (other.classname == "treasure_chest") + { + remove(other); + return; + } + T_Damage (other, self, self, self.dmg); if ((self.wait >= MULTICAST_ALL)) { @@ -159,7 +165,8 @@ void () door_killed = void () OpenDoorBeep = { - local float r; + local float r,x; + r = range (self.enemy); @@ -175,9 +182,14 @@ void () OpenDoorBeep = else sound (self, CHAN_BODY, "items/lockpick2.wav", 1, ATTN_NORM); + + x = (2.51 - (2.5*(self.enemy.skill_sneak/30))); + + self.think = OpenDoorBeep; - self.nextthink = time + 0.5; - if (ToIID(other.islot4) == IID_EQUIP_TOOLKIT) + self.nextthink = time + x; + + if (ToIID(self.enemy.islot4) == IID_EQUIP_TOOLKIT) self.owner.owner.rtime = self.owner.owner.rtime + 3; else self.owner.owner.rtime = self.owner.owner.rtime + 1; @@ -256,32 +268,13 @@ void () door_touch = } else if (self.owner.items == IT_KEY2) { - if (other.class == 1) - { - sprint(other, 2, "the lock on this door is too complex for you.\n"); - sound (other, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); - return; - } - if (other.class == 2) - { + sprint(other, 2, "picking...\n"); other.attack_finished = time + 7; other.rtime = time + 7.5; SpawnOpenDoor(self, other); return; - } - if (other.class == 3) - { - sprint(other, 2, "the lock on this door is too complex for you.\n"); - sound (other, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); - return; - } - if (other.class == 4) - { - sprint(other, 2, "picking...\n"); - SpawnOpenDoor(self, other); - return; - } + } if (self.owner.items == IT_KEY1) sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); diff --git a/quakec/fallout2/hos.qc b/quakec/fallout2/hos.qc index b61197b9f..cc747ce7b 100644 --- a/quakec/fallout2/hos.qc +++ b/quakec/fallout2/hos.qc @@ -285,7 +285,7 @@ void (vector jojo) spawn_civilian = } } - te = findradius (self.origin, 30); + te = findradius (self.origin, 40); while (te) { if (te.classname == "player" || te.classname == "monster" && te.health > 0) diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 8e60cb560..d33099024 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -184,6 +184,18 @@ float(float slotno, float iid) FitsInSlot; .float xslot6; .float xslot7; .float xslot8; +.float xslot9; +.float xslot10; +.float xslot11; +.float xslot12; +.float xslot13; +.float xslot14; +.float xslot15; +.float xslot16; +.float xslot17; +.float xslot18; +.float xslot19; +.float xslot20; #define MAXSLOTS 24 @@ -604,7 +616,7 @@ slot_t(float slot) SlotField = return islot24; - bprint(PRINT_MEDIUM, "ERROR: Invalid slot number (", ftos(slot), ")\n"); + //bprint(PRINT_MEDIUM, "ERROR: Invalid slot number (", ftos(slot), ")\n"); return islot1; }; @@ -647,11 +659,11 @@ string(float iid) GetItemVModel = if (iid == IID_WP_JACKHAMMER) return "progs/v_jackhammer.mdl"; if (iid == IID_WP_MP9) - return "progs/v_ump.mdl"; + return "progs/v_mp9.mdl"; if (iid == IID_WP_MP7) return "progs/v_smg.mdl"; if (iid == IID_WP_MP9_S) - return "progs/v_ump.mdl"; + return "progs/v_mp9.mdl"; if (iid == IID_WP_MP7_S) return "progs/v_smg.mdl"; if (iid == IID_WP_RANGEMASTER) diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 7d938a498..2708d00a1 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -207,7 +207,7 @@ void() treasure_touch = { sound (self, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); sprint(other, 2, "this metal box is locked.\n"); - if (other.class == 2 || other.class == 4) + if (other.skill_sneak >= 1) { sprint(other, 2, "you may attempt to pick this\n"); sprint(other, 2, "by pressing your 'action' key\n"); @@ -539,7 +539,7 @@ void () OpenChestBeep = self.think = OpenChestBeep; - self.nextthink = time + 0.2+random()*0.4; + self.nextthink = time + 0.1+random()*0.4 + (0.02*self.enemy.skill_sneak); self.enemy.chest = self; self.enemy.currentmenu = "menu_lockpick"; @@ -929,6 +929,7 @@ void() buyzone1 = setsize (self, '-16 -16 -24', '16 16 32'); setorigin(self, self.origin + '0 0 24'); self.classname = "merchant"; + }; void() buyzone2 = diff --git a/quakec/fallout2/knight.qc b/quakec/fallout2/knight.qc index 2f21e509f..af52bf304 100644 --- a/quakec/fallout2/knight.qc +++ b/quakec/fallout2/knight.qc @@ -48,7 +48,7 @@ $frame deathb9 deathb10 deathb11 void() go_invisible = { setmodel (self, ""); - sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); }; void() go_visible = @@ -67,10 +67,7 @@ void() knight_stand7 =[ $stand7, knight_stand8 ] {ai_stand();}; void() knight_stand8 =[ $stand8, knight_stand9 ] {ai_stand();}; void() knight_stand9 =[ $stand9, knight_stand1 ] {ai_stand();}; -void() knight_walk1 =[ $walk1, knight_walk2 ] { -if (random() < 0.2) - sound (self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE); -ai_walk(3);}; +void() knight_walk1 =[ $walk1, knight_walk2 ] {ai_walk(3);}; void() knight_walk2 =[ $walk2, knight_walk3 ] {ai_walk(2);}; void() knight_walk3 =[ $walk3, knight_walk4 ] {ai_walk(3);}; void() knight_walk4 =[ $walk4, knight_walk5 ] {ai_walk(4);}; @@ -89,8 +86,6 @@ void() knight_walk14 =[ $walk14, knight_walk1 ] {ai_walk(3);}; void() knight_run1 =[ $runb1, knight_run2 ] { if ((random() < 0.6) && self.model != "") go_invisible(); -else if (random() < 0.2) - sound (self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE); ai_run(21);}; void() knight_run2 =[ $runb2, knight_run3 ] {ai_run(25);}; void() knight_run3 =[ $runb3, knight_run4 ] {ai_run(18);}; @@ -130,6 +125,16 @@ if (self.takedamage == DAMAGE_NO) return; } +local vector source, org, vec, dir; +local float weap, dot, tdam; +local string sdam; +makevectors (self.enemy.angles); +vec = normalize ((self.origin - self.enemy.origin)); +dot = (vec * v_forward); + +if (dot > 0.5) + return; + sound (self, CHAN_WEAPON, "knight/sword1.wav", 1, ATTN_NORM); ai_charge(0); go_visible(); @@ -247,7 +252,8 @@ void() knight_bow10 =[ $walk1, knight_walk1 ] {ai_turn();}; -void() knight_die1 =[ $death1, knight_die2 ] {}; +void() knight_die1 =[ $death1, knight_die2 ] +{go_visible();}; void() knight_die2 =[ $death2, knight_die3 ] {}; void() knight_die3 =[ $death3, knight_die4 ] {self.solid = SOLID_NOT;}; @@ -321,7 +327,7 @@ void() monster_knight = setsize (self, '-16 -16 -24', '16 16 40'); self.health = 75; - self.islot3 = SlotVal(IID_ARM_METAL, 1); + self.islot3 = SlotVal(IID_ARM_METAL, 1); self.armornoise = "weapons/ric1.wav"; self.th_stand = knight_stand1; self.th_walk = knight_walk1; diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index 55dc05bbd..d570d1f50 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -923,6 +923,9 @@ void() brotherhood_merchant = self.classname = "merchant"; self.think = shop_face; self.nextthink = time + 0.5; + + self.xslot1 = 412; + self.xslot2 = 413; }; void() brotherhood_sergeant = diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index 5e2e3d2ff..817c79f6e 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -949,8 +949,9 @@ void() W_PlayerMenu = sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); centerprint(self, "\n"); self.currentmenu = "none"; - //DisplayMenu(); - self.impulse = 1; + PutClientInServer(); + self.impulse = 0; + self.current_slot = 1; return; } else if (self.impulse == 1 && coop == 0) diff --git a/quakec/fallout2/plats.qc b/quakec/fallout2/plats.qc index 4a935b572..52d72dbd1 100644 --- a/quakec/fallout2/plats.qc +++ b/quakec/fallout2/plats.qc @@ -97,6 +97,13 @@ void() plat_outside_touch = if (other.classname != "player") return; + + if (other.classname == "treasure_chest") + { + remove(other); + return; + } + if (other.health <= 0) return; @@ -118,6 +125,12 @@ void() plat_crush = { //dprint ("plat_crush\n"); + if (other.classname == "treasure_chest") + { + remove(other); + return; + } + other.deathtype = "squish"; T_Damage (other, self, self, 1); @@ -225,6 +238,13 @@ void() func_train_find; void() train_blocked = { + + if (other.classname == "treasure_chest") + { + remove(other); + return; + } + if (time < self.attack_finished) return; self.attack_finished = time + 0.5; diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index a35260edf..fb7d66b8b 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -1378,6 +1378,11 @@ void () grunt_pain = if (self.rtime > 0) { + if (random()*100<10) + { + remove(self); + return; + } if (random()*100<50) sound (self, CHAN_VOICE, "player/headshot.wav", 0.75, ATTN_NORM); else diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 06d71c19b..b17285ae7 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -199,14 +199,15 @@ void(float damage, float dist, float rate) FireMelee = if (dot < 0.5 && trace_ent.takedamage) { - tdam = self.sneak*random()*3; + tdam = 10 + (15*self.skill_sneak); + if (getperk(7)) - tdam = self.sneak*random()*6; + tdam = tdam * 2; if (self.steadyaim == 0) - tdam = tdam * 5; + tdam = tdam + 10; - if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car" && (trace_ent.islot3 == 0 || self.critical == 3)) + if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car") SpawnBlood (org, 1); else SpawnNonBlood (org, 1); @@ -239,7 +240,7 @@ void(float damage, float dist, float rate) FireMelee = bprint(2, " assassinates "); bprint(2, trace_ent.netname); bprint(2, "!\n"); - self.score = self.score + 25; + self.score = self.score + 5; if (random()*4<2) sound (trace_ent, CHAN_WEAPON, "player/headshot.wav", 0.25, ATTN_IDLE); @@ -1620,11 +1621,11 @@ void() W_Attack = else if (weap == IID_WP_DKS1_S) FireAssaultRifle(35, 3, "weapons/moonlight1.wav", 5000, 0.25); else if (weap == IID_WP_WINCHESTER) - W_FireShotgun (2, 4, 8, 30, 1500, 0, "weapons/shotgun1.wav"); + W_FireShotgun (2, 5, 8, 50, 1500, 0, "weapons/shotgun1.wav"); else if (weap == IID_WP_MOSSBERG) - W_FireShotgun (2, 4, 8, 20, 2000, 1, "weapons/citykiller.wav"); + W_FireShotgun (2, 5, 7, 20, 2000, 1, "weapons/citykiller.wav"); else if (weap == IID_WP_JACKHAMMER) - W_FireShotgun (1, 4, 9, 25, 1750, 2, "weapons/citykiller.wav"); + W_FireShotgun (1, 5, 7, 30, 1750, 2, "weapons/citykiller.wav"); else if (weap == IID_WP_MP9) FireSMG(14, 0, "weapons/mp7.wav", 1500, 0.10); else if (weap == IID_WP_MP7) @@ -1758,7 +1759,7 @@ void() CheatCommand = { local float x; local string y; - +/* x = self.waterlevel; y = ftos(x); @@ -1766,8 +1767,8 @@ void() CheatCommand = sprint(self, 2, y); sprint(self, 2, "\n"); self.ammo_shells = 900; - self.score = 21; - + self.currentmenu = "gain_skill"; +*/ }; /* @@ -4227,14 +4228,28 @@ void () UseStimpack = { sprint(self, PRINT_MEDIUM, trace_ent.netname); sprint(self, PRINT_MEDIUM, " had no stims!\n"); - return; } - else + if (x >= 1) { - self.score = self.score + 50; + self.score = self.score + 5; sprint(self, PRINT_MEDIUM, trace_ent.netname); sprint(self, PRINT_MEDIUM, " had a stim. using it to heal.\n"); DecreaseDestroySlotOther(trace_ent, x);//take away a stimpack + return; + } + x = SlotOfItem(trace_ent, IID_CHEM_MEDICALBAG); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had no medical bag!\n"); + } + if (x >= 1) + { + self.score = self.score + 5; + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " had a stim. using it to heal.\n"); + DecreaseDestroySlotOther(trace_ent, x);//take away a stimpack + return; } } @@ -4645,9 +4660,7 @@ void () DisplayMenu = void () Special = { - if (self.class == 1) - UseMedicalBag(); - else + Sneak(); }; @@ -4946,7 +4959,7 @@ void () ExitScreen = sprint(self, 2, "lock is jammed.\n"); return; } - if (self.class != 2 && self.class != 4) + if (self.skill_sneak == 0) { sound (self, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); sprint(self, 2, "locked!\n"); @@ -4970,7 +4983,8 @@ void () ExitScreen = if (self.currentmenu != "none") return; - bprint (2, "hostage has been located.\n"); + bprint (2, "civilian has been located.\n"); + sound (trace_ent, CHAN_BODY, "misc/rescued.wav", 1, ATTN_NONE); rescue = rescue + 1; //remove(trace_ent); spawn_excla(trace_ent, 3000); @@ -5628,6 +5642,26 @@ 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 = te.chain; } @@ -5734,20 +5768,10 @@ void () CharacterSheet = sprint (self, PRINT_HIGH, "Score ‘ "); r1 = (self.score); - r2 = (self.kills); - if (r1 == 0) - r1 = 1; - ratio = (r2 / r1); x = ftos (r1); sprint (self, 2, x); - sprint (self, 2, " ("); - x = ftos (self.kills); - sprint (self, 2, x); - sprint (self, PRINT_HIGH, "/"); - x = ftos (self.dead); - sprint (self, 2, x); - sprint (self, 2, ") "); + sprint (self, PRINT_HIGH, "\nSpeed ‘ "); x = ftos (self.maxspeed); sprint (self, 2, x); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 13c2d84f0..e0ba0f080 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -68,12 +68,26 @@ void() SetupStats = clientstat(67, 2, map_ent1); clientstat(68, 2, map_ent2); clientstat(69, 2, map_ent3); - clientstat(70, 2, silencer); - clientstat(71, 2, extender); - clientstat(81, 2, skill_combat); - clientstat(82, 2, skill_doctor); - clientstat(83, 2, skill_sneak); - clientstat(84, 2, skill_science); + clientstat(71, 2, xslot1); + clientstat(72, 2, xslot2); + clientstat(73, 2, xslot3); + clientstat(74, 2, xslot4); + clientstat(75, 2, xslot5); + clientstat(76, 2, xslot6); + clientstat(77, 2, xslot7); + clientstat(78, 2, xslot8); + clientstat(79, 2, xslot9); + clientstat(80, 2, xslot10); + clientstat(81, 2, xslot11); + clientstat(82, 2, xslot12); + clientstat(83, 2, xslot13); + clientstat(84, 2, xslot14); + clientstat(85, 2, xslot15); + clientstat(86, 2, xslot16); + clientstat(87, 2, xslot17); + clientstat(88, 2, xslot18); + clientstat(89, 2, xslot19); + clientstat(90, 2, xslot20); clientstat(91, 2, islot17); clientstat(92, 2, islot18); clientstat(93, 2, islot19); @@ -83,14 +97,11 @@ void() SetupStats = clientstat(97, 2, islot23); clientstat(98, 2, islot24); clientstat(99, 2, recoil); - clientstat(100, 2, xslot1); - clientstat(101, 2, xslot2); - clientstat(102, 2, xslot3); - clientstat(103, 2, xslot4); - clientstat(104, 2, xslot5); - clientstat(105, 2, xslot6); - clientstat(106, 2, xslot7); - clientstat(107, 2, xslot8); + clientstat(81, 2, skill_combat); + clientstat(82, 2, skill_doctor); + clientstat(83, 2, skill_sneak); + clientstat(84, 2, skill_science); + clientstat(108, 2, safezone); clientstat(109, 2, connected); clientstat(110, 2, steadyaim); @@ -669,15 +680,12 @@ if (coop == 1) // Players vs Monsters te = find(te, classname, "player"); } -// if (pcount > 0) -// self.timer = self.timer + 0.5; - if (pcount == 0 && self.timer > 5) localcmd("restart\n"); if (world.map_obj == OBJ_HOSTAGE) { - time_left = time_left - 1; + //time_left = time_left - 1; te = find(world, classname, "rhostage"); while (te) @@ -1088,11 +1096,12 @@ if (coop == 1) // Players vs Monsters ze = find (ze, classname, "player"); } } - if (endgame_timer == 10) + if (endgame_timer >= 10) { localcmd("serverinfo objective return\n"); changelevel ("r_bunker"); } + endgame_timer = endgame_timer + 1; } if (pcount == 0 && pdead > 0) endgame_timer = endgame_timer + 1; @@ -1743,14 +1752,8 @@ void () RecoilControl = } - if (te.class == 1) - te.recoil = te.recoil - 0.20; - if (te.class == 2) - te.recoil = te.recoil - 0.20; - if (te.class == 3) - te.recoil = te.recoil - 0.25; - if (te.class == 4) - te.recoil = te.recoil - 0.15; + + te.recoil = te.recoil - (0.20+(te.skill_combat*0.005)); } else { @@ -1967,7 +1970,7 @@ void() worldspawn = precache_model ("progs/v_pipe.mdl"); precache_model ("progs/v_double.mdl"); precache_model ("progs/v_combat.mdl"); - precache_model ("progs/v_ump.mdl"); + precache_model ("progs/v_mp9.mdl"); precache_model ("progs/v_g11.mdl"); precache_model ("progs/v_ak47.mdl"); precache_model ("progs/v_acr.mdl"); @@ -2096,6 +2099,8 @@ void() worldspawn = precache_sound ("misc/hosdie1.wav"); precache_sound ("misc/hosdie2.wav"); + precache_sound ("misc/hosdown.wav"); + precache_sound ("misc/rescued.wav"); precache_sound ("player/gib1.wav"); precache_sound ("player/step1.wav"); diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index d485f4b8b..49449ac0c 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -524,6 +524,12 @@ void () zombie_death = { if (self.rtime > 0) { + if (random()*100<10) + { + remove(self); + return; + } + if (random()*100<50) sound (self, CHAN_VOICE, "player/headshot.wav", 0.75, ATTN_NORM); else @@ -925,13 +931,8 @@ void() monster_zombie = self.th_die = zombie_die; self.th_melee = zombie_melee; - if (world.map_obj == OBJ_DEADTOWN) - { - if (random()<0.5) - self.th_missile = zombie_missile; - } - else - self.th_missile = zombie_missile; + + self.th_missile = zombie_missile; self.angles_y = random()*360; @@ -939,12 +940,15 @@ void() monster_zombie = - if (random()<0.25 || world.map_obj == OBJ_DEADTOWN) - spawn_ghoul(self.origin); - if (world.map_obj == OBJ_DEADTOWN && random()<0.25) - spawn_ghoul(self.origin + '128 128 0'); - if (world.map_obj == OBJ_DEADTOWN && random()<0.25) - spawn_ghoul(self.origin + '128 0 0'); + + spawn_ghoul(self.origin + '-128 -128 0'); + spawn_ghoul(self.origin + '-128 0 0'); + spawn_ghoul(self.origin + '0 -128 0'); + spawn_ghoul(self.origin + '0 128 0'); + spawn_ghoul(self.origin + '128 0 0'); + spawn_ghoul(self.origin + '128 128 0'); + spawn_ghoul(self.origin + '-128 128 0'); + spawn_ghoul(self.origin + '128 -128 0'); if (random()<0.25 && world.map_obj == 1) spawn_civilian(self.origin); From 2ffd7f4b5f44477641c155a22ee9a2ce17188eb0 Mon Sep 17 00:00:00 2001 From: Magnus Date: Sat, 7 Nov 2009 10:41:46 +0000 Subject: [PATCH 13/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3424 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 3 +- quakec/fallout2/cmds.qc | 760 ++++++++++++++++++++++++++++++--- quakec/fallout2/csqc/invent.qc | 167 ++++++-- quakec/fallout2/inventory.qc | 216 +++++----- quakec/fallout2/misc.qc | 177 +++++++- quakec/fallout2/weapons.qc | 80 ++-- quakec/fallout2/world.qc | 12 +- quakec/fallout2/zombie.qc | 11 +- 8 files changed, 1186 insertions(+), 240 deletions(-) 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; From 3554c9c9e84d958d2155bf112f5b1f3b9f2dcc62 Mon Sep 17 00:00:00 2001 From: Magnus Date: Sat, 7 Nov 2009 13:28:20 +0000 Subject: [PATCH 14/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3425 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/cmds.qc | 28 ++++++++++++++++++++++ quakec/fallout2/inventory.qc | 45 ++++++++++++++++-------------------- quakec/fallout2/weapons.qc | 19 +++++++-------- 3 files changed, 58 insertions(+), 34 deletions(-) diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index aa29552c1..8f7613580 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -1022,7 +1022,35 @@ void(string arg1) Cmd_InvMix = sprint(self, PRINT_MEDIUM, "1 super stim created\n"); sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); } + else if ((iid1 == IID_WP_NEEDLER && iid2 == IID_WP_NEEDLER) || + (iid2 == IID_WP_NEEDLER && iid1 == IID_WP_NEEDLER)) + { + + + if (random()*100 > (self.skill_science*10)) + { + sprint(self, PRINT_MEDIUM, "your concoction exploded!\n"); + Explosion(); + return; + } + + 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; + } + + DecreaseDestroySlot(23); + DecreaseDestroySlot(24); + + SetItemSlot(self, x, SlotVal(IID_WP_ACR, 1)); + sprint(self, PRINT_MEDIUM, "Steyr ACR created\n"); + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + } else { sprint(self, PRINT_MEDIUM, "cannot merge items!\n"); diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 2a08b99dc..ce01a0e7d 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -561,6 +561,12 @@ float(entity e, float iid) FindSuitableEmptySlot = if (ToIID(e.islot16) == IID_NONE) if (FitsInSlot(16, iid)) return 16; + if (ToIID(e.islot15) == IID_NONE) + if (FitsInSlot(23, iid)) + return 23; + if (ToIID(e.islot16) == IID_NONE) + if (FitsInSlot(24, iid)) + return 24; } else if (IsJunk(iid)) { @@ -576,10 +582,6 @@ float(entity e, float iid) FindSuitableEmptySlot = return 21; if (ToIID(e.islot22) == IID_NONE) return 22; - if (ToIID(e.islot23) == IID_NONE) - return 23; - if (ToIID(e.islot24) == IID_NONE) - return 24; } return 0; }; @@ -635,10 +637,6 @@ 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; @@ -1510,31 +1508,31 @@ float(float iid) GetBaseValue = if (iid == IID_AM_NEEDLER) - return 1; + return 7; if (iid == IID_AM_2MMEC) - return 1; + return 15; if (iid == IID_AM_10MM) - return 1; + return 3; if (iid == IID_AM_556MM) - return 1; + return 5; if (iid == IID_AM_5MMHIGHVEL) - return 1; + return 4; if (iid == IID_AM_12GAUGESHELLS) - return 1; + return 4; if (iid == IID_AM_ENERGYCELL) - return 1; + return 12; if (iid == IID_AM_762MM) - return 1; + return 8; if (iid == IID_AM_44MAGNUM) - return 1; + return 6; if (iid == IID_AM_WARSAW) - return 1; + return 5; if (iid == IID_AM_45ACP) - return 1; + return 4; if (iid == IID_AM_ROCKET) - return 1; + return 30; if (iid == IID_AM_CASELESS) - return 1; + return 10; if (iid == IID_GREN_STUN) @@ -2332,10 +2330,7 @@ float(float slotno, float iid) FitsInSlot = return IsJunk(iid); if (slotno == 22) return IsJunk(iid); - if (slotno == 23) - return IsJunk(iid); - if (slotno == 24) - return IsJunk(iid); + return true; }; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index e7eed3f62..2c716199f 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1641,7 +1641,7 @@ void() W_Attack = else if (weap == IID_WP_AK112_M) FireAssaultRifle(16, 10, "weapons/ak112.wav", 4000, 0.095); else if (weap == IID_WP_ACR) - FireAssaultRifle(16, 7, "weapons/auto2.wav", 9000, 0.090); + FireAssaultRifle(16, 7, "weapons/ak112.wav", 9000, 0.090); else if (weap == IID_WP_AK74) FireAssaultRifle(20, 12, "ogre/ak47.wav", 3500, 0.090); else if (weap == IID_WP_DKS1) @@ -1766,6 +1766,7 @@ void() CheatCommand = self.islot18 = SlotVal(IID_MISC_NUKACOLA, 50); self.islot19 = SlotVal(IID_MISC_AEROSOL, 50); self.islot20 = SlotVal(IID_MISC_GUM, 50); + self.islot10 = SlotVal(IID_WP_ACR, 1); }; /* @@ -2548,9 +2549,9 @@ void () FlashExplode = { if (CanDamage (self, te)) { - te.flash = 4; - te.attack_finished = time + 4; - spawn_excla(te, 4); + te.flash = 12; + te.attack_finished = time + 12; + spawn_excla(te, 12); } } @@ -2561,9 +2562,9 @@ void () FlashExplode = te.missionbrief = 5; stuffcmd (te, "v_cshift 255 255 255 255\n"); stuffcmd (te, "v_idlescale 3\n"); - te.flash = time + 4; + te.flash = time + 12; - spawn_excla(te, 4); + spawn_excla(te, 12); } } te = te.chain; @@ -2580,9 +2581,9 @@ void () FlashExplode = if (dot > 0.3 && CanDamage (self, te)) { - te.flash = 4; - te.attack_finished = time + 4; - spawn_excla(te, 4); + te.flash = 12; + te.attack_finished = time + 12; + spawn_excla(te, 12); } } From 92fc87b9ff91236d3130c7b0844e76ae6cdb8db9 Mon Sep 17 00:00:00 2001 From: Magnus Date: Mon, 9 Nov 2009 04:48:58 +0000 Subject: [PATCH 15/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3429 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 130 ++++------------- quakec/fallout2/combat.qc | 63 ++++---- quakec/fallout2/csqc/invent.qc | 28 +++- quakec/fallout2/defs.qc | 1 - quakec/fallout2/enforcer.qc | 21 --- quakec/fallout2/inventory.qc | 260 ++++++++++++++++----------------- quakec/fallout2/items.qc | 93 ++++++++++++ quakec/fallout2/misc.qc | 42 +++--- quakec/fallout2/mod_buy.qc | 26 +--- quakec/fallout2/ogre.qc | 2 +- quakec/fallout2/player.qc | 8 +- quakec/fallout2/weapons.qc | 251 ++++++++++++++++--------------- quakec/fallout2/world.qc | 5 + 13 files changed, 470 insertions(+), 460 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index e3a497978..b55b76942 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -342,51 +342,19 @@ void() execute_changelevel = local entity pos; local float x; - intermission_running = 1; - -// enforce a wait time before allowing changelevel - intermission_exittime = time + 15; - - pos = FindIntermission (); - WriteByte (MSG_ALL, SVC_INTERMISSION); - WriteCoord (MSG_ALL, pos.origin_x); - WriteCoord (MSG_ALL, pos.origin_y); - WriteCoord (MSG_ALL, pos.origin_z); - WriteAngle (MSG_ALL, pos.mangle_x); - WriteAngle (MSG_ALL, pos.mangle_y); - WriteAngle (MSG_ALL, pos.mangle_z); - + localcmd("map r_bunker\n"); - x = ceil(random()*6); - - if (x == 1) - savemap = "hostage"; - if (x == 2) - savemap = "supplies"; - if (x == 3) - savemap = "shadow"; - if (x == 4) - savemap = "deadtown"; - if (x == 5) - savemap = "destroy"; - if (x == 6) - savemap = "defuse"; - - if (intermission_exittime < time) - localcmd("map r_bunker"); - - if (infokey(world, "objective") != "return" && infokey(world, "objective") != "start") - localcmd("serverinfo objective return\n"); - - self.nextthink = time + 1; }; void() changelevel_touch = { + if (coop == 0) + return; + if (other.classname != "player") return; @@ -446,7 +414,7 @@ void() changelevel_touch = // we can't move people right now, because touch functions are called // in the middle of C movement code, so set a think time to do it self.think = execute_changelevel; - self.nextthink = time + 0.1; + self.nextthink = time + 10; }; /*QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION @@ -519,6 +487,12 @@ entity() SelectSpawnPoint = numspots = 0; totalspots = 0; + + if (infokey(world, "coop") == "0") + coop = 0; + if (infokey(world, "coop") == "1") + coop = 1; + // testinfo_player_start is only found in regioned levels spot = find (world, classname, "testplayerstart"); @@ -527,8 +501,8 @@ entity() SelectSpawnPoint = spot = find (world, classname, "spawn3"); - if (spot) - ent1 = "spawn3"; + if (coop == 0) + ent1 = "info_player_deathmatch"; else ent1 = "info_player_coop"; @@ -709,6 +683,8 @@ void() PutClientInServer = self.equipment_slot = 0; + spawn_dot(self); + self.health = self.max_health; // oh, this is a hack! @@ -738,42 +714,6 @@ void() PutClientInServer = self.view_ofs = '0 0 22'; self.view2 = world; - if (world.model == "maps/r_bunker.bsp") - { - if (infokey(world, "objective") != "return") - { - if (self.ammo_shells == 300) - self.popup = 1; - else - self.popup = 2; - } - } - - if (world.model == "maps/r_bunker.bsp") - { - if (infokey(world, "objective") == "return") - { - if (self.score <= 0) - { - self.popup = 6; - } - if (self.score <= 400) - { - self.ammo_shells = self.ammo_shells + 25; - self.popup = 3; - } - else if (self.score <= 800) - { - self.ammo_shells = self.ammo_shells + 50; - self.popup = 4; - } - else - { - self.ammo_shells = self.ammo_shells + 75; - self.popup = 5; - } - } - } // Mod - Xian (May.20.97) // Bug where player would have velocity from their last kill @@ -840,6 +780,8 @@ void() PutClientInServer = } W_SetCurrentAmmo(); + stuffcmd(self, "sizeup\n"); + stuffcmd(self, "sizeup\n"); }; @@ -873,7 +815,6 @@ void() info_player_start2 = while (x > 0) { - bprint(2, "hi\n"); start = spawn(); setsize(start, '-16 -16 -24', '16 16 32'); setorigin(start, self.origin + '0 0 4'); @@ -905,7 +846,6 @@ potential spawning position for coop games */ void() info_player_coop = { - coop = 1; }; @@ -1373,7 +1313,7 @@ void() SneakLevel = //bulletproof shirt gives a 2% bonus to stealth st = ToIID(self.islot3); - if (st == IID_ARM_SHIRT) + if (st == IID_ARM_LEATHER) sn = sn + 2; //metal armor gives a large penalty to stealth @@ -1386,10 +1326,6 @@ void() SneakLevel = if (st == IID_ARM_LPOWER) sn = sn - 10; - //body snatcher allows for an automatic disguise - st = ToIID(self.islot3); - if (st == IID_ARM_DESERT) - sn = 99; //stealthboy allows for an automatic 10-second invisibility st = ToIID(self.islot4); @@ -1431,17 +1367,17 @@ void() ArmorCheck = //Armor if (aid == IID_ARM_DESERT) type = 0.10; - if (aid == IID_ARM_SHIRT) - type = 0.25; if (aid == IID_ARM_LEATHER) + type = 0.25; + if (aid == IID_ARM_VANDAL) type = 0.30; - if (aid == IID_ARM_KEVLAR) - type = 0.50; if (aid == IID_ARM_METAL) + type = 0.50; + if (aid == IID_ARM_TESLA) type = 0.25; if (aid == IID_ARM_COMBAT) type = 0.40; - if (aid == IID_ARM_BROTHERHOOD) + if (aid == IID_ARM_SEVA) type = 0.45; if (aid == IID_ARM_FORCE) type = 0.15; @@ -1451,24 +1387,24 @@ void() ArmorCheck = type += 0.20; - if (aid <= IID_ARM_KEVLAR) + if (aid <= IID_ARM_METAL) self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1); - else if (aid <= IID_ARM_BROTHERHOOD) + else if (aid <= IID_ARM_SEVA) 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 == IID_ARM_SHIRT) - self.armornoise = "misc/thud.wav"; if (aid == IID_ARM_LEATHER) self.armornoise = "misc/thud.wav"; - if (aid == IID_ARM_KEVLAR) + if (aid == IID_ARM_VANDAL) self.armornoise = "misc/thud.wav"; if (aid == IID_ARM_METAL) + self.armornoise = "misc/thud.wav"; + if (aid == IID_ARM_TESLA) self.armornoise = "weapons/ric1.wav"; if (aid == IID_ARM_COMBAT) self.armornoise = "misc/thud.wav"; - if (aid == IID_ARM_BROTHERHOOD) + if (aid == IID_ARM_SEVA) self.armornoise = "misc/thud.wav"; if (aid == IID_ARM_FORCE) self.armornoise = "misc/laserdef.wav"; @@ -1541,10 +1477,6 @@ void () PositionControl = else self.maxspeed = 50; - if (self.health <= (self.max_health*0.20) && random()<0.05) - sound (self, CHAN_AUTO, "player/paina.wav", 1, ATTN_NORM); - else if (self.health <= (self.max_health*0.20) && random()<0.05) - sound (self, CHAN_AUTO, "player/painb.wav", 1, ATTN_NORM); if (getperk(2)) self.maxspeed = self.maxspeed*1.10; @@ -1964,7 +1896,7 @@ void() CheckPowerups = self.modelindex = modelindex_player; if (self.position == 2) self.modelindex = modelindex_prone; - if (self.sneak == 1 || self.sneak == 3 && coop == 0) + if (self.sneak > 0 && coop == 0) self.modelindex = modelindex_gone; if (self.sneak > 0 && coop == 1) self.modelindex = modelindex_sneak; @@ -2778,7 +2710,7 @@ void() Identify = tmp = ToIID(trace_ent.islot3); if (tmp == 0) c2 = "natural armor"; - else if (tmp == IID_ARM_SHIRT) + else if (tmp == IID_ARM_LEATHER) c2 = "lightly armored"; else c2 = GetItemName(ToIID(trace_ent.islot3)); diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 80675a8fb..6ee2d327a 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -355,13 +355,14 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = } } - if (damage <= 0) + if (damage <= 0 && (attacker.classname == "monster" || attacker.classname == "player")) { damage = 0; sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); return; } + if (attacker.classname == "monster" || attacker.classname == "player") sound (targ, CHAN_ITEM, targ.armornoise, 1, ATTN_NORM); @@ -449,25 +450,25 @@ take = damage; switch(ToIID(targ.islot3)) { case IID_ARM_DESERT: - take -= 1; - break; - case IID_ARM_SHIRT: - take -= 1; + take -= 2; break; case IID_ARM_LEATHER: - take -= 5; - break; - case IID_ARM_KEVLAR: take -= 3; break; + case IID_ARM_VANDAL: + take -= 4; + break; case IID_ARM_METAL: + take -= 5; + break; + case IID_ARM_TESLA: take -= 9; break; case IID_ARM_COMBAT: - take -= 7; + take -= 6; break; - case IID_ARM_BROTHERHOOD: - take -= 10; + case IID_ARM_SEVA: + take -= 8; break; case IID_ARM_FORCE: take -= 13; @@ -481,22 +482,22 @@ take = damage; switch(ToIID(targ.islot3)) { - case IID_ARM_SHIRT: + case IID_ARM_LEATHER: take = take * 0.80; break; - case IID_ARM_LEATHER: + case IID_ARM_VANDAL: take = take * 0.70; break; - case IID_ARM_KEVLAR: + case IID_ARM_METAL: take = take * 0.50; break; - case IID_ARM_METAL: + case IID_ARM_TESLA: take = take * 0.65; break; case IID_ARM_COMBAT: take = take * 0.60; break; - case IID_ARM_BROTHERHOOD: + case IID_ARM_SEVA: take = take * 0.55; break; case IID_ARM_FORCE: @@ -782,22 +783,22 @@ take = damage; case IID_ARM_DESERT: take -= 1; break; - case IID_ARM_SHIRT: + case IID_ARM_LEATHER: take -= 1; break; - case IID_ARM_LEATHER: - take -= 10; - break; - case IID_ARM_KEVLAR: - take -= 5; + case IID_ARM_VANDAL: + take -= 15; break; case IID_ARM_METAL: + take -= 10; + break; + case IID_ARM_TESLA: take -= 25; break; case IID_ARM_COMBAT: take -= 20; break; - case IID_ARM_BROTHERHOOD: + case IID_ARM_SEVA: take -= 20; break; case IID_ARM_FORCE: @@ -812,22 +813,22 @@ take = damage; switch(ToIID(targ.islot3)) { - case IID_ARM_SHIRT: + case IID_ARM_LEATHER: take = take * 0.70; break; - case IID_ARM_LEATHER: + case IID_ARM_VANDAL: take = take * 0.60; break; - case IID_ARM_KEVLAR: + case IID_ARM_METAL: take = take * 0.40; break; - case IID_ARM_METAL: + case IID_ARM_TESLA: take = take * 0.55; break; case IID_ARM_COMBAT: take = take * 0.50; break; - case IID_ARM_BROTHERHOOD: + case IID_ARM_SEVA: take = take * 0.45; break; case IID_ARM_FORCE: @@ -1062,7 +1063,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage = case IID_ARM_METAL: take -= 1; break; - case IID_ARM_BROTHERHOOD: + case IID_ARM_SEVA: take -= 1; break; case IID_ARM_FORCE: @@ -1080,7 +1081,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage = case IID_ARM_LEATHER: take = take * 0.90; break; - case IID_ARM_KEVLAR: + case IID_ARM_VANDAL: take = take * 0.75; break; case IID_ARM_METAL: @@ -1089,7 +1090,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) X_Damage = case IID_ARM_COMBAT: take = take * 0.90; break; - case IID_ARM_BROTHERHOOD: + case IID_ARM_SEVA: take = take * 0.80; break; case IID_ARM_LPOWER: diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index c6d4e8a6e..83c23a3ab 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -440,10 +440,9 @@ void() Trader_Draw = if (showcontextmenu && show_trader) { - drawfill(contextpos - '8 8 0', '88 24 0'+'96 96 0', '0 0 0', 0.9); - + drawfill(contextpos - '8 8 0', '48 48 0', '0 0 0', 1.0); 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', + drawstring(contextpos + '0 8 0', "buy?", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1); } @@ -522,7 +521,7 @@ void() Pipboy_Draw = void() Invent_Draw = { - local float i; + local float i, check; local float it; local string itname, s1, s2, s3, s4, s5, s6, s7, s8, s9, perki, perk2i, p1, p2, pn, pd; local float op; @@ -552,9 +551,24 @@ void() Invent_Draw = SlotImage('3 5 0'*IMGSIZEF, 15); SlotImage('3 6 0'*IMGSIZEF, 16); - SlotImage('5.5 1 0'*IMGSIZEF, 1); - SlotImage('5.5 2 0'*IMGSIZEF, 2); - SlotImage('5.5 3 0'*IMGSIZEF, 3); + check = getstati(32); + if (check > 0) + SlotImage('5.5 1 0'*IMGSIZEF, 1); + else + drawpic('5.5 1 0'*IMGSIZEF, "gui/pipboy/weapon1.png", IMGSIZEV, '1 1 1', 1); + + check = getstati(33); + if (check > 0) + SlotImage('5.5 2 0'*IMGSIZEF, 2); + else + drawpic('5.5 2 0'*IMGSIZEF, "gui/pipboy/weapon2.png", IMGSIZEV, '1 1 1', 1); + + check = getstati(34); + if (check > 0) + SlotImage('5.5 3 0'*IMGSIZEF, 3); + else + drawpic('5.5 3 0'*IMGSIZEF, "gui/pipboy/armor.png", IMGSIZEV, '1 1 1', 1); + SlotImageSmall('1 3 0'*IMGSIZEK, 17); SlotImageSmall('1 4 0'*IMGSIZEK, 18); diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 323173b71..5e6e42c16 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -40,7 +40,6 @@ float total_monsters; float found_secrets; // number of secrets found float killed_monsters; // number of monsters killed - // spawnparms are used to encode information about clients across server // level changes float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16; diff --git a/quakec/fallout2/enforcer.qc b/quakec/fallout2/enforcer.qc index d1f8239da..bc7a41dad 100644 --- a/quakec/fallout2/enforcer.qc +++ b/quakec/fallout2/enforcer.qc @@ -409,27 +409,6 @@ void() enf_die = DropMoney(); - if (self.weapon == 3) - { - DropFromChest(self, IID_WP_MP7_S, self.mag1); - DropFromChest(self, IID_AM_5MMHIGHVEL, 30+random()*30); - } - else if (self.weapon == 4) - { - DropFromChest(self, IID_WP_AK112, self.mag1); - DropFromChest(self, IID_AM_5MMHIGHVEL, 24+random()*24); - } - else if (self.weapon == 5) - { - DropFromChest(self, IID_WP_AK74, self.mag1); - DropFromChest(self, IID_AM_WARSAW, 30+random()*30); - } - else if (self.weapon == 6) - { - DropFromChest(self, IID_WP_MOONLIGHT, self.mag1); - DropFromChest(self, IID_AM_556MM, 30+random()*30); - } - self.solid = SOLID_NOT; spawn_live_enforcer(self.origin, self.angles); remove(self); diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index ce01a0e7d..737dbbcda 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -11,7 +11,7 @@ float IID_NONE = 0; //the ammoless weapons float IID_WP_WRENCH = 399; float IID_WP_KNIFE = 400; -float IID_WP_AXE = 401; +float IID_WP_SLEDGE = 401; float IID_WP_SPEAR = 402; float IID_WP_POWERAXE = 403; @@ -24,8 +24,8 @@ float IID_WP_ALIENBLASTER = 408; float IID_WP_WINCHESTER = 409; float IID_WP_MOSSBERG = 410; float IID_WP_JACKHAMMER = 411; -float IID_WP_MP9 = 412; -float IID_WP_MP7 = 413; +float IID_WP_GREASEGUN = 412; +float IID_WP_MP9 = 413; float IID_WP_RANGEMASTER = 414; float IID_WP_AK112 = 415; float IID_WP_AK74 = 416; @@ -34,8 +34,8 @@ float IID_WP_MOONLIGHT = 418; float IID_WP_G11 = 419; float IID_WP_GLOCK_S = 420; float IID_WP_USP_S = 421; -float IID_WP_MP9_S = 422; -float IID_WP_MP7_S = 423; +float IID_WP_GREASEGUN_S = 422; +float IID_WP_MP9_S = 423; float IID_WP_PIPERIFLE = 424; float IID_WP_PIPERIFLE_R = 425; float IID_WP_PIPERIFLE_S = 426; @@ -85,12 +85,12 @@ float IID_GREN_FLARE = 106; //armour #define IsArmor(iid) (iid >= IID_ARM_DESERT && iid <= IID_ARM_LPOWER) float IID_ARM_DESERT = 200; -float IID_ARM_SHIRT = 201; -float IID_ARM_LEATHER = 202; -float IID_ARM_KEVLAR = 203; -float IID_ARM_METAL = 204; +float IID_ARM_LEATHER = 201; +float IID_ARM_VANDAL = 202; +float IID_ARM_METAL = 203; +float IID_ARM_TESLA = 204; float IID_ARM_COMBAT = 205; -float IID_ARM_BROTHERHOOD = 206; +float IID_ARM_SEVA = 206; float IID_ARM_FORCE = 207; float IID_ARM_LPOWER = 208; @@ -651,7 +651,7 @@ string(float iid) GetItemVModel = return "progs/v_span.mdl"; if (iid == IID_WP_KNIFE) return "progs/v_knife.mdl"; - if (iid == IID_WP_AXE) + if (iid == IID_WP_SLEDGE) return "progs/v_axe.mdl"; if (iid == IID_WP_SPEAR) return "progs/v_spear.mdl"; @@ -680,13 +680,13 @@ string(float iid) GetItemVModel = if (iid == IID_WP_JACKHAMMER) return "progs/v_jackhammer.mdl"; + if (iid == IID_WP_GREASEGUN) + return "progs/v_mp9.mdl"; if (iid == IID_WP_MP9) - return "progs/v_mp9.mdl"; - if (iid == IID_WP_MP7) return "progs/v_smg.mdl"; - if (iid == IID_WP_MP9_S) + if (iid == IID_WP_GREASEGUN_S) return "progs/v_mp9.mdl"; - if (iid == IID_WP_MP7_S) + if (iid == IID_WP_MP9_S) return "progs/v_smg.mdl"; if (iid == IID_WP_RANGEMASTER) return "progs/v_rangem.mdl"; @@ -745,7 +745,7 @@ string(float iid) GetItemWModel = return "progs/w_knife.mdl"; if (iid == IID_WP_WRENCH) return "progs/w_span.mdl"; - if (iid == IID_WP_AXE) + if (iid == IID_WP_SLEDGE) return "progs/w_knife.mdl"; if (iid == IID_WP_SPEAR) return "progs/w_spear.mdl"; @@ -777,13 +777,13 @@ string(float iid) GetItemWModel = if (iid == IID_WP_JACKHAMMER) return "progs/w_jackhammer.mdl"; + if (iid == IID_WP_GREASEGUN) + return "progs/w_mp9.mdl"; if (iid == IID_WP_MP9) - return "progs/w_mp9.mdl"; - if (iid == IID_WP_MP7) return "progs/w_mp5.mdl"; - if (iid == IID_WP_MP9_S) + if (iid == IID_WP_GREASEGUN_S) return "progs/w_mp9.mdl"; - if (iid == IID_WP_MP7_S) + if (iid == IID_WP_MP9_S) return "progs/w_mp7.mdl"; if (iid == IID_WP_RANGEMASTER) return "progs/w_rangem.mdl"; @@ -899,13 +899,13 @@ float(float iid) WeaponAmmoType = return IID_AM_12GAUGESHELLS; if (iid == IID_WP_JACKHAMMER) return IID_AM_12GAUGESHELLS; + if (iid == IID_WP_GREASEGUN) + return IID_AM_45ACP; if (iid == IID_WP_MP9) - return IID_AM_45ACP; - if (iid == IID_WP_MP7) return IID_AM_10MM; - if (iid == IID_WP_MP9_S) + if (iid == IID_WP_GREASEGUN_S) return IID_AM_45ACP; - if (iid == IID_WP_MP7_S) + if (iid == IID_WP_MP9_S) return IID_AM_10MM; if (iid == IID_WP_RANGEMASTER) return IID_AM_556MM; @@ -976,13 +976,13 @@ float(float iid) WeaponMagQuant = return 12; if (iid == IID_WP_JACKHAMMER) return 20; + if (iid == IID_WP_GREASEGUN) + return 25; if (iid == IID_WP_MP9) - return 25; - if (iid == IID_WP_MP7) return 30; - if (iid == IID_WP_MP9_S) + if (iid == IID_WP_GREASEGUN_S) return 25; - if (iid == IID_WP_MP7_S) + if (iid == IID_WP_MP9_S) return 30; if (iid == IID_WP_RANGEMASTER) return 10; @@ -1030,7 +1030,7 @@ float(float iid) GetItemWeight = return 0; if (iid == IID_WP_KNIFE) return 1; - if (iid == IID_WP_AXE) + if (iid == IID_WP_SLEDGE) return 8; if (iid == IID_WP_SPEAR) return 8; @@ -1060,14 +1060,14 @@ float(float iid) GetItemWeight = return 5; if (iid == IID_WP_JACKHAMMER) return 6; + if (iid == IID_WP_GREASEGUN) + return 3; + if (iid == IID_WP_GREASEGUN_S) + return 3; if (iid == IID_WP_MP9) return 3; if (iid == IID_WP_MP9_S) return 3; - if (iid == IID_WP_MP7) - return 3; - if (iid == IID_WP_MP7_S) - return 3; if (iid == IID_WP_RANGEMASTER) return 5; if (iid == IID_WP_RANGEMASTER_SCOPE) @@ -1106,20 +1106,20 @@ float(float iid) GetItemWeight = return 25; - if (iid == IID_ARM_SHIRT) - return 3; if (iid == IID_ARM_LEATHER) return 5; - if (iid == IID_ARM_KEVLAR) - return 9; + if (iid == IID_ARM_VANDAL) + return 10; if (iid == IID_ARM_METAL) - return 15; - if (iid == IID_ARM_COMBAT) + return 20; + if (iid == IID_ARM_TESLA) return 12; - if (iid == IID_ARM_BROTHERHOOD) - return 17; + if (iid == IID_ARM_COMBAT) + return 14; + if (iid == IID_ARM_SEVA) + return 16; if (iid == IID_ARM_FORCE) - return 6; + return 9; if (iid == IID_ARM_LPOWER) return 20; @@ -1164,7 +1164,7 @@ string(float iid) GetItemName = return "WRENCH"; if (iid == IID_WP_KNIFE) return "knife"; - if (iid == IID_WP_AXE) + if (iid == IID_WP_SLEDGE) return "axe"; if (iid == IID_WP_SPEAR) return "spear"; @@ -1209,14 +1209,10 @@ string(float iid) GetItemName = return "mossberg (12g)"; if (iid == IID_WP_JACKHAMMER) return "jackhammer (12g)"; - if (iid == IID_WP_MP9) - return "h&k ump (.45 acp)"; - if (iid == IID_WP_MP9_S) - return "h&k ump (silenced)"; - if (iid == IID_WP_MP7) - return "h&k mp10 (10mm)"; - if (iid == IID_WP_MP7_S) - return "h&k mp10 (silenced)"; + if (iid == IID_WP_GREASEGUN) + return "grease gun (.45 acp)"; + if (iid == IID_WP_GREASEGUN) + return "mp9 (10mm)"; if (iid == IID_WP_RANGEMASTER) return "rangemaster (5.56mm)"; if (iid == IID_WP_RANGEMASTER_SCOPE) @@ -1298,18 +1294,18 @@ string(float iid) GetItemName = if (iid == IID_ARM_DESERT) return "desert armor"; - if (iid == IID_ARM_SHIRT) - return "kevlar shirt"; if (iid == IID_ARM_LEATHER) return "leather armor"; - if (iid == IID_ARM_KEVLAR) - return "double kevlar"; + if (iid == IID_ARM_VANDAL) + return "vandal armor"; if (iid == IID_ARM_METAL) - return "ceramic armor"; + return "metal armor"; + if (iid == IID_ARM_TESLA) + return "tesla armor"; if (iid == IID_ARM_COMBAT) return "combat armor"; - if (iid == IID_ARM_BROTHERHOOD) - return "brotherhood armor"; + if (iid == IID_ARM_SEVA) + return "seva suit"; if (iid == IID_ARM_FORCE) return "force armor"; if (iid == IID_ARM_LPOWER) @@ -1416,7 +1412,7 @@ float(float iid) GetBaseValue = return 5; if (iid == IID_WP_KNIFE) return 5; - if (iid == IID_WP_AXE) + if (iid == IID_WP_SLEDGE) return 15; if (iid == IID_WP_SPEAR) return 25; @@ -1460,13 +1456,13 @@ float(float iid) GetBaseValue = return 150; if (iid == IID_WP_JACKHAMMER) return 250; - if (iid == IID_WP_MP9) + if (iid == IID_WP_GREASEGUN) return 100; - if (iid == IID_WP_MP9_S) + if (iid == IID_WP_GREASEGUN_S) return 125; - if (iid == IID_WP_MP7) + if (iid == IID_WP_MP9) return 110; - if (iid == IID_WP_MP7_S) + if (iid == IID_WP_MP9_S) return 125; if (iid == IID_WP_RANGEMASTER) return 80; @@ -1536,30 +1532,30 @@ float(float iid) GetBaseValue = if (iid == IID_GREN_STUN) - return 1; + return 5; if (iid == IID_GREN_FRAG) - return 1; + return 10; if (iid == IID_GREN_EMP) - return 1; + return 15; if (iid == IID_GREN_SMOKE) - return 1; + return 5; if (iid == IID_GREN_FLASH) - return 1; + return 5; if (iid == IID_ARM_DESERT) return 45; - if (iid == IID_ARM_SHIRT) - return 50; if (iid == IID_ARM_LEATHER) + return 50; + if (iid == IID_ARM_VANDAL) return 90; - if (iid == IID_ARM_KEVLAR) - return 125; if (iid == IID_ARM_METAL) return 100; + if (iid == IID_ARM_TESLA) + return 175; if (iid == IID_ARM_COMBAT) return 300; - if (iid == IID_ARM_BROTHERHOOD) + if (iid == IID_ARM_SEVA) return 350; if (iid == IID_ARM_FORCE) return 500; @@ -1610,31 +1606,31 @@ float(float iid) GetBaseValue = return 10; if (iid == IID_MISC_JUNK) - return 0; + return 1; if (iid == IID_MISC_NUKACOLA) - return 0; + return 1; if (iid == IID_MISC_CHEMICALS) - return 0; + return 2; if (iid == IID_MISC_AEROSOL) - return 0; + return 2; if (iid == IID_MISC_RDXCRYSTAL) - return 0; + return 3; if (iid == IID_MISC_STEELPIPE) - return 0; + return 1; if (iid == IID_MISC_DUCKTAPE) - return 0; + return 1; if (iid == IID_MISC_LCD) - return 0; + return 2; if (iid == IID_MISC_CIRCUITBOARD) - return 0; + return 2; if (iid == IID_MISC_COPPERWIRE) - return 0; + return 1; if (iid == IID_MISC_HMXCOMPOUND) - return 0; + return 1; if (iid == IID_MISC_GUM) - return 0; + return 2; if (iid == IID_MISC_XRAYTUBE) - return 0; + return 5; bprint(PRINT_MEDIUM, ftos(iid), " without a sell price!\n"); @@ -1651,7 +1647,7 @@ string(float iid) GetItemDesc = return "a heavy multi-function wrench"; if (iid == IID_WP_KNIFE) return "great for stealth attacks"; - if (iid == IID_WP_AXE) + if (iid == IID_WP_SLEDGE) return "a futuristic battle axe"; if (iid == IID_WP_SPEAR) return "a long, sharp polearm"; @@ -1696,13 +1692,13 @@ string(float iid) GetItemDesc = return "semi-auto combat shotgun, magazine fed"; if (iid == IID_WP_JACKHAMMER) return "the ultimate for close range battles"; + if (iid == IID_WP_GREASEGUN) + return "higher recoil due to larger .45 acp round"; + if (iid == IID_WP_GREASEGUN_S) + return "higher recoil due to larger .45 acp round"; if (iid == IID_WP_MP9) - return "higher recoil due to larger .45 acp round"; - if (iid == IID_WP_MP9_S) - return "higher recoil due to larger .45 acp round"; - if (iid == IID_WP_MP7) return "great all-around weapon; good burst fire"; - if (iid == IID_WP_MP7_S) + if (iid == IID_WP_MP9_S) return "silenced 10mm smg; less recoil"; if (iid == IID_WP_RANGEMASTER) return "civilian battle rifle. sturdy and effective"; @@ -1782,22 +1778,22 @@ string(float iid) GetItemDesc = if (iid == IID_ARM_DESERT) return "the light armor of a raider; makes a great disguise"; - if (iid == IID_ARM_SHIRT) - return "featherweight body armor with good stealth and mobility"; if (iid == IID_ARM_LEATHER) - return "made of thick, tanned brahmin hide"; - if (iid == IID_ARM_KEVLAR) - return "a suit of dragon skin(tm), reduces all damage to blunt trauma"; + return "lightweight leather armor. provides great mobility."; + if (iid == IID_ARM_VANDAL) + return "enhanced leather armor for extra protection."; if (iid == IID_ARM_METAL) - return "metal plates deflect smaller attacks easily"; + return "gives great protection at a sacrifice to speed."; + if (iid == IID_ARM_TESLA) + return "experimental armor with high deflection but low absorb."; if (iid == IID_ARM_COMBAT) - return "made from defensive polymers, the yardstick of armors"; - if (iid == IID_ARM_BROTHERHOOD) - return "enhanced combat armor with anti-explosive plating"; + return "this all-purpose armor is designed for combat missions."; + if (iid == IID_ARM_SEVA) + return "high-tech suit provides more environmental defense"; if (iid == IID_ARM_FORCE) return "experimental energy-field armor, very low absorb"; if (iid == IID_ARM_LPOWER) - return "this heavy armor contains servos that assist with movement"; + return "the heaviest armor with great protection"; if (iid == IID_CHEM_STIMPACK) @@ -1896,7 +1892,7 @@ string(float iid) GetItemImage = return "wrench.jpg"; if (iid == IID_WP_KNIFE) return "knife.jpg"; - if (iid == IID_WP_AXE) + if (iid == IID_WP_SLEDGE) return "disruptor.jpg"; if (iid == IID_WP_SPEAR) return "spear.jpg"; @@ -1927,30 +1923,26 @@ string(float iid) GetItemImage = return "citykiller.jpg"; if (iid == IID_WP_JACKHAMMER) return "jackhammer.jpg"; + if (iid == IID_WP_GREASEGUN) + return "ggun2.jpg"; if (iid == IID_WP_MP9) return "mp9.jpg"; - if (iid == IID_WP_MP7) - return "ggun.jpg"; - if (iid == IID_WP_MP9_S) - return "mp9.jpg"; - if (iid == IID_WP_MP7_S) - return "ggun.jpg"; if (iid == IID_WP_RANGEMASTER) - return "rangem.jpg"; + return "rangem.png"; if (iid == IID_WP_RANGEMASTER_SCOPE) return "rangem_s.jpg"; if (iid == IID_WP_AK47) return "ak47.jpg"; if (iid == IID_WP_AK112) - return "ak112.jpg"; + return "ak112.png"; if (iid == IID_WP_AK112_M) - return "ak112.jpg"; + return "ak112.png"; if (iid == IID_WP_AK74) return "ak47.jpg"; if (iid == IID_WP_ACR) return "acr.jpg"; if (iid == IID_WP_DKS1) - return "dks1.jpg"; + return "dks1.png"; if (iid == IID_WP_DKS1_S) return "dks1_s.jpg"; if (iid == IID_WP_MOONLIGHT) @@ -1960,15 +1952,15 @@ string(float iid) GetItemImage = if (iid == IID_WP_GAUSERIFLE) return "grifle.jpg"; if (iid == IID_WP_PULSERIFLE) - return "plasmar.jpg"; + return "plasma.jpg"; if (iid == IID_WP_TURBOPLASMA) - return "turbo.jpg"; + return "plasma.jpg"; if (iid == IID_WP_PULSERIFLE) return "carbine.jpg"; if (iid == IID_WP_FNFAL) return "fnfal.jpg"; if (iid == IID_WP_ROCKETLAUNCHER) - return "rpg.jpg"; + return "rocket.jpg"; if (iid == IID_WP_LASERGATLING) return "gatling.jpg"; @@ -1980,7 +1972,7 @@ string(float iid) GetItemImage = if (iid == IID_AM_10MM) return "10mm.jpg"; if (iid == IID_AM_556MM) - return "556mm.jpg"; + return "556mm.png"; if (iid == IID_AM_5MMHIGHVEL) return "5mmhv.jpg"; if (iid == IID_AM_12GAUGESHELLS) @@ -1988,7 +1980,7 @@ string(float iid) GetItemImage = if (iid == IID_AM_ENERGYCELL) return "cell.jpg"; if (iid == IID_AM_762MM) - return "762mm.jpg"; + return "762mm.png"; if (iid == IID_AM_44MAGNUM) return "44mag.jpg"; if (iid == IID_AM_WARSAW) @@ -2013,18 +2005,18 @@ string(float iid) GetItemImage = if (iid == IID_ARM_DESERT) return "desert.jpg"; - if (iid == IID_ARM_SHIRT) - return "shirt.jpg"; if (iid == IID_ARM_LEATHER) return "leather.jpg"; - if (iid == IID_ARM_KEVLAR) - return "doublek.jpg"; + if (iid == IID_ARM_VANDAL) + return "vandal.jpg"; if (iid == IID_ARM_METAL) - return "ceramic.jpg"; + return "metal.jpg"; + if (iid == IID_ARM_TESLA) + return "tesla.jpg"; if (iid == IID_ARM_COMBAT) return "combat.jpg"; - if (iid == IID_ARM_BROTHERHOOD) - return "brotherhood.jpg"; + if (iid == IID_ARM_SEVA) + return "seva.jpg"; if (iid == IID_ARM_FORCE) return "force.jpg"; if (iid == IID_ARM_LPOWER) @@ -2127,7 +2119,7 @@ float(string itname) ItemIDOfName = if (itname == "knife") return IID_WP_KNIFE; if (itname == "hand-axe") - return IID_WP_AXE; + return IID_WP_SLEDGE; if (itname == "spear") return IID_WP_SPEAR; if (itname == "poweraxe") @@ -2154,10 +2146,10 @@ float(string itname) ItemIDOfName = return IID_WP_MOSSBERG; if (itname == "jackhammer") return IID_WP_JACKHAMMER; + if (itname == "grease gun") + return IID_WP_GREASEGUN; if (itname == "mp9") return IID_WP_MP9; - if (itname == "grease gun") - return IID_WP_MP7; if (itname == "rangemaster") return IID_WP_RANGEMASTER; if (itname == "rangemaster (scope)") @@ -2204,18 +2196,18 @@ float(string itname) ItemIDOfName = return IID_GREN_SMOKE; if (itname == "flash grenade") return IID_GREN_FLASH; - if (itname == "bulletproof shirt") - return IID_ARM_SHIRT; if (itname == "leather armor") return IID_ARM_LEATHER; - if (itname == "kevlar armor") - return IID_ARM_KEVLAR; + if (itname == "vandal armor") + return IID_ARM_VANDAL; if (itname == "metal armor") return IID_ARM_METAL; + if (itname == "tesla armor") + return IID_ARM_TESLA; if (itname == "combat armor") return IID_ARM_COMBAT; - if (itname == "brotherhood armor") - return IID_ARM_BROTHERHOOD; + if (itname == "seva suit") + return IID_ARM_SEVA; if (itname == "force armor") return IID_ARM_FORCE; if (itname == "light power armor") diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 2708d00a1..94139f01d 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -257,6 +257,90 @@ void() Explosive = droptofloor(); }; +float (entity to, float iid, float quant) TryGiveStackable; +void() junk_touch = +{ + local float junktype; + + if (other.skill_science <= 0) + return; + if (other.classname != "player") + return; + if (other.health <= 0) + return; + + + + if (!TryGiveStackable(other, ToIID(self.islot1), self.flash)) + { + sprint(other, PRINT_MEDIUM, "inventory full.\n"); + return; + } + + sound (other, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + + sprint(other, PRINT_MEDIUM, "found "); + sprint(other, PRINT_MEDIUM, GetItemName(ToIID(self.islot1))); + sprint(other, PRINT_MEDIUM, ".\n"); + + remove (self); + +}; + +void() SpawnJunk = +{ + setorigin(self, self.origin + '0 0 64'); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_x = crandom()*600; + self.velocity_y = crandom()*600; + self.velocity_z = -100; + + self.avelocity_y = crandom()*600; + + if (random()*100 < 50) + setmodel (self, "progs/junk1.mdl"); + else + setmodel (self, "progs/junk2.mdl"); + + self.touch = junk_touch; + self.solid = SOLID_BBOX; + setsize (self, '-12 -12 0', '12 12 12'); + self.takedamage = DAMAGE_NO; + self.classname = "random_junk"; + + + if (random()*100 <= 10) + self.islot1 = IID_MISC_JUNK; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_NUKACOLA; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_CHEMICALS; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_AEROSOL; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_RDXCRYSTAL; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_STEELPIPE; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_DUCKTAPE; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_LCD; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_CIRCUITBOARD; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_COPPERWIRE; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_HMXCOMPOUND; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_GUM; + else if (random()*100 <= 10) + self.islot1 = IID_MISC_XRAYTUBE; + + if (random()*100 <= 10) + self.flash = 2; + else + self.flash = 1; +}; void() TreasureChest = { setorigin(self, self.origin + '0 0 64'); @@ -273,8 +357,16 @@ void() TreasureChest = setsize (self, '-12 -12 0', '12 12 12'); self.takedamage = DAMAGE_NO; self.classname = "treasure_chest"; + + SpawnJunk(); + SpawnJunk(); + SpawnJunk(); }; + + + + void() car_rock = { self.frame = self.frame + 1; @@ -2167,6 +2259,7 @@ void() DropMoney = }; + /* =============== DropBackpack diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index cb89004f6..addf315d1 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -927,8 +927,8 @@ void() brotherhood_merchant = if (random()*100 < 33) { - self.xslot1 = SlotVal(IID_WP_MP9, 1); - self.xslot6 = SlotVal(IID_AM_10MM, 30); + self.xslot1 = SlotVal(IID_WP_GREASEGUN, 1); + self.xslot6 = SlotVal(IID_AM_45ACP, 30); } else if (random()*100 < 33) { @@ -992,7 +992,7 @@ void() brotherhood_merchant = if (random()*100 < 33) { self.xslot5 = SlotVal(IID_WP_AK112, 1); - self.xslot10 = SlotVal(IID_AM_556MM, 30); + self.xslot10 = SlotVal(IID_AM_5MMHIGHVEL, 30); } else if (random()*100 < 33) { @@ -1001,36 +1001,32 @@ void() brotherhood_merchant = } else { - self.xslot5 = SlotVal(IID_WP_MP7, 1); - self.xslot10 = SlotVal(IID_AM_45ACP, 30); + self.xslot5 = SlotVal(IID_WP_MP9, 1); + self.xslot10 = SlotVal(IID_AM_10MM, 30); } if (random()*100 < 50) - self.xslot11 = SlotVal(IID_ARM_SHIRT, 1); - else self.xslot11 = SlotVal(IID_ARM_LEATHER, 1); + else + self.xslot11 = SlotVal(IID_ARM_VANDAL, 1); if (random()*100 < 50) - self.xslot12 = SlotVal(IID_ARM_KEVLAR, 1); - else self.xslot12 = SlotVal(IID_ARM_METAL, 1); + else + self.xslot12 = SlotVal(IID_ARM_TESLA, 1); if (random()*100 < 75) self.xslot13 = SlotVal(IID_ARM_COMBAT, 1); else - self.xslot13 = SlotVal(IID_ARM_BROTHERHOOD, 1); + self.xslot13 = SlotVal(IID_ARM_SEVA, 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); + self.xslot14 = SlotVal(IID_CHEM_STIMPACK, 1); + + + self.xslot15 = SlotVal(IID_CHEM_MEDICALBAG, 25); if (random()*100 < 80) self.xslot16 = SlotVal(IID_WP_AK112, 1); @@ -1152,11 +1148,11 @@ void() brotherhood_doctor = 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); + self.xslot16 = SlotVal(IID_CHEM_STIMPACK, 1); + self.xslot17 = SlotVal(IID_CHEM_MEDICALBAG, 25); + self.xslot18 = SlotVal(IID_CHEM_SUPERSTIM, 1); + self.xslot19 = SlotVal(IID_CHEM_ADRENALINE, 1); + self.xslot20 = SlotVal(IID_CHEM_PSYCHO, 1); }; diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index 817c79f6e..4de8c3c8a 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -561,27 +561,7 @@ void() W_PlayerMenu = return; } - else if (self.currentmenu == "shop_armor") - { - if (self.impulse == 1) - BuyArmor(3, 50, IID_ARM_SHIRT); //weight, cost, item - if (self.impulse == 2) - BuyArmor(7, 100, IID_ARM_LEATHER); //weight, cost, item - if (self.impulse == 3) - BuyArmor(9, 125, IID_ARM_KEVLAR); //weight, cost, item - if (self.impulse == 4) - BuyArmor(15, 150, IID_ARM_METAL); //weight, cost, item - if (self.impulse == 5) - BuyArmor(12, 200, IID_ARM_COMBAT); //weight, cost, item - if (self.impulse == 6) - BuyArmor(17, 250, IID_ARM_BROTHERHOOD); //weight, cost, item - if (self.impulse == 7) - BuyArmor(5, 300, IID_ARM_FORCE); //weight, cost, item - if (self.impulse == 8) - BuyArmor(20, 400, IID_ARM_LPOWER); //weight, cost, item - return; - } else if (self.currentmenu == "shop_ammo" && world.map_obj != 4) { if (self.impulse == 1) @@ -667,7 +647,7 @@ void() W_PlayerMenu = if (self.impulse == 2) BuyWeapon(3, 8, IID_WP_WRENCH); //weight, cost, item if (self.impulse == 3) - BuyWeapon(8, 9, IID_WP_AXE); //weight, cost, item + BuyWeapon(8, 9, IID_WP_SLEDGE); //weight, cost, item if (self.impulse == 4) BuyWeapon(4, 12, IID_WP_SPEAR); //weight, cost, item @@ -701,9 +681,9 @@ void() W_PlayerMenu = if (self.impulse == 4) BuyWeapon(2, 120, IID_WP_NEEDLER); //weight, cost, item if (self.impulse == 5) - BuyWeapon(3, 170, IID_WP_MP7); //weight, cost, item + BuyWeapon(3, 170, IID_WP_MP9); //weight, cost, item if (self.impulse == 6) - BuyWeapon(3, 150, IID_WP_MP9); //weight, cost, item + BuyWeapon(3, 150, IID_WP_GREASEGUN); //weight, cost, item return; } diff --git a/quakec/fallout2/ogre.qc b/quakec/fallout2/ogre.qc index b49b6e6da..5cd996a1d 100644 --- a/quakec/fallout2/ogre.qc +++ b/quakec/fallout2/ogre.qc @@ -1128,7 +1128,7 @@ void () monster_ogre = setsize (self, '-16 -16 -24', '16 16 48'); self.health = 200; self.team = 3; - self.islot3 = SlotVal(IID_ARM_SHIRT, 1); + self.islot3 = SlotVal(IID_ARM_LEATHER, 1); self.armornoise = "misc/thud.wav"; self.th_stand = ogre_stand1; self.th_walk = ogre_walk1; diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index 6edea438c..7e2816827 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -292,7 +292,7 @@ float (entity guy) holding_melee = if (iid == IID_NONE || iid == IID_WP_KNIFE || - iid == IID_WP_AXE || + iid == IID_WP_SLEDGE || iid == IID_WP_SPEAR || iid == IID_WP_WRENCH) return true; @@ -433,7 +433,7 @@ void () player_run = [ 137, player_run ] self.walkframe = self.walkframe + 1; - if (self.walkframe == 6) + if (self.walkframe >= 6) self.walkframe = 0; }; @@ -492,7 +492,7 @@ void () player_walk = [ 170, player_walk ] self.frame = (170 + self.walkframe); - if (self.walkframe == 11) + if (self.walkframe >= 11) self.walkframe = 0; self.walkframe = (self.walkframe + 1); @@ -553,7 +553,7 @@ void () player_slow = [ 170, player_slow ] self.frame = (170 + floor(self.walkframe/2)); - if (self.walkframe == 22) + if (self.walkframe >= 22) self.walkframe = 0; self.walkframe = (self.walkframe + 1); diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 2c716199f..97f2f987a 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -125,7 +125,7 @@ float (entity healer, entity saved) RevivePlayer = // saved.materialize = 200; saved.ghost = 0; - saved.health = 1; + saved.health = 40; saved.air_finished = time + 10; saved.view_ofs = '0 0 22'; self = saved; @@ -172,7 +172,7 @@ void(float damage, float dist, float rate) FireMelee = weap = ToIID(self.(SlotField(self.current_slot))); //large and in charge! adds a small burst of adrenalnie - if ((getperk(8)) && ((weap == IID_WP_SPEAR || weap == IID_WP_AXE || weap == IID_WP_WRENCH))) + if ((getperk(8)) && ((weap == IID_WP_SPEAR || weap == IID_WP_SLEDGE || weap == IID_WP_WRENCH))) { if (self.ragetime <= 0) { @@ -272,10 +272,10 @@ void(float damage, float dist, float rate) FireMelee = if (self.class == 2 || self.class == 3) damage = damage * 1.25; - if (weap == IID_WP_AXE || weap == IID_WP_SPEAR || weap == IID_WP_KNIFE) + if (weap == IID_WP_SLEDGE || weap == IID_WP_SPEAR || weap == IID_WP_KNIFE) SpawnBlood (org, 1); - if ((getperk(8)) && (weap == IID_WP_AXE || weap == IID_WP_SPEAR || weap == IID_WP_WRENCH)) + if ((getperk(8)) && (weap == IID_WP_SLEDGE || weap == IID_WP_SPEAR || weap == IID_WP_WRENCH)) { sprint(self, 2, "!LARGE AND IN CHARGE\n"); dir = normalize(trace_ent.origin - self.origin); @@ -306,7 +306,7 @@ void(float damage, float dist, float rate) FireMelee = else sound (self, CHAN_BODY, "weapons/brawl-2.wav", 1, ATTN_NORM); } - else if (weap == IID_WP_AXE || weap == IID_WP_WRENCH) + else if (weap == IID_WP_SLEDGE || weap == IID_WP_WRENCH) { if (random()<0.5) sound (self, CHAN_BODY, "effects/axe_hit1.wav", 1, ATTN_NORM); @@ -334,7 +334,7 @@ void() W_FireMelee = FireMelee(5+random()*30, 64, 1.2); else if (iid == IID_WP_KNIFE) FireMelee(5+random()*20, 64, 0.4); - else if (iid == IID_WP_AXE) + else if (iid == IID_WP_SLEDGE) FireMelee(5+random()*80, 96, 1); else if (iid == IID_WP_SPEAR) FireMelee(5+random()*60, 160, 0.8); @@ -1573,7 +1573,7 @@ void() W_Attack = sound (self, CHAN_WEAPON, "effects/miss.wav", TRUE, ATTN_NORM); } - else if (weap == IID_WP_AXE || weap == IID_WP_WRENCH) + else if (weap == IID_WP_SLEDGE || weap == IID_WP_WRENCH) { if (random()<0.75) { @@ -1626,13 +1626,13 @@ void() W_Attack = W_FireShotgun (2, 5, 7, 20, 2000, 1, "weapons/citykiller.wav"); else if (weap == IID_WP_JACKHAMMER) W_FireShotgun (1, 5, 7, 30, 1750, 2, "weapons/citykiller.wav"); - else if (weap == IID_WP_MP9) + else if (weap == IID_WP_GREASEGUN) FireSMG(14, 0, "weapons/mp7.wav", 1500, 0.10); - else if (weap == IID_WP_MP7) + else if (weap == IID_WP_MP9) FireSMG(12, 0, "weapons/mp5.wav", 1500, 0.08); - else if (weap == IID_WP_MP9_S) + else if (weap == IID_WP_GREASEGUN_S) FireSMG(12, 0, "weapons/smg_s.wav", 1500, 0.10); - else if (weap == IID_WP_MP7_S) + else if (weap == IID_WP_MP9_S) FireSMG(10, 0, "weapons/smg_s.wav", 1500, 0.08); else if (weap == IID_WP_RANGEMASTER) FireAssaultRifle(18, 4, "weapons/rangem.wav", 4000, 0.1); @@ -2480,7 +2480,7 @@ void () Explosion = void () FragExplode = { - local float r; + local float r, d; local entity te; local vector dir; @@ -2507,7 +2507,10 @@ void () FragExplode = te = te.chain; } - T_RadiusDamage2 (self, self.owner, 65+random()*65, other, 400); + r = 400 + self.skill_science*2; + d = 65+random()*65 + self.skill_science; + + T_RadiusDamage2 (self, self.owner, 65+random()*65, other, r); remove (self); }; @@ -2530,7 +2533,7 @@ void () PlasmaExplode = void () FlashExplode = { local entity te; - local float dot; + local float dot, effect; local vector vec; self.velocity = VEC_ORIGIN; @@ -2542,6 +2545,8 @@ void () FlashExplode = WriteCoord (0, self.origin_z); sound (self, CHAN_BODY, "misc/flash.wav", 1, ATTN_NORM); + effect = 5 + (self.skill_science/3); + te = findradius (self.origin, 200); while (te) { @@ -2549,8 +2554,8 @@ void () FlashExplode = { if (CanDamage (self, te)) { - te.flash = 12; - te.attack_finished = time + 12; + te.flash = effect; + te.attack_finished = time + effect; spawn_excla(te, 12); } @@ -2562,9 +2567,9 @@ void () FlashExplode = te.missionbrief = 5; stuffcmd (te, "v_cshift 255 255 255 255\n"); stuffcmd (te, "v_idlescale 3\n"); - te.flash = time + 12; + te.flash = time + effect; - spawn_excla(te, 12); + spawn_excla(te, effect); } } te = te.chain; @@ -2581,9 +2586,9 @@ void () FlashExplode = if (dot > 0.3 && CanDamage (self, te)) { - te.flash = 12; - te.attack_finished = time + 12; - spawn_excla(te, 12); + te.flash = effect; + te.attack_finished = time + effect; + spawn_excla(te, effect); } } @@ -2597,9 +2602,9 @@ void () FlashExplode = { stuffcmd (te, "v_cshift 255 255 255 255\n"); stuffcmd (te, "v_idlescale 3\n"); - te.flash = time + 4; + te.flash = time + effect; - spawn_excla(te, 4); + spawn_excla(te, effect); } } te = te.chain; @@ -2607,37 +2612,38 @@ void () FlashExplode = remove (self); }; -void () FlashThink = -{ - local entity te; - - te = findradius(self.origin, 600); - - while (te) - { - if (te.classname == "player" && te.sneak > 0) - te.sneak = 0; - - te = te.chain; - } - - self.nextthink = time + 1; - self.score = self.score + 1; - - if (self.score == 120) - remove(self); -}; void () StunExplode = { local entity te; - local float dot; + local float dot, effect; local vector vec; - self.effects = EF_BLUE; - self.think = FlashThink; - self.nextthink = time + 1; + self.velocity = VEC_ORIGIN; + + WriteByte (0, SVC_TEMPENTITY); + WriteByte (0, WEAPON_SPIKES); + WriteCoord (0, self.origin_x); + WriteCoord (0, self.origin_y); + WriteCoord (0, self.origin_z); + + te = findradius(self.origin, 400); + + while (te) + { + if (te.flags & FL_MONSTER) + { + te.hold = effect; + + } + if (te.classname == "player") + te.hold = effect; + + te = te.chain; + } sound (self, CHAN_BODY, "misc/flash.wav", 1, ATTN_NORM); + + remove(self); }; /* @@ -2963,17 +2969,17 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = } sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); - if (weap == IID_WP_MP9) + if (weap == IID_WP_GREASEGUN) loud_noise(50); - else if (weap == IID_WP_MP7) + else if (weap == IID_WP_MP9) loud_noise(40); - else if (weap == IID_WP_MP9_S) + else if (weap == IID_WP_GREASEGUN_S) loud_noise(5); - else if (weap == IID_WP_MP7_S) + else if (weap == IID_WP_MP9_S) loud_noise(5); //only silenced weapons do not break stealth - if (weap != IID_WP_MP9_S && weap != IID_WP_MP7_S && self.sneak > 0) + if (weap != IID_WP_GREASEGUN_S && weap != IID_WP_MP9_S && self.sneak > 0) { self.equipment_slot = 0; sprint(self, PRINT_HIGH, " Uncloaked \n"); @@ -3066,13 +3072,13 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = dam = dam + random()*dam; - if (weap == IID_WP_MP9) + if (weap == IID_WP_GREASEGUN) J_Damage (trace_ent, self, self, dam); - else if (weap == IID_WP_MP7) + else if (weap == IID_WP_MP9) T_Damage (trace_ent, self, self, dam); - else if (weap == IID_WP_MP9_S) + else if (weap == IID_WP_GREASEGUN_S) J_Damage (trace_ent, self, self, dam); - else if (weap == IID_WP_MP7_S) + else if (weap == IID_WP_MP9_S) T_Damage (trace_ent, self, self, dam); T_Damage (trace_ent, self, self, dam); @@ -3287,14 +3293,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR } } - if (self.extender == weap && self.silencer != weap) - dam = dam * 1.10; - if (self.silencer == weap) - { - sound (self, CHAN_WEAPON, "weapons/needler.wav", 1, ATTN_NORM); - loud_noise(20); - } else { if (weap == IID_WP_MOONLIGHT) @@ -3399,6 +3398,8 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (tmp > 500) tmp = 500; + tmp = tmp * 0.75; + source = self.origin + '0 0 22'; targ = self.origin + '0 0 22' + v_right*self.driftx + v_up*self.drifty + v_right*crandom()* tmp + v_up*random()*tmp + v_up*random()*tmp; @@ -3935,7 +3936,7 @@ void (entity chest, float iid, float num) DropFromChest = newmis.flash = num; newmis.touch = MultiTouch; } - else if (iid >= IID_ARM_SHIRT && iid <= IID_ARM_LPOWER) + else if (iid >= IID_ARM_LEATHER && iid <= IID_ARM_LPOWER) { newmis.flash = num; newmis.touch = MultiTouch; @@ -4147,19 +4148,45 @@ float(entity x, float slotno) DecreaseDestroySlotOther; void () UseStimpack = { - local float x; + local float x, found; local vector source; - local entity thing; + local entity thing, te; if (self.attack_finished > time) return; + te = findradius (self.origin, 100); + while (te) + { + + if (found == 0 && te.classname == "player" && te.deadflag) + { + + x = SlotOfItem(self, IID_CHEM_STIMPACK); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you don't have a stimpack\n"); + return; + } + + DecreaseDestroySlot(x);//take away a stimpack + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + RevivePlayer(self, te); + found = 1; + } + + te = te.chain; + } + + if (found == 1) + return; + self.attack_finished = time + 1; self.rtime = time + 1; makevectors (self.v_angle); - source = self.origin + '0 0 16'; + source = self.origin + '0 0 0'; traceline (source, source + v_forward*64, FALSE, self); if (trace_fraction == 1.0)//nobody in front of user, so heal self @@ -4390,7 +4417,7 @@ void () UseMedicalBag = self.rtime = time + 1; makevectors (self.v_angle); - source = self.origin + '0 0 16'; + source = self.origin + '0 0 0'; traceline (source, source + v_forward*64, FALSE, self); if (trace_fraction == 1.0)//nobody in front of user, so heal self @@ -4421,9 +4448,8 @@ void () UseMedicalBag = } sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); - sprint(self, PRINT_MEDIUM, "you heal yourself with your medkit\n"); - self.health = self.health + 5; - self.regen = self.regen + 5; + sprint(self, PRINT_MEDIUM, "you start to bandage yourself\n"); + self.regen = self.regen + self.skill_doctor; } } else if (trace_ent.classname == "player")//healing another team-mate @@ -4474,13 +4500,12 @@ void () UseMedicalBag = sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); self.score = self.score + 10; sprint(trace_ent, PRINT_MEDIUM, self.netname); - sprint(trace_ent, PRINT_MEDIUM, " heals you with a stimpack\n"); + sprint(trace_ent, PRINT_MEDIUM, " bandages your wounds\n"); sprint(self, PRINT_MEDIUM, "you heal "); sprint(self, PRINT_MEDIUM, trace_ent.netname); sprint(self, PRINT_MEDIUM, " with a stimpack\n"); - trace_ent.health = trace_ent.health + 10; - trace_ent.regen = trace_ent.regen + 10; + trace_ent.regen = trace_ent.regen + self.skill_doctor; } } } @@ -5358,33 +5383,26 @@ void () Bar_Think = { local float dot1; - if ((self.owner.health < WEAPON_SHOTGUN)) + + if (self.owner.health >= self.owner.max_health) { - remove (self); - return; - } - if ((self.owner.health >= self.owner.max_health)) - { - remove (self); + self.frame = 0; + setmodel (self, ""); + self.nextthink = time + 0.01; return; } self.flags = self.flags; - if ((self.owner.position == WEAPON_SHOTGUN)) - { - dot1 = WEAPON_SHOTGUN; - } - if ((dot1 == WEAPON_SHOTGUN)) - { - self.frame = MULTICAST_ALL; - setmodel (self, ""); - self.nextthink = (time + 0.01); - return; - } - if (((self.owner.health >= WEAPON_SHOTGUN) && (dot1 == MULTICAST_ALL))) + if (self.owner.health >= 1) { self.frame = floor (((self.owner.health / self.owner.max_health) * TE_WIZSPIKE)); - setorigin (self, (self.owner.origin + '0 0 48')); + if (self.owner.position == 0) + setorigin (self, (self.owner.origin + '0 0 40')); + else if (self.owner.position == 1) + setorigin (self, (self.owner.origin + '0 0 32')); + else + setorigin (self, (self.owner.origin + '0 0 24')); + self.nextthink = (time + 0.01); setmodel (self, "progs/hbar.spr"); } @@ -5407,6 +5425,7 @@ void (entity guy) spawn_dot = hologram.cnt = MULTICAST_ALL; hologram.think = Bar_Think; hologram.nextthink = (time + 0.01); + hologram.scale = 0.5; }; void() FinishTurret; @@ -6467,26 +6486,6 @@ void() AttachSilencer = return; } } - else if (weap == IID_WP_MP7) - { - sprint(self, 2, "silencer attached.\n"); - DecreaseDestroySlot(y); - - if (self.current_slot == 1) - { - x = ToStatus(self.islot1); - self.islot1 = 0; - SetItemSlot(self, 1, SlotVal(IID_WP_MP7_S, x)); - return; - } - if (self.current_slot == 2) - { - x = ToStatus(self.islot2); - self.islot2 = 0; - SetItemSlot(self, 2, SlotVal(IID_WP_MP7_S, x)); - return; - } - } else if (weap == IID_WP_MP9) { sprint(self, 2, "silencer attached.\n"); @@ -6507,6 +6506,26 @@ void() AttachSilencer = return; } } + else if (weap == IID_WP_GREASEGUN) + { + sprint(self, 2, "silencer attached.\n"); + DecreaseDestroySlot(y); + + if (self.current_slot == 1) + { + x = ToStatus(self.islot1); + self.islot1 = 0; + SetItemSlot(self, 1, SlotVal(IID_WP_GREASEGUN_S, x)); + return; + } + if (self.current_slot == 2) + { + x = ToStatus(self.islot2); + self.islot2 = 0; + SetItemSlot(self, 2, SlotVal(IID_WP_GREASEGUN_S, x)); + return; + } + } else if (weap == IID_WP_PIPERIFLE) { sprint(self, 2, "silencer attached.\n"); @@ -6881,7 +6900,7 @@ void() SpawnGModel = setmodel (hologram, "progs/g_knife.mdl"); if (weap == IID_WP_WRENCH) setmodel (hologram, "progs/g_wrench.mdl"); - if (weap == IID_WP_AXE) + if (weap == IID_WP_SLEDGE) setmodel (hologram, "progs/g_axe.mdl"); if (weap == IID_WP_SPEAR) setmodel (hologram, "progs/g_spear.mdl"); @@ -6903,7 +6922,7 @@ void() SpawnGModel = setmodel (hologram, "progs/g_knife.mdl"); if (weap == IID_WP_WRENCH) setmodel (hologram, "progs/g_wrench.mdl"); - if (weap == IID_WP_AXE) + if (weap == IID_WP_SLEDGE) setmodel (hologram, "progs/g_axe.mdl"); if (weap == IID_WP_SPEAR) setmodel (hologram, "progs/g_spear.mdl"); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 87d055f93..8e988c775 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -2240,6 +2240,11 @@ void() worldspawn = // 63 testing lightstyle(63, "a"); + + if (infokey(world, "coop") == "0") + coop = 0; + if (infokey(world, "coop") == "1") + coop = 1; }; void() StartFrame = From e3f9901bd80ad79ab669ee6dd6fcb61fbad5dbe3 Mon Sep 17 00:00:00 2001 From: Magnus Date: Mon, 9 Nov 2009 15:24:37 +0000 Subject: [PATCH 16/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3430 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 45 +-- quakec/fallout2/cmds.qc | 604 ++++++--------------------------- quakec/fallout2/csqc/invent.qc | 2 +- quakec/fallout2/hos.qc | 2 +- quakec/fallout2/inventory.qc | 280 +++++++++++++-- quakec/fallout2/items.qc | 52 +-- quakec/fallout2/menus.qc | 9 +- quakec/fallout2/misc.qc | 59 +--- quakec/fallout2/mod_buy.qc | 7 +- quakec/fallout2/weapons.qc | 6 +- quakec/fallout2/world.qc | 7 +- 11 files changed, 462 insertions(+), 611 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index b55b76942..11a928604 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -270,47 +270,50 @@ void() get_new_map = m_map = "e3m1"; else if (random()<0.04) m_map = "e4m1"; - else if (random()<0.04) + else if (random()<0.08) m_map = "bbelief1"; - else if (random()<0.15) - m_map = "bbelief1"; - else if (random()<0.15) + else if (random()<0.08) m_map = "bbelief2"; - else if (random()<0.15) + else if (random()<0.08) m_map = "bbelief3"; - else if (random()<0.15) + else if (random()<0.08) m_map = "bbelief4"; - else if (random()<0.15) + else if (random()<0.08) m_map = "bbelief5"; - else if (random()<0.15) + else if (random()<0.08) m_map = "bbelief6"; - else if (random()<0.15) - m_map = "bbelief7"; - else if (random()<0.15) - m_map = "bbelief8"; + else if (random()<0.08) + m_map = "e1m4"; + else if (random()<0.08) + m_map = "e2m3"; + else if (random()<0.08) + m_map = "e3m3"; + else if (random()<0.08) + m_map = "e1m3"; + else if (random()<0.08) + m_map = "e1m5"; else m_map = "bbelief1"; }; -void() get_new_mission = +void(float type) get_new_mission = { local float x; local string savemap; - x = ceil(random()*6); - if (x == 1) + if (type == 1) savemap = "hostage"; - if (x == 2) + if (type == 2) savemap = "supplies"; - if (x == 3) + if (type == 3) savemap = "shadow"; - if (x == 4) + if (type == 4) savemap = "deadtown"; - if (x == 5) + if (type == 5) savemap = "destroy"; - if (x == 6) + if (type == 6) savemap = "defuse"; localcmd("serverinfo objective "); @@ -1300,7 +1303,7 @@ void() SneakLevel = if (r > 0 && r <= 600) { r = 600 - r; - q = 3 + (self.skill_sneak/5); + q = 3 + (self.skill_sneak/2); sn = sn - r/q; } diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 8f7613580..ea157fd60 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -261,7 +261,7 @@ void(string arg1) Cmd_InvDrop = void(string arg1) Cmd_InvBuy = { - local float x,y, iid, amount, money; + local float x,y, iid, amount, money, item; x = FindEmptySlot(self); @@ -273,513 +273,50 @@ void(string arg1) Cmd_InvBuy = 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); - } - + item = self.xslot1; 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); - } - + item = self.xslot2; 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); - } - + item = self.xslot3; 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); - } - + item = self.xslot4; 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); - } - + item = self.xslot5; 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); - } - + item = self.xslot6; 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); - } - + item = self.xslot7; 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); - } + item = self.xslot8; 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); - } + item = self.xslot9; 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); - } + item = self.xslot10; 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); - } + item = self.xslot11; 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); - } + item = self.xslot12; 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); - } + item = self.xslot13; 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); - } + item = self.xslot14; 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); - } + item = self.xslot15; 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); - } + item = self.xslot16; 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); - } + item = self.xslot17; 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); - } + item = self.xslot18; 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); - } + item = self.xslot19; if (arg1 == "20") - { - iid = ToIID(self.xslot20); - amount = ToStatus(self.xslot20); + item = self.xslot20; + + + iid = ToIID(item); + amount = ToStatus(item); money = GetBaseValue(iid); if (self.ammo_shells < money) { @@ -791,17 +328,20 @@ void(string arg1) Cmd_InvBuy = self.ammo_shells = self.ammo_shells - money; if (NotStackable(iid)) - SetItemSlot(self, x, self.xslot20); + SetItemSlot(self, x, item); + else if (IsEquip(iid)) + SetItemSlot(self, x, item); else - if (!TryGiveStackable(self, iid, amount)) { sprint(self, 2, "full inventory.\n"); sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + self.ammo_shells = self.ammo_shells + money; return; } sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); - } + + }; void(string arg1) Cmd_InvSell = @@ -1022,6 +562,88 @@ void(string arg1) Cmd_InvMix = sprint(self, PRINT_MEDIUM, "1 super stim created\n"); sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); } + else if ((iid1 == IID_MISC_DUCKTAPE && iid2 == IID_MISC_AEROSOL) || + (iid2 == IID_MISC_DUCKTAPE && iid1 == IID_MISC_AEROSOL)) + { + 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; + } + + DecreaseDestroySlot(23); + DecreaseDestroySlot(24); + + if (random()*100 > (self.skill_science*20)) + { + sprint(self, PRINT_MEDIUM, "your concoction failed!\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + + + + + SetItemSlot(self, x, SlotVal(IID_EQUIP_SILENCER, 1)); + + sprint(self, PRINT_MEDIUM, "silencer created\n"); + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + } + else if ((iid1 == IID_EQUIP_SILENCER && iid2 == IID_WP_USP) || + (iid2 == IID_EQUIP_SILENCER && iid1 == IID_WP_USP)) + { + if (random()*100 > (self.skill_science*20)) + { + sprint(self, PRINT_MEDIUM, "your concoction failed!\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + 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; + } + + DecreaseDestroySlot(23); + DecreaseDestroySlot(24); + + SetItemSlot(self, x, SlotVal(IID_WP_USP_S, 1)); + + sprint(self, PRINT_MEDIUM, "silencer created\n"); + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + } + else if ((iid1 == IID_EQUIP_SILENCER && iid2 == IID_WP_GLOCK) || + (iid2 == IID_EQUIP_SILENCER && iid1 == IID_WP_GLOCK)) + { + if (random()*100 > (self.skill_science*20)) + { + sprint(self, PRINT_MEDIUM, "your concoction failed!\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + 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; + } + + DecreaseDestroySlot(23); + DecreaseDestroySlot(24); + + SetItemSlot(self, x, SlotVal(IID_WP_GLOCK_S, 1)); + + sprint(self, PRINT_MEDIUM, "silencer created\n"); + sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); + } else if ((iid1 == IID_WP_NEEDLER && iid2 == IID_WP_NEEDLER) || (iid2 == IID_WP_NEEDLER && iid1 == IID_WP_NEEDLER)) { diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 83c23a3ab..2fde5006c 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -107,7 +107,7 @@ void(vector pos, float slotno) SlotImage = 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); diff --git a/quakec/fallout2/hos.qc b/quakec/fallout2/hos.qc index cc747ce7b..70bfa8759 100644 --- a/quakec/fallout2/hos.qc +++ b/quakec/fallout2/hos.qc @@ -246,7 +246,7 @@ void (vector jojo) spawn_civilian = self.movetype = MOVETYPE_STEP; self.takedamage = DAMAGE_AIM; setmodel (self, "progs/hosfem.mdl"); - setsize (self, VEC_HULL_MIN, '16 16 32'); + setsize (self, '-10 -10 24', '10 10 24'); self.health = 80; self.netname = "civilian"; self.classname = "rhostage"; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 737dbbcda..d4e7f2a28 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -672,7 +672,7 @@ string(float iid) GetItemVModel = if (iid == IID_WP_ALIENBLASTER) return "progs/v_blaster.mdl"; if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) - return "progs/v_pipe.mdl"; + return "progs/v_bozar.mdl"; if (iid == IID_WP_WINCHESTER) return "progs/v_double.mdl"; if (iid == IID_WP_MOSSBERG) @@ -697,7 +697,7 @@ string(float iid) GetItemVModel = if (iid == IID_WP_AK74) return "progs/v_ak47.mdl"; if (iid == IID_WP_ACR) - return "progs/v_acr.mdl"; + return "progs/v_bozar.mdl"; if (iid == IID_WP_DKS1) return "progs/v_srifle.mdl"; if (iid == IID_WP_DKS1_S) @@ -796,7 +796,7 @@ string(float iid) GetItemWModel = if (iid == IID_WP_AK74) return "progs/w_ak47.mdl"; if (iid == IID_WP_ACR) - return "progs/w_acr.mdl"; + return "progs/w_bozar.mdl"; if (iid == IID_WP_DKS1) return "progs/w_srifle.mdl"; if (iid == IID_WP_DKS1_S) @@ -920,7 +920,7 @@ float(float iid) WeaponAmmoType = if (iid == IID_WP_AK74) return IID_AM_WARSAW; if (iid == IID_WP_ACR) - return IID_AM_NEEDLER; + return IID_AM_762MM; if (iid == IID_WP_DKS1) return IID_AM_762MM; if (iid == IID_WP_DKS1_S) @@ -997,7 +997,7 @@ float(float iid) WeaponMagQuant = if (iid == IID_WP_AK74) return 30; if (iid == IID_WP_ACR) - return 24; + return 20; if (iid == IID_WP_DKS1) return 8; if (iid == IID_WP_DKS1_S) @@ -1081,7 +1081,7 @@ float(float iid) GetItemWeight = if (iid == IID_WP_AK74) return 5; if (iid == IID_WP_ACR) - return 5; + return 10; if (iid == IID_WP_DKS1) return 9; if (iid == IID_WP_DKS1_S) @@ -1211,7 +1211,7 @@ string(float iid) GetItemName = return "jackhammer (12g)"; if (iid == IID_WP_GREASEGUN) return "grease gun (.45 acp)"; - if (iid == IID_WP_GREASEGUN) + if (iid == IID_WP_MP9) return "mp9 (10mm)"; if (iid == IID_WP_RANGEMASTER) return "rangemaster (5.56mm)"; @@ -1226,7 +1226,7 @@ string(float iid) GetItemName = if (iid == IID_WP_AK74) return "ak-47 (7.62mm warsaw pact)"; if (iid == IID_WP_ACR) - return "steyr acr (5mm flechette)"; + return "bozar (7.62mm)"; if (iid == IID_WP_DKS1) return "knight sr-25 widowmaker (7.62mm)"; if (iid == IID_WP_DKS1_S) @@ -1250,8 +1250,6 @@ string(float iid) GetItemName = if (iid == IID_WP_LASERGATLING) return "laser minigun (energy)"; - - if (iid == IID_AM_NEEDLER) return "needler cartidge"; if (iid == IID_AM_2MMEC) @@ -1433,7 +1431,7 @@ float(float iid) GetBaseValue = if (iid == IID_WP_NEEDLER) return 80; if (iid == IID_WP_ALIENBLASTER) - return 200; + return 150; if (iid == IID_WP_PIPERIFLE) return 15; if (iid == IID_WP_PIPERIFLE_S) @@ -1477,7 +1475,7 @@ float(float iid) GetBaseValue = if (iid == IID_WP_AK74) return 20; if (iid == IID_WP_ACR) - return 240; + return 190; if (iid == IID_WP_DKS1) return 110; if (iid == IID_WP_DKS1_S) @@ -1711,7 +1709,7 @@ string(float iid) GetItemDesc = if (iid == IID_WP_AK112_M) return "this rifle has been modified to accept larger magazines"; if (iid == IID_WP_DKS1) - return "this sturdy rifle fires .308, a larger, more reliable round"; + return "this sturdy rifle fires .308\na larger and more reliable round"; if (iid == IID_WP_DKS1_S) return ".308 sniper rifle, silenced for stealth-ops"; if (iid == IID_WP_DKS1) @@ -1734,8 +1732,254 @@ string(float iid) GetItemDesc = return "great for devastating tactical strikes"; if (iid == IID_WP_LASERGATLING) return "quite simply, the ultimate in heavy firepower"; + if (iid == IID_WP_ACR) + return "sniper-style weapon that supports burst fire"; + if (iid == IID_AM_NEEDLER) + return "good armor-peircing properties"; + if (iid == IID_AM_2MMEC) + return "virtually ignores armor"; + if (iid == IID_AM_10MM) + return "jacketed hollow-points for good damage"; + if (iid == IID_AM_556MM) + return "standard rifle round, moderate recoil"; + if (iid == IID_AM_5MMHIGHVEL) + return "experimental high-velocity rifle ammo"; + if (iid == IID_AM_12GAUGESHELLS) + return "the old standard, has trouble with heavy armor"; + if (iid == IID_AM_ENERGYCELL) + return "this energy cell comes from an unknown origin"; + if (iid == IID_AM_762MM) + return "good stopping power and armor-piercing performance"; + if (iid == IID_AM_44MAGNUM) + return "full metal jacket, hit 'em hard"; + if (iid == IID_AM_WARSAW) + return "ancient soviet rifle round, used in the ak47"; + if (iid == IID_AM_45ACP) + return "a common pistol round with good stopping power"; + if (iid == IID_AM_ROCKET) + return "expensive and extremely lethal"; + if (iid == IID_AM_CASELESS) + return "a brick of small-caliber caseless ammo"; + + + if (iid == IID_GREN_FRAG) + return "all-purpose fragmentation grenade"; + if (iid == IID_GREN_EMP) + return "useful against robots and cyborgs"; + if (iid == IID_GREN_SMOKE) + return "very useful for a quick getaway!"; + if (iid == IID_GREN_FLASH) + return "temporarily blinds nearby enemies"; + if (iid == IID_GREN_STUN) + return "delivers a forceful shock to nearby enemies"; + + if (iid == IID_ARM_DESERT) + return "the light armor of a raider; makes a great disguise"; + if (iid == IID_ARM_LEATHER) + return "lightweight leather armor. provides great mobility."; + if (iid == IID_ARM_VANDAL) + return "enhanced leather armor for extra protection."; + if (iid == IID_ARM_METAL) + return "gives great protection at a sacrifice to speed."; + if (iid == IID_ARM_TESLA) + return "experimental armor with high deflection but low absorb."; + if (iid == IID_ARM_COMBAT) + return "this all-purpose armor is designed for combat missions."; + if (iid == IID_ARM_SEVA) + return "high-tech suit provides more environmental defense"; + if (iid == IID_ARM_FORCE) + return "experimental energy-field armor, very low absorb"; + if (iid == IID_ARM_LPOWER) + return "the heaviest armor with great protection"; + + + if (iid == IID_CHEM_STIMPACK) + return "advanced healing chem that replaces lost blood"; + if (iid == IID_CHEM_MEDICALBAG) + return "first aid kit with many high-tech supplies"; + if (iid == IID_CHEM_SUPERSTIM) + return "contains nanobots that heal very fast"; + if (iid == IID_CHEM_ADRENALINE) + return "boosts the metabolism, increasing jump and run speed"; + if (iid == IID_CHEM_PSYCHO) + return "unknown chemicals, probably of military origin"; + if (iid == IID_CHEM_BESERK) + return "unknown chemicals, probably of military origin"; + if (iid == IID_CHEM_RADX) + return "powerful anti-radiation pills"; + + + if (iid == IID_BUILD_MRAMMO) + return "provides extra ammunition"; + if (iid == IID_BUILD_SHIELDGEN) + return "protects all nearby allies"; + if (iid == IID_BUILD_AUTODOC) + return "the auto-doc will repair injuries"; + if (iid == IID_BUILD_ROBOFANG) + return "robofang guardian unit"; + if (iid == IID_BUILD_TTURRET) + return "dispatches hostile intruders"; + if (iid == IID_BUILD_RTURRET) + return "rocket turret"; + if (iid == IID_BUILD_GTURRET) + return "machine-gun turret"; + + + if (iid == IID_EQUIP_MEDIC_BAG) + return "allows more chems to be carried"; + if (iid == IID_EQUIP_GOGGLES) + return "protects against visual impairments"; + if (iid == IID_EQUIP_SILENCER) + return "attaches to any smallarm"; + if (iid == IID_EQUIP_BELTPOUCH) + return "useful for carrying extra grenades"; + if (iid == IID_EQUIP_TOOLKIT) + return "for picking all sorts of locks"; + if (iid == IID_EQUIP_BACKPACK) + return "this handy bag lets you carry more ammunition"; + if (iid == IID_EQUIP_CLIMBINGGEAR) + return "for those hard to reach places"; + if (iid == IID_EQUIP_BATTERY) + return "provides prolonged battery life"; + if (iid == IID_EQUIP_STEALTHBOY) + return "makes user blurry and hard to see"; + if (iid == IID_EQUIP_EXTENDER) + return "gives a weapon slightly longer range and damage"; + if (iid == IID_EQUIP_XRAY) + return "allows for enemy detection through walls"; + + if (iid == IID_MISC_NUKACOLA) + return "a bottle of tasty nuka-cola"; + if (iid == IID_MISC_JUNK) + return "metallic bits, pipe and other debris"; + if (iid == IID_MISC_CHEMICALS) + return "standard household cleaner"; + if (iid == IID_MISC_AEROSOL) + return "a half-full aerosol can"; + if (iid == IID_MISC_RDXCRYSTAL) + return "a batch of highly unstable explosive crystals"; + if (iid == IID_MISC_STEELPIPE) + return "a slightly rusted steel pipe"; + if (iid == IID_MISC_DUCKTAPE) + return "ancient, but still highly functional"; + if (iid == IID_MISC_LCD) + return "an lcd from a Lameboy DS videogame unit"; + if (iid == IID_MISC_CIRCUITBOARD) + return "a corroded circuit board from a remote control"; + if (iid == IID_MISC_COPPERWIRE) + return "a small spool of thin copper wire"; + if (iid == IID_MISC_HMXCOMPOUND) + return "a small amount of high-grade military explosive"; + if (iid == IID_MISC_GUM) + return "trident chewing gum, limited edition watermelon flavor"; + if (iid == IID_MISC_XRAYTUBE) + return "??? a strange device ???"; + + bprint(PRINT_MEDIUM, ftos(iid), " without a desc!\n"); + return strcat("", ftos(iid)); +}; + + +string(float iid) GetItemStats = +{ + if (iid == IID_NONE) + return ""; + + + if (iid == IID_WP_WRENCH) + return "a heavy multi-function wrench"; + if (iid == IID_WP_KNIFE) + return "great for stealth attacks"; + if (iid == IID_WP_SLEDGE) + return "a futuristic battle axe"; + if (iid == IID_WP_SPEAR) + return "a long, sharp polearm"; + if (iid == IID_WP_POWERAXE) + return "a futuristic axe of some sort"; + + if (iid == IID_WP_USP) + return "dmg: 14 rng: 20 ammo: .45 skill: combat"; + if (iid == IID_WP_USP_S) + return "dmg: 12 rng: 18 ammo: .45 skill: combat"; + if (iid == IID_WP_GLOCK) + return "dmg: 12 rng: 18 ammo: 10mm skill: combat"; + if (iid == IID_WP_GLOCK_S) + return "dmg: 10 rng: 16 ammo: 10mm skill: combat"; + if (iid == IID_WP_DEAGLE) + return "dmg: 18 rng: 30 ammo: .44 skill: combat"; + if (iid == IID_WP_DEAGLE_M) + return "dmg: 18 rng: 30 ammo: .44 skill: combat"; + if (iid == IID_WP_NEEDLER) + return "dmg: 16 rng: 20 ammo: nc skill: science"; + if (iid == IID_WP_ALIENBLASTER) + return "dmg: 48 rng: 15 ammo: cell skill: science"; + if (iid == IID_WP_PIPERIFLE) + return "dmg: 20 rng: 50 ammo: .44 skill: combat"; + if (iid == IID_WP_PIPERIFLE_S) + return "dmg: 18 rng: 45 ammo: .44 skill: combat"; + if (iid == IID_WP_PIPERIFLE_SCOPE) + return "dmg: 20 rng: 60 ammo: .44 skill: combat"; + if (iid == IID_WP_PIPERIFLE_R) + return "dmg: 20 rng: 50 ammo: .44 skill: combat"; + if (iid == IID_WP_PIPERIFLE_S_R) + return "dmg: 18 rng: 45 ammo: .44 skill: combat"; + if (iid == IID_WP_PIPERIFLE_SCOPE_R) + return "dmg: 20 rng: 60 ammo: .44 skill: combat"; + if (iid == IID_WP_PIPERIFLE_SCOPE_S) + return "dmg: 18 rng: 50 ammo: .44 skill: combat"; + if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) + return "dmg: 18 rng: 50 ammo: .44 skill: combat"; + if (iid == IID_WP_WINCHESTER) + return "dmg: 40 rng: 10 ammo: 12ga skill: combat"; + if (iid == IID_WP_MOSSBERG) + return "dmg: 35 rng: 20 ammo: 12ga skill: combat"; + if (iid == IID_WP_JACKHAMMER) + return "dmg: 35 rng: 15 ammo: 12ga skill: combat"; + if (iid == IID_WP_GREASEGUN) + return "dmg: 14 rng: 15 ammo: .45 skill: combat"; + if (iid == IID_WP_GREASEGUN_S) + return "dmg: 12 rng: 10 ammo: .45 skill: combat"; + if (iid == IID_WP_MP9) + return "dmg: 12 rng: 15 ammo: 10mm skill: sneak"; + if (iid == IID_WP_MP9_S) + return "dmg: 10 rng: 15 ammo: 10mm skill: sneak"; + if (iid == IID_WP_RANGEMASTER) + return "dmg: 18 rng: 40 ammo: 5.56 skill: combat"; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return "dmg: 18 rng: 50 ammo: 5.56 skill: combat"; + if (iid == IID_WP_AK47) + return "an outdated assault rifle with extreme durability"; + if (iid == IID_WP_AK112) + return "dmg: 16 rng: 40 ammo: 5mm skill: combat"; + if (iid == IID_WP_AK112_M) + return "dmg: 16 rng: 40 ammo: 5mm skill: combat"; + if (iid == IID_WP_DKS1) + return "dmg: 40 rng: 80 ammo: 7.62 skill: combat"; + if (iid == IID_WP_DKS1_S) + return "dmg: 35 rng: 70 ammo: 7.62 skill: combat"; + if (iid == IID_WP_MOONLIGHT) + return "dmg: 16 rng: 40 ammo: 5.56 skill: combat"; + if (iid == IID_WP_G11) + return "dmg: 14 rng: 40 ammo: csels skill: combat"; + if (iid == IID_WP_GAUSERIFLE) + return "dmg: 30 rng: 90 ammo: 2mmec skill: combat"; + if (iid == IID_WP_PULSERIFLE) + return "dmg: 16 rng: 40 ammo: 5mm skill: combat"; + if (iid == IID_WP_TURBOPLASMA) + return "dmg: 32 rng: 45 ammo: cell skill: science"; + if (iid == IID_WP_PLASMACARBINE) + return "dmg: 28 rng: 30 ammo: cell skill: science"; + if (iid == IID_WP_FNFAL) + return "dmg: 32 rng: 60 ammo: 7.62 skill: combat"; + if (iid == IID_WP_ROCKETLAUNCHER) + return "dmg: 100 rng: 30 ammo: rkt skill: combat"; + if (iid == IID_WP_LASERGATLING) + return "dmg: 24 rng: 60 ammo: cell skill: combat"; + if (iid == IID_WP_ACR) + return "dmg: 50 rng: 90 ammo: 7.62 skill: combat"; + if (iid == IID_AM_NEEDLER) return "good armor-peircing properties"; @@ -1918,13 +2162,13 @@ string(float iid) GetItemImage = if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) return "prifle.jpg"; if (iid == IID_WP_WINCHESTER) - return "double.jpg"; + return "sawedoff.jpg"; if (iid == IID_WP_MOSSBERG) return "citykiller.jpg"; if (iid == IID_WP_JACKHAMMER) return "jackhammer.jpg"; if (iid == IID_WP_GREASEGUN) - return "ggun2.jpg"; + return "greasegun.jpg"; if (iid == IID_WP_MP9) return "mp9.jpg"; if (iid == IID_WP_RANGEMASTER) @@ -1940,7 +2184,7 @@ string(float iid) GetItemImage = if (iid == IID_WP_AK74) return "ak47.jpg"; if (iid == IID_WP_ACR) - return "acr.jpg"; + return "bozar.png"; if (iid == IID_WP_DKS1) return "dks1.png"; if (iid == IID_WP_DKS1_S) @@ -2164,7 +2408,7 @@ float(string itname) ItemIDOfName = return IID_WP_AK112_M; if (itname == "ak-74") return IID_WP_AK74; - if (itname == "acr") + if (itname == "bozar") return IID_WP_ACR; if (itname == "dks-1") return IID_WP_DKS1; @@ -2299,8 +2543,6 @@ float(string itname) ItemIDOfName = float(float slotno, float iid) FitsInSlot = { - if (IsEquip(iid)) - return false; if (!iid) //nothing can be put in every slot. return true; diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 94139f01d..25022ca80 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -289,13 +289,13 @@ void() junk_touch = void() SpawnJunk = { - setorigin(self, self.origin + '0 0 64'); + setorigin(self, self.origin + '0 0 32'); self.movetype = MOVETYPE_BOUNCE; self.velocity_x = crandom()*600; self.velocity_y = crandom()*600; self.velocity_z = -100; - self.avelocity_y = crandom()*600; + self.avelocity_y = crandom()*300; if (random()*100 < 50) setmodel (self, "progs/junk1.mdl"); @@ -303,38 +303,38 @@ void() SpawnJunk = setmodel (self, "progs/junk2.mdl"); self.touch = junk_touch; - self.solid = SOLID_BBOX; + self.solid = SOLID_TRIGGER; setsize (self, '-12 -12 0', '12 12 12'); self.takedamage = DAMAGE_NO; self.classname = "random_junk"; if (random()*100 <= 10) - self.islot1 = IID_MISC_JUNK; + self.islot1 = SlotVal(IID_MISC_JUNK, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_NUKACOLA; + self.islot1 = SlotVal(IID_MISC_NUKACOLA, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_CHEMICALS; + self.islot1 = SlotVal(IID_MISC_CHEMICALS, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_AEROSOL; + self.islot1 = SlotVal(IID_MISC_AEROSOL, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_RDXCRYSTAL; + self.islot1 = SlotVal(IID_MISC_RDXCRYSTAL, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_STEELPIPE; + self.islot1 = SlotVal(IID_MISC_STEELPIPE, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_DUCKTAPE; + self.islot1 = SlotVal(IID_MISC_DUCKTAPE, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_LCD; + self.islot1 = SlotVal(IID_MISC_LCD, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_CIRCUITBOARD; + self.islot1 = SlotVal(IID_MISC_CIRCUITBOARD, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_COPPERWIRE; + self.islot1 = SlotVal(IID_MISC_COPPERWIRE, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_HMXCOMPOUND; + self.islot1 = SlotVal(IID_MISC_HMXCOMPOUND, 1); else if (random()*100 <= 10) - self.islot1 = IID_MISC_GUM; - else if (random()*100 <= 10) - self.islot1 = IID_MISC_XRAYTUBE; + self.islot1 = SlotVal(IID_MISC_GUM, 1); + else + self.islot1 = SlotVal(IID_MISC_JUNK, 1); if (random()*100 <= 10) self.flash = 2; @@ -358,9 +358,7 @@ void() TreasureChest = self.takedamage = DAMAGE_NO; self.classname = "treasure_chest"; - SpawnJunk(); - SpawnJunk(); - SpawnJunk(); + }; @@ -1327,6 +1325,9 @@ void() weapon_supershotgun = if (random()<0.25) TreasureChest(); + + SpawnJunk(); + SpawnJunk(); }; /*QUAKED weapon_nailgun (0 .5 .8) (-16 -16 0) (16 16 32) @@ -1342,6 +1343,9 @@ void() weapon_nailgun = Explosive(); else TreasureChest(); + + SpawnJunk(); + SpawnJunk(); }; /*QUAKED weapon_supernailgun (0 .5 .8) (-16 -16 0) (16 16 32) @@ -1357,6 +1361,10 @@ void() weapon_supernailgun = Explosive(); else if (random()*100 <= 40) TreasureChest(); + + SpawnJunk(); + SpawnJunk(); + SpawnJunk(); }; /*QUAKED weapon_grenadelauncher (0 .5 .8) (-16 -16 0) (16 16 32) @@ -1374,6 +1382,8 @@ void() weapon_grenadelauncher = else if (random()*100 <= 40) TreasureChest(); + SpawnJunk(); + }; /*QUAKED weapon_rocketlauncher (0 .5 .8) (-16 -16 0) (16 16 32) @@ -1390,6 +1400,7 @@ void() weapon_rocketlauncher = else if (random()*100 <= 40) TreasureChest(); + SpawnJunk(); }; @@ -1408,6 +1419,7 @@ void() weapon_lightning = else if (random()*100 <= 40) TreasureChest(); + SpawnJunk(); }; diff --git a/quakec/fallout2/menus.qc b/quakec/fallout2/menus.qc index 6953b3c8b..e337a8b14 100644 --- a/quakec/fallout2/menus.qc +++ b/quakec/fallout2/menus.qc @@ -469,8 +469,13 @@ string () MissionString = return ("‘‘‘ mission select ‘‘‘\n" "\n" "\n" - "1‘ get new mission\n" - "2‘ grab one later \n\n\n"); + "1‘ hostage rescue \n" + "2‘ capture supplies \n" + "3‘ shadow mission \n" + "4‘ zombie mission \n" + "5‘ destroy supplies \n" + "6‘ bomb defusal \n\n" + "7‘ grab one later \n"); }; string () DepartString = diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index addf315d1..dea400841 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -1028,61 +1028,24 @@ void() brotherhood_merchant = self.xslot15 = SlotVal(IID_CHEM_MEDICALBAG, 25); - 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); + self.xslot16 = SlotVal(IID_WP_ACR, 1); + self.xslot17 = SlotVal(IID_AM_762MM, 30); + + + self.xslot18 = SlotVal(IID_WP_ALIENBLASTER, 1); + self.xslot19 = SlotVal(IID_AM_ENERGYCELL, 30); if (random()*100 < 20) - self.xslot18 = SlotVal(IID_AM_ENERGYCELL, 30); + self.xslot20 = SlotVal(IID_AM_ENERGYCELL, 30); else if (random()*100 < 20) - self.xslot18 = SlotVal(IID_EQUIP_BELTPOUCH, 1); + self.xslot20 = SlotVal(IID_EQUIP_BELTPOUCH, 1); else if (random()*100 < 20) - self.xslot18 = SlotVal(IID_EQUIP_STEALTHBOY, 1); + self.xslot20 = SlotVal(IID_EQUIP_STEALTHBOY, 1); else if (random()*100 < 20) - self.xslot18 = SlotVal(IID_EQUIP_CLIMBINGGEAR, 1); + self.xslot20 = 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); + self.xslot20 = SlotVal(IID_EQUIP_TOOLKIT, 1); }; void() brotherhood_sergeant = diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index 4de8c3c8a..9ce5b0eac 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -976,10 +976,10 @@ void() W_PlayerMenu = } else if (self.currentmenu == "select_mission") { - if (self.impulse == 1) + if (self.impulse >= 1 && self.impulse <= 6) { if (infokey(world, "objective") == "return" || infokey(world, "objective") == "start") - get_new_mission(); + get_new_mission(1); else { sprint(self, 2, "you're already on a mission!\n"); @@ -993,7 +993,8 @@ void() W_PlayerMenu = self.impulse = 0; return; } - else if (self.impulse == 2) + + else { centerprint(self, "\n"); self.currentmenu = "none"; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 97f2f987a..8122d25ef 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1589,7 +1589,7 @@ void() W_Attack = else if (weap == IID_WP_USP) FirePistol(14, 6, "weapons/usp.wav", 2000, 0.1); else if (weap == IID_WP_USP_S) - FirePistol(12, 6, "weapons/smg_s.wav", 2000, 0.1); + FirePistol(12, 6, "weapons/smg_s.wav", 1800, 0.1); else if (weap == IID_WP_DEAGLE) FirePistol(18, 9, "weapons/deagle.wav", 3000, 0.1); else if (weap == IID_WP_DEAGLE_M) @@ -1641,9 +1641,9 @@ void() W_Attack = else if (weap == IID_WP_AK112_M) FireAssaultRifle(16, 10, "weapons/ak112.wav", 4000, 0.095); else if (weap == IID_WP_ACR) - FireAssaultRifle(16, 7, "weapons/ak112.wav", 9000, 0.090); + FireAssaultRifle(25, 7, "weapons/bozar.wav", 9000, 0.090); else if (weap == IID_WP_AK74) - FireAssaultRifle(20, 12, "ogre/ak47.wav", 3500, 0.090); + FireAssaultRifle(45, 12, "ogre/ak47.wav", 3500, 0.090); else if (weap == IID_WP_DKS1) FireAssaultRifle(40, 3, "weapons/dks-1.wav", 8000, 0.2); else if (weap == IID_WP_MOONLIGHT && self.zoom == 0) diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 8e988c775..63c9d020e 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -227,9 +227,9 @@ void() load_monster = if (world.map_ent2 == 6) monster_ogre(); if (world.map_ent2 == 7) - monster_wizard(); + monster_army(); if (world.map_ent2 == 8) - monster_knight(); + monster_demon1(); if (world.map_ent2 == 9) monster_demon1(); if (world.map_ent2 == 10) @@ -1969,6 +1969,7 @@ void() worldspawn = precache_model ("progs/v_smg.mdl"); precache_model ("progs/v_rangem.mdl"); precache_model ("progs/v_pipe.mdl"); + precache_model ("progs/v_bozar.mdl"); precache_model ("progs/v_double.mdl"); precache_model ("progs/v_combat.mdl"); precache_model ("progs/v_mp9.mdl"); @@ -2035,6 +2036,7 @@ void() worldspawn = precache_model ("progs/w_rocket.mdl"); precache_model ("progs/w_plasma.mdl"); precache_model ("progs/w_chain.mdl"); + precache_model ("progs/w_bozar.mdl"); precache_model ("progs/money.mdl"); precache_model ("progs/turrgun.mdl"); @@ -2146,6 +2148,7 @@ void() worldspawn = precache_sound ("weapons/moonlight-1.wav"); precache_sound ("weapons/moonlight-2.wav"); precache_sound ("weapons/needler.wav"); + precache_sound ("weapons/bozar.wav"); precache_sound ("weapons/smg_s.wav"); precache_sound ("weapons/shotgun1.wav"); precache_sound ("weapons/mp5.wav"); From f9a2e32c641abc3c010a8f48407081b2580d78c6 Mon Sep 17 00:00:00 2001 From: Magnus Date: Tue, 10 Nov 2009 13:57:08 +0000 Subject: [PATCH 17/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3431 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 39 ++++--------- quakec/fallout2/cmds.qc | 32 +++++++++++ quakec/fallout2/csqc/invent.qc | 79 +++++++++++++++++++++----- quakec/fallout2/enforcer.qc | 2 +- quakec/fallout2/hos.qc | 2 +- quakec/fallout2/inventory.qc | 2 +- quakec/fallout2/items.qc | 100 ++++++++++++++++++++------------- quakec/fallout2/misc.qc | 14 +++++ quakec/fallout2/ogre.qc | 4 +- quakec/fallout2/soldier.qc | 34 ++++++----- quakec/fallout2/weapons.qc | 34 ++++++----- quakec/fallout2/world.qc | 49 +++++++--------- 12 files changed, 244 insertions(+), 147 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 11a928604..6ca64e7cf 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -101,12 +101,12 @@ void() SetNewParms = //on account of changing maps before spawning was resulting in no inventory. parm1 = 0; parm2 = 0; - parm3 = 0; + parm3 = SlotVal(IID_ARM_LEATHER, 1); parm4 = 0; parm5 = 0; parm6 = 0; parm7 = 0; - parm8 = 300; + parm8 = 150; parm9 = 0; parm10 = 0; parm11 = 0; @@ -599,7 +599,7 @@ void() PutClientInServer = self.takedamage = DAMAGE_AIM; self.movetype = MOVETYPE_WALK; self.show_hostile = 0; - self.max_health = 100 + self.skill_combat; + self.max_health = 150 + (self.skill_combat*2); self.health = 100; self.flags = FL_CLIENT; self.air_finished = time + 12; @@ -644,8 +644,8 @@ void() PutClientInServer = if (self.current_slot == 0) { self.islot1 = SlotVal(IID_WP_GLOCK, 15); - self.islot2 = 0; - self.islot3 = 0; + self.islot2 = SlotVal(IID_WP_KNIFE, 1); + self.islot3 = SlotVal(IID_ARM_LEATHER, 1); self.islot5 = SlotVal(IID_CHEM_STIMPACK, 3); self.islot7 = SlotVal(IID_AM_10MM, 30); self.islot8 = 0; @@ -1546,35 +1546,20 @@ void() PlayerPreThink = DisplayMenu (); return; } - else if (self.score >= 500 && self.score <= 1550 && self.currentmenu == "none") - { - self.score = self.score + 1; - } - else if (self.score >= 1551 && self.currentmenu == "none") - { - self.currentmenu = "gain_skill"; - self.missionbrief = 2; - DisplayMenu (); - } - else if (self.score >= 200 && self.currentmenu == "none") - { - self.score = 500; - } - if ((self.skill_combat + self.skill_sneak + self.skill_doctor + self.skill_science) <= 10) + + if (self.score < 200) { - if (self.currentmenu == "none") + if ((self.skill_combat + self.skill_doctor + self.skill_sneak + self.skill_science) <= 10) { - self.currentmenu = "gain_skill"; - self.missionbrief = 2; - return; + self.score = 200; + + sound (self, CHAN_BODY, "misc/secret.wav", 1, ATTN_NORM); + sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n"); } } - - - if (self.cycle1 < time) { if (self.currentmenu != "none") diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index ea157fd60..bd51fa127 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -259,6 +259,31 @@ void(string arg1) Cmd_InvDrop = DropFromSlot(slotno, true, false); }; +void(string arg1) Cmd_GainLevel = +{ + if (self.score < 200) + { + sprint(self, 2, "not enough experience points.\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + if (self.score >= 200) + { + sound (self, CHAN_BODY, "buttons/switch02.wav", 1, ATTN_NORM); + self.score = self.score - 200; + } + + if (arg1 == "combat") + self.skill_combat = self.skill_combat + 1; + else if (arg1 == "doctor") + self.skill_doctor = self.skill_doctor + 1; + else if (arg1 == "sneak") + self.skill_sneak = self.skill_sneak + 1; + else if (arg1 == "science") + self.skill_science = self.skill_science + 1; +}; + + void(string arg1) Cmd_InvBuy = { local float x,y, iid, amount, money, item; @@ -373,6 +398,7 @@ void(string arg1) Cmd_InvSell = SetItemSlot(self, slotno, 0); x = GetBaseValue(iid); + x = x / 5; y = ftos(x); z = GetItemName(iid); @@ -1168,6 +1194,12 @@ void(string line) SV_ParseClientCommand = return; Cmd_InvBuy(argv(1)); } + else if (cmd == "gainlevel") + { + if (self.deadflag || self.current_slot==0) + return; + Cmd_GainLevel(argv(1)); + } else if (cmd == "invmix") { if (self.deadflag) diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 2fde5006c..fc24389c7 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -17,6 +17,8 @@ float sliderpos; float downslotnum; //the slot number when the mousecursor when down +float selected_class; + vector toppos = '0 32 0'; float k_mouse1; @@ -442,7 +444,7 @@ void() Trader_Draw = { drawfill(contextpos - '8 8 0', '48 48 0', '0 0 0', 1.0); op = floor((mousepos_y - contextpos_y)/8); - drawstring(contextpos + '0 8 0', "buy?", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', + drawstring(contextpos + '0 8 0', "buy?", '8 8 0', '1 1 0' + (op!=1)*'0 0 1', 1); } @@ -468,6 +470,7 @@ void() Trader_Draw = void() Pipboy_Draw = { float width,height,lvl,bar; + string skill; vector w; width = cvar("vid_conwidth"); @@ -477,45 +480,84 @@ void() Pipboy_Draw = - 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); + if (mousepos_y >= 200 && mousepos_y <= 325) + { + if (mousepos_x >= 150 && mousepos_x <= 250) + { + drawpic('0 0 0', "gui/pipboy/skills2.jpg", '640 480 0', '1 1 1', 1); + selected_class = 1; + } + else if (mousepos_x >= 250 && mousepos_x <= 350) + { + drawpic('0 0 0', "gui/pipboy/skills3.jpg", '640 480 0', '1 1 1', 1); + selected_class = 2; + } + else if (mousepos_x >= 350 && mousepos_x <= 450) + { + drawpic('0 0 0', "gui/pipboy/skills4.jpg", '640 480 0', '1 1 1', 1); + selected_class = 3; + } + else if (mousepos_x >= 450 && mousepos_x <= 550) + { + drawpic('0 0 0', "gui/pipboy/skills5.jpg", '640 480 0', '1 1 1', 1); + selected_class = 4; + } + else + { + drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0', '1 1 1', 1); + selected_class = 0; + } + } + else + { + drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0', '1 1 1', 1); + selected_class = 0; + } + + + bar = 0; lvl = getstati(100); + skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('4 2 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/red.jpg", '1 4 0'*2, '1 1 1', 1); + drawpic('210 190 0' - ('0 4 0'*bar), "gui/graph/red.jpg", '16 2 0'*2, '1 1 1', 1); bar = bar + 1; } + drawstring('220 190 0' - ('0 4 0'*(lvl+4)), skill, '8 8 0', '1 1 1', 1); - drawstring('3 2.2 0'*IMGSIZEF, "DOCTOR", '8 8 8', '1 1 1', 1); bar = 0; lvl = getstati(101); + skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('4 2.2 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/green.jpg", '1 4 0'*2, '1 1 1', 1); + drawpic('305 190 0' - ('0 4 0'*bar), "gui/graph/green.jpg", '16 2 0'*2, '1 1 1', 1); bar = bar + 1; } + drawstring('315 190 0' - ('0 4 0'*(lvl+4)), skill, '8 8 0', '1 1 1', 1); - - drawstring('3 2.4 0'*IMGSIZEF, "SNEAK", '8 8 8', '1 1 1', 1); bar = 0; lvl = getstati(102); + skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('4 2.4 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/blue.jpg", '1 4 0'*2, '1 1 1', 1); + drawpic('395 190 0' - ('0 4 0'*bar), "gui/graph/blue.jpg", '16 2 0'*2, '1 1 1', 1); bar = bar + 1; } + drawstring('405 190 0' - ('0 4 0'*(lvl+4)), skill, '8 8 0', '1 1 1', 1); - drawstring('3 2.6 0'*IMGSIZEF, "SCIENCE", '8 8 8', '1 1 1', 1); bar = 0; lvl = getstati(103); + skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('4 2.6 0'*IMGSIZEF + ('4 0 0'*bar), "gui/graph/yellow.jpg", '1 4 0'*2, '1 1 1', 1); + drawpic('485 190 0' - ('0 4 0'*bar), "gui/graph/yellow.jpg", '16 2 0'*2, '1 1 1', 1); bar = bar + 1; } + drawstring('495 190 0' - ('0 4 0'*(lvl+4)), skill, '8 8 0', '1 1 1', 1); + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -749,7 +791,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_pipboy = false; show_inventory = false; } - else if (!show_inventory && !show_trader) + else if (!show_inventory && !show_trader && !show_pipboy) return false; else if (param1 == k_mouse1) { @@ -800,7 +842,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = { op = floor((mousepos_y - contextpos_y)/8); - if (op == 0) + if (op == 1) localcmd(strcat("cmd invbuy ", ftos(slotnum), "\n")); showcontextmenu = false; @@ -828,6 +870,17 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = contextpos = mousepos; } } + else if (show_pipboy) + { + if (selected_class == 1) + localcmd("cmd gainlevel combat\n"); + if (selected_class == 2) + localcmd("cmd gainlevel doctor\n"); + if (selected_class == 3) + localcmd("cmd gainlevel sneak\n"); + if (selected_class == 4) + localcmd("cmd gainlevel science\n"); + } else { show_inventory = false; //they clicked outside, fools! diff --git a/quakec/fallout2/enforcer.qc b/quakec/fallout2/enforcer.qc index bc7a41dad..4915e60fb 100644 --- a/quakec/fallout2/enforcer.qc +++ b/quakec/fallout2/enforcer.qc @@ -452,7 +452,7 @@ void() monster_enforcer = self.netname = "enforcer"; setsize (self, '-12 -12 -24', '12 12 32'); - self.health = 100; + self.health = 200; self.islot3 = SlotVal(IID_ARM_COMBAT, 1); self.armortype = 0.5; self.helmet = 1; diff --git a/quakec/fallout2/hos.qc b/quakec/fallout2/hos.qc index 70bfa8759..9f0498f93 100644 --- a/quakec/fallout2/hos.qc +++ b/quakec/fallout2/hos.qc @@ -246,7 +246,7 @@ void (vector jojo) spawn_civilian = self.movetype = MOVETYPE_STEP; self.takedamage = DAMAGE_AIM; setmodel (self, "progs/hosfem.mdl"); - setsize (self, '-10 -10 24', '10 10 24'); + setsize (self, '-10 -10 -24', '10 10 24'); self.health = 80; self.netname = "civilian"; self.classname = "rhostage"; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index d4e7f2a28..888e8255a 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -672,7 +672,7 @@ string(float iid) GetItemVModel = if (iid == IID_WP_ALIENBLASTER) return "progs/v_blaster.mdl"; if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) - return "progs/v_bozar.mdl"; + return "progs/v_pipe.mdl"; if (iid == IID_WP_WINCHESTER) return "progs/v_double.mdl"; if (iid == IID_WP_MOSSBERG) diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 25022ca80..7321ea218 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -287,59 +287,65 @@ void() junk_touch = }; -void() SpawnJunk = +void(vector loc) SpawnJunk = { - setorigin(self, self.origin + '0 0 32'); - self.movetype = MOVETYPE_BOUNCE; - self.velocity_x = crandom()*600; - self.velocity_y = crandom()*600; - self.velocity_z = -100; + local entity junk; - self.avelocity_y = crandom()*300; + junk = spawn (); + + setorigin(junk, loc + '0 0 96'); + + + junk.movetype = MOVETYPE_BOUNCE; + junk.velocity_x = crandom()*600; + junk.velocity_y = crandom()*600; + junk.velocity_z = -100; + + junk.avelocity_y = crandom()*300; if (random()*100 < 50) - setmodel (self, "progs/junk1.mdl"); + setmodel (junk, "progs/junk1.mdl"); else - setmodel (self, "progs/junk2.mdl"); + setmodel (junk, "progs/junk2.mdl"); - self.touch = junk_touch; - self.solid = SOLID_TRIGGER; - setsize (self, '-12 -12 0', '12 12 12'); - self.takedamage = DAMAGE_NO; - self.classname = "random_junk"; + junk.touch = junk_touch; + junk.solid = SOLID_TRIGGER; + setsize (junk, '-12 -12 0', '12 12 12'); + junk.takedamage = DAMAGE_NO; + junk.classname = "random_junk"; if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_JUNK, 1); + junk.islot1 = SlotVal(IID_MISC_JUNK, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_NUKACOLA, 1); + junk.islot1 = SlotVal(IID_MISC_NUKACOLA, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_CHEMICALS, 1); + junk.islot1 = SlotVal(IID_MISC_CHEMICALS, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_AEROSOL, 1); + junk.islot1 = SlotVal(IID_MISC_AEROSOL, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_RDXCRYSTAL, 1); + junk.islot1 = SlotVal(IID_MISC_RDXCRYSTAL, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_STEELPIPE, 1); + junk.islot1 = SlotVal(IID_MISC_STEELPIPE, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_DUCKTAPE, 1); + junk.islot1 = SlotVal(IID_MISC_DUCKTAPE, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_LCD, 1); + junk.islot1 = SlotVal(IID_MISC_LCD, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_CIRCUITBOARD, 1); + junk.islot1 = SlotVal(IID_MISC_CIRCUITBOARD, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_COPPERWIRE, 1); + junk.islot1 = SlotVal(IID_MISC_COPPERWIRE, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_HMXCOMPOUND, 1); + junk.islot1 = SlotVal(IID_MISC_HMXCOMPOUND, 1); else if (random()*100 <= 10) - self.islot1 = SlotVal(IID_MISC_GUM, 1); + junk.islot1 = SlotVal(IID_MISC_GUM, 1); else - self.islot1 = SlotVal(IID_MISC_JUNK, 1); + junk.islot1 = SlotVal(IID_MISC_JUNK, 1); if (random()*100 <= 10) - self.flash = 2; + junk.flash = 2; else - self.flash = 1; + junk.flash = 1; }; void() TreasureChest = { @@ -1326,8 +1332,12 @@ void() weapon_supershotgun = if (random()<0.25) TreasureChest(); - SpawnJunk(); - SpawnJunk(); + + + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); }; /*QUAKED weapon_nailgun (0 .5 .8) (-16 -16 0) (16 16 32) @@ -1344,8 +1354,10 @@ void() weapon_nailgun = else TreasureChest(); - SpawnJunk(); - SpawnJunk(); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); }; /*QUAKED weapon_supernailgun (0 .5 .8) (-16 -16 0) (16 16 32) @@ -1362,9 +1374,10 @@ void() weapon_supernailgun = else if (random()*100 <= 40) TreasureChest(); - SpawnJunk(); - SpawnJunk(); - SpawnJunk(); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); }; /*QUAKED weapon_grenadelauncher (0 .5 .8) (-16 -16 0) (16 16 32) @@ -1382,7 +1395,10 @@ void() weapon_grenadelauncher = else if (random()*100 <= 40) TreasureChest(); - SpawnJunk(); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); }; @@ -1400,7 +1416,10 @@ void() weapon_rocketlauncher = else if (random()*100 <= 40) TreasureChest(); - SpawnJunk(); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); }; @@ -1419,7 +1438,10 @@ void() weapon_lightning = else if (random()*100 <= 40) TreasureChest(); - SpawnJunk(); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); + SpawnJunk(self.origin); }; diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index dea400841..628e118f1 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -1072,6 +1072,20 @@ void() brotherhood_soldier = self.solid = SOLID_SLIDEBOX; setsize (self, '-16 -16 -24', '16 16 32'); self.takedamage = DAMAGE_NO; + + self.xslot1 = SlotVal(IID_AM_45ACP, 30); + self.xslot2 = SlotVal(IID_AM_10MM, 30); + self.xslot3 = SlotVal(IID_AM_12GAUGESHELLS, 30); + self.xslot4 = SlotVal(IID_AM_5MMHIGHVEL, 30); + self.xslot5 = SlotVal(IID_AM_762MM, 30); + self.xslot6 = SlotVal(IID_AM_556MM, 30); + self.xslot7 = SlotVal(IID_AM_ENERGYCELL, 30); + self.xslot8 = SlotVal(IID_AM_CASELESS, 30); + self.xslot8 = SlotVal(IID_AM_NEEDLER, 30); + self.xslot16 = SlotVal(IID_WP_AK112_M, 1); + self.xslot17 = SlotVal(IID_WP_G11, 1); + self.xslot18 = SlotVal(IID_WP_JACKHAMMER, 1); + self.xslot19 = SlotVal(IID_WP_MOONLIGHT, 1); }; void() brotherhood_guard = diff --git a/quakec/fallout2/ogre.qc b/quakec/fallout2/ogre.qc index 5cd996a1d..d77b88247 100644 --- a/quakec/fallout2/ogre.qc +++ b/quakec/fallout2/ogre.qc @@ -879,7 +879,7 @@ void (entity attacker, float damage) ogre_pain = if (self.pain_finished > time) return; - if (random()*8 <= 1) + if (random()*100 <= 1) { ogre_paind1(); self.pain_finished = time + 7; @@ -1126,7 +1126,7 @@ void () monster_ogre = self.netname = "mutant"; self.classname = "monster"; setsize (self, '-16 -16 -24', '16 16 48'); - self.health = 200; + self.health = 300; self.team = 3; self.islot3 = SlotVal(IID_ARM_LEATHER, 1); self.armornoise = "misc/thud.wav"; diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index fb7d66b8b..3ff3c20c1 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -383,7 +383,7 @@ void (float tmp, float dam) army_fire4 = makevectors (self.angles); - sound (self, CHAN_WEAPON, "weapons/ak112.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/ak47.wav", PLAT_LOW_TRIGGER, ATTN_NORM); src = self.origin + v_forward*10; src_z = self.absmin_z + self.size_z * 0.7; @@ -747,7 +747,7 @@ void () army_atk6 = [ 86, army_atk7 ] void () army_atk7 = [ 87, army_atk8 ] { ai_face (); - army_fire (120, 19); + army_fire (170, 19); }; void () army_atk8 = [ 88, army_atk9 ] @@ -789,7 +789,7 @@ void () army_atka4 = [ 84, army_atka5 ] void () army_atka5 = [ 85, army_atka6 ] { ai_face (); - army_fire2 (200, 7); + army_fire2 (250, 7); }; void () army_atka6 = [ 86, army_atka7 ] @@ -850,7 +850,7 @@ void () army_atkb5 = [ 85, army_atkb6 ] if (r == RANGE_NEAR || r == RANGE_MELEE) self.recoil = 1; - army_fire3 (100, 15); + army_fire3 (120, 15); }; void () army_atkb6 = [ 86, army_atkb7 ] @@ -858,8 +858,8 @@ void () army_atkb6 = [ 86, army_atkb7 ] ai_face (); if (self.recoil == 1) { - army_fire3 (150, 14); - army_fire3 (150, 14); + army_fire3 (160, 14); + army_fire3 (160, 14); } }; @@ -867,7 +867,7 @@ void () army_atkb7 = [ 87, army_atkb8 ] { ai_face (); if (self.recoil == 1) - army_fire3 (150, 14); + army_fire3 (160, 14); }; void () army_atkb8 = [ 88, army_atkb9 ] @@ -875,8 +875,8 @@ void () army_atkb8 = [ 88, army_atkb9 ] ai_face (); if (self.recoil == 1) { - army_fire3 (150, 14); - army_fire3 (150, 14); + army_fire3 (160, 14); + army_fire3 (160, 14); } }; @@ -885,8 +885,8 @@ void () army_atkb9 = [ 89, army_run1 ] ai_face (); if (self.recoil == 1) { - army_fire3 (150, 14); - army_fire3 (150, 14); + army_fire3 (170, 14); + army_fire3 (170, 14); } }; @@ -919,7 +919,7 @@ void () army_atkcs4 = [ 84, army_atkcs5 ] void () army_atkcs5 = [ 85, army_atkcs6 ] { ai_face (); - sound (self, CHAN_WEAPON, "weapons/ak112.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/ak47.wav", PLAT_LOW_TRIGGER, ATTN_NORM); army_fire4 (100, 20); }; @@ -1483,7 +1483,7 @@ void () army_die = if (self.weapon == 4) DropFromChest(self, IID_WP_MP9, 15); if (self.weapon == 5) - DropFromChest(self, IID_WP_AK112, 12); + DropFromChest(self, IID_WP_AK47, 12); if (self.weapon == 1) DropFromChest(self, IID_AM_44MAGNUM, 10); @@ -1572,8 +1572,6 @@ void (vector jojo, entity friend) spawn_soldier = te = te.chain; } -//soldiers have either 0, 1 or 2 grenades - self.grenadetoggle = floor(random()*2); //soldiers have either pistol, smg, shotgun or rifle self.weapon = ceil(random()*4); @@ -1711,7 +1709,7 @@ void () monster_army = self.movetype = MOVETYPE_STEP; setmodel (self, "progs/soldier.mdl"); setsize (self, '-12 -12 -24', '12 12 28'); - self.health = 70+random()*30; + self.health = 100; self.team = 3; self.islot3 = SlotVal(IID_ARM_LEATHER, 1); self.armortype = 0.2; @@ -1795,7 +1793,7 @@ void () monster_army = if (random()<0.25 && (world.map_obj != OBJ_SHADOW)) spawn_soldier(self.origin, self); - if (random()<0.25 && world.map_obj == OBJ_HOSTAGE) + if (random()<0.25) spawn_civilian(self.origin); }; @@ -1906,7 +1904,7 @@ void () monster_commander = commanders = commanders + 1; setsize (self, '-12 -12 -24', '12 12 32'); - self.health = 120; + self.health = 300; self.islot3 = SlotVal(IID_ARM_COMBAT, 1); self.armortype = 0.5; self.helmet = 1; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 8122d25ef..16aea9034 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -125,7 +125,7 @@ float (entity healer, entity saved) RevivePlayer = // saved.materialize = 200; saved.ghost = 0; - saved.health = 40; + saved.health = 20 + (healer.skill_doctor); saved.air_finished = time + 10; saved.view_ofs = '0 0 22'; self = saved; @@ -1621,11 +1621,11 @@ void() W_Attack = else if (weap == IID_WP_DKS1_S) FireAssaultRifle(35, 3, "weapons/moonlight1.wav", 5000, 0.25); else if (weap == IID_WP_WINCHESTER) - W_FireShotgun (2, 5, 8, 50, 1500, 0, "weapons/shotgun1.wav"); + W_FireShotgun (2, 5, 7, 50, 1500, 0, "weapons/shotgun1.wav"); else if (weap == IID_WP_MOSSBERG) - W_FireShotgun (2, 5, 7, 20, 2000, 1, "weapons/citykiller.wav"); + W_FireShotgun (2, 5, 6, 20, 2000, 1, "weapons/citykiller.wav"); else if (weap == IID_WP_JACKHAMMER) - W_FireShotgun (1, 5, 7, 30, 1750, 2, "weapons/citykiller.wav"); + W_FireShotgun (1, 5, 6, 30, 1750, 2, "weapons/citykiller.wav"); else if (weap == IID_WP_GREASEGUN) FireSMG(14, 0, "weapons/mp7.wav", 1500, 0.10); else if (weap == IID_WP_MP9) @@ -1641,7 +1641,7 @@ void() W_Attack = else if (weap == IID_WP_AK112_M) FireAssaultRifle(16, 10, "weapons/ak112.wav", 4000, 0.095); else if (weap == IID_WP_ACR) - FireAssaultRifle(25, 7, "weapons/bozar.wav", 9000, 0.090); + FireAssaultRifle(45, 7, "weapons/amr.wav", 9000, 0.1); else if (weap == IID_WP_AK74) FireAssaultRifle(45, 12, "ogre/ak47.wav", 3500, 0.090); else if (weap == IID_WP_DKS1) @@ -3310,6 +3310,8 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (weap == IID_WP_DKS1) loud_noise(100); + else if (weap == IID_WP_ACR) + loud_noise(110); else if (weap == IID_WP_MOONLIGHT) loud_noise(5); else if (weap == IID_WP_DKS1_S) @@ -3446,6 +3448,8 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR stuffcmd (self, "-attack\n"); if (weap == IID_WP_GAUSERIFLE) stuffcmd (self, "-attack\n"); + if (weap == IID_WP_ACR) + stuffcmd (self, "-attack\n"); if (trace_ent.takedamage) { @@ -4218,8 +4222,8 @@ void () UseStimpack = thing = thing.chain; } - self.health = self.health + 20; - self.regen = self.regen + (5 + (self.skill_doctor)); + self.health = self.health + 10 + (self.skill_doctor/2); + self.regen = self.regen + (3 + (self.skill_doctor/2)); } } else if (trace_ent.classname == "player")//healing another team-mate @@ -4290,8 +4294,8 @@ void () UseStimpack = sprint(self, PRINT_MEDIUM, trace_ent.netname); sprint(self, PRINT_MEDIUM, " with a stimpack\n"); - trace_ent.health = trace_ent.health + 20; - trace_ent.regen = trace_ent.regen + (5 + (self.skill_doctor)); + trace_ent.health = trace_ent.health + 10 + (self.skill_doctor/2); + trace_ent.regen = trace_ent.regen + (3 + (self.skill_doctor/2)); } } } @@ -4449,7 +4453,7 @@ void () UseMedicalBag = sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); sprint(self, PRINT_MEDIUM, "you start to bandage yourself\n"); - self.regen = self.regen + self.skill_doctor; + self.regen = self.regen + 3 + (self.skill_doctor/2); } } else if (trace_ent.classname == "player")//healing another team-mate @@ -4505,7 +4509,7 @@ void () UseMedicalBag = sprint(self, PRINT_MEDIUM, trace_ent.netname); sprint(self, PRINT_MEDIUM, " with a stimpack\n"); - trace_ent.regen = trace_ent.regen + self.skill_doctor; + trace_ent.regen = trace_ent.regen + 3 + (self.skill_doctor/2); } } } @@ -6016,10 +6020,10 @@ void (float rec, float number, float dam, float spread, float ran, float auto, s weap = ToIID(self.(SlotField(self.current_slot))); - var1 = (16 + (random () * 12) * (self.recoil)); - var2 = (16 + (random () * 12) * (self.recoil)); - var3 = (16 + (random () * 12) * (self.recoil)); - var4 = (16 + (random () * 12) * (self.recoil)); + var1 = ((random () * 16) * (self.recoil)); + var2 = ((random () * 16) * (self.recoil)); + var3 = ((random () * 16) * (self.recoil)); + var4 = ((random () * 16) * (self.recoil)); if (self.position == 0) player_single1 (); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 63c9d020e..ce670a4db 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -189,30 +189,13 @@ void() load_monster = { self.zone = 1; - monster_army(); -/* - if (world.map_ent1 == 1) - monster_dog(); - if (world.map_ent1 == 2) - monster_zombie(); - if (world.map_ent1 == 3) - monster_tarbaby(); - if (world.map_ent1 == 4 || world.map_ent1 == 5) - monster_army(); - if (world.map_ent1 == 6) - monster_ogre(); - if (world.map_ent1 == 7) - monster_wizard(); - if (world.map_ent1 == 8) - monster_knight(); - if (world.map_ent1 == 9) - monster_demon1(); - if (world.map_ent1 == 10) - monster_enforcer(); - if (world.map_ent1 == 11) - monster_shalrath(); - if (world.map_ent1 == 12) - monster_shambler();*/ + + if (world.map_obj == OBJ_DEADTOWN) + monster_zombie(); + else + monster_army(); + + } else if (y <= world.map_ent2_percent) { @@ -222,12 +205,12 @@ void() load_monster = monster_dog(); if (world.map_ent2 == 2) monster_zombie(); - if (world.map_ent2 == 3 || world.map_ent2 == 4 || world.map_ent2 == 5) + if (world.map_ent2 == 3 || world.map_ent2 == 4) monster_army(); - if (world.map_ent2 == 6) + if (world.map_ent2 == 5 || world.map_ent2 == 6) monster_ogre(); if (world.map_ent2 == 7) - monster_army(); + monster_enforcer(); if (world.map_ent2 == 8) monster_demon1(); if (world.map_ent2 == 9) @@ -248,13 +231,13 @@ void() load_monster = else if (random()<0.10) monster_zombie(); else if (random()<0.10) - monster_army(); + monster_enforcer(); else if (random()<0.10) monster_ogre(); else if (random()<0.10) - monster_wizard(); + monster_army(); else if (random()<0.10) - monster_knight(); + monster_enforcer(); if (world.map_obj == OBJ_DEADTOWN) spawn_ghoul(self.origin + '128 0 0'); @@ -742,6 +725,7 @@ if (coop == 1) // Players vs Monsters if (endgame_timer == 0) { bprint(2, "^4** ^bTHE HOSTAGES WERE SAVED!!!^b **\n"); + sound (self, CHAN_VOICE, "misc/fanfare.wav", 1, ATTN_NONE); ze = find (world, classname, "player"); while (ze != world) { @@ -2105,6 +2089,10 @@ void() worldspawn = precache_sound ("misc/hosdown.wav"); precache_sound ("misc/rescued.wav"); precache_sound ("misc/beep1.wav"); + precache_sound ("buttons/switch02.wav"); + precache_sound ("buttons/switch04.wav"); + precache_sound ("misc/secret.wav"); + precache_sound ("misc/fanfare.wav"); precache_sound ("player/gib1.wav"); precache_sound ("player/step1.wav"); @@ -2149,6 +2137,7 @@ void() worldspawn = precache_sound ("weapons/moonlight-2.wav"); precache_sound ("weapons/needler.wav"); precache_sound ("weapons/bozar.wav"); + precache_sound ("weapons/amr.wav"); precache_sound ("weapons/smg_s.wav"); precache_sound ("weapons/shotgun1.wav"); precache_sound ("weapons/mp5.wav"); From 99c7db1c080bb78805833d2f8da541856c9e92d3 Mon Sep 17 00:00:00 2001 From: Magnus Date: Wed, 11 Nov 2009 07:31:51 +0000 Subject: [PATCH 18/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3432 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/combat.qc | 3 +- quakec/fallout2/csqc/invent.qc | 45 +++++++++++- quakec/fallout2/dog.qc | 8 +-- quakec/fallout2/inventory.qc | 30 ++++---- quakec/fallout2/items.qc | 12 ++-- quakec/fallout2/menus.qc | 2 +- quakec/fallout2/misc.qc | 121 ++++++++------------------------- quakec/fallout2/mod_buy.qc | 23 ++++--- quakec/fallout2/soldier.qc | 25 +++---- quakec/fallout2/weapons.qc | 88 +++++++++++++----------- quakec/fallout2/world.qc | 5 +- 11 files changed, 180 insertions(+), 182 deletions(-) diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 6ee2d327a..e7987ada0 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -118,7 +118,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = local float save, dm; local float take, severity, helm; local string attackerteam, targteam; - + local string info1, info2; if (!targ.takedamage) return; @@ -535,6 +535,7 @@ take = damage; } + targ.health = targ.health - take; if (targ.classname == "monster" && targ.enemy.classname != "player" && attacker.classname == "player") diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index fc24389c7..0cf3c766d 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -623,8 +623,18 @@ void() Invent_Draw = SlotImageSmall('1 12.5 0'*IMGSIZEK, 4); - SlotImageSmall('11 12 0'*IMGSIZEK, 23); - SlotImageSmall('13 12 0'*IMGSIZEK, 24); + check = getstati(97); + if (check > 0) + SlotImage('11 12 0'*IMGSIZEK, 23); + else + drawpic('11 12 0'*IMGSIZEK, "gui/pipboy/mix.png", IMGSIZEH, '1 1 1', 1); + + + check = getstati(98); + if (check > 0) + SlotImage('13 12 0'*IMGSIZEK, 24); + else + drawpic('13 12 0'*IMGSIZEK, "gui/pipboy/mix.png", IMGSIZEH, '1 1 1', 1); /* perki = GetPerkImage(getstati(60)); @@ -756,7 +766,36 @@ else if (slotnum == 99) } // drawfill(mousepos, '8 8 0', '0 0 0', 0.7); // drawstring(mousepos, "^", '8 8 0', '1 1 1', 1); - drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); + + if (downslotnum == 0) + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); + else + { + + if (downslotnum <= 16) + it = getstati(31+downslotnum); + else + { + if (downslotnum == 17) + it = getstati(91); + if (downslotnum == 18) + it = getstati(92); + if (downslotnum == 19) + it = getstati(93); + if (downslotnum == 20) + it = getstati(94); + if (downslotnum == 21) + it = getstati(95); + if (downslotnum == 22) + it = getstati(96); + if (downslotnum == 23) + it = getstati(97); + if (downslotnum == 24) + it = getstati(98); + } + itname = GetItemImage(ToIID(it)); + drawpic(mousepos, strcat("gui/", itname), '48 48 0', '1 1 1', 1); + } }; void() CalcScrollPos = diff --git a/quakec/fallout2/dog.qc b/quakec/fallout2/dog.qc index 8e945196a..2978bd51c 100644 --- a/quakec/fallout2/dog.qc +++ b/quakec/fallout2/dog.qc @@ -66,12 +66,8 @@ local float ldmg; T_Damage (self.enemy, self, self, ldmg); - if (random()*25 <= 5) - { - stuffcmd(self.enemy, "drop\n"); - self.enemy.attack_finished = time + 1; - self.enemy.position = 2; - } + self.enemy.attack_finished = time + 0.25; + }; void() Dog_JumpTouch = diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 888e8255a..a4e36dae7 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -681,13 +681,13 @@ string(float iid) GetItemVModel = if (iid == IID_WP_JACKHAMMER) return "progs/v_jackhammer.mdl"; if (iid == IID_WP_GREASEGUN) - return "progs/v_mp9.mdl"; + return "progs/v_smg.mdl"; if (iid == IID_WP_MP9) - return "progs/v_smg.mdl"; - if (iid == IID_WP_GREASEGUN_S) return "progs/v_mp9.mdl"; - if (iid == IID_WP_MP9_S) + if (iid == IID_WP_GREASEGUN_S) return "progs/v_smg.mdl"; + if (iid == IID_WP_MP9_S) + return "progs/v_mp9.mdl"; if (iid == IID_WP_RANGEMASTER) return "progs/v_rangem.mdl"; if (iid == IID_WP_RANGEMASTER_SCOPE) @@ -707,7 +707,7 @@ string(float iid) GetItemVModel = if (iid == IID_WP_FNFAL) return "progs/v_fnfal.mdl"; if (iid == IID_WP_AK112_M) - return "progs/v_ak47.mdl"; + return "progs/v_lsw.mdl"; if (iid == IID_WP_G11) return "progs/v_g11.mdl"; @@ -916,7 +916,7 @@ float(float iid) WeaponAmmoType = if (iid == IID_WP_AK47) return IID_AM_WARSAW; if (iid == IID_WP_AK112_M) - return IID_AM_5MMHIGHVEL; + return IID_AM_556MM; if (iid == IID_WP_AK74) return IID_AM_WARSAW; if (iid == IID_WP_ACR) @@ -993,7 +993,7 @@ float(float iid) WeaponMagQuant = if (iid == IID_WP_AK112) return 24; if (iid == IID_WP_AK112_M) - return 90; + return 100; if (iid == IID_WP_AK74) return 30; if (iid == IID_WP_ACR) @@ -1077,7 +1077,7 @@ float(float iid) GetItemWeight = if (iid == IID_WP_AK47) return 6; if (iid == IID_WP_AK112_M) - return 7; + return 8; if (iid == IID_WP_AK74) return 5; if (iid == IID_WP_ACR) @@ -1206,7 +1206,7 @@ string(float iid) GetItemName = if (iid == IID_WP_WINCHESTER) return "winchester (12g)"; if (iid == IID_WP_MOSSBERG) - return "mossberg (12g)"; + return "citykiller (12g)"; if (iid == IID_WP_JACKHAMMER) return "jackhammer (12g)"; if (iid == IID_WP_GREASEGUN) @@ -1222,7 +1222,7 @@ string(float iid) GetItemName = if (iid == IID_WP_AK112) return "ak-112 (5mm jhp)"; if (iid == IID_WP_AK112_M) - return "ak-112 (extended magazine)"; + return "light support weapon (5.56mm)"; if (iid == IID_WP_AK74) return "ak-47 (7.62mm warsaw pact)"; if (iid == IID_WP_ACR) @@ -1707,9 +1707,9 @@ string(float iid) GetItemDesc = if (iid == IID_WP_AK112) return "a common assault rifle with extreme durability"; if (iid == IID_WP_AK112_M) - return "this rifle has been modified to accept larger magazines"; + return "a great weapon for providing suppressing fire"; if (iid == IID_WP_DKS1) - return "this sturdy rifle fires .308\na larger and more reliable round"; + return "the larger caliber 7.62mm provides extra power"; if (iid == IID_WP_DKS1_S) return ".308 sniper rifle, silenced for stealth-ops"; if (iid == IID_WP_DKS1) @@ -1733,7 +1733,7 @@ string(float iid) GetItemDesc = if (iid == IID_WP_LASERGATLING) return "quite simply, the ultimate in heavy firepower"; if (iid == IID_WP_ACR) - return "sniper-style weapon that supports burst fire"; + return "fast, powerful, and accurate - a sniper's dream"; if (iid == IID_AM_NEEDLER) @@ -1784,7 +1784,7 @@ string(float iid) GetItemDesc = if (iid == IID_ARM_METAL) return "gives great protection at a sacrifice to speed."; if (iid == IID_ARM_TESLA) - return "experimental armor with high deflection but low absorb."; + return "experimental armor. great against small rounds."; if (iid == IID_ARM_COMBAT) return "this all-purpose armor is designed for combat missions."; if (iid == IID_ARM_SEVA) @@ -2180,7 +2180,7 @@ string(float iid) GetItemImage = if (iid == IID_WP_AK112) return "ak112.png"; if (iid == IID_WP_AK112_M) - return "ak112.png"; + return "lsw.png"; if (iid == IID_WP_AK74) return "ak47.jpg"; if (iid == IID_WP_ACR) diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 7321ea218..2f0bbc30a 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -291,6 +291,9 @@ void(vector loc) SpawnJunk = { local entity junk; + if (random()*100 <= 80) + return; + junk = spawn (); setorigin(junk, loc + '0 0 96'); @@ -315,13 +318,12 @@ void(vector loc) SpawnJunk = junk.classname = "random_junk"; - if (random()*100 <= 10) - junk.islot1 = SlotVal(IID_MISC_JUNK, 1); - else if (random()*100 <= 10) + + if (random()*100 <= 25) junk.islot1 = SlotVal(IID_MISC_NUKACOLA, 1); - else if (random()*100 <= 10) + else if (random()*100 <= 25) junk.islot1 = SlotVal(IID_MISC_CHEMICALS, 1); - else if (random()*100 <= 10) + else if (random()*100 <= 25) junk.islot1 = SlotVal(IID_MISC_AEROSOL, 1); else if (random()*100 <= 10) junk.islot1 = SlotVal(IID_MISC_RDXCRYSTAL, 1); diff --git a/quakec/fallout2/menus.qc b/quakec/fallout2/menus.qc index e337a8b14..a6c063a38 100644 --- a/quakec/fallout2/menus.qc +++ b/quakec/fallout2/menus.qc @@ -474,7 +474,7 @@ string () MissionString = "3‘ shadow mission \n" "4‘ zombie mission \n" "5‘ destroy supplies \n" - "6‘ bomb defusal \n\n" + "6‘ bomb defusal \n\n" "7‘ grab one later \n"); }; diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index 628e118f1..fef0a35b0 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -911,6 +911,13 @@ void() misc_noisemaker = void() brotherhood_merchant = { + local entity sign; +/* + sign = spawn(); + sign.origin = self.origin + '0 0 32'; + setmodel(sign, "progs/trader.spr"); + sign.solid = SOLID_NOT;*/ + setorigin(self, self.origin + '0 0 64'); self.movetype = MOVETYPE_BOUNCE; self.velocity_z = -200; @@ -925,111 +932,35 @@ void() brotherhood_merchant = self.nextthink = time + 0.5; - if (random()*100 < 33) - { - self.xslot1 = SlotVal(IID_WP_GREASEGUN, 1); - self.xslot6 = SlotVal(IID_AM_45ACP, 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); - } + + self.xslot1 = SlotVal(IID_WP_USP, 1); + self.xslot6 = SlotVal(IID_AM_45ACP, 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); - } + 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); - } + self.xslot3 = SlotVal(IID_WP_WINCHESTER, 1); + self.xslot8 = SlotVal(IID_AM_12GAUGESHELLS, 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); - } + self.xslot4 = SlotVal(IID_WP_RANGEMASTER, 1); + self.xslot9 = SlotVal(IID_AM_556MM, 30); - if (random()*100 < 33) - { - self.xslot5 = SlotVal(IID_WP_AK112, 1); - self.xslot10 = SlotVal(IID_AM_5MMHIGHVEL, 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_MP9, 1); - self.xslot10 = SlotVal(IID_AM_10MM, 30); - } + self.xslot5 = SlotVal(IID_WP_MP9, 1); + self.xslot10 = SlotVal(IID_AM_10MM, 30); - if (random()*100 < 50) - self.xslot11 = SlotVal(IID_ARM_LEATHER, 1); - else - self.xslot11 = SlotVal(IID_ARM_VANDAL, 1); - if (random()*100 < 50) - self.xslot12 = SlotVal(IID_ARM_METAL, 1); - else - self.xslot12 = SlotVal(IID_ARM_TESLA, 1); - - if (random()*100 < 75) - self.xslot13 = SlotVal(IID_ARM_COMBAT, 1); - else - self.xslot13 = SlotVal(IID_ARM_SEVA, 1); + self.xslot11 = SlotVal(IID_ARM_VANDAL, 1); + self.xslot12 = SlotVal(IID_ARM_METAL, 1); + self.xslot13 = SlotVal(IID_ARM_TESLA, 1); self.xslot14 = SlotVal(IID_CHEM_STIMPACK, 1); - - self.xslot15 = SlotVal(IID_CHEM_MEDICALBAG, 25); - self.xslot16 = SlotVal(IID_WP_ACR, 1); + self.xslot16 = SlotVal(IID_WP_DKS1, 1); self.xslot17 = SlotVal(IID_AM_762MM, 30); @@ -1081,11 +1012,17 @@ void() brotherhood_soldier = self.xslot6 = SlotVal(IID_AM_556MM, 30); self.xslot7 = SlotVal(IID_AM_ENERGYCELL, 30); self.xslot8 = SlotVal(IID_AM_CASELESS, 30); - self.xslot8 = SlotVal(IID_AM_NEEDLER, 30); + self.xslot9 = SlotVal(IID_AM_NEEDLER, 30); + self.xslot15 = SlotVal(IID_WP_ACR, 1); self.xslot16 = SlotVal(IID_WP_AK112_M, 1); self.xslot17 = SlotVal(IID_WP_G11, 1); self.xslot18 = SlotVal(IID_WP_JACKHAMMER, 1); self.xslot19 = SlotVal(IID_WP_MOONLIGHT, 1); + self.xslot19 = SlotVal(IID_WP_MOSSBERG, 1); + + self.think = shop_face; + self.nextthink = time + 0.5; + }; void() brotherhood_guard = diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index 9ce5b0eac..bd3bb0f74 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -978,14 +978,21 @@ void() W_PlayerMenu = { if (self.impulse >= 1 && self.impulse <= 6) { - if (infokey(world, "objective") == "return" || infokey(world, "objective") == "start") - get_new_mission(1); - else - { - sprint(self, 2, "you're already on a mission!\n"); - self.currentmenu = "none"; - return; - } + + if (self.impulse == 1) + get_new_mission(1); + if (self.impulse == 2) + get_new_mission(2); + if (self.impulse == 3) + get_new_mission(3); + if (self.impulse == 4) + get_new_mission(4); + if (self.impulse == 5) + get_new_mission(5); + if (self.impulse == 6) + get_new_mission(6); + + self.team = 1; sound (self, CHAN_WEAPON, "effects/radio2.wav", TRUE, ATTN_IDLE); centerprint(self, "mission obtained\n"); diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index 3ff3c20c1..f75cb6177 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -1477,24 +1477,22 @@ void () army_die = if (self.weapon == 1) DropFromChest(self, IID_WP_PIPERIFLE, 1); if (self.weapon == 2) - DropFromChest(self, IID_WP_USP, 6); + DropFromChest(self, IID_WP_GLOCK, 6); if (self.weapon == 3) DropFromChest(self, IID_WP_WINCHESTER, 1); if (self.weapon == 4) - DropFromChest(self, IID_WP_MP9, 15); + DropFromChest(self, IID_WP_GREASEGUN, 15); if (self.weapon == 5) DropFromChest(self, IID_WP_AK47, 12); if (self.weapon == 1) DropFromChest(self, IID_AM_44MAGNUM, 10); if (self.weapon == 2) - DropFromChest(self, IID_AM_45ACP, 12); + DropFromChest(self, IID_AM_10MM, 12); if (self.weapon == 3) DropFromChest(self, IID_AM_12GAUGESHELLS, 8); if (self.weapon == 4) - DropFromChest(self, IID_AM_10MM, 15); - if (self.weapon == 4) - DropFromChest(self, IID_AM_10MM, 30); + DropFromChest(self, IID_AM_45ACP, 30); if (self.weapon == 5) DropFromChest(self, IID_AM_5MMHIGHVEL, 24); @@ -1515,9 +1513,9 @@ void (vector jojo, entity friend) spawn_soldier = self.movetype = MOVETYPE_STEP; setmodel (self, "progs/soldier.mdl"); setsize (self, '-12 -12 -24', '12 12 28'); - self.health = 60+random()*30; self.netname = "raider"; - self.max_health = self.health; + self.max_health = 150; + self.health = self.max_health; self.armornoise = "misc/thud.wav"; self.th_stand = army_stand1; self.th_walk = army_walk1; @@ -1666,8 +1664,9 @@ void () monster_army = self.netname = "enforcer"; setsize (self, '-12 -12 -24', '12 12 28'); - self.health = 120; - self.islot3 = SlotVal(IID_ARM_COMBAT, 1); + self.max_health = 150; + self.health = self.max_health; + self.islot3 = SlotVal(IID_ARM_COMBAT, 1); self.armortype = 35; self.helmet = 1; self.th_stand = enf_stand1; @@ -1709,7 +1708,8 @@ void () monster_army = self.movetype = MOVETYPE_STEP; setmodel (self, "progs/soldier.mdl"); setsize (self, '-12 -12 -24', '12 12 28'); - self.health = 100; + self.max_health = 150; + self.health = self.max_health; self.team = 3; self.islot3 = SlotVal(IID_ARM_LEATHER, 1); self.armortype = 0.2; @@ -1904,7 +1904,8 @@ void () monster_commander = commanders = commanders + 1; setsize (self, '-12 -12 -24', '12 12 32'); - self.health = 300; + self.max_health =250; + self.health = self.max_health; self.islot3 = SlotVal(IID_ARM_COMBAT, 1); self.armortype = 0.5; self.helmet = 1; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 16aea9034..94660ae00 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -199,7 +199,7 @@ void(float damage, float dist, float rate) FireMelee = if (dot < 0.5 && trace_ent.takedamage) { - tdam = 10 + (15*self.skill_sneak); + tdam = 25 + (30*self.skill_sneak); if (getperk(7)) tdam = tdam * 2; @@ -1595,29 +1595,29 @@ void() W_Attack = else if (weap == IID_WP_DEAGLE_M) FirePistol(18, 9, "weapons/deagle.wav", 3000, 0.1); else if (weap == IID_WP_NEEDLER) - FirePistol(16, 2, "weapons/needler.wav", 2000, 0.1); + FirePistol(10+self.skill_science, 2, "weapons/needler.wav", 2000, 0.1); else if (weap == IID_WP_GLOCK) FirePistol(12, 6, "weapons/glock.wav", 2000, 0.1); else if (weap == IID_WP_GLOCK_S) FirePistol(10, 6, "weapons/smg_s.wav", 2000, 0.1); else if (weap == IID_WP_ALIENBLASTER) - FirePulseRifle(16, 0.1, 48, 2); + FirePulseRifle(16, 0.1, 10+self.skill_science*4, 2); else if (weap == IID_WP_PIPERIFLE) - FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + FireAssaultRifle(15+self.skill_science, 5, "weapons/rangem.wav", 5000, 0.1); else if (weap == IID_WP_PIPERIFLE_S) - FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + FireAssaultRifle(15+self.skill_science, 5, "weapons/needler.wav", 5000, 0.1); else if (weap == IID_WP_PIPERIFLE_S_R) - FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + FireAssaultRifle(15+self.skill_science, 5, "weapons/needler.wav", 5000, 0.1); else if (weap == IID_WP_PIPERIFLE_SCOPE_S_R) - FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + FireAssaultRifle(15+self.skill_science, 5, "weapons/needler.wav", 5000, 0.1); else if (weap == IID_WP_PIPERIFLE_SCOPE_S) - FireAssaultRifle(20, 5, "weapons/needler.wav", 5000, 0.1); + FireAssaultRifle(15+self.skill_science, 5, "weapons/needler.wav", 5000, 0.1); else if (weap == IID_WP_PIPERIFLE_R) - FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + FireAssaultRifle(15+self.skill_science, 5, "weapons/rangem.wav", 5000, 0.1); else if (weap == IID_WP_PIPERIFLE_SCOPE) - FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + FireAssaultRifle(15+self.skill_science, 5, "weapons/rangem.wav", 5000, 0.1); else if (weap == IID_WP_PIPERIFLE_SCOPE_R) - FireAssaultRifle(20, 5, "weapons/rangem.wav", 5000, 0.1); + FireAssaultRifle(15+self.skill_science, 5, "weapons/rangem.wav", 5000, 0.1); else if (weap == IID_WP_DKS1_S) FireAssaultRifle(35, 3, "weapons/moonlight1.wav", 5000, 0.25); else if (weap == IID_WP_WINCHESTER) @@ -1627,9 +1627,9 @@ void() W_Attack = else if (weap == IID_WP_JACKHAMMER) W_FireShotgun (1, 5, 6, 30, 1750, 2, "weapons/citykiller.wav"); else if (weap == IID_WP_GREASEGUN) - FireSMG(14, 0, "weapons/mp7.wav", 1500, 0.10); + FireSMG(14, 0, "weapons/mp5.wav", 1500, 0.10); else if (weap == IID_WP_MP9) - FireSMG(12, 0, "weapons/mp5.wav", 1500, 0.08); + FireSMG(12, 0, "ogre/ak74.wav", 1500, 0.08); else if (weap == IID_WP_GREASEGUN_S) FireSMG(12, 0, "weapons/smg_s.wav", 1500, 0.10); else if (weap == IID_WP_MP9_S) @@ -1639,13 +1639,13 @@ void() W_Attack = else if (weap == IID_WP_AK112) FireAssaultRifle(16, 10, "weapons/ak112.wav", 4000, 0.095); else if (weap == IID_WP_AK112_M) - FireAssaultRifle(16, 10, "weapons/ak112.wav", 4000, 0.095); + FireAssaultRifle(16, 10, "weapons/lsw.wav", 5000, 0.10); else if (weap == IID_WP_ACR) - FireAssaultRifle(45, 7, "weapons/amr.wav", 9000, 0.1); + FireAssaultRifle(35, 7, "weapons/bozar.wav", 9000, 0.1); else if (weap == IID_WP_AK74) FireAssaultRifle(45, 12, "ogre/ak47.wav", 3500, 0.090); else if (weap == IID_WP_DKS1) - FireAssaultRifle(40, 3, "weapons/dks-1.wav", 8000, 0.2); + FireAssaultRifle(35, 3, "weapons/dks-1.wav", 8000, 0.2); else if (weap == IID_WP_MOONLIGHT && self.zoom == 0) FireAssaultRifle(16, 10, "weapons/m4-nw.wav", 4000, 0.09); else if (weap == IID_WP_MOONLIGHT && self.zoom == 1) @@ -1762,11 +1762,7 @@ void() CheatCommand = local float x; local string y; - 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); - self.islot10 = SlotVal(IID_WP_ACR, 1); + self.ammo_shells = 900; }; /* @@ -3027,7 +3023,7 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = if (self.velocity == '0 0 0') tmp = tmp + (15*self.recoil); else - tmp = tmp + (20*self.recoil); + tmp = tmp + (25*self.recoil); self.attack = self.attack + 1; self.recoil = self.recoil + 4; @@ -3293,17 +3289,17 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR } } - + if (weap == IID_WP_MOONLIGHT) + { + if (random()<0.5) + sound (self, CHAN_WEAPON, "weapons/moonlight-1.wav", 1, ATTN_NORM); + else + sound (self, CHAN_WEAPON, "weapons/moonlight-2.wav", 1, ATTN_NORM); + } else { - if (weap == IID_WP_MOONLIGHT) - { - if (random()<0.5) - sound (self, CHAN_WEAPON, "weapons/moonlight-1.wav", 1, ATTN_NORM); - else - sound (self, CHAN_WEAPON, "weapons/moonlight-2.wav", 1, ATTN_NORM); - } - else if (weap == IID_WP_DKS1_S) + + if (weap == IID_WP_DKS1_S) sound (self, CHAN_WEAPON, "ogre/ak74.wav", 1, ATTN_NORM); else sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); @@ -3356,8 +3352,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR DropAmmo (); makevectors (self.v_angle); - if (self.recoil >= 10) - self.recoil = 10; + if (self.attack == 0) { @@ -3381,6 +3376,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR tmp = accuracy * 10; xrecoil = dam / 2; + //for the snipers if (self.position == 2 && self.recoil == 0) tmp = tmp * 0.75; @@ -3390,6 +3386,8 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR self.attack = self.attack + 1; self.recoil = self.recoil + xrecoil; + if (self.recoil >= 10) + self.recoil = 10; if (self.zoom > 0 && weap == IID_WP_G11 && self.attack == 3) { @@ -3417,6 +3415,14 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (self.position == 1) y = y * 0.90; + if (self.position == 2 && weap == IID_WP_AK112_M) + { + if (self.recoil >= 7) + self.recoil = 7; + + y = y * 0.10; + tmp = tmp * 0.75; + } if (random()*3<=2) self.driftx = self.driftx + y; else @@ -3442,7 +3448,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR stuffcmd (self, "-attack\n"); if (weap == IID_WP_FNFAL && self.zoom == 1) stuffcmd (self, "-attack\n"); - if (self.zoom > 0 && weap != IID_WP_G11 && weap != IID_WP_MOONLIGHT) + if (self.zoom > 0 && weap != IID_WP_G11 && weap != IID_WP_MOONLIGHT && weap != IID_WP_AK112_M) stuffcmd (self, "-attack\n"); if (self.zoom > 0 && weap == IID_WP_G11 && self.attack >= 3 && weap != IID_WP_MOONLIGHT) stuffcmd (self, "-attack\n"); @@ -6020,10 +6026,10 @@ void (float rec, float number, float dam, float spread, float ran, float auto, s weap = ToIID(self.(SlotField(self.current_slot))); - var1 = ((random () * 16) * (self.recoil)); - var2 = ((random () * 16) * (self.recoil)); - var3 = ((random () * 16) * (self.recoil)); - var4 = ((random () * 16) * (self.recoil)); + var1 = ((random () * 12) * (self.recoil)); + var2 = ((random () * 12) * (self.recoil)); + var3 = ((random () * 12) * (self.recoil)); + var4 = ((random () * 12) * (self.recoil)); if (self.position == 0) player_single1 (); @@ -6214,6 +6220,8 @@ void (string color) ZoomInLarge = if (color == "red") stuffcmd (self, "v_cshift 100 0 0 50\n"); + if (color == "pink") + stuffcmd (self, "v_cshift 100 0 25 50\n"); if (color == "blue") stuffcmd (self, "v_cshift 0 0 100 75\n"); if (color == "green") @@ -6235,6 +6243,8 @@ void (string color) ZoomInSmall = if (color == "red") stuffcmd (self, "v_cshift 100 0 0 50\n"); + if (color == "pink") + stuffcmd (self, "v_cshift 100 0 25 50\n"); if (color == "blue") stuffcmd (self, "v_cshift 0 0 100 75\n"); if (color == "green") @@ -6269,6 +6279,8 @@ void () ZoomIn = ZoomInLarge("purple"); if (weap == IID_WP_ACR) ZoomInLarge("pink"); + if (weap == IID_WP_AK112_M) + ZoomInSmall("pink"); if (weap == IID_WP_DKS1_S) ZoomInLarge("purple"); if (weap == IID_WP_FNFAL) diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index ce670a4db..1cba13e7f 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -703,7 +703,7 @@ if (coop == 1) // Players vs Monsters sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); } - else if (hdead >= 2) //hostages killed + else if (hdead > hcount) //hostages killed { if (endgame_timer == 0) bprint(2, "^4** ^bTHE HOSTAGES WERE KILLED!!!^b **\n"); @@ -1954,6 +1954,7 @@ void() worldspawn = precache_model ("progs/v_rangem.mdl"); precache_model ("progs/v_pipe.mdl"); precache_model ("progs/v_bozar.mdl"); + precache_model ("progs/v_lsw.mdl"); precache_model ("progs/v_double.mdl"); precache_model ("progs/v_combat.mdl"); precache_model ("progs/v_mp9.mdl"); @@ -2084,6 +2085,7 @@ void() worldspawn = precache_sound ("weapons/smoke.wav"); precache_sound ("weapons/energy2.wav"); + precache_sound ("misc/hosdie1.wav"); precache_sound ("misc/hosdie2.wav"); precache_sound ("misc/hosdown.wav"); @@ -2137,6 +2139,7 @@ void() worldspawn = precache_sound ("weapons/moonlight-2.wav"); precache_sound ("weapons/needler.wav"); precache_sound ("weapons/bozar.wav"); + precache_sound ("weapons/lsw.wav"); precache_sound ("weapons/amr.wav"); precache_sound ("weapons/smg_s.wav"); precache_sound ("weapons/shotgun1.wav"); From 1945a40957d5d9d22a1fcd0b70f1e549492d295f Mon Sep 17 00:00:00 2001 From: Magnus Date: Wed, 11 Nov 2009 14:28:41 +0000 Subject: [PATCH 19/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3433 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 2 +- quakec/fallout2/inventory.qc | 10 +++++----- quakec/fallout2/world.qc | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 6ca64e7cf..2824ce8ce 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -106,7 +106,7 @@ void() SetNewParms = parm5 = 0; parm6 = 0; parm7 = 0; - parm8 = 150; + parm8 = 200; parm9 = 0; parm10 = 0; parm11 = 0; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index a4e36dae7..eb05708f3 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -658,9 +658,9 @@ string(float iid) GetItemVModel = if (iid == IID_WP_POWERAXE) return "progs/v_axe.mdl"; if (iid == IID_WP_USP) - return "progs/v_1911.mdl"; + return "progs/v_usp.mdl"; if (iid == IID_WP_USP_S) - return "progs/v_1911.mdl"; + return "progs/v_usp.mdl"; if (iid == IID_WP_GLOCK) return "progs/v_glock.mdl"; if (iid == IID_WP_GLOCK_S) @@ -753,9 +753,9 @@ string(float iid) GetItemWModel = return "progs/w_axe.mdl"; if (iid == IID_WP_USP) - return "progs/w_1911.mdl"; + return "progs/w_usp.mdl"; if (iid == IID_WP_USP_S) - return "progs/w_1911.mdl"; + return "progs/w_usp.mdl"; if (iid == IID_WP_GLOCK) return "progs/w_glock.mdl"; if (iid == IID_WP_GLOCK_S) @@ -765,7 +765,7 @@ string(float iid) GetItemWModel = if (iid == IID_WP_DEAGLE_M) return "progs/w_deagle.mdl"; if (iid == IID_WP_NEEDLER) - return "progs/w_1911.mdl"; + return "progs/w_usp.mdl"; if (iid == IID_WP_ALIENBLASTER) return "progs/w_alien.mdl"; if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 1cba13e7f..ea32f2f38 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -1946,7 +1946,7 @@ void() worldspawn = precache_model ("progs/v_fist.mdl"); precache_model ("progs/v_knife.mdl"); precache_model ("progs/v_spear.mdl"); - precache_model ("progs/v_1911.mdl"); + precache_model ("progs/v_usp.mdl"); precache_model ("progs/v_needler.mdl"); precache_model ("progs/v_glock.mdl"); precache_model ("progs/v_fnfal.mdl"); @@ -2003,7 +2003,7 @@ void() worldspawn = precache_model ("progs/w_combat.mdl"); precache_model ("progs/w_axe.mdl"); precache_model ("progs/w_glock.mdl"); - precache_model ("progs/w_1911.mdl"); + precache_model ("progs/w_usp.mdl"); precache_model ("progs/w_deagle.mdl"); precache_model ("progs/w_alien.mdl"); precache_model ("progs/w_mp9.mdl"); From 7a166b89f7073b7274ac4372aa7beb2c9d8ff1cd Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 11 Nov 2009 20:06:34 +0000 Subject: [PATCH 20/76] Fixed double weapon bug. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3434 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/constants.qc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quakec/fallout2/csqc/constants.qc b/quakec/fallout2/csqc/constants.qc index e7d38ccb8..e30f218cb 100644 --- a/quakec/fallout2/csqc/constants.qc +++ b/quakec/fallout2/csqc/constants.qc @@ -1,4 +1,4 @@ -//FIXME: most of this should be in common/constants.qc +//FIXME: some of this should be in common/constants.qc // // constants @@ -38,9 +38,10 @@ float EF_DIMLIGHT = 8; -float MASK_ENGINE = 1; //this is special. Any entities known by the engine but not the csqc will be added. +float MASK_ENGINE = 1; //this is special. Any entities known by the engine but not the csqc will be added (does not include viewmodels). +float MASK_VIEWMODELS = 2; //this is also special. It will cause all engine viewmodels to be added (including viewmodelforclient). //you can add any other masks below, remember, use bits. -float MASK_NORMAL = 2; +float MASK_NORMAL = 4; //normal, as in normal view ents that the csqc provides From 6b203a8eb4ee104e1aa5e8610f8ac2d86808259c Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 11 Nov 2009 20:09:33 +0000 Subject: [PATCH 21/76] no longer uses vid_conwidth/height. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3435 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/main.qc | 152 +++++++++++++---------------------- 1 file changed, 57 insertions(+), 95 deletions(-) diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index bbbad3372..d20a26dfb 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -3,57 +3,44 @@ float viewmodelindex; .float lerptime; +float scrwidth; +float scrheight; void() Quick_Draw = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - drawstring('32 -80 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " q1 ", '8 8 8', '1 1 1', 1); - QuickImage('32 -72 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 5); + drawstring('32 -80 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " q1 ", '8 8 8', '1 1 1', 1); + QuickImage('32 -72 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 5); - drawstring('64 -80 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " q2 ", '8 8 8', '1 1 1', 1); - QuickImage('64 -72 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 6); + drawstring('64 -80 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " q2 ", '8 8 8', '1 1 1', 1); + QuickImage('64 -72 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 6); }; void() DrawScreen = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - ScreenImage(); }; void() Weapon_Draw = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - local float hand; hand = getstati(61); if (hand == 1) { - drawstring('0 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " HAND 1 ", '8 8 8', '1 1 1', 1); - SlotImage('0 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 1); + drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " HAND 1 ", '8 8 8', '1 1 1', 1); + SlotImage('0 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 1); } if (hand == 2) { - drawstring('0 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " HAND 2 ", '8 8 8', '1 1 1', 1); - SlotImage('0 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 2); + drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " HAND 2 ", '8 8 8', '1 1 1', 1); + SlotImage('0 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 2); } }; void() Crosshair_Draw = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - local float x, a; local vector y; @@ -65,7 +52,7 @@ void() Crosshair_Draw = else if (getstati(54) == 2) a = 8; - y = '1 0 0'*width*0.50 + '0 1 0'*height*0.50; + y = '1 0 0'*scrwidth*0.50 + '0 1 0'*scrheight*0.50; x = a + (4 * getstati(99)); Crosshair(y + '1 0 0'*x, "gui/xhair.jpg"); @@ -89,10 +76,6 @@ void() Crosshair_Draw = void() Position_Draw = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - float pos, s; string sn; @@ -102,45 +85,41 @@ void() Position_Draw = if (s > 0) { - drawstring('0 -32 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), "sneak", '8 8 8', '1 1 1', 1); - PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), 1); - drawstring('0 8 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), strcat("%", sn), '8 8 8', '1 1 1', 1); + drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "sneak", '8 8 8', '1 1 1', 1); + PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 1); + drawstring('0 8 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), strcat("%", sn), '8 8 8', '1 1 1', 1); } else if (pos == 1) { - drawstring('0 -32 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), "duck", '8 8 8', '1 1 1', 1); - PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), 1); + drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "duck", '8 8 8', '1 1 1', 1); + PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 1); } else if (pos == 2) { - drawstring('0 -32 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), "prone", '8 8 8', '1 1 1', 1); - PosImage('0 -24 0'+('1 0 0'*(width*0.40)) +('0 1 0'*(height*0.90)), 2); + drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "prone", '8 8 8', '1 1 1', 1); + PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 2); } }; void() Chem_Draw = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - local float rage, heal; rage = getstati(55); heal = getstati(56); if (rage == 255) - ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 0); + ChemImage('0 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 0); else if (rage == IID_CHEM_ADRENALINE) - ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 1); + ChemImage('0 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 1); else if (rage == IID_CHEM_PSYCHO) - ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 2); + ChemImage('0 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 2); else if (rage == IID_CHEM_BESERK) - ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 3); + ChemImage('0 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 3); else if (heal > 0) - ChemImage('32 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 4); + ChemImage('32 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 4); else if (rage == 777) - ChemImage('0 -24 0'+('1 0 0'*(width*0.60)) +('0 1 0'*(height*0.20)), 5); + ChemImage('0 -24 0'+('1 0 0'*(scrwidth*0.60)) +('0 1 0'*(scrheight*0.20)), 5); }; @@ -148,9 +127,6 @@ void() Ammo_Draw = { local float hand, weap, ammo, amount; local string reveal; - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); hand = getstati(61); @@ -161,11 +137,11 @@ void() Ammo_Draw = amount = ShadowSlotOfItem(self, ammo); //drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1); //SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount); - drawstring('-64 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " AMMO ", '8 8 8', '1 1 1', 1); + drawstring('-64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " AMMO ", '8 8 8', '1 1 1', 1); if (amount > 0) - SlotImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), amount); + SlotImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), amount); else - BlankImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 0); + BlankImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 0); } else if (hand == 2) { @@ -175,48 +151,40 @@ void() Ammo_Draw = reveal = ftos(amount); //drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1); //SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount); - drawstring('-64 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " AMMO ", '8 8 8', '1 1 1', 1); + drawstring('-64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " AMMO ", '8 8 8', '1 1 1', 1); if (amount > 0) - SlotImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), amount); + SlotImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), amount); else - BlankImage('-64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 0); + BlankImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 0); } }; void() Money_Draw = { - float width,height; string cash; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); cash = ftos(getstati(50)); - drawstring('64 -32 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), cash, '8 8 8', '1 1 1', 1); - MoneyImage('64 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), "money.jpg"); + drawstring('64 -32 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), cash, '8 8 8', '1 1 1', 1); + MoneyImage('64 -24 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), "money.jpg"); }; void() Energy_Draw = { - float width,height; string cash; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); cash = ftos(getstati(51)); - drawstring('34 -32 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), cash, '8 8 8', '1 1 1', 1); - MoneyImage('32 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), "energy.jpg"); + drawstring('34 -32 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), cash, '8 8 8', '1 1 1', 1); + MoneyImage('32 -24 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), "energy.jpg"); }; void() Weight_Draw = { - float width,height,carry,max,enc; + float carry,max,enc; string image; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); carry = getstati(52); max = getstati(53); @@ -240,27 +208,21 @@ void() Weight_Draw = else image = "weight/weight_seven.jpg"; - MoneyImage('0 -24 0'+('1 0 0'*(width*0.50)) +('0 1 0'*(height*0.90)), image); + MoneyImage('0 -24 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), image); }; void() Armor_Draw = { - float width,height; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - //drawstring('300 350 0'+('3 0 0'*IMGSIZEF), " ARMOR ", '8 8 8', '1 1 1', 1); //SlotImage('300 358 0'+('3 0 0'*IMGSIZEF), 3); - drawstring('64 -32 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), " ARMOR ", '8 8 8', '1 1 1', 1); - SlotImage('64 -24 0'+('1 0 0'*(width*0.80)) +('0 1 0'*(height*0.90)), 3); + drawstring('64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " ARMOR ", '8 8 8', '1 1 1', 1); + SlotImage('64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 3); }; void() Health_Draw = { - float width,height; - height = cvar("vid_conheight"); float hp, maxhp, status, perc, hpos, tpos, opos, ostatus, ones; string string_hpos, string_tpos, string_opos; @@ -337,24 +299,24 @@ void() Health_Draw = if (perc > 50) { - HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 0, "percent.jpg"); - HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 0, string_hpos); - HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 0, string_tpos); - HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 0, string_opos); + HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 0, "percent.jpg"); + HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_hpos); + HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_tpos); + HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_opos); } else if (perc > 25) { - HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 1, "percent.jpg"); - HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 1, string_hpos); - HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 1, string_tpos); - HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 1, string_opos); + HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 1, "percent.jpg"); + HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_hpos); + HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_tpos); + HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_opos); } else { - HealthImage('0 -24 0'+('0 1 0'*(height*0.90)), 2, "percent.jpg"); - HealthImage('32 -24 0'+('0 1 0'*(height*0.90)), 2, string_hpos); - HealthImage('64 -24 0'+('0 1 0'*(height*0.90)), 2, string_tpos); - HealthImage('96 -24 0'+('0 1 0'*(height*0.90)), 2, string_opos); + HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 2, "percent.jpg"); + HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_hpos); + HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_tpos); + HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_opos); } }; @@ -397,12 +359,12 @@ void() CSQC_Init = -void(float do2d) CSQC_UpdateView = +void(float vwidth, float vheight, float do2d) CSQC_UpdateView = { - float width,height; float usehud; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); + + scrwidth = vwidth; + scrheight = vheight; clearscene(); @@ -420,8 +382,8 @@ void(float do2d) CSQC_UpdateView = //force fullscreen views. setviewprop(VF_MIN, '0 0 0'); - setviewprop(VF_SIZE_X, width); - setviewprop(VF_SIZE_Y, height); + setviewprop(VF_SIZE_X, scrwidth); + setviewprop(VF_SIZE_Y, scrheight); addentities(MASK_ENGINE | MASK_NORMAL); @@ -462,4 +424,4 @@ void(float do2d) CSQC_UpdateView = Chem_Draw(); Crosshair_Draw(); } -}; \ No newline at end of file +}; From 86a1cf9913a6422ad39da2a5e5b645f4933500ad Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 12 Nov 2009 20:35:46 +0000 Subject: [PATCH 22/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3437 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/invent.qc | 400 +++++++++++++++++++++++++++++---- quakec/fallout2/csqc/main.qc | 6 + 2 files changed, 363 insertions(+), 43 deletions(-) diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 0cf3c766d..108bfbbc5 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -5,6 +5,9 @@ float PRINT_MEDIUM = 1; float show_inventory; float show_pipboy; float show_trader; +float show_perks; +float show_items; +float show_gainperk; vector mousepos; @@ -18,6 +21,8 @@ float sliderpos; float downslotnum; //the slot number when the mousecursor when down float selected_class; +float perkslot; +float which_perk; vector toppos = '0 32 0'; @@ -467,6 +472,165 @@ void() Trader_Draw = drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; +void() Perks_Draw = +{ + local string perki, perk2i, p1, p2; + + drawpic('0 0 0', "gui/pipboy/perks.png", '640 480 0', '1 1 1', 1); + + + + if (mousepos_y >= 2.5*IMGSIZEF && mousepos_y <= 3.5*IMGSIZEF) + { + + + if (mousepos_x >= 4*IMGSIZEF && mousepos_x <= 5*IMGSIZEF) + selected_class = 8; + + if (mousepos_x >= 6.5*IMGSIZEF && mousepos_x <= 7.5*IMGSIZEF) + selected_class = 9; + + } + + if (mousepos_y >= 390 && mousepos_y <= 425) + { + + + if (mousepos_x >= 300 && mousepos_x <= 335) + selected_class = 5; + else if (mousepos_x >= 350 && mousepos_x <= 385) + selected_class = 6; + + else if (mousepos_x >= 400 && mousepos_x <= 435) + selected_class = 7; + else + selected_class = 0; + } + + + perki = GetPerkImage(getstati(60)); + perk2i = GetPerkImage(getstati(59)); + + + drawpic('3.5 2 0'*IMGSIZEF, perki, '128 128 0', '1 1 1', 1); + + drawpic('6 2 0'*IMGSIZEF, perk2i, '128 128 0', '1 1 1', 1); + + p1 = PerkNameCentered(1, getstati(60)); + p2 = PerkNameCentered(2, getstati(59)); + + drawstring('4 4.5 0'*IMGSIZEF - '28 0 0', p1, '8 8 8', '1 1 1', 1); + drawstring('6 4.5 0'*IMGSIZEF + '8 0 0', p2, '8 8 8', '1 1 1', 1); + + + + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); +}; + +void() Items_Draw = +{ + local float it; + local string itname; + + drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0', '1 1 1', 1); + + if (mousepos_y >= 390 && mousepos_y <= 425) + { + + drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0', '1 1 1', 1); + + if (mousepos_x >= 300 && mousepos_x <= 325) + selected_class = 5; + else if (mousepos_x >= 350 && mousepos_x <= 385) + selected_class = 6; + + else if (mousepos_x >= 400 && mousepos_x <= 435) + selected_class = 7; + else + selected_class = 0; + } + + SlotImage('3 1.25 0'*IMGSIZEF, 1); + + SlotImage('3 2.75 0'*IMGSIZEF, 2); + + SlotImage('3 4.25 0'*IMGSIZEF, 3); + + + it = getstati(32); + itname = GetItemName(ToIID(it)); + drawstring('4 1.5 0'*IMGSIZEF + '0 0 0', itname, '16 16 0', '1 1 1', 1); + + it = getstati(33); + itname = GetItemName(ToIID(it)); + drawstring('4 3 0'*IMGSIZEF + '0 0 0', itname, '16 16 0', '1 1 1', 1); + + it = getstati(34); + itname = GetItemName(ToIID(it)); + drawstring('4 4.5 0'*IMGSIZEF + '0 0 0', itname, '16 16 0', '1 1 1', 1); + + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); +}; + + + +void() GainPerk_Draw = +{ + local float it; + local string itname, pn, pd; + + drawpic('0 0 0', "gui/pipboy/gainperk.png", '640 480 0', '1 1 1', 1); + + if (mousepos_y >= 2*IMGSIZEF && mousepos_y <= 3*IMGSIZEF) + { + if (mousepos_x >= 2*IMGSIZEF && mousepos_x <= 3*IMGSIZEF) + which_perk = 1; + else if (mousepos_x >= 3*IMGSIZEF && mousepos_x <= 4*IMGSIZEF) + which_perk = 2; + else if (mousepos_x >= 4*IMGSIZEF && mousepos_x <= 5*IMGSIZEF) + which_perk = 3; + else if (mousepos_x >= 5*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) + which_perk = 4; + else if (mousepos_x >= 6*IMGSIZEF && mousepos_x <= 7*IMGSIZEF) + which_perk = 5; + else + which_perk = 0; + } + if (mousepos_y >= 3*IMGSIZEF && mousepos_y <= 4*IMGSIZEF) + { + if (mousepos_x >= 2*IMGSIZEF && mousepos_x <= 3*IMGSIZEF) + which_perk = 6; + else if (mousepos_x >= 3*IMGSIZEF && mousepos_x <= 4*IMGSIZEF) + which_perk = 7; + else if (mousepos_x >= 4*IMGSIZEF && mousepos_x <= 5*IMGSIZEF) + which_perk = 8; + else if (mousepos_x >= 5*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) + which_perk = 9; + else + which_perk = 0; + } + + drawpic('2 2 0'*IMGSIZEF, "gui/perks/Support Fire.png", '64 64 0', '1 1 1', 1); + drawpic('3 2 0'*IMGSIZEF, "gui/perks/Duck And Cover", '64 64 0', '1 1 1', 1); + drawpic('4 2 0'*IMGSIZEF, "gui/perks/Harmless.png", '64 64 0', '1 1 1', 1); + drawpic('5 2 0'*IMGSIZEF, "gui/perks/Hit The Deck.png", '64 64 0', '1 1 1', 1); + drawpic('6 2 0'*IMGSIZEF, "gui/perks/Living Anatomy.png", '64 64 0', '1 1 1', 1); + + drawpic('2 3 0'*IMGSIZEF, "gui/perks/Mutation.png", '64 64 0', '1 1 1', 1); + drawpic('3 3 0'*IMGSIZEF, "gui/perks/Narrow Escape.png", '64 64 0', '1 1 1', 1); + drawpic('4 3 0'*IMGSIZEF, "gui/perks/Schizophrenia.png", '64 64 0', '1 1 1', 1); + drawpic('5 3 0'*IMGSIZEF, "gui/perks/Sleep Tight.png", '64 64 0', '1 1 1', 1); + + pn = PerkName(1, which_perk); + pd = GetPerkDesc(which_perk); + drawstring('32 16 0', pn, '8 8 0', '1 1 1', 1); + drawstring('32 32 0', pd, '8 8 0', '1 1 1', 1); + + + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); +}; + + void() Pipboy_Draw = { float width,height,lvl,bar; @@ -478,8 +642,6 @@ void() Pipboy_Draw = - - if (mousepos_y >= 200 && mousepos_y <= 325) { if (mousepos_x >= 150 && mousepos_x <= 250) @@ -508,6 +670,21 @@ void() Pipboy_Draw = selected_class = 0; } } + else if (mousepos_y >= 390 && mousepos_y <= 425) + { + + drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0', '1 1 1', 1); + + if (mousepos_x >= 300 && mousepos_x <= 325) + selected_class = 5; + else if (mousepos_x >= 350 && mousepos_x <= 375) + selected_class = 6; + + else if (mousepos_x >= 400 && mousepos_x <= 425) + selected_class = 7; + else + selected_class = 0; + } else { drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0', '1 1 1', 1); @@ -515,7 +692,40 @@ void() Pipboy_Draw = } + if (selected_class == 1) + { + drawstring('200 50 0', " combat", '8 8 0', '1 1 1', 1); + drawstring('200 66 0', "place points into this skill for improved", '8 8 0', '1 1 1', 1); + drawstring('200 74 0', "handling of weapons, as well as increased", '8 8 0', '1 1 1', 1); + drawstring('200 82 0', "carry capacity and other aspects of being", '8 8 0', '1 1 1', 1); + drawstring('200 90 0', "trained in combat.", '8 8 0', '1 1 1', 1); + } + if (selected_class == 2) + { + drawstring('200 50 0', " doctor", '8 8 0', '1 1 1', 1); + drawstring('200 66 0', "place points into this skill for improved", '8 8 0', '1 1 1', 1); + drawstring('200 74 0', "chem use, which substantially affects the", '8 8 0', '1 1 1', 1); + drawstring('200 82 0', "amount of healing done, as well as all of", '8 8 0', '1 1 1', 1); + drawstring('200 90 0', "the other aspects of first aid.", '8 8 0', '1 1 1', 1); + } + if (selected_class == 3) + { + drawstring('200 50 0', " sneak", '8 8 0', '1 1 1', 1); + drawstring('200 66 0', "place points into this skill to maximize", '8 8 0', '1 1 1', 1); + drawstring('200 74 0', "your ability to remain unseen by enemies.", '8 8 0', '1 1 1', 1); + drawstring('200 82 0', "grants higher sneak ability and how fast", '8 8 0', '1 1 1', 1); + drawstring('200 90 0', "you can pick locks, among other things.", '8 8 0', '1 1 1', 1); + } + if (selected_class == 4) + { + drawstring('200 50 0', " science", '16 16 0', '1 1 1', 1); + drawstring('200 66 0', "place points into this skill to increase", '8 8 0', '1 1 1', 1); + drawstring('200 74 0', "your chances of making useful items from", '8 8 0', '1 1 1', 1); + drawstring('200 82 0', "junk found in the wasteland. use the mix", '8 8 0', '1 1 1', 1); + drawstring('200 90 0', "box found in your inventory screen.", '8 8 0', '1 1 1', 1); + + } bar = 0; lvl = getstati(100); skill = ftos(lvl+1); @@ -596,20 +806,17 @@ void() Invent_Draw = check = getstati(32); if (check > 0) SlotImage('5.5 1 0'*IMGSIZEF, 1); - else - drawpic('5.5 1 0'*IMGSIZEF, "gui/pipboy/weapon1.png", IMGSIZEV, '1 1 1', 1); + check = getstati(33); if (check > 0) SlotImage('5.5 2 0'*IMGSIZEF, 2); - else - drawpic('5.5 2 0'*IMGSIZEF, "gui/pipboy/weapon2.png", IMGSIZEV, '1 1 1', 1); + check = getstati(34); if (check > 0) SlotImage('5.5 3 0'*IMGSIZEF, 3); - else - drawpic('5.5 3 0'*IMGSIZEF, "gui/pipboy/armor.png", IMGSIZEV, '1 1 1', 1); + SlotImageSmall('1 3 0'*IMGSIZEK, 17); @@ -626,37 +833,12 @@ void() Invent_Draw = check = getstati(97); if (check > 0) SlotImage('11 12 0'*IMGSIZEK, 23); - else - drawpic('11 12 0'*IMGSIZEK, "gui/pipboy/mix.png", IMGSIZEH, '1 1 1', 1); + check = getstati(98); if (check > 0) SlotImage('13 12 0'*IMGSIZEK, 24); - else - drawpic('13 12 0'*IMGSIZEK, "gui/pipboy/mix.png", IMGSIZEH, '1 1 1', 1); - -/* - perki = GetPerkImage(getstati(60)); - perk2i = GetPerkImage(getstati(59)); - - drawstring('112 328 0'+('3 0 0'*IMGSIZEF), " PERK1 ", '8 8 8', '1 1 1', 1); - drawpic('112 336 0'+('3 0 0'*IMGSIZEF), perki, IMGSIZEV, '1 1 1', 1); - drawstring('112 328 0'+('5 0 0'*IMGSIZEF), " PERK2 ", '8 8 8', '1 1 1', 1); - drawpic('112 336 0'+('5 0 0'*IMGSIZEF), perk2i, IMGSIZEV, '1 1 1', 1); - - p1 = PerkName(1, getstati(60)); - p2 = PerkName(2, getstati(59)); - - drawstring('112 408 0'+('3 0 0'*IMGSIZEF), p1, '8 8 8', '1 1 1', 1); - drawstring('112 408 0'+('5 0 0'*IMGSIZEF), p2, '8 8 8', '1 1 1', 1); - -*/ - - - - - if (showcontextmenu && show_inventory) @@ -747,8 +929,8 @@ if (slotnum <= 24) it = getstati(98); } - itname = GetItemDesc(ToIID(it)); - drawstring('32 16 0', itname, '8 8 0', '1 1 1', 1); + itname = GetItemName(ToIID(it)); + drawstring('32 16 0', itname, '16 16 0', '1 1 1', 1); } else if (slotnum == 98) { @@ -817,20 +999,29 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_inventory = !show_inventory; show_pipboy = false; show_trader = false; + show_perks = false; + show_items = false; + show_gainperk = false; } if (param1 == 'p') { show_pipboy = !show_pipboy; show_inventory = false; show_trader = false; + show_perks = false; + show_items = false; + show_gainperk = false; } if (param1 == 'b' && (getstati(108) == 1)) { show_trader = !show_trader; show_pipboy = false; show_inventory = false; + show_perks = false; + show_items = false; + show_gainperk = false; } - else if (!show_inventory && !show_trader && !show_pipboy) + else if (!show_inventory && !show_trader && !show_pipboy && !show_perks && !show_items && !show_gainperk) return false; else if (param1 == k_mouse1) { @@ -858,7 +1049,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = return false; return true; } - if (eventtype == 1 && (show_inventory || show_trader || show_pipboy)) //key up + if (eventtype == 1 && (show_inventory || show_trader || show_pipboy || show_items || show_perks || show_gainperk)) //key up { if (param1 == k_mouse1) { @@ -895,7 +1086,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = else if (downslotnum == slotnum) //mouse didn't move away { - if (slotnum >= 1 && slotnum <= 26) + if (slotnum >= 1 && slotnum <= 26 && show_inventory) { //if there's actually an item there if ((show_inventory) && (getstati(32+slotnum-1) != 0)) @@ -909,16 +1100,139 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = contextpos = mousepos; } } + else if (show_gainperk) + { + if (which_perk == getstati(60)) + return; + if (which_perk == getstati(59)) + return; + if (which_perk >= 1 && which_perk <= 9) + localcmd(strcat("cmd gainperk ", ftos(which_perk), " ", ftos(perkslot), "\n")); + show_inventory = false; + show_pipboy = false; + show_trader = false; + show_perks = true; + show_items = false; + show_gainperk = false; + } else if (show_pipboy) { if (selected_class == 1) localcmd("cmd gainlevel combat\n"); - if (selected_class == 2) + else if (selected_class == 2) localcmd("cmd gainlevel doctor\n"); - if (selected_class == 3) + else if (selected_class == 3) localcmd("cmd gainlevel sneak\n"); - if (selected_class == 4) + else if (selected_class == 4) localcmd("cmd gainlevel science\n"); + else if (selected_class == 5) + { + show_inventory = false; + show_pipboy = true; + show_trader = false; + show_perks = false; + show_items = false; + show_gainperk = false; + } + else if (selected_class == 6) + { + show_inventory = false; + show_pipboy = false; + show_trader = false; + show_perks = false; + show_items = true; + show_gainperk = false; + } + else if (selected_class == 7) + { + show_inventory = false; + show_pipboy = false; + show_trader = false; + show_perks = true; + show_items = false; + show_gainperk = false; + } + + } + else if (show_items) + { + if (selected_class == 5) + { + show_inventory = false; + show_pipboy = true; + show_trader = false; + show_perks = false; + show_items = false; + show_gainperk = false; + } + else if (selected_class == 6) + { + show_inventory = false; + show_pipboy = false; + show_trader = false; + show_perks = false; + show_items = true; + show_gainperk = false; + } + else if (selected_class == 7) + { + show_inventory = false; + show_pipboy = false; + show_trader = false; + show_perks = true; + show_items = false; + show_gainperk = false; + } + } + else if (show_perks) + { + if (selected_class == 5) + { + show_inventory = false; + show_pipboy = true; + show_trader = false; + show_perks = false; + show_items = false; + show_gainperk = false; + } + else if (selected_class == 6) + { + show_inventory = false; + show_pipboy = false; + show_trader = false; + show_perks = false; + show_items = true; + show_gainperk = false; + } + else if (selected_class == 7) + { + show_inventory = false; + show_pipboy = false; + show_trader = false; + show_perks = true; + show_items = false; + show_gainperk = false; + } + else if (selected_class == 8) + { + show_inventory = false; + show_pipboy = false; + show_trader = false; + show_perks = false; + show_items = false; + show_gainperk = true; + perkslot = 1; + } + else if (selected_class == 9) + { + show_inventory = false; + show_pipboy = false; + show_trader = false; + show_perks = false; + show_items = false; + show_gainperk = true; + perkslot = 2; + } } else { @@ -940,7 +1254,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = return false; return true; } - if (eventtype == 2 && (show_inventory || show_trader || show_pipboy)) //mouse + if (eventtype == 2 && (show_inventory || show_trader || show_pipboy || show_items || show_perks || show_gainperk)) //mouse { mousepos_x += param1; mousepos_y += param2; diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index d20a26dfb..408e84618 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -410,6 +410,12 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = Invent_Draw(); else if (show_pipboy) Pipboy_Draw(); + else if (show_perks) + Perks_Draw(); + else if (show_items) + Items_Draw(); + else if (show_gainperk) + GainPerk_Draw(); else { Health_Draw(); From f6819cc0cddc4ce8d727d3d4bb8938bd85bef5bd Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 12 Nov 2009 20:36:42 +0000 Subject: [PATCH 23/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3438 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/ai.qc | 11 +++ quakec/fallout2/cmds.qc | 56 ++++++++++++++ quakec/fallout2/combat.qc | 4 +- quakec/fallout2/inventory.qc | 139 +++++++++++++---------------------- quakec/fallout2/weapons.qc | 20 +++-- 5 files changed, 136 insertions(+), 94 deletions(-) diff --git a/quakec/fallout2/ai.qc b/quakec/fallout2/ai.qc index 481ed4f9a..d28d3182d 100644 --- a/quakec/fallout2/ai.qc +++ b/quakec/fallout2/ai.qc @@ -712,6 +712,17 @@ The monster has an enemy it is trying to kill */ void(float dist) ai_run = { + if (self.hold > 0) + { + self.th_stand (); + + + self.hold = self.hold - 1; + self.think = self.th_run; + self.nextthink = time + 0.1; + return; + } + movedist = dist; // see if the enemy is dead if (self.enemy.health <= 0) diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index bd51fa127..dd15d2b78 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -283,6 +283,56 @@ void(string arg1) Cmd_GainLevel = self.skill_science = self.skill_science + 1; }; +void(string arg1, string arg2) Cmd_GainPerk = +{ + + sound (self, CHAN_BODY, "buttons/switch02.wav", 1, ATTN_NORM); + + + if (arg2 == "1") + { + if (arg1 == "1") + self.perk1 = 1; + if (arg1 == "2") + self.perk1 = 2; + if (arg1 == "3") + self.perk1 = 3; + if (arg1 == "4") + self.perk1 = 4; + if (arg1 == "5") + self.perk1 = 5; + if (arg1 == "6") + self.perk1 = 6; + if (arg1 == "7") + self.perk1 = 7; + if (arg1 == "8") + self.perk1 = 8; + if (arg1 == "9") + self.perk1 = 9; + } + if (arg2 == "2") + { + if (arg1 == "1") + self.perk2 = 1; + if (arg1 == "2") + self.perk2 = 2; + if (arg1 == "3") + self.perk2 = 3; + if (arg1 == "4") + self.perk2 = 4; + if (arg1 == "5") + self.perk2 = 5; + if (arg1 == "6") + self.perk2 = 6; + if (arg1 == "7") + self.perk2 = 7; + if (arg1 == "8") + self.perk2 = 8; + if (arg1 == "9") + self.perk2 = 9; + } +}; + void(string arg1) Cmd_InvBuy = { @@ -1218,6 +1268,12 @@ void(string line) SV_ParseClientCommand = return; Cmd_InvSwap(argv(1), argv(2)); } + else if (cmd == "gainperk") + { + if (self.deadflag || self.current_slot==0) + return; + Cmd_GainPerk(argv(1), argv(2)); + } else if (cmd == "invgive") { if (self.deadflag || self.current_slot==0) diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index e7987ada0..849ad1b9a 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -535,8 +535,8 @@ take = damage; } - - targ.health = targ.health - take; + if (targ.hold <= 0) + targ.health = targ.health - take; if (targ.classname == "monster" && targ.enemy.classname != "player" && attacker.classname == "player") { diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index eb05708f3..03b96b306 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -2572,85 +2572,70 @@ float(float slotno, float iid) FitsInSlot = string (float slot, float int) PerkName = { if (int == 1) - return "unbreakable"; + return "Support Fire"; if (int == 2) - return "feral swiftness"; + return "Duck And Cover"; if (int == 3) - return "stunt man"; + return "Harmless"; if (int == 4) - return "kick in the door!"; + return "Hit The Deck"; if (int == 5) - return "quick draw"; + return "Living Anatomy"; if (int == 6) - return "light step"; + return "Mutation"; if (int == 7) - return "surprise attack"; + return "Narrow Escape"; if (int == 8) - return "large and in charge"; + return "Schizophrenia"; if (int == 9) - return "nintendo gamer"; - if (int == 10) - return "esp"; - if (int == 11) - return "last man standing"; - if (int == 12) - return "bodysnatcher"; - if (int == 13) - return "medicine man"; - if (int == 14) - return "dark alchemist"; - if (int == 15) - return "renegade commando"; - if (int == 16) - return "power shot"; - if (int == 17) - return "one in a million"; - if (int == 18) - return "master blaster"; - if (int == 19) - return "death wish"; + return "Sleep Tight"; + }; +string (float slot, float int) PerkNameCentered = +{ + if (int == 1) + return " Support Fire"; + if (int == 2) + return "Duck And Cover"; + if (int == 3) + return " Harmless"; + if (int == 4) + return " Hit The Deck"; + if (int == 5) + return "Living Anatomy"; + if (int == 6) + return " Mutation"; + if (int == 7) + return "Narrow Escape"; + if (int == 8) + return "Schizophrenia"; + if (int == 9) + return " Sleep Tight"; + +}; + + string(float int) GetPerkImage = { if (int == 1) - return "gui/perks/ironman.jpg"; + return "gui/perks/Support Fire.jpg"; else if (int == 2) - return "gui/perks/swiftness.jpg"; + return "gui/perks/Duck And Cover.jpg"; else if (int == 3) - return "gui/perks/stuntman.jpg"; + return "gui/perks/Harmless.jpg"; else if (int == 4) - return "gui/perks/kickin.jpg"; + return "gui/perks/Hit The Deck.jpg"; else if (int == 5) - return "gui/perks/quickdraw.jpg"; + return "gui/perks/Living Anatomy.jpg"; else if (int == 6) - return "gui/perks/lightstep.jpg"; + return "gui/perks/Mutation.jpg"; else if (int == 7) - return "gui/perks/surprise.jpg"; + return "gui/perks/Narrow Escape.jpg"; else if (int == 8) - return "gui/perks/large.jpg"; + return "gui/perks/Schizophrenia.jpg"; else if (int == 9) - return "gui/perks/nintendo.jpg"; - else if (int == 10) - return "gui/perks/redscare.jpg"; - else if (int == 11) - return "gui/perks/lastman.jpg"; - else if (int == 12) - return "gui/perks/bodysnatcher.jpg"; - else if (int == 13) - return "gui/perks/healingway.jpg"; - else if (int == 14) - return "gui/perks/alchemist.jpg"; - else if (int == 15) - return "gui/perks/eastern.jpg"; - else if (int == 16) - return "gui/perks/powershot.jpg"; - else if (int == 17) - return "gui/perks/million.jpg"; - else if (int == 18) - return "gui/perks/demoman.jpg"; - else if (int == 19) - return "gui/perks/lightning.jpg"; + return "gui/perks/Sleep Tight.jpg"; else return "gui/perks/none.jpg"; @@ -2660,43 +2645,23 @@ string(float int) GetPerkImage = string(float int) GetPerkDesc = { if (int == 1) - return "25% damage resist bonus while at half health"; + return "33% recoil reduction while prone"; else if (int == 2) - return "provides a flat 10% bonus movement speed"; + return "20% damage resist while taking cover and ducking"; else if (int == 3) - return "instant stance change, fast prone movement"; + return "enemies tend to ignore you over your friends"; else if (int == 4) - return "smash down locked doors and chests, very loud"; + return "50% damage resist to area attacks while prone"; else if (int == 5) - return "fast reloading, instant weapon switching"; + return "Aimed attacks get a damage bonus equal to Doctor skill"; else if (int == 6) - return "reduced footsteps, +10% sneak, don't trip traps"; + return "This perk randomly functions as two perks"; else if (int == 7) - return "25% damage bonus to any enemy not targetting you"; + return "Provides you a few hassle-free seconds to escape danger"; else if (int == 8) - return "gain melee knockback and berserker rage bonus"; + return "You sometimes gain additional skills from another place"; else if (int == 9) - return "you'll sometimes enter 'the zone'!"; - else if (int == 10) - return "+10% miss chance to you and any nearby allies"; - else if (int == 11) - return "recover hit points as you mow down foes"; - else if (int == 12) - return "become a master of disguise by looting dead bodies"; - else if (int == 13) - return "25% bonus to all chems used on yourself and others"; - else if (int == 14) - return "mix chems together to make better ones"; - else if (int == 15) - return "you have mastered martial arts and kick attacks"; - else if (int == 16) - return "25% damage bonus to your aimed shots"; - else if (int == 17) - return "you sometimes get very, very lucky with anything"; - else if (int == 18) - return "bigger crosshairs means even bigger damage bonus"; - else if (int == 19) - return "20% damage bonus and you also take 20% more damage"; + return "Automatically kill anything with knife in sneak mode"; else return ""; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 94660ae00..37fc089c8 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1639,7 +1639,7 @@ void() W_Attack = else if (weap == IID_WP_AK112) FireAssaultRifle(16, 10, "weapons/ak112.wav", 4000, 0.095); else if (weap == IID_WP_AK112_M) - FireAssaultRifle(16, 10, "weapons/lsw.wav", 5000, 0.10); + FireAssaultRifle(17, 10, "weapons/lsw.wav", 5000, 0.10); else if (weap == IID_WP_ACR) FireAssaultRifle(35, 7, "weapons/bozar.wav", 9000, 0.1); else if (weap == IID_WP_AK74) @@ -1761,8 +1761,18 @@ void() CheatCommand = { local float x; local string y; + local entity te; self.ammo_shells = 900; + + te = findradius (self.origin, 6000); + while (te) + { + if (te.classname == "monster") + te.hold = 100; + + te = te.chain; + } }; /* @@ -3417,11 +3427,11 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (self.position == 2 && weap == IID_WP_AK112_M) { - if (self.recoil >= 7) - self.recoil = 7; + if (self.recoil >= 8) + self.recoil = 8; - y = y * 0.10; - tmp = tmp * 0.75; + y = y * 0.25; + tmp = tmp * 0.80; } if (random()*3<=2) self.driftx = self.driftx + y; From 03e8a58d5ad64f7eb59e5194c5a6f52511def053 Mon Sep 17 00:00:00 2001 From: Magnus Date: Fri, 13 Nov 2009 05:05:32 +0000 Subject: [PATCH 24/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3442 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 62 ++--------- quakec/fallout2/combat.qc | 27 ++--- quakec/fallout2/csqc/invent.qc | 45 ++++---- quakec/fallout2/defs.qc | 4 +- quakec/fallout2/inventory.qc | 10 +- quakec/fallout2/weapons.qc | 197 ++++++++++++++------------------- quakec/fallout2/world.qc | 9 +- 7 files changed, 149 insertions(+), 205 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 2824ce8ce..dd35f0b22 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -1292,10 +1292,6 @@ void() SneakLevel = if (self.position > 0) sn = sn + 1; - //light step perk gives a 1% bonus to stealth - if (getperk(6)) - sn = sn + 1; - //walking in front of a monster at close range is very bad //at longer ranges it isn't so bad to do so //thus even healer and barbarian types can sneak if they do so smartly @@ -1475,14 +1471,10 @@ void () PositionControl = self.maxspeed = 225; else if (self.position == 1) self.maxspeed = 100; - else if (self.position == 2 && getperk(3))//stunt man - self.maxspeed = 100; else self.maxspeed = 50; - if (getperk(2)) - self.maxspeed = self.maxspeed*1.10; if (self.rage == IID_CHEM_ADRENALINE) self.maxspeed = self.maxspeed*1.20; @@ -1560,6 +1552,14 @@ void() PlayerPreThink = } } + + //perk1timer and perk2timer are "cooldowns" for each perk + if (self.perk1timer > 0) + self.perk1timer = self.perk1timer - 1; + + if (self.perk2timer > 0) + self.perk2timer = self.perk2timer - 1; + if (self.cycle1 < time) { if (self.currentmenu != "none") @@ -1578,14 +1578,6 @@ void() PlayerPreThink = local float lgrip, rgrip; - //nintendo gamer: player sometimes goes into 'the zone' - if ((self.recoil >= 5) && (getperk(9)) && (random()<=0.10)) - { - sprint(self, 2, "THE ZONE!\n"); - self.rage = 255; - self.ragetime = 15; - } - if (self.health > self.max_health) self.health = self.max_health; @@ -1686,38 +1678,6 @@ void() PlayerPreThink = self.ammo_cells = 0; } - if (getperk(100))//SPIRIT LINK - { - te = findradius(self.origin, 500); - - while (te) - { - if (te.classname == "player" && te != self && (te.health < self.health)) - { - if (self.health > 5 && te.health > 0) - { - - sound (te, CHAN_BODY, "items/r_item1.wav", 1, ATTN_IDLE); - sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_IDLE); - - sprint(self, 2, "!SPIRIT LINK\n"); - sprint(te, 2, "!SPIRIT LINK\n"); - - if ((self.health - te.health) > 10) - { - self.health -= 5; - te.health += 5; - } - else - { - self.health -= 1; - te.health += 1; - } - } - } - te = te.chain; - } - } if (self.regen > 0 && !self.deadflag) //don't come back to life. { @@ -2135,9 +2095,10 @@ void() ClientConnect = stuffcmd(self, "alias special impulse 53\n"); stuffcmd(self, "alias exit impulse 100\n"); stuffcmd(self, "alias drop impulse 55\n"); - stuffcmd(self, "alias info impulse 56\n"); stuffcmd(self, "alias zoom impulse 60\n"); stuffcmd(self, "alias hostage impulse 65\n"); + stuffcmd(self, "alias perk1 impulse 61\n"); + stuffcmd(self, "alias perk2 impulse 62\n"); stuffcmd(self, "alias stimpack impulse 225\n"); stuffcmd(self, "alias equip \"cmd invuse 4\"\n"); @@ -2181,7 +2142,8 @@ void() ClientConnect = stuffcmd(self, "bind h hostage\n"); stuffcmd(self, "bind x stimpack\n"); stuffcmd(self, "bind b buy\n"); - stuffcmd(self, "bind q info\n"); + stuffcmd(self, "bind q perk1\n"); + stuffcmd(self, "bind a perk2\n"); stuffcmd(self, "bind shift prone\n"); stuffcmd(self, "bind ctrl duck\n"); diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 849ad1b9a..7b9861b02 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -219,7 +219,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = //paranoia: if taking cover, 25% miss chance (others get 10% bonus) if (targ.rage == 777) { - if (targ.perk1 == 10 || targ.perk2 == 10) + if (targ.perk1 == 2 || targ.perk2 == 2) { if (random()<0.20) { @@ -240,27 +240,28 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = //master blaster: the more you burst, the higher the damage bonus if (attacker.perk1 == 18 || attacker.perk2 == 18) { - if (self.recoil > 10) + if (attacker.recoil > 10) { - sprint(self, 2, "!MASTER BLASTER\n"); - damage = damage * (1 + (self.recoil * 0.01)); + sprint(attacker, 2, "!MASTER BLASTER\n"); + damage = damage * (1 + (attacker.recoil * 0.01)); } } + + //hit the deck + if (targ.perk1 == 4 || targ.perk2 == 4) + { + if (targ.position == 2) + damage = damage * 0.90; + } + //sneak attack: if you attack a creature who isn't fighting you, bonus damage - if (attacker.perk1 == 7 || attacker.perk2 == 7) + if (attacker.skill_sneak > 0) { if (targ.enemy != attacker) { sprint(attacker, 2, "!SNEAK ATTACK\n"); - if (damage <= 10) - damage = damage * 3; - else if (damage <= 20) - damage = damage * 2; - else if (damage <= 30) - damage = damage * 1.5; - else - damage = damage * 1.25; + damage = damage * (1 + (self.skill_sneak/100)); } } diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 108bfbbc5..c423f4557 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -832,13 +832,13 @@ void() Invent_Draw = check = getstati(97); if (check > 0) - SlotImage('11 12 0'*IMGSIZEK, 23); + SlotImageSmall('11 12 0'*IMGSIZEK, 23); check = getstati(98); if (check > 0) - SlotImage('13 12 0'*IMGSIZEK, 24); + SlotImageSmall('13 12 0'*IMGSIZEK, 24); if (showcontextmenu && show_inventory) @@ -883,11 +883,11 @@ void() Invent_Draw = - if (mousepos_x >= 11*IMGSIZEK && mousepos_x <= 12*IMGSIZEK) - if (mousepos_y >= 12*IMGSIZEK && mousepos_y <= 13*IMGSIZEK) + if (mousepos_x >= 10.75*IMGSIZEK && mousepos_x <= 12.25*IMGSIZEK) + if (mousepos_y >= 11.75*IMGSIZEK && mousepos_y <= 13.25*IMGSIZEK) slotnum = 23; - if (mousepos_x >= 13*IMGSIZEK && mousepos_x <= 14*IMGSIZEK) - if (mousepos_y >= 12*IMGSIZEK && mousepos_y <= 13*IMGSIZEK) + if (mousepos_x >= 12.75*IMGSIZEK && mousepos_x <= 14.25*IMGSIZEK) + if (mousepos_y >= 11.75*IMGSIZEK && mousepos_y <= 13.25*IMGSIZEK) slotnum = 24; } else @@ -976,7 +976,7 @@ else if (slotnum == 99) it = getstati(98); } itname = GetItemImage(ToIID(it)); - drawpic(mousepos, strcat("gui/", itname), '48 48 0', '1 1 1', 1); + drawpic(mousepos - '16 16 0', strcat("gui/", itname), '48 48 0', '1 1 1', 1); } }; @@ -1086,21 +1086,8 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = else if (downslotnum == slotnum) //mouse didn't move away { - if (slotnum >= 1 && slotnum <= 26 && show_inventory) - { - //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; - } - } - else if (show_gainperk) + + if (show_gainperk) { if (which_perk == getstati(60)) return; @@ -1234,6 +1221,20 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = perkslot = 2; } } + else if (slotnum >= 1 && slotnum <= 26) + { + //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; + } + } else { show_inventory = false; //they clicked outside, fools! diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 5e6e42c16..67f42fdbb 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -734,11 +734,13 @@ float intermission_running; .string ammotype2; .string currentmenu; .entity wielded; -.float walk; +.float walk; .float steadyaim; .float lastman; .float popup; .float flare; +.float perk1timer; +.float perk2timer; .entity friend; .entity tumbler1; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 03b96b306..3fb2228c8 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -2589,7 +2589,8 @@ string (float slot, float int) PerkName = return "Schizophrenia"; if (int == 9) return "Sleep Tight"; - + if (int == 10) + return "Economic Moves"; }; string (float slot, float int) PerkNameCentered = @@ -2612,7 +2613,8 @@ string (float slot, float int) PerkNameCentered = return "Schizophrenia"; if (int == 9) return " Sleep Tight"; - + if (int == 10) + return "Economic Moves"; }; @@ -2636,6 +2638,8 @@ string(float int) GetPerkImage = return "gui/perks/Schizophrenia.jpg"; else if (int == 9) return "gui/perks/Sleep Tight.jpg"; + else if (int == 10) + return "gui/perks/Economic Moves.jpg"; else return "gui/perks/none.jpg"; @@ -2662,6 +2666,8 @@ string(float int) GetPerkDesc = return "You sometimes gain additional skills from another place"; else if (int == 9) return "Automatically kill anything with knife in sneak mode"; + else if (int == 10) + return "Suffer less time-related penalties for all actions"; else return ""; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 37fc089c8..b54f3f783 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -96,6 +96,55 @@ float() crandom = return 2*(random() - 0.5); }; + + +void(float slotno) UsePerk = +{ + local float x; + local string y, timeleft; + local entity te; + + if (slotno == 1 && self.perk1timer > 0) + { + timeleft = ftos(self.perk1timer); + sprint(self, 2, "ability is not ready yet. ["); + sprint(self, 2, timeleft); + sprint(self, 2, "]\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + + if (slotno == 2 && self.perk2timer > 0) + { + timeleft = ftos(self.perk2timer); + sprint(self, 2, "ability is not ready yet. ["); + sprint(self, 2, timeleft); + sprint(self, 2, "]\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } + + if (self.perk1 == 7 || self.perk2 == 7) + { + if (slotno == 1) + self.perk1timer = 2000; + if (slotno == 2) + self.perk2timer = 2000; + + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + + te = findradius (self.origin, 6000); + while (te) + { + if (te.classname == "monster") + te.hold = 100; + + te = te.chain; + } + } +}; + + void() muzzleflash = { WriteByte (MSG_MULTICAST, SVC_MUZZLEFLASH); @@ -158,31 +207,16 @@ void(float damage, float dist, float rate) FireMelee = local float weap, dot, tdam; local string sdam; - if (getperk(16))//power shot adds a small bonus to the first shot fired + if (getperk(5))//living anatomy { if (self.steadyaim == 0) - { - sprint(self, 2, "!POWER SHOT\n"); - damage = damage * 1.20; - } + damage = damage + self.skill_doctor; } self.recoil = self.recoil + 5; weap = ToIID(self.(SlotField(self.current_slot))); - //large and in charge! adds a small burst of adrenalnie - if ((getperk(8)) && ((weap == IID_WP_SPEAR || weap == IID_WP_SLEDGE || weap == IID_WP_WRENCH))) - { - if (self.ragetime <= 0) - { - sprint(self, 2, "!LARGE AND IN CHARGE\n"); - sound (self, CHAN_VOICE, "player/berserk.wav", 1, ATTN_NORM); - self.rage = IID_CHEM_ADRENALINE; - self.ragetime = 3; - } - } - makevectors (self.v_angle); source = self.origin + '0 0 16'; traceline (source, source + v_forward*dist, FALSE, self); @@ -199,10 +233,10 @@ void(float damage, float dist, float rate) FireMelee = if (dot < 0.5 && trace_ent.takedamage) { - tdam = 25 + (30*self.skill_sneak); + tdam = 20 + (20*self.skill_sneak); - if (getperk(7)) - tdam = tdam * 2; + if (getperk(9)) + tdam = 900; if (self.steadyaim == 0) tdam = tdam + 10; @@ -275,13 +309,6 @@ void(float damage, float dist, float rate) FireMelee = if (weap == IID_WP_SLEDGE || weap == IID_WP_SPEAR || weap == IID_WP_KNIFE) SpawnBlood (org, 1); - if ((getperk(8)) && (weap == IID_WP_SLEDGE || weap == IID_WP_SPEAR || weap == IID_WP_WRENCH)) - { - sprint(self, 2, "!LARGE AND IN CHARGE\n"); - dir = normalize(trace_ent.origin - self.origin); - trace_ent.velocity = dir * 600; - trace_ent.velocity_z = 100+random()*200; - } trace_ent.axhitme = 1; if (trace_ent.classname != "car") @@ -1413,8 +1440,6 @@ void (float slotno) ReloadWeapon = else if (self.position == 1) player_creload1(); - if (getperk(5)) - r = r * 0.5; self.attack_finished = time + r; @@ -1721,7 +1746,7 @@ void() W_ChangeWeapon = if (self.impulse == 1 && self.current_slot != 1) { - if (!getperk(5)) + if (!getperk(10)) { self.weaponframe = 4; self.attack_finished = time + 1; @@ -1734,7 +1759,7 @@ void() W_ChangeWeapon = } else if (self.impulse == 2 && self.current_slot != 2) { - if (!getperk(5)) + if (!getperk(10)) { self.weaponframe = 4; self.attack_finished = time + 1; @@ -1865,7 +1890,7 @@ void () ProneOff = } sprint (self, 2, "position: stand.\n"); - if (getperk(3)) + if (getperk(10)) { self.attack_finished = time + 0.5; self.rtime = time + 0.5; @@ -1891,7 +1916,7 @@ void () ProneOn = return; } - if (!getperk(3) && self.velocity_z != 0) + if (!getperk(10) && self.velocity_z != 0) return; if (self.position == 2) @@ -1906,7 +1931,7 @@ void () ProneOn = self.position = 2; self.view_ofs = '0 0 -10'; sprint (self, 2, "position: prone.\n"); - if (getperk(3)) + if (getperk(10)) { self.attack_finished = time + 0.5; self.rtime = time + 0.5; @@ -1932,7 +1957,7 @@ void () DuckOff = return; } sprint (self, 2, "position: stand.\n"); - if (!getperk(3)) + if (!getperk(10)) { self.attack_finished = time + 0.2; self.rtime = time + 0.2; @@ -1948,7 +1973,7 @@ void () DuckOn = { if (self.waterlevel > 0) { - if (!getperk(3)) + if (!getperk(10)) { self.attack_finished = time + 0.5; self.rtime = time + 0.5; @@ -1971,7 +1996,7 @@ void () DuckOn = return; } - if (!getperk(3)) + if (!getperk(10)) { self.attack_finished = time + 0.5; self.rtime = time + 0.5; @@ -2032,19 +2057,8 @@ void() ImpulseCommands = if (self.impulse == 4 && self.currentmenu == "none") Cmd_InvUse("6"); - if (self.impulse >= 1 && self.currentmenu == "shop_perk1") - { - W_PlayerMenu (); - self.impulse = 0; - return; - } - else if (self.impulse >= 1 && self.currentmenu == "shop_perk2") - { - W_PlayerMenu (); - self.impulse = 0; - return; - } - else if (self.impulse >= 1 && self.impulse <= 10 && self.currentmenu != "none") + + if (self.impulse >= 1 && self.impulse <= 10 && self.currentmenu != "none") { W_PlayerMenu (); self.impulse = 0; @@ -2081,9 +2095,13 @@ void() ImpulseCommands = UseEquipment (); if (self.impulse == 60) ZoomIn (); + if (self.impulse == 61) + UsePerk (1); + if (self.impulse == 62) + UsePerk (2); + if (self.impulse == 65) HostageReport (); - if (self.impulse == 66) WalkOn (); if (self.impulse == 67) @@ -2815,13 +2833,10 @@ void (float dam, float ap, string snd, float rng, float rate) FirePistol = stuffcmd(self, "-attack\n"); self.attack_finished = (time + rate); - if (getperk(16))//power shot adds a small bonus to the first shot fired + if (getperk(5)) { if (self.steadyaim == 0) - { - sprint(self, 2, "!POWER SHOT\n"); - dam = dam * 1.20; - } + dam = dam + self.skill_doctor/2; } if (self.extender == weap && self.silencer != weap) @@ -2965,13 +2980,10 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = weap = ToIID(self.(SlotField(self.current_slot))); - if (getperk(16))//power shot adds a small bonus to the first shot fired + if (getperk(5)) { if (self.steadyaim == 0) - { - sprint(self, 2, "!POWER SHOT\n"); - dam = dam * 1.20; - } + dam = dam + self.skill_doctor/2; } sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); @@ -3290,13 +3302,10 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR weap = ToIID(self.(SlotField(self.current_slot))); - if (getperk(16))//power shot adds a small bonus to the first shot fired + if (getperk(5)) { if (self.steadyaim == 0) - { - sprint(self, 2, "!POWER SHOT\n"); - dam = dam * 1.20; - } + dam = dam + self.skill_doctor/2; } if (weap == IID_WP_MOONLIGHT) @@ -3569,13 +3578,10 @@ void (float dam, float xrecoil, string snd, float rng, float rate) FireMinigun = self.weaponframe = 9; } - if (getperk(16))//power shot adds a small bonus to the first shot fired + if (getperk(5)) { if (self.steadyaim == 0) - { - sprint(self, 2, "!POWER SHOT\n"); - dam = dam * 1.20; - } + dam = dam + self.skill_doctor/3; } loud_noise(50); @@ -4003,9 +4009,8 @@ float(float iid) UseBoostingChem = return false; } - //chem addict: any self-used chem functions better - if (getperk(15)) - duration = duration * 2; + + duration = duration * (1 + (self.skill_doctor / 10)); self.attack_finished = time + 1; @@ -4110,20 +4115,6 @@ float(float iid) UseHealingChem = return false; } - if (self.perk1 == 13 || self.perk2 == 13) - { - sprint(self, 2, "MEDICINE MAN\n"); - heal = heal * 1.25; - } - if (self.perk1 == 17 || self.perk2 == 17) - { - if (random()<0.05) - { - sprint(self, 2, "ONE IN A MILLION\n"); - heal = heal * 5; - } - } - sprint (trace_ent, PRINT_HIGH, self.netname); sprint (trace_ent, PRINT_HIGH, " used a "); sprint (trace_ent, PRINT_HIGH, x); @@ -4141,20 +4132,6 @@ float(float iid) UseHealingChem = sprint (self, PRINT_HIGH, x); sprint (self, PRINT_HIGH, ".\n"); - if (self.perk1 == 13 || self.perk2 == 13) - { - sprint(self, 2, "MEDICINE MAN\n"); - heal = heal * 1.25; - } - if (self.perk1 == 17 || self.perk2 == 17) - { - if (random()<0.05) - { - sprint(self, 2, "ONE IN A MILLION\n"); - heal = heal * 5; - } - } - sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); self.health = self.health + heal; self.regen = heal; @@ -4833,12 +4810,6 @@ void () ExitScreen = } if (trace_ent.classname == "body" && self.pickup == 0) { - if ((self.perk1 == 12 || self.perk2 == 12) && (ToIID(self.islot3) != IID_ARM_DESERT)) - { - sprint(self, 2, "you loot the raider's desert armor\n"); - SetItemSlot(self, 3, SlotVal(IID_ARM_DESERT, 1)); - return; - } trace_ent.movetype = MOVETYPE_BOUNCE; dir = normalize(trace_ent.origin - self.origin); @@ -5123,6 +5094,9 @@ void () disappear = //this allows an assassin to vanish, making monsters aggro //those who are visible + if (!getperk(3)) + return; + te = findradius(self.origin, 500); while (te) { @@ -6025,13 +5999,10 @@ void (float rec, float number, float dam, float spread, float ran, float auto, s local float var4; local float weap; - if (getperk(16))//power shot adds a small bonus to the first shot fired + if (getperk(5)) { if (self.steadyaim == 0) - { - sprint(self, 2, "!POWER SHOT\n"); - dam = dam * 1.20; - } + dam = dam + self.skill_doctor/5; } weap = ToIID(self.(SlotField(self.current_slot))); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index ea32f2f38..1294234ef 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -1700,7 +1700,7 @@ void () RecoilControl = te.lastman = te.lastman - 0.01; - //steady aim: for power shot, and aimed shots by standing still + //steady aim: for living anatomy, and aimed shots by standing still if (te.recoil != 0) te.steadyaim = 6; else if (te.recoil == 0 && te.steadyaim > 0) @@ -1772,9 +1772,9 @@ void () RecoilControl = if (te.drifty > 250) te.drifty = 250; - //nintendo gamer: going into the zone gives a -5 recoil bonus - if (te.rage == 255) - te.recoil = te.recoil - 0.05; + //support fire: going prone gives a -10 recoil bonus with this perk during heavy fire + if (getperk(1) && self.position == 2 && te.recoil > 5) + te.recoil = te.recoil - 0.10; //prone: going prone gives a -5 recoil bonus @@ -2091,6 +2091,7 @@ void() worldspawn = precache_sound ("misc/hosdown.wav"); precache_sound ("misc/rescued.wav"); precache_sound ("misc/beep1.wav"); + precache_sound ("misc/r_tele4.wav"); precache_sound ("buttons/switch02.wav"); precache_sound ("buttons/switch04.wav"); precache_sound ("misc/secret.wav"); From e08bd1abea160b7b77e17dc4258be77a376f680e Mon Sep 17 00:00:00 2001 From: Magnus Date: Fri, 13 Nov 2009 05:47:13 +0000 Subject: [PATCH 25/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3443 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/invent.qc | 12 ++++++------ quakec/fallout2/weapons.qc | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index c423f4557..61549f882 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -559,15 +559,15 @@ void() Items_Draw = it = getstati(32); itname = GetItemName(ToIID(it)); - drawstring('4 1.5 0'*IMGSIZEF + '0 0 0', itname, '16 16 0', '1 1 1', 1); + drawstring('4 1.5 0'*IMGSIZEF + '0 0 0', itname, '8 8 0', '1 1 1', 1); it = getstati(33); itname = GetItemName(ToIID(it)); - drawstring('4 3 0'*IMGSIZEF + '0 0 0', itname, '16 16 0', '1 1 1', 1); + drawstring('4 3 0'*IMGSIZEF + '0 0 0', itname, '8 8 0', '1 1 1', 1); it = getstati(34); itname = GetItemName(ToIID(it)); - drawstring('4 4.5 0'*IMGSIZEF + '0 0 0', itname, '16 16 0', '1 1 1', 1); + drawstring('4 4.5 0'*IMGSIZEF + '0 0 0', itname, '8 8 0', '1 1 1', 1); drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -805,17 +805,17 @@ void() Invent_Draw = check = getstati(32); if (check > 0) - SlotImage('5.5 1 0'*IMGSIZEF, 1); + SlotImage('6 1 0'*IMGSIZEF, 1); check = getstati(33); if (check > 0) - SlotImage('5.5 2 0'*IMGSIZEF, 2); + SlotImage('6 2 0'*IMGSIZEF, 2); check = getstati(34); if (check > 0) - SlotImage('5.5 3 0'*IMGSIZEF, 3); + SlotImage('6 3 0'*IMGSIZEF, 3); diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index b54f3f783..0b1b425f6 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -2836,7 +2836,7 @@ void (float dam, float ap, string snd, float rng, float rate) FirePistol = if (getperk(5)) { if (self.steadyaim == 0) - dam = dam + self.skill_doctor/2; + dam = dam + self.skill_doctor; } if (self.extender == weap && self.silencer != weap) @@ -2983,7 +2983,7 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = if (getperk(5)) { if (self.steadyaim == 0) - dam = dam + self.skill_doctor/2; + dam = dam + self.skill_doctor; } sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); @@ -3305,7 +3305,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (getperk(5)) { if (self.steadyaim == 0) - dam = dam + self.skill_doctor/2; + dam = dam + self.skill_doctor; } if (weap == IID_WP_MOONLIGHT) @@ -3581,7 +3581,7 @@ void (float dam, float xrecoil, string snd, float rng, float rate) FireMinigun = if (getperk(5)) { if (self.steadyaim == 0) - dam = dam + self.skill_doctor/3; + dam = dam + self.skill_doctor; } loud_noise(50); @@ -6002,7 +6002,7 @@ void (float rec, float number, float dam, float spread, float ran, float auto, s if (getperk(5)) { if (self.steadyaim == 0) - dam = dam + self.skill_doctor/5; + dam = dam + self.skill_doctor/3; } weap = ToIID(self.(SlotField(self.current_slot))); From d07fd0369f0667287e10705cbb13109f9b7cae84 Mon Sep 17 00:00:00 2001 From: Magnus Date: Fri, 13 Nov 2009 07:06:47 +0000 Subject: [PATCH 26/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3444 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/invent.qc | 14 +++++----- quakec/fallout2/misc.qc | 3 ++- quakec/fallout2/world.qc | 48 +++++++++++++++++++++------------- 3 files changed, 40 insertions(+), 25 deletions(-) diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 61549f882..effc7ade3 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -805,17 +805,17 @@ void() Invent_Draw = check = getstati(32); if (check > 0) - SlotImage('6 1 0'*IMGSIZEF, 1); + SlotImage('6 1 0'*IMGSIZEF - '16 2 0', 1); check = getstati(33); if (check > 0) - SlotImage('6 2 0'*IMGSIZEF, 2); + SlotImage('6 2 0'*IMGSIZEF - '16 -5 0', 2); check = getstati(34); if (check > 0) - SlotImage('6 3 0'*IMGSIZEF, 3); + SlotImage('6 3 0'*IMGSIZEF - '16 -13 0', 3); @@ -870,13 +870,15 @@ void() Invent_Draw = if (mousepos_y >= 1*IMGSIZEF && mousepos_y <= 7*IMGSIZEF) slotnum = floor((mousepos_y)/IMGSIZEF) + 10; - if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.5*IMGSIZEF) + if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.7*IMGSIZEF) if (mousepos_y >= 1*IMGSIZEF && mousepos_y <= 2*IMGSIZEF) slotnum = 1; - if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.5*IMGSIZEF) + + if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.7*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_x >= 5.5*IMGSIZEF && mousepos_x <= 6.7*IMGSIZEF) if (mousepos_y >= 3*IMGSIZEF && mousepos_y <= 4*IMGSIZEF) slotnum = 3; diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index fef0a35b0..1397f180d 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -1013,12 +1013,13 @@ void() brotherhood_soldier = self.xslot7 = SlotVal(IID_AM_ENERGYCELL, 30); self.xslot8 = SlotVal(IID_AM_CASELESS, 30); self.xslot9 = SlotVal(IID_AM_NEEDLER, 30); + self.xslot14 = SlotVal(IID_WP_AK112, 1); self.xslot15 = SlotVal(IID_WP_ACR, 1); self.xslot16 = SlotVal(IID_WP_AK112_M, 1); self.xslot17 = SlotVal(IID_WP_G11, 1); self.xslot18 = SlotVal(IID_WP_JACKHAMMER, 1); self.xslot19 = SlotVal(IID_WP_MOONLIGHT, 1); - self.xslot19 = SlotVal(IID_WP_MOSSBERG, 1); + self.xslot20 = SlotVal(IID_WP_MOSSBERG, 1); self.think = shop_face; self.nextthink = time + 0.5; diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 1294234ef..723c2293a 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -284,17 +284,17 @@ void() map_startup = world.map_obj = 6; if (infokey(world, "objective") == "hostage") - time_left = 400; + time_left = 600; if (infokey(world, "objective") == "supplies") - time_left = 500; + time_left = 600; if (infokey(world, "objective") == "shadow") - time_left = 300; + time_left = 600; if (infokey(world, "objective") == "deadtown") - time_left = 300; + time_left = 600; if (infokey(world, "objective") == "destroy") - time_left = 500; + time_left = 600; if (infokey(world, "objective") == "defuse") - time_left = 400; + time_left = 600; /* if (world.map_obj == 0) @@ -669,7 +669,7 @@ if (coop == 1) // Players vs Monsters if (world.map_obj == OBJ_HOSTAGE) { - //time_left = time_left - 1; + time_left = time_left - 1; te = find(world, classname, "rhostage"); while (te) @@ -702,8 +702,9 @@ if (coop == 1) // Players vs Monsters localcmd("restart\n"); sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); + return; } - else if (hdead > hcount) //hostages killed + else if (hdead > rescue + hcount) //hostages killed { if (endgame_timer == 0) bprint(2, "^4** ^bTHE HOSTAGES WERE KILLED!!!^b **\n"); @@ -719,6 +720,7 @@ if (coop == 1) // Players vs Monsters localcmd("restart\n"); endgame_timer = endgame_timer + 1; + return; } else if (hcount == 0 && hdead <= rescue) //hostages rescued { @@ -742,23 +744,33 @@ if (coop == 1) // Players vs Monsters localcmd("serverinfo objective return\n"); changelevel ("r_bunker"); } + return; } else if (time_left <= 0) //time ran out { if (endgame_timer == 0) - bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); + { + bprint(2, "^4** ^bSOME HOSTAGES WERE SAVED^b **\n"); + sound (self, CHAN_VOICE, "misc/beep1.wav", 1, ATTN_NONE); + ze = find (world, classname, "player"); + while (ze != world) + { + ze.ammo_shells = ze.ammo_shells + 25; + stuffcmd(ze, "play music/victory\n"); + ze = find (ze, classname, "player"); + } + } if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION FAILED^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 5) - localcmd("restart\n"); + bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } + endgame_timer = endgame_timer + 1; + return; } else if (time_left == 480) //time ran out bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); From d35ca68b3a79b742d8be821e2771c7db5b7b7efe Mon Sep 17 00:00:00 2001 From: Magnus Date: Sun, 15 Nov 2009 02:36:24 +0000 Subject: [PATCH 27/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3452 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/ai.qc | 41 +- quakec/fallout2/client.qc | 50 +- quakec/fallout2/cmds.qc | 4 + quakec/fallout2/combat.qc | 34 +- quakec/fallout2/csqc/invent.qc | 69 ++- quakec/fallout2/csqc/main.qc | 18 + quakec/fallout2/defs.qc | 8 + quakec/fallout2/doors.qc | 4 +- quakec/fallout2/enforcer.qc | 27 +- quakec/fallout2/fish.qc | 7 +- quakec/fallout2/hos.qc | 37 +- quakec/fallout2/inventory.qc | 48 +- quakec/fallout2/items.qc | 17 +- quakec/fallout2/misc.qc | 36 +- quakec/fallout2/ogre.qc | 4 +- quakec/fallout2/soldier.qc | 21 +- quakec/fallout2/weapons.qc | 110 ++--- quakec/fallout2/world.qc | 806 +++++++++------------------------ quakec/fallout2/zombie.qc | 109 ++++- 19 files changed, 637 insertions(+), 813 deletions(-) diff --git a/quakec/fallout2/ai.qc b/quakec/fallout2/ai.qc index d28d3182d..d8491e30e 100644 --- a/quakec/fallout2/ai.qc +++ b/quakec/fallout2/ai.qc @@ -3,6 +3,8 @@ void() t_movetarget; void() knight_walk1; void() knight_bow6; void() knight_bow1; +void() walkmonster_start; + void(entity etemp, entity stemp, entity stemp, float dmg) T_Damage; /* @@ -516,6 +518,21 @@ The monster is walking it's beat */ void(float dist) ai_walk = { + if (self.hold == 1) + { + self.th_stand; + self.hold = 0; + return; + } + if (self.hold > 1) + { + self.th_stand (); + + + self.hold = self.hold - 1; + return; + } + movedist = dist; // check for noticing a player @@ -535,6 +552,21 @@ The monster is staying in one place for a while, with slight angle turns */ void() ai_stand = { + if (self.hold == 1) + { + self.th_stand; + self.hold = 0; + return; + } + if (self.hold > 1) + { + self.th_stand (); + + + self.hold = self.hold - 1; + return; + } + if (FindTarget ()) return; @@ -712,7 +744,14 @@ The monster has an enemy it is trying to kill */ void(float dist) ai_run = { - if (self.hold > 0) + + if (self.hold == 1) + { + self.th_stand; + self.hold = 0; + return; + } + if (self.hold > 1) { self.th_stand (); diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index dd35f0b22..2fc3262f8 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -50,14 +50,10 @@ void() SetChangeParms = (IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) ); - if (self.skill_combat > 0) - parm5 = self.skill_combat; - if (self.skill_doctor > 0) - parm6 = self.skill_doctor; - if (self.skill_sneak > 0) - parm7 = self.skill_sneak; - if (self.skill_science > 0) - parm14 = self.skill_science; + parm5 = self.skill_combat; + parm6 = self.skill_doctor; + parm7 = self.skill_sneak; + parm14 = self.skill_science; @@ -1264,7 +1260,7 @@ void() SneakLevel = front = 0; - te = findradius(self.origin, 1000); + te = findradius(self.origin, 1500); while (te) { if (visible(te) && te.classname == "monster" && check_fov(te)) @@ -1275,7 +1271,7 @@ void() SneakLevel = } - sn = 90 + self.skill_sneak*0.5; + sn = 90 + self.skill_sneak/2; //sneaking along a wall increases chance by 2% makevectors(self.angles); @@ -1288,9 +1284,9 @@ void() SneakLevel = else if (pointcontents (self.origin - v_forward*64) == CONTENT_SOLID) sn = sn + 2; - //duck or prone gives a 1% bonus to stealth + //duck or prone gives a 2% bonus to stealth if (self.position > 0) - sn = sn + 1; + sn = sn + 2; //walking in front of a monster at close range is very bad //at longer ranges it isn't so bad to do so @@ -1300,36 +1296,34 @@ void() SneakLevel = { r = 600 - r; q = 3 + (self.skill_sneak/2); + //stealthboy gives a bonus to sneak range + st = ToIID(self.islot4); + if (st == IID_EQUIP_STEALTHBOY) + q = 3 + (self.skill_sneak/2) + 3; sn = sn - r/q; } - //wearing no armor gives a 5% bonus to stealth + //combat armor gives a penalty to stealth st = ToIID(self.islot3); - if (st == 0) - sn = sn + 5; - - //bulletproof shirt gives a 2% bonus to stealth - st = ToIID(self.islot3); - if (st == IID_ARM_LEATHER) - sn = sn + 2; + if (st == IID_ARM_COMBAT || st == IID_ARM_SEVA) + sn = sn - 5; //metal armor gives a large penalty to stealth st = ToIID(self.islot3); if (st == IID_ARM_METAL) - sn = sn - 5; + sn = sn - 10; //power armor gives a huge penalty to stealth st = ToIID(self.islot3); if (st == IID_ARM_LPOWER) - sn = sn - 10; + sn = sn - 25; - - //stealthboy allows for an automatic 10-second invisibility - st = ToIID(self.islot4); - if (st == IID_EQUIP_STEALTHBOY && self.ammo_cells > 0) - sn = 99; + //tesla armor gives a massive penalty to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_TESLA) + sn = sn - 40; if (sn <= 5) sn = 5; @@ -1560,6 +1554,8 @@ void() PlayerPreThink = if (self.perk2timer > 0) self.perk2timer = self.perk2timer - 1; + self.shadowtime = time_left; + if (self.cycle1 < time) { if (self.currentmenu != "none") diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index dd15d2b78..07c833f20 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -309,6 +309,8 @@ void(string arg1, string arg2) Cmd_GainPerk = self.perk1 = 8; if (arg1 == "9") self.perk1 = 9; + if (arg1 == "10") + self.perk1 = 10; } if (arg2 == "2") { @@ -330,6 +332,8 @@ void(string arg1, string arg2) Cmd_GainPerk = self.perk2 = 8; if (arg1 == "9") self.perk2 = 9; + if (arg1 == "10") + self.perk2 = 10; } }; diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 7b9861b02..3d30721a7 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -126,7 +126,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = damage = floor(damage); targ.health = floor(targ.health); - +/* if (attacker.classname == "player" && total_players == 4) damage = floor(damage * 0.75); if (attacker.classname == "player" && total_players == 3) @@ -134,8 +134,8 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = else if (attacker.classname == "player" && total_players == 2) damage = floor(damage * 0.90); - if (attacker.classname == "monster") - damage = floor(damage * 0.80); + if (targ.classname == "player") + damage = floor(damage * 0.60);*/ //getting hurt is slightly painful to the score, play cautiously! @@ -255,14 +255,12 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = damage = damage * 0.90; } + //sneak attack: if you attack a creature who isn't fighting you, bonus damage if (attacker.skill_sneak > 0) { if (targ.enemy != attacker) - { - sprint(attacker, 2, "!SNEAK ATTACK\n"); - damage = damage * (1 + (self.skill_sneak/100)); - } + damage = damage * (1 + (attacker.skill_sneak/100)); } //death wish: 20% damage bonus to targ, 10% to attacker @@ -457,25 +455,25 @@ take = damage; take -= 3; break; case IID_ARM_VANDAL: - take -= 4; - break; - case IID_ARM_METAL: take -= 5; break; + case IID_ARM_METAL: + take -= 1; + break; case IID_ARM_TESLA: - take -= 9; + take -= 6; break; case IID_ARM_COMBAT: take -= 6; break; case IID_ARM_SEVA: - take -= 8; + take -= 6; break; case IID_ARM_FORCE: - take -= 13; + take -= 9; break; case IID_ARM_LPOWER: - take -= 11; + take -= 10; break; default: break; @@ -490,22 +488,22 @@ take = damage; take = take * 0.70; break; case IID_ARM_METAL: - take = take * 0.50; + take = take * 0.40; break; case IID_ARM_TESLA: - take = take * 0.65; + take = take * 0.60; break; case IID_ARM_COMBAT: take = take * 0.60; break; case IID_ARM_SEVA: - take = take * 0.55; + take = take * 0.60; break; case IID_ARM_FORCE: take = take * 0.90; break; case IID_ARM_LPOWER: - take = take * 0.50; + take = take * 0.40; break; default: break; diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index effc7ade3..62674c47f 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -8,6 +8,8 @@ float show_trader; float show_perks; float show_items; float show_gainperk; +float scrwidth; +float scrheight; vector mousepos; @@ -215,6 +217,41 @@ void() ScreenImage = else if (getstati(57) == 6) drawpic('0 0 0', "gui/xcarnage.jpg", w, '1 1 1', 1); + + w = '0 32 0'+('1 0 0'*(scrwidth*0.10))+('0 1 0'*(scrheight*0.20)); + + if (getstati(57) == 3) + { + if (getstati(105) == 1) + drawstring(w, "the players were slain...", '8 8 8', '1 1 1', 1); + if (getstati(105) == 2) + drawstring(w, "the hostages were slain...", '8 8 8', '1 1 1', 1); + if (getstati(105) == 3) + drawstring(w, "the hostages were saved!", '8 8 8', '1 1 1', 1); + if (getstati(105) == 4) + drawstring(w, "some hostages were saved.", '8 8 8', '1 1 1', 1); + if (getstati(105) == 5) + drawstring(w, "no hostages were saved...", '8 8 8', '1 1 1', 1); + if (getstati(105) == 6) + drawstring(w, "the bombs were defused!", '8 8 8', '1 1 1', 1); + if (getstati(105) == 7) + drawstring(w, "the bombs were not defused...", '8 8 8', '1 1 1', 1); + if (getstati(105) == 8) + drawstring(w, "the supplies were not found...", '8 8 8', '1 1 1', 1); + if (getstati(105) == 9) + drawstring(w, "the supplies were found!", '8 8 8', '1 1 1', 1); + if (getstati(105) == 10) + drawstring(w, "all commanders were slain!", '8 8 8', '1 1 1', 1); + if (getstati(105) == 11) + drawstring(w, "the players did not escape...", '8 8 8', '1 1 1', 1); + if (getstati(105) == 12) + drawstring(w, "the players were discovered...", '8 8 8', '1 1 1', 1); + if (getstati(105) == 13) + drawstring(w, "the fuel tanks were destroyed!", '8 8 8', '1 1 1', 1); + if (getstati(105) == 14) + drawstring(w, "the fuel tanks were not destroyed...", '8 8 8', '1 1 1', 1); + } + }; string(float x) GetMonsterName = @@ -480,19 +517,17 @@ void() Perks_Draw = - if (mousepos_y >= 2.5*IMGSIZEF && mousepos_y <= 3.5*IMGSIZEF) + + if (mousepos_y >= 2.0*IMGSIZEF && mousepos_y <= 4*IMGSIZEF) { - - - if (mousepos_x >= 4*IMGSIZEF && mousepos_x <= 5*IMGSIZEF) + if (mousepos_x >= 3*IMGSIZEF && mousepos_x <= 5.5*IMGSIZEF) selected_class = 8; - - if (mousepos_x >= 6.5*IMGSIZEF && mousepos_x <= 7.5*IMGSIZEF) + else if (mousepos_x >= 6*IMGSIZEF && mousepos_x <= 7.5*IMGSIZEF) selected_class = 9; - + else + selected_class = 0; } - - if (mousepos_y >= 390 && mousepos_y <= 425) + else if (mousepos_y >= 390 && mousepos_y <= 425) { @@ -506,7 +541,8 @@ void() Perks_Draw = else selected_class = 0; } - + else + selected_class = 0; perki = GetPerkImage(getstati(60)); perk2i = GetPerkImage(getstati(59)); @@ -519,8 +555,8 @@ void() Perks_Draw = p1 = PerkNameCentered(1, getstati(60)); p2 = PerkNameCentered(2, getstati(59)); - drawstring('4 4.5 0'*IMGSIZEF - '28 0 0', p1, '8 8 8', '1 1 1', 1); - drawstring('6 4.5 0'*IMGSIZEF + '8 0 0', p2, '8 8 8', '1 1 1', 1); + drawstring('4 4.5 0'*IMGSIZEF - '45 0 0', p1, '8 8 8', '1 1 1', 1); + drawstring('6 4.5 0'*IMGSIZEF - '7 0 0', p2, '8 8 8', '1 1 1', 1); @@ -606,6 +642,8 @@ void() GainPerk_Draw = which_perk = 8; else if (mousepos_x >= 5*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) which_perk = 9; + else if (mousepos_x >= 6*IMGSIZEF && mousepos_x <= 7*IMGSIZEF) + which_perk = 10; else which_perk = 0; } @@ -613,13 +651,14 @@ void() GainPerk_Draw = drawpic('2 2 0'*IMGSIZEF, "gui/perks/Support Fire.png", '64 64 0', '1 1 1', 1); drawpic('3 2 0'*IMGSIZEF, "gui/perks/Duck And Cover", '64 64 0', '1 1 1', 1); drawpic('4 2 0'*IMGSIZEF, "gui/perks/Harmless.png", '64 64 0', '1 1 1', 1); - drawpic('5 2 0'*IMGSIZEF, "gui/perks/Hit The Deck.png", '64 64 0', '1 1 1', 1); - drawpic('6 2 0'*IMGSIZEF, "gui/perks/Living Anatomy.png", '64 64 0', '1 1 1', 1); + drawpic('5 2 0'*IMGSIZEF, "gui/perks/Stay Low.png", '64 64 0', '1 1 1', 1); + drawpic('6 2 0'*IMGSIZEF, "gui/perks/Surgical Precision.png", '64 64 0', '1 1 1', 1); drawpic('2 3 0'*IMGSIZEF, "gui/perks/Mutation.png", '64 64 0', '1 1 1', 1); drawpic('3 3 0'*IMGSIZEF, "gui/perks/Narrow Escape.png", '64 64 0', '1 1 1', 1); drawpic('4 3 0'*IMGSIZEF, "gui/perks/Schizophrenia.png", '64 64 0', '1 1 1', 1); drawpic('5 3 0'*IMGSIZEF, "gui/perks/Sleep Tight.png", '64 64 0', '1 1 1', 1); + drawpic('6 3 0'*IMGSIZEF, "gui/perks/Economic Moves.png", '64 64 0', '1 1 1', 1); pn = PerkName(1, which_perk); pd = GetPerkDesc(which_perk); @@ -1095,7 +1134,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = return; if (which_perk == getstati(59)) return; - if (which_perk >= 1 && which_perk <= 9) + if (which_perk >= 1 && which_perk <= 10) localcmd(strcat("cmd gainperk ", ftos(which_perk), " ", ftos(perkslot), "\n")); show_inventory = false; show_pipboy = false; diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index 408e84618..fc574ce3a 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -123,6 +123,23 @@ void() Chem_Draw = }; + + +void() Time_Draw = +{ + local float xtime, ytime, ztime; + local string qtime, rtime, shadowtime; + + xtime = getstati(104); + ytime = floor(xtime/60); + ztime = xtime - (ytime*60); + qtime = ftos(ytime); + rtime = ftos(ztime); + shadowtime = ftos(getstati(104)); + + drawstring('0 32 0'+('1 0 0'*(scrwidth*0.10))+('0 1 0'*(scrheight*0.90)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8', '1 1 1', 1); +}; + void() Ammo_Draw = { local float hand, weap, ammo, amount; @@ -418,6 +435,7 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = GainPerk_Draw(); else { + Time_Draw(); Health_Draw(); Weight_Draw(); Money_Draw(); diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 67f42fdbb..5f17a2f7e 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -682,6 +682,10 @@ float intermission_running; .float skill_doctor; .float skill_sneak; .float skill_science; +.float shadowskill_combat; +.float shadowskill_doctor; +.float shadowskill_sneak; +.float shadowskill_science; .float rescued; .float scale; @@ -739,8 +743,12 @@ float intermission_running; .float lastman; .float popup; .float flare; +.float radiation; .float perk1timer; .float perk2timer; +.float shadowtime; +.float announcercache; +string announcer; .entity friend; .entity tumbler1; diff --git a/quakec/fallout2/doors.qc b/quakec/fallout2/doors.qc index 9294bd0f7..9578d3031 100644 --- a/quakec/fallout2/doors.qc +++ b/quakec/fallout2/doors.qc @@ -183,7 +183,9 @@ void () OpenDoorBeep = sound (self, CHAN_BODY, "items/lockpick2.wav", 1, ATTN_NORM); - x = (2.51 - (2.5*(self.enemy.skill_sneak/30))); + x = (2.51 - (2.5*(self.enemy.skill_sneak/7))); + if (x <= 0) + x = 0.1; self.think = OpenDoorBeep; diff --git a/quakec/fallout2/enforcer.qc b/quakec/fallout2/enforcer.qc index 4915e60fb..03d482c24 100644 --- a/quakec/fallout2/enforcer.qc +++ b/quakec/fallout2/enforcer.qc @@ -87,14 +87,9 @@ void (float tmp, float dam) enforcer_single = else if (self.weapon == 6) sound (self, CHAN_WEAPON, "weapons/moonlight-2.wav", 1, ATTN_NORM); - if (self.weapon == 3) - dam = 12; - else if (self.weapon == 4) - dam = 16; - else if (self.weapon == 5) - dam = 18; - else if (self.weapon == 6) - dam = 16; + + dam = 12; + tmp = 500; self.attack = self.attack + 1; @@ -189,13 +184,13 @@ void() enf_atk8 =[ $attack3, enf_atk9 ] {ai_face();}; void() enf_atk9 =[ $attack2, enf_atk10 ] {ai_face();}; void() enf_atk10 =[ $attack1, enf_run1 ] {ai_face();}; -void() enf_burst1 =[ $attack5, enf_burst2 ] {enforcer_single(500, 13);}; -void() enf_burst2 =[ $attack6, enf_burst3 ] {enforcer_single(500, 13);ai_face();}; -void() enf_burst3 =[ $attack5, enf_burst4 ] {enforcer_single(50, 13);}; -void() enf_burst4 =[ $attack6, enf_burst5 ] {enforcer_single(550, 13);ai_face();}; -void() enf_burst5 =[ $attack5, enf_burst6 ] {enforcer_single(550, 13);}; -void() enf_burst6 =[ $attack6, enf_burst7 ] {enforcer_single(500, 13);ai_face();}; -void() enf_burst7 =[ $attack5, enf_burst8 ] {enforcer_single(550, 13);}; +void() enf_burst1 =[ $attack5, enf_burst2 ] {enforcer_single(600, 13);}; +void() enf_burst2 =[ $attack6, enf_burst3 ] {enforcer_single(600, 13);ai_face();}; +void() enf_burst3 =[ $attack5, enf_burst4 ] {enforcer_single(600, 13);}; +void() enf_burst4 =[ $attack6, enf_burst5 ] {enforcer_single(650, 13);ai_face();}; +void() enf_burst5 =[ $attack5, enf_burst6 ] {enforcer_single(650, 13);}; +void() enf_burst6 =[ $attack6, enf_burst7 ] {enforcer_single(650, 13);ai_face();}; +void() enf_burst7 =[ $attack5, enf_burst8 ] {enforcer_single(650, 13);}; void() enf_burst8 =[ $attack4, enf_burst9 ] {enforcer_single(700, 13);ai_face();}; void() enf_burst9 =[ $attack3, enf_burst10 ] {ai_face();}; void() enf_burst10 =[ $attack2, enf_run1 ] {ai_face();}; @@ -452,7 +447,7 @@ void() monster_enforcer = self.netname = "enforcer"; setsize (self, '-12 -12 -24', '12 12 32'); - self.health = 200; + self.health = 150; self.islot3 = SlotVal(IID_ARM_COMBAT, 1); self.armortype = 0.5; self.helmet = 1; diff --git a/quakec/fallout2/fish.qc b/quakec/fallout2/fish.qc index 4709ef844..977e3ff7b 100644 --- a/quakec/fallout2/fish.qc +++ b/quakec/fallout2/fish.qc @@ -151,6 +151,8 @@ void(entity attacker, float damage) fish_pain = void() monster_fish = { + + precache_model2 ("progs/fish.mdl"); precache_sound2 ("fish/death.wav"); @@ -174,7 +176,8 @@ void() monster_fish = self.th_die = f_death1; self.th_pain = fish_pain; self.th_melee = f_attack1; - - swimmonster_start (); + + remove(self); + //swimmonster_start (); }; diff --git a/quakec/fallout2/hos.qc b/quakec/fallout2/hos.qc index 9f0498f93..51bed57a6 100644 --- a/quakec/fallout2/hos.qc +++ b/quakec/fallout2/hos.qc @@ -22,82 +22,83 @@ void () hos_stand5 = [ 15, hos_stand1 ] void () hos_run1 = [ 0, hos_run2 ] { - hos_forward (MULTICAST_PVS_R); + ai_forward(5); }; void () hos_run2 = [ 1, hos_run3 ] { - hos_forward (AS_MELEE); + ai_forward(5); }; void () hos_run3 = [ 2, hos_run4 ] { - hos_forward (MULTICAST_PVS_R); + ai_forward(5); }; void () hos_run4 = [ 3, hos_run5 ] { - hos_forward (AS_MELEE); + ai_forward(5); }; void () hos_run5 = [ 4, hos_run6 ] { - hos_forward (MULTICAST_PVS_R); + ai_forward(5); }; void () hos_run6 = [ 5, hos_run1 ] { - hos_forward (AS_MELEE); + ai_forward(5); }; void () hos_walk1 = [ 16, hos_walk2 ] { - hos_forward (MULTICAST_PVS_R); + ai_forward(5); }; void () hos_walk2 = [ 17, hos_walk3 ] { - hos_forward (AS_MELEE); + ai_forward(5); }; void () hos_walk3 = [ 18, hos_walk4 ] { - hos_forward (MULTICAST_PVS_R); + ai_forward(5); }; void () hos_walk4 = [ 19, hos_walk5 ] { - hos_forward (AS_MELEE); + ai_forward(5); }; void () hos_walk5 = [ 20, hos_walk6 ] { - hos_forward (MULTICAST_PVS_R); + ai_forward(5); }; void () hos_walk6 = [ 21, hos_walk7 ] { - hos_forward (AS_MELEE); + ai_forward(5); }; void () hos_walk7 = [ 22, hos_walk8 ] { - hos_forward (MULTICAST_PVS_R); + self.angles_y = random()*360; + ai_forward(5); }; void () hos_walk8 = [ 23, hos_walk9 ] { - hos_forward (AS_MELEE); + ai_forward(5); }; void () hos_walk9 = [ 24, hos_walk10 ] { - hos_forward (MULTICAST_PVS_R); + ai_forward(5); }; void () hos_walk10 = [ 25, hos_walk1 ] { - hos_forward (AS_MELEE); + ai_forward(5); }; void () hos_deatha1 = [ 6, hos_deatha2 ] @@ -251,7 +252,7 @@ void (vector jojo) spawn_civilian = self.netname = "civilian"; self.classname = "rhostage"; self.max_health = self.health; - hos_stand1 (); + hos_walk1 (); self.th_die = hostage_die; self.th_pain = hostage_pain; self.rescued = 0; @@ -285,7 +286,7 @@ void (vector jojo) spawn_civilian = } } - te = findradius (self.origin, 40); + te = findradius (self.origin, 24); while (te) { if (te.classname == "player" || te.classname == "monster" && te.health > 0) diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 3fb2228c8..01bab48cc 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -1111,17 +1111,17 @@ float(float iid) GetItemWeight = if (iid == IID_ARM_VANDAL) return 10; if (iid == IID_ARM_METAL) - return 20; + return 25; if (iid == IID_ARM_TESLA) - return 12; + return 10; if (iid == IID_ARM_COMBAT) - return 14; + return 15; if (iid == IID_ARM_SEVA) - return 16; + return 15; if (iid == IID_ARM_FORCE) - return 9; + return 10; if (iid == IID_ARM_LPOWER) - return 20; + return 35; if (iid == IID_BUILD_MRAMMO) return 2; @@ -1281,7 +1281,7 @@ string(float iid) GetItemName = if (iid == IID_GREN_STUN) return "stun grenade"; if (iid == IID_GREN_FRAG) - return "frag grenade"; + return "nuka grenade"; if (iid == IID_GREN_EMP) return "emp grenade"; if (iid == IID_GREN_SMOKE) @@ -1587,7 +1587,7 @@ float(float iid) GetBaseValue = if (iid == IID_EQUIP_TOOLKIT) return 50; if (iid == IID_EQUIP_BACKPACK) - return 100; + return 10; if (iid == IID_EQUIP_CLIMBINGGEAR) return 150; if (iid == IID_EQUIP_BATTERY) @@ -2578,9 +2578,9 @@ string (float slot, float int) PerkName = if (int == 3) return "Harmless"; if (int == 4) - return "Hit The Deck"; + return "Stay Low"; if (int == 5) - return "Living Anatomy"; + return "Surgical Precision"; if (int == 6) return "Mutation"; if (int == 7) @@ -2596,25 +2596,25 @@ string (float slot, float int) PerkName = string (float slot, float int) PerkNameCentered = { if (int == 1) - return " Support Fire"; + return " Support Fire"; if (int == 2) - return "Duck And Cover"; + return " Duck And Cover"; if (int == 3) - return " Harmless"; + return " Harmless"; if (int == 4) - return " Hit The Deck"; + return " Stay Low"; if (int == 5) - return "Living Anatomy"; + return "Surgical Precision"; if (int == 6) - return " Mutation"; + return " Mutation"; if (int == 7) - return "Narrow Escape"; + return " Narrow Escape"; if (int == 8) - return "Schizophrenia"; + return " Schizophrenia"; if (int == 9) - return " Sleep Tight"; + return " Sleep Tight"; if (int == 10) - return "Economic Moves"; + return " Economic Moves"; }; @@ -2627,9 +2627,9 @@ string(float int) GetPerkImage = else if (int == 3) return "gui/perks/Harmless.jpg"; else if (int == 4) - return "gui/perks/Hit The Deck.jpg"; + return "gui/perks/Stay Low.jpg"; else if (int == 5) - return "gui/perks/Living Anatomy.jpg"; + return "gui/perks/Surgical Precision.jpg"; else if (int == 6) return "gui/perks/Mutation.jpg"; else if (int == 7) @@ -2663,9 +2663,9 @@ string(float int) GetPerkDesc = else if (int == 7) return "Provides you a few hassle-free seconds to escape danger"; else if (int == 8) - return "You sometimes gain additional skills from another place"; + return "You may gain additional skills from an unknown source"; else if (int == 9) - return "Automatically kill anything with knife in sneak mode"; + return "Paralyze anything with a sneak attack from a knife"; else if (int == 10) return "Suffer less time-related penalties for all actions"; else diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 2f0bbc30a..29f258d23 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -291,9 +291,6 @@ void(vector loc) SpawnJunk = { local entity junk; - if (random()*100 <= 80) - return; - junk = spawn (); setorigin(junk, loc + '0 0 96'); @@ -319,11 +316,13 @@ void(vector loc) SpawnJunk = - if (random()*100 <= 25) - junk.islot1 = SlotVal(IID_MISC_NUKACOLA, 1); - else if (random()*100 <= 25) + if (random()*100 <= 50) + junk.islot1 = SlotVal(IID_MISC_HMXCOMPOUND, 1); + else if (random()*100 <= 50) junk.islot1 = SlotVal(IID_MISC_CHEMICALS, 1); - else if (random()*100 <= 25) + else if (random()*100 <= 33) + junk.islot1 = SlotVal(IID_MISC_NUKACOLA, 1); + else if (random()*100 <= 33) junk.islot1 = SlotVal(IID_MISC_AEROSOL, 1); else if (random()*100 <= 10) junk.islot1 = SlotVal(IID_MISC_RDXCRYSTAL, 1); @@ -337,8 +336,6 @@ void(vector loc) SpawnJunk = junk.islot1 = SlotVal(IID_MISC_CIRCUITBOARD, 1); else if (random()*100 <= 10) junk.islot1 = SlotVal(IID_MISC_COPPERWIRE, 1); - else if (random()*100 <= 10) - junk.islot1 = SlotVal(IID_MISC_HMXCOMPOUND, 1); else if (random()*100 <= 10) junk.islot1 = SlotVal(IID_MISC_GUM, 1); else @@ -853,7 +850,7 @@ float (entity to, float iid, float quant) TryGiveStackable = local float item; local float x; - x = 300; + x = 400; if (ToIID(self.islot4) == IID_EQUIP_BACKPACK) x = 600; diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index 1397f180d..ac6628c1d 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -934,19 +934,19 @@ void() brotherhood_merchant = self.xslot1 = SlotVal(IID_WP_USP, 1); - self.xslot6 = SlotVal(IID_AM_45ACP, 30); + self.xslot6 = SlotVal(IID_AM_45ACP, 100); self.xslot2 = SlotVal(IID_WP_PIPERIFLE, 1); - self.xslot7 = SlotVal(IID_AM_44MAGNUM, 30); + self.xslot7 = SlotVal(IID_AM_44MAGNUM, 100); self.xslot3 = SlotVal(IID_WP_WINCHESTER, 1); - self.xslot8 = SlotVal(IID_AM_12GAUGESHELLS, 30); + self.xslot8 = SlotVal(IID_AM_12GAUGESHELLS, 100); self.xslot4 = SlotVal(IID_WP_RANGEMASTER, 1); - self.xslot9 = SlotVal(IID_AM_556MM, 30); + self.xslot9 = SlotVal(IID_AM_556MM, 100); self.xslot5 = SlotVal(IID_WP_MP9, 1); - self.xslot10 = SlotVal(IID_AM_10MM, 30); + self.xslot10 = SlotVal(IID_AM_10MM, 100); @@ -961,14 +961,14 @@ void() brotherhood_merchant = self.xslot16 = SlotVal(IID_WP_DKS1, 1); - self.xslot17 = SlotVal(IID_AM_762MM, 30); + self.xslot17 = SlotVal(IID_AM_762MM, 100); self.xslot18 = SlotVal(IID_WP_ALIENBLASTER, 1); - self.xslot19 = SlotVal(IID_AM_ENERGYCELL, 30); + self.xslot19 = SlotVal(IID_AM_ENERGYCELL, 100); if (random()*100 < 20) - self.xslot20 = SlotVal(IID_AM_ENERGYCELL, 30); + self.xslot20 = SlotVal(IID_AM_ENERGYCELL, 100); else if (random()*100 < 20) self.xslot20 = SlotVal(IID_EQUIP_BELTPOUCH, 1); else if (random()*100 < 20) @@ -1004,15 +1004,17 @@ void() brotherhood_soldier = setsize (self, '-16 -16 -24', '16 16 32'); self.takedamage = DAMAGE_NO; - self.xslot1 = SlotVal(IID_AM_45ACP, 30); - self.xslot2 = SlotVal(IID_AM_10MM, 30); - self.xslot3 = SlotVal(IID_AM_12GAUGESHELLS, 30); - self.xslot4 = SlotVal(IID_AM_5MMHIGHVEL, 30); - self.xslot5 = SlotVal(IID_AM_762MM, 30); - self.xslot6 = SlotVal(IID_AM_556MM, 30); - self.xslot7 = SlotVal(IID_AM_ENERGYCELL, 30); - self.xslot8 = SlotVal(IID_AM_CASELESS, 30); - self.xslot9 = SlotVal(IID_AM_NEEDLER, 30); + self.xslot1 = SlotVal(IID_AM_45ACP, 100); + self.xslot2 = SlotVal(IID_AM_10MM, 100); + self.xslot3 = SlotVal(IID_AM_12GAUGESHELLS, 100); + self.xslot4 = SlotVal(IID_AM_5MMHIGHVEL, 100); + self.xslot5 = SlotVal(IID_AM_762MM, 100); + self.xslot6 = SlotVal(IID_AM_556MM, 100); + self.xslot7 = SlotVal(IID_AM_ENERGYCELL, 100); + self.xslot8 = SlotVal(IID_AM_CASELESS, 100); + self.xslot9 = SlotVal(IID_AM_NEEDLER, 100); + self.xslot12 = SlotVal(IID_EQUIP_STEALTHBOY, 1); + self.xslot13 = SlotVal(IID_EQUIP_BACKPACK, 1); self.xslot14 = SlotVal(IID_WP_AK112, 1); self.xslot15 = SlotVal(IID_WP_ACR, 1); self.xslot16 = SlotVal(IID_WP_AK112_M, 1); diff --git a/quakec/fallout2/ogre.qc b/quakec/fallout2/ogre.qc index d77b88247..a41515f25 100644 --- a/quakec/fallout2/ogre.qc +++ b/quakec/fallout2/ogre.qc @@ -122,10 +122,10 @@ void (float tmp, float dam) ogre_smg = sound (self, CHAN_WEAPON, "weapons/mp7.wav", 1, ATTN_NORM); - tmp = 350; + tmp = 300; - dam = 15; + dam = 10; if (self.enemy.sneak == 1) tmp = tmp * 2; diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index f75cb6177..34d4edf5d 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -1321,6 +1321,10 @@ void () army_die10 = [ 17, army_die10 ] void () army_cdie1 = [ 18, army_cdie2 ] { + if (random()*4 <= 2) + sound (self, CHAN_VOICE, "player/agdie2.wav", 1, ATTN_NORM); + else + sound (self, CHAN_VOICE, "player/agdie3.wav", 1, ATTN_NORM); }; void () army_cdie2 = [ 19, army_cdie3 ] @@ -1459,16 +1463,7 @@ void () army_die = if (random()<0.75) DropMoney(); - if (r <= 0.20) - sound (self, CHAN_VOICE, "player/agdie1.wav", 1, ATTN_NORM); - else if (r <= 0.40) - sound (self, CHAN_VOICE, "player/agdie2.wav", 1, ATTN_NORM); - else if (r <= 0.60) - sound (self, CHAN_VOICE, "player/agdie3.wav", 1, ATTN_NORM); - else if (r <= 0.80) - sound (self, CHAN_VOICE, "player/agdie4.wav", 1, ATTN_NORM); - else - sound (self, CHAN_VOICE, "player/agdie5.wav", 1, ATTN_NORM); + DeathThroes(); @@ -1514,7 +1509,7 @@ void (vector jojo, entity friend) spawn_soldier = setmodel (self, "progs/soldier.mdl"); setsize (self, '-12 -12 -24', '12 12 28'); self.netname = "raider"; - self.max_health = 150; + self.max_health = 80; self.health = self.max_health; self.armornoise = "misc/thud.wav"; self.th_stand = army_stand1; @@ -1708,7 +1703,7 @@ void () monster_army = self.movetype = MOVETYPE_STEP; setmodel (self, "progs/soldier.mdl"); setsize (self, '-12 -12 -24', '12 12 28'); - self.max_health = 150; + self.max_health = 80; self.health = self.max_health; self.team = 3; self.islot3 = SlotVal(IID_ARM_LEATHER, 1); @@ -1904,7 +1899,7 @@ void () monster_commander = commanders = commanders + 1; setsize (self, '-12 -12 -24', '12 12 32'); - self.max_health =250; + self.max_health = 200; self.health = self.max_health; self.islot3 = SlotVal(IID_ARM_COMBAT, 1); self.armortype = 0.5; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 0b1b425f6..e10cdab66 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -11,6 +11,7 @@ void (string snd, float type) function_radio; void () MapInfo; void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; void () player_run; +void () walkmonster_start; void(entity bomb, entity attacker, float rad, entity ignore, string dtype) T_RadiusDamage; void(entity bomb, entity attacker, float rad, entity ignore, float xrange) T_RadiusDamage2; void() ZoomIn; @@ -29,6 +30,7 @@ void (float dam, float rec, string snd, float rng, float rate) FireSMG; float() FireToolkit; void () HostageReport; void (entity jeb, float time) spawn_excla; +void (entity jeb, float time) spawn_stop; void () FireAlienBlaster; void () W_PlayerMenu; void () player_single_shot; @@ -124,7 +126,7 @@ void(float slotno) UsePerk = return; } - if (self.perk1 == 7 || self.perk2 == 7) + if ((self.perk1 == 7 && slotno == 1) || (self.perk2 == 7 && slotno == 2)) { if (slotno == 1) self.perk1timer = 2000; @@ -137,8 +139,10 @@ void(float slotno) UsePerk = while (te) { if (te.classname == "monster") - te.hold = 100; - + { + te.hold = 80; + spawn_stop(te, 10); + } te = te.chain; } } @@ -1931,12 +1935,7 @@ void () ProneOn = self.position = 2; self.view_ofs = '0 0 -10'; sprint (self, 2, "position: prone.\n"); - if (getperk(10)) - { - self.attack_finished = time + 0.5; - self.rtime = time + 0.5; - } - else + if (!getperk(10)) { self.attack_finished = time + 1.5; self.rtime = time + 1.5; @@ -2502,7 +2501,7 @@ void () Explosion = //self.nextthink = (time + 0.02); }; -void () FragExplode = +void (float skill) FragExplode = { local float r, d; local entity te; @@ -2514,7 +2513,6 @@ void () FragExplode = setorigin (self, self.origin); setsize (self, '0 0 0', '0 0 0'); - bprint(2, "fragex\n"); Explosion(); te = findradius(self.origin, 400); @@ -2531,10 +2529,10 @@ void () FragExplode = te = te.chain; } - r = 400 + self.skill_science*2; - d = 65+random()*65 + self.skill_science; + r = 200 + skill*20; + d = 10 + skill*10; - T_RadiusDamage2 (self, self.owner, 65+random()*65, other, r); + T_RadiusDamage2 (self, self.owner, d+random()*40, other, r); remove (self); }; @@ -4215,8 +4213,8 @@ void () UseStimpack = thing = thing.chain; } - self.health = self.health + 10 + (self.skill_doctor/2); - self.regen = self.regen + (3 + (self.skill_doctor/2)); + self.health = self.health + 30 + (self.skill_doctor); + self.regen = self.regen + (5 + (self.skill_doctor/2)); } } else if (trace_ent.classname == "player")//healing another team-mate @@ -4287,7 +4285,7 @@ void () UseStimpack = sprint(self, PRINT_MEDIUM, trace_ent.netname); sprint(self, PRINT_MEDIUM, " with a stimpack\n"); - trace_ent.health = trace_ent.health + 10 + (self.skill_doctor/2); + trace_ent.health = trace_ent.health + 30 + (self.skill_doctor); trace_ent.regen = trace_ent.regen + (3 + (self.skill_doctor/2)); } } @@ -4439,13 +4437,13 @@ void () UseMedicalBag = while (thing) { if (thing.classname == "player" && (thing.health+20) < self.health) - self.score = self.score - 50; + self.score = self.score - 25; thing = thing.chain; } sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); - sprint(self, PRINT_MEDIUM, "you start to bandage yourself\n"); + self.health = self.health + 5 + (self.skill_doctor/2); self.regen = self.regen + 3 + (self.skill_doctor/2); } } @@ -4495,13 +4493,8 @@ void () UseMedicalBag = else { sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); - self.score = self.score + 10; - sprint(trace_ent, PRINT_MEDIUM, self.netname); - sprint(trace_ent, PRINT_MEDIUM, " bandages your wounds\n"); - sprint(self, PRINT_MEDIUM, "you heal "); - sprint(self, PRINT_MEDIUM, trace_ent.netname); - sprint(self, PRINT_MEDIUM, " with a stimpack\n"); - + self.score = self.score + 1; + trace_ent.health = trace_ent.health + 5 + (self.skill_doctor/2); trace_ent.regen = trace_ent.regen + 3 + (self.skill_doctor/2); } } @@ -5127,8 +5120,7 @@ void () Sneak = if (self.sneak >= 1) { - sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); - centerprint (self, " Uncloaked \n"); + sound (self, CHAN_BODY, "items/r_tele4.wav", 1, ATTN_NORM); setmodel (self, "progs/guy.mdl"); self.sneak = 0; return; @@ -5137,7 +5129,6 @@ void () Sneak = { disappear(); sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); - centerprint (self, " sneaking \n"); self.sneak = 1; return; } @@ -5377,29 +5368,19 @@ void () Bar_Think = { local float dot1; - - if (self.owner.health >= self.owner.max_health) - { - self.frame = 0; - setmodel (self, ""); - self.nextthink = time + 0.01; - return; - } self.flags = self.flags; - if (self.owner.health >= 1) - { - self.frame = floor (((self.owner.health / self.owner.max_health) * TE_WIZSPIKE)); - if (self.owner.position == 0) - setorigin (self, (self.owner.origin + '0 0 40')); - else if (self.owner.position == 1) - setorigin (self, (self.owner.origin + '0 0 32')); - else - setorigin (self, (self.owner.origin + '0 0 24')); + self.frame = floor (((self.owner.health / self.owner.max_health) * TE_WIZSPIKE)); - self.nextthink = (time + 0.01); - setmodel (self, "progs/hbar.spr"); - } + if (self.owner.position == 0) + setorigin (self, (self.owner.origin + '0 0 40')); + else if (self.owner.position == 1) + setorigin (self, (self.owner.origin + '0 0 32')); + else + setorigin (self, (self.owner.origin + '0 0 24')); + + self.nextthink = (time + 0.01); + setmodel (self, "progs/hbar.spr"); }; void (entity guy) spawn_dot = @@ -6181,7 +6162,25 @@ void (entity jeb, float length) spawn_excla = hologram.solid = SOLID_NOT; hologram.owner = jeb; setmodel (hologram, "progs/radio.spr"); - setorigin (hologram, jeb.origin); + setorigin (hologram, jeb.origin + '0 0 48'); + setsize (hologram, VEC_ORIGIN, VEC_ORIGIN); + hologram.angles = jeb.angles; + hologram.colormap = jeb.colormap; + hologram.cnt = 100*length; + hologram.think = radio_think; + hologram.nextthink = (time + 0.01); +}; + +void (entity jeb, float length) spawn_stop = +{ + local entity hologram; + + hologram = spawn (); + hologram.movetype = MOVETYPE_NONE; + hologram.solid = SOLID_NOT; + hologram.owner = jeb; + setmodel (hologram, "progs/stop.spr"); + setorigin (hologram, jeb.origin + '0 0 48'); setsize (hologram, VEC_ORIGIN, VEC_ORIGIN); hologram.angles = jeb.angles; hologram.colormap = jeb.colormap; @@ -6397,7 +6396,9 @@ float(vector org) light_level = local float brightness; light = getlight(self.origin); - brightness = light_x*0.3 + light_y*0.51 + light_z*0.2; + //brightness = light_x*0.3 + light_y*0.51 + light_z*0.2; + + brightness = light_x + light_y + light_z; return brightness; }; @@ -6413,6 +6414,13 @@ void() show_light_level = bprint(2, "light level: "); bprint(2, y); bprint(2, "\n"); + + x = self.waterlevel; + y = ftos(x); + + bprint(2, "water level: "); + bprint(2, y); + bprint(2, "\n"); }; void() AttachSilencer = diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 723c2293a..0d144374a 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -101,8 +101,8 @@ void() SetupStats = clientstat(101, 2, skill_doctor); clientstat(102, 2, skill_sneak); clientstat(103, 2, skill_science); - clientstat(104, 2, mixslot1); - clientstat(105, 2, mixslot2); + clientstat(104, 2, shadowtime); + clientstat(105, 2, announcercache); clientstat(108, 2, safezone); clientstat(109, 2, connected); clientstat(110, 2, steadyaim); @@ -110,6 +110,7 @@ void() SetupStats = clientstat(126, 2, popup); clientstat(127, 2, score); + }; //assesses all current players @@ -163,7 +164,7 @@ void() load_monster = if (infokey(world, "total") == "four") bprint(2, "test - four players\n");*/ - +/* if (infokey(world, "total") == "one" && random()<0.40) return; @@ -174,25 +175,26 @@ void() load_monster = return; if (infokey(world, "total") == "four" && random()<0.10) - return; + return;*/ - if (self.waterlevel > 2) - { - monster_fish(); - return; - } + + if (self.waterlevel >= 2) + return; x = random()*100; y = random()*100; - if (x <= world.map_ent1_percent) + + if (world.map_obj == OBJ_DEADTOWN) + { + self.zone = 1; + monster_zombie(); + } + else if (x <= world.map_ent1_percent) { self.zone = 1; - if (world.map_obj == OBJ_DEADTOWN) - monster_zombie(); - else monster_army(); @@ -210,7 +212,7 @@ void() load_monster = if (world.map_ent2 == 5 || world.map_ent2 == 6) monster_ogre(); if (world.map_ent2 == 7) - monster_enforcer(); + monster_army(); if (world.map_ent2 == 8) monster_demon1(); if (world.map_ent2 == 9) @@ -231,18 +233,14 @@ void() load_monster = else if (random()<0.10) monster_zombie(); else if (random()<0.10) - monster_enforcer(); + monster_army(); else if (random()<0.10) monster_ogre(); else if (random()<0.10) monster_army(); else if (random()<0.10) - monster_enforcer(); + monster_army(); - if (world.map_obj == OBJ_DEADTOWN) - spawn_ghoul(self.origin + '128 0 0'); - if (world.map_obj == OBJ_DEADTOWN) - spawn_ghoul(self.origin + '0 128 0'); } }; @@ -667,7 +665,20 @@ if (coop == 1) // Players vs Monsters if (pcount == 0 && self.timer > 5) localcmd("restart\n"); - if (world.map_obj == OBJ_HOSTAGE) + + if (endgame_timer > 0) + { + ze = find (world, classname, "monster"); + while (ze != world) + { + remove(ze); + + + ze = find (ze, classname, "monster"); + } + } + + if (world.map_obj == OBJ_HOSTAGE || world.map_obj == OBJ_DEADTOWN) { time_left = time_left - 1; @@ -688,153 +699,105 @@ if (coop == 1) // Players vs Monsters if (pcount == 0 && pdead > 0) //everyone died { - if (endgame_timer == 0) - bprint(2, "^4** ^bTHE PLAYERS WERE SLAIN^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bTHIS AREA WILL RESTART^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); + announcer = "all players were slain"; + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 1; + + + ze = find (ze, classname, "player"); + } if (endgame_timer == 5) localcmd("restart\n"); sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); - return; } else if (hdead > rescue + hcount) //hostages killed { if (endgame_timer == 0) - bprint(2, "^4** ^bTHE HOSTAGES WERE KILLED!!!^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bYOU HAVE FAILED THE MISSION^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); + { + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 2; + + + ze = find (ze, classname, "player"); + } + } if (endgame_timer == 5) localcmd("restart\n"); endgame_timer = endgame_timer + 1; - return; } else if (hcount == 0 && hdead <= rescue) //hostages rescued { if (endgame_timer == 0) { - bprint(2, "^4** ^bTHE HOSTAGES WERE SAVED!!!^b **\n"); - sound (self, CHAN_VOICE, "misc/fanfare.wav", 1, ATTN_NONE); ze = find (world, classname, "player"); while (ze != world) { - ze.ammo_shells = ze.ammo_shells + 25; - stuffcmd(ze, "play music/victory\n"); - ze = find (ze, classname, "player"); - } - } - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + ze.missionbrief = 3; + ze.announcercache = 3; + + ze = find (ze, classname, "player"); + } + } if (endgame_timer == 10) { localcmd("serverinfo objective return\n"); changelevel ("r_bunker"); } - return; } - else if (time_left <= 0) //time ran out + else if (time_left <= 0 && rescue > 0) //time ran out and at least one was rescued { if (endgame_timer == 0) { - bprint(2, "^4** ^bSOME HOSTAGES WERE SAVED^b **\n"); - sound (self, CHAN_VOICE, "misc/beep1.wav", 1, ATTN_NONE); ze = find (world, classname, "player"); while (ze != world) { - ze.ammo_shells = ze.ammo_shells + 25; - stuffcmd(ze, "play music/victory\n"); - ze = find (ze, classname, "player"); - } - } - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); + ze.missionbrief = 3; + ze.announcercache = 4; - if (endgame_timer == 10) + + ze = find (ze, classname, "player"); + } + } + if (endgame_timer >= 10) { localcmd("serverinfo objective return\n"); changelevel ("r_bunker"); } - - endgame_timer = endgame_timer + 1; - return; } - else if (time_left == 480) //time ran out - bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); - else if (time_left == 450) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); - else if (time_left == 420) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); - else if (time_left == 390) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); - else if (time_left == 360) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); - else if (time_left == 330) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); - else if (time_left == 300) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); - else if (time_left == 270) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); - else if (time_left == 240) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); - else if (time_left == 210) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); - else if (time_left == 180) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); - else if (time_left == 150) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); - else if (time_left == 120) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); - else if (time_left == 90) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); - else if (time_left == 60) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); - else if (time_left == 45) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); - else if (time_left == 30) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); - else if (time_left == 15) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); - else if (time_left == 10) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); - else if (time_left == 9) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); - else if (time_left == 8) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); - else if (time_left == 7) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); - else if (time_left == 6) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); - else if (time_left == 5) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); - else if (time_left == 4) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); - else if (time_left == 3) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); - else if (time_left == 2) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); - else if (time_left == 1) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); + else if (time_left <= 0 && rescue == 0) //time ran out and no rescues were made + { + if (endgame_timer == 0) + { + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 5; + + ze = find (ze, classname, "player"); + } + } + if (endgame_timer >= 10) + localcmd("restart\n"); + } if (pcount == 0 && pdead > 0) endgame_timer = endgame_timer + 1; - if (hcount == 0 && hdead <= rescue) + else if (hcount == 0 && hdead <= rescue) + endgame_timer = endgame_timer + 1; + else if (time_left <= 0) endgame_timer = endgame_timer + 1; } - if (world.map_obj == OBJ_DEFUSE) + else if (world.map_obj == OBJ_DEFUSE) { time_left = time_left - 1; @@ -849,42 +812,33 @@ if (coop == 1) // Players vs Monsters te = find(te, classname, "bomb"); } - local string xx; - - if (random()*10 <= 1) - { - xx = ftos(bcount); - bprint(2, xx); - bprint(2, " bombs left!!\n"); - } - if (pcount == 0 && pdead > 0) //everyone died { - if (endgame_timer == 0) - bprint(2, "^4** ^bTHE PLAYERS WERE SLAIN^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bTHIS AREA WILL RESTART^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 5) + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 1; + + + ze = find (ze, classname, "player"); + } + + if (endgame_timer == 10) localcmd("restart\n"); - sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); } else if (bcount == 0) //bombs defused { if (endgame_timer == 0) { - bprint(2, "^4** ^bTHE FUEL TANKS WERE DESTROYED!!!^b **\n"); - bprint(2, "^4** ^b RETURNING TO BASE!!!^b **\n"); ze = find (world, classname, "player"); while (ze != world) { ze.ammo_shells = ze.ammo_shells + 25; + ze.missionbrief = 3; + ze.announcercache = 6; + stuffcmd(ze, "play music/victory\n"); ze = find (ze, classname, "player"); } @@ -896,94 +850,29 @@ if (coop == 1) // Players vs Monsters changelevel ("r_bunker"); } } - - else if (time_left == 480) //time ran out - bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); - else if (time_left == 450) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); - else if (time_left == 420) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); - else if (time_left == 390) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); - else if (time_left == 360) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); - else if (time_left == 330) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); - else if (time_left == 300) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); - else if (time_left == 270) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); - else if (time_left == 240) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); - else if (time_left == 210) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); - else if (time_left == 180) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); - else if (time_left == 150) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); - else if (time_left == 120) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); - else if (time_left == 90) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); - else if (time_left == 60) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); - else if (time_left == 45) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); - else if (time_left == 30) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); - else if (time_left == 15) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); - else if (time_left == 10) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); - else if (time_left == 9) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); - else if (time_left == 8) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); - else if (time_left == 7) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); - else if (time_left == 6) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); - else if (time_left == 5) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); - else if (time_left == 4) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); - else if (time_left == 3) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); - else if (time_left == 2) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); - else if (time_left == 1) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); - else if (time_left == 0) //time ran out + else if (time_left <= 0) //time ran out { if (endgame_timer == 0) - sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); - if (endgame_timer == 2) - sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); - if (endgame_timer == 3) - sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); - if (endgame_timer == 4) - sound (world, CHAN_BODY, "ambience/gunfire5.wav", 1, ATTN_NONE); + { + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 7; - if (endgame_timer == 0) - bprint(2, "^4** ^bTHE EXPLOSIVES WERE NOT DEFUSED^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^b!!! MISSION SITE DESTROYED !!!^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); + ze = find (ze, classname, "player"); + } + } if (endgame_timer == 5) localcmd("restart\n"); - - sound (world, CHAN_BODY, "misc/menu3.wav", 1, ATTN_NONE); } if (pcount == 0 && pdead > 0) endgame_timer = endgame_timer + 1; - if (bcount == 0) + else if (bcount == 0) endgame_timer = endgame_timer + 1; - if (self.timer >= 300) + else if (self.timer >= 300) + endgame_timer = endgame_timer + 1; + else if (time_left <= 0) endgame_timer = endgame_timer + 1; } else if (world.map_obj == OBJ_SUPPLY) @@ -992,104 +881,49 @@ if (coop == 1) // Players vs Monsters if (pcount == 0 && pdead > 0) //everyone died { - if (endgame_timer == 0) - bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION FAILED^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 5) + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 1; + + + ze = find (ze, classname, "player"); + } + + if (endgame_timer == 10) localcmd("restart\n"); } else if (time_left <= 0) //time ran out { if (endgame_timer == 0) - bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION FAILED^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 5) + { + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 8; + + + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 10) localcmd("restart\n"); - endgame_timer = endgame_timer + 1; } - else if (time_left == 480) //time ran out - bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); - else if (time_left == 450) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); - else if (time_left == 420) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); - else if (time_left == 390) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); - else if (time_left == 360) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); - else if (time_left == 330) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); - else if (time_left == 300) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); - else if (time_left == 270) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); - else if (time_left == 240) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); - else if (time_left == 210) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); - else if (time_left == 180) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); - else if (time_left == 150) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); - else if (time_left == 120) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); - else if (time_left == 90) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); - else if (time_left == 60) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); - else if (time_left == 45) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); - else if (time_left == 30) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); - else if (time_left == 15) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); - else if (time_left == 10) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); - else if (time_left == 9) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); - else if (time_left == 8) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); - else if (time_left == 7) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); - else if (time_left == 6) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); - else if (time_left == 5) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); - else if (time_left == 4) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); - else if (time_left == 3) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); - else if (time_left == 2) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); - else if (time_left == 1) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); else if (supplies == 0) //supplies secured { if (endgame_timer == 0) { - bprint(2, "^4** ^bTHE SUPPLIES WERE SECURED!!!^b **\n"); - bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); ze = find (world, classname, "player"); while (ze != world) { - ze.ammo_shells = ze.ammo_shells + 25; - stuffcmd(ze, "play music/victory\n"); + ze.missionbrief = 3; + ze.announcercache = 9; + + ze = find (ze, classname, "player"); } } @@ -1104,6 +938,8 @@ if (coop == 1) // Players vs Monsters endgame_timer = endgame_timer + 1; else if (supplies == 0) endgame_timer = endgame_timer + 1; + else if (time_left <= 0) + endgame_timer = endgame_timer + 1; } else if (world.map_obj == OBJ_SHADOW) { @@ -1112,29 +948,31 @@ if (coop == 1) // Players vs Monsters if (pcount == 0 && pdead > 0) //everyone died { if (endgame_timer == 0) - bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION FAILED^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 5) + { + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 1; + + + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 10) localcmd("restart\n"); } else if (commanders == 0) //commanders assassinated { if (endgame_timer == 0) { - bprint(2, "^4** ^bTHE COMMANDERS WERE NEUTRALIZED!!!^b **\n"); - bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); ze = find (world, classname, "player"); while (ze != world) { - ze.ammo_shells = ze.ammo_shells + 25; - stuffcmd(ze, "play music/victory\n"); + ze.missionbrief = 3; + ze.announcercache = 10; + + ze = find (ze, classname, "player"); } } @@ -1144,92 +982,38 @@ if (coop == 1) // Players vs Monsters changelevel ("r_bunker"); } } - else if (time_left <= 0 && intermission_running == 0) //time ran out + else if (time_left <= 0) //time ran out { if (endgame_timer == 0) - bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION FAILED^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 5) - localcmd("restart\n"); + { + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 11; - endgame_timer = endgame_timer + 1; + + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 10) + localcmd("restart\n"); } - else if (time_left == 480) //time ran out - bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); - else if (time_left == 450) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); - else if (time_left == 420) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); - else if (time_left == 390) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); - else if (time_left == 360) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); - else if (time_left == 330) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); - else if (time_left == 300) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); - else if (time_left == 270) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); - else if (time_left == 240) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); - else if (time_left == 210) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); - else if (time_left == 180) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); - else if (time_left == 150) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); - else if (time_left == 120) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); - else if (time_left == 90) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); - else if (time_left == 60) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); - else if (time_left == 45) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); - else if (time_left == 30) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); - else if (time_left == 15) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); - else if (time_left == 10) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); - else if (time_left == 9) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); - else if (time_left == 8) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); - else if (time_left == 7) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); - else if (time_left == 6) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); - else if (time_left == 5) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); - else if (time_left == 4) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); - else if (time_left == 3) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); - else if (time_left == 2) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); - else if (time_left == 1) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); else if (called_in >= 5) //soldier radioed in { if (endgame_timer == 0) - bprint(2, "^4** ^bYOUR SQUAD WAS DISCOVERED^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION FAILED^b **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 5) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 6) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 7) + { + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 12; + + + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 10) localcmd("restart\n"); } @@ -1237,103 +1021,7 @@ if (coop == 1) // Players vs Monsters endgame_timer = endgame_timer + 1; else if (called_in >= 5) endgame_timer = endgame_timer + 1; - } - else if (world.map_obj == OBJ_DEADTOWN) - { - time_left = time_left - 1; - - if (time_left <= 0 && intermission_running == 0) //time ran out - { - if (endgame_timer == 0) - bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION FAILED^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 5) - localcmd("restart\n"); - - endgame_timer = endgame_timer + 1; - } - else if (time_left == 480) //time ran out - bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); - else if (time_left == 450) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); - else if (time_left == 420) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); - else if (time_left == 390) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); - else if (time_left == 360) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); - else if (time_left == 330) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); - else if (time_left == 300) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); - else if (time_left == 270) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); - else if (time_left == 240) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); - else if (time_left == 210) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); - else if (time_left == 180) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); - else if (time_left == 150) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); - else if (time_left == 120) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); - else if (time_left == 90) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); - else if (time_left == 60) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); - else if (time_left == 45) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); - else if (time_left == 30) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); - else if (time_left == 15) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); - else if (time_left == 10) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); - else if (time_left == 9) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); - else if (time_left == 8) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); - else if (time_left == 7) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); - else if (time_left == 6) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); - else if (time_left == 5) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); - else if (time_left == 4) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); - else if (time_left == 3) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); - else if (time_left == 2) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); - else if (time_left == 1) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); - else if (pcount == 0 && pdead > 0 && called_in == 0) //everyone died - { - if (endgame_timer == 0) - bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION FAILED^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 5) - localcmd("restart\n"); - } - - if (pcount == 0 && pdead > 0) - endgame_timer = endgame_timer + 1; - else if (called_in == 1) + else if (time_left <= 0) endgame_timer = endgame_timer + 1; } else if (world.map_obj == OBJ_DESTROY) @@ -1343,16 +1031,18 @@ if (coop == 1) // Players vs Monsters if (pcount == 0 && pdead > 0 && called_in == 0) //everyone died { if (endgame_timer == 0) - bprint(2, "^4** ^bYOUR SQUAD WAS SLAIN^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION FAILED^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 5) + { + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 1; + + + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 10) localcmd("restart\n"); } @@ -1360,17 +1050,16 @@ if (coop == 1) // Players vs Monsters { if (endgame_timer == 0) { - bprint(2, "^4** ^bTHE FUEL TANKS WERE DESTROYED!!!^b **\n"); ze = find (world, classname, "player"); while (ze != world) { - ze.ammo_shells = ze.ammo_shells + 25; - stuffcmd(ze, "play music/victory\n"); + ze.missionbrief = 3; + ze.announcercache = 13; + + ze = find (ze, classname, "player"); - } + } } - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION COMPLETED, RETURN TO BASE^b **\n"); if (endgame_timer == 10) { localcmd("serverinfo objective return\n"); @@ -1380,81 +1069,30 @@ if (coop == 1) // Players vs Monsters else if (time_left <= 0) //time ran out { if (endgame_timer == 0) - bprint(2, "^4** ^bRADIATION CONSUMES EVERYONE^b **\n"); - if (endgame_timer == 1) - bprint(2, "^4** ^bMISSION FAILED^b **\n"); - if (endgame_timer == 2) - bprint(2, "^4** 3 **\n"); - if (endgame_timer == 3) - bprint(2, "^4** 2 **\n"); - if (endgame_timer == 4) - bprint(2, "^4** 1 **\n"); - if (endgame_timer == 5) - localcmd("restart\n"); + { + ze = find (world, classname, "player"); + while (ze != world) + { + ze.missionbrief = 3; + ze.announcercache = 14; - endgame_timer = endgame_timer + 1; + + ze = find (ze, classname, "player"); + } + } + if (endgame_timer == 10) + { + localcmd("serverinfo objective return\n"); + changelevel ("r_bunker"); + } } - else if (time_left == 480) //time ran out - bprint(2, "^4** ^bTIME LEFT: 8:00^b **\n"); - else if (time_left == 450) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:30^b **\n"); - else if (time_left == 420) //time ran out - bprint(2, "^4** ^bTIME LEFT: 7:00^b **\n"); - else if (time_left == 390) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:30^b **\n"); - else if (time_left == 360) //time ran out - bprint(2, "^4** ^bTIME LEFT: 6:00^b **\n"); - else if (time_left == 330) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:30^b **\n"); - else if (time_left == 300) //time ran out - bprint(2, "^4** ^bTIME LEFT: 5:00^b **\n"); - else if (time_left == 270) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:30^b **\n"); - else if (time_left == 240) //time ran out - bprint(2, "^4** ^bTIME LEFT: 4:00^b **\n"); - else if (time_left == 210) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:30^b **\n"); - else if (time_left == 180) //time ran out - bprint(2, "^4** ^bTIME LEFT: 3:00^b **\n"); - else if (time_left == 150) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:30^b **\n"); - else if (time_left == 120) //time ran out - bprint(2, "^4** ^bTIME LEFT: 2:00^b **\n"); - else if (time_left == 90) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:30^b **\n"); - else if (time_left == 60) //time ran out - bprint(2, "^4** ^bTIME LEFT: 1:00^b **\n"); - else if (time_left == 45) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:45^b **\n"); - else if (time_left == 30) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:30^b **\n"); - else if (time_left == 15) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:15^b **\n"); - else if (time_left == 10) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:10^b **\n"); - else if (time_left == 9) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:09^b **\n"); - else if (time_left == 8) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:08^b **\n"); - else if (time_left == 7) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:07^b **\n"); - else if (time_left == 6) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:06^b **\n"); - else if (time_left == 5) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:05^b **\n"); - else if (time_left == 4) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:04^b **\n"); - else if (time_left == 3) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:03^b **\n"); - else if (time_left == 2) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:02^b **\n"); - else if (time_left == 1) //time ran out - bprint(2, "^4** ^bTIME LEFT: 0:01^b **\n"); if (pcount == 0 && pdead > 0) endgame_timer = endgame_timer + 1; else if (supplies == 0) endgame_timer = endgame_timer + 1; + else if (time_left <= 0) + endgame_timer = endgame_timer + 1; } self.think = GameControl; self.nextthink = time + 1; @@ -1785,7 +1423,7 @@ void () RecoilControl = te.drifty = 250; //support fire: going prone gives a -10 recoil bonus with this perk during heavy fire - if (getperk(1) && self.position == 2 && te.recoil > 5) + if (getperk(1) && self.position == 2 && te.recoil > 3) te.recoil = te.recoil - 0.10; @@ -1948,6 +1586,7 @@ void() worldspawn = precache_model ("progs/s_explod.spr"); // sprite explosion precache_model ("progs/ammobox.mdl"); precache_model ("progs/ammobox2.mdl"); + precache_model ("progs/stop.spr"); precache_model ("progs/v_axe.mdl"); precache_model ("progs/v_span.mdl"); @@ -2007,6 +1646,7 @@ void() worldspawn = precache_model ("progs/ray.mdl"); precache_model ("progs/radio.spr"); + precache_model ("progs/w_spear.mdl"); precache_model ("progs/w_span.mdl"); precache_model ("progs/w_knife.mdl"); diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index efbda82a9..cc31143bc 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -83,7 +83,14 @@ void() zombie_cruc6 = [ $cruc_6, zombie_cruc1 ] {self.nextthink = time + 0.1 + void() zombie_walk1 =[ $walk1, zombie_walk2 ] {ai_walk(3);}; void() zombie_walk2 =[ $walk2, zombie_walk3 ] {ai_walk(3);}; -void() zombie_walk3 =[ $walk3, zombie_walk4 ] {ai_walk(3);}; +void() zombie_walk3 =[ $walk3, zombie_walk4 ] {ai_walk(3); + +if (self.takedamage == DAMAGE_NO) +{ + remove(self); + return; +} +}; void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(3);}; void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(3);}; void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(3);}; @@ -105,7 +112,14 @@ if (random() < 0.2) sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);}; void() zombie_run1 =[ $run1, zombie_run2 ] {ai_run(4);self.inpain = 0;}; -void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(4);}; +void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(4); + +if (self.takedamage == DAMAGE_NO) +{ + remove(self); + return; +} +}; void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(4);}; void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(4);}; void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(4);}; @@ -517,7 +531,10 @@ void() zdie6 =[ $painb6, zdie7 ] {}; void() zdie7 =[ $painb7, zdie8 ] {}; void() zdie8 =[ $painb8, zdie9 ] {}; void() zdie9 =[ $painb9, zdie10] {}; -void() zdie10 =[ $painb10, zdie10] {}; +void() zdie10 =[ $painb10, zdie10] { +self.think = SUB_Remove; +self.nextthink = time + 20; +}; void () zombie_death = @@ -538,7 +555,7 @@ void () zombie_death = SpawnBlood (self.origin + '0 0 4', 4); self.think = SUB_Remove; - self.nextthink = time + 30; + self.nextthink = time + 10; self.health = 180; return; } @@ -708,7 +725,30 @@ void () spawn_ghoul_copy = local entity zombie, lair; local entity te, ze; local vector jojo; - local float zomc, pcount; + local float zomc, pcount, loadzombie; + local string finder; + local vector stuff; + + + + self.think = spawn_ghoul_copy; + self.nextthink = time + 20 + random()*10; + stuff = self.origin; + + + + loadzombie = 0; + + te = findradius (self.origin, 800); + while (te) + { + if (te.classname == "player") + loadzombie = 1; + + te = te.chain; + } + + ze = find (world, netname, "ghoul"); @@ -719,7 +759,7 @@ void () spawn_ghoul_copy = zomc = zomc + 1; - ze = find (ze, netname, "ghoul"); + ze = find (ze, netname, "monster"); } ze = find(world, classname, "player"); @@ -731,7 +771,7 @@ void () spawn_ghoul_copy = ze = find(ze, classname, "player"); } - if (zomc > 25*pcount) + if (zomc > 60*pcount) return; zombie = spawn (); @@ -749,10 +789,10 @@ void () spawn_ghoul_copy = self.th_pain = zombie_pain; self.th_die = zombie_die; self.th_melee = zombie_melee; - self.th_missile = zombie_missile; + self.angles_y = random()*360; - self.origin = self.origin + '0 64 0'; + self.origin = stuff + '0 16 0'; self.origin_z = self.origin_z + 1; droptofloor(); @@ -802,6 +842,8 @@ void (vector jojo) spawn_ghoul = local entity zombie, lair; local entity te, ze; local float stop; + local vector jojo; + local float zomc, pcount; ze = findradius(jojo, 256); @@ -822,9 +864,8 @@ void (vector jojo) spawn_ghoul = self.movetype = MOVETYPE_STEP; setsize (self, '0 0 0', '0 0 0'); self.netname = "lair"; - self.nextthink = time + 30; self.think = spawn_ghoul_copy; - self.nextthink = time + 30; + self.nextthink = time + 20 + random()*10; } zombie = spawn (); @@ -842,7 +883,6 @@ void (vector jojo) spawn_ghoul = self.th_pain = zombie_pain; self.th_die = zombie_die; self.th_melee = zombie_melee; - self.th_missile = zombie_missile; self.angles_y = random()*360; self.origin = jojo + '0 64 0'; @@ -892,12 +932,21 @@ void (vector jojo) spawn_ghoul = void() monster_zombie = { + local entity zombie, lair; + local entity te, ze; + local float stop; + local vector jojo; + local float zomc, pcount; + if (self.zone == 0) { load_monster(); return; } + + + precache_model ("progs/ghoul.mdl"); precache_model ("progs/h_zombie.mdl"); precache_model ("progs/zom_gib.mdl"); @@ -917,6 +966,34 @@ void() monster_zombie = precache_sound ("misc/rock1.wav"); precache_sound ("misc/rock2.wav"); + + if (world.map_obj == OBJ_DEADTOWN) + { + ze = findradius(self.origin, 256); + while (ze) + { + + if (ze.classname == "lair") + stop = 1; + + ze = ze.chain; + } + + if (stop == 0) + { + jojo = self.origin; + lair = spawn (); + setorigin(lair, jojo); + lair.solid = SOLID_NOT; + lair.movetype = MOVETYPE_STEP; + setsize (lair, '0 0 0', '0 0 0'); + lair.netname = "lair"; + lair.nextthink = time + 30; + lair.think = spawn_ghoul_copy; + lair.nextthink = time + 30; + } + } + self.solid = SOLID_SLIDEBOX; self.movetype = MOVETYPE_STEP; @@ -931,7 +1008,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; @@ -939,7 +1015,7 @@ void() monster_zombie = - +/* spawn_ghoul(self.origin + '-128 -128 0'); spawn_ghoul(self.origin + '-128 0 0'); spawn_ghoul(self.origin + '0 -128 0'); @@ -947,8 +1023,11 @@ void() monster_zombie = spawn_ghoul(self.origin + '128 0 0'); spawn_ghoul(self.origin + '128 128 0'); spawn_ghoul(self.origin + '-128 128 0'); - spawn_ghoul(self.origin + '128 -128 0'); + spawn_ghoul(self.origin + '128 -128 0');*/ if (random()<0.25 && world.map_obj == 1) spawn_civilian(self.origin); + + if (random()<0.5 && world.map_obj == 4) + spawn_civilian(self.origin); }; From 86a45f1a55b0094179300008e0d475bce6517094 Mon Sep 17 00:00:00 2001 From: Magnus Date: Sun, 15 Nov 2009 17:06:53 +0000 Subject: [PATCH 28/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3462 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/ai.qc | 10 --- quakec/fallout2/client.qc | 17 ++--- quakec/fallout2/hos.qc | 3 + quakec/fallout2/weapons.qc | 5 +- quakec/fallout2/zombie.qc | 136 ++++++------------------------------- 5 files changed, 35 insertions(+), 136 deletions(-) diff --git a/quakec/fallout2/ai.qc b/quakec/fallout2/ai.qc index d8491e30e..704017d71 100644 --- a/quakec/fallout2/ai.qc +++ b/quakec/fallout2/ai.qc @@ -520,15 +520,11 @@ void(float dist) ai_walk = { if (self.hold == 1) { - self.th_stand; self.hold = 0; return; } if (self.hold > 1) { - self.th_stand (); - - self.hold = self.hold - 1; return; } @@ -554,15 +550,11 @@ void() ai_stand = { if (self.hold == 1) { - self.th_stand; self.hold = 0; return; } if (self.hold > 1) { - self.th_stand (); - - self.hold = self.hold - 1; return; } @@ -754,8 +746,6 @@ void(float dist) ai_run = if (self.hold > 1) { self.th_stand (); - - self.hold = self.hold - 1; self.think = self.th_run; self.nextthink = time + 0.1; diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 2fc3262f8..d5fe12dea 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -134,14 +134,10 @@ void() DecodeLevelParms = setspawnparms(self); - if (parm5 > 0) - self.skill_combat = parm5; - if (parm6 > 0) - self.skill_doctor = parm6; - if (parm7 > 0) - self.skill_sneak = parm7; - if (parm14 > 0) - self.skill_science = parm14; + self.skill_combat = parm5; + self.skill_doctor = parm6; + self.skill_sneak = parm7; + self.skill_science = parm14; self.ammo_shells = parm8; self.perk1 = parm9; @@ -362,6 +358,11 @@ void() changelevel_touch = sprint (other, 2,"there are more hostages to save.\n"); return; } + else if ((world.map_obj == OBJ_DEADTOWN && hostages > 0) && random()<0.02) + { + sprint (other, 2,"there are more hostages to save.\n"); + return; + } else if ((world.map_obj == OBJ_SUPPLY && supplies > 0) && random()<0.02) { sprint (other, 2,"there are more supplies to secure.\n"); diff --git a/quakec/fallout2/hos.qc b/quakec/fallout2/hos.qc index 51bed57a6..ef632e879 100644 --- a/quakec/fallout2/hos.qc +++ b/quakec/fallout2/hos.qc @@ -299,5 +299,8 @@ void (vector jojo) spawn_civilian = te = te.chain; } + if (self.waterlevel >= 2) + remove(self); + self = oself; }; \ No newline at end of file diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index e10cdab66..f70dc6551 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -102,7 +102,7 @@ float() crandom = void(float slotno) UsePerk = { - local float x; + local float x, mcount; local string y, timeleft; local entity te; @@ -140,8 +140,9 @@ void(float slotno) UsePerk = { if (te.classname == "monster") { - te.hold = 80; + te.hold = 160; spawn_stop(te, 10); + mcount = mcount + 1; } te = te.chain; } diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index cc31143bc..bfc97cb49 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -615,16 +615,11 @@ void() zombie_die = r = random(); - if (r <= 0.20) - sound (self, CHAN_VOICE, "player/agdie1.wav", 1, ATTN_NORM); - else if (r <= 0.40) - sound (self, CHAN_VOICE, "player/agdie2.wav", 1, ATTN_NORM); - else if (r <= 0.60) - sound (self, CHAN_VOICE, "player/agdie3.wav", 1, ATTN_NORM); - else if (r <= 0.80) - sound (self, CHAN_VOICE, "player/agdie4.wav", 1, ATTN_NORM); + if (r <= 0.50) + sound (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM); else - sound (self, CHAN_VOICE, "player/agdie5.wav", 1, ATTN_NORM); + sound (self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM); + spawn_live_zombie(self.origin, self.angles); remove(self); @@ -726,15 +721,21 @@ void () spawn_ghoul_copy = local entity te, ze; local vector jojo; local float zomc, pcount, loadzombie; - local string finder; + local string finder, waterlev; local vector stuff; + self.think = spawn_ghoul_copy; - self.nextthink = time + 20 + random()*10; + self.nextthink = time + 5 + random()*5; stuff = self.origin; + waterlev = ftos(pointcontents(self.origin)); + + bprint(2, "pointcontents: "); + bprint(2, waterlev); + bprint(2, "\n"); loadzombie = 0; @@ -748,6 +749,12 @@ void () spawn_ghoul_copy = te = te.chain; } + if (loadzombie == 0) + return; + + + + ze = find (world, netname, "ghoul"); @@ -771,7 +778,7 @@ void () spawn_ghoul_copy = ze = find(ze, classname, "player"); } - if (zomc > 60*pcount) + if (zomc > 90*pcount) return; zombie = spawn (); @@ -837,98 +844,6 @@ void () spawn_ghoul_copy = walkmonster_start_go (); }; -void (vector jojo) spawn_ghoul = -{ - local entity zombie, lair; - local entity te, ze; - local float stop; - local vector jojo; - local float zomc, pcount; - - - ze = findradius(jojo, 256); - while (ze) - { - - if (ze.classname == "lair") - stop = 1; - - ze = ze.chain; - } - - if (stop == 0) - { - lair = spawn (); - self = lair; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_STEP; - setsize (self, '0 0 0', '0 0 0'); - self.netname = "lair"; - self.think = spawn_ghoul_copy; - self.nextthink = time + 20 + random()*10; - } - - zombie = spawn (); - self = zombie; - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; - setmodel (self, "progs/ghoul.mdl"); - setsize (self, '-8 -8 -24', '8 8 24'); - self.health = 60; - self.netname = "ghoul"; - self.max_health = self.health; - self.th_stand = zombie_stand1; - self.th_walk = zombie_walk1; - self.th_run = zombie_run1; - self.th_pain = zombie_pain; - self.th_die = zombie_die; - self.th_melee = zombie_melee; - self.angles_y = random()*360; - - self.origin = jojo + '0 64 0'; - self.origin_z = self.origin_z + 1; - droptofloor(); - - if (!walkmove(0, 0)) - { - self.origin = jojo + '0 -64 0'; - self.origin_z = self.origin_z + 1; - droptofloor(); - if (!walkmove(0, 0)) - { - self.origin = jojo + '64 0 0'; - self.origin_z = self.origin_z + 1; - droptofloor(); - if (!walkmove(0, 0)) - { - self.origin = jojo + '-64 0 0'; - self.origin_z = self.origin_z + 1; - droptofloor(); - if (!walkmove(0, 0)) - { - remove(self); - return; - } - } - } - } - - te = findradius (self.origin, 30); - while (te) - { - if (te.classname == "player" || te.classname == "monster" && te.health > 0) - { - remove(self); - return; - } - - - te = te.chain; - } - - self.classname = "monster"; - walkmonster_start_go (); -}; void() monster_zombie = { @@ -945,8 +860,6 @@ void() monster_zombie = } - - precache_model ("progs/ghoul.mdl"); precache_model ("progs/h_zombie.mdl"); precache_model ("progs/zom_gib.mdl"); @@ -988,6 +901,7 @@ void() monster_zombie = lair.movetype = MOVETYPE_STEP; setsize (lair, '0 0 0', '0 0 0'); lair.netname = "lair"; + lair.classname = "lair"; lair.nextthink = time + 30; lair.think = spawn_ghoul_copy; lair.nextthink = time + 30; @@ -1015,16 +929,6 @@ void() monster_zombie = -/* - spawn_ghoul(self.origin + '-128 -128 0'); - spawn_ghoul(self.origin + '-128 0 0'); - spawn_ghoul(self.origin + '0 -128 0'); - spawn_ghoul(self.origin + '0 128 0'); - spawn_ghoul(self.origin + '128 0 0'); - spawn_ghoul(self.origin + '128 128 0'); - spawn_ghoul(self.origin + '-128 128 0'); - spawn_ghoul(self.origin + '128 -128 0');*/ - if (random()<0.25 && world.map_obj == 1) spawn_civilian(self.origin); From c8635934a666aa76bfb892b84fd592a5759f8146 Mon Sep 17 00:00:00 2001 From: Magnus Date: Mon, 16 Nov 2009 17:42:41 +0000 Subject: [PATCH 29/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3463 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 44 +--- quakec/fallout2/csqc/invent.qc | 6 +- quakec/fallout2/csqc/main.qc | 354 +++++++++++++++------------------ quakec/fallout2/items.qc | 85 +++++++- quakec/fallout2/weapons.qc | 68 +++++++ quakec/fallout2/world.qc | 10 +- quakec/fallout2/zombie.qc | 63 ++++-- 7 files changed, 377 insertions(+), 253 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index d5fe12dea..7f975477d 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -614,29 +614,7 @@ void() PutClientInServer = DecodeLevelParms (); -/* - if (self.skill_combat == 0 && self.skill_sneak == 0 && self.skill_doctor == 0 && self.skill_science == 0) - { - self.deadflag = DEAD_NO; - self.health = 200; - self.max_health = 200; - setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); - self.view_ofs = '0 0 22'; - self.takedamage = DAMAGE_NO; - self.solid = SOLID_NOT; - spot = SelectSpawnPoint (); - self.origin = spot.origin + '0 0 1'; - self.angles = spot.angles; - self.fixangle = TRUE; // turn this way immediately - self.movetype = MOVETYPE_WALK; - self.flags = FL_CLIENT; - self.classname = "player"; - self.currentmenu = "none"; - self.air_finished = time + 999; - self.active = 1; - player_stand1 (); - return; - }*/ + if (self.current_slot == 0) { @@ -1536,6 +1514,7 @@ void() PlayerPreThink = + if (self.score < 200) { if ((self.skill_combat + self.skill_doctor + self.skill_sneak + self.skill_science) <= 10) @@ -1555,6 +1534,7 @@ void() PlayerPreThink = if (self.perk2timer > 0) self.perk2timer = self.perk2timer - 1; + self.shadowtime = time_left; if (self.cycle1 < time) @@ -1686,23 +1666,17 @@ void() PlayerPreThink = if (self.flash < time || ToIID(self.islot4) == IID_EQUIP_GOGGLES) { + local string x; + if (ToIID(self.islot4) == IID_EQUIP_GOGGLES) stuffcmd(self, "v_cshift 25 0 25 25\n"); + x = ftos(self.recoil); + if (self.steadyaim == 0) stuffcmd(self, "v_idlescale 0\n"); - else if (self.recoil >= 4) - stuffcmd(self, "v_idlescale 4\n"); - else if (self.velocity == '0 0 0' && self.health >= self.max_health*0.80 && self.position > 0) - stuffcmd(self, "v_idlescale 0\n"); - else if (self.velocity == '0 0 0' && self.position > 0) - stuffcmd(self, "v_idlescale 1\n"); - else if (self.velocity == '0 0 0' && self.health >= self.max_health*0.80) - stuffcmd(self, "v_idlescale 2\n"); - else if (self.velocity != '0 0 0' || self.health < self.max_health*0.80) - stuffcmd(self, "v_idlescale 4\n"); - else if (self.health < self.max_health*0.50) - stuffcmd(self, "v_idlescale 6\n"); + else + stuffcmd(self, strcat("v_idlescale ", x, "\n")); } self.cycle2 = time + 1; diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 62674c47f..01c33a785 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -34,7 +34,7 @@ float k_mwheeldown; float mouseisdown; #define IMGSIZEF 64 -#define IMGSIZEV ('1 1 0'*IMGSIZEF) +#define IMGSIZEV ('1 1 0'*(scrwidth/10)) #define IMGSIZEK 32 #define IMGSIZEH ('1 1 0'*IMGSIZEK) #define IMGSIZEX 48 @@ -46,8 +46,6 @@ float mouseisdown; - - void(vector pos, float slotno) TraderImage = { local float it, mod_s, mod_e; @@ -123,6 +121,8 @@ void(vector pos, float slotno) SlotImage = drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); }; + + void(vector pos, float slotno) SlotImageSmall = { local float it, mod_s, mod_e; diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index fc574ce3a..54d00c999 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -6,38 +6,13 @@ float viewmodelindex; float scrwidth; float scrheight; -void() Quick_Draw = -{ - drawstring('32 -80 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " q1 ", '8 8 8', '1 1 1', 1); - QuickImage('32 -72 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 5); - - drawstring('64 -80 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " q2 ", '8 8 8', '1 1 1', 1); - QuickImage('64 -72 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 6); -}; void() DrawScreen = { ScreenImage(); }; - -void() Weapon_Draw = -{ - local float hand; - - hand = getstati(61); - - if (hand == 1) - { - drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " HAND 1 ", '8 8 8', '1 1 1', 1); - SlotImage('0 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 1); - } - if (hand == 2) - { - drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " HAND 2 ", '8 8 8', '1 1 1', 1); - SlotImage('0 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 2); - } -}; + void() Crosshair_Draw = { @@ -83,21 +58,17 @@ void() Position_Draw = s = getstati(58); sn = ftos(s); + if (pos == 0) + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.93)) +('0 1 0'*(scrheight*0.87)), "gui/hud/stand.png", '0 0 0'+'32 60 0'*(scrwidth/640), '1 1 1'); + else if (pos == 1) + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.93)) +('0 1 0'*(scrheight*0.87)), "gui/hud/duck.png", '0 0 0'+'32 60 0'*(scrwidth/640), '1 1 1'); + else if (pos == 2) + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.93)) +('0 1 0'*(scrheight*0.87)), "gui/hud/prone.png", '0 0 0'+'32 60 0'*(scrwidth/640), '1 1 1'); + if (s > 0) { - drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "sneak", '8 8 8', '1 1 1', 1); - PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 1); - drawstring('0 8 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), strcat("%", sn), '8 8 8', '1 1 1', 1); - } - else if (pos == 1) - { - drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "duck", '8 8 8', '1 1 1', 1); - PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 1); - } - else if (pos == 2) - { - drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "prone", '8 8 8', '1 1 1', 1); - PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 2); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.20)) +('0 1 0'*(scrheight*0.79)), "gui/hud/sneak.png", '0 0 0'+'72 25 0'*(scrwidth/640), '1 1 1'); + //drawstring('0 0 0'+('1 0 0'*(scrwidth*0.20)) +('0 1 0'*(scrheight*0.80)), strcat("%", sn), '8 8 8', '1 1 1', 1); } }; @@ -140,63 +111,9 @@ void() Time_Draw = drawstring('0 32 0'+('1 0 0'*(scrwidth*0.10))+('0 1 0'*(scrheight*0.90)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8', '1 1 1', 1); }; -void() Ammo_Draw = -{ - local float hand, weap, ammo, amount; - local string reveal; - hand = getstati(61); - if (hand == 1) - { - weap = ToIID(getstati(32)); - ammo = WeaponAmmoType(weap); - amount = ShadowSlotOfItem(self, ammo); - //drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1); - //SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount); - drawstring('-64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " AMMO ", '8 8 8', '1 1 1', 1); - if (amount > 0) - SlotImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), amount); - else - BlankImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 0); - } - else if (hand == 2) - { - weap = ToIID(getstati(33)); - ammo = WeaponAmmoType(weap); - amount = ShadowSlotOfItem(self, ammo); - reveal = ftos(amount); - //drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1); - //SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount); - drawstring('-64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " AMMO ", '8 8 8', '1 1 1', 1); - if (amount > 0) - SlotImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), amount); - else - BlankImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 0); - } -}; -void() Money_Draw = -{ - string cash; - - cash = ftos(getstati(50)); - - drawstring('64 -32 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), cash, '8 8 8', '1 1 1', 1); - MoneyImage('64 -24 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), "money.jpg"); - -}; - -void() Energy_Draw = -{ - string cash; - - cash = ftos(getstati(51)); - - drawstring('34 -32 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), cash, '8 8 8', '1 1 1', 1); - MoneyImage('32 -24 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), "energy.jpg"); - -}; void() Weight_Draw = { @@ -229,114 +146,57 @@ void() Weight_Draw = }; -void() Armor_Draw = -{ - //drawstring('300 350 0'+('3 0 0'*IMGSIZEF), " ARMOR ", '8 8 8', '1 1 1', 1); - //SlotImage('300 358 0'+('3 0 0'*IMGSIZEF), 3); - drawstring('64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " ARMOR ", '8 8 8', '1 1 1', 1); - SlotImage('64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 3); - -}; void() Health_Draw = { - float hp, maxhp, status, perc, hpos, tpos, opos, ostatus, ones; - string string_hpos, string_tpos, string_opos; + local float bar, hp, maxhp, top; hp = getstati(48); maxhp = getstati(49); - status = (floor(hp) * 100) / maxhp; - perc = status; + bar = 0; + top = ceil(150 * (hp/maxhp)); - if (hp >= maxhp) - string_hpos = "one.jpg"; - else - string_hpos = "zero.jpg"; + if (top > 150) + top = 150; - ostatus = status; - status = status * 0.10; - status = floor(status); - - if (status == 0) - string_tpos = "zero.jpg"; - if (status == 1) - string_tpos = "one.jpg"; - if (status == 2) - string_tpos = "two.jpg"; - if (status == 3) - string_tpos = "three.jpg"; - if (status == 4) - string_tpos = "four.jpg"; - if (status == 5) - string_tpos = "five.jpg"; - if (status == 6) - string_tpos = "six.jpg"; - if (status == 7) - string_tpos = "seven.jpg"; - if (status == 8) - string_tpos = "eight.jpg"; - if (status == 9) - string_tpos = "nine.jpg"; - if (status == 10) - string_tpos = "zero.jpg"; - - ones = (ostatus - (status*10)); - ones = floor(ones); - - if (ones == 0) - string_opos = "zero.jpg"; - if (ones == 1) - string_opos = "one.jpg"; - if (ones == 2) - string_opos = "two.jpg"; - if (ones == 3) - string_opos = "three.jpg"; - if (ones == 4) - string_opos = "four.jpg"; - if (ones == 5) - string_opos = "five.jpg"; - if (ones == 6) - string_opos = "six.jpg"; - if (ones == 7) - string_opos = "seven.jpg"; - if (ones == 8) - string_opos = "eight.jpg"; - if (ones == 9) - string_opos = "nine.jpg"; - if (status == 10) - string_opos = "zero.jpg"; - - if (hp <= 0) + while (bar <= top) { - string_hpos = "zero.jpg"; - string_tpos = "zero.jpg"; - string_opos = "zero.jpg"; + + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.07)) +('0 1 0'*(scrheight*0.75)) - ('0 1 0'*bar*(scrheight/640)), "gui/graph/green.jpg", '0 0 0'+'12 1 0'*(scrwidth/640), '1 1 1', 1); + + + bar = bar + 1; } - if (perc > 50) - { - HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 0, "percent.jpg"); - HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_hpos); - HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_tpos); - HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_opos); - } - else if (perc > 25) - { - HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 1, "percent.jpg"); - HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_hpos); - HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_tpos); - HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_opos); - } - else - { - HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 2, "percent.jpg"); - HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_hpos); - HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_tpos); - HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_opos); - } }; + +void() Radiation_Draw = +{ + local float bar, rad, top; + + rad = getstati(106); + + bar = 0; + top = ceil(150 * (rad/100)); + + if (top > 150) + top = 150; + + while (bar <= top) + { + + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.02)) +('0 1 0'*(scrheight*0.75)) - ('0 1 0'*bar*(scrheight/640)), "gui/graph/yellow.jpg", '0 0 0'+'12 1 0'*(scrwidth/640), '1 1 1', 1); + + + bar = bar + 1; + } + +}; + + + void() DoThatViewModelThing = { float newframe, newmodel; @@ -375,6 +235,105 @@ void() CSQC_Init = }; +void(vector pos, float x) HUD_Image = +{ + local float it, mod_s, mod_e; + local string itname; + + + if (x <= 16) + it = getstati(31+x); + + + itname = GetItemImage(ToIID(it)); + drawpic(pos, strcat("gui/", itname), '48 48 0', '1 1 1', 1); + + it = ToStatus(it); + if (it <= 1) + return; + itname = ftos(it); + it = strlen(itname); + drawstring(pos + '48 48 0' - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); +}; + + +void(vector pos, float slotno) HUD_Weapon_Image = +{ + local float it, mod_s, mod_e; + local string itname; + + + if (slotno == downslotnum && slotnum) + slotno = slotnum; + else if (slotno == slotnum && downslotnum) + slotno = downslotnum; + + if (slotno <= 16) + it = getstati(31+slotno); + + + itname = GetItemImage(ToIID(it)); + drawpic(pos, strcat("gui/weapons/", itname), '180 59 0', '1 1 1', 1); + +}; + +void() Ammo_Draw = +{ + local float hand, weap, ammo, amount, max, bar, top; + local string reveal; + + hand = getstati(61); + + if (hand == 1) + { + weap = ToIID(getstati(32)); + ammo = ToStatus(getstati(32)); + max = WeaponMagQuant(weap); + + + bar = 0; + top = ceil(35 * (ammo/max)); + + if (top > 35) + top = 35; + + while (bar <= top) + { + + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.99)) - ('0 2 0'*bar*(scrheight/640)), "gui/graph/green.jpg", '0 0 0'+'8 1 0'*(scrwidth/640), '1 1 1', 1); + + + bar = bar + 1; + } + + } + + if (hand == 2) + { + weap = ToIID(getstati(33)); + ammo = ToStatus(getstati(33)); + max = WeaponMagQuant(weap); + + + bar = 0; + top = ceil(35 * (ammo/max)); + + if (top > 35) + top = 35; + + while (bar <= top) + { + + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.99)) - ('0 2 0'*bar*(scrheight/640)), "gui/graph/green.jpg", '0 0 0'+'8 1 0'*(scrwidth/640), '1 1 1', 1); + + + bar = bar + 1; + } + + } + +}; + void(float vwidth, float vheight, float do2d) CSQC_UpdateView = { @@ -406,8 +365,6 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = renderscene(); -// if (usehud) -// Hud_Draw(); if (getstati(57) == 1) BriefImage(); @@ -435,17 +392,22 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = GainPerk_Draw(); else { - Time_Draw(); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.06)) +('0 1 0'*(scrheight*0.45)), "gui/hud/health.png", '0 0 0'+'25 155 0'*(scrwidth/640), '1 1 1'); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.01)) +('0 1 0'*(scrheight*0.45)), "gui/hud/radiation.png", '0 0 0'+'25 155 0'*(scrwidth/640), '1 1 1'); + drawpic('0 0 0' + ('0 1 0'*(scrheight*0.84)), "gui/hud/hud.png", '0 0 0'+'80 10 0'*(scrwidth/80), '1 1 1'); + Health_Draw(); - Weight_Draw(); - Money_Draw(); + Radiation_Draw(); + + HUD_Weapon_Image('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.87)), getstati(61)); Ammo_Draw(); - Energy_Draw(); - Weapon_Draw(); - Armor_Draw(); + + SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.72)) +('0 1 0'*(scrheight*0.87)), getstati(5)); + SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.79)) +('0 1 0'*(scrheight*0.87)), getstati(6)); + Position_Draw(); - Quick_Draw(); Chem_Draw(); + Time_Draw(); Crosshair_Draw(); } }; diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 29f258d23..534b9fbe5 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -362,11 +362,49 @@ void() TreasureChest = setsize (self, '-12 -12 0', '12 12 12'); self.takedamage = DAMAGE_NO; self.classname = "treasure_chest"; - - }; +void() rad_think = +{ + local entity te; + + self.think = rad_think; + self.nextthink = time + 1; + + te = findradius (self.origin, 700); + while (te) + { + if (te.classname == "player") + te.radiation = te.radiation + 1; + + te = te.chain; + } +}; + +void(vector spot) spawn_radiation = +{ + local entity rad; + + rad = spawn(); + + setorigin(rad, spot + '0 0 64'); + rad.movetype = MOVETYPE_BOUNCE; + rad.velocity_x = crandom()*200; + rad.velocity_y = crandom()*200; + rad.velocity_z = -200; + + rad.avelocity_y = crandom()*200; + + setmodel (rad, ""); + rad.solid = SOLID_NOT; + setsize (rad, '-12 -12 0', '12 12 12'); + rad.takedamage = DAMAGE_NO; + rad.classname = "rad"; + + rad.think = rad_think; + rad.nextthink = time + 1; +}; @@ -841,6 +879,9 @@ void() item_health = setsize (self, '0 0 0', '32 32 56'); StartItem (); } + + if (random()*100 <= 2) + spawn_radiation(self.origin); }; @@ -1059,6 +1100,9 @@ void() item_armor1_finish = }; void() item_armor1 = { + if (random()*100 <= 2) + spawn_radiation(self.origin); + if (random()<0.50) { precache_model ("progs/enforcer.mdl"); @@ -1072,6 +1116,9 @@ void() item_armor1 = void() item_armor2 = { + if (random()*100 <= 2) + spawn_radiation(self.origin); + if (random()<0.50) { precache_model ("progs/enforcer.mdl"); @@ -1092,6 +1139,9 @@ void() item_armor2 = void() item_armorInv = { + if (random()*100 <= 2) + spawn_radiation(self.origin); + if (random()<0.50) { precache_model ("progs/enforcer.mdl"); @@ -1332,6 +1382,8 @@ void() weapon_supershotgun = TreasureChest(); + if (random()*100 <= 5) + spawn_radiation(self.origin); SpawnJunk(self.origin); SpawnJunk(self.origin); @@ -1353,6 +1405,11 @@ void() weapon_nailgun = else TreasureChest(); + + if (random()*100 <= 10) + spawn_radiation(self.origin); + + SpawnJunk(self.origin); SpawnJunk(self.origin); SpawnJunk(self.origin); @@ -1373,6 +1430,10 @@ void() weapon_supernailgun = else if (random()*100 <= 40) TreasureChest(); + + if (random()*100 <= 10) + spawn_radiation(self.origin); + SpawnJunk(self.origin); SpawnJunk(self.origin); SpawnJunk(self.origin); @@ -1394,6 +1455,10 @@ void() weapon_grenadelauncher = else if (random()*100 <= 40) TreasureChest(); + + if (random()*100 <= 5) + spawn_radiation(self.origin); + SpawnJunk(self.origin); SpawnJunk(self.origin); SpawnJunk(self.origin); @@ -1415,6 +1480,11 @@ void() weapon_rocketlauncher = else if (random()*100 <= 40) TreasureChest(); + + if (random()*100 <= 10) + spawn_radiation(self.origin); + + SpawnJunk(self.origin); SpawnJunk(self.origin); SpawnJunk(self.origin); @@ -1437,6 +1507,11 @@ void() weapon_lightning = else if (random()*100 <= 40) TreasureChest(); + + if (random()*100 <= 10) + spawn_radiation(self.origin); + + SpawnJunk(self.origin); SpawnJunk(self.origin); SpawnJunk(self.origin); @@ -1778,6 +1853,9 @@ void() item_rockets = setsize (self, '0 0 0', '32 32 56'); StartItem (); + if (random()*100 <= 2) + spawn_radiation(self.origin); + }; @@ -1817,6 +1895,9 @@ void() item_cells = setsize (self, '0 0 0', '32 32 56'); StartItem (); + if (random()*100 <= 2) + spawn_radiation(self.origin); + }; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index f70dc6551..8a5729d8d 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -100,6 +100,63 @@ float() crandom = + + + +void() healing_bob = +{ +local float rnd1, rnd2, rnd3; + + self.cnt = self.cnt + 1; + + if (self.cnt == 20) + remove(self); + + rnd1 = self.velocity_x + (-30 + (random() * 20)); + rnd2 = self.velocity_y + (-30 + (random() * 20)); + rnd3 = self.velocity_z + 30 + random() * 10; + + if (random()*100 > 50) + rnd1 = 24; + else + rnd1 = -24; + + if (random()*100 > 50) + rnd2 = 24; + else + rnd2 = -24; + + if (random()*100 > 50) + rnd3 = -5; + else + rnd3 = 10; + + self.velocity_x = rnd1; + self.velocity_y = rnd2; + self.velocity_z = rnd3; + + + self.think = healing_bob; + self.nextthink = time + 0.2; +}; + +void (entity spot) spawn_healing = +{ + local entity hologram; + + hologram = spawn (); + hologram.movetype = MOVETYPE_FLY; + hologram.solid = SOLID_NOT; + hologram.owner = spot; + setmodel (hologram, "progs/healing.spr"); + setorigin (hologram, spot.origin + '0 0 48'); + setsize (hologram, VEC_ORIGIN, VEC_ORIGIN); + hologram.angles = spot.angles; + hologram.think = healing_bob; + hologram.nextthink = time + 0.1; +}; + + void(float slotno) UsePerk = { local float x, mcount; @@ -4169,6 +4226,9 @@ void () UseStimpack = DecreaseDestroySlot(x);//take away a stimpack sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); RevivePlayer(self, te); + spawn_healing(te); + spawn_healing(te); + spawn_healing(te); found = 1; } @@ -4216,6 +4276,9 @@ void () UseStimpack = self.health = self.health + 30 + (self.skill_doctor); self.regen = self.regen + (5 + (self.skill_doctor/2)); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); } } else if (trace_ent.classname == "player")//healing another team-mate @@ -4288,6 +4351,9 @@ void () UseStimpack = trace_ent.health = trace_ent.health + 30 + (self.skill_doctor); trace_ent.regen = trace_ent.regen + (3 + (self.skill_doctor/2)); + spawn_healing(trace_ent); + spawn_healing(trace_ent); + spawn_healing(trace_ent); } } } @@ -6190,6 +6256,8 @@ void (entity jeb, float length) spawn_stop = hologram.nextthink = (time + 0.01); }; + + void (string color) ZoomInLarge = { if (self.attack_finished > time) diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 0d144374a..92aa3ddc2 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -103,6 +103,7 @@ void() SetupStats = clientstat(103, 2, skill_science); clientstat(104, 2, shadowtime); clientstat(105, 2, announcercache); + clientstat(106, 2, radiation); clientstat(108, 2, safezone); clientstat(109, 2, connected); clientstat(110, 2, steadyaim); @@ -634,18 +635,22 @@ if (coop == 1) // Players vs Monsters musicplay = 1; musictrack = 1; - bprint(2, "the battle begins!\n"); + if (world.map_obj == OBJ_DEADTOWN) + musictrack = 2; + ze = find (world, classname, "player"); while (ze != world) { if (musictrack == 1) stuffcmd(ze, "play music/battle\n"); + if (musictrack == 2) + stuffcmd(ze, "play misc/zombies\n"); ze = find (ze, classname, "player"); } } - else if (musicplay < 100) + else if (musicplay < 50) musicplay = musicplay + 1; else if (musicplay >= 100) musicplay = 0; @@ -1587,6 +1592,7 @@ void() worldspawn = precache_model ("progs/ammobox.mdl"); precache_model ("progs/ammobox2.mdl"); precache_model ("progs/stop.spr"); + precache_model ("progs/healing.spr"); precache_model ("progs/v_axe.mdl"); precache_model ("progs/v_span.mdl"); diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index bfc97cb49..503d6468b 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -56,7 +56,17 @@ float SPAWN_CRUCIFIED = 1; .float inpain; -void() zombie_stand1 =[ $stand1, zombie_stand2 ] {ai_stand();}; +void() zombie_stand1 =[ $stand1, zombie_stand2 ] {ai_stand(); + +if ((pointcontents(self.origin) <= -2) && (self.owner.netname == "lair")) +{ + remove(self.owner); + remove(self); +} +else if ((pointcontents(self.origin) <= -2)) + remove(self); + +}; void() zombie_stand2 =[ $stand2, zombie_stand3 ] {ai_stand();}; void() zombie_stand3 =[ $stand3, zombie_stand4 ] {ai_stand();}; void() zombie_stand4 =[ $stand4, zombie_stand5 ] {ai_stand();}; @@ -119,6 +129,7 @@ if (self.takedamage == DAMAGE_NO) remove(self); return; } + }; void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(4);}; void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(4);}; @@ -728,19 +739,16 @@ void () spawn_ghoul_copy = self.think = spawn_ghoul_copy; - self.nextthink = time + 5 + random()*5; + self.nextthink = time + 8 + random()*4; stuff = self.origin; - waterlev = ftos(pointcontents(self.origin)); - bprint(2, "pointcontents: "); - bprint(2, waterlev); - bprint(2, "\n"); loadzombie = 0; - te = findradius (self.origin, 800); + + te = findradius (self.origin, 1200); while (te) { if (te.classname == "player") @@ -749,6 +757,17 @@ void () spawn_ghoul_copy = te = te.chain; } + + te = findradius (self.origin, 400); + while (te) + { + if (te.classname == "player") + loadzombie = 0; + + te = te.chain; + } + + if (loadzombie == 0) return; @@ -782,12 +801,13 @@ void () spawn_ghoul_copy = return; zombie = spawn (); + zombie.owner = self; self = zombie; self.solid = SOLID_SLIDEBOX; self.movetype = MOVETYPE_STEP; setmodel (self, "progs/ghoul.mdl"); setsize (self, '-8 -8 -24', '8 8 24'); - self.health = 60; + self.health = 90; self.netname = "ghoul"; self.max_health = self.health; self.th_stand = zombie_stand1; @@ -799,7 +819,16 @@ void () spawn_ghoul_copy = self.angles_y = random()*360; - self.origin = stuff + '0 16 0'; + if (random()*100 <= 3) + { + setsize (self, '-16 -16 -24', '16 16 32'); + self.health = 400; + self.netname = "ghoul lord"; + self.max_health = self.health; + self.scale = 2; + } + + self.origin = stuff + '0 64 0'; self.origin_z = self.origin_z + 1; droptofloor(); @@ -850,7 +879,7 @@ void() monster_zombie = local entity zombie, lair; local entity te, ze; local float stop; - local vector jojo; + local vector spot; local float zomc, pcount; if (self.zone == 0) @@ -894,12 +923,16 @@ void() monster_zombie = if (stop == 0) { - jojo = self.origin; + spot = self.origin; lair = spawn (); - setorigin(lair, jojo); + setorigin(lair, spot); + lair.origin = spot; lair.solid = SOLID_NOT; + lair.health = 1000; + lair.max_health = 1000; + setmodel (lair, ""); lair.movetype = MOVETYPE_STEP; - setsize (lair, '0 0 0', '0 0 0'); + setsize (lair, '-8 -8 -24', '8 8 24'); lair.netname = "lair"; lair.classname = "lair"; lair.nextthink = time + 30; @@ -914,7 +947,7 @@ void() monster_zombie = setmodel (self, "progs/ghoul.mdl"); setsize (self, '-8 -8 -24', '8 8 24'); - self.health = 60; + self.health = 90; self.classname = "monster"; self.netname = "ghoul"; self.th_stand = zombie_stand1; @@ -932,6 +965,6 @@ void() monster_zombie = if (random()<0.25 && world.map_obj == 1) spawn_civilian(self.origin); - if (random()<0.5 && world.map_obj == 4) + if (random()<0.25 && world.map_obj == 4) spawn_civilian(self.origin); }; From 4677f8a644d86ee9afb9251073d5a5bb3790a65a Mon Sep 17 00:00:00 2001 From: Magnus Date: Tue, 17 Nov 2009 14:22:17 +0000 Subject: [PATCH 30/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3465 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 9 +- quakec/fallout2/cmds.qc | 14 +- quakec/fallout2/combat.qc | 25 +- quakec/fallout2/csqc/invent.qc | 426 ++++++++++++++--------- quakec/fallout2/csqc/main.qc | 189 +++++++--- quakec/fallout2/inventory.qc | 605 ++++++++++++++++----------------- quakec/fallout2/items.qc | 2 +- quakec/fallout2/misc.qc | 2 +- quakec/fallout2/weapons.qc | 40 ++- quakec/fallout2/world.qc | 6 +- quakec/fallout2/zombie.qc | 86 +++-- 11 files changed, 811 insertions(+), 593 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 7f975477d..705494cc1 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -1132,7 +1132,7 @@ void() WaterMove = else self.dmgtime = time + 0.2; - T_Damage (self, world, world, 10*self.waterlevel); + self.radiation = self.radiation + (1*self.waterlevel); } } else if (self.watertype == CONTENT_SLIME) @@ -1140,7 +1140,8 @@ void() WaterMove = if (self.dmgtime < time && self.rage != IID_CHEM_RADX) { self.dmgtime = time + 1; - T_Damage (self, world, world, 4*self.waterlevel); + + self.radiation = self.radiation + ((1*self.waterlevel)/2); } } @@ -2074,9 +2075,9 @@ void() ClientConnect = stuffcmd(self, "alias stimpack impulse 225\n"); stuffcmd(self, "alias equip \"cmd invuse 4\"\n"); stuffcmd(self, "alias q1 \"cmd invuse 5\"\n"); - stuffcmd(self, "alias q2 \"cmd invuse 6\"\n"); + stuffcmd(self, "alias q2 \"cmd invuse 11\"\n"); stuffcmd(self, "alias quick1 \"cmd invuse 5\"\n"); - stuffcmd(self, "alias quick2 \"cmd invuse 6\"\n"); + stuffcmd(self, "alias quick2 \"cmd invuse 11\"\n"); stuffcmd(self, "alias toolkit \"cmd invswap toolkit 2;impulse 2\"\n"); diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 07c833f20..07b998bd5 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -311,6 +311,8 @@ void(string arg1, string arg2) Cmd_GainPerk = self.perk1 = 9; if (arg1 == "10") self.perk1 = 10; + if (arg1 == "11") + self.perk1 = 11; } if (arg2 == "2") { @@ -334,6 +336,8 @@ void(string arg1, string arg2) Cmd_GainPerk = self.perk2 = 9; if (arg1 == "10") self.perk2 = 10; + if (arg1 == "11") + self.perk2 = 11; } }; @@ -599,22 +603,22 @@ void(string arg1) Cmd_InvMix = DecreaseDestroySlot(23); DecreaseDestroySlot(24); - if (random()*100 > (self.skill_science*8)) + if (random()*100 > (self.skill_science*20)) { sprint(self, PRINT_MEDIUM, "your concoction exploded!\n"); Explosion(); return; } - if (random()*100 < ((self.skill_science*8) - 100)) + if (random()*100 < ((self.skill_science*20) - 100)) { - sprint(self, PRINT_MEDIUM, "2 grenades created!\n"); + sprint(self, PRINT_MEDIUM, "3 nuka bombs created!\n"); sound (self, CHAN_BODY, "misc/yourturn.wav", 1, ATTN_NORM); - TryGiveStackable(self, IID_GREN_FRAG, 2); + TryGiveStackable(self, IID_GREN_FRAG, 3); return; } TryGiveStackable(self, IID_GREN_FRAG, 1); - sprint(self, PRINT_MEDIUM, "1 grenade created\n"); + sprint(self, PRINT_MEDIUM, "1 nuka bomb created\n"); sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); } else if ((iid1 == IID_MISC_CHEMICALS && iid2 == IID_MISC_RDXCRYSTAL) || diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 3d30721a7..186855113 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -115,7 +115,7 @@ This should be the only function that ever reduces health. void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = { local entity oldself; - local float save, dm; + local float save, dm, radpenalty; local float take, severity, helm; local string attackerteam, targteam; local string info1, info2; @@ -137,6 +137,15 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (targ.classname == "player") damage = floor(damage * 0.60);*/ + if (targ.radiation > 0) + { + radpenalty = 1 + (targ.radiation/100); + + if (radpenalty > 1.25) + radpenalty = 1.25; + + damage = damage * radpenalty; + } //getting hurt is slightly painful to the score, play cautiously! if (attacker.classname == "monster" && targ.classname == "player") @@ -449,31 +458,31 @@ take = damage; switch(ToIID(targ.islot3)) { case IID_ARM_DESERT: - take -= 2; + take -= 1; break; case IID_ARM_LEATHER: - take -= 3; + take -= 2; break; case IID_ARM_VANDAL: - take -= 5; + take -= 3; break; case IID_ARM_METAL: take -= 1; break; case IID_ARM_TESLA: - take -= 6; + take -= 5; break; case IID_ARM_COMBAT: take -= 6; break; case IID_ARM_SEVA: - take -= 6; + take -= 5; break; case IID_ARM_FORCE: take -= 9; break; case IID_ARM_LPOWER: - take -= 10; + take -= 8; break; default: break; @@ -485,7 +494,7 @@ take = damage; take = take * 0.80; break; case IID_ARM_VANDAL: - take = take * 0.70; + take = take * 0.65; break; case IID_ARM_METAL: take = take * 0.40; diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 01c33a785..29ea43fcc 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -14,6 +14,8 @@ float scrheight; vector mousepos; float showcontextmenu; +float showmixmenu; + vector contextpos; float slotnum; //the current slot under the mousecursor @@ -121,6 +123,53 @@ void(vector pos, float slotno) SlotImage = drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); }; +void(vector pos, float slotno, vector imgsize) SlotImageBig = +{ + local float it, mod_s, mod_e; + local string itname; + + + if (slotno == downslotnum && slotnum) + slotno = slotnum; + else if (slotno == slotnum && downslotnum) + slotno = downslotnum; + + if (slotno <= 16) + it = getstati(31+slotno); + else + { + if (slotno == 17) + it = getstati(91); + if (slotno == 18) + it = getstati(92); + if (slotno == 19) + it = getstati(93); + if (slotno == 20) + it = getstati(94); + if (slotno == 21) + it = getstati(95); + if (slotno == 22) + it = getstati(96); + if (slotno == 23) + 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)); + drawpic(pos, strcat("gui/weapons/", itname), imgsize, '1 1 1', 1); + + it = ToStatus(it); + if (it <= 1) + return; + itname = ftos(it); + it = strlen(itname); + drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); +}; void(vector pos, float slotno) SlotImageSmall = @@ -492,7 +541,7 @@ void() Trader_Draw = if (slotnum <= 20) it = getstati(70+slotnum); - itname = GetItemDesc(ToIID(it)); + itname = GetItemName(ToIID(it)); drawstring('32 16 0', itname, '8 8 0', '1 1 1', 1); price = GetBaseValue(ToIID(it)); @@ -513,30 +562,30 @@ void() Perks_Draw = { local string perki, perk2i, p1, p2; - drawpic('0 0 0', "gui/pipboy/perks.png", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/perks.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); - if (mousepos_y >= 2.0*IMGSIZEF && mousepos_y <= 4*IMGSIZEF) + if (mousepos_y >= 2.0*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640)) { - if (mousepos_x >= 3*IMGSIZEF && mousepos_x <= 5.5*IMGSIZEF) + if (mousepos_x >= 3*IMGSIZEF*(scrwidth/640) && mousepos_x <= 5.5*IMGSIZEF*(scrwidth/640)) selected_class = 8; - else if (mousepos_x >= 6*IMGSIZEF && mousepos_x <= 7.5*IMGSIZEF) + else if (mousepos_x >= 6*IMGSIZEF*(scrwidth/640) && mousepos_x <= 7.5*IMGSIZEF*(scrwidth/640)) selected_class = 9; else selected_class = 0; } - else if (mousepos_y >= 390 && mousepos_y <= 425) + else if (mousepos_y >= 390*(scrwidth/640) && mousepos_y <= 425*(scrwidth/640)) { - if (mousepos_x >= 300 && mousepos_x <= 335) + if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 335*(scrwidth/640)) selected_class = 5; - else if (mousepos_x >= 350 && mousepos_x <= 385) + else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 385*(scrwidth/640)) selected_class = 6; - else if (mousepos_x >= 400 && mousepos_x <= 435) + else if (mousepos_x >= 400*(scrwidth/640) && mousepos_x <= 435*(scrwidth/640)) selected_class = 7; else selected_class = 0; @@ -548,15 +597,14 @@ void() Perks_Draw = perk2i = GetPerkImage(getstati(59)); - drawpic('3.5 2 0'*IMGSIZEF, perki, '128 128 0', '1 1 1', 1); - - drawpic('6 2 0'*IMGSIZEF, perk2i, '128 128 0', '1 1 1', 1); + drawpic('3.5 2 0'*IMGSIZEF*(scrwidth/640), perki, '128 128 0'*(scrwidth/640), '1 1 1', 1); + drawpic('6 2 0'*IMGSIZEF*(scrwidth/640), perk2i, '128 128 0'*(scrwidth/640), '1 1 1', 1); p1 = PerkNameCentered(1, getstati(60)); p2 = PerkNameCentered(2, getstati(59)); - drawstring('4 4.5 0'*IMGSIZEF - '45 0 0', p1, '8 8 8', '1 1 1', 1); - drawstring('6 4.5 0'*IMGSIZEF - '7 0 0', p2, '8 8 8', '1 1 1', 1); + drawstring('4 4.5 0'*IMGSIZEF*(scrwidth/640) - '45 0 0'*(scrwidth/640), p1, '8 8 8'*(scrwidth/640), '1 1 1', 1); + drawstring('6 4.5 0'*IMGSIZEF*(scrwidth/640) - '7 0 0'*(scrwidth/640), p2, '8 8 8'*(scrwidth/640), '1 1 1', 1); @@ -568,42 +616,60 @@ void() Items_Draw = local float it; local string itname; - drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); - if (mousepos_y >= 390 && mousepos_y <= 425) + if (mousepos_y >= 390*(scrwidth/640) && mousepos_y <= 425*(scrwidth/640)) { - drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); - if (mousepos_x >= 300 && mousepos_x <= 325) + if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 325*(scrwidth/640)) selected_class = 5; - else if (mousepos_x >= 350 && mousepos_x <= 385) + else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 385*(scrwidth/640)) selected_class = 6; - else if (mousepos_x >= 400 && mousepos_x <= 435) + else if (mousepos_x >= 400*(scrwidth/640) && mousepos_x <= 435*(scrwidth/640)) selected_class = 7; else selected_class = 0; } - SlotImage('3 1.25 0'*IMGSIZEF, 1); + SlotImageBig('3 1.25 0'*IMGSIZEF*(scrwidth/640), 1, '180 64 0'*(scrwidth/640)); - SlotImage('3 2.75 0'*IMGSIZEF, 2); + SlotImageBig('5.5 2.75 0'*IMGSIZEF*(scrwidth/640), 2, '180 64 0'*(scrwidth/640)); - SlotImage('3 4.25 0'*IMGSIZEF, 3); + SlotImageBig('3 3.4 0'*IMGSIZEF*(scrwidth/640), 3, '128 128 0'*(scrwidth/640)); it = getstati(32); itname = GetItemName(ToIID(it)); - drawstring('4 1.5 0'*IMGSIZEF + '0 0 0', itname, '8 8 0', '1 1 1', 1); + drawstring('3 1 0'*IMGSIZEF*(scrwidth/640) + '0 0 0'*(scrwidth/640), itname, '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = (ftos(GetWeaponDamage(ToIID(it)))); + drawstring('6 1.5 0'*IMGSIZEF*(scrwidth/640) + '0 8 0'*(scrwidth/640), strcat("damage: ", itname, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = (ftos(GetWeaponRange(ToIID(it)))); + drawstring('6 1.5 0'*IMGSIZEF*(scrwidth/640) + '0 16 0'*(scrwidth/640), strcat("range: ", itname, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = (ftos(GetItemWeight(ToIID(it)))); + drawstring('6 1.5 0'*IMGSIZEF*(scrwidth/640) + '0 24 0'*(scrwidth/640), strcat("weight: ", itname, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); it = getstati(33); itname = GetItemName(ToIID(it)); - drawstring('4 3 0'*IMGSIZEF + '0 0 0', itname, '8 8 0', '1 1 1', 1); + drawstring('5.5 2.5 0'*IMGSIZEF*(scrwidth/640) + '0 0 0'*(scrwidth/640), itname, '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = (ftos(GetWeaponDamage(ToIID(it)))); + drawstring('4.5 2.8 0'*IMGSIZEF*(scrwidth/640) + '0 8 0'*(scrwidth/640), strcat("damage: ", itname, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = (ftos(GetWeaponRange(ToIID(it)))); + drawstring('4.5 2.8 0'*IMGSIZEF*(scrwidth/640) + '0 16 0'*(scrwidth/640), strcat("range: ", itname, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = (ftos(GetItemWeight(ToIID(it)))); + drawstring('4.5 2.8 0'*IMGSIZEF*(scrwidth/640) + '0 24 0'*(scrwidth/640), strcat("weight: ", itname, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); it = getstati(34); itname = GetItemName(ToIID(it)); - drawstring('4 4.5 0'*IMGSIZEF + '0 0 0', itname, '8 8 0', '1 1 1', 1); + drawstring('3 5 0'*IMGSIZEF*(scrwidth/640) + '0 0 0'*(scrwidth/640), itname, '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = (ftos(GetArmorThreshold(ToIID(it)))); + drawstring('5 4.3 0'*IMGSIZEF*(scrwidth/640) + '0 8 0'*(scrwidth/640), strcat("threshold: ", itname, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = (ftos(GetArmorAbsorb(ToIID(it)))); + drawstring('5 4.3 0'*IMGSIZEF*(scrwidth/640) + '0 16 0'*(scrwidth/640), strcat("absorb: ", itname, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = (ftos(GetItemWeight(ToIID(it)))); + drawstring('5 4.3 0'*IMGSIZEF*(scrwidth/640) + '0 24 0'*(scrwidth/640), strcat("weight: ", itname, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -615,55 +681,64 @@ void() GainPerk_Draw = local float it; local string itname, pn, pd; - drawpic('0 0 0', "gui/pipboy/gainperk.png", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/gainperk.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); - if (mousepos_y >= 2*IMGSIZEF && mousepos_y <= 3*IMGSIZEF) + if (mousepos_y >= 2*IMGSIZEF*(scrwidth/640) && mousepos_y <= 3*IMGSIZEF*(scrwidth/640)) { - if (mousepos_x >= 2*IMGSIZEF && mousepos_x <= 3*IMGSIZEF) + if (mousepos_x >= 2*IMGSIZEF*(scrwidth/640) && mousepos_x <= 3*IMGSIZEF*(scrwidth/640)) which_perk = 1; - else if (mousepos_x >= 3*IMGSIZEF && mousepos_x <= 4*IMGSIZEF) + else if (mousepos_x >= 3*IMGSIZEF*(scrwidth/640) && mousepos_x <= 4*IMGSIZEF*(scrwidth/640)) which_perk = 2; - else if (mousepos_x >= 4*IMGSIZEF && mousepos_x <= 5*IMGSIZEF) + else if (mousepos_x >= 4*IMGSIZEF*(scrwidth/640) && mousepos_x <= 5*IMGSIZEF*(scrwidth/640)) which_perk = 3; - else if (mousepos_x >= 5*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) + else if (mousepos_x >= 5*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) which_perk = 4; - else if (mousepos_x >= 6*IMGSIZEF && mousepos_x <= 7*IMGSIZEF) + else if (mousepos_x >= 6*IMGSIZEF*(scrwidth/640) && mousepos_x <= 7*IMGSIZEF*(scrwidth/640)) which_perk = 5; else which_perk = 0; } - if (mousepos_y >= 3*IMGSIZEF && mousepos_y <= 4*IMGSIZEF) + if (mousepos_y >= 3*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640)) { - if (mousepos_x >= 2*IMGSIZEF && mousepos_x <= 3*IMGSIZEF) + if (mousepos_x >= 2*IMGSIZEF*(scrwidth/640) && mousepos_x <= 3*IMGSIZEF*(scrwidth/640)) which_perk = 6; - else if (mousepos_x >= 3*IMGSIZEF && mousepos_x <= 4*IMGSIZEF) + else if (mousepos_x >= 3*IMGSIZEF*(scrwidth/640) && mousepos_x <= 4*IMGSIZEF*(scrwidth/640)) which_perk = 7; - else if (mousepos_x >= 4*IMGSIZEF && mousepos_x <= 5*IMGSIZEF) + else if (mousepos_x >= 4*IMGSIZEF*(scrwidth/640) && mousepos_x <= 5*IMGSIZEF*(scrwidth/640)) which_perk = 8; - else if (mousepos_x >= 5*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) + else if (mousepos_x >= 5*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) which_perk = 9; - else if (mousepos_x >= 6*IMGSIZEF && mousepos_x <= 7*IMGSIZEF) + else if (mousepos_x >= 6*IMGSIZEF*(scrwidth/640) && mousepos_x <= 7*IMGSIZEF*(scrwidth/640)) which_perk = 10; else which_perk = 0; } + if (mousepos_y >= 4*IMGSIZEF*(scrwidth/640) && mousepos_y <= 5*IMGSIZEF*(scrwidth/640)) + { + if (mousepos_x >= 2*IMGSIZEF*(scrwidth/640) && mousepos_x <= 3*IMGSIZEF*(scrwidth/640)) + which_perk = 11; + else + which_perk = 0; + } - drawpic('2 2 0'*IMGSIZEF, "gui/perks/Support Fire.png", '64 64 0', '1 1 1', 1); - drawpic('3 2 0'*IMGSIZEF, "gui/perks/Duck And Cover", '64 64 0', '1 1 1', 1); - drawpic('4 2 0'*IMGSIZEF, "gui/perks/Harmless.png", '64 64 0', '1 1 1', 1); - drawpic('5 2 0'*IMGSIZEF, "gui/perks/Stay Low.png", '64 64 0', '1 1 1', 1); - drawpic('6 2 0'*IMGSIZEF, "gui/perks/Surgical Precision.png", '64 64 0', '1 1 1', 1); + drawpic('2 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Support Fire.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('3 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Duck And Cover", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('4 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Harmless.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('5 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Stay Low.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('6 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Surgical Precision.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); - drawpic('2 3 0'*IMGSIZEF, "gui/perks/Mutation.png", '64 64 0', '1 1 1', 1); - drawpic('3 3 0'*IMGSIZEF, "gui/perks/Narrow Escape.png", '64 64 0', '1 1 1', 1); - drawpic('4 3 0'*IMGSIZEF, "gui/perks/Schizophrenia.png", '64 64 0', '1 1 1', 1); - drawpic('5 3 0'*IMGSIZEF, "gui/perks/Sleep Tight.png", '64 64 0', '1 1 1', 1); - drawpic('6 3 0'*IMGSIZEF, "gui/perks/Economic Moves.png", '64 64 0', '1 1 1', 1); + drawpic('2 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Mutation.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('3 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Narrow Escape.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('4 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Schizophrenia.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('5 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Sleep Tight.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('6 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Economic Moves.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + + drawpic('2 4 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Nuclear Man.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); pn = PerkName(1, which_perk); pd = GetPerkDesc(which_perk); - drawstring('32 16 0', pn, '8 8 0', '1 1 1', 1); - drawstring('32 32 0', pd, '8 8 0', '1 1 1', 1); + drawstring('32 16 0'*(scrwidth/640), pn, '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('32 32 0'*(scrwidth/640), pd, '8 8 0'*(scrwidth/640), '1 1 1', 1); drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); @@ -681,99 +756,101 @@ void() Pipboy_Draw = - if (mousepos_y >= 200 && mousepos_y <= 325) + if (mousepos_y >= 200*(scrwidth/640) && mousepos_y <= 325*(scrwidth/640)) { - if (mousepos_x >= 150 && mousepos_x <= 250) + if (mousepos_x >= 150*(scrwidth/640) && mousepos_x <= 250*(scrwidth/640)) { - drawpic('0 0 0', "gui/pipboy/skills2.jpg", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/skills2.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); selected_class = 1; } - else if (mousepos_x >= 250 && mousepos_x <= 350) + else if (mousepos_x >= 250*(scrwidth/640) && mousepos_x <= 350*(scrwidth/640)) { - drawpic('0 0 0', "gui/pipboy/skills3.jpg", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/skills3.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); selected_class = 2; } - else if (mousepos_x >= 350 && mousepos_x <= 450) + else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 450*(scrwidth/640)) { - drawpic('0 0 0', "gui/pipboy/skills4.jpg", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/skills4.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); selected_class = 3; } - else if (mousepos_x >= 450 && mousepos_x <= 550) + else if (mousepos_x >= 450*(scrwidth/640) && mousepos_x <= 550*(scrwidth/640)) { - drawpic('0 0 0', "gui/pipboy/skills5.jpg", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/skills5.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); selected_class = 4; } else { - drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); selected_class = 0; } } - else if (mousepos_y >= 390 && mousepos_y <= 425) + else if (mousepos_y >= 390*(scrwidth/640) && mousepos_y <= 425*(scrwidth/640)) { - drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); - if (mousepos_x >= 300 && mousepos_x <= 325) + if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 325*(scrwidth/640)) selected_class = 5; - else if (mousepos_x >= 350 && mousepos_x <= 375) + else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 375*(scrwidth/640)) selected_class = 6; - else if (mousepos_x >= 400 && mousepos_x <= 425) + else if (mousepos_x >= 400*(scrwidth/640) && mousepos_x <= 425*(scrwidth/640)) selected_class = 7; else selected_class = 0; } else { - drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); selected_class = 0; } if (selected_class == 1) { - drawstring('200 50 0', " combat", '8 8 0', '1 1 1', 1); - drawstring('200 66 0', "place points into this skill for improved", '8 8 0', '1 1 1', 1); - drawstring('200 74 0', "handling of weapons, as well as increased", '8 8 0', '1 1 1', 1); - drawstring('200 82 0', "carry capacity and other aspects of being", '8 8 0', '1 1 1', 1); - drawstring('200 90 0', "trained in combat.", '8 8 0', '1 1 1', 1); + drawstring('200 50 0'*(scrwidth/640), " combat", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 66 0'*(scrwidth/640), "place points into this skill for improved", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 74 0'*(scrwidth/640), "handling of weapons, as well as increased", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 82 0'*(scrwidth/640), "carry capacity and other aspects of being", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 90 0'*(scrwidth/640), "trained in combat.", '8 8 0'*(scrwidth/640), '1 1 1', 1); } if (selected_class == 2) { - drawstring('200 50 0', " doctor", '8 8 0', '1 1 1', 1); - drawstring('200 66 0', "place points into this skill for improved", '8 8 0', '1 1 1', 1); - drawstring('200 74 0', "chem use, which substantially affects the", '8 8 0', '1 1 1', 1); - drawstring('200 82 0', "amount of healing done, as well as all of", '8 8 0', '1 1 1', 1); - drawstring('200 90 0', "the other aspects of first aid.", '8 8 0', '1 1 1', 1); + drawstring('200 50 0'*(scrwidth/640), " doctor", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 66 0'*(scrwidth/640), "place points into this skill for improved", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 74 0'*(scrwidth/640), "chem use, which substantially affects the", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 82 0'*(scrwidth/640), "amount of healing done, as well as all of", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 90 0'*(scrwidth/640), "the other aspects of first aid.", '8 8 0'*(scrwidth/640), '1 1 1', 1); } if (selected_class == 3) { - drawstring('200 50 0', " sneak", '8 8 0', '1 1 1', 1); - drawstring('200 66 0', "place points into this skill to maximize", '8 8 0', '1 1 1', 1); - drawstring('200 74 0', "your ability to remain unseen by enemies.", '8 8 0', '1 1 1', 1); - drawstring('200 82 0', "grants higher sneak ability and how fast", '8 8 0', '1 1 1', 1); - drawstring('200 90 0', "you can pick locks, among other things.", '8 8 0', '1 1 1', 1); + drawstring('200 50 0'*(scrwidth/640), " sneak", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 66 0'*(scrwidth/640), "place points into this skill to maximize", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 74 0'*(scrwidth/640), "your ability to remain unseen by enemies.", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 82 0'*(scrwidth/640), "grants higher sneak ability and how fast", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 90 0'*(scrwidth/640), "you can pick locks, among other things.", '8 8 0'*(scrwidth/640), '1 1 1', 1); } if (selected_class == 4) { - drawstring('200 50 0', " science", '16 16 0', '1 1 1', 1); - drawstring('200 66 0', "place points into this skill to increase", '8 8 0', '1 1 1', 1); - drawstring('200 74 0', "your chances of making useful items from", '8 8 0', '1 1 1', 1); - drawstring('200 82 0', "junk found in the wasteland. use the mix", '8 8 0', '1 1 1', 1); - drawstring('200 90 0', "box found in your inventory screen.", '8 8 0', '1 1 1', 1); + drawstring('200 50 0'*(scrwidth/640), " science", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 66 0'*(scrwidth/640), "place points into this skill to increase", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 74 0'*(scrwidth/640), "your chances of making useful items from", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 82 0'*(scrwidth/640), "junk found in the wasteland. use the mix", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('200 90 0'*(scrwidth/640), "box found in your inventory screen.", '8 8 0'*(scrwidth/640), '1 1 1', 1); } + + bar = 0; lvl = getstati(100); skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('210 190 0' - ('0 4 0'*bar), "gui/graph/red.jpg", '16 2 0'*2, '1 1 1', 1); + drawpic('210 190 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/graph/red.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); bar = bar + 1; } - drawstring('220 190 0' - ('0 4 0'*(lvl+4)), skill, '8 8 0', '1 1 1', 1); + drawstring('220 190 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '8 8 0'*(scrwidth/640), '1 1 1', 1); bar = 0; @@ -781,30 +858,30 @@ void() Pipboy_Draw = skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('305 190 0' - ('0 4 0'*bar), "gui/graph/green.jpg", '16 2 0'*2, '1 1 1', 1); + drawpic('305 190 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/graph/green.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); bar = bar + 1; } - drawstring('315 190 0' - ('0 4 0'*(lvl+4)), skill, '8 8 0', '1 1 1', 1); + drawstring('315 190 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '8 8 0'*(scrwidth/640), '1 1 1', 1); bar = 0; lvl = getstati(102); skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('395 190 0' - ('0 4 0'*bar), "gui/graph/blue.jpg", '16 2 0'*2, '1 1 1', 1); + drawpic('395 190 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/graph/blue.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); bar = bar + 1; } - drawstring('405 190 0' - ('0 4 0'*(lvl+4)), skill, '8 8 0', '1 1 1', 1); + drawstring('405 190 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '8 8 0'*(scrwidth/640), '1 1 1', 1); bar = 0; lvl = getstati(103); skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('485 190 0' - ('0 4 0'*bar), "gui/graph/yellow.jpg", '16 2 0'*2, '1 1 1', 1); + drawpic('485 190 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/graph/yellow.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); bar = bar + 1; } - drawstring('495 190 0' - ('0 4 0'*(lvl+4)), skill, '8 8 0', '1 1 1', 1); + drawstring('495 190 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '8 8 0'*(scrwidth/640), '1 1 1', 1); drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -823,117 +900,124 @@ void() Invent_Draw = width = cvar("vid_conwidth"); //how much space have we got for the slider? - drawpic('0 0 0', "gui/pipboy/inventory.jpg", '500 470 0', '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/inventory.jpg", '500 470 0'*(scrwidth/640), '1 1 1', 1); local float slotofs; slotofs = sliderpos*(height - (IMGSIZEF*6)) + (IMGSIZEF*6); - SlotImage('2 1 0'*IMGSIZEF, 5); - SlotImage('2 2 0'*IMGSIZEF, 6); - SlotImage('2 3 0'*IMGSIZEF, 7); - 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); - SlotImage('3 4 0'*IMGSIZEF, 14); - SlotImage('3 5 0'*IMGSIZEF, 15); - SlotImage('3 6 0'*IMGSIZEF, 16); + SlotImage('2 1 0'*IMGSIZEF*(scrwidth/640), 5); + SlotImage('2 2 0'*IMGSIZEF*(scrwidth/640), 6); + SlotImage('2 3 0'*IMGSIZEF*(scrwidth/640), 7); + SlotImage('2 4 0'*IMGSIZEF*(scrwidth/640), 8); + SlotImage('2 5 0'*IMGSIZEF*(scrwidth/640), 9); + SlotImage('2 6 0'*IMGSIZEF*(scrwidth/640), 10); + SlotImage('3 1 0'*IMGSIZEF*(scrwidth/640), 11); + SlotImage('3 2 0'*IMGSIZEF*(scrwidth/640), 12); + SlotImage('3 3 0'*IMGSIZEF*(scrwidth/640), 13); + SlotImage('3 4 0'*IMGSIZEF*(scrwidth/640), 14); + SlotImage('3 5 0'*IMGSIZEF*(scrwidth/640), 15); + SlotImage('3 6 0'*IMGSIZEF*(scrwidth/640), 16); check = getstati(32); if (check > 0) - SlotImage('6 1 0'*IMGSIZEF - '16 2 0', 1); + SlotImage('6 1 0'*IMGSIZEF*(scrwidth/640) - '16 2 0'*(scrwidth/640), 1); check = getstati(33); if (check > 0) - SlotImage('6 2 0'*IMGSIZEF - '16 -5 0', 2); + SlotImage('6 2 0'*IMGSIZEF*(scrwidth/640) - '16 -5 0'*(scrwidth/640), 2); check = getstati(34); if (check > 0) - SlotImage('6 3 0'*IMGSIZEF - '16 -13 0', 3); + SlotImage('6 3 0'*IMGSIZEF*(scrwidth/640) - '16 -13 0'*(scrwidth/640), 3); + + check = getstati(35); + if (check > 0) + SlotImageSmall('1 12.5 0'*IMGSIZEK*(scrwidth/640), 4); + + SlotImageSmall('1 3 0'*IMGSIZEK*(scrwidth/640), 17); + SlotImageSmall('1 4 0'*IMGSIZEK*(scrwidth/640), 18); + SlotImageSmall('1 5 0'*IMGSIZEK*(scrwidth/640), 19); + SlotImageSmall('1 6 0'*IMGSIZEK*(scrwidth/640), 20); + SlotImageSmall('1 7 0'*IMGSIZEK*(scrwidth/640), 21); + SlotImageSmall('1 8 0'*IMGSIZEK*(scrwidth/640), 22); - SlotImageSmall('1 3 0'*IMGSIZEK, 17); - SlotImageSmall('1 4 0'*IMGSIZEK, 18); - SlotImageSmall('1 5 0'*IMGSIZEK, 19); - SlotImageSmall('1 6 0'*IMGSIZEK, 20); - SlotImageSmall('1 7 0'*IMGSIZEK, 21); - SlotImageSmall('1 8 0'*IMGSIZEK, 22); - - - SlotImageSmall('1 12.5 0'*IMGSIZEK, 4); - check = getstati(97); if (check > 0) - SlotImageSmall('11 12 0'*IMGSIZEK, 23); + SlotImageSmall('11 12 0'*IMGSIZEK*(scrwidth/640), 23); check = getstati(98); if (check > 0) - SlotImageSmall('13 12 0'*IMGSIZEK, 24); + SlotImageSmall('13 12 0'*IMGSIZEK*(scrwidth/640), 24); if (showcontextmenu && show_inventory) { - drawfill(contextpos - '8 8 0', '88 24 0'+'96 96 0', '0 0 0', 0.9); + drawfill(contextpos - '8 8 0', '88 24 0'+'32 16 0'*(scrwidth/640), '0 0 0', 1); op = floor((mousepos_y - contextpos_y)/8); drawstring(contextpos + (0 * '0 8 0'), "use/reload", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1); drawstring(contextpos + (1 * '0 8 0'), "drop", '8 8 0', '1 1 0' + (op!=1)*'0 0 1', 1); - drawstring(contextpos + (2 * '0 8 0'), "mix", '8 8 0', '1 1 0' + (op!=2)*'0 0 1', 1); if (getstati(108) == 1) - drawstring(contextpos + (3 * '0 8 0'), "sell", '8 8 0', '1 1 0' + (op!=3)*'0 0 1', 1); + drawstring(contextpos + (2 * '0 8 0'), "sell", '8 8 0', '1 1 0' + (op!=2)*'0 0 1', 1); } + else if (showmixmenu && show_inventory) + { + 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'), "mix items", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1); + } else { if ((mousepos_y >= 12.5*IMGSIZEH && mousepos_y <= 13*IMGSIZEH) && mousepos_x <= IMGSIZEF) { slotnum = 4; } - else if (mousepos_x >= IMGSIZEF) + else if (mousepos_x >= IMGSIZEF*(scrwidth/640) ) { slotnum = 0; - if (mousepos_x >= 2*IMGSIZEF && mousepos_x <= 3*IMGSIZEF) - if (mousepos_y >= 1*IMGSIZEF && mousepos_y <= 7*IMGSIZEF) - slotnum = floor((mousepos_y)/IMGSIZEF) + 4; + if (mousepos_x >= 2*IMGSIZEF*(scrwidth/640) && mousepos_x <= 3*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 7*IMGSIZEF*(scrwidth/640)) + slotnum = floor((mousepos_y)/(IMGSIZEF*(scrwidth/640))) + 4; - if (mousepos_x >= 3*IMGSIZEF && mousepos_x <= 4*IMGSIZEF) - if (mousepos_y >= 1*IMGSIZEF && mousepos_y <= 7*IMGSIZEF) - slotnum = floor((mousepos_y)/IMGSIZEF) + 10; + if (mousepos_x >= 3*IMGSIZEF*(scrwidth/640) && mousepos_x <= 4*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 7*IMGSIZEF*(scrwidth/640)) + slotnum = floor((mousepos_y)/(IMGSIZEF*(scrwidth/640))) + 10; - if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.7*IMGSIZEF) - if (mousepos_y >= 1*IMGSIZEF && mousepos_y <= 2*IMGSIZEF) + if (mousepos_x >= 5.5*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6.7*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 2*IMGSIZEF*(scrwidth/640)) slotnum = 1; - if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.7*IMGSIZEF) - if (mousepos_y >= 2*IMGSIZEF && mousepos_y <= 3*IMGSIZEF) + if (mousepos_x >= 5.5*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6.7*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 2*IMGSIZEF*(scrwidth/640) && mousepos_y <= 3*IMGSIZEF*(scrwidth/640)) slotnum = 2; - if (mousepos_x >= 5.5*IMGSIZEF && mousepos_x <= 6.7*IMGSIZEF) - if (mousepos_y >= 3*IMGSIZEF && mousepos_y <= 4*IMGSIZEF) + if (mousepos_x >= 5.5*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6.7*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 3*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640)) slotnum = 3; - if (mousepos_x >= 10.75*IMGSIZEK && mousepos_x <= 12.25*IMGSIZEK) - if (mousepos_y >= 11.75*IMGSIZEK && mousepos_y <= 13.25*IMGSIZEK) + if (mousepos_x >= 10.75*IMGSIZEK*(scrwidth/640) && mousepos_x <= 12.25*IMGSIZEK*(scrwidth/640)) + if (mousepos_y >= 11.75*IMGSIZEK*(scrwidth/640) && mousepos_y <= 13.25*IMGSIZEK*(scrwidth/640)) slotnum = 23; - if (mousepos_x >= 12.75*IMGSIZEK && mousepos_x <= 14.25*IMGSIZEK) - if (mousepos_y >= 11.75*IMGSIZEK && mousepos_y <= 13.25*IMGSIZEK) + if (mousepos_x >= 12.75*IMGSIZEK*(scrwidth/640) && mousepos_x <= 14.25*IMGSIZEK*(scrwidth/640)) + if (mousepos_y >= 11.75*IMGSIZEK*(scrwidth/640) && mousepos_y <= 13.25*IMGSIZEK*(scrwidth/640)) slotnum = 24; } else { - slotnum = floor((mousepos_y)/IMGSIZEK) + 14; + slotnum = floor((mousepos_y)/(IMGSIZEK*(scrwidth/640))) + 14; if (slotnum <= 16) slotnum = 0; if (slotnum >= 25) @@ -942,7 +1026,7 @@ void() Invent_Draw = // slotnum = floor((mousepos_y - toppos_y)/8) + 1; } - drawstring('128 0 0', ftos(slotnum), '8 8 0', '1 1 1', 1); + if (slotnum <= 24) @@ -971,24 +1055,16 @@ if (slotnum <= 24) } itname = GetItemName(ToIID(it)); - drawstring('32 16 0', itname, '16 16 0', '1 1 1', 1); + drawstring('32 16 0'*(scrwidth/640), itname, '16 16 0'*(scrwidth/640), '1 1 1', 1); } -else if (slotnum == 98) -{ - pn = PerkName(1, getstati(60)); - pd = GetPerkDesc(getstati(60)); - drawstring('128 32 0', pn, '8 8 0', '1 1 1', 1); - drawstring('128 48 0', pd, '8 8 0', '1 1 1', 1); -} -else if (slotnum == 99) -{ - pn = PerkName(2, getstati(59)); - pd = GetPerkDesc(getstati(59)); - drawstring('128 32 0', pn, '8 8 0', '1 1 1', 1); - drawstring('128 48 0', pd, '8 8 0', '1 1 1', 1); -} -// drawfill(mousepos, '8 8 0', '0 0 0', 0.7); -// drawstring(mousepos, "^", '8 8 0', '1 1 1', 1); + + + if (mousepos_x > scrwidth*0.95) + mousepos_x = scrwidth*0.95; + + if (mousepos_y > scrheight*0.95) + mousepos_y = scrheight*0.95; + if (downslotnum == 0) drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); @@ -1103,12 +1179,20 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = else if ((op == 1)) localcmd(strcat("cmd invdrop ", ftos(slotnum), "\n")); else if (op == 2) - localcmd(strcat("cmd invmix ", ftos(slotnum), "\n")); - else if ((op == 3) && (getstati(108) == 1)) localcmd(strcat("cmd invsell ", ftos(slotnum), "\n")); showcontextmenu = false; } + else if (showmixmenu && show_inventory) + { + op = floor((mousepos_y - contextpos_y)/8); + + if (op == 0) + localcmd(strcat("cmd invmix ", ftos(slotnum), "\n")); + + + showmixmenu = false; + } else if (showcontextmenu && show_trader) { op = floor((mousepos_y - contextpos_y)/8); @@ -1134,7 +1218,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = return; if (which_perk == getstati(59)) return; - if (which_perk >= 1 && which_perk <= 10) + if (which_perk >= 1 && which_perk <= 11) localcmd(strcat("cmd gainperk ", ftos(which_perk), " ", ftos(perkslot), "\n")); show_inventory = false; show_pipboy = false; @@ -1262,7 +1346,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = perkslot = 2; } } - else if (slotnum >= 1 && slotnum <= 26) + else if (slotnum >= 1 && slotnum <= 22) { //if there's actually an item there if ((show_inventory) && (getstati(32+slotnum-1) != 0)) @@ -1276,10 +1360,20 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = contextpos = mousepos; } } + else if (slotnum >= 23 && slotnum <= 24) + { + //if there's actually an item there + if ((show_inventory) && (getstati(97) != 0) && (getstati(98) != 0)) + { + showmixmenu = true; //show the context menu + contextpos = mousepos; + } + } else { show_inventory = false; //they clicked outside, fools! showcontextmenu = false; + showmixmenu = false; } } else diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index 54d00c999..98bec3e82 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -5,7 +5,7 @@ float viewmodelindex; float scrwidth; float scrheight; - +float scenedraw; void() DrawScreen = @@ -51,11 +51,12 @@ void() Crosshair_Draw = void() Position_Draw = { - float pos, s; + float pos, s, lvl; string sn; pos = getstati(54); s = getstati(58); + lvl = getstati(127); sn = ftos(s); if (pos == 0) @@ -70,6 +71,11 @@ void() Position_Draw = drawpic('0 0 0'+('1 0 0'*(scrwidth*0.20)) +('0 1 0'*(scrheight*0.79)), "gui/hud/sneak.png", '0 0 0'+'72 25 0'*(scrwidth/640), '1 1 1'); //drawstring('0 0 0'+('1 0 0'*(scrwidth*0.20)) +('0 1 0'*(scrheight*0.80)), strcat("%", sn), '8 8 8', '1 1 1', 1); } + + if (lvl >= 200) + { + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.70)) +('0 1 0'*(scrheight*0.80)), "gui/hud/level.png", '0 0 0'+'132 22 0'*(scrwidth/640), '1 1 1'); + } }; void() Chem_Draw = @@ -98,8 +104,8 @@ void() Chem_Draw = void() Time_Draw = { - local float xtime, ytime, ztime; - local string qtime, rtime, shadowtime; + local float xtime, ytime, ztime, obj; + local string qtime, rtime, shadowtime, text; xtime = getstati(104); ytime = floor(xtime/60); @@ -108,7 +114,22 @@ void() Time_Draw = rtime = ftos(ztime); shadowtime = ftos(getstati(104)); - drawstring('0 32 0'+('1 0 0'*(scrwidth*0.10))+('0 1 0'*(scrheight*0.90)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8', '1 1 1', 1); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.25))+('0 1 0'*(scrheight*0.86)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8', '1 1 1', 1); + + + obj = getstati(66); + + if (obj == 1) + text = "rescue citizens\n"; + if (obj == 2) + text = "capture supplies\n"; + if (obj == 3) + text = "assassinate commanders\n"; + if (obj == 4) + text = "rescue citizens\n"; + + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.86)), text, '8 8 8', '1 1 1', 1); + }; @@ -155,23 +176,18 @@ void() Health_Draw = maxhp = getstati(49); bar = 0; - top = ceil(150 * (hp/maxhp)); + top = ceil(115 * (hp/maxhp)); - if (top > 150) - top = 150; - - while (bar <= top) - { - - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.07)) +('0 1 0'*(scrheight*0.75)) - ('0 1 0'*bar*(scrheight/640)), "gui/graph/green.jpg", '0 0 0'+'12 1 0'*(scrwidth/640), '1 1 1', 1); - + if (top > 115) + top = 115; + while (bar < top) bar = bar + 1; - } + + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.07)) +('0 1 0'*(scrheight*0.75)) + ('0 1 0'*(scrheight/640)), "gui/graph/green.jpg", '16 1 0'*(scrheight/640)-'0 1 0'*(scrwidth/640)*bar, '1 1 1', 1); }; - void() Radiation_Draw = { local float bar, rad, top; @@ -179,24 +195,23 @@ void() Radiation_Draw = rad = getstati(106); bar = 0; - top = ceil(150 * (rad/100)); + top = ceil(115 * (rad/100)); - if (top > 150) - top = 150; - - while (bar <= top) - { - - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.02)) +('0 1 0'*(scrheight*0.75)) - ('0 1 0'*bar*(scrheight/640)), "gui/graph/yellow.jpg", '0 0 0'+'12 1 0'*(scrwidth/640), '1 1 1', 1); - + if (top > 115) + top = 115; + while (bar < top) bar = bar + 1; - } + + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.02)) +('0 1 0'*(scrheight*0.75)) + ('0 1 0'*(scrheight/640)), "gui/graph/yellow.jpg", '16 1 0'*(scrheight/640)-'0 1 0'*(scrwidth/640)*bar, '1 1 1', 1); }; + + + void() DoThatViewModelThing = { float newframe, newmodel; @@ -241,9 +256,8 @@ void(vector pos, float x) HUD_Image = local string itname; - if (x <= 16) - it = getstati(31+x); + it = getstati(31+x); itname = GetItemImage(ToIID(it)); drawpic(pos, strcat("gui/", itname), '48 48 0', '1 1 1', 1); @@ -257,23 +271,17 @@ void(vector pos, float x) HUD_Image = }; -void(vector pos, float slotno) HUD_Weapon_Image = +void(vector pos, float x) HUD_Weapon_Image = { local float it, mod_s, mod_e; local string itname; - if (slotno == downslotnum && slotnum) - slotno = slotnum; - else if (slotno == slotnum && downslotnum) - slotno = downslotnum; - - if (slotno <= 16) - it = getstati(31+slotno); + it = getstati(31+x); itname = GetItemImage(ToIID(it)); - drawpic(pos, strcat("gui/weapons/", itname), '180 59 0', '1 1 1', 1); + drawpic(pos, strcat("gui/weapons/", itname), '180 59 0'*(scrwidth/640), '1 1 1', 1); }; @@ -295,7 +303,7 @@ void() Ammo_Draw = top = ceil(35 * (ammo/max)); if (top > 35) - top = 35; + top =35; while (bar <= top) { @@ -307,8 +315,7 @@ void() Ammo_Draw = } } - - if (hand == 2) + else if (hand == 2) { weap = ToIID(getstati(33)); ammo = ToStatus(getstati(33)); @@ -335,6 +342,79 @@ void() Ammo_Draw = }; + +void() HUD_Perks_Draw = +{ + local string perki, perk2i; + local float perktime, perktime2, bar, max, top; + + + perktime = getstati(111); + if (perktime == 0) + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.855)) + ('0 1 0'*(scrheight*0.90)), "gui/graph/green.jpg", '0 0 0'+'4 4 0'*(scrwidth/640), '1 1 1', 1); + + perktime2 = getstati(112); + if (perktime2 == 0) + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.855)) + ('0 1 0'*(scrheight*0.96)), "gui/graph/green.jpg", '0 0 0'+'4 4 0'*(scrwidth/640), '1 1 1', 1); + + + if (getstati(60) > 0) + { + perki = GetPerkImage(getstati(60)); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.865)) +('0 1 0'*(scrheight*0.875)), perki, '28 28 0'*(scrwidth/640), '1 1 1', 1); + } + + if (getstati(59) > 0) + { + perk2i = GetPerkImage(getstati(59)); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.865)) +('0 1 0'*(scrheight*0.935)), perk2i, '28 28 0'*(scrwidth/640), '1 1 1', 1); + } + + perktime = getstati(111); + if (perktime > 0) + { + max = 2000; + + bar = 0; + top = ceil(32 * (perktime/max)); + + if (top > 32) + top = 32; + + while (bar < top) + { + + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.865)) +('0 1 0'*(scrheight*0.88)) + ('0 1 0'*bar*(scrheight/640)), "gui/graph/black.jpg", '0 0 0'+'28 1 0'*(scrwidth/640), '1 1 1', 1); + + + bar = bar + 1; + } + } + + perktime = getstati(112); + if (perktime > 0) + { + max = 2000; + + bar = 0; + top = ceil(32 * (perktime/max)); + + if (top > 32) + top = 32; + + while (bar < top) + { + + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.865)) +('0 1 0'*(scrheight*0.94)) + ('0 1 0'*bar*(scrheight/640)), "gui/graph/black.jpg", '0 0 0'+'28 1 0'*(scrwidth/640), '1 1 1', 1); + + + bar = bar + 1; + } + } + +}; + + void(float vwidth, float vheight, float do2d) CSQC_UpdateView = { float usehud; @@ -343,7 +423,7 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = scrheight = vheight; clearscene(); - +/* if (0)//!cvar("cg_usehud")) { setviewprop(VF_DRAWENGINESBAR, 0); @@ -352,9 +432,9 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = else { setviewprop(VF_DRAWENGINESBAR, 1); - } + }*/ - setviewprop(VF_DRAWCROSSHAIR, 1); + setviewprop(VF_DRAWCROSSHAIR, 1);// //force fullscreen views. setviewprop(VF_MIN, '0 0 0'); @@ -392,6 +472,7 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = GainPerk_Draw(); else { + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.06)) +('0 1 0'*(scrheight*0.45)), "gui/hud/health.png", '0 0 0'+'25 155 0'*(scrwidth/640), '1 1 1'); drawpic('0 0 0'+('1 0 0'*(scrwidth*0.01)) +('0 1 0'*(scrheight*0.45)), "gui/hud/radiation.png", '0 0 0'+'25 155 0'*(scrwidth/640), '1 1 1'); drawpic('0 0 0' + ('0 1 0'*(scrheight*0.84)), "gui/hud/hud.png", '0 0 0'+'80 10 0'*(scrwidth/80), '1 1 1'); @@ -399,13 +480,27 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = Health_Draw(); Radiation_Draw(); - HUD_Weapon_Image('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.87)), getstati(61)); - Ammo_Draw(); + if ((getstati(61) == 1) && (getstati(32) > 0)) + { + HUD_Weapon_Image('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.87)), getstati(61)); + Ammo_Draw(); + } + else if ((getstati(61) == 2) && (getstati(33) > 0)) + { + HUD_Weapon_Image('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.87)), getstati(61)); + Ammo_Draw(); + } - SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.72)) +('0 1 0'*(scrheight*0.87)), getstati(5)); - SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.79)) +('0 1 0'*(scrheight*0.87)), getstati(6)); + if (getstati(36) > 0) + SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.70)) +('0 1 0'*(scrheight*0.90)), 5); + + if (getstati(42) > 0) + SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.77)) +('0 1 0'*(scrheight*0.90)), 11); + + HUD_Perks_Draw(); Position_Draw(); + Chem_Draw(); Time_Draw(); Crosshair_Draw(); diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 01bab48cc..ced88d5a5 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -1172,83 +1172,83 @@ string(float iid) GetItemName = return "disruptor"; if (iid == IID_WP_USP) - return "usp (45 acp)"; + return "usp"; if (iid == IID_WP_USP_S) - return "usp (silenced)"; + return "silenced usp"; if (iid == IID_WP_GLOCK) - return "glock 21 (10mm)"; + return "10mm pistol"; if (iid == IID_WP_GLOCK_S) - return "glock 21 (silenced)"; + return "silenced 10mm pistol"; if (iid == IID_WP_DEAGLE) - return "desert eagle (.44mag)"; + return "desert eagle"; if (iid == IID_WP_DEAGLE_M) - return "desert eagle (silenced)"; + return "modified desert eagle"; if (iid == IID_WP_NEEDLER) - return "needler"; + return "needler pistol"; if (iid == IID_WP_ALIENBLASTER) - return "alien blaster (energy)"; + return "alien blaster"; if (iid == IID_WP_PIPERIFLE) - return "pipe rifle (.44mag)"; + return "pipe rifle"; if (iid == IID_WP_PIPERIFLE_S) - return "pipe rifle (silenced)"; + return "silenced pipe rifle"; if (iid == IID_WP_PIPERIFLE_R) - return "pipe rifle (rod&spring)"; + return "modified pipe rifle"; if (iid == IID_WP_PIPERIFLE_SCOPE) - return "pipe rifle (scope)"; + return "scoped pipe rifle"; if (iid == IID_WP_PIPERIFLE_S_R) - return "pipe rifle (silenced, rod&spring)"; + return "super piperifle mark i"; if (iid == IID_WP_PIPERIFLE_SCOPE_R) - return "pipe rifle (scope, rod&spring)"; + return "super piperifle mark ii"; if (iid == IID_WP_PIPERIFLE_SCOPE_S) - return "pipe rifle (scope, silenced)"; + return "super piperifle mark iii"; if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) - return "pipe rifle (scope, silenced, rod&spring)"; + return "super piperifle mark iv"; if (iid == IID_WP_WINCHESTER) - return "winchester (12g)"; + return "sawed-off shotgun"; if (iid == IID_WP_MOSSBERG) - return "citykiller (12g)"; + return "citykiller"; if (iid == IID_WP_JACKHAMMER) - return "jackhammer (12g)"; + return "jackhammer"; if (iid == IID_WP_GREASEGUN) - return "grease gun (.45 acp)"; + return "grease gun"; if (iid == IID_WP_MP9) - return "mp9 (10mm)"; + return "mp9"; if (iid == IID_WP_RANGEMASTER) - return "rangemaster (5.56mm)"; + return "rangemaster"; if (iid == IID_WP_RANGEMASTER_SCOPE) - return "rangemaster (x2 SUSAT scope)"; + return "scoped rangemaster"; if (iid == IID_WP_AK47) - return "ak-47 (7.62mm warsaw pact)"; + return "ak-47"; if (iid == IID_WP_AK112) - return "ak-112 (5mm jhp)"; + return "ak-112"; if (iid == IID_WP_AK112_M) - return "light support weapon (5.56mm)"; + return "light support weapon"; if (iid == IID_WP_AK74) - return "ak-47 (7.62mm warsaw pact)"; + return "ak-47"; if (iid == IID_WP_ACR) - return "bozar (7.62mm)"; + return "bozar"; if (iid == IID_WP_DKS1) - return "knight sr-25 widowmaker (7.62mm)"; + return "dks-1"; if (iid == IID_WP_DKS1_S) - return "knight sr-25 widowmaker (silenced)"; + return "dks-1"; if (iid == IID_WP_MOONLIGHT) - return "moonlight (5.56mm)"; + return "moonlight"; if (iid == IID_WP_G11) - return "hk g11 (4mm)"; + return "hk g11"; if (iid == IID_WP_GAUSERIFLE) - return "gauss rifle (2mm EC)"; + return "gauss rifle"; if (iid == IID_WP_PULSERIFLE) - return "phased plasma rifle (energy)"; + return "plasma rifle"; if (iid == IID_WP_TURBOPLASMA) - return "turbo plasma rifle (energy)"; + return "turbo plasma rifle"; if (iid == IID_WP_PLASMACARBINE) - return "plasma carbine (energy)"; + return "laser pistol"; if (iid == IID_WP_FNFAL) - return "fn fal (7.62mm)"; + return "fn fal"; if (iid == IID_WP_ROCKETLAUNCHER) return "rocket launcher"; if (iid == IID_WP_LASERGATLING) - return "laser minigun (energy)"; + return "laser minigun"; if (iid == IID_AM_NEEDLER) return "needler cartidge"; @@ -1279,15 +1279,15 @@ string(float iid) GetItemName = if (iid == IID_GREN_STUN) - return "stun grenade"; + return "stun bomb"; if (iid == IID_GREN_FRAG) - return "nuka grenade"; + return "nuka bomb"; if (iid == IID_GREN_EMP) - return "emp grenade"; + return "emp bomb"; if (iid == IID_GREN_SMOKE) - return "smoke grenade"; + return "smoke bomb"; if (iid == IID_GREN_FLASH) - return "flash grenade"; + return "flash bomb"; if (iid == IID_ARM_DESERT) @@ -1435,19 +1435,19 @@ float(float iid) GetBaseValue = if (iid == IID_WP_PIPERIFLE) return 15; if (iid == IID_WP_PIPERIFLE_S) - return 25; + return 250; if (iid == IID_WP_PIPERIFLE_R) - return 25; + return 250; if (iid == IID_WP_PIPERIFLE_SCOPE) - return 25; + return 250; if (iid == IID_WP_PIPERIFLE_S_R) - return 35; + return 350; if (iid == IID_WP_PIPERIFLE_SCOPE_R) - return 35; + return 350; if (iid == IID_WP_PIPERIFLE_SCOPE_S) - return 35; + return 350; if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) - return 50; + return 500; if (iid == IID_WP_WINCHESTER) return 50; if (iid == IID_WP_MOSSBERG) @@ -1502,31 +1502,31 @@ float(float iid) GetBaseValue = if (iid == IID_AM_NEEDLER) - return 7; + return 35; if (iid == IID_AM_2MMEC) - return 15; + return 120; if (iid == IID_AM_10MM) - return 3; - if (iid == IID_AM_556MM) - return 5; - if (iid == IID_AM_5MMHIGHVEL) - return 4; - if (iid == IID_AM_12GAUGESHELLS) - return 4; - if (iid == IID_AM_ENERGYCELL) return 12; + if (iid == IID_AM_556MM) + return 20; + if (iid == IID_AM_5MMHIGHVEL) + return 16; + if (iid == IID_AM_12GAUGESHELLS) + return 16; + if (iid == IID_AM_ENERGYCELL) + return 48; if (iid == IID_AM_762MM) - return 8; + return 32; if (iid == IID_AM_44MAGNUM) - return 6; + return 24; if (iid == IID_AM_WARSAW) - return 5; + return 20; if (iid == IID_AM_45ACP) - return 4; + return 16; if (iid == IID_AM_ROCKET) return 30; if (iid == IID_AM_CASELESS) - return 10; + return 40; if (iid == IID_GREN_STUN) @@ -1550,15 +1550,15 @@ float(float iid) GetBaseValue = if (iid == IID_ARM_METAL) return 100; if (iid == IID_ARM_TESLA) - return 175; + return 125; if (iid == IID_ARM_COMBAT) - return 300; + return 250; if (iid == IID_ARM_SEVA) - return 350; + return 275; if (iid == IID_ARM_FORCE) - return 500; + return 300; if (iid == IID_ARM_LPOWER) - return 550; + return 450; if (iid == IID_CHEM_STIMPACK) @@ -1675,15 +1675,15 @@ string(float iid) GetItemDesc = if (iid == IID_WP_PIPERIFLE_SCOPE) return "a crude scope has been attached to this pipe rifle"; if (iid == IID_WP_PIPERIFLE_R) - return "a modified pipe rifle with a rod&spring replacement"; + return "a modified pipe rifle with a box magazine"; if (iid == IID_WP_PIPERIFLE_S_R) - return "pipe rifle with a silencer and rod&spring replacement"; + return "pipe rifle with a silencer and box magazine"; if (iid == IID_WP_PIPERIFLE_SCOPE_R) - return "pipe rifle with a scope and rod&spring replacement"; + return "pipe rifle with a scope and box magazine"; if (iid == IID_WP_PIPERIFLE_SCOPE_S) return "pipe rifle with a scope and silencer"; if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) - return "pipe rifle with a scope, silencer, and rod&spring"; + return "the ultimate makeshift rifle!"; if (iid == IID_WP_WINCHESTER) return "double-barrelled and sawed off"; if (iid == IID_WP_MOSSBERG) @@ -1715,7 +1715,7 @@ string(float iid) GetItemDesc = if (iid == IID_WP_DKS1) return "semi-auto sniper rifle"; if (iid == IID_WP_MOONLIGHT) - return "decent rifle with extra utility"; + return "great all-around rifle with extra utility"; if (iid == IID_WP_G11) return "a prototype rifle that uses caseless ammo"; if (iid == IID_WP_GAUSERIFLE) @@ -1733,7 +1733,7 @@ string(float iid) GetItemDesc = if (iid == IID_WP_LASERGATLING) return "quite simply, the ultimate in heavy firepower"; if (iid == IID_WP_ACR) - return "fast, powerful, and accurate - a sniper's dream"; + return "refinement of the sniper's art"; if (iid == IID_AM_NEEDLER) @@ -1881,249 +1881,234 @@ string(float iid) GetItemDesc = return strcat("", ftos(iid)); }; - -string(float iid) GetItemStats = +float(float iid) GetArmorThreshold = { - if (iid == IID_NONE) - return ""; - - - if (iid == IID_WP_WRENCH) - return "a heavy multi-function wrench"; - if (iid == IID_WP_KNIFE) - return "great for stealth attacks"; - if (iid == IID_WP_SLEDGE) - return "a futuristic battle axe"; - if (iid == IID_WP_SPEAR) - return "a long, sharp polearm"; - if (iid == IID_WP_POWERAXE) - return "a futuristic axe of some sort"; - - if (iid == IID_WP_USP) - return "dmg: 14 rng: 20 ammo: .45 skill: combat"; - if (iid == IID_WP_USP_S) - return "dmg: 12 rng: 18 ammo: .45 skill: combat"; - if (iid == IID_WP_GLOCK) - return "dmg: 12 rng: 18 ammo: 10mm skill: combat"; - if (iid == IID_WP_GLOCK_S) - return "dmg: 10 rng: 16 ammo: 10mm skill: combat"; - if (iid == IID_WP_DEAGLE) - return "dmg: 18 rng: 30 ammo: .44 skill: combat"; - if (iid == IID_WP_DEAGLE_M) - return "dmg: 18 rng: 30 ammo: .44 skill: combat"; - if (iid == IID_WP_NEEDLER) - return "dmg: 16 rng: 20 ammo: nc skill: science"; - if (iid == IID_WP_ALIENBLASTER) - return "dmg: 48 rng: 15 ammo: cell skill: science"; - if (iid == IID_WP_PIPERIFLE) - return "dmg: 20 rng: 50 ammo: .44 skill: combat"; - if (iid == IID_WP_PIPERIFLE_S) - return "dmg: 18 rng: 45 ammo: .44 skill: combat"; - if (iid == IID_WP_PIPERIFLE_SCOPE) - return "dmg: 20 rng: 60 ammo: .44 skill: combat"; - if (iid == IID_WP_PIPERIFLE_R) - return "dmg: 20 rng: 50 ammo: .44 skill: combat"; - if (iid == IID_WP_PIPERIFLE_S_R) - return "dmg: 18 rng: 45 ammo: .44 skill: combat"; - if (iid == IID_WP_PIPERIFLE_SCOPE_R) - return "dmg: 20 rng: 60 ammo: .44 skill: combat"; - if (iid == IID_WP_PIPERIFLE_SCOPE_S) - return "dmg: 18 rng: 50 ammo: .44 skill: combat"; - if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) - return "dmg: 18 rng: 50 ammo: .44 skill: combat"; - if (iid == IID_WP_WINCHESTER) - return "dmg: 40 rng: 10 ammo: 12ga skill: combat"; - if (iid == IID_WP_MOSSBERG) - return "dmg: 35 rng: 20 ammo: 12ga skill: combat"; - if (iid == IID_WP_JACKHAMMER) - return "dmg: 35 rng: 15 ammo: 12ga skill: combat"; - if (iid == IID_WP_GREASEGUN) - return "dmg: 14 rng: 15 ammo: .45 skill: combat"; - if (iid == IID_WP_GREASEGUN_S) - return "dmg: 12 rng: 10 ammo: .45 skill: combat"; - if (iid == IID_WP_MP9) - return "dmg: 12 rng: 15 ammo: 10mm skill: sneak"; - if (iid == IID_WP_MP9_S) - return "dmg: 10 rng: 15 ammo: 10mm skill: sneak"; - if (iid == IID_WP_RANGEMASTER) - return "dmg: 18 rng: 40 ammo: 5.56 skill: combat"; - if (iid == IID_WP_RANGEMASTER_SCOPE) - return "dmg: 18 rng: 50 ammo: 5.56 skill: combat"; - if (iid == IID_WP_AK47) - return "an outdated assault rifle with extreme durability"; - if (iid == IID_WP_AK112) - return "dmg: 16 rng: 40 ammo: 5mm skill: combat"; - if (iid == IID_WP_AK112_M) - return "dmg: 16 rng: 40 ammo: 5mm skill: combat"; - if (iid == IID_WP_DKS1) - return "dmg: 40 rng: 80 ammo: 7.62 skill: combat"; - if (iid == IID_WP_DKS1_S) - return "dmg: 35 rng: 70 ammo: 7.62 skill: combat"; - if (iid == IID_WP_MOONLIGHT) - return "dmg: 16 rng: 40 ammo: 5.56 skill: combat"; - if (iid == IID_WP_G11) - return "dmg: 14 rng: 40 ammo: csels skill: combat"; - if (iid == IID_WP_GAUSERIFLE) - return "dmg: 30 rng: 90 ammo: 2mmec skill: combat"; - if (iid == IID_WP_PULSERIFLE) - return "dmg: 16 rng: 40 ammo: 5mm skill: combat"; - if (iid == IID_WP_TURBOPLASMA) - return "dmg: 32 rng: 45 ammo: cell skill: science"; - if (iid == IID_WP_PLASMACARBINE) - return "dmg: 28 rng: 30 ammo: cell skill: science"; - if (iid == IID_WP_FNFAL) - return "dmg: 32 rng: 60 ammo: 7.62 skill: combat"; - if (iid == IID_WP_ROCKETLAUNCHER) - return "dmg: 100 rng: 30 ammo: rkt skill: combat"; - if (iid == IID_WP_LASERGATLING) - return "dmg: 24 rng: 60 ammo: cell skill: combat"; - if (iid == IID_WP_ACR) - return "dmg: 50 rng: 90 ammo: 7.62 skill: combat"; - - - if (iid == IID_AM_NEEDLER) - return "good armor-peircing properties"; - if (iid == IID_AM_2MMEC) - return "virtually ignores armor"; - if (iid == IID_AM_10MM) - return "jacketed hollow-points for good damage"; - if (iid == IID_AM_556MM) - return "standard rifle round, moderate recoil"; - if (iid == IID_AM_5MMHIGHVEL) - return "experimental high-velocity rifle ammo"; - if (iid == IID_AM_12GAUGESHELLS) - return "the old standard, has trouble with heavy armor"; - if (iid == IID_AM_ENERGYCELL) - return "this energy cell comes from an unknown origin"; - if (iid == IID_AM_762MM) - return "good stopping power and armor-piercing performance"; - if (iid == IID_AM_44MAGNUM) - return "full metal jacket, hit 'em hard"; - if (iid == IID_AM_WARSAW) - return "ancient soviet rifle round, used in the ak47"; - if (iid == IID_AM_45ACP) - return "a common pistol round with good stopping power"; - if (iid == IID_AM_ROCKET) - return "expensive and extremely lethal"; - if (iid == IID_AM_CASELESS) - return "a brick of small-caliber caseless ammo"; - - - if (iid == IID_GREN_FRAG) - return "all-purpose fragmentation grenade"; - if (iid == IID_GREN_EMP) - return "useful against robots and cyborgs"; - if (iid == IID_GREN_SMOKE) - return "very useful for a quick getaway!"; - if (iid == IID_GREN_FLASH) - return "temporarily blinds nearby enemies"; - if (iid == IID_GREN_STUN) - return "delivers a forceful shock to nearby enemies"; if (iid == IID_ARM_DESERT) - return "the light armor of a raider; makes a great disguise"; + return 2; if (iid == IID_ARM_LEATHER) - return "lightweight leather armor. provides great mobility."; + return 3; if (iid == IID_ARM_VANDAL) - return "enhanced leather armor for extra protection."; + return 4; if (iid == IID_ARM_METAL) - return "gives great protection at a sacrifice to speed."; + return 1; if (iid == IID_ARM_TESLA) - return "experimental armor with high deflection but low absorb."; + return 5; if (iid == IID_ARM_COMBAT) - return "this all-purpose armor is designed for combat missions."; + return 7; if (iid == IID_ARM_SEVA) - return "high-tech suit provides more environmental defense"; + return 6; if (iid == IID_ARM_FORCE) - return "experimental energy-field armor, very low absorb"; + return 10; if (iid == IID_ARM_LPOWER) - return "the heaviest armor with great protection"; + return 8; +}; - if (iid == IID_CHEM_STIMPACK) - return "advanced healing chem that replaces lost blood"; - if (iid == IID_CHEM_MEDICALBAG) - return "first aid kit with many high-tech supplies"; - if (iid == IID_CHEM_SUPERSTIM) - return "contains nanobots that heal very fast"; - if (iid == IID_CHEM_ADRENALINE) - return "boosts the metabolism, increasing jump and run speed"; - if (iid == IID_CHEM_PSYCHO) - return "unknown chemicals, probably of military origin"; - if (iid == IID_CHEM_BESERK) - return "unknown chemicals, probably of military origin"; - if (iid == IID_CHEM_RADX) - return "powerful anti-radiation pills"; +float(float iid) GetArmorAbsorb = +{ + + if (iid == IID_ARM_DESERT) + return 10; + if (iid == IID_ARM_LEATHER) + return 20; + if (iid == IID_ARM_VANDAL) + return 30; + if (iid == IID_ARM_METAL) + return 50; + if (iid == IID_ARM_TESLA) + return 40; + if (iid == IID_ARM_COMBAT) + return 40; + if (iid == IID_ARM_SEVA) + return 40; + if (iid == IID_ARM_FORCE) + return 10; + if (iid == IID_ARM_LPOWER) + return 50; +}; - if (iid == IID_BUILD_MRAMMO) - return "provides extra ammunition"; - if (iid == IID_BUILD_SHIELDGEN) - return "protects all nearby allies"; - if (iid == IID_BUILD_AUTODOC) - return "the auto-doc will repair injuries"; - if (iid == IID_BUILD_ROBOFANG) - return "robofang guardian unit"; - if (iid == IID_BUILD_TTURRET) - return "dispatches hostile intruders"; - if (iid == IID_BUILD_RTURRET) - return "rocket turret"; - if (iid == IID_BUILD_GTURRET) - return "machine-gun turret"; +float(float iid) GetWeaponRange = +{ + if (iid == IID_NONE) + return 0; - if (iid == IID_EQUIP_MEDIC_BAG) - return "allows more chems to be carried"; - if (iid == IID_EQUIP_GOGGLES) - return "protects against visual impairments"; - if (iid == IID_EQUIP_SILENCER) - return "attaches to any smallarm"; - if (iid == IID_EQUIP_BELTPOUCH) - return "useful for carrying extra grenades"; - if (iid == IID_EQUIP_TOOLKIT) - return "for picking all sorts of locks"; - if (iid == IID_EQUIP_BACKPACK) - return "this handy bag lets you carry more ammunition"; - if (iid == IID_EQUIP_CLIMBINGGEAR) - return "for those hard to reach places"; - if (iid == IID_EQUIP_BATTERY) - return "provides prolonged battery life"; - if (iid == IID_EQUIP_STEALTHBOY) - return "makes user blurry and hard to see"; - if (iid == IID_EQUIP_EXTENDER) - return "gives a weapon slightly longer range and damage"; - if (iid == IID_EQUIP_XRAY) - return "allows for enemy detection through walls"; + if (iid == IID_WP_KNIFE) + return 5; - if (iid == IID_MISC_NUKACOLA) - return "a bottle of tasty nuka-cola"; - if (iid == IID_MISC_JUNK) - return "metallic bits, pipe and other debris"; - if (iid == IID_MISC_CHEMICALS) - return "standard household cleaner"; - if (iid == IID_MISC_AEROSOL) - return "a half-full aerosol can"; - if (iid == IID_MISC_RDXCRYSTAL) - return "a batch of highly unstable explosive crystals"; - if (iid == IID_MISC_STEELPIPE) - return "a slightly rusted steel pipe"; - if (iid == IID_MISC_DUCKTAPE) - return "ancient, but still highly functional"; - if (iid == IID_MISC_LCD) - return "an lcd from a Lameboy DS videogame unit"; - if (iid == IID_MISC_CIRCUITBOARD) - return "a corroded circuit board from a remote control"; - if (iid == IID_MISC_COPPERWIRE) - return "a small spool of thin copper wire"; - if (iid == IID_MISC_HMXCOMPOUND) - return "a small amount of high-grade military explosive"; - if (iid == IID_MISC_GUM) - return "trident chewing gum, limited edition watermelon flavor"; - if (iid == IID_MISC_XRAYTUBE) - return "??? a strange device ???"; - bprint(PRINT_MEDIUM, ftos(iid), " without a desc!\n"); - return strcat("", ftos(iid)); + if (iid == IID_WP_USP) + return 20; + if (iid == IID_WP_USP_S) + return 15; + if (iid == IID_WP_GLOCK) + return 15; + if (iid == IID_WP_GLOCK_S) + return 10; + if (iid == IID_WP_DEAGLE) + return 25; + if (iid == IID_WP_DEAGLE_M) + return 25; + if (iid == IID_WP_NEEDLER) + return 20; + if (iid == IID_WP_ALIENBLASTER) + return 10; + if (iid == IID_WP_PIPERIFLE) + return 40; + if (iid == IID_WP_PIPERIFLE_S) + return 40; + if (iid == IID_WP_PIPERIFLE_SCOPE) + return 40; + if (iid == IID_WP_PIPERIFLE_R) + return 40; + if (iid == IID_WP_PIPERIFLE_S_R) + return 40; + if (iid == IID_WP_PIPERIFLE_SCOPE_R) + return 40; + if (iid == IID_WP_PIPERIFLE_SCOPE_S) + return 40; + if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) + return 40; + if (iid == IID_WP_WINCHESTER) + return 10; + if (iid == IID_WP_MOSSBERG) + return 10; + if (iid == IID_WP_JACKHAMMER) + return 10; + if (iid == IID_WP_GREASEGUN) + return 20; + if (iid == IID_WP_GREASEGUN_S) + return 20; + if (iid == IID_WP_MP9) + return 15; + if (iid == IID_WP_MP9_S) + return 15; + if (iid == IID_WP_RANGEMASTER) + return 40; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return 50; + if (iid == IID_WP_AK112) + return 40; + if (iid == IID_WP_AK112_M) + return 40; + if (iid == IID_WP_DKS1) + return 60; + if (iid == IID_WP_DKS1_S) + return 60; + if (iid == IID_WP_MOONLIGHT) + return 50; + if (iid == IID_WP_G11) + return 60; + if (iid == IID_WP_GAUSERIFLE) + return 70; + if (iid == IID_WP_PULSERIFLE) + return 50; + if (iid == IID_WP_TURBOPLASMA) + return 40; + if (iid == IID_WP_PLASMACARBINE) + return 40; + if (iid == IID_WP_FNFAL) + return 60; + if (iid == IID_WP_ROCKETLAUNCHER) + return 15; + if (iid == IID_WP_LASERGATLING) + return 35; + if (iid == IID_WP_ACR) + return 90; + + return 0; +}; + +float(float iid) GetWeaponDamage = +{ + if (iid == IID_NONE) + return 0; + + + if (iid == IID_WP_KNIFE) + return 10; + if (iid == IID_WP_USP) + return 14; + if (iid == IID_WP_USP_S) + return 12; + if (iid == IID_WP_GLOCK) + return 12; + if (iid == IID_WP_GLOCK_S) + return 10; + if (iid == IID_WP_DEAGLE) + return 18; + if (iid == IID_WP_DEAGLE_M) + return 18; + if (iid == IID_WP_NEEDLER) + return 16; + if (iid == IID_WP_ALIENBLASTER) + return 20; + if (iid == IID_WP_PIPERIFLE) + return 20; + if (iid == IID_WP_PIPERIFLE_S) + return 20; + if (iid == IID_WP_PIPERIFLE_SCOPE) + return 20; + if (iid == IID_WP_PIPERIFLE_R) + return 20; + if (iid == IID_WP_PIPERIFLE_S_R) + return 20; + if (iid == IID_WP_PIPERIFLE_SCOPE_R) + return 20; + if (iid == IID_WP_PIPERIFLE_SCOPE_S) + return 20; + if (iid == IID_WP_PIPERIFLE_SCOPE_S_R) + return 20; + if (iid == IID_WP_WINCHESTER) + return 35; + if (iid == IID_WP_MOSSBERG) + return 35; + if (iid == IID_WP_JACKHAMMER) + return 35; + if (iid == IID_WP_GREASEGUN) + return 14; + if (iid == IID_WP_GREASEGUN_S) + return 12; + if (iid == IID_WP_MP9) + return 12; + if (iid == IID_WP_MP9_S) + return 10; + if (iid == IID_WP_RANGEMASTER) + return 18; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return 18; + if (iid == IID_WP_AK112) + return 16; + if (iid == IID_WP_AK112_M) + return 16; + if (iid == IID_WP_DKS1) + return 30; + if (iid == IID_WP_DKS1_S) + return 30; + if (iid == IID_WP_MOONLIGHT) + return 16; + if (iid == IID_WP_G11) + return 14; + if (iid == IID_WP_GAUSERIFLE) + return 22; + if (iid == IID_WP_PULSERIFLE) + return 26; + if (iid == IID_WP_TURBOPLASMA) + return 24; + if (iid == IID_WP_PLASMACARBINE) + return 20; + if (iid == IID_WP_FNFAL) + return 20; + if (iid == IID_WP_ROCKETLAUNCHER) + return 75; + if (iid == IID_WP_LASERGATLING) + return 24; + if (iid == IID_WP_ACR) + return 40; + + return 0; }; string(float iid) GetItemImage = @@ -2148,9 +2133,9 @@ string(float iid) GetItemImage = if (iid == IID_WP_USP_S) return "usp.jpg"; if (iid == IID_WP_GLOCK) - return "glock.jpg"; + return "10mmpistol.jpg"; if (iid == IID_WP_GLOCK_S) - return "glock.jpg"; + return "10mmpistol.jpg"; if (iid == IID_WP_DEAGLE) return "deagle.jpg"; if (iid == IID_WP_DEAGLE_M) @@ -2190,11 +2175,11 @@ string(float iid) GetItemImage = if (iid == IID_WP_DKS1_S) return "dks1_s.jpg"; if (iid == IID_WP_MOONLIGHT) - return "moonlight.jpg"; + return "XL70E3.jpg"; if (iid == IID_WP_G11) return "g11.jpg"; if (iid == IID_WP_GAUSERIFLE) - return "grifle.jpg"; + return "gauss.jpg"; if (iid == IID_WP_PULSERIFLE) return "plasma.jpg"; if (iid == IID_WP_TURBOPLASMA) @@ -2591,6 +2576,8 @@ string (float slot, float int) PerkName = return "Sleep Tight"; if (int == 10) return "Economic Moves"; + if (int == 11) + return "Nuclear Man"; }; string (float slot, float int) PerkNameCentered = @@ -2615,6 +2602,8 @@ string (float slot, float int) PerkNameCentered = return " Sleep Tight"; if (int == 10) return " Economic Moves"; + if (int == 11) + return " Nuclear Man"; }; @@ -2640,6 +2629,8 @@ string(float int) GetPerkImage = return "gui/perks/Sleep Tight.jpg"; else if (int == 10) return "gui/perks/Economic Moves.jpg"; + else if (int == 11) + return "gui/perks/Nuclear Man.jpg"; else return "gui/perks/none.jpg"; @@ -2651,9 +2642,9 @@ string(float int) GetPerkDesc = if (int == 1) return "33% recoil reduction while prone"; else if (int == 2) - return "20% damage resist while taking cover and ducking"; + return "Huge dodge chance while taking cover and ducking"; else if (int == 3) - return "enemies tend to ignore you over your friends"; + return "Makes enemies attack your friends instead of you"; else if (int == 4) return "50% damage resist to area attacks while prone"; else if (int == 5) @@ -2668,6 +2659,8 @@ string(float int) GetPerkDesc = return "Paralyze anything with a sneak attack from a knife"; else if (int == 10) return "Suffer less time-related penalties for all actions"; + else if (int == 11) + return "Eat a small amount of radiation to heal yourself"; else return ""; diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 534b9fbe5..7f022c3d9 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -370,7 +370,7 @@ void() rad_think = local entity te; self.think = rad_think; - self.nextthink = time + 1; + self.nextthink = time + 4; te = findradius (self.origin, 700); while (te) diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index ac6628c1d..7232baa18 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -281,7 +281,7 @@ void () hostage_die = } hos_deatha1 (); - + self.solid = SOLID_NOT; setsize (self, VEC_ORIGIN, VEC_ORIGIN); }; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 8a5729d8d..737c2aa0c 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -112,24 +112,9 @@ local float rnd1, rnd2, rnd3; if (self.cnt == 20) remove(self); - rnd1 = self.velocity_x + (-30 + (random() * 20)); - rnd2 = self.velocity_y + (-30 + (random() * 20)); - rnd3 = self.velocity_z + 30 + random() * 10; - - if (random()*100 > 50) - rnd1 = 24; - else - rnd1 = -24; - - if (random()*100 > 50) - rnd2 = 24; - else - rnd2 = -24; - - if (random()*100 > 50) - rnd3 = -5; - else - rnd3 = 10; + rnd1 = self.velocity_x + (-10 + (random() * 20)); + rnd2 = self.velocity_y + (-10 + (random() * 20)); + rnd3 = self.velocity_z + 1 + random() * 3; self.velocity_x = rnd1; self.velocity_y = rnd2; @@ -204,6 +189,17 @@ void(float slotno) UsePerk = te = te.chain; } } + if ((self.perk1 == 11 && slotno == 1) || (self.perk2 == 11 && slotno == 2)) + { + if (slotno == 1) + self.perk1timer = 2000; + if (slotno == 2) + self.perk2timer = 2000; + + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + + + } }; @@ -2112,7 +2108,7 @@ void() ImpulseCommands = if (self.impulse == 3 && self.currentmenu == "none") Cmd_InvUse("5"); if (self.impulse == 4 && self.currentmenu == "none") - Cmd_InvUse("6"); + Cmd_InvUse("11"); if (self.impulse >= 1 && self.impulse <= 10 && self.currentmenu != "none") @@ -4342,7 +4338,7 @@ void () UseStimpack = else { sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); - self.score = self.score + 50; + self.score = self.score + 1; sprint(trace_ent, PRINT_MEDIUM, self.netname); sprint(trace_ent, PRINT_MEDIUM, " heals you with a stimpack\n"); sprint(self, PRINT_MEDIUM, "you heal "); @@ -4453,7 +4449,7 @@ void () UseSuperStim = { sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); - self.score = self.score + 50; + self.score = self.score + 1; sprint(trace_ent, PRINT_MEDIUM, self.netname); sprint(trace_ent, PRINT_MEDIUM, " heals you with a superstim!\n"); sprint(self, PRINT_MEDIUM, "you heal "); @@ -4512,6 +4508,7 @@ void () UseMedicalBag = sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); self.health = self.health + 5 + (self.skill_doctor/2); self.regen = self.regen + 3 + (self.skill_doctor/2); + spawn_healing(self); } } else if (trace_ent.classname == "player")//healing another team-mate @@ -4563,6 +4560,7 @@ void () UseMedicalBag = self.score = self.score + 1; trace_ent.health = trace_ent.health + 5 + (self.skill_doctor/2); trace_ent.regen = trace_ent.regen + 3 + (self.skill_doctor/2); + spawn_healing(trace_ent); } } } diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 92aa3ddc2..f81c0aab6 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -107,6 +107,8 @@ void() SetupStats = clientstat(108, 2, safezone); clientstat(109, 2, connected); clientstat(110, 2, steadyaim); + clientstat(111, 2, perk1timer); + clientstat(112, 2, perk2timer); clientstat(125, 2, timer); clientstat(126, 2, popup); clientstat(127, 2, score); @@ -650,9 +652,9 @@ if (coop == 1) // Players vs Monsters } } - else if (musicplay < 50) + else if (musicplay < 20) musicplay = musicplay + 1; - else if (musicplay >= 100) + else if (musicplay >= 20) musicplay = 0; te = find(world, classname, "player"); diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index 503d6468b..26581df21 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -116,10 +116,7 @@ void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(3);}; void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(3);}; void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(3);}; void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(3);}; -void() zombie_walk19 =[ $walk19, zombie_walk1 ] { -ai_walk(6); -if (random() < 0.2) - sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);}; +void() zombie_walk19 =[ $walk19, zombie_walk1 ] {ai_walk(6);}; void() zombie_run1 =[ $run1, zombie_run2 ] {ai_run(4);self.inpain = 0;}; void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(4); @@ -146,13 +143,7 @@ void() zombie_run14 =[ $run14, zombie_run15 ] {ai_run(4);}; void() zombie_run15 =[ $run15, zombie_run16 ] {ai_run(4);}; void() zombie_run16 =[ $run16, zombie_run17 ] {ai_run(4);}; void() zombie_run17 =[ $run17, zombie_run18 ] {ai_run(4);}; -void() zombie_run18 =[ $run18, zombie_run1 ] { -ai_run(8); -if (random() < 0.2) - sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE); -if (random() > 0.8) - sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE); -}; +void() zombie_run18 =[ $run18, zombie_run1 ] {ai_run(8);}; /* ============================================================================= @@ -314,7 +305,7 @@ void() zombie_attc12 =[ $attc12, zombie_run1 ] {ai_face();ZombieFireGrenade('-1 void() zombie_claw = { -local vector delta; +local vector delta, dir; local float ldmg; if (!self.enemy) @@ -329,11 +320,22 @@ local float ldmg; delta = self.enemy.origin - self.origin; - if (vlen(delta) > (80)) + if (self.scale == 1.5 && vlen(delta) > (90)) return; - + else if (vlen(delta) > (60)) + return; + ldmg = 5+random()*15; + if (self.scale == 1.5) + { + ldmg = 10+random()*15; + dir = normalize(self.enemy.origin - self.origin); + self.enemy.radiation = self.enemy.radiation + 50; + self.enemy.velocity = dir * 300; + self.enemy.velocity_z = 300; + self.enemy.avelocity_y = (random()* 300); + } T_Damage (self.enemy, self, self, ldmg); }; @@ -589,7 +591,7 @@ void () zombie_death = self.attack = self.attack + 1; }; -void (vector stuff, vector ang) spawn_live_zombie = +void (vector stuff, vector ang, float bodysize) spawn_live_zombie = { local entity zombie; @@ -611,6 +613,7 @@ void (vector stuff, vector ang) spawn_live_zombie = zombie.think = zombie_death; zombie.th_die = corpse_gib; zombie.nextthink = time + 0.12; + zombie.scale = bodysize; }; void() DropBackpack; @@ -619,10 +622,6 @@ void() zombie_die = { local float r; - if (random()<0.25) - DropMoney(); - if (random()<0.25) - DropMoney(); r = random(); @@ -632,8 +631,14 @@ void() zombie_die = sound (self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM); - spawn_live_zombie(self.origin, self.angles); - remove(self); + if (self.scale == 1) + { + spawn_live_zombie(self.origin, self.angles, self.scale); + remove(self); + } + else + zdie1(); + return; }; @@ -661,7 +666,7 @@ void(entity attacker, float take) zombie_pain = { local float r; - if (take < 9) + if (take < 50) return; // totally ignore if (self.inpain == 2) @@ -739,7 +744,20 @@ void () spawn_ghoul_copy = self.think = spawn_ghoul_copy; - self.nextthink = time + 8 + random()*4; + self.nextthink = time + 9 + random()*8; + + + + if (total_players == 2) + self.nextthink = time + 9 + random()*5; + + if (total_players == 3) + self.nextthink = time + 8 + random()*4; + + if (total_players == 4) + self.nextthink = time + 6 + random()*2; + + stuff = self.origin; @@ -748,7 +766,7 @@ void () spawn_ghoul_copy = loadzombie = 0; - te = findradius (self.origin, 1200); + te = findradius (self.origin, 1500); while (te) { if (te.classname == "player") @@ -758,7 +776,7 @@ void () spawn_ghoul_copy = } - te = findradius (self.origin, 400); + te = findradius (self.origin, 250); while (te) { if (te.classname == "player") @@ -797,7 +815,7 @@ void () spawn_ghoul_copy = ze = find(ze, classname, "player"); } - if (zomc > 90*pcount) + if (zomc > 30*pcount) return; zombie = spawn (); @@ -808,7 +826,7 @@ void () spawn_ghoul_copy = setmodel (self, "progs/ghoul.mdl"); setsize (self, '-8 -8 -24', '8 8 24'); self.health = 90; - self.netname = "ghoul"; + self.netname = "feral ghoul"; self.max_health = self.health; self.th_stand = zombie_stand1; self.th_walk = zombie_walk1; @@ -817,15 +835,19 @@ void () spawn_ghoul_copy = self.th_die = zombie_die; self.th_melee = zombie_melee; + self.skin = 0; + self.angles_y = random()*360; - if (random()*100 <= 3) + if (random()*100 <= 8) { - setsize (self, '-16 -16 -24', '16 16 32'); - self.health = 400; - self.netname = "ghoul lord"; + setsize (self, '-16 -16 -40 ', '16 16 32'); + self.health = 1200; + self.netname = "glowing one"; self.max_health = self.health; - self.scale = 2; + self.scale = 1.5; + self.effects = EF_BLUE; + self.skin = 1; } self.origin = stuff + '0 64 0'; From 2432c14a45b76835fa60ad883bc8b03de85d9da2 Mon Sep 17 00:00:00 2001 From: Magnus Date: Wed, 18 Nov 2009 02:25:16 +0000 Subject: [PATCH 31/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3466 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 24 ++++++++++++++++++++++++ quakec/fallout2/defs.qc | 2 ++ quakec/fallout2/inventory.qc | 8 ++++---- quakec/fallout2/misc.qc | 6 ++++-- quakec/fallout2/world.qc | 12 ++++++------ quakec/fallout2/zombie.qc | 26 ++++++++++++++++++++++---- 6 files changed, 62 insertions(+), 16 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 705494cc1..82f6a0142 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -760,6 +760,14 @@ void() PutClientInServer = W_SetCurrentAmmo(); stuffcmd(self, "sizeup\n"); stuffcmd(self, "sizeup\n"); + + + if (world.model == "maps/r_bunker.bsp") + stuffcmd(self, "play music/afterglow\n"); + else if (world.map_obj == OBJ_DEADTOWN) + stuffcmd(self, "play music/necropolis\n"); + else + stuffcmd(self, "play music/raiders\n"); }; @@ -1552,6 +1560,7 @@ void() PlayerPreThink = ArmorCheck(); SneakLevel(); self.accept = 0; + local float lgrip, rgrip; @@ -1655,7 +1664,22 @@ void() PlayerPreThink = if (self.ammo_cells < 0) self.ammo_cells = 0; } + + if (self.musictimer == 0) + { + if (world.model == "maps/r_bunker.bsp") + stuffcmd(self, "play music/afterglow\n"); + else if (world.map_obj == OBJ_DEADTOWN) + stuffcmd(self, "play music/necropolis\n"); + else + stuffcmd(self, "play music/raiders\n"); + self.musictimer = 1; + } + else if (self.musictimer <= 120) + self.musictimer = self.musictimer + 1; + else if (self.musictimer > 120) + self.musictimer = 0; if (self.regen > 0 && !self.deadflag) //don't come back to life. { diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 5f17a2f7e..b32e22c52 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -687,6 +687,8 @@ float intermission_running; .float shadowskill_sneak; .float shadowskill_science; +.float musictimer; + .float rescued; .float scale; .float bandages; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index ced88d5a5..c00a8dfaa 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -1715,7 +1715,7 @@ string(float iid) GetItemDesc = if (iid == IID_WP_DKS1) return "semi-auto sniper rifle"; if (iid == IID_WP_MOONLIGHT) - return "great all-around rifle with extra utility"; + return "silenced m16a2 with night-vision scope"; if (iid == IID_WP_G11) return "a prototype rifle that uses caseless ammo"; if (iid == IID_WP_GAUSERIFLE) @@ -1723,9 +1723,9 @@ string(float iid) GetItemDesc = if (iid == IID_WP_PULSERIFLE) return "high-tech plasma weapon released just before the war"; if (iid == IID_WP_TURBOPLASMA) - return "modified plasma rifle for greater heat and pressure dissipation"; + return "modified plasma rifle"; if (iid == IID_WP_PLASMACARBINE) - return "prototype plasma rifle released during the final stages of the war"; + return "prototype plasma rifle"; if (iid == IID_WP_FNFAL) return "rifle designed for longer range; high recoil"; if (iid == IID_WP_ROCKETLAUNCHER) @@ -2175,7 +2175,7 @@ string(float iid) GetItemImage = if (iid == IID_WP_DKS1_S) return "dks1_s.jpg"; if (iid == IID_WP_MOONLIGHT) - return "XL70E3.jpg"; + return "moonlight.jpg"; if (iid == IID_WP_G11) return "g11.jpg"; if (iid == IID_WP_GAUSERIFLE) diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index 7232baa18..94a5880d4 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -1013,8 +1013,10 @@ void() brotherhood_soldier = self.xslot7 = SlotVal(IID_AM_ENERGYCELL, 100); self.xslot8 = SlotVal(IID_AM_CASELESS, 100); self.xslot9 = SlotVal(IID_AM_NEEDLER, 100); - self.xslot12 = SlotVal(IID_EQUIP_STEALTHBOY, 1); - self.xslot13 = SlotVal(IID_EQUIP_BACKPACK, 1); + self.xslot10 = SlotVal(IID_EQUIP_STEALTHBOY, 1); + self.xslot11 = SlotVal(IID_EQUIP_BACKPACK, 1); + self.xslot12 = SlotVal(IID_ARM_COMBAT, 1); + self.xslot13 = SlotVal(IID_ARM_SEVA, 1); self.xslot14 = SlotVal(IID_WP_AK112, 1); self.xslot15 = SlotVal(IID_WP_ACR, 1); self.xslot16 = SlotVal(IID_WP_AK112_M, 1); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index f81c0aab6..49dcd42d6 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -631,7 +631,7 @@ if (coop == 1) // Players vs Monsters te = find(te, classname, "monster"); } - +/* if (musicplay == 0) { musicplay = 1; @@ -644,18 +644,18 @@ if (coop == 1) // Players vs Monsters while (ze != world) { if (musictrack == 1) - stuffcmd(ze, "play music/battle\n"); + stuffcmd(ze, "play music/battle_a\n"); if (musictrack == 2) - stuffcmd(ze, "play misc/zombies\n"); + stuffcmd(ze, "play music/zombies\n"); ze = find (ze, classname, "player"); } } - else if (musicplay < 20) + else if (musicplay < 120) musicplay = musicplay + 1; - else if (musicplay >= 20) - musicplay = 0; + else if (musicplay >= 120) + musicplay = 0;*/ te = find(world, classname, "player"); while (te) diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index 26581df21..2313a4588 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -737,7 +737,7 @@ void () spawn_ghoul_copy = local entity te, ze; local vector jojo; local float zomc, pcount, loadzombie; - local string finder, waterlev; + local string finder, waterlev, diag; local vector stuff; @@ -797,13 +797,14 @@ void () spawn_ghoul_copy = ze = find (world, netname, "ghoul"); zomc = 0; + pcount = 0; while (ze) { zomc = zomc + 1; - ze = find (ze, netname, "monster"); + ze = find (ze, classname, "monster"); } ze = find(world, classname, "player"); @@ -815,14 +816,31 @@ void () spawn_ghoul_copy = ze = find(ze, classname, "player"); } - if (zomc > 30*pcount) + + if (zomc > 60*pcount) return; + + zomc = 0; + + te = findradius (self.origin, 1000); + while (te) + { + if (te.classname == "monster") + zomc = zomc + 1; + + te = te.chain; + } + + if (zomc >= 25) + return; + + zombie = spawn (); zombie.owner = self; self = zombie; self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_STEP; + self.movetype = MOVETYPE_STEP; setmodel (self, "progs/ghoul.mdl"); setsize (self, '-8 -8 -24', '8 8 24'); self.health = 90; From 2dcd293cc83936883902296eb7dd59ce9517f280 Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 19 Nov 2009 17:19:05 +0000 Subject: [PATCH 32/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3469 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/ai.qc | 25 ++- quakec/fallout2/client.qc | 34 +--- quakec/fallout2/combat.qc | 26 +-- quakec/fallout2/csqc/invent.qc | 2 +- quakec/fallout2/csqc/main.qc | 17 +- quakec/fallout2/defs.qc | 8 + quakec/fallout2/inventory.qc | 40 ++-- quakec/fallout2/items.qc | 12 +- quakec/fallout2/misc.qc | 32 ++- quakec/fallout2/mod_buy.qc | 140 +++---------- quakec/fallout2/player.qc | 14 +- quakec/fallout2/soldier.qc | 2 +- quakec/fallout2/weapons.qc | 361 ++++++++++++++++++++------------- quakec/fallout2/world.qc | 32 ++- quakec/fallout2/zombie.qc | 107 ++++++---- 15 files changed, 463 insertions(+), 389 deletions(-) diff --git a/quakec/fallout2/ai.qc b/quakec/fallout2/ai.qc index 704017d71..4f1c3dfec 100644 --- a/quakec/fallout2/ai.qc +++ b/quakec/fallout2/ai.qc @@ -268,6 +268,10 @@ void() ChangeYaw = void() HuntTarget = { + + if (self.enemy == self.friend) + return; + self.goalentity = self.enemy; self.think = self.th_run; self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin); @@ -350,17 +354,22 @@ slower noticing monsters. */ float() FindTarget = { - local entity client; + local entity client, te; local float r, x; local string y; // if the first spawnflag bit is set, the monster will only wake up on // really seeing the player, not another monster getting angry - // spawnflags & 3 is a big hack, because zombie crucified used the first // spawn flag prior to the ambush flag, and I forgot about it, so the second // spawn flag works as well + + + if (self.charmed == 1) + return FALSE; + + if (sight_entity_time >= time - 0.1 && !(self.spawnflags & 3) ) { client = sight_entity; @@ -374,9 +383,15 @@ float() FindTarget = return FALSE; // current check entity isn't in PVS } + + if (client == self.friend)//friends will not be attacked + return FALSE; if (client == self.enemy) return FALSE; + if (self.flash > 0) + return; + if (client.flags & FL_NOTARGET) return FALSE; if (client.items & IT_INVISIBILITY) @@ -444,10 +459,13 @@ float() FindTarget = if (client.sneak > 0)//sneaking players are invisible return FALSE; + // // got one // self.enemy = client; + +/* if (self.enemy.classname != "player") { self.enemy = self.enemy.enemy; @@ -456,7 +474,7 @@ float() FindTarget = self.enemy = world; return FALSE; } - } + }*/ FoundTarget (); @@ -736,7 +754,6 @@ The monster has an enemy it is trying to kill */ void(float dist) ai_run = { - if (self.hold == 1) { self.th_stand; diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 82f6a0142..8dcbd0051 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -1561,6 +1561,10 @@ void() PlayerPreThink = SneakLevel(); self.accept = 0; + self.endinfo1 = rescue; + self.endinfo2 = dead_hostage; + self.endinfo3 = hostages; + local float lgrip, rgrip; @@ -1612,10 +1616,7 @@ void() PlayerPreThink = if (self.cycle2 < time) { - if (ToIID(self.islot4) == IID_EQUIP_BATTERY) - r = 20; - else - r = 10; + if (self.ragetime > 0) self.ragetime -= 1; @@ -1644,26 +1645,6 @@ void() PlayerPreThink = if (rgrip == 0 && lgrip == 1) self.rage = 777; - if (self.sneak == 0) - { - if (self.ammo_cells < r) - self.ammo_cells = self.ammo_cells + 1; - - if (self.ammo_cells > r) - self.ammo_cells = r; - } - - if (self.sneak > 0) - { - if (self.ammo_cells == 3 && ToIID(self.islot4) == IID_EQUIP_STEALTHBOY) - sprint(self, 2, "stealthboy running low!\n"); - - if (self.ammo_cells > 0) - self.ammo_cells = self.ammo_cells - 1; - - if (self.ammo_cells < 0) - self.ammo_cells = 0; - } if (self.musictimer == 0) { @@ -2194,6 +2175,11 @@ void() ClientDisconnect = // let everyone else know bprint (PRINT_HIGH, self.netname); bprint (PRINT_HIGH, " left the game.\n"); + if (self.team == 1) + teamblue = teamblue - 1; + else if (self.team == 2) + teamred = teamred - 1; + self.classname = "disconnected"; sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); set_suicide_frame (); diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 186855113..71a0ff027 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -139,14 +139,19 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (targ.radiation > 0) { - radpenalty = 1 + (targ.radiation/100); - - if (radpenalty > 1.25) - radpenalty = 1.25; - + radpenalty = 1 + (targ.radiation/200); damage = damage * radpenalty; } + if (attacker.radiation > 0) + { + radpenalty = 1 - (targ.radiation/200); + damage = damage * radpenalty; + } + + if (targ.classname == "player" && attacker.classname == "monster") + targ.superenemy = attacker; + //getting hurt is slightly painful to the score, play cautiously! if (attacker.classname == "monster" && targ.classname == "player") targ.score = targ.score - 1; @@ -573,18 +578,7 @@ take = damage; } Killed (targ, attacker); - if (attacker.perk1 == 11 || attacker.perk2 == 11) - { - attacker.lastman += 1.5; - lm = ftos(attacker.lastman); - sprint(self, 2, "!LAST MAN STANDING: "); - sprint(self, 2, lm); - sprint(self, 2, "\n"); - attacker.health += attacker.lastman; - if (attacker.health > attacker.max_health) - attacker.health = attacker.max_health; - } return; } diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 29ea43fcc..c09572482 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -723,7 +723,7 @@ void() GainPerk_Draw = drawpic('2 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Support Fire.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('3 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Duck And Cover", '64 64 0'*(scrwidth/640), '1 1 1', 1); - drawpic('4 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Harmless.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('4 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Puppet Master.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('5 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Stay Low.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('6 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Surgical Precision.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index 98bec3e82..c6874391e 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -105,7 +105,7 @@ void() Chem_Draw = void() Time_Draw = { local float xtime, ytime, ztime, obj; - local string qtime, rtime, shadowtime, text; + local string qtime, rtime, shadowtime, text, text2; xtime = getstati(104); ytime = floor(xtime/60); @@ -130,6 +130,21 @@ void() Time_Draw = drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.86)), text, '8 8 8', '1 1 1', 1); + + + + text = "citizens rescued: "; + text2 = ftos(getstati(113)); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.90)), strcat(text, text2), '8 8 8', '1 1 1', 1); + + text = "citizens slain: "; + text2 = ftos(getstati(114)); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.92)), strcat(text, text2), '8 8 8', '1 1 1', 1); + + text = "citizens left: "; + text2 = ftos(getstati(115)); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.94)), strcat(text, text2), '8 8 8', '1 1 1', 1); + }; diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index b32e22c52..c4d0a58f7 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -523,6 +523,8 @@ float gtimer; float total_players; float endgame_timer; float time_left; +float teamred; +float teamblue; float s_map_obj; float s_ent1; @@ -666,6 +668,9 @@ float intermission_running; .float equipment_slot; .float has_radio; .float score; +.float endinfo1; +.float endinfo2; +.float endinfo3; //.float select; //.float grenade_hold; @@ -752,6 +757,7 @@ float intermission_running; .float announcercache; string announcer; +.float charmed; .entity friend; .entity tumbler1; .entity tumbler2; @@ -760,6 +766,8 @@ string announcer; .entity heal_ent; .vector oldorg; .vector home; +.entity superenemy; + .float location; .float start_time; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index c00a8dfaa..90cf41683 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -58,6 +58,7 @@ float IID_WP_DKS1_S = 441; float IID_WP_RANGEMASTER_SCOPE = 442; float IID_WP_AK47 = 443; float IID_WP_ACR = 444; +float IID_WP_GRENADELAUNCHER = 445; //and ammo for those guns float IID_AM_NEEDLER = 507; @@ -73,6 +74,7 @@ float IID_AM_45ACP = 516; //".45 ACP ammo"; float IID_AM_ROCKET = 517; //"explosive rocket" float IID_AM_CASELESS = 518; //caseless float IID_AM_WARSAW = 519; //ak-47 ammo +float IID_AM_GRENADE = 520; //grenade launcher ammo //grenade items float IID_GREN_FRAG = 101; @@ -662,9 +664,9 @@ string(float iid) GetItemVModel = if (iid == IID_WP_USP_S) return "progs/v_usp.mdl"; if (iid == IID_WP_GLOCK) - return "progs/v_glock.mdl"; + return "progs/v_10mmpistol.mdl"; if (iid == IID_WP_GLOCK_S) - return "progs/v_glock.mdl"; + return "progs/v_10mmpistol.mdl"; if (iid == IID_WP_DEAGLE) return "progs/v_deagle.mdl"; if (iid == IID_WP_NEEDLER) @@ -721,6 +723,8 @@ string(float iid) GetItemVModel = return "progs/v_carbine.mdl"; if (iid == IID_WP_ROCKETLAUNCHER) return "progs/v_rocket.mdl"; + if (iid == IID_WP_GRENADELAUNCHER) + return "progs/v_gl.mdl"; if (iid == IID_WP_LASERGATLING) return "progs/v_chain.mdl"; @@ -757,9 +761,9 @@ string(float iid) GetItemWModel = if (iid == IID_WP_USP_S) return "progs/w_usp.mdl"; if (iid == IID_WP_GLOCK) - return "progs/w_glock.mdl"; + return "progs/w_10mmpistol.mdl"; if (iid == IID_WP_GLOCK_S) - return "progs/w_glock.mdl"; + return "progs/w_10mmpistol.mdl"; if (iid == IID_WP_DEAGLE) return "progs/w_deagle.mdl"; if (iid == IID_WP_DEAGLE_M) @@ -819,6 +823,8 @@ string(float iid) GetItemWModel = if (iid == IID_WP_ROCKETLAUNCHER) return "progs/w_rocket.mdl"; + if (iid == IID_WP_GRENADELAUNCHER) + return "progs/w_gl.mdl"; if (iid == IID_WP_LASERGATLING) return "progs/w_chain.mdl"; @@ -946,6 +952,8 @@ float(float iid) WeaponAmmoType = return IID_AM_ROCKET; if (iid == IID_WP_LASERGATLING) return IID_AM_ENERGYCELL; + if (iid == IID_WP_GRENADELAUNCHER) + return IID_AM_GRENADE; return IID_NONE; }; @@ -957,9 +965,9 @@ float(float iid) WeaponMagQuant = if (iid == IID_WP_USP_S) return 12; if (iid == IID_WP_GLOCK) - return 15; + return 10; if (iid == IID_WP_GLOCK_S) - return 15; + return 10; if (iid == IID_WP_DEAGLE) return 7; if (iid == IID_WP_DEAGLE_M) @@ -1954,7 +1962,7 @@ float(float iid) GetWeaponRange = if (iid == IID_WP_NEEDLER) return 20; if (iid == IID_WP_ALIENBLASTER) - return 10; + return 6+(getstati(103)*1); if (iid == IID_WP_PIPERIFLE) return 40; if (iid == IID_WP_PIPERIFLE_S) @@ -2044,7 +2052,7 @@ float(float iid) GetWeaponDamage = if (iid == IID_WP_NEEDLER) return 16; if (iid == IID_WP_ALIENBLASTER) - return 20; + return 20+(getstati(103)*6); if (iid == IID_WP_PIPERIFLE) return 20; if (iid == IID_WP_PIPERIFLE_S) @@ -2143,7 +2151,7 @@ string(float iid) GetItemImage = if (iid == IID_WP_NEEDLER) return "needler.jpg"; if (iid == IID_WP_ALIENBLASTER) - return "ppistol.jpg"; + return "blaster.jpg"; if (iid >= IID_WP_PIPERIFLE && iid <= IID_WP_PIPERIFLE_S_R) return "prifle.jpg"; if (iid == IID_WP_WINCHESTER) @@ -2561,7 +2569,7 @@ string (float slot, float int) PerkName = if (int == 2) return "Duck And Cover"; if (int == 3) - return "Harmless"; + return "Puppet Master"; if (int == 4) return "Stay Low"; if (int == 5) @@ -2587,7 +2595,7 @@ string (float slot, float int) PerkNameCentered = if (int == 2) return " Duck And Cover"; if (int == 3) - return " Harmless"; + return " Puppet Master "; if (int == 4) return " Stay Low"; if (int == 5) @@ -2614,7 +2622,7 @@ string(float int) GetPerkImage = else if (int == 2) return "gui/perks/Duck And Cover.jpg"; else if (int == 3) - return "gui/perks/Harmless.jpg"; + return "gui/perks/Puppet Master.jpg"; else if (int == 4) return "gui/perks/Stay Low.jpg"; else if (int == 5) @@ -2640,11 +2648,11 @@ string(float int) GetPerkImage = string(float int) GetPerkDesc = { if (int == 1) - return "33% recoil reduction while prone"; + return "Recoil is drastically reduced while lying down"; else if (int == 2) - return "Huge dodge chance while taking cover and ducking"; - else if (int == 3) return "Makes enemies attack your friends instead of you"; + else if (int == 3) + return "You can make enemies attack their friends"; else if (int == 4) return "50% damage resist to area attacks while prone"; else if (int == 5) @@ -2654,7 +2662,7 @@ string(float int) GetPerkDesc = else if (int == 7) return "Provides you a few hassle-free seconds to escape danger"; else if (int == 8) - return "You may gain additional skills from an unknown source"; + return "Your skill levels surge in power from an unknown source"; else if (int == 9) return "Paralyze anything with a sneak attack from a knife"; else if (int == 10) diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 7f022c3d9..edabf65b1 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -372,9 +372,19 @@ void() rad_think = self.think = rad_think; self.nextthink = time + 4; + WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte (MSG_BROADCAST, TE_LAVASPLASH); + WriteCoord (MSG_BROADCAST, self.origin_x); + WriteCoord (MSG_BROADCAST, self.origin_y); + WriteCoord (MSG_BROADCAST, self.origin_z); + + te = findradius (self.origin, 700); while (te) { + + + if (te.classname == "player") te.radiation = te.radiation + 1; @@ -1382,7 +1392,7 @@ void() weapon_supershotgun = TreasureChest(); - if (random()*100 <= 5) + if (random()*100 <= 100) spawn_radiation(self.origin); SpawnJunk(self.origin); diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index 94a5880d4..caa7fbb7c 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -912,15 +912,31 @@ void() misc_noisemaker = void() brotherhood_merchant = { local entity sign; -/* - sign = spawn(); - sign.origin = self.origin + '0 0 32'; - setmodel(sign, "progs/trader.spr"); - sign.solid = SOLID_NOT;*/ - setorigin(self, self.origin + '0 0 64'); - self.movetype = MOVETYPE_BOUNCE; - self.velocity_z = -200; + sign = spawn(); + sign.movetype = MOVETYPE_BOUNCE; + sign.velocity_x = crandom()*50; + sign.velocity_y = crandom()*50; + sign.velocity_z = -100; + setsize (sign, '-2 -2 -6', '2 2 2'); + sign.origin = self.origin + '32 0 32'; + setmodel(sign, "progs/money.mdl"); + sign.solid = SOLID_BBOX; + sign.scale = 10; + + sign = spawn(); + sign.movetype = MOVETYPE_BOUNCE; + sign.velocity_x = crandom()*50; + sign.velocity_y = crandom()*50; + sign.velocity_z = -100; + setsize (sign, '-2 -2 -6', '2 2 2'); + sign.origin = self.origin + '0 32 32'; + setmodel(sign, "progs/money.mdl"); + sign.solid = SOLID_BBOX; + sign.scale = 10; + + + setmodel (self, "progs/enforcer.mdl"); self.touch = SUB_Null; diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index bd3bb0f74..923ae023e 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -797,30 +797,6 @@ void() W_PlayerMenu = return; } - else if (self.currentmenu == "select_team") - { - if (self.impulse == 1) - { - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - bprint(2, self.netname); - bprint(2, " has joined the rangers.\n"); - self.currentmenu = "confirm_team"; - DisplayMenu(); - self.team = 1; - return; - } - if (self.impulse == 2) - { - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - bprint(2, self.netname); - bprint(2, " has joined the raiders.\n"); - self.currentmenu = "confirm_team"; - DisplayMenu(); - self.team = 2; - return; - } - - } else if (self.currentmenu == "gain_skill") { if (self.impulse == 1) @@ -864,61 +840,8 @@ void() W_PlayerMenu = return; } } - else if (self.currentmenu == "confirm_team") - { - if (self.impulse == 1) - { - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "select_skill"; - DisplayMenu(); - self.impulse = 0; - return; - } - if (self.impulse == 2) - { - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "select_team"; - DisplayMenu(); - self.impulse = 0; - self.team = 0; - return; - } - } - else if (self.currentmenu == "confirm_skill") - { - if (self.impulse == 1) - { - self.missionbrief = 0; - self.class = self.tclass; - if (self.class == 1) - self.skill_doctor = self.skill_doctor + 1; - if (self.class == 2) - self.skill_sneak = self.skill_sneak + 1; - if (self.class == 3) - self.skill_combat = self.skill_combat + 1; - if (self.class == 4) - self.skill_science = self.skill_science + 1; - self.score = 0; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "none"; - centerprint(self, ""); - bprint(2, self.netname); - bprint(2, " has gained a level.\n"); - self.class = self.tclass; - self.impulse = 0; - return; - } - if (self.impulse == 2) - { - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "gain_skill"; - DisplayMenu(); - self.impulse = 0; - self.class = 0; - return; - } - } + else if (self.currentmenu == "display_enter_screen") { if (self.impulse == 1 && coop == 1) @@ -936,42 +859,39 @@ void() W_PlayerMenu = } else if (self.impulse == 1 && coop == 0) { - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.connected = 1; - self.currentmenu = "select_team"; - DisplayMenu(); - self.impulse = 0; - return; - } - } - else if (self.currentmenu == "display_brief") - { - if (self.impulse == 1) - { - if (self.skill_combat == 0 && self.skill_sneak == 0 && self.skill_doctor == 0 && self.skill_science == 0) + self.missionbrief = 0; + if (teamblue == teamred) + { + if (random()*100 <= 50) + { + self.team = 1; + teamblue = teamblue + 1; + } + else + { + self.team = 2; + teamred = teamred + 1; + } + } + else if (teamblue > teamred) + { + self.team = 2; + teamred = teamred + 1; + } + else if (teamblue < teamred) { self.team = 1; - self.missionbrief = 2; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "select_skill"; - DisplayMenu(); - self.impulse = 0; - return; - } - else - { - - self.missionbrief = 0; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "none"; - centerprint(self, ""); - PutClientInServer(); - bprint(2, self.netname); - bprint(2, " has entered the wasteland.\n"); - total_players = total_players + 1; - return; + teamblue = teamblue + 1; } + self.connected = 1; + sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); + centerprint(self, "\n"); + self.currentmenu = "none"; + PutClientInServer(); + self.impulse = 0; + self.current_slot = 1; + return; } } else if (self.currentmenu == "select_mission") diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index 7e2816827..c99f45862 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -155,7 +155,7 @@ void (float db) loud_noise = t = t + 32; } - if (x < db*20 && d <= md) + if (x < db*20 && d <= md && (te.friend != self)) { te.enemy = self; te.think = HuntTarget; @@ -248,17 +248,13 @@ void () Footstep = if (self.sneak != 0) return; - if (getperk(6)) - r = 0.5; - else - r = 1; + + r = 1 - (self.skill_sneak/40); if (self.classname == "player") { - if (getperk(6)) - loud_noise(10); - else - loud_noise(20); + + loud_noise(20 - self.skill_sneak); } if (world.worldtype == 1 || world.worldtype == 2) diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index 34d4edf5d..16250d3e0 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -657,7 +657,7 @@ void () army_walk8 = [ 80, army_walk1 ] void () army_run1 = [ 73, army_run2 ] { - if (random()<0.25 || self.health <= 25) + if ((random()<0.25 || self.health <= 25) && self.charmed != 1) find_hide(); ai_run (TE_TELEPORT); diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 737c2aa0c..86ffe2b72 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -142,33 +142,131 @@ void (entity spot) spawn_healing = }; +void () disappear = +{ + local entity te; + local float nearby; + //this allows you to vanish, making monsters aggro + //other players + + + te = findradius(self.origin, 600); + while (te) + { + if (te.classname == "player" && te.sneak == 0 && te != self) + nearby = 1; + + te = te.chain; + } + + if (nearby == 1) + { + te = findradius(self.origin, 1000); + while (te) + { + if (te.enemy == self) + te.enemy = world; + + te = te.chain; + } + } + + te = findradius(self.origin, 1000); + while (te) + { + if (te.enemy == self) + te.enemy = world; + + te = te.chain; + } +}; + +void () puppet_master = +{ + local entity te; + local float charm_monster; + //this allows you to control other monsters + + + charm_monster = 0; + te = findradius(self.origin, 400); + while (te) + { + if (te.classname == "monster" && (charm_monster == 0) && (visible(te))) + { + spawn_excla(te, 60); + charm_monster = 1; + te.friend = self; + te.charmed = 1; + te.enemy = world; + te.goalentity = self; + self.friend = te; + } + te = te.chain; + } + +}; + +void () puppet_master_command = +{ + local entity te, ent; + local float charm_monster; + //this allows you to control other monsters + + makevectors (self.v_angle); + traceline (self.origin, self.origin+v_forward*4000, FALSE, self); + + if (trace_ent.classname == "monster" && trace_ent != self.friend) + { + self.friend.enemy = trace_ent; + self.friend.think = HuntTarget; + self.friend.nextthink = time + 0.25; + } + else + { + self.friend.enemy = self; + self.friend.think = HuntTarget; + self.friend.nextthink = time + 0.25; + } +}; + void(float slotno) UsePerk = { - local float x, mcount; + local float x, mcount, eat; local string y, timeleft; local entity te; + local vector org; if (slotno == 1 && self.perk1timer > 0) { + if ((self.perk1 == 3 && slotno == 1) || (self.perk2 == 3 && slotno == 2)) + { + puppet_master_command(); + return; + } timeleft = ftos(self.perk1timer); - sprint(self, 2, "ability is not ready yet. ["); - sprint(self, 2, timeleft); - sprint(self, 2, "]\n"); + sprint(self, 2, "ability is not ready yet.\n"); sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); return; } if (slotno == 2 && self.perk2timer > 0) { + if ((self.perk1 == 3 && slotno == 1) || (self.perk2 == 3 && slotno == 2)) + { + puppet_master_command(); + return; + } timeleft = ftos(self.perk2timer); - sprint(self, 2, "ability is not ready yet. ["); - sprint(self, 2, timeleft); - sprint(self, 2, "]\n"); + sprint(self, 2, "ability is not ready yet.\n"); sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); return; + } - if ((self.perk1 == 7 && slotno == 1) || (self.perk2 == 7 && slotno == 2)) + + + if ((self.perk1 == 2 && slotno == 1) || (self.perk2 == 2 && slotno == 2)) { if (slotno == 1) self.perk1timer = 2000; @@ -177,27 +275,96 @@ void(float slotno) UsePerk = sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + org = self.origin; + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_TELEPORT); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + + disappear(); + + } + if ((self.perk1 == 3 && slotno == 1) || (self.perk2 == 3 && slotno == 2)) + { + if (slotno == 1) + self.perk1timer = 2000; + if (slotno == 2) + self.perk2timer = 2000; + + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + + org = self.origin; + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_TELEPORT); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + + if (self.friend.classname != "monster") + puppet_master(); + else + puppet_master_command(); + + } + else if ((self.perk1 == 7 && slotno == 1) || (self.perk2 == 7 && slotno == 2)) + { + if (slotno == 1) + self.perk1timer = 2000; + if (slotno == 2) + self.perk2timer = 2000; + + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + + org = self.origin; + WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); + WriteByte (MSG_MULTICAST, TE_TELEPORT); + WriteCoord (MSG_MULTICAST, org_x); + WriteCoord (MSG_MULTICAST, org_y); + WriteCoord (MSG_MULTICAST, org_z); + te = findradius (self.origin, 6000); while (te) { if (te.classname == "monster") { - te.hold = 160; + te.hold = 180; spawn_stop(te, 10); mcount = mcount + 1; } te = te.chain; } } - if ((self.perk1 == 11 && slotno == 1) || (self.perk2 == 11 && slotno == 2)) + else if ((self.perk1 == 11 && slotno == 1) || (self.perk2 == 11 && slotno == 2)) { + if (self.radiation <= 0) + return; + if (slotno == 1) self.perk1timer = 2000; if (slotno == 2) self.perk2timer = 2000; - sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + if (self.radiation <= 25) + { + eat = self.radiation; + self.radiation = 0; + } + else + { + eat = 25; + self.radiation = self.radiation - 25; + } + self.health = self.health + eat; + self.regen = self.regen + ceil(eat/5); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); } }; @@ -1080,10 +1247,9 @@ W_FireGrenade */ void() W_FireGrenade = { - if (deathmatch != 4) - self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + DropAmmo(); - sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/gl-1.wav", 1, ATTN_NORM); msg_entity = self; WriteByte (MSG_ONE, SVC_SMALLKICK); @@ -1680,11 +1846,11 @@ void() W_Attack = else if (weap == IID_WP_NEEDLER) FirePistol(10+self.skill_science, 2, "weapons/needler.wav", 2000, 0.1); else if (weap == IID_WP_GLOCK) - FirePistol(12, 6, "weapons/glock.wav", 2000, 0.1); + FirePistol(12, 6, "weapons/10mmpistol.wav", 2000, 0.1); else if (weap == IID_WP_GLOCK_S) FirePistol(10, 6, "weapons/smg_s.wav", 2000, 0.1); else if (weap == IID_WP_ALIENBLASTER) - FirePulseRifle(16, 0.1, 10+self.skill_science*4, 2); + FirePulseRifle(4, 0.1, 20+self.skill_science*6, 3); else if (weap == IID_WP_PIPERIFLE) FireAssaultRifle(15+self.skill_science, 5, "weapons/rangem.wav", 5000, 0.1); else if (weap == IID_WP_PIPERIFLE_S) @@ -1749,13 +1915,6 @@ void() W_Attack = FireAssaultRifle(30, 80, "weapons/gauss.wav", 9000, 0.2); else if (weap == IID_WP_LASERGATLING) FireMinigun(16, 20, "weapons/ak112.wav", 4000, 0.05); - - //FirePulseRifle(2, 0.1, 30, 3); - - -//float IID_WP_GAUSERIFLE = 421; -//float IID_WP_PULSERIFLE = 422; - else if (weap == IID_GREN_FRAG) player_pull1(); else if (weap == IID_GREN_EMP) @@ -1767,7 +1926,8 @@ void() W_Attack = else if (weap == IID_WP_ROCKETLAUNCHER) W_FireRocket(); - + else if (weap == IID_WP_GRENADELAUNCHER) + W_FireGrenade(); else if (weap == IID_WP_WRENCH) { if (!FireToolkit()) @@ -1846,16 +2006,7 @@ void() CheatCommand = local string y; local entity te; - self.ammo_shells = 900; - - te = findradius (self.origin, 6000); - while (te) - { - if (te.classname == "monster") - te.hold = 100; - - te = te.chain; - } + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); }; /* @@ -2583,8 +2734,8 @@ void (float skill) FragExplode = te = te.chain; } - r = 200 + skill*20; - d = 10 + skill*10; + r = 450; + d = 30 + skill*5; T_RadiusDamage2 (self, self.owner, d+random()*40, other, r); remove (self); @@ -2996,9 +3147,9 @@ void (float dam, float ap, string snd, float rng, float rate) FirePistol = dam = dam + random()*dam; if (weap == IID_WP_NEEDLER) - X_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else if (weap == IID_WP_USP) - J_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else T_Damage (trace_ent, self, self, dam); @@ -3143,11 +3294,11 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = dam = dam + random()*dam; if (weap == IID_WP_GREASEGUN) - J_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else if (weap == IID_WP_MP9) T_Damage (trace_ent, self, self, dam); else if (weap == IID_WP_GREASEGUN_S) - J_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else if (weap == IID_WP_MP9_S) T_Damage (trace_ent, self, self, dam); @@ -3174,45 +3325,20 @@ void (float rec, float speed, float dam, float type) FirePulseRifle = weap = ToIID(self.(SlotField(self.current_slot))); - if (weap != IID_WP_ALIENBLASTER) - { - if (self.recoil >= 15) - { - loud_noise(60); - sound (self, CHAN_WEAPON, "weapons/blowoff-1.wav", 1, ATTN_NORM); - self.attack_finished = (time + (1 + random()*1.5)); - return; - } - else if (weap != IID_WP_LASERGATLING) - { - loud_noise(60); - sound (self, CHAN_AUTO, "weapons/blowoff-2.wav", 0.5, ATTN_IDLE); - } - } - if (weap == IID_WP_ALIENBLASTER) stuffcmd (self, "-attack\n"); - if (weap != IID_WP_LASERGATLING) - { - loud_noise(20); - if (random()<0.5) - sound (self, CHAN_WEAPON, "weapons/plasma-1.wav", 1, ATTN_NORM); - else - sound (self, CHAN_WEAPON, "weapons/plasma-2.wav", 1, ATTN_NORM); - } - else if (weap == IID_WP_LASERGATLING && self.attack == 1) - { - loud_noise(40); - sound (self, CHAN_WEAPON, "weapons/laserburst1.wav", 1, ATTN_NORM); - } + loud_noise(20); + sound (self, CHAN_WEAPON, "weapons/blaster.wav", 1, ATTN_NORM); + + if (self.attack >= 6) self.attack = 0; - self.attack_finished = time + (speed*0.5) + (random()*speed*0.5); + self.attack_finished = time + (speed*1) + (random()*speed*1); //only silenced weapons do not break stealth @@ -3241,24 +3367,25 @@ void (float rec, float speed, float dam, float type) FirePulseRifle = DropAmmo (); makevectors (self.v_angle); - if (self.recoil >= 20) - self.recoil = 20; + if (self.recoil >= 10) + self.recoil = 10; - tmp = 50; + tmp = 400; - if (self.velocity != '0 0 0') - tmp = 100; + tmp = tmp - (5*self.skill_science); - tmp = tmp + (5*self.recoil); + tmp = tmp * (1 + (self.recoil / 10)); - if (self.recoil <= 1 && self.velocity_z == 0) + tmp = tmp * (1.25 - (self.skill_science/20)); + + if (self.recoil <= 0 && self.velocity_z == 0) tmp = (tmp * 0.5); self.attack = self.attack + 1; self.recoil = self.recoil + rec; - source = self.origin + '0 0 22' + v_right*6 + v_forward*14; + source = self.origin + '0 0 24' + v_right*4 + v_forward*14; source = source + adjust; tmp = tmp * 0.60; @@ -3276,15 +3403,16 @@ void (float rec, float speed, float dam, float type) FirePulseRifle = org2 = trace_endpos + (v_forward * ((trace_ent.size_y / 2) + (trace_ent.size_x / 2))); zap = spawn(); - zap.origin = self.origin + v_right*16 + adjust; + zap.origin = self.origin + v_right*6 + adjust; zap.velocity = self.velocity; zap.angles = self.angles; zap.v_angle = self.v_angle; + if (type == 1) { WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_LIGHTNING1); + WriteByte (MSG_MULTICAST, TE_LIGHTNING2); WriteEntity (MSG_MULTICAST, zap); WriteCoord (MSG_MULTICAST, source_x); WriteCoord (MSG_MULTICAST, source_y); @@ -3563,9 +3691,9 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR dam = dam + random()*dam; if (weap == IID_WP_DKS1 || weap == IID_WP_FNFAL || weap == IID_WP_ACR) - X_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else if (weap == IID_WP_AK112) - J_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else T_Damage (trace_ent, self, self, dam); @@ -3737,15 +3865,15 @@ void (float dam, float xrecoil, string snd, float rng, float rate) FireMinigun = dam = dam + random()*dam; if (weap == IID_WP_DKS1) - X_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else if (weap == IID_WP_FNFAL) - X_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else if (weap == IID_WP_DKS1_S) - X_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else if (weap == IID_WP_AK112) - X_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else if (weap == IID_WP_AK112_M) - X_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam); else T_Damage (trace_ent, self, self, dam); @@ -4697,33 +4825,7 @@ void () DisplayMenu = centerprint (self, "choose skill to gain‘\n\n1‘ doctor \n2‘ sneak \n3‘ combat \n4‘ science \n"); } - if ((self.currentmenu == "select_team")) - { - if (self.class == 0) - centerprint (self, "CHOOSE YOUR TEAM‘\n\n1‘ Rangers (good)\n2‘ Raiders (evil)\n3‘ Auto-Assign \n"); - if (self.class >= 0 && self.oldteam == 0) - centerprint (self, "CHOOSE YOUR TEAM‘\n\n1‘ Rangers (good)\n2‘ Raiders (evil)\n3‘ Auto-Assign \n"); - if (self.class > 0 && self.oldteam > 0) - centerprint (self, "CHOOSE YOUR TEAM‘\n\n1‘ Rangers (good)\n2‘ Raiders (evil)\n3‘ Auto-Assign \n4‘ Keep Previous \n"); - } - if (self.currentmenu == "confirm_team") - { - if (self.team == 1) - centerprint (self, "you will respawn as‘\n\nRanger - OK?\n1‘ Yes \n2‘ No \n"); - if (self.team == 2) - centerprint (self, "you will respawn as‘\n\nRaider - OK?\n1‘ Yes \n2‘ No \n"); - } - if (self.currentmenu == "confirm_skill") - { - if (self.tclass == 1) - centerprint (self, "your skill-set will be‘\n\nfirst aid - OK?\n1‘ Yes \n2‘ No \n\nprimary: first aid\nsecondary: buff allies\n"); - if (self.tclass == 2) - centerprint (self, "your skill-set will be‘\n\nstealth - OK?\n1‘ Yes \n2‘ No \n\nprimary: stealth\nsecondary: damage"); - if (self.tclass == 3) - centerprint (self, "your skill-set will be‘\n\ncombat - OK?\n1‘ Yes \n2‘ No \n\nprimary: survival\nsecondary: damage"); - if (self.tclass == 4) - centerprint (self, "your skill-set will be‘\n\nscience - OK?\n1‘ Yes \n2‘ No \n\nprimary: create\nsecondary: bypass"); - } + if (self.currentmenu == "menu_build") { @@ -5145,37 +5247,7 @@ void () ExitScreen = } }; -void () disappear = -{ - local entity te; - local float nearby; - //this allows an assassin to vanish, making monsters aggro - //those who are visible - if (!getperk(3)) - return; - - te = findradius(self.origin, 500); - while (te) - { - if (te.classname == "player" && te.sneak == 0 && te != self) - nearby = 1; - - te = te.chain; - } - - if (nearby == 1) - { - te = findradius(self.origin, 1000); - while (te) - { - if (te.enemy == self) - te.enemy = world; - - te = te.chain; - } - } -}; void () Sneak = { @@ -5192,7 +5264,6 @@ void () Sneak = } if (self.sneak == 0) { - disappear(); sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); self.sneak = 1; return; diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 49dcd42d6..43063c6a8 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -109,6 +109,9 @@ void() SetupStats = clientstat(110, 2, steadyaim); clientstat(111, 2, perk1timer); clientstat(112, 2, perk2timer); + clientstat(113, 2, endinfo1); + clientstat(114, 2, endinfo2); + clientstat(115, 2, endinfo3); clientstat(125, 2, timer); clientstat(126, 2, popup); clientstat(127, 2, score); @@ -749,7 +752,10 @@ if (coop == 1) // Players vs Monsters { ze.missionbrief = 3; ze.announcercache = 3; - + ze.ammo_shells = ze.ammo_shells + (3*rescue); + ze.endinfo1 = rescue; + ze.endinfo2 = hostages; + ze.endinfo3 = dead_hostage; ze = find (ze, classname, "player"); } @@ -769,7 +775,10 @@ if (coop == 1) // Players vs Monsters { ze.missionbrief = 3; ze.announcercache = 4; - + ze.ammo_shells = ze.ammo_shells + (3*rescue); + ze.endinfo1 = rescue; + ze.endinfo2 = hostages; + ze.endinfo3 = dead_hostage; ze = find (ze, classname, "player"); } @@ -842,9 +851,10 @@ if (coop == 1) // Players vs Monsters ze = find (world, classname, "player"); while (ze != world) { - ze.ammo_shells = ze.ammo_shells + 25; ze.missionbrief = 3; ze.announcercache = 6; + ze.ammo_shells = ze.ammo_shells + 30; + stuffcmd(ze, "play music/victory\n"); ze = find (ze, classname, "player"); @@ -929,6 +939,7 @@ if (coop == 1) // Players vs Monsters { ze.missionbrief = 3; ze.announcercache = 9; + ze.ammo_shells = ze.ammo_shells + 30; ze = find (ze, classname, "player"); @@ -978,6 +989,7 @@ if (coop == 1) // Players vs Monsters { ze.missionbrief = 3; ze.announcercache = 10; + ze.ammo_shells = ze.ammo_shells + 40; ze = find (ze, classname, "player"); @@ -1062,6 +1074,7 @@ if (coop == 1) // Players vs Monsters { ze.missionbrief = 3; ze.announcercache = 13; + ze.ammo_shells = ze.ammo_shells + 30; ze = find (ze, classname, "player"); @@ -1105,7 +1118,7 @@ if (coop == 1) // Players vs Monsters self.nextthink = time + 1; return; } -if (coop == 0) // Players vs Players +else if (coop == 0) // Players vs Players { t1alive = 0; t1dead = 0; @@ -1607,7 +1620,7 @@ void() worldspawn = precache_model ("progs/v_spear.mdl"); precache_model ("progs/v_usp.mdl"); precache_model ("progs/v_needler.mdl"); - precache_model ("progs/v_glock.mdl"); + precache_model ("progs/v_10mmpistol.mdl"); precache_model ("progs/v_fnfal.mdl"); precache_model ("progs/v_smg.mdl"); precache_model ("progs/v_rangem.mdl"); @@ -1641,7 +1654,6 @@ void() worldspawn = precache_model ("progs/junk1.mdl"); precache_model ("progs/junk2.mdl"); - precache_model ("progs/chest.mdl"); precache_model ("progs/hosfem.mdl"); precache_model ("progs/hosguy.mdl"); precache_model ("progs/handgren.mdl"); @@ -1662,12 +1674,11 @@ void() worldspawn = precache_model ("progs/w_double.mdl"); precache_model ("progs/w_combat.mdl"); precache_model ("progs/w_axe.mdl"); - precache_model ("progs/w_glock.mdl"); + precache_model ("progs/w_10mmpistol.mdl"); precache_model ("progs/w_usp.mdl"); precache_model ("progs/w_deagle.mdl"); precache_model ("progs/w_alien.mdl"); precache_model ("progs/w_mp9.mdl"); - precache_model ("progs/w_mp5.mdl"); precache_model ("progs/w_jackhammer.mdl"); precache_model ("progs/w_rangem.mdl"); precache_model ("progs/w_g11.mdl"); @@ -1774,7 +1785,7 @@ void() worldspawn = precache_sound ("ogre/ak74.wav"); precache_sound ("ogre/ak47.wav"); precache_sound ("weapons/usp.wav"); - precache_sound ("weapons/glock.wav"); + precache_sound ("weapons/10mmpistol.wav"); precache_sound ("weapons/auto2.wav"); precache_sound ("weapons/ak112.wav"); precache_sound ("weapons/amr.wav"); @@ -1794,8 +1805,7 @@ void() worldspawn = precache_sound ("weapons/citykiller.wav"); precache_sound ("weapons/laser.wav"); precache_sound ("weapons/laserburst1.wav"); - precache_sound ("weapons/plasma-1.wav"); - precache_sound ("weapons/plasma-2.wav"); + precache_sound ("weapons/blaster.wav"); precache_sound ("weapons/moonlight-1.wav"); precache_sound ("weapons/moonlight-2.wav"); precache_sound ("weapons/needler.wav"); diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index 2313a4588..5f7922cdf 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -50,6 +50,8 @@ $frame paine29 paine30 $frame cruc_1 cruc_2 cruc_3 cruc_4 cruc_5 cruc_6 +$frame rise1 rise2 rise3 + float SPAWN_CRUCIFIED = 1; //============================================================================= @@ -64,7 +66,9 @@ if ((pointcontents(self.origin) <= -2) && (self.owner.netname == "lair")) remove(self); } else if ((pointcontents(self.origin) <= -2)) +{ remove(self); +} }; void() zombie_stand2 =[ $stand2, zombie_stand3 ] {ai_stand();}; @@ -145,6 +149,35 @@ void() zombie_run16 =[ $run16, zombie_run17 ] {ai_run(4);}; void() zombie_run17 =[ $run17, zombie_run18 ] {ai_run(4);}; void() zombie_run18 =[ $run18, zombie_run1 ] {ai_run(8);}; + + +void() zombie_rise1 =[ $rise1, zombie_rise2 ] {}; +void() zombie_rise2 =[ $rise2, zombie_rise3 ] {}; +void() zombie_rise3 =[ $rise3, zombie_rise4 ] {}; +void() zombie_rise4 =[ $paine12, zombie_rise5 ] {}; +void() zombie_rise5 =[ $paine13, zombie_rise6 ] {}; +void() zombie_rise6 =[ $paine14, zombie_rise7 ] {}; +void() zombie_rise7 =[ $paine15, zombie_rise8 ] {}; +void() zombie_rise8 =[ $paine16, zombie_rise9 ] {}; +void() zombie_rise9 =[ $paine17, zombie_rise10 ] {}; +void() zombie_rise10 =[ $paine18, zombie_rise11 ] {}; +void() zombie_rise11 =[ $paine19, zombie_rise12 ] {}; +void() zombie_rise12 =[ $paine20, zombie_rise13 ] {}; +void() zombie_rise13 =[ $paine21, zombie_rise14 ] {}; +void() zombie_rise14 =[ $paine22, zombie_rise15 ] {}; +void() zombie_rise15 =[ $paine23, zombie_rise16 ] {}; +void() zombie_rise16 =[ $paine24, zombie_rise17 ] {}; +void() zombie_rise17 =[ $paine25, zombie_rise18 ] {}; +void() zombie_rise18 =[ $paine26, zombie_rise19 ] {}; +void() zombie_rise19 =[ $paine27, zombie_rise20 ] {}; +void() zombie_rise20 =[ $paine28, zombie_rise21 ] {}; +void() zombie_rise21 =[ $paine29, zombie_rise22 ] {}; +void() zombie_rise22 =[ $paine30, zombie_stand1 ] { + + +}; + + /* ============================================================================= @@ -737,46 +770,27 @@ void () spawn_ghoul_copy = local entity te, ze; local vector jojo; local float zomc, pcount, loadzombie; - local string finder, waterlev, diag; + local string finder, waterlev, diag, errmsg; local vector stuff; self.think = spawn_ghoul_copy; - self.nextthink = time + 9 + random()*8; - - + self.nextthink = time + 7 + random()*7; if (total_players == 2) - self.nextthink = time + 9 + random()*5; - - if (total_players == 3) - self.nextthink = time + 8 + random()*4; - - if (total_players == 4) - self.nextthink = time + 6 + random()*2; - + self.nextthink = time + 5 = random()*5; stuff = self.origin; - loadzombie = 0; + loadzombie = 1; - te = findradius (self.origin, 1500); - while (te) - { - if (te.classname == "player") - loadzombie = 1; - - te = te.chain; - } - - - te = findradius (self.origin, 250); + te = findradius (self.origin, 900); while (te) { if (te.classname == "player") @@ -786,15 +800,13 @@ void () spawn_ghoul_copy = } - if (loadzombie == 0) + + + if (loadzombie == 1) return; - - - - - ze = find (world, netname, "ghoul"); + ze = find (world, netname, "feral ghoul"); zomc = 0; pcount = 0; @@ -816,13 +828,12 @@ void () spawn_ghoul_copy = ze = find(ze, classname, "player"); } - - if (zomc > 60*pcount) + if (zomc > (30 + (30*pcount))) return; zomc = 0; - +/* te = findradius (self.origin, 1000); while (te) { @@ -832,18 +843,20 @@ void () spawn_ghoul_copy = te = te.chain; } - if (zomc >= 25) - return; + if (zomc >= 15+(15*pcount)) + return;*/ zombie = spawn (); zombie.owner = self; self = zombie; self.solid = SOLID_SLIDEBOX; + self.frame = 115; self.movetype = MOVETYPE_STEP; setmodel (self, "progs/ghoul.mdl"); setsize (self, '-8 -8 -24', '8 8 24'); self.health = 90; + self.takedamage = DAMAGE_AIM; self.netname = "feral ghoul"; self.max_health = self.health; self.th_stand = zombie_stand1; @@ -899,18 +912,29 @@ void () spawn_ghoul_copy = te = findradius (self.origin, 30); while (te) { - if (te.classname == "player" || te.classname == "monster" && te.health > 0) + if (te != self) { - remove(self); - return; + if (te.classname == "player" || te.classname == "monster" && te.health > 0) + { + remove(self); + return; + } } - te = te.chain; } + self.takedamage = DAMAGE_AIM; + + self.ideal_yaw = self.angles * '0 1 0'; + if (!self.yaw_speed) + self.yaw_speed = 20; + self.view_ofs = '0 0 25'; + self.use = monster_use; + + self.flags = self.flags | FL_MONSTER; self.classname = "monster"; - walkmonster_start_go (); + zombie_rise1(); }; @@ -975,9 +999,8 @@ void() monster_zombie = setsize (lair, '-8 -8 -24', '8 8 24'); lair.netname = "lair"; lair.classname = "lair"; - lair.nextthink = time + 30; lair.think = spawn_ghoul_copy; - lair.nextthink = time + 30; + lair.nextthink = time + 1*random(); } } From 596a0d640414b24f56f826c62b4b55d9c65e1bb4 Mon Sep 17 00:00:00 2001 From: Magnus Date: Sat, 21 Nov 2009 02:22:41 +0000 Subject: [PATCH 33/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3470 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/ai.qc | 27 +- quakec/fallout2/boss.qc | 2 +- quakec/fallout2/client.qc | 366 ++++++++-------- quakec/fallout2/cmds.qc | 436 +------------------ quakec/fallout2/combat.qc | 622 ++------------------------- quakec/fallout2/csqc/invent.qc | 201 ++++----- quakec/fallout2/csqc/main.qc | 42 +- quakec/fallout2/defs.qc | 20 +- quakec/fallout2/dog.qc | 36 -- quakec/fallout2/inventory.qc | 167 +++++++- quakec/fallout2/items.qc | 2 +- quakec/fallout2/misc.qc | 2 +- quakec/fallout2/mod_buy.qc | 556 ------------------------ quakec/fallout2/player.qc | 46 ++ quakec/fallout2/shambler.qc | 7 +- quakec/fallout2/soldier.qc | 8 +- quakec/fallout2/weapons.qc | 762 +++++++++++---------------------- quakec/fallout2/world.qc | 72 ++-- 18 files changed, 870 insertions(+), 2504 deletions(-) diff --git a/quakec/fallout2/ai.qc b/quakec/fallout2/ai.qc index 4f1c3dfec..7508a7d0e 100644 --- a/quakec/fallout2/ai.qc +++ b/quakec/fallout2/ai.qc @@ -366,8 +366,11 @@ float() FindTarget = - if (self.charmed == 1) + if (self.charmed >= 1) + { + self.charmed = self.charmed - 1; return FALSE; + } if (sight_entity_time >= time - 0.1 && !(self.spawnflags & 3) ) @@ -407,8 +410,6 @@ float() FindTarget = if (client.team == 0)//client connecting return FALSE; - if (client.class == 0)//client connecting - return FALSE; if (r == RANGE_NEAR) @@ -434,27 +435,13 @@ float() FindTarget = self.alert = self.alert - 1; } - //if your sneak level is 70% or higher you will never get caught - //alert guards get the full 100% random roll, otherwise 90% - if (self.alert == 0) - x = random()*80; - else - x = random()*100; - if (client.sneak >= 70 && client.velocity == '0 0 0') - { - sprint(client, 2, self.netname); - sprint(client, 2, " failed to detect you.\n"); - } - else if (client.sneak > 0 && (x > client.sneak + 15)) + + if ((client.sneak <= 1) && (client.sneak > 0)) { sprint(client, 2, "you've been detected!\n"); client.sneak = 0; } - else if (client.sneak > 0) - { - sprint(client, 2, self.netname); - sprint(client, 2, " failed to detect you.\n"); - } + } if (client.sneak > 0)//sneaking players are invisible diff --git a/quakec/fallout2/boss.qc b/quakec/fallout2/boss.qc index ed16553ca..98524d37b 100644 --- a/quakec/fallout2/boss.qc +++ b/quakec/fallout2/boss.qc @@ -41,7 +41,7 @@ void() boss_face = { // go for another player if multi player - if (self.enemy.health <= 0 || random() < 0.02 || self.enemy.class == 0 || self.enemy.team == 0) + if (self.enemy.health <= 0 || random() < 0.02 || self.enemy.team == 0) { self.enemy = find(self.enemy, classname, "player"); if (!self.enemy) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 8dcbd0051..fd116ec8d 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -44,7 +44,16 @@ void() SetChangeParms = if (!self.current_slot) //changing without spawning? DecodeLevelParms(); //make sure we have our inventory! - + if (self.supertime > 0) + { + self.supertime = 0; + sprint(self, 2, "you are now back to your normal self.\n"); + self.skill_combat = self.skill_combat - 20; + self.skill_doctor = self.skill_doctor - 20; + self.skill_sneak = self.skill_sneak - 20; + self.skill_science = self.skill_science - 20; + self.skill_speech = self.skill_speech - 20; + } self.items = self.items - (self.items & (IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) ); @@ -54,13 +63,12 @@ void() SetChangeParms = parm6 = self.skill_doctor; parm7 = self.skill_sneak; parm14 = self.skill_science; - + parm16 = self.skill_speech; parm8 = self.ammo_shells; parm9 = self.perk1; parm10 = self.perk2; - parm16 = self.current_slot; parm17 = self.islot1; parm18 = self.islot2; parm19 = self.islot3; @@ -102,7 +110,7 @@ void() SetNewParms = parm5 = 0; parm6 = 0; parm7 = 0; - parm8 = 200; + parm8 = 0; parm9 = 0; parm10 = 0; parm11 = 0; @@ -138,15 +146,14 @@ void() DecodeLevelParms = self.skill_doctor = parm6; self.skill_sneak = parm7; self.skill_science = parm14; + self.skill_speech = parm16; self.ammo_shells = parm8; self.perk1 = parm9; self.perk2 = parm10; - self.class = 1; - if (parm16 > 0) - self.current_slot = parm16; + self.current_slot = 1; self.islot1 = parm17; self.islot2 = parm18; @@ -616,17 +623,17 @@ void() PutClientInServer = DecodeLevelParms (); - if (self.current_slot == 0) + if (self.islot1 == 0 && self.islot2 == 0 && self.islot3 == 0 && self.islot4 == 0 && self.islot5 == 0 && self.islot6 == 0 && self.islot7 == 0 && self.islot8 == 0 && self.islot9 == 0 && self.islot10 == 0 && self.islot11 == 0 && self.islot12 == 0) { self.islot1 = SlotVal(IID_WP_GLOCK, 15); self.islot2 = SlotVal(IID_WP_KNIFE, 1); self.islot3 = SlotVal(IID_ARM_LEATHER, 1); - self.islot5 = SlotVal(IID_CHEM_STIMPACK, 3); - self.islot7 = SlotVal(IID_AM_10MM, 30); + self.islot5 = SlotVal(IID_CHEM_STIMPACK, 5); + self.islot7 = SlotVal(IID_AM_10MM, 70); self.islot8 = 0; self.islot9 = 0; self.islot10 = 0; - self.islot11 = 0; + self.islot11 = SlotVal(IID_CHEM_MEDICALBAG, 25); self.islot12 = 0; self.islot13 = 0; self.islot14 = 0; @@ -657,7 +664,7 @@ void() PutClientInServer = self.fixangle = TRUE; // turn this way immediately - self.max_health = 100 + self.skill_combat; + self.max_health = 80 + (self.skill_combat*4) + (self.skill_doctor*2) + (self.skill_sneak*2) + (self.skill_speech); self.equipment_slot = 0; @@ -758,16 +765,14 @@ void() PutClientInServer = } W_SetCurrentAmmo(); - stuffcmd(self, "sizeup\n"); - stuffcmd(self, "sizeup\n"); + stuffcmd(self, "impulse 2\n"); + stuffcmd(self, "impulse 1\n"); if (world.model == "maps/r_bunker.bsp") stuffcmd(self, "play music/afterglow\n"); else if (world.map_obj == OBJ_DEADTOWN) stuffcmd(self, "play music/necropolis\n"); - else - stuffcmd(self, "play music/raiders\n"); }; @@ -1212,7 +1217,7 @@ float(entity targ) check_fov = vec = normalize (self.origin - targ.origin); dot = vec * v_forward; - if ( dot > 0.9) + if ( dot > 0.5) { return TRUE; } @@ -1220,6 +1225,19 @@ float(entity targ) check_fov = return FALSE; }; +float(entity targ) check_fov_num = +{ + local vector vec; + local float dot; + + makevectors (targ.angles); + vec = normalize (self.origin - targ.origin); + dot = vec * v_forward; + + + return dot; +}; + float(entity targ) check_fov_side = { local vector vec; @@ -1241,80 +1259,139 @@ float(entity targ) check_fov_side = void() SneakLevel = { - local float sn, st, front, r, q; - local entity te; + local float sn, st, front, r, q, x, b, c, y, z, t; + local entity te, ze; local string report; - + front = 0; - - te = findradius(self.origin, 1500); - while (te) - { - if (visible(te) && te.classname == "monster" && check_fov(te)) - r = vlen(self.origin - te.origin); - - - te = te.chain; - } + q = 1200; + q = q - (self.skill_sneak*50); - sn = 90 + self.skill_sneak/2; + sn = 99; + self.sneak = 99; - //sneaking along a wall increases chance by 2% - makevectors(self.angles); - if (pointcontents (self.origin + v_right*64) == CONTENT_SOLID) - sn = sn + 2; - else if (pointcontents (self.origin - v_right*64) == CONTENT_SOLID) - sn = sn + 2; - else if (pointcontents (self.origin + v_forward*64) == CONTENT_SOLID) - sn = sn + 2; - else if (pointcontents (self.origin - v_forward*64) == CONTENT_SOLID) - sn = sn + 2; - //duck or prone gives a 2% bonus to stealth - if (self.position > 0) - sn = sn + 2; + //light level gives a bonus/penalty to stealth + b = light_level(self.origin); + + if (b <= 50) + q = q - (200); + if (b >= 200) + q = q + (200); + + + //standing still gives a bonus to stealth + if (self.velocity == '0 0 0') + q = q - (200); + + + //stealthboy gives a bonus to stealth + st = ToIID(self.islot4); + if (st == IID_EQUIP_STEALTHBOY) + q = q - (100); + + //combat armor gives a penalty to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_COMBAT || st == IID_ARM_SEVA) + q = q + (100); + + //metal armor gives a large penalty to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_METAL) + q = q + (200); + + //power armor gives a huge penalty to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_LPOWER) + q = q + (300); + + //tesla armor gives a massive penalty to stealth + st = ToIID(self.islot3); + if (st == IID_ARM_TESLA) + q = q + (400); //walking in front of a monster at close range is very bad //at longer ranges it isn't so bad to do so //thus even healer and barbarian types can sneak if they do so smartly - if (r > 0 && r <= 600) - { - r = 600 - r; - q = 3 + (self.skill_sneak/2); - //stealthboy gives a bonus to sneak range - st = ToIID(self.islot4); - if (st == IID_EQUIP_STEALTHBOY) - q = 3 + (self.skill_sneak/2) + 3; - sn = sn - r/q; + c = 0; + + te = findradius(self.origin, q); + while (te) + { + if (visible(te) && te.classname == "monster" && (check_fov_num(te) > 0.5) && te.health > 3) + { + if (c == 0) + { + + r = vlen(self.origin - te.origin); + t = q * (check_fov_num(te)); + t = t * (check_fov_num(te)); + t = t * (check_fov_num(te)); + y = r / t; + ze = te; + c = 1; +/* + bprint(2, "test1: "); + bprint(2, ftos(r)); + bprint(2, " "); + bprint(2, ftos(q)); + bprint(2, " "); + bprint(2, ftos(t)); + bprint(2, "\n");*/ + } + else + { + + r = vlen(self.origin - te.origin); + t = q * (check_fov_num(te)); + t = t * (check_fov_num(te)); + t = t * (check_fov_num(te)); + z = r / t; + /* + bprint(2, "test2: "); + bprint(2, ftos(r)); + bprint(2, " "); + bprint(2, ftos(q)); + bprint(2, " "); + bprint(2, ftos(t)); + bprint(2, "\n");*/ + + if (z < y) + { + ze = te; + y = z; + } + + } + } + + te = te.chain; } - //combat armor gives a penalty to stealth - st = ToIID(self.islot3); - if (st == IID_ARM_COMBAT || st == IID_ARM_SEVA) - sn = sn - 5; + if (r > 0 && r <= q) + { + sn = 150 * (r/t); + sn = sn - 50; + } - //metal armor gives a large penalty to stealth - st = ToIID(self.islot3); - if (st == IID_ARM_METAL) - sn = sn - 10; + if (self.invistime > 0) + { + bprint(2, "invistime\n"); + self.sneak = 99; + } - //power armor gives a huge penalty to stealth - st = ToIID(self.islot3); - if (st == IID_ARM_LPOWER) - sn = sn - 25; - //tesla armor gives a massive penalty to stealth - st = ToIID(self.islot3); - if (st == IID_ARM_TESLA) - sn = sn - 40; - - if (sn <= 5) - sn = 5; + if (sn <= 1 && sn > 0) + { + sprint(self, 2, "you've been detected!\n"); + self.sneak = 0; + return; + } if (sn >= 99) sn = 99; @@ -1526,23 +1603,39 @@ void() PlayerPreThink = if (self.score < 200) { - if ((self.skill_combat + self.skill_doctor + self.skill_sneak + self.skill_science) <= 10) + if ((self.skill_combat + self.skill_doctor + self.skill_sneak + self.skill_science + self.skill_speech) <= 8) { self.score = 200; - sound (self, CHAN_BODY, "misc/secret.wav", 1, ATTN_NORM); + sound (self, CHAN_BODY, "misc/levelup.wav", 1, ATTN_NORM); + sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n"); + } + } + else if (self.score > 200) + { + if ((self.skill_combat + self.skill_doctor + self.skill_sneak + self.skill_science + self.skill_speech) > 8) + { + self.score = 200; + + sound (self, CHAN_BODY, "misc/levelup.wav", 1, ATTN_NORM); sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n"); } } - //perk1timer and perk2timer are "cooldowns" for each perk if (self.perk1timer > 0) self.perk1timer = self.perk1timer - 1; - if (self.perk2timer > 0) self.perk2timer = self.perk2timer - 1; + //speech skill provides faster perk regeneration + if (random()*40 < self.skill_speech) + { + if (self.perk1timer > 0) + self.perk1timer = self.perk1timer - 1; + if (self.perk2timer > 0) + self.perk2timer = self.perk2timer - 1; + } self.shadowtime = time_left; @@ -1558,13 +1651,36 @@ void() PlayerPreThink = PositionControl(); WeightControl(); ArmorCheck(); - SneakLevel(); + if (self.sneak > 0) + SneakLevel(); self.accept = 0; self.endinfo1 = rescue; self.endinfo2 = dead_hostage; self.endinfo3 = hostages; + if (self.invistime > 1) + self.invistime = self.invistime -1; + else if (self.invistime == 1) + { + self.invistime = 0; + sound (self, CHAN_BODY, "items/inv2.wav", 1, ATTN_NORM); + sprint(self, 2, "your disguise wears off.\n"); + } + + if (self.supertime > 1) + self.supertime = self.supertime -1; + else if (self.supertime == 1) + { + self.supertime = 0; + sound (self, CHAN_BODY, "items/damage2.wav", 1, ATTN_NORM); + sprint(self, 2, "you are now back to your normal self.\n"); + self.skill_combat = self.skill_combat - 20; + self.skill_doctor = self.skill_doctor - 20; + self.skill_sneak = self.skill_sneak - 20; + self.skill_science = self.skill_science - 20; + self.skill_speech = self.skill_speech - 20; + } local float lgrip, rgrip; @@ -1652,8 +1768,6 @@ void() PlayerPreThink = stuffcmd(self, "play music/afterglow\n"); else if (world.map_obj == OBJ_DEADTOWN) stuffcmd(self, "play music/necropolis\n"); - else - stuffcmd(self, "play music/raiders\n"); self.musictimer = 1; } @@ -1809,7 +1923,7 @@ void() CheckPowerups = else { self.items = self.items - (self.items & IT_INVISIBILITY); - if (self.ghost == 1 || self.class == 0 || self.team == 0) + if (self.ghost == 1 || self.team == 0) { self.modelindex = modelindex_gone; return; @@ -2250,12 +2364,12 @@ void(entity targ, entity attacker) ClientObituary = if (attacker.critical == 3) //headshot { bprint (PRINT_MEDIUM, "X "); - attacker.score = attacker.score + 25; + attacker.score = attacker.score + 1; } if (attacker.critical == 777) //through the wall { bprint (PRINT_MEDIUM, "% "); - attacker.score = attacker.score + 50; + attacker.score = attacker.score + 5; } if (attacker.critical == 778) //wall headshot { @@ -2265,7 +2379,7 @@ void(entity targ, entity attacker) ClientObituary = if (attacker.velocity_z != 0) { bprint (PRINT_MEDIUM, "@ "); - attacker.score = attacker.score - 50; + attacker.score = attacker.score - 2; } // if (attacker.current_slot == 1 && attacker.mag1 == 0) // bprint (PRINT_MEDIUM, "! "); @@ -2575,89 +2689,5 @@ void(entity targ, entity attacker) ClientObituary = void() Identify = { - local string c1, c2, c3, c5; - local float tmp; - - makevectors (self.v_angle); - 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 == 1) - c1 = "\nfirst aid\n"; - else if (trace_ent.class == 2) - c1 = "\nstealth\n"; - else if (trace_ent.class == 3) - c1 = "\ncombat\n"; - else if (trace_ent.class == 4) - c1 = "\nscience\n"; - else - c1 = "\n"; - - if (trace_ent.health <= 0) - c2 = "dead"; - c2 = ftos (trace_ent.health); - c3 = GetItemName (ToIID(ItemInSlot(trace_ent, trace_ent.current_slot))); - - if (trace_ent.islot3 == 0) - c5 = "no armor"; - else - c5 = GetItemName(ToIID(trace_ent.islot3)); - - centerprint (self, trace_ent.netname, c1, c2, "\n", c3, "\n", c5); - } - if (trace_ent.classname == "robowolf" && self.currentmenu == "none") - { - c1 = "robo-fang\n"; - c2 = "robot construct\nowned by "; - c3 = trace_ent.track.netname; - if (trace_ent.team == self.team) - c5 = "\nfriendly\n"; - else - c5 = "\nhostile\n"; - - centerprint (self, trace_ent.netname, c1, c2, c3, c5, "", ""); - } - if (trace_ent.classname == "station" && self.currentmenu == "none") - { - c1 = trace_ent.netname; - if (self.armortype == 0) - c2 = "uncompleted"; - else if (trace_ent.health >= trace_ent.max_health) - c2 = "online"; - else if (trace_ent.health >= trace_ent.max_health*0.75) - c2 = "banged up"; - else if (trace_ent.health >= trace_ent.max_health*0.50) - c2 = "damaged"; - else - c2 = "almost destroyed"; - - c3 = trace_ent.track.netname; - - centerprint (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_LEATHER) - c2 = "lightly armored"; - else - c2 = GetItemName(ToIID(trace_ent.islot3)); - - if (trace_ent.weapon == 1) - c3 = "rifle"; - if (trace_ent.weapon == 2) - c3 = "pistol"; - if (trace_ent.weapon == 3) - c3 = "shotgun"; - if (trace_ent.weapon == 4) - c3 = "smg"; - if (trace_ent.weapon >= 5) - c3 = "assault rifle"; - - centerprint (self, trace_ent.netname, "\n", c1, "\n", c2, "\n", c3); - } +return; }; diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 07b998bd5..e4dc1f7b0 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -164,18 +164,6 @@ void(string arg1) Cmd_InvUse = return; } - if (iid == IID_BUILD_MRAMMO || - iid == IID_BUILD_SHIELDGEN || - iid == IID_BUILD_AUTODOC || - iid == IID_BUILD_ROBOFANG || - iid == IID_BUILD_TTURRET || - iid == IID_BUILD_RTURRET || - iid == IID_BUILD_GTURRET) - { - if (spawn_station(iid)) - DecreaseDestroySlot(slotno); - return; - } if (iid == IID_EQUIP_CLIMBINGGEAR) { @@ -210,30 +198,9 @@ void(string arg1) Cmd_InvUse = Sneak(); return; } - if (iid == IID_EQUIP_SILENCER) - { - AttachSilencer(); - return; - } - if (iid == IID_WP_WRENCH) - { - FireToolkit(); - return; - } - if (iid == IID_EQUIP_HOVERBOOTS) - { - if (self.equipment_slot == slotno) - { - self.equipment_slot = 0; - sprint(self, PRINT_HIGH, "Hoverboots deactivated\n"); - } - else - { - self.equipment_slot = slotno; - sprint(self, PRINT_HIGH, "Hoverboots activated\n"); - } - return; - } + + + sprint(self, PRINT_HIGH, "Don't know how to 'use' item\n"); }; @@ -281,6 +248,8 @@ void(string arg1) Cmd_GainLevel = self.skill_sneak = self.skill_sneak + 1; else if (arg1 == "science") self.skill_science = self.skill_science + 1; + else if (arg1 == "speech") + self.skill_speech = self.skill_speech + 1; }; void(string arg1, string arg2) Cmd_GainPerk = @@ -401,6 +370,8 @@ void(string arg1) Cmd_InvBuy = iid = ToIID(item); amount = ToStatus(item); money = GetBaseValue(iid); + money = ceil(money * (1 - (self.skill_speech/30))); + if (self.ammo_shells < money) { sprint(self, 2, "not enough money.\n"); @@ -456,7 +427,8 @@ void(string arg1) Cmd_InvSell = SetItemSlot(self, slotno, 0); x = GetBaseValue(iid); - x = x / 5; + x = ceil(x * (1 + (self.skill_speech/30))); + x = ceil(x / 5); y = ftos(x); z = GetItemName(iid); @@ -765,390 +737,6 @@ void(string arg1) Cmd_InvMix = } }; -void(string arg1) Cmd_InvCreate = -{ - local float it, iid; - local float slotno, q, w, x, y, z; - local float weap; - - if (arg1 == "flash") - { - - x = SlotOfItem(self, IID_MISC_NUKACOLA); - if (x == 0) - { - sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals + aerosol can\n"); - return; - } - - y = SlotOfItem(self, IID_MISC_CHEMICALS); - if (y == 0) - { - sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals + aerosol can\n"); - return; - } - - z = SlotOfItem(self, IID_MISC_AEROSOL); - if (z == 0) - { - sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals + aerosol can\n"); - return; - } - - DecreaseDestroySlot(x); - DecreaseDestroySlot(y); - DecreaseDestroySlot(z); - - if ((random()<0.50) && (self.class == 1)) - { - sprint(self, PRINT_MEDIUM, "you failed to create a flash bomb.\n"); - return; - } - if ((random()<0.25) && (self.class == 2)) - { - sprint(self, PRINT_MEDIUM, "you failed to create a flash bomb.\n"); - return; - } - if ((random()<0.75) && (self.class == 3)) - { - sprint(self, PRINT_MEDIUM, "you failed to create a flash bomb.\n"); - return; - } - - TryGiveStackable(self, IID_GREN_FLASH, 1); - sprint(self, PRINT_MEDIUM, "flash bomb created.\n"); - } - if (arg1 == "grenade") - { - x = SlotOfItem(self, IID_MISC_RDXCRYSTAL); - if (x == 0) - { - sprint(self, PRINT_MEDIUM, "you need rdx crystals, chemicals, aerosol can\n"); - return; - } - - y = SlotOfItem(self, IID_MISC_CHEMICALS); - if (y == 0) - { - sprint(self, PRINT_MEDIUM, "you need rdx crystals, chemicals, aerosol can\n"); - return; - } - - z = SlotOfItem(self, IID_MISC_AEROSOL); - if (z == 0) - { - sprint(self, PRINT_MEDIUM, "you need rdx crystals, chemicals, aerosol can\n"); - return; - } - - DecreaseDestroySlot(x); - DecreaseDestroySlot(y); - DecreaseDestroySlot(z); - - if ((random()<0.75) && (self.class == 1)) - { - sprint(self, PRINT_MEDIUM, "you failed to create a grenade.\n"); - return; - } - if ((random()<0.75) && (self.class == 2)) - { - sprint(self, PRINT_MEDIUM, "you failed to create a grenade.\n"); - return; - } - if ((random()<0.75) && (self.class == 3)) - { - sprint(self, PRINT_MEDIUM, "you failed to create a grenade.\n"); - return; - } - - TryGiveStackable(self, IID_GREN_FRAG, 1); - sprint(self, PRINT_MEDIUM, "homemade bomb created.\n"); - } - if (arg1 == "silencer") - { - x = SlotOfItem(self, IID_MISC_DUCKTAPE); - if (x == 0) - { - sprint(self, PRINT_MEDIUM, "you need junk + aerosol can + duck tape\n"); - return; - } - y = SlotOfItem(self, IID_MISC_JUNK); - if (y == 0) - { - sprint(self, PRINT_MEDIUM, "you need junk + aerosol can + duck tape\n"); - return; - } - z = SlotOfItem(self, IID_MISC_AEROSOL); - if (z == 0) - { - sprint(self, PRINT_MEDIUM, "you need junk + aerosol can + duck tape\n"); - return; - } - - DecreaseDestroySlot(x); - DecreaseDestroySlot(y); - DecreaseDestroySlot(z); - - if ((random()<0.25) && (self.class == 1)) - { - sprint(self, PRINT_MEDIUM, "you failed to create a silencer.\n"); - return; - } - if ((random()<0.10) && (self.class == 2)) - { - sprint(self, PRINT_MEDIUM, "you failed to create a silencer.\n"); - return; - } - if ((random()<0.50) && (self.class == 3)) - { - sprint(self, PRINT_MEDIUM, "you failed to create a silencer.\n"); - return; - } - AddNonStackable(self, IID_EQUIP_SILENCER, 1); - sprint(self, PRINT_MEDIUM, "silencer created.\n"); - } - if (arg1 == "stun") - { - x = SlotOfItem(self, IID_MISC_NUKACOLA); - if (x == 0) - { - sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals\n"); - return; - } - - y = SlotOfItem(self, IID_MISC_CHEMICALS); - if (y == 0) - { - sprint(self, PRINT_MEDIUM, "you need nukacola + chemicals\n"); - return; - } - DecreaseDestroySlot(x); - DecreaseDestroySlot(y); - - if ((random()<0.40) && (self.class < 4)) - { - sprint(self, PRINT_MEDIUM, "you failed to create a stun grenade.\n"); - return; - } - - TryGiveStackable(self, IID_GREN_STUN, 1); - sprint(self, PRINT_MEDIUM, "stun grenade created.\n"); - } - if (arg1 == "extender") - { - y = SlotOfItem(self, IID_MISC_STEELPIPE); - if (y == 0) - { - sprint(self, PRINT_MEDIUM, "you need steel pipe + duck tape\n"); - return; - } - - z = SlotOfItem(self, IID_MISC_DUCKTAPE); - if (z == 0) - { - sprint(self, PRINT_MEDIUM, "you need junk, aerosol can\n"); - return; - } - - DecreaseDestroySlot(y); - DecreaseDestroySlot(z); - - AddNonStackable(self, IID_EQUIP_EXTENDER, 1); - sprint(self, PRINT_MEDIUM, "barrel extender created.\n"); - } - if (arg1 == "xray") - { - y = SlotOfItem(self, IID_MISC_LCD); - if (y == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - y = SlotOfItem(self, IID_MISC_CIRCUITBOARD); - if (y == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - - z = SlotOfItem(self, IID_MISC_GUM); - if (z == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - q = SlotOfItem(self, IID_MISC_XRAYTUBE); - if (q == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - w = SlotOfItem(self, IID_MISC_COPPERWIRE); - if (w == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - - DecreaseDestroySlot(q); - DecreaseDestroySlot(w); - DecreaseDestroySlot(x); - DecreaseDestroySlot(y); - DecreaseDestroySlot(z); - - if ((random()<0.90) && (self.class < 4)) - { - sprint(self, PRINT_MEDIUM, "you failed to create an x-ray device.\n"); - return; - } - - AddNonStackable(self, IID_EQUIP_XRAY, 1); - sprint(self, PRINT_MEDIUM, "x-ray device created!\n"); - } - if (arg1 == "modify") - { - weap = ToIID(self.(SlotField(self.current_slot))); - - if (weap == IID_WP_PULSERIFLE) - { - y = SlotOfItem(self, IID_MISC_DUCKTAPE); - if (y == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - x = SlotOfItem(self, IID_MISC_CIRCUITBOARD); - if (x == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - z = SlotOfItem(self, IID_MISC_NUKACOLA); - if (z == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - q = SlotOfItem(self, IID_MISC_XRAYTUBE); - if (q == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - w = SlotOfItem(self, IID_MISC_COPPERWIRE); - if (w == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - - DecreaseDestroySlot(q); - DecreaseDestroySlot(w); - DecreaseDestroySlot(x); - DecreaseDestroySlot(y); - DecreaseDestroySlot(z); - - if (ToIID(self.islot1) == IID_WP_PULSERIFLE) - SetItemSlot(self, 1, SlotVal(IID_WP_TURBOPLASMA, 40)); - else if (ToIID(self.islot2) == IID_WP_PULSERIFLE) - SetItemSlot(self, 2, SlotVal(IID_WP_TURBOPLASMA, 40)); - - - if ((random()<0.25)) - { - sprint(self, PRINT_MEDIUM, "you try to modify your plasma rifle by hotwiring\n"); - sprint(self, PRINT_MEDIUM, "the bolt carrier and venting off excess gasses \n"); - sprint(self, PRINT_MEDIUM, "but you end up destroying it...\n"); - return; - } - AddNonStackable(self, IID_WP_TURBOPLASMA, 1); - sprint(self, PRINT_MEDIUM, "turbo plasma rifle created\n"); - } - if (weap == IID_WP_AK112) - { - y = SlotOfItem(self, IID_MISC_DUCKTAPE); - if (y == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - x = SlotOfItem(self, IID_MISC_JUNK); - if (x == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - z = SlotOfItem(self, IID_MISC_AEROSOL); - if (z == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - w = SlotOfItem(self, IID_MISC_COPPERWIRE); - if (w == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - - DecreaseDestroySlot(y); - DecreaseDestroySlot(w); - DecreaseDestroySlot(x); - DecreaseDestroySlot(z); - - if (ToIID(self.islot1) == IID_WP_AK112) - SetItemSlot(self, 1, SlotVal(IID_WP_AK112_M, 50)); - else if (ToIID(self.islot2) == IID_WP_AK112) - SetItemSlot(self, 2, SlotVal(IID_WP_AK112_M, 50)); - - sprint(self, PRINT_MEDIUM, "created expanded magazine for ak-112\n"); - } - if (weap == IID_WP_DEAGLE) - { - y = SlotOfItem(self, IID_MISC_DUCKTAPE); - if (y == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - x = SlotOfItem(self, IID_MISC_JUNK); - if (x == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - z = SlotOfItem(self, IID_MISC_AEROSOL); - if (z == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - w = SlotOfItem(self, IID_MISC_COPPERWIRE); - if (w == 0) - { - sprint(self, PRINT_MEDIUM, "you need the proper ingredients...\n"); - return; - } - - DecreaseDestroySlot(y); - DecreaseDestroySlot(w); - DecreaseDestroySlot(x); - DecreaseDestroySlot(z); - - if (ToIID(self.islot1) == IID_WP_DEAGLE) - SetItemSlot(self, 1, SlotVal(IID_WP_DEAGLE_M, 10)); - else if (ToIID(self.islot2) == IID_WP_DEAGLE) - SetItemSlot(self, 2, SlotVal(IID_WP_DEAGLE_M, 10)); - - sprint(self, PRINT_MEDIUM, "created expanded magazine for deagle\n"); - } - else - { - sprint(self, PRINT_MEDIUM, "can't modify currently held weapon.\n"); - return; - } - } -}; void(string arg1, string arg2) Cmd_InvSwap = { @@ -1264,12 +852,6 @@ void(string line) SV_ParseClientCommand = return; Cmd_InvMix(argv(1)); } - else if (cmd == "create") - { - if (self.deadflag) - return; - Cmd_InvCreate(argv(1)); - } else if (cmd == "invswap") { if (self.deadflag || self.current_slot==0) diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 71a0ff027..3daab2280 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -103,6 +103,27 @@ void(entity targ, entity attacker) Killed = }; +void(entity targ, entity attacker) ArmorNoise = +{ + local float r; + + if (targ.classname != "player" && targ.classname != "monster") + return; + + if (attacker.classname != "player" && attacker.classname != "monster") + return; + + r = random(); + + if (r <= 0.33) + sound (targ, CHAN_WEAPON, "contact/armor1.wav", 1, ATTN_NORM); + else if (r <= 0.67) + sound (targ, CHAN_WEAPON, "contact/armor2.wav", 1, ATTN_NORM); + else + sound (targ, CHAN_WEAPON, "contact/armor3.wav", 1, ATTN_NORM); +}; + + /* ============ T_Damage @@ -137,6 +158,12 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (targ.classname == "player") damage = floor(damage * 0.60);*/ + + if (challenge_rating <= 6 && attacker.classname == "monster") + damage = damage * 0.70; + if (challenge_rating <= 9 && attacker.classname == "monster") + damage = damage * 0.80; + if (targ.radiation > 0) { radpenalty = 1 + (targ.radiation/200); @@ -303,7 +330,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (attacker.classname == "monster") { - if (random()*100>= 98) + if (random()*100>= 95) attacker.critical = 3; else attacker.critical = 0; @@ -314,33 +341,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (attacker.critical == 3) { - if (random()<0.005) - severity = 64; - - - severity = 0 + random()*20; - - if ((attacker.perk1 == 17 || attacker.perk2 == 17) && random()<0.05) - { - severity = severity + 15; - sprint(self, 2, "!ONE IN A MILLION\n"); - } - - if (attacker.class == 2) - severity = severity + 5; - - if (targ.classname == "player") - damage = (damage * 2); - else if (severity >= 64) - damage = (damage * 10); - else if (severity >= 30) - damage = (damage * 6); - else if (severity >= 20) - damage = (damage * 5); - else if (severity >= 15) - damage = (damage * 4); - else - damage = (damage * 3); + damage = (damage * 2); if (targ.classname == "monster") attacker.score = attacker.score + 1; @@ -368,15 +369,8 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = } } - if (damage <= 0 && (attacker.classname == "monster" || attacker.classname == "player")) - { - damage = 0; - sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); - return; - } - if (attacker.classname == "monster" || attacker.classname == "player") - sound (targ, CHAN_ITEM, targ.armornoise, 1, ATTN_NORM); + // add to the damage total for clients, which will be sent as a single @@ -455,8 +449,6 @@ take = damage; //fix: soldiers inherent armor bonus applies to armor absorb //fix: psycho drug gives similar benefits to a soldiers bonus - if (targ.class == 3) - take -= 1; if (self.rage == IID_CHEM_PSYCHO) take -= 3; @@ -547,6 +539,7 @@ take = damage; return; } + ArmorNoise(targ, attacker); if (targ.hold <= 0) targ.health = targ.health - take; @@ -612,559 +605,6 @@ take = damage; }; -/* -============ -J_Damage - -This is a special function that is called for weapons using JHP ammo. -JHP ammo does extra damage against things wearing no armor or little -armor, but less damage against heavily armored foes. -============ -*/ - -void(entity targ, entity inflictor, entity attacker, float damage) J_Damage = -{ - local entity oldself; - local float save; - local float take, severity, helm; - local string attackerteam, targteam; - - - if (!targ.takedamage) - return; - - damage = damage * 1.25; - damage = floor(damage); - -// used by buttons and triggers to set activator for target firing - damage_attacker = attacker; - - if (attacker.critical == 3 && targ.classname != "car")//attacker scored a headshot/critical - { - if (attacker.critical == 3) - { - severity = 0 + random()*20; - - if (attacker.class == 3) - severity = severity + 2; - - if (severity >= 19) - damage = (damage * 5); - else if (severity >= 14) - damage = (damage * 4); - else - damage = (damage * 3); - - if (targ.classname == "monster") - attacker.score = attacker.score + 1; - - helm = targ.armortype; - if (targ.helmet == 0) - { - sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM); - helm = 0; - } - if (targ.helmet == AS_STRAIGHT) - { - sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); - helm = 0.30; - } - if (targ.helmet == AS_SLIDING) - { - sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); - helm = 0.45; - } - - damage = (damage - (damage * helm)); - - makevectors (targ.v_angle); - } - } - - //sneak attack: if you attack a creature who isn't fighting you, bonus damage - if (attacker.perk1 == 7 || attacker.perk2 == 7) - { - if (targ.enemy != attacker) - { - sprint(attacker, 2, "!SNEAK ATTACK\n"); - if (damage <= 10) - damage = damage * 3; - else if (damage <= 20) - damage = damage * 2; - else if (damage <= 30) - damage = damage * 1.5; - else - damage = damage * 1.25; - } - } - - if (damage <= 0) - { - damage = 0; - sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); - return; - } - - sound (targ, CHAN_ITEM, targ.armornoise, 1, ATTN_NORM); - - -// add to the damage total for clients, which will be sent as a single -// message at the end of the frame -// FIXME: remove after combining shotgun blasts? - if (targ.flags & FL_CLIENT) - { - targ.dmg_take = targ.dmg_take + take; - targ.dmg_save = targ.dmg_save + save; - targ.dmg_inflictor = inflictor; - } - - damage_inflictor = inflictor; - -/* -// figure momentum add - if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) ) - { - dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5; - dir = normalize(dir); - // Set kickback for smaller weapons -//Zoid -- use normal NQ kickback -// // Read: only if it's not yourself doing the damage -// if ( (damage < 60) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname != targ.netname)) -// targ.velocity = targ.velocity + dir * damage * 11; -// else - // Otherwise, these rules apply to rockets and grenades - // for blast velocity - targ.velocity = targ.velocity + dir * damage * 8; - - // Rocket Jump modifiers - if ( (rj > 1) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname == targ.netname)) - targ.velocity = targ.velocity + dir * damage * rj; - - }*/ - - - -// check for godmode or invincibility - if (targ.flags & FL_GODMODE) - return; - if (targ.invincible_finished >= time) - { - if (self.invincible_sound < time) - { - sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM); - self.invincible_sound = time + 2; - } - return; - } - -// team play damage avoidance -//ZOID 12-13-96: self.team doesn't work in QW. Use keys - attackerteam = infokey(attacker, "team"); - targteam = infokey(targ, "team"); - - if ((teamplay == 1) && (targteam == attackerteam) && - (attacker.classname == "player") && (attackerteam != "") && - inflictor.classname !="door") - return; - - if ((teamplay == 3) && (targteam == attackerteam) && - (attacker.classname == "player") && (attackerteam != "") && - (targ != attacker)&& inflictor.classname !="door") - return; - - -take = damage; - -// do the damage - //different sorts of armour simply subtract different ammounts - //this makes armor like the force armor good against many small rounds - //(SMG, shotguns, swords, etc) but useless against big damage (grenades) - //power armor, which has the best of both worlds, is also the heaviest :p - - switch(ToIID(targ.islot3)) - { - case IID_ARM_DESERT: - take -= 1; - break; - case IID_ARM_LEATHER: - take -= 1; - break; - case IID_ARM_VANDAL: - take -= 15; - break; - case IID_ARM_METAL: - take -= 10; - break; - case IID_ARM_TESLA: - take -= 25; - break; - case IID_ARM_COMBAT: - take -= 20; - break; - case IID_ARM_SEVA: - take -= 20; - break; - case IID_ARM_FORCE: - take -= 30; - break; - case IID_ARM_LPOWER: - take -= 25; - break; - default: - break; - } - - switch(ToIID(targ.islot3)) - { - case IID_ARM_LEATHER: - take = take * 0.70; - break; - case IID_ARM_VANDAL: - take = take * 0.60; - break; - case IID_ARM_METAL: - take = take * 0.40; - break; - case IID_ARM_TESLA: - take = take * 0.55; - break; - case IID_ARM_COMBAT: - take = take * 0.50; - break; - case IID_ARM_SEVA: - take = take * 0.45; - break; - case IID_ARM_FORCE: - take = take * 0.80; - break; - case IID_ARM_LPOWER: - take = take * 0.40; - break; - default: - break; - } - - if (targ.classname == "player" && targ.zoom > 0) - { - targ.maxspeed = targ.maxspeed * 0.20; - stuffcmd(targ, "v_idlescale 20\n"); - } - else if (take > 20 && targ.classname == "player") - { - targ.maxspeed = targ.maxspeed * 0.20; - stuffcmd(targ, "v_cshift 100 0 0 100\n"); - stuffcmd(targ, "v_idlescale 30\n"); - } - else if (take > 0) - { - targ.maxspeed = targ.maxspeed * 0.30; - stuffcmd(targ, "v_cshift 100 0 0 50\n"); - } - - - if (take <= 0) - { - take = 0; - sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); - return; - } - - - targ.health = targ.health - take; - - if (targ.health <= 0) - { - Killed (targ, attacker); - return; - } - -// react to the damage - oldself = self; - self = targ; - -/*SERVER - if ( (self.flags & FL_MONSTER) && attacker != world) - { - // get mad unless of the same class (except for soldiers) - if (self != attacker && attacker != self.enemy) - { - if ( (self.classname != attacker.classname) - || (self.classname == "monster" ) ) - { - if (self.enemy.classname == "player") - self.oldenemy = self.enemy; - self.enemy = attacker; - FoundTarget (); - } - } - } -*/ - if (self.th_pain) - { - self.th_pain (attacker, take); - } - - self = oldself; -}; - -/* -============ -X_Damage - -The purpose of X_Damage is to allow certain weapons to bypass armor -which is a very large part of the game. -============ -*/ - -void(entity targ, entity inflictor, entity attacker, float damage) X_Damage = -{ - local entity oldself; - local float save; - local float take, severity, helm; - local string attackerteam, targteam; - - - if (!targ.takedamage) - return; - - damage = damage * 0.75; - damage = floor(damage); - -// used by buttons and triggers to set activator for target firing - damage_attacker = attacker; - - if (attacker.critical == 3 && targ.classname != "car")//attacker scored a headshot/critical - { - if (attacker.critical == 3) - { - severity = 0 + random()*20; - - if (attacker.class == 2) - severity = severity + 4; - - if (severity >= 19) - damage = (damage * 5); - else if (severity >= 14) - damage = (damage * 4); - else - damage = (damage * 3); - - if (targ.classname == "monster") - attacker.score = attacker.score + 1; - - helm = targ.armortype; - if (targ.helmet == 0) - { - sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM); - helm = 0; - } - if (targ.helmet == AS_STRAIGHT) - { - sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); - helm = 0.15; - } - if (targ.helmet == AS_SLIDING) - { - sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); - helm = 0.22; - } - - damage = (damage - (damage * helm)); - - makevectors (targ.v_angle); - } - } - - if (damage <= 0) - { - damage = 0; - sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); - return; - } - - sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); - -// save damage based on the target's armor level - - - - take = ceil(damage); - -// add to the damage total for clients, which will be sent as a single -// message at the end of the frame -// FIXME: remove after combining shotgun blasts? - if (targ.flags & FL_CLIENT) - { - targ.dmg_take = targ.dmg_take + take; - targ.dmg_save = targ.dmg_save + save; - targ.dmg_inflictor = inflictor; - } - - damage_inflictor = inflictor; - -/* -// figure momentum add - if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) ) - { - dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5; - dir = normalize(dir); - // Set kickback for smaller weapons -//Zoid -- use normal NQ kickback -// // Read: only if it's not yourself doing the damage -// if ( (damage < 60) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname != targ.netname)) -// targ.velocity = targ.velocity + dir * damage * 11; -// else - // Otherwise, these rules apply to rockets and grenades - // for blast velocity - targ.velocity = targ.velocity + dir * damage * 8; - - // Rocket Jump modifiers - if ( (rj > 1) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname == targ.netname)) - targ.velocity = targ.velocity + dir * damage * rj; - - }*/ - - - -// check for godmode or invincibility - if (targ.flags & FL_GODMODE) - return; - if (targ.invincible_finished >= time) - { - if (self.invincible_sound < time) - { - sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM); - self.invincible_sound = time + 2; - } - return; - } - -// team play damage avoidance -//ZOID 12-13-96: self.team doesn't work in QW. Use keys - attackerteam = infokey(attacker, "team"); - targteam = infokey(targ, "team"); - - if ((teamplay == 1) && (targteam == attackerteam) && - (attacker.classname == "player") && (attackerteam != "") && - inflictor.classname !="door") - return; - - if ((teamplay == 3) && (targteam == attackerteam) && - (attacker.classname == "player") && (attackerteam != "") && - (targ != attacker)&& inflictor.classname !="door") - return; - - -// do the damage - //different sorts of armour simply subtract different ammounts - //this makes armor like the force armor good against many small rounds - //(SMG, shotguns, swords, etc) but useless against big damage (grenades) - //power armor, which has the best of both worlds, is also the heaviest :p - - switch(ToIID(targ.islot3)) - { - case IID_ARM_METAL: - take -= 1; - break; - case IID_ARM_SEVA: - take -= 1; - break; - case IID_ARM_FORCE: - take -= 3; - break; - case IID_ARM_LPOWER: - take -= 2; - break; - default: - break; - } - - switch(ToIID(targ.islot3)) - { - case IID_ARM_LEATHER: - take = take * 0.90; - break; - case IID_ARM_VANDAL: - take = take * 0.75; - break; - case IID_ARM_METAL: - take = take * 0.90; - break; - case IID_ARM_COMBAT: - take = take * 0.90; - break; - case IID_ARM_SEVA: - take = take * 0.80; - break; - case IID_ARM_LPOWER: - take = take * 0.75; - break; - default: - break; - } - - if (targ.classname == "player" && targ.zoom > 0) - { - targ.maxspeed = targ.maxspeed * 0.33; - stuffcmd(targ, "v_idlescale 20\n"); - } - else if (take > 20 && targ.classname == "player") - { - targ.maxspeed = targ.maxspeed * 0.25; - stuffcmd(targ, "v_cshift 100 0 0 100\n"); - stuffcmd(targ, "v_idlescale 30\n"); - } - else if (take > 0) - { - targ.maxspeed = targ.maxspeed * 0.50; - stuffcmd(targ, "v_cshift 100 0 0 50\n"); - } - - - if (take <= 0) - { - take = 0; - sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); - return; - } - - - targ.health = targ.health - take; - - if (targ.health <= 0) - { - Killed (targ, attacker); - return; - } - -// react to the damage - oldself = self; - self = targ; - -/*SERVER - if ( (self.flags & FL_MONSTER) && attacker != world) - { - // get mad unless of the same class (except for soldiers) - if (self != attacker && attacker != self.enemy) - { - if ( (self.classname != attacker.classname) - || (self.classname == "monster" ) ) - { - if (self.enemy.classname == "player") - self.oldenemy = self.enemy; - self.enemy = attacker; - FoundTarget (); - } - } - } -*/ - if (self.th_pain) - { - self.th_pain (attacker, take); - } - - self = oldself; -}; /* ============ diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index c09572482..e0f450729 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -154,10 +154,6 @@ void(vector pos, float slotno, vector imgsize) SlotImageBig = 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)); @@ -203,10 +199,6 @@ 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)); @@ -545,6 +537,7 @@ void() Trader_Draw = drawstring('32 16 0', itname, '8 8 0', '1 1 1', 1); price = GetBaseValue(ToIID(it)); + price = ceil(price * (1 - (getstati(104)/30))); price2 = ftos(price); money = getstati(50); money2 = ftos(money); @@ -570,9 +563,9 @@ void() Perks_Draw = if (mousepos_y >= 2.0*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640)) { if (mousepos_x >= 3*IMGSIZEF*(scrwidth/640) && mousepos_x <= 5.5*IMGSIZEF*(scrwidth/640)) - selected_class = 8; - else if (mousepos_x >= 6*IMGSIZEF*(scrwidth/640) && mousepos_x <= 7.5*IMGSIZEF*(scrwidth/640)) selected_class = 9; + else if (mousepos_x >= 6*IMGSIZEF*(scrwidth/640) && mousepos_x <= 7.5*IMGSIZEF*(scrwidth/640)) + selected_class = 10; else selected_class = 0; } @@ -581,12 +574,12 @@ void() Perks_Draw = if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 335*(scrwidth/640)) - selected_class = 5; - else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 385*(scrwidth/640)) selected_class = 6; + else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 385*(scrwidth/640)) + selected_class = 7; else if (mousepos_x >= 400*(scrwidth/640) && mousepos_x <= 435*(scrwidth/640)) - selected_class = 7; + selected_class = 8; else selected_class = 0; } @@ -614,7 +607,7 @@ void() Perks_Draw = void() Items_Draw = { local float it; - local string itname; + local string itname, w1, w2; drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); @@ -624,12 +617,12 @@ void() Items_Draw = drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 325*(scrwidth/640)) - selected_class = 5; - else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 385*(scrwidth/640)) selected_class = 6; + else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 385*(scrwidth/640)) + selected_class = 7; else if (mousepos_x >= 400*(scrwidth/640) && mousepos_x <= 435*(scrwidth/640)) - selected_class = 7; + selected_class = 8; else selected_class = 0; } @@ -671,6 +664,12 @@ void() Items_Draw = itname = (ftos(GetItemWeight(ToIID(it)))); drawstring('5 4.3 0'*IMGSIZEF*(scrwidth/640) + '0 24 0'*(scrwidth/640), strcat("weight: ", itname, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + w1 = ftos(getstati(52)); + w2 = ftos(getstati(53)); + + drawstring('7 5 0'*IMGSIZEF*(scrwidth/640) + '0 0 0'*(scrwidth/640), "weight\n", '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('7 5 0'*IMGSIZEF*(scrwidth/640) + '0 8 0'*(scrwidth/640), strcat(w1, "/", w2, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -679,7 +678,7 @@ void() Items_Draw = void() GainPerk_Draw = { local float it; - local string itname, pn, pd; + local string itname, pn, pd, pd2; drawpic('0 0 0', "gui/pipboy/gainperk.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); @@ -730,16 +729,17 @@ void() GainPerk_Draw = drawpic('2 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Mutation.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('3 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Narrow Escape.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('4 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Schizophrenia.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); - drawpic('5 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Sleep Tight.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('5 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Placebo Effect.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('6 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Economic Moves.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('2 4 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Nuclear Man.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); pn = PerkName(1, which_perk); pd = GetPerkDesc(which_perk); + pd2 = GetPerkDesc2(which_perk); drawstring('32 16 0'*(scrwidth/640), pn, '8 8 0'*(scrwidth/640), '1 1 1', 1); drawstring('32 32 0'*(scrwidth/640), pd, '8 8 0'*(scrwidth/640), '1 1 1', 1); - + drawstring('32 40 0'*(scrwidth/640), pd2, '8 8 0'*(scrwidth/640), '1 1 1', 1); drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -751,106 +751,70 @@ void() Pipboy_Draw = string skill; vector w; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); + if (mousepos_x >= 192 && mousepos_x <= 512) + if (mousepos_y >= 240 && mousepos_y <= 304) + selected_class = ceil((mousepos_x-191)/64); + - if (mousepos_y >= 200*(scrwidth/640) && mousepos_y <= 325*(scrwidth/640)) - { - if (mousepos_x >= 150*(scrwidth/640) && mousepos_x <= 250*(scrwidth/640)) - { - drawpic('0 0 0', "gui/pipboy/skills2.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); - selected_class = 1; - } - else if (mousepos_x >= 250*(scrwidth/640) && mousepos_x <= 350*(scrwidth/640)) - { - drawpic('0 0 0', "gui/pipboy/skills3.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); - selected_class = 2; - } - else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 450*(scrwidth/640)) - { - drawpic('0 0 0', "gui/pipboy/skills4.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); - selected_class = 3; - } - else if (mousepos_x >= 450*(scrwidth/640) && mousepos_x <= 550*(scrwidth/640)) - { - drawpic('0 0 0', "gui/pipboy/skills5.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); - selected_class = 4; - } - else - { - drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); - selected_class = 0; - } - } else if (mousepos_y >= 390*(scrwidth/640) && mousepos_y <= 425*(scrwidth/640)) { - drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); + drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 325*(scrwidth/640)) - selected_class = 5; - else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 375*(scrwidth/640)) selected_class = 6; - - else if (mousepos_x >= 400*(scrwidth/640) && mousepos_x <= 425*(scrwidth/640)) + else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 385*(scrwidth/640)) selected_class = 7; + + else if (mousepos_x >= 400*(scrwidth/640) && mousepos_x <= 435*(scrwidth/640)) + selected_class = 8; else selected_class = 0; } - else - { - drawpic('0 0 0', "gui/pipboy/skills1.jpg", '640 480 0'*(scrwidth/640), '1 1 1', 1); - selected_class = 0; - } + + drawpic('0 0 0', "gui/pipboy/pipboy.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); + + + drawpic('192 256 0'*(scrwidth/640), "gui/pipboy/combat.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('256 256 0'*(scrwidth/640), "gui/pipboy/doctor.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('320 256 0'*(scrwidth/640), "gui/pipboy/sneak.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('384 256 0'*(scrwidth/640), "gui/pipboy/science.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('448 256 0'*(scrwidth/640), "gui/pipboy/speech.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + + if (selected_class == 1) + drawpic('128 64 0'*(scrwidth/640), "gui/pipboy/combat.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); + else if (selected_class == 2) + drawpic('128 64 0'*(scrwidth/640), "gui/pipboy/doctor.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); + else if (selected_class == 3) + drawpic('128 64 0'*(scrwidth/640), "gui/pipboy/sneak.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); + else if (selected_class == 4) + drawpic('128 64 0'*(scrwidth/640), "gui/pipboy/science.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); + else if (selected_class == 5) + drawpic('128 64 0'*(scrwidth/640), "gui/pipboy/speech.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); if (selected_class == 1) - { - drawstring('200 50 0'*(scrwidth/640), " combat", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 66 0'*(scrwidth/640), "place points into this skill for improved", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 74 0'*(scrwidth/640), "handling of weapons, as well as increased", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 82 0'*(scrwidth/640), "carry capacity and other aspects of being", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 90 0'*(scrwidth/640), "trained in combat.", '8 8 0'*(scrwidth/640), '1 1 1', 1); - } - if (selected_class == 2) - { - drawstring('200 50 0'*(scrwidth/640), " doctor", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 66 0'*(scrwidth/640), "place points into this skill for improved", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 74 0'*(scrwidth/640), "chem use, which substantially affects the", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 82 0'*(scrwidth/640), "amount of healing done, as well as all of", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 90 0'*(scrwidth/640), "the other aspects of first aid.", '8 8 0'*(scrwidth/640), '1 1 1', 1); - } - if (selected_class == 3) - { - drawstring('200 50 0'*(scrwidth/640), " sneak", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 66 0'*(scrwidth/640), "place points into this skill to maximize", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 74 0'*(scrwidth/640), "your ability to remain unseen by enemies.", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 82 0'*(scrwidth/640), "grants higher sneak ability and how fast", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 90 0'*(scrwidth/640), "you can pick locks, among other things.", '8 8 0'*(scrwidth/640), '1 1 1', 1); - - } - if (selected_class == 4) - { - drawstring('200 50 0'*(scrwidth/640), " science", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 66 0'*(scrwidth/640), "place points into this skill to increase", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 74 0'*(scrwidth/640), "your chances of making useful items from", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 82 0'*(scrwidth/640), "junk found in the wasteland. use the mix", '8 8 0'*(scrwidth/640), '1 1 1', 1); - drawstring('200 90 0'*(scrwidth/640), "box found in your inventory screen.", '8 8 0'*(scrwidth/640), '1 1 1', 1); - - } - + drawstring('196 64 0'*(scrwidth/640), "combat", '16 16 0'*(scrwidth/640), '1 1 1', 1); + else if (selected_class == 2) + drawstring('196 64 0'*(scrwidth/640), "doctor", '16 16 0'*(scrwidth/640), '1 1 1', 1); + else if (selected_class == 3) + drawstring('196 64 0'*(scrwidth/640), "sneak", '16 16 0'*(scrwidth/640), '1 1 1', 1); + else if (selected_class == 4) + drawstring('196 64 0'*(scrwidth/640), "science", '16 16 0'*(scrwidth/640), '1 1 1', 1); + else if (selected_class == 5) + drawstring('196 64 0'*(scrwidth/640), "speech", '16 16 0'*(scrwidth/640), '1 1 1', 1); bar = 0; lvl = getstati(100); skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('210 190 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/graph/red.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); + drawpic('208 230 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/pipboy/graph/red.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); bar = bar + 1; } - drawstring('220 190 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('218 230 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '12 12 0'*(scrwidth/640), '1 1 1', 1); bar = 0; @@ -858,30 +822,41 @@ void() Pipboy_Draw = skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('305 190 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/graph/green.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); + drawpic('272 230 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/pipboy/graph/green.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); bar = bar + 1; } - drawstring('315 190 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('280 230 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '12 12 0'*(scrwidth/640), '1 1 1', 1); bar = 0; lvl = getstati(102); skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('395 190 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/graph/blue.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); + drawpic('336 230 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/pipboy/graph/blue.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); bar = bar + 1; } - drawstring('405 190 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('346 230 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '12 12 0'*(scrwidth/640), '1 1 1', 1); bar = 0; lvl = getstati(103); skill = ftos(lvl+1); while (bar <= lvl) { - drawpic('485 190 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/graph/yellow.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); + drawpic('400 230 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/pipboy/graph/yellow.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); bar = bar + 1; } - drawstring('495 190 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('410 230 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '12 12 0'*(scrwidth/640), '1 1 1', 1); + + + bar = 0; + lvl = getstati(104); + skill = ftos(lvl+1); + while (bar <= lvl) + { + drawpic('464 230 0'*(scrwidth/640) - ('0 4 0'*bar*(scrwidth/640)), "gui/pipboy/graph/gray.jpg", '16 2 0'*2*(scrwidth/640), '1 1 1', 1); + bar = bar + 1; + } + drawstring('472 230 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '12 12 0'*(scrwidth/640), '1 1 1', 1); drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -1238,6 +1213,8 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = else if (selected_class == 4) localcmd("cmd gainlevel science\n"); else if (selected_class == 5) + localcmd("cmd gainlevel speech\n"); + else if (selected_class == 6) { show_inventory = false; show_pipboy = true; @@ -1246,7 +1223,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_items = false; show_gainperk = false; } - else if (selected_class == 6) + else if (selected_class == 7) { show_inventory = false; show_pipboy = false; @@ -1255,7 +1232,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_items = true; show_gainperk = false; } - else if (selected_class == 7) + else if (selected_class == 8) { show_inventory = false; show_pipboy = false; @@ -1268,7 +1245,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = } else if (show_items) { - if (selected_class == 5) + if (selected_class == 6) { show_inventory = false; show_pipboy = true; @@ -1277,7 +1254,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_items = false; show_gainperk = false; } - else if (selected_class == 6) + else if (selected_class == 7) { show_inventory = false; show_pipboy = false; @@ -1286,7 +1263,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_items = true; show_gainperk = false; } - else if (selected_class == 7) + else if (selected_class == 8) { show_inventory = false; show_pipboy = false; @@ -1298,7 +1275,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = } else if (show_perks) { - if (selected_class == 5) + if (selected_class == 6) { show_inventory = false; show_pipboy = true; @@ -1307,7 +1284,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_items = false; show_gainperk = false; } - else if (selected_class == 6) + else if (selected_class == 7) { show_inventory = false; show_pipboy = false; @@ -1316,7 +1293,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_items = true; show_gainperk = false; } - else if (selected_class == 7) + else if (selected_class == 8) { show_inventory = false; show_pipboy = false; @@ -1325,7 +1302,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_items = false; show_gainperk = false; } - else if (selected_class == 8) + else if (selected_class == 9) { show_inventory = false; show_pipboy = false; @@ -1335,7 +1312,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_gainperk = true; perkslot = 1; } - else if (selected_class == 9) + else if (selected_class == 10) { show_inventory = false; show_pipboy = false; diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index c6874391e..b8cb5912a 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -51,7 +51,7 @@ void() Crosshair_Draw = void() Position_Draw = { - float pos, s, lvl; + float pos, s, lvl, bar, top; string sn; pos = getstati(54); @@ -68,8 +68,24 @@ void() Position_Draw = if (s > 0) { - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.20)) +('0 1 0'*(scrheight*0.79)), "gui/hud/sneak.png", '0 0 0'+'72 25 0'*(scrwidth/640), '1 1 1'); - //drawstring('0 0 0'+('1 0 0'*(scrwidth*0.20)) +('0 1 0'*(scrheight*0.80)), strcat("%", sn), '8 8 8', '1 1 1', 1); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.22)) +('0 1 0'*(scrheight*0.79)), "gui/hud/sneak.png", '0 0 0'+'72 25 0'*(scrwidth/640), '1 1 1'); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.01)) +('0 1 0'*(scrheight*0.79)), "gui/hud/sneakbar.png", '0 0 0'+'135 25 0'*(scrwidth/640), '1 1 1'); + + + + bar = 0; + top = ceil(117 * (s/100)); + if (top > 117) + top = 117; + + while (bar < top) + bar = bar + 1; + + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.0225)) +('0 1 0'*(scrheight*0.8025)) + ('0 1 0'*(scrheight/640)), "gui/pipboy/graph/blue.jpg", '1 16 0'*(scrheight/640)+'1 0 0'*(scrwidth/640)*bar, '1 1 1', 1); + + + + //drawstring('0 0 0'+('1 0 0'*(scrwidth*0.20)) +('0 1 0'*(scrheight*0.78)), strcat("%", sn), '12 12 12'*(scrheight/640), '1 1 1', 1); } if (lvl >= 200) @@ -107,12 +123,12 @@ void() Time_Draw = local float xtime, ytime, ztime, obj; local string qtime, rtime, shadowtime, text, text2; - xtime = getstati(104); + xtime = getstati(63); ytime = floor(xtime/60); ztime = xtime - (ytime*60); qtime = ftos(ytime); rtime = ftos(ztime); - shadowtime = ftos(getstati(104)); + shadowtime = ftos(getstati(63)); drawstring('0 0 0'+('1 0 0'*(scrwidth*0.25))+('0 1 0'*(scrheight*0.86)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8', '1 1 1', 1); @@ -199,7 +215,7 @@ void() Health_Draw = while (bar < top) bar = bar + 1; - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.07)) +('0 1 0'*(scrheight*0.75)) + ('0 1 0'*(scrheight/640)), "gui/graph/green.jpg", '16 1 0'*(scrheight/640)-'0 1 0'*(scrwidth/640)*bar, '1 1 1', 1); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.07)) +('0 1 0'*(scrheight*0.75)) + ('0 1 0'*(scrheight/640)), "gui/pipboy/graph/green.jpg", '16 1 0'*(scrheight/640)-'0 1 0'*(scrwidth/640)*bar, '1 1 1', 1); }; @@ -218,7 +234,7 @@ void() Radiation_Draw = while (bar < top) bar = bar + 1; - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.02)) +('0 1 0'*(scrheight*0.75)) + ('0 1 0'*(scrheight/640)), "gui/graph/yellow.jpg", '16 1 0'*(scrheight/640)-'0 1 0'*(scrwidth/640)*bar, '1 1 1', 1); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.02)) +('0 1 0'*(scrheight*0.75)) + ('0 1 0'*(scrheight/640)), "gui/pipboy/graph/yellow.jpg", '16 1 0'*(scrheight/640)-'0 1 0'*(scrwidth/640)*bar, '1 1 1', 1); }; @@ -323,7 +339,7 @@ void() Ammo_Draw = while (bar <= top) { - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.99)) - ('0 2 0'*bar*(scrheight/640)), "gui/graph/green.jpg", '0 0 0'+'8 1 0'*(scrwidth/640), '1 1 1', 1); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.99)) - ('0 2 0'*bar*(scrheight/640)), "gui/pipboy/graph/green.jpg", '0 0 0'+'8 1 0'*(scrwidth/640), '1 1 1', 1); bar = bar + 1; @@ -346,7 +362,7 @@ void() Ammo_Draw = while (bar <= top) { - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.99)) - ('0 2 0'*bar*(scrheight/640)), "gui/graph/green.jpg", '0 0 0'+'8 1 0'*(scrwidth/640), '1 1 1', 1); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.99)) - ('0 2 0'*bar*(scrheight/640)), "gui/pipboy/graph/green.jpg", '0 0 0'+'8 1 0'*(scrwidth/640), '1 1 1', 1); bar = bar + 1; @@ -366,11 +382,11 @@ void() HUD_Perks_Draw = perktime = getstati(111); if (perktime == 0) - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.855)) + ('0 1 0'*(scrheight*0.90)), "gui/graph/green.jpg", '0 0 0'+'4 4 0'*(scrwidth/640), '1 1 1', 1); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.855)) + ('0 1 0'*(scrheight*0.90)), "gui/pipboy/graph/green.jpg", '0 0 0'+'4 4 0'*(scrwidth/640), '1 1 1', 1); perktime2 = getstati(112); if (perktime2 == 0) - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.855)) + ('0 1 0'*(scrheight*0.96)), "gui/graph/green.jpg", '0 0 0'+'4 4 0'*(scrwidth/640), '1 1 1', 1); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.855)) + ('0 1 0'*(scrheight*0.96)), "gui/pipboy/graph/green.jpg", '0 0 0'+'4 4 0'*(scrwidth/640), '1 1 1', 1); if (getstati(60) > 0) @@ -399,7 +415,7 @@ void() HUD_Perks_Draw = while (bar < top) { - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.865)) +('0 1 0'*(scrheight*0.88)) + ('0 1 0'*bar*(scrheight/640)), "gui/graph/black.jpg", '0 0 0'+'28 1 0'*(scrwidth/640), '1 1 1', 1); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.865)) +('0 1 0'*(scrheight*0.88)) + ('0 1 0'*bar*(scrheight/640)), "gui/pipboy/graph/black.jpg", '0 0 0'+'28 1 0'*(scrwidth/640), '1 1 1', 1); bar = bar + 1; @@ -420,7 +436,7 @@ void() HUD_Perks_Draw = while (bar < top) { - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.865)) +('0 1 0'*(scrheight*0.94)) + ('0 1 0'*bar*(scrheight/640)), "gui/graph/black.jpg", '0 0 0'+'28 1 0'*(scrwidth/640), '1 1 1', 1); + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.865)) +('0 1 0'*(scrheight*0.94)) + ('0 1 0'*bar*(scrheight/640)), "gui/pipboy/graph/black.jpg", '0 0 0'+'28 1 0'*(scrwidth/640), '1 1 1', 1); bar = bar + 1; diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index c4d0a58f7..08b2a467b 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -632,29 +632,14 @@ float intermission_running; .float ghostcnt; .float dtime; .float active; -.float class; -.float tclass; -.float xclass; .float zone; .float missionbrief; -.float silencer; -.float extender; -//.float vote1; -//.float vote2; -//.float vote3; -//.float vote4; -//.float vote5; -//.float vote6; -//.float vote7; -//.float override; .entity track; -//.float recharge; .float processed; .float current_slot; .float attack; .float position; .float recoil; -.float heat; .float hold; .float critical; .float helmet; @@ -668,6 +653,8 @@ float intermission_running; .float equipment_slot; .float has_radio; .float score; +.float supertime; +.float invistime; .float endinfo1; .float endinfo2; .float endinfo3; @@ -687,10 +674,12 @@ float intermission_running; .float skill_doctor; .float skill_sneak; .float skill_science; +.float skill_speech; .float shadowskill_combat; .float shadowskill_doctor; .float shadowskill_sneak; .float shadowskill_science; +.float shadowskill_speech; .float musictimer; @@ -755,6 +744,7 @@ float intermission_running; .float perk2timer; .float shadowtime; .float announcercache; +.float crawltime; string announcer; .float charmed; diff --git a/quakec/fallout2/dog.qc b/quakec/fallout2/dog.qc index 2978bd51c..2b937ba06 100644 --- a/quakec/fallout2/dog.qc +++ b/quakec/fallout2/dog.qc @@ -172,45 +172,9 @@ void() Sniff = sound (self, CHAN_VOICE, "dog/dsight.wav", 1, ATTN_NORM); self.rtime = time + 5; - if (te.class == 2 && random()*100 > 99) - { - spawn_excla(te, 1); - te.sneak = 0; - sprint(te, 2, "detected!\n"); - self.enemy = te; - FoundTarget(); - } - else if (te.class != 2 && random()*100 > 80) - { - spawn_excla(te, 1); - te.sneak = 0; - sprint(te, 2, "detected!\n"); - self.enemy = te; - FoundTarget(); - } - } return; } - - if (self.classname != "robofang") - return; - - x = 20; - te = findradius (self.origin, 500); - while (te) - { - if (te.classname == "monster" && te.enemy == self.owner) - { - if (self.rtime < time) - sound (self, CHAN_VOICE, "dog/dsight.wav", 1, ATTN_NORM); - self.rtime = time + 5; - self.enemy = te; - FoundTarget(); - return; - } - te = te.chain; - } }; void() dog_run1 =[ $run1 , dog_run2 ] { diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 90cf41683..527bbe088 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -654,11 +654,11 @@ string(float iid) GetItemVModel = if (iid == IID_WP_KNIFE) return "progs/v_knife.mdl"; if (iid == IID_WP_SLEDGE) - return "progs/v_axe.mdl"; + return "progs/v_disruptor.mdl"; if (iid == IID_WP_SPEAR) return "progs/v_spear.mdl"; if (iid == IID_WP_POWERAXE) - return "progs/v_axe.mdl"; + return "progs/v_disruptor.mdl"; if (iid == IID_WP_USP) return "progs/v_usp.mdl"; if (iid == IID_WP_USP_S) @@ -2581,7 +2581,7 @@ string (float slot, float int) PerkName = if (int == 8) return "Schizophrenia"; if (int == 9) - return "Sleep Tight"; + return "Place Effect"; if (int == 10) return "Economic Moves"; if (int == 11) @@ -2607,7 +2607,7 @@ string (float slot, float int) PerkNameCentered = if (int == 8) return " Schizophrenia"; if (int == 9) - return " Sleep Tight"; + return " Place Effect"; if (int == 10) return " Economic Moves"; if (int == 11) @@ -2634,7 +2634,7 @@ string(float int) GetPerkImage = else if (int == 8) return "gui/perks/Schizophrenia.jpg"; else if (int == 9) - return "gui/perks/Sleep Tight.jpg"; + return "gui/perks/Placebo Effect.jpg"; else if (int == 10) return "gui/perks/Economic Moves.jpg"; else if (int == 11) @@ -2648,28 +2648,163 @@ string(float int) GetPerkImage = string(float int) GetPerkDesc = { if (int == 1) - return "Recoil is drastically reduced while lying down"; + return "For those who like climbing into the trenches! This perk"; else if (int == 2) - return "Makes enemies attack your friends instead of you"; + return "Being a hero is overrated! You try your best to not look"; else if (int == 3) - return "You can make enemies attack their friends"; + return "Your black heart has a weird effect over the denizens of"; else if (int == 4) - return "50% damage resist to area attacks while prone"; + return "You know how to take cover! While prone, any attack that"; else if (int == 5) - return "Aimed attacks get a damage bonus equal to Doctor skill"; + return "You have gained in-depth knowledge of vital organs. Your"; else if (int == 6) - return "This perk randomly functions as two perks"; + return "The radiation has mutated your body slightly. A critical"; else if (int == 7) - return "Provides you a few hassle-free seconds to escape danger"; + return "For when your friend really, really needs that stimpack!"; else if (int == 8) - return "Your skill levels surge in power from an unknown source"; + return "You are haunted by the ghost of a wasteland wanderer who"; else if (int == 9) - return "Paralyze anything with a sneak attack from a knife"; + return "Through convincing acts you can force people (even you!)"; else if (int == 10) - return "Suffer less time-related penalties for all actions"; + return "You can move more effectively than most people. Movement"; else if (int == 11) - return "Eat a small amount of radiation to heal yourself"; + return "Your body has adapted to radiation to the point that you"; else return ""; +}; + +string(float int) GetPerkDesc2 = +{ + if (int == 1) + return "will drastically reduce recoil while lying down."; + else if (int == 2) + return "dangerous - making monsters attack your friends!"; + else if (int == 3) + return "the wasteland - you can turn a few to your side!"; + else if (int == 4) + return "is non-aimed deals much less damage to you."; + else if (int == 5) + return "aimed attacks get a damage bonus equal to Doctor skill."; + else if (int == 6) + return "hit no longer has quite the same sting it once had."; + else if (int == 7) + return "Provides you a few free seconds to escape danger."; + else if (int == 8) + return "sometimes takes over your body, boosting all skills."; + else if (int == 9) + return "to believe your stimpak is much better than it is."; + else if (int == 10) + return "actions suffer much less time-related penalties."; + else if (int == 11) + return "can absorb small amounts, healing you as well!"; + else + return ""; + +}; + + +float(float iid) GetItemThreatLevel = +{ + if (iid == IID_NONE) + return 0; + if (iid == IID_WP_KNIFE) + return 1; + if (iid == IID_WP_SLEDGE) + return 1; + if (iid == IID_WP_SPEAR) + return 1; + if (iid == IID_WP_POWERAXE) + return 1; + if (iid == IID_WP_USP) + return 1; + if (iid == IID_WP_USP_S) + return 1; + if (iid == IID_WP_GLOCK) + return 1; + if (iid == IID_WP_GLOCK_S) + return 1; + if (iid == IID_WP_DEAGLE) + return 1; + if (iid == IID_WP_DEAGLE_M) + return 1; + if (iid == IID_WP_NEEDLER) + return 3; + if (iid == IID_WP_ALIENBLASTER) + return 3; + if (iid == IID_WP_PIPERIFLE) + return 1; + if (iid == IID_WP_WINCHESTER) + return 1; + if (iid == IID_WP_MOSSBERG) + return 3; + if (iid == IID_WP_JACKHAMMER) + return 5; + if (iid == IID_WP_GREASEGUN) + return 1; + if (iid == IID_WP_GREASEGUN_S) + return 1; + if (iid == IID_WP_MP9) + return 1; + if (iid == IID_WP_MP9_S) + return 1; + if (iid == IID_WP_RANGEMASTER) + return 1; + if (iid == IID_WP_RANGEMASTER_SCOPE) + return 1; + if (iid == IID_WP_AK112) + return 3; + if (iid == IID_WP_AK47) + return 3; + if (iid == IID_WP_AK112_M) + return 3; + if (iid == IID_WP_AK74) + return 5; + if (iid == IID_WP_ACR) + return 5; + if (iid == IID_WP_DKS1) + return 3; + if (iid == IID_WP_DKS1_S) + return 3; + if (iid == IID_WP_MOONLIGHT) + return 5; + if (iid == IID_WP_G11) + return 5; + if (iid == IID_WP_GAUSERIFLE) + return 7; + if (iid == IID_WP_PULSERIFLE) + return 7; + if (iid == IID_WP_TURBOPLASMA) + return 7; + if (iid == IID_WP_PLASMACARBINE) + return 7; + if (iid == IID_WP_FNFAL) + return 5; + if (iid == IID_WP_ROCKETLAUNCHER) + return 7; + if (iid == IID_WP_LASERGATLING) + return 7; + + + if (iid == IID_ARM_LEATHER) + return 1; + if (iid == IID_ARM_VANDAL) + return 1; + if (iid == IID_ARM_METAL) + return 1; + if (iid == IID_ARM_TESLA) + return 1; + if (iid == IID_ARM_COMBAT) + return 3; + if (iid == IID_ARM_SEVA) + return 3; + if (iid == IID_ARM_FORCE) + return 5; + if (iid == IID_ARM_LPOWER) + return 7; + + + +// bprint(PRINT_MEDIUM, ftos(iid), " without a threat level!\n"); + return 0; }; \ No newline at end of file diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index edabf65b1..31542d8b9 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -229,7 +229,7 @@ void() bomb_touch = { sound (self, CHAN_BODY, "items/locked.wav", 1, ATTN_NORM); sprint(other, 2, "this is a high-tech bomb.\n"); - if (other.class == 4) + if (other.skill_science > 0) { sprint(other, 2, "you may attempt to deactivate this\n"); sprint(other, 2, "bomb by pressing your 'action' key\n"); diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index caa7fbb7c..cdd02940e 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -1020,7 +1020,7 @@ void() brotherhood_soldier = setsize (self, '-16 -16 -24', '16 16 32'); self.takedamage = DAMAGE_NO; - self.xslot1 = SlotVal(IID_AM_45ACP, 100); + self.xslot1 = SlotVal(IID_WP_SLEDGE, 1); self.xslot2 = SlotVal(IID_AM_10MM, 100); self.xslot3 = SlotVal(IID_AM_12GAUGESHELLS, 100); self.xslot4 = SlotVal(IID_AM_5MMHIGHVEL, 100); diff --git a/quakec/fallout2/mod_buy.qc b/quakec/fallout2/mod_buy.qc index 923ae023e..3f47ed925 100644 --- a/quakec/fallout2/mod_buy.qc +++ b/quakec/fallout2/mod_buy.qc @@ -79,176 +79,8 @@ void(float cost, float iid, float amount) BuyStackableMulti = //finds existing grenades, otherwise, empty slot }; -void() BuyBandages = -{ - local string y; - if (self.ammo_shells < 2) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "not enough money.\n"); - return; - } - if (self.class != 2) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "not a medic.\n"); - return; - } - if (self.bandages >= 50) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "too many bandages.\n"); - return; - } - sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); - self.bandages = self.bandages + 25; - self.ammo_shells = self.ammo_shells - 2; - if (self.bandages > 50) - self.bandages = 50; - y = ftos(self.bandages); - sprint(self, PRINT_HIGH, "you now have "); - sprint(self, PRINT_HIGH, y); - sprint(self, PRINT_HIGH, "/50 bandages.\n"); -}; - -void(float cost, float type, float count) BuyChem = -{ - local string chemname; - local float max; - local float alreadygot; - local float typex; - - if (self.ammo_shells < cost) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "not enough money.\n"); - return; - } - - //only medics and engineers can buy superstims - if (type == IID_CHEM_SUPERSTIM && self.class != 1 && self.class != 4) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); - sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); - return; - } - - //only medics and engineers can buy adrenaline - if (type == IID_CHEM_ADRENALINE && self.class != 1 && self.class != 4) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); - sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); - return; - } - - //only medics can buy psycho - if (type == IID_CHEM_PSYCHO && self.class != 1) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); - sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); - return; - } - - //only medics can buy berserk - if (type == IID_CHEM_BESERK && self.class != 1) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "you'll need a higher first aid skill\n"); - sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); - return; - } - - //only medics can buy the doctor bag - if (type == IID_CHEM_MEDICALBAG && self.class != 1) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "you will need a higher doctor skill\n"); - sprint(self, PRINT_HIGH, "for authorization to purchase those.\n"); - return; - } - - if (type == IID_CHEM_STIMPACK) - max = 4; - if (type == IID_CHEM_SUPERSTIM) - max = 1; - if (type == IID_CHEM_MEDICALBAG) - max = 50; - if (type == IID_CHEM_ADRENALINE) - max = 25; - if (type == IID_CHEM_PSYCHO) - max = 25; - if (type == IID_CHEM_BESERK) - max = 25; - if (type == IID_CHEM_RADX) - max = 5; - - if (self.class == 1) - max = max + 1; - - if (ToIID(self.islot4) == IID_EQUIP_MEDIC_BAG) - max = max * 2; - - alreadygot = TotalQuantity(self, type); - if (alreadygot >= max) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "you can't hold any more of those chems.\n"); - return; - } - - //can only carry two types of chem - typex = 0; - if (SlotOfItem(self, IID_CHEM_STIMPACK) > 0) - typex = typex + 1; - if (SlotOfItem(self, IID_CHEM_SUPERSTIM) > 0) - typex = typex + 1; - if (SlotOfItem(self, IID_CHEM_MEDICALBAG) > 0) - typex = typex + 1; - if (SlotOfItem(self, IID_CHEM_ADRENALINE) > 0) - typex = typex + 1; - if (SlotOfItem(self, IID_CHEM_PSYCHO) > 0) - typex = typex + 1; - if (SlotOfItem(self, IID_CHEM_BESERK) > 0) - typex = typex + 1; - if (SlotOfItem(self, IID_CHEM_RADX) > 0) - typex = typex + 1; - - max = 2; - - if (self.class == 1) - max = 4; - if (ToIID(self.islot4) == IID_EQUIP_MEDIC_BAG) - max = 4; - - if (typex >= max) - { - self.currentmenu = "none"; - sprint(self, PRINT_HIGH, "only authorized to carry "); - if (max == 2) - sprint(self, PRINT_HIGH, "two types of chems (non-medic)\n"); - else - sprint(self, PRINT_HIGH, "four types of chems (medic)\n"); - - return; - } - - if (!TryGiveStackable(self, type, count)) - { - sprint(self, 2, "full inventory.\n"); - return; - } - - sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); - self.ammo_shells = self.ammo_shells - cost; - chemname = GetItemName(type); - sprint(self, PRINT_HIGH, chemname); - sprint(self, PRINT_HIGH, " purchased.\n"); -}; void(string type) ChangeAmmo = { @@ -452,394 +284,6 @@ void() W_PlayerMenu = if (self.currentmenu == "none") return; - else if (self.currentmenu == "shop_list") - { - if (self.impulse == 1) - self.currentmenu = "shop_perk1"; - if (self.impulse == 2) - self.currentmenu = "shop_perk2"; - if (self.impulse == 3) - self.currentmenu = "shop_armor"; - if (self.impulse == 4) - self.currentmenu = "shop_ammo"; - if (self.impulse == 5) - self.currentmenu = "shop_weapons"; - if (self.impulse == 6) - self.currentmenu = "shop_equipment"; - if (self.impulse == 7) - self.currentmenu = "shop_chems"; - if (self.impulse == 8) - self.currentmenu = "shop_other"; - - DisplayMenu(); - return; - } - else if (self.currentmenu == "shop_perk1") - { - if (self.impulse == 1) - BuyPerk(1, 1, 1); - if (self.impulse == 2) - BuyPerk(1, 2, 1); - if (self.impulse == 3) - BuyPerk(1, 3, 1); - if (self.impulse == 4) - BuyPerk(2, 4, 1); - if (self.impulse == 5) - BuyPerk(2, 5, 1); - if (self.impulse == 6) - BuyPerk(2, 6, 1); - if (self.impulse == 7) - BuyPerk(2, 7, 1); - if (self.impulse == 8) - BuyPerk(3, 8, 1); - if (self.impulse == 9) - BuyPerk(4, 9, 1); - if (self.impulse == 10) - BuyPerk(4, 10, 1); - if (self.impulse == 212) - BuyPerk(4, 11, 1); - if (self.impulse == 213) - BuyPerk(4, 12, 1); - if (self.impulse == 214) - BuyPerk(4, 13, 1); - if (self.impulse == 215) - BuyPerk(4, 14, 1); - if (self.impulse == 216) - BuyPerk(4, 15, 1); - if (self.impulse == 217) - BuyPerk(4, 16, 1); - if (self.impulse == 218) - BuyPerk(4, 17, 1); - if (self.impulse == 219) - BuyPerk(4, 18, 1); - if (self.impulse == 220) - BuyPerk(4, 19, 1); - - - return; - } - if (self.currentmenu == "shop_perk2") - { - if (self.impulse == 1) - BuyPerk(1, 1, 2); - if (self.impulse == 2) - BuyPerk(1, 2, 2); - if (self.impulse == 3) - BuyPerk(1, 3, 2); - if (self.impulse == 4) - BuyPerk(2, 4, 2); - if (self.impulse == 5) - BuyPerk(2, 5, 2); - if (self.impulse == 6) - BuyPerk(2, 6, 2); - if (self.impulse == 7) - BuyPerk(2, 7, 2); - if (self.impulse == 8) - BuyPerk(3, 8, 2); - if (self.impulse == 9) - BuyPerk(4, 9, 2); - if (self.impulse == 10) - BuyPerk(4, 10, 2); - if (self.impulse == 212) - BuyPerk(4, 11, 2); - if (self.impulse == 213) - BuyPerk(4, 12, 2); - if (self.impulse == 214) - BuyPerk(4, 13, 2); - if (self.impulse == 215) - BuyPerk(4, 14, 2); - if (self.impulse == 216) - BuyPerk(4, 15, 2); - if (self.impulse == 217) - BuyPerk(4, 16, 2); - if (self.impulse == 218) - BuyPerk(4, 17, 2); - if (self.impulse == 219) - BuyPerk(4, 18, 2); - if (self.impulse == 220) - BuyPerk(4, 19, 2); - - return; - } - - else if (self.currentmenu == "shop_ammo" && world.map_obj != 4) - { - if (self.impulse == 1) - BuyStackableMulti(15,IID_AM_10MM,50); - if (self.impulse == 2) - BuyStackableMulti(25,IID_AM_12GAUGESHELLS,50); - if (self.impulse == 3) - BuyStackableMulti(30,IID_AM_44MAGNUM,50); - if (self.impulse == 4) - BuyStackableMulti(20,IID_AM_45ACP,50); - if (self.impulse == 5) - BuyStackableMulti(30,IID_AM_556MM,50); - if (self.impulse == 6) - BuyStackableMulti(25,IID_AM_5MMHIGHVEL,50); - if (self.impulse == 7) - BuyStackableMulti(40,IID_AM_762MM,50); - if (self.impulse == 8) - BuyStackableMulti(35,IID_AM_NEEDLER,50); - if (self.impulse == 9) - BuyStackableMulti(40,IID_AM_CASELESS, 50); - if (self.impulse == 10) - BuyStackableMulti(55,IID_AM_ENERGYCELL,50); - - if (random() < 0.5) - sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); - else - sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); - - return; - } - else if (self.currentmenu == "shop_ammo" && world.map_obj == 4) - { - if (self.impulse == 1) - BuyStackableMulti(5,IID_AM_10MM,50); - if (self.impulse == 2) - BuyStackableMulti(8,IID_AM_12GAUGESHELLS,50); - if (self.impulse == 3) - BuyStackableMulti(10,IID_AM_44MAGNUM,50); - if (self.impulse == 4) - BuyStackableMulti(7,IID_AM_45ACP,50); - if (self.impulse == 5) - BuyStackableMulti(10,IID_AM_556MM,50); - if (self.impulse == 6) - BuyStackableMulti(8,IID_AM_5MMHIGHVEL,50); - if (self.impulse == 7) - BuyStackableMulti(15,IID_AM_762MM,50); - if (self.impulse == 8) - BuyStackableMulti(10,IID_AM_NEEDLER,50); - if (self.impulse == 9) - BuyStackableMulti(20,IID_AM_CASELESS, 50); - if (self.impulse == 10) - BuyStackableMulti(15,IID_AM_ENERGYCELL,50); - - if (random() < 0.5) - sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); - else - sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); - - return; - } - else if (self.currentmenu == "shop_weapons") - { - if (self.impulse == 1) - self.currentmenu = "shop_melee"; - if (self.impulse == 2) - self.currentmenu = "shop_thrown"; - if (self.impulse == 3) - self.currentmenu = "shop_pistols"; - if (self.impulse == 4) - self.currentmenu = "shop_shotguns"; - if (self.impulse == 5) - self.currentmenu = "shop_rifles"; - if (self.impulse == 6) - self.currentmenu = "shop_heavy"; - - DisplayMenu(); - return; - } - else if (self.currentmenu == "shop_melee") - { - if (self.impulse == 1) - BuyWeapon(1, 6, IID_WP_KNIFE); //weight, cost, item - if (self.impulse == 2) - BuyWeapon(3, 8, IID_WP_WRENCH); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(8, 9, IID_WP_SLEDGE); //weight, cost, item - if (self.impulse == 4) - BuyWeapon(4, 12, IID_WP_SPEAR); //weight, cost, item - - return; - } - else if (self.currentmenu == "shop_thrown") - { - if (self.impulse == 1) - BuyStackableMulti(8, IID_GREN_FLASH, 1); //weight, cost, item - if (self.impulse == 2) - BuyStackableMulti(12, IID_GREN_FRAG, 1); //weight, cost, item - if (self.impulse == 3) - BuyStackableMulti(1, IID_GREN_FLARE, 1); //weight, cost, item - if (self.impulse == 4) - BuyStackableMulti(2, IID_MISC_HMXCOMPOUND, 1); //weight, cost, item - if (self.impulse == 5) - BuyStackableMulti(2, IID_MISC_RDXCRYSTAL, 1); //weight, cost, item - if (self.impulse == 6) - BuyStackableMulti(10, IID_AM_ROCKET, 1); //weight, cost, item - - return; - } - else if (self.currentmenu == "shop_pistols") - { - if (self.impulse == 1) - BuyWeapon(1, 50, IID_WP_USP); //weight, cost, item - if (self.impulse == 2) - BuyWeapon(2, 70, IID_WP_DEAGLE); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(1, 40, IID_WP_GLOCK); //weight, cost, item - if (self.impulse == 4) - BuyWeapon(2, 120, IID_WP_NEEDLER); //weight, cost, item - if (self.impulse == 5) - BuyWeapon(3, 170, IID_WP_MP9); //weight, cost, item - if (self.impulse == 6) - BuyWeapon(3, 150, IID_WP_GREASEGUN); //weight, cost, item - - return; - } - else if (self.currentmenu == "shop_shotguns") - { - if (self.impulse == 1) - BuyWeapon(3, 15, IID_WP_PIPERIFLE); //weight, cost, item - if (self.impulse == 2) - BuyWeapon(4, 60, IID_WP_WINCHESTER); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(5, 240, IID_WP_MOSSBERG); //weight, cost, item - if (self.impulse == 4) - BuyWeapon(7, 350, IID_WP_JACKHAMMER); //weight, cost, item - - return; - } - else if (self.currentmenu == "shop_rifles") - { - if (self.impulse == 1) - BuyWeapon(3, 110, IID_WP_RANGEMASTER); //weight, cost, item - if (self.impulse == 2) - BuyWeapon(4, 180, IID_WP_AK112); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(8, 190, IID_WP_FNFAL); //weight, cost, item - if (self.impulse == 4) - BuyWeapon(9, 270, IID_WP_DKS1); //weight, cost, item - if (self.impulse == 5) - BuyWeapon(5, 280, IID_WP_MOONLIGHT); //weight, cost, item - if (self.impulse == 6) - BuyWeapon(6, 220, IID_WP_G11); //weight, cost, item - - return; - } - else if (self.currentmenu == "shop_heavy") - { - if (self.impulse == 1) - BuyWeapon(10, 650, IID_WP_ROCKETLAUNCHER); //weight, cost, item - if (self.impulse == 2) - BuyWeapon(7, 550, IID_WP_GAUSERIFLE); //weight, cost, item - if (self.impulse == 3) - BuyWeapon(2, 250, IID_WP_ALIENBLASTER); //weight, cost, item - if (self.impulse == 4) - BuyWeapon(11, 450, IID_WP_PULSERIFLE); //weight, cost, item - if (self.impulse == 5) - BuyWeapon(8, 550, IID_WP_PLASMACARBINE); //weight, cost, item - if (self.impulse == 6) - BuyWeapon(25, 650, IID_WP_LASERGATLING); //weight, cost, item - } - else if (self.currentmenu == "shop_equipment") - { - if (self.impulse == 1) - BuyEquipment(5, IID_EQUIP_MEDIC_BAG); //cost, item - if (self.impulse == 2) - BuyEquipment(5, IID_EQUIP_GOGGLES); //cost, item - if (self.impulse == 3) - BuyEquipment(5, IID_EQUIP_STEALTHBOY); //cost, item - if (self.impulse == 4) - BuyEquipment(5, IID_EQUIP_BELTPOUCH); //cost, item - if (self.impulse == 5) - BuyEquipment(5, IID_EQUIP_BACKPACK); //cost, item - if (self.impulse == 6) - BuyEquipment(5, IID_EQUIP_TOOLKIT); //cost, item - if (self.impulse == 7) - BuyEquipment(5, IID_EQUIP_CLIMBINGGEAR); //cost, item - if (self.impulse == 8) - BuyEquipment(5, IID_EQUIP_BATTERY); //cost, item - - return; - } - else if (self.currentmenu == "shop_chems") - { - if (self.impulse == 1) - BuyChem(5, IID_CHEM_STIMPACK, 1); //cost, item - if (self.impulse == 2) - BuyChem(15, IID_CHEM_RADX, 5); //cost, item - if (self.impulse == 3) - BuyChem(15, IID_CHEM_ADRENALINE, 25); //cost, item - if (self.impulse == 4) - BuyChem(25, IID_CHEM_MEDICALBAG, 100); //cost, item - if (self.impulse == 5) - BuyChem(25, IID_CHEM_SUPERSTIM, 1); //cost, item - if (self.impulse == 6) - BuyChem(25, IID_CHEM_PSYCHO, 25); //cost, item - if (self.impulse == 7) - BuyChem(25, IID_CHEM_BESERK, 25); //cost, item - - return; - } - else if (self.currentmenu == "shop_other") - { - if (self.impulse == 1) - BuyStackableMulti(1, IID_MISC_JUNK, 1); //weight, cost, item - if (self.impulse == 2) - BuyStackableMulti(1, IID_MISC_NUKACOLA, 1); //weight, cost, item - if (self.impulse == 3) - BuyStackableMulti(2, IID_MISC_CHEMICALS, 1); //weight, cost, item - if (self.impulse == 4) - BuyStackableMulti(2, IID_MISC_AEROSOL, 1); //weight, cost, item - if (self.impulse == 5) - BuyStackableMulti(5, IID_MISC_CIRCUITBOARD, 1); //weight, cost, item - if (self.impulse == 6) - BuyStackableMulti(3, IID_MISC_STEELPIPE, 1); //weight, cost, item - if (self.impulse == 7) - BuyStackableMulti(1, IID_MISC_DUCKTAPE, 1); //weight, cost, item - if (self.impulse == 8) - BuyStackableMulti(1, IID_MISC_GUM, 1); //weight, cost, item - if (self.impulse == 9) - BuyStackableMulti(1, IID_MISC_COPPERWIRE, 1); //weight, cost, item - if (self.impulse == 10) - BuyStackableMulti(7, IID_MISC_XRAYTUBE, 1); //weight, cost, item - - return; - } - else if (self.currentmenu == "gain_skill") - { - if (self.impulse == 1) - { - self.missionbrief = 2; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "none"; - self.tclass = 1; - self.currentmenu = "confirm_skill"; - self.ghost = 0; - return; - } - if ((self.impulse == 2)) - { - self.missionbrief = 2; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "none"; - self.tclass = 2; - self.currentmenu = "confirm_skill"; - self.ghost = 0; - return; - } - if (self.impulse == 3) - { - self.missionbrief = 2; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "none"; - self.tclass = 3; - self.currentmenu = "confirm_skill"; - self.ghost = 0; - return; - } - if (self.impulse == 4) - { - self.missionbrief = 2; - sound (self, CHAN_WEAPON, "player/yourturn.wav", TRUE, ATTN_NORM); - self.currentmenu = "none"; - self.tclass = 4; - self.currentmenu = "confirm_skill"; - self.ghost = 0; - return; - } - } else if (self.currentmenu == "display_enter_screen") diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index c99f45862..d086fa372 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -87,8 +87,54 @@ void () player_duck = [ 45, player_run ] { }; + +void () CrawlSound = +{ + local float rand; + local float r; + + + + + rand = random (); + + if (self.sneak != 0) + return; + if (self.velocity == '0 0 0') + { + self.crawltime = 0; + return; + } + + + self.attack_finished = time + 1; + self.rtime = time + 1; + + + r = 1 - (self.skill_sneak/40); + + if ((rand < 0.25)) + sound (self, CHAN_ITEM, "player/prone1.wav", r, ATTN_NORM); + else if ((rand < 0.5)) + sound (self, CHAN_ITEM, "player/prone2.wav", r, ATTN_NORM); + else if ((rand < 0.75)) + sound (self, CHAN_ITEM, "player/prone3.wav", r, ATTN_NORM); + else + sound (self, CHAN_ITEM, "player/prone4.wav", r, ATTN_NORM); + + +}; + + void () player_lay = [ 45, player_run ] { + self.crawltime = self.crawltime - 1; + + if (self.crawltime <= 0) + { + CrawlSound(); + self.crawltime = 8; + } }; void () player_single_shot = [ 89, player_single_shot2 ]{}; diff --git a/quakec/fallout2/shambler.qc b/quakec/fallout2/shambler.qc index 3322a08cb..1c9579534 100644 --- a/quakec/fallout2/shambler.qc +++ b/quakec/fallout2/shambler.qc @@ -179,9 +179,8 @@ void() sham_melee = local float chance; chance = random(); - if (self.class == 3) - sham_smash1 (); - else if (self.class == 5 && chance > 0.3) + + if (chance > 0.5) sham_swingr1 (); else sham_swingl1 (); @@ -521,7 +520,6 @@ void() monster_shambler = if (random() < 0.001)//shambler warrior { - self.class = 3; self.solid = SOLID_SLIDEBOX; self.movetype = MOVETYPE_STEP; setmodel (self, "progs/shambler.mdl"); @@ -539,7 +537,6 @@ void() monster_shambler = } else //shambler shaman { - self.class = 5; self.solid = SOLID_SLIDEBOX; self.movetype = MOVETYPE_STEP; setmodel (self, "progs/shambler.mdl"); diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index 16250d3e0..de88582d4 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -1706,7 +1706,7 @@ void () monster_army = self.max_health = 80; self.health = self.max_health; self.team = 3; - self.islot3 = SlotVal(IID_ARM_LEATHER, 1); + self.islot3 = SlotVal(IID_ARM_LEATHER, 1); self.armortype = 0.2; self.armornoise = "misc/thud.wav"; self.th_stand = army_stand1; @@ -1732,8 +1732,8 @@ void () monster_army = //soldiers have either pistol, smg, shotgun or rifle - if (random()*100 >= 80) - self.weapon = ceil(random()*4); + if (random()*100 >= 50) + self.weapon = 4; else self.weapon = 2; @@ -1901,7 +1901,7 @@ void () monster_commander = setsize (self, '-12 -12 -24', '12 12 32'); self.max_health = 200; self.health = self.max_health; - self.islot3 = SlotVal(IID_ARM_COMBAT, 1); + self.islot3 = SlotVal(IID_ARM_COMBAT, 1); self.armortype = 0.5; self.helmet = 1; self.th_stand = enf_stand1; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 86ffe2b72..899513969 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -102,6 +102,49 @@ float() crandom = +float (entity healer, entity saved) RevivePlayer = +{ + local entity oself; + oself = self; + + self = saved; +/* if (!walkmove(0, 0)) + { + //too close? + return FALSE; + } +*/ + saved.deadflag = DEAD_NO; + saved.takedamage = DAMAGE_AIM; + saved.movetype = MOVETYPE_WALK; +// saved.solid = SOLID_NOT; + + self = oself; + +// saved.materialize = 200; + saved.ghost = 0; + saved.health = 20 + (healer.skill_doctor); + saved.air_finished = time + 10; + saved.view_ofs = '0 0 22'; + self = saved; + player_run(); + self = oself; + stuffcmd(saved, "impulse 1\n"); + if (healer.classname == "player") + { + sprint (healer, PRINT_HIGH, "you revive "); + sprint (healer, PRINT_HIGH, trace_ent.netname); + sprint (healer, PRINT_HIGH, ".\n "); + } + sprint (saved, PRINT_HIGH, healer.netname); + sprint (saved, PRINT_HIGH, " saves you from death.\n"); + saved.view2 = world; + + saved.flags (-) FL_FINDABLE_NONSOLID; + + return TRUE; +}; + void() healing_bob = { @@ -142,6 +185,36 @@ void (entity spot) spawn_healing = }; +void () heart_think = +{ + self.cnt = self.cnt - 1; + setorigin (self, (self.owner.origin + '0 0 48')); + self.nextthink = (time + 0.01); + if (self.cnt <= 0) + remove (self); + + if (self.owner.charmed <= 0) + remove(self); +}; + +void (entity jeb, float length) spawn_heart = +{ + local entity hologram; + + hologram = spawn (); + hologram.movetype = MOVETYPE_NONE; + hologram.solid = SOLID_NOT; + hologram.owner = jeb; + setmodel (hologram, "progs/heart.spr"); + setorigin (hologram, jeb.origin + '0 0 48'); + setsize (hologram, VEC_ORIGIN, VEC_ORIGIN); + hologram.angles = jeb.angles; + hologram.colormap = jeb.colormap; + hologram.cnt = 100*length; + hologram.think = heart_think; + hologram.nextthink = (time + 0.01); +}; + void () disappear = { local entity te; @@ -150,35 +223,14 @@ void () disappear = //other players - te = findradius(self.origin, 600); + te = findradius(self.origin, 6000); while (te) { - if (te.classname == "player" && te.sneak == 0 && te != self) - nearby = 1; + if (te.enemy == self) + te.enemy = world; te = te.chain; } - - if (nearby == 1) - { - te = findradius(self.origin, 1000); - while (te) - { - if (te.enemy == self) - te.enemy = world; - - te = te.chain; - } - } - - te = findradius(self.origin, 1000); - while (te) - { - if (te.enemy == self) - te.enemy = world; - - te = te.chain; - } }; void () puppet_master = @@ -194,10 +246,10 @@ void () puppet_master = { if (te.classname == "monster" && (charm_monster == 0) && (visible(te))) { - spawn_excla(te, 60); + spawn_heart(te, 300); charm_monster = 1; te.friend = self; - te.charmed = 1; + te.charmed = 300; te.enemy = world; te.goalentity = self; self.friend = te; @@ -207,6 +259,108 @@ void () puppet_master = }; + +void () illusion_heal = +{ + local float x, found; + local vector source; + local entity thing, te; + + + if (self.attack_finished > time) + return; + + te = findradius (self.origin, 100); + while (te) + { + + if (found == 0 && te.classname == "player" && te.deadflag) + { + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + RevivePlayer(self, te); + spawn_healing(te); + spawn_healing(te); + spawn_healing(te); + spawn_healing(te); + spawn_healing(te); + spawn_healing(te); + found = 1; + } + + te = te.chain; + } + + if (found == 1) + return; + + self.attack_finished = time + 1; + self.rtime = 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)//nobody in front of user, so heal self + { + if (self.health >= self.max_health) + sprint(self, PRINT_MEDIUM, "you are not injured.\n"); + else if (self.health < self.max_health) + { + + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + sprint(self, PRINT_MEDIUM, "you heal yourself with a placebo stimpack\n"); + + self.health = self.max_health; + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + } + } + else if (trace_ent.classname == "player")//healing another team-mate + { + if (trace_ent.health >= trace_ent.max_health) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is not injured.\n"); + } + else if (trace_ent.health < trace_ent.max_health) + { + if (trace_ent.deadflag) + { + sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + RevivePlayer(self, trace_ent); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + } + else + { + sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + self.score = self.score + 1; + sprint(trace_ent, PRINT_MEDIUM, self.netname); + sprint(trace_ent, PRINT_MEDIUM, " heals you with a placebo stimpack\n"); + sprint(self, PRINT_MEDIUM, "you heal "); + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " with a placebo stimpack\n"); + + trace_ent.health = trace_ent.max_health; + spawn_healing(trace_ent); + spawn_healing(trace_ent); + spawn_healing(trace_ent); + spawn_healing(trace_ent); + spawn_healing(trace_ent); + spawn_healing(trace_ent); + } + } + } +}; + void () puppet_master_command = { local entity te, ent; @@ -216,6 +370,9 @@ void () puppet_master_command = makevectors (self.v_angle); traceline (self.origin, self.origin+v_forward*4000, FALSE, self); + if (self.friend.classname != "monster") + return; + if (trace_ent.classname == "monster" && trace_ent != self.friend) { self.friend.enemy = trace_ent; @@ -282,7 +439,10 @@ void(float slotno) UsePerk = WriteCoord (MSG_MULTICAST, org_y); WriteCoord (MSG_MULTICAST, org_z); + + self.invistime = 10; disappear(); + sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); } if ((self.perk1 == 3 && slotno == 1) || (self.perk2 == 3 && slotno == 2)) @@ -335,6 +495,34 @@ void(float slotno) UsePerk = te = te.chain; } } + else if ((self.perk1 == 8 && slotno == 1) || (self.perk2 == 8 && slotno == 2)) + { + if (slotno == 1) + self.perk1timer = 2000; + if (slotno == 2) + self.perk2timer = 2000; + + sound (self, CHAN_BODY, "items/damage.wav", 1, ATTN_NORM); + sprint(self, 2, "it is time...\n"); + self.supertime = 20; + self.skill_combat = self.skill_combat + 20; + self.skill_doctor = self.skill_doctor + 20; + self.skill_sneak = self.skill_sneak + 20; + self.skill_science = self.skill_science + 20; + self.skill_speech = self.skill_speech + 20; + } + else if ((self.perk1 == 9 && slotno == 1) || (self.perk2 == 9 && slotno == 2)) + { + if (slotno == 1) + self.perk1timer = 2000; + if (slotno == 2) + self.perk2timer = 2000; + + + + illusion_heal(); + + } else if ((self.perk1 == 11 && slotno == 1) || (self.perk2 == 11 && slotno == 2)) { if (self.radiation <= 0) @@ -345,15 +533,15 @@ void(float slotno) UsePerk = if (slotno == 2) self.perk2timer = 2000; - if (self.radiation <= 25) + if (self.radiation <= 10) { eat = self.radiation; self.radiation = 0; } else { - eat = 25; - self.radiation = self.radiation - 25; + eat = 10; + self.radiation = self.radiation - 10; } self.health = self.health + eat; @@ -378,48 +566,7 @@ void() muzzleflash = }; -float (entity healer, entity saved) RevivePlayer = -{ - local entity oself; - oself = self; - self = saved; -/* if (!walkmove(0, 0)) - { - //too close? - return FALSE; - } -*/ - saved.deadflag = DEAD_NO; - saved.takedamage = DAMAGE_AIM; - saved.movetype = MOVETYPE_WALK; -// saved.solid = SOLID_NOT; - - self = oself; - -// saved.materialize = 200; - saved.ghost = 0; - saved.health = 20 + (healer.skill_doctor); - saved.air_finished = time + 10; - saved.view_ofs = '0 0 22'; - self = saved; - player_run(); - self = oself; - stuffcmd(saved, "impulse 1\n"); - if (healer.classname == "player") - { - sprint (healer, PRINT_HIGH, "you revive "); - sprint (healer, PRINT_HIGH, trace_ent.netname); - sprint (healer, PRINT_HIGH, ".\n "); - } - sprint (saved, PRINT_HIGH, healer.netname); - sprint (saved, PRINT_HIGH, " saves you from death.\n"); - saved.view2 = world; - - saved.flags (-) FL_FINDABLE_NONSOLID; - - return TRUE; -}; /* ================ @@ -458,7 +605,7 @@ void(float damage, float dist, float rate) FireMelee = if (dot < 0.5 && trace_ent.takedamage) { - tdam = 20 + (20*self.skill_sneak); + tdam = 20 + (60*self.skill_sneak); if (getperk(9)) tdam = 900; @@ -527,9 +674,6 @@ void(float damage, float dist, float rate) FireMelee = } else if (trace_ent.takedamage) { - //soldiers and assassins do more melee damage - if (self.class == 2 || self.class == 3) - damage = damage * 1.25; if (weap == IID_WP_SLEDGE || weap == IID_WP_SPEAR || weap == IID_WP_KNIFE) SpawnBlood (org, 1); @@ -585,9 +729,9 @@ void() W_FireMelee = else if (iid == IID_WP_WRENCH) FireMelee(5+random()*30, 64, 1.2); else if (iid == IID_WP_KNIFE) - FireMelee(5+random()*20, 64, 0.4); + FireMelee(5+(self.skill_sneak*4)+random()*20, 64, 0.4); else if (iid == IID_WP_SLEDGE) - FireMelee(5+random()*80, 96, 1); + FireMelee(5+(self.skill_combat*6)+random()*40, 96, 1); else if (iid == IID_WP_SPEAR) FireMelee(5+random()*60, 160, 0.8); @@ -1754,8 +1898,6 @@ void() W_Attack = if (self.rtime > time) return; - if (self.class == 0) - return; if (self.team == 0) return; if (self.attack_finished > time) @@ -1972,8 +2114,8 @@ void() W_ChangeWeapon = } fl = IT_NAILGUN; self.current_slot = 1; - if (IsMelee(ToIID(self.islot1))) - SpawnGModel(); + // if (IsMelee(ToIID(self.islot1))) + // SpawnGModel(); } else if (self.impulse == 2 && self.current_slot != 2) { @@ -1985,8 +2127,8 @@ void() W_ChangeWeapon = } fl = IT_SUPER_NAILGUN; self.current_slot = 2; - if (IsMelee(ToIID(self.islot2))) - SpawnGModel(); + // if (IsMelee(ToIID(self.islot2))) + // SpawnGModel(); } self.weapon = fl; @@ -2007,6 +2149,7 @@ void() CheatCommand = local entity te; sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + self.ammo_shells = 900; }; /* @@ -2485,23 +2628,38 @@ void (vector org) bullet_hole = WriteCoord (MSG_MULTICAST, org_y); WriteCoord (MSG_MULTICAST, org_z); multicast (self.origin, MULTICAST_PHS); - +/* r = random(); ric = spawn(); setorigin(ric, org); - if (r <= 0.20) - sound (ric, CHAN_WEAPON, "weapons/ric1.wav", TRUE, ATTN_NORM); + if (r <= 0.08) + sound (ric, CHAN_WEAPON, "contact/rico1.wav", TRUE, ATTN_NORM); + else if (r <= 0.16) + sound (ric, CHAN_WEAPON, "contact/rico2.wav", TRUE, ATTN_NORM); + else if (r <= 0.24) + sound (ric, CHAN_WEAPON, "contact/rico3.wav", TRUE, ATTN_NORM); + else if (r <= 0.32) + sound (ric, CHAN_WEAPON, "contact/rico4.wav", TRUE, ATTN_NORM); else if (r <= 0.40) - sound (ric, CHAN_WEAPON, "weapons/ric2.wav", TRUE, ATTN_NORM); - else if (r <= 0.60) - sound (ric, CHAN_WEAPON, "weapons/ric3.wav", TRUE, ATTN_NORM); + sound (ric, CHAN_WEAPON, "contact/rico5.wav", TRUE, ATTN_NORM); + else if (r <= 0.48) + sound (ric, CHAN_WEAPON, "contact/rico6.wav", TRUE, ATTN_NORM); + else if (r <= 0.56) + sound (ric, CHAN_WEAPON, "contact/rico7.wav", TRUE, ATTN_NORM); + else if (r <= 0.64) + sound (ric, CHAN_WEAPON, "contact/rico8.wav", TRUE, ATTN_NORM); + else if (r <= 0.72) + sound (ric, CHAN_WEAPON, "contact/rico9.wav", TRUE, ATTN_NORM); else if (r <= 0.80) - sound (ric, CHAN_WEAPON, "weapons/ric4.wav", TRUE, ATTN_NORM); + sound (ric, CHAN_WEAPON, "contact/rico10.wav", TRUE, ATTN_NORM); + else if (r <= 0.90) + sound (ric, CHAN_WEAPON, "contact/rico11.wav", TRUE, ATTN_NORM); else - sound (ric, CHAN_WEAPON, "weapons/ric5.wav", TRUE, ATTN_NORM); + sound (ric, CHAN_WEAPON, "contact/rico12.wav", TRUE, ATTN_NORM); - remove(ric); + ric.think = SUB_Remove; + ric.nextthink = time + 1;*/ }; void (vector test, float length, float dam) penetrate = @@ -3042,9 +3200,6 @@ void (float dam, float ap, string snd, float rng, float rate) FirePistol = dam = dam + self.skill_doctor; } - if (self.extender == weap && self.silencer != weap) - dam = dam * 1.10; - sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); @@ -4943,9 +5098,6 @@ void () ExitScreen = self.impulse = 0; - if (self.class == 0) - return; - if (self.ghost == 1) return; @@ -5167,10 +5319,10 @@ void () ExitScreen = } if (trace_ent.classname == "monster" && trace_ent.health > 0) { - if (self.sneak == 0) + if (self.sneak <= 0) return; - if (self.class != 2) + if (self.skill_sneak <= 0) return; if (self.currentmenu != "none") @@ -5262,42 +5414,14 @@ void () Sneak = self.sneak = 0; return; } - if (self.sneak == 0) + else { sound (self, CHAN_BODY, "items/inv1.wav", 1, ATTN_NORM); - self.sneak = 1; + self.sneak = 99; return; } }; -void () Shield = -{ - if (self.class != 6) - { - centerprint (self, "You can't shield yourself!\n"); - return; - } - if (self.sneak == 2) - { - centerprint (self, " Unshielded \n"); - self.sneak = 0; - sound (self, CHAN_BODY, "items/protect2.wav", 1, ATTN_NORM); - return; - } - if (self.ammo_cells < 10) - { - centerprint (self, "wait for your shield to recharge.\n"); - return; - } - if (self.sneak == 0) - { - centerprint (self, " Energy Shield \n"); - self.sneak = 2; - sound (self, CHAN_BODY, "items/protect.wav", 1, ATTN_NORM); - return; - } - -}; void () station_die = { @@ -5866,114 +5990,6 @@ void () BuyMenu = void () CharacterSheet = { - local string x; - local float qq; - local float ratio; - local float r1; - local float r2; - - stuffcmd (self, "toggleconsole\n"); - sprint (self, PRINT_HIGH, "\n\n\n\n ** INFO ** \n"); - sprint (self, PRINT_HIGH, "Class ‘ "); - if (self.class == 1) - sprint (self, 2, "Medic"); - if (self.class == 2) - sprint (self, 2, "Assassin"); - if (self.class == 3) - sprint (self, 2, "Soldier"); - if (self.class == 4) - sprint (self, 2, "Scientist"); - - sprint (self, PRINT_HIGH, "\nTeam ‘ "); - - if (self.team == 1) - sprint (self, 2, "Rangers\n"); - if (self.team == 2) - sprint (self, 2, "Raiders\n"); - - sprint (self, PRINT_HIGH, "Score ‘ "); - r1 = (self.score); - - x = ftos (r1); - sprint (self, 2, x); - - sprint (self, PRINT_HIGH, "\nSpeed ‘ "); - x = ftos (self.maxspeed); - sprint (self, 2, x); - sprint (self, PRINT_HIGH, "/300\n"); - sprint (self, PRINT_HIGH, "Money ‘ "); - - x = ftos (self.ammo_shells); - sprint (self, 2, x); - sprint (self, PRINT_HIGH, "$\n"); - -/* - sprint (self, PRINT_HIGH, "\nArmor ‘ "); - x = GetArmorName(); - sprint (self, 2, x); - sprint (self, 2, " ("); - 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); - x = ftos (self.chemcount); - sprint (self, 2, "["); - sprint (self, 2, x); - sprint (self, 2, "]"); - sprint (self, 2, "\n"); -*/ - sprint (self, PRINT_HIGH, "Gadget ‘ "); - - x = GetEquipmentName(); - sprint (self, 2, x); - sprint (self, 2, "\n"); - sprint (self, PRINT_HIGH, "Perk ‘ "); - x = GetPerkName(); - sprint (self, 2, x); - sprint (self, 2, "\n"); - sprint (self, PRINT_HIGH, "Trait ‘ "); - 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); - sprint (self, 2, " ("); - x = ftos (self.slot1_weight); - sprint (self, 2, x); - sprint (self, 2, ") ("); - sprint (self, 2, self.ammotype1); - sprint (self, 2, ")\n"); - - sprint (self, PRINT_HIGH, "Weapon 2 ‘ "); - x = GetWeaponName (self, self.slot2); - sprint (self, 2, x); - sprint (self, 2, " ("); - x = ftos (self.slot2_weight); - sprint (self, 2, x); - sprint (self, 2, ") ("); - sprint (self, 2, self.ammotype2); - sprint (self, 2, ")\n\n"); -*/ - qq = weightx (); - sprint (self, PRINT_HIGH, "Weight ‘ "); - x = ftos (qq); - sprint (self, 2, x); - qq = self.max_weight; - sprint (self, PRINT_HIGH, "/"); - x = ftos (qq); - sprint (self, 2, x); - sprint (self, PRINT_HIGH, "\n"); - return; }; void () UseEquipment = @@ -6560,278 +6576,6 @@ void() show_light_level = bprint(2, y); bprint(2, "\n"); }; - -void() AttachSilencer = -{ - local float weap, x, y; - - weap = ToIID(self.(SlotField(self.current_slot))); - - y = SlotOfItem(self, IID_EQUIP_SILENCER); - - if (weap == IID_WP_USP) - { - sprint(self, 2, "silencer attached.\n"); - DecreaseDestroySlot(y); - - if (self.current_slot == 1) - { - x = ToStatus(self.islot1); - self.islot1 = 0; - SetItemSlot(self, 1, SlotVal(IID_WP_USP_S, x)); - return; - } - if (self.current_slot == 2) - { - x = ToStatus(self.islot2); - self.islot2 = 0; - SetItemSlot(self, 2, SlotVal(IID_WP_USP_S, x)); - return; - } - } - else if (weap == IID_WP_DKS1) - { - sprint(self, 2, "silencer attached.\n"); - DecreaseDestroySlot(y); - - if (self.current_slot == 1) - { - x = ToStatus(self.islot1); - self.islot1 = 0; - SetItemSlot(self, 1, SlotVal(IID_WP_DKS1_S, x)); - return; - } - if (self.current_slot == 2) - { - x = ToStatus(self.islot2); - self.islot2 = 0; - SetItemSlot(self, 2, SlotVal(IID_WP_DKS1_S, x)); - return; - } - } - else if (weap == IID_WP_GLOCK) - { - sprint(self, 2, "silencer attached.\n"); - DecreaseDestroySlot(y); - - if (self.current_slot == 1) - { - x = ToStatus(self.islot1); - self.islot1 = 0; - SetItemSlot(self, 1, SlotVal(IID_WP_GLOCK_S, x)); - return; - } - if (self.current_slot == 2) - { - x = ToStatus(self.islot2); - self.islot2 = 0; - SetItemSlot(self, 2, SlotVal(IID_WP_GLOCK_S, x)); - return; - } - } - else if (weap == IID_WP_MP9) - { - sprint(self, 2, "silencer attached.\n"); - DecreaseDestroySlot(y); - - if (self.current_slot == 1) - { - x = ToStatus(self.islot1); - self.islot1 = 0; - SetItemSlot(self, 1, SlotVal(IID_WP_MP9_S, x)); - return; - } - if (self.current_slot == 2) - { - x = ToStatus(self.islot2); - self.islot2 = 0; - SetItemSlot(self, 2, SlotVal(IID_WP_MP9_S, x)); - return; - } - } - else if (weap == IID_WP_GREASEGUN) - { - sprint(self, 2, "silencer attached.\n"); - DecreaseDestroySlot(y); - - if (self.current_slot == 1) - { - x = ToStatus(self.islot1); - self.islot1 = 0; - SetItemSlot(self, 1, SlotVal(IID_WP_GREASEGUN_S, x)); - return; - } - if (self.current_slot == 2) - { - x = ToStatus(self.islot2); - self.islot2 = 0; - SetItemSlot(self, 2, SlotVal(IID_WP_GREASEGUN_S, x)); - return; - } - } - else if (weap == IID_WP_PIPERIFLE) - { - sprint(self, 2, "silencer attached.\n"); - DecreaseDestroySlot(y); - - if (self.current_slot == 1) - { - x = ToStatus(self.islot1); - self.islot1 = 0; - SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_S, x)); - return; - } - if (self.current_slot == 2) - { - x = ToStatus(self.islot2); - self.islot2 = 0; - SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_S, x)); - return; - } - } - else if (weap == IID_WP_PIPERIFLE_R) - { - sprint(self, 2, "silencer attached.\n"); - DecreaseDestroySlot(y); - - if (self.current_slot == 1) - { - x = ToStatus(self.islot1); - self.islot1 = 0; - SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_S_R, x)); - return; - } - if (self.current_slot == 2) - { - x = ToStatus(self.islot2); - self.islot2 = 0; - SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_S_R, x)); - return; - } - } - else if (weap == IID_WP_PIPERIFLE_SCOPE) - { - sprint(self, 2, "silencer attached.\n"); - DecreaseDestroySlot(y); - - if (self.current_slot == 1) - { - x = ToStatus(self.islot1); - self.islot1 = 0; - SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_SCOPE_S, x)); - return; - } - if (self.current_slot == 2) - { - x = ToStatus(self.islot2); - self.islot2 = 0; - SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_SCOPE_S, x)); - return; - } - } - else if (weap == IID_WP_PIPERIFLE_SCOPE_R) - { - sprint(self, 2, "silencer attached.\n"); - DecreaseDestroySlot(y); - - if (self.current_slot == 1) - { - x = ToStatus(self.islot1); - self.islot1 = 0; - SetItemSlot(self, 1, SlotVal(IID_WP_PIPERIFLE_SCOPE_S_R, x)); - return; - } - if (self.current_slot == 2) - { - x = ToStatus(self.islot2); - self.islot2 = 0; - SetItemSlot(self, 2, SlotVal(IID_WP_PIPERIFLE_SCOPE_S_R, x)); - return; - } - } - else - { - sprint(self, 2, "cannot be silenced.\n"); - return; - } - -}; - - -void() AttachExtender = -{ - local float weap; - - weap = ToIID(self.(SlotField(self.current_slot))); - - if (weap == IID_WP_NEEDLER || weap == IID_WP_MOONLIGHT) - { - sprint(self, 2, "that weapon already has a silencer attached\n"); - return; - } - if (weap == IID_WP_ALIENBLASTER) - { - sprint(self, 2, "how exactly do you extend that???\n"); - return; - } - if (self.silencer == weap) - { - sprint(self, 2, "that weapon already has a silencer attached\n"); - return; - } - else if (ToIID(self.islot4) == IID_EQUIP_EXTENDER && self.extender == 0) - { - self.extender = weap; - sprint(self, 2, "extender attached.\n"); - self.islot4 = 0; - self.attack_finished = time + 1; - self.rtime = time + 1; - return; - } -/* - else if (ToIID(self.islot4) == IID_EQUIP_EXTENDER && self.extender > 0) - { - self.extender = 0; - sprint(self, 2, "removing extender...\n"); - self.attack_finished = time + 1; - return; - }*/ -}; - -void (float iid) RemoveSilencer = -{ - if (ToIID(self.islot4) == 0) - { - SetItemSlot(self, 4, SlotVal(IID_EQUIP_SILENCER, 1)); - sprint(self, 2, "removing silencer...\n"); - self.attack_finished = time + 1; - self.rtime = time + 1; - self.silencer = 0; - } - else if (ToIID(self.islot4) > 0) - { - sprint(self, 2, "can't remove silencer, equipment slot is full\n"); - return; - } -}; - -void (float iid) RemoveExtender = -{ - if (ToIID(self.islot4) == 0) - { - SetItemSlot(self, 4, SlotVal(IID_EQUIP_EXTENDER, 1)); - sprint(self, 2, "removing extender...\n"); - self.attack_finished = time + 1; - self.rtime = time + 1; - self.extender = 0; - } - else if (ToIID(self.islot4) > 0) - { - sprint(self, 2, "can't remove extender, equipment slot is full\n"); - return; - } -}; - void (string snd, float type) function_radio = { diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 43063c6a8..6c888c538 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -61,7 +61,7 @@ void() SetupStats = clientstat(60, 2, perk1); clientstat(61, 2, current_slot); clientstat(62, 2, team); - clientstat(63, 2, class); + clientstat(63, 2, shadowtime); clientstat(64, 2, start_time); clientstat(65, 2, location); clientstat(66, 2, map_obj); @@ -101,7 +101,7 @@ void() SetupStats = clientstat(101, 2, skill_doctor); clientstat(102, 2, skill_sneak); clientstat(103, 2, skill_science); - clientstat(104, 2, shadowtime); + clientstat(104, 2, skill_speech); clientstat(105, 2, announcercache); clientstat(106, 2, radiation); clientstat(108, 2, safezone); @@ -124,6 +124,7 @@ void() get_difficulty = { local entity te; local float cr; + local string rating; //challenge rating system // @@ -136,21 +137,13 @@ void() get_difficulty = te = find (world, classname, "player"); while (te) { - - if (te.ammo_shells > 200)//money - challenge_rating += 1; - if (te.ammo_shells > 500)//money - challenge_rating += 1; - if (ToIID(te.islot1) >= IID_WP_AK112 || ToIID(te.islot2) >= IID_WP_AK112)//good weapon - challenge_rating += 1; - if (ToIID(te.islot3) >= IID_ARM_COMBAT)//good armor - challenge_rating += 1; + challenge_rating += GetItemThreatLevel(ToIID(te.islot1)); + challenge_rating += GetItemThreatLevel(ToIID(te.islot1)); + challenge_rating += GetItemThreatLevel(ToIID(te.islot3)); te = te.chain; } - if (challenge_rating > 24) - challenge_rating = 24; }; void() load_monster = @@ -623,7 +616,9 @@ if (coop == 1) // Players vs Monsters local float combat; combat = 0; - get_difficulty(); + + if (random()*100<25); + get_difficulty(); te = find(world, classname, "monster"); while (te) @@ -664,7 +659,7 @@ if (coop == 1) // Players vs Monsters while (te) { - if (te.health > 0 && te.class > 0) + if (te.health > 0 && te.team > 0) pcount = pcount + 1; if (te.health <= 0) pdead = pdead + 1; @@ -752,7 +747,7 @@ if (coop == 1) // Players vs Monsters { ze.missionbrief = 3; ze.announcercache = 3; - ze.ammo_shells = ze.ammo_shells + (3*rescue); + ze.ammo_shells = ze.ammo_shells + (5*rescue); ze.endinfo1 = rescue; ze.endinfo2 = hostages; ze.endinfo3 = dead_hostage; @@ -775,7 +770,7 @@ if (coop == 1) // Players vs Monsters { ze.missionbrief = 3; ze.announcercache = 4; - ze.ammo_shells = ze.ammo_shells + (3*rescue); + ze.ammo_shells = ze.ammo_shells + (5*rescue); ze.endinfo1 = rescue; ze.endinfo2 = hostages; ze.endinfo3 = dead_hostage; @@ -1408,7 +1403,7 @@ void () RecoilControl = } - te.recoil = te.recoil - (0.20+(te.skill_combat*0.005)); + te.recoil = te.recoil - (0.15+(te.skill_combat*0.005) + (te.skill_doctor*0.003) + (te.skill_sneak*0.002)); } else { @@ -1608,8 +1603,9 @@ void() worldspawn = precache_model ("progs/ammobox2.mdl"); precache_model ("progs/stop.spr"); precache_model ("progs/healing.spr"); + precache_model ("progs/heart.spr"); - precache_model ("progs/v_axe.mdl"); + precache_model ("progs/v_disruptor.mdl"); precache_model ("progs/v_span.mdl"); precache_model ("progs/v_nail.mdl"); precache_model ("progs/v_rock.mdl"); @@ -1695,10 +1691,6 @@ void() worldspawn = precache_model ("progs/w_bozar.mdl"); precache_model ("progs/money.mdl"); - precache_model ("progs/turrgun.mdl"); - precache_model ("progs/turrbase.mdl"); - precache_model ("progs/miniturr.mdl"); - precache_model ("progs/minibase.mdl"); precache_model ("progs/grenade2.mdl"); precache_model ("maps/b_bh10.bsp"); @@ -1762,12 +1754,20 @@ void() worldspawn = precache_sound ("misc/hosdown.wav"); precache_sound ("misc/rescued.wav"); precache_sound ("misc/beep1.wav"); + precache_sound ("misc/beep2.wav"); precache_sound ("misc/r_tele4.wav"); precache_sound ("buttons/switch02.wav"); precache_sound ("buttons/switch04.wav"); precache_sound ("misc/secret.wav"); - precache_sound ("misc/fanfare.wav"); + precache_sound ("player/levelup.wav"); + precache_sound ("items/damage.wav"); + precache_sound ("items/damage2.wav"); + + precache_sound ("player/prone1.wav"); + precache_sound ("player/prone2.wav"); + precache_sound ("player/prone3.wav"); + precache_sound ("player/prone4.wav"); precache_sound ("player/gib1.wav"); precache_sound ("player/step1.wav"); precache_sound ("player/step2.wav"); @@ -1817,11 +1817,7 @@ void() worldspawn = precache_sound ("weapons/mp5.wav"); precache_sound ("weapons/mp7.wav"); precache_sound ("weapons/rangem.wav"); - precache_sound ("weapons/ric1.wav"); - precache_sound ("weapons/ric2.wav"); - precache_sound ("weapons/ric3.wav"); - precache_sound ("weapons/ric4.wav"); - precache_sound ("weapons/ric5.wav"); + precache_sound ("weapons/tink1.wav"); precache_sound ("weapons/shell.wav"); precache_sound ("weapons/reload.wav"); @@ -1839,6 +1835,24 @@ void() worldspawn = precache_sound ("player/headshot.wav"); precache_sound ("player/hit1.wav"); + + precache_sound ("contact/armor1.wav"); + precache_sound ("contact/armor2.wav"); + precache_sound ("contact/armor3.wav"); + + precache_sound ("contact/rico1.wav"); + precache_sound ("contact/rico2.wav"); + precache_sound ("contact/rico3.wav"); + precache_sound ("contact/rico4.wav"); + precache_sound ("contact/rico5.wav"); + precache_sound ("contact/rico6.wav"); + precache_sound ("contact/rico7.wav"); + precache_sound ("contact/rico8.wav"); + precache_sound ("contact/rico9.wav"); + precache_sound ("contact/rico10.wav"); + precache_sound ("contact/rico11.wav"); + precache_sound ("contact/rico12.wav"); + precache_sound ("player/paina.wav"); precache_sound ("player/painb.wav"); precache_sound ("player/yourturn.wav"); From b1a0130a3d3417efb2df5c5d5d997e3d23554ef2 Mon Sep 17 00:00:00 2001 From: Magnus Date: Sat, 21 Nov 2009 17:39:22 +0000 Subject: [PATCH 34/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3471 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 9 +- quakec/fallout2/inventory.qc | 168 +++++++++++++++++++++-------------- quakec/fallout2/player.qc | 13 ++- quakec/fallout2/weapons.qc | 46 ++++++++-- quakec/fallout2/world.qc | 46 ++-------- 5 files changed, 166 insertions(+), 116 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index fd116ec8d..18bc8a92e 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -12,7 +12,7 @@ void(entity to, float iid, float amount) AddStackable; void(entity to, float iid, float amount) AddNonStackable; void() shop_face; -float modelindex_dead, modelindex_sneak, modelindex_prone, modelindex_eyes, modelindex_player, modelindex_gone, modelindex_melee; +float modelindex_dead, modelindex_sneak, modelindex_prone, modelindex_eyes, modelindex_player, modelindex_gone, modelindex_melee, modelindex_crawl; /* ============================================================================= @@ -676,6 +676,9 @@ void() PutClientInServer = setmodel (self, "progs/eyes.mdl"); modelindex_eyes = self.modelindex; + setmodel (self, "progs/prone.mdl"); + modelindex_crawl = self.modelindex; + setmodel (self, "progs/lay.mdl"); modelindex_prone = self.modelindex; @@ -1933,8 +1936,10 @@ void() CheckPowerups = if (self.position <= 1) self.modelindex = modelindex_player; - if (self.position == 2) + if (self.position == 2 && self.velocity == '0 0 0') self.modelindex = modelindex_prone; + if (self.position == 2 && self.velocity != '0 0 0') + self.modelindex = modelindex_crawl; if (self.sneak > 0 && coop == 0) self.modelindex = modelindex_gone; if (self.sneak > 0 && coop == 1) diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 527bbe088..680af4f11 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -2567,7 +2567,7 @@ string (float slot, float int) PerkName = if (int == 1) return "Support Fire"; if (int == 2) - return "Duck And Cover"; + return "I Disappear"; if (int == 3) return "Puppet Master"; if (int == 4) @@ -2579,9 +2579,9 @@ string (float slot, float int) PerkName = if (int == 7) return "Narrow Escape"; if (int == 8) - return "Schizophrenia"; + return "Schizophrenia!"; if (int == 9) - return "Place Effect"; + return "Placebo Effect"; if (int == 10) return "Economic Moves"; if (int == 11) @@ -2591,27 +2591,27 @@ string (float slot, float int) PerkName = string (float slot, float int) PerkNameCentered = { if (int == 1) - return " Support Fire"; + return " Support Fire "; if (int == 2) - return " Duck And Cover"; + return " I Disappear "; if (int == 3) - return " Puppet Master "; + return " Puppet Master "; if (int == 4) - return " Stay Low"; + return " Stay Low "; if (int == 5) return "Surgical Precision"; if (int == 6) - return " Mutation"; + return " Mutation "; if (int == 7) - return " Narrow Escape"; + return " Narrow Escape "; if (int == 8) - return " Schizophrenia"; + return " Schizophrenia! "; if (int == 9) - return " Place Effect"; + return " Placebo Effect "; if (int == 10) - return " Economic Moves"; + return " Economic Moves "; if (int == 11) - return " Nuclear Man"; + return " Nuclear Man "; }; @@ -2620,7 +2620,7 @@ string(float int) GetPerkImage = if (int == 1) return "gui/perks/Support Fire.jpg"; else if (int == 2) - return "gui/perks/Duck And Cover.jpg"; + return "gui/perks/I Disappear.jpg"; else if (int == 3) return "gui/perks/Puppet Master.jpg"; else if (int == 4) @@ -2639,6 +2639,8 @@ string(float int) GetPerkImage = return "gui/perks/Economic Moves.jpg"; else if (int == 11) return "gui/perks/Nuclear Man.jpg"; + else if (int == 12) + return "gui/perks/Commander.jpg"; else return "gui/perks/none.jpg"; @@ -2652,13 +2654,13 @@ string(float int) GetPerkDesc = else if (int == 2) return "Being a hero is overrated! You try your best to not look"; else if (int == 3) - return "Your black heart has a weird effect over the denizens of"; + return "Your black heart has a strange effect on the denizens of"; else if (int == 4) return "You know how to take cover! While prone, any attack that"; else if (int == 5) return "You have gained in-depth knowledge of vital organs. Your"; else if (int == 6) - return "The radiation has mutated your body slightly. A critical"; + return "Exposure to the wasteland has caused your body to mutate"; else if (int == 7) return "For when your friend really, really needs that stimpack!"; else if (int == 8) @@ -2669,6 +2671,8 @@ string(float int) GetPerkDesc = return "You can move more effectively than most people. Movement"; else if (int == 11) return "Your body has adapted to radiation to the point that you"; + else if (int == 12) + return "Your supreme leadership affects all of those around you,"; else return ""; @@ -2679,129 +2683,163 @@ string(float int) GetPerkDesc2 = if (int == 1) return "will drastically reduce recoil while lying down."; else if (int == 2) - return "dangerous - making monsters attack your friends!"; + return "dangerous - making monsters forget about you!"; else if (int == 3) return "the wasteland - you can turn a few to your side!"; else if (int == 4) return "is non-aimed deals much less damage to you."; else if (int == 5) - return "aimed attacks get a damage bonus equal to Doctor skill."; + return "aimed attacks are boosted by your Doctor skill."; else if (int == 6) - return "hit no longer has quite the same sting it once had."; + return "and change, granting mysterious effects."; else if (int == 7) return "Provides you a few free seconds to escape danger."; else if (int == 8) return "sometimes takes over your body, boosting all skills."; else if (int == 9) - return "to believe your stimpak is much better than it is."; + return "to believe you are giving them a super stimpack."; else if (int == 10) return "actions suffer much less time-related penalties."; else if (int == 11) return "can absorb small amounts, healing you as well!"; + else if (int == 12) + return " inspiring allies and causing foes to tremble."; else return ""; }; +string(float int) GetPerkRequirements = +{ + if (int == 1) + return "Combat 5"; + else if (int == 2) + return "Sneak 5, Speech 5"; + else if (int == 3) + return "Speech 7, Science 5"; + else if (int == 4) + return "Combat 3"; + else if (int == 5) + return "Doctor 5, Sneak 3"; + else if (int == 6) + return "None"; + else if (int == 7) + return "Sneak: 7"; + else if (int == 8) + return "None"; + else if (int == 9) + return "Speech 5, Doctor 5"; + else if (int == 10) + return "Combat 5, Sneak 5"; + else if (int == 11) + return "None"; + else if (int == 12) + return "Combat 7, Speech 5"; + else if (int == 13) + return "Sneak 5, Science 5"; + else + return ""; + +}; float(float iid) GetItemThreatLevel = { if (iid == IID_NONE) return 0; if (iid == IID_WP_KNIFE) - return 1; + return 0; if (iid == IID_WP_SLEDGE) - return 1; + return 0; if (iid == IID_WP_SPEAR) - return 1; + return 0; if (iid == IID_WP_POWERAXE) - return 1; + return 0; if (iid == IID_WP_USP) - return 1; + return 0; if (iid == IID_WP_USP_S) - return 1; + return 0; if (iid == IID_WP_GLOCK) - return 1; + return 0; if (iid == IID_WP_GLOCK_S) - return 1; + return 0; if (iid == IID_WP_DEAGLE) - return 1; + return 0; if (iid == IID_WP_DEAGLE_M) - return 1; + return 0; if (iid == IID_WP_NEEDLER) - return 3; + return 2; if (iid == IID_WP_ALIENBLASTER) - return 3; + return 2; if (iid == IID_WP_PIPERIFLE) - return 1; + return 0; if (iid == IID_WP_WINCHESTER) - return 1; + return 0; if (iid == IID_WP_MOSSBERG) - return 3; + return 1; if (iid == IID_WP_JACKHAMMER) - return 5; + return 2; if (iid == IID_WP_GREASEGUN) - return 1; + return 0; if (iid == IID_WP_GREASEGUN_S) - return 1; + return 0; if (iid == IID_WP_MP9) - return 1; + return 0; if (iid == IID_WP_MP9_S) - return 1; + return 0; if (iid == IID_WP_RANGEMASTER) - return 1; + return 0; if (iid == IID_WP_RANGEMASTER_SCOPE) - return 1; + return 0; if (iid == IID_WP_AK112) - return 3; + return 1; if (iid == IID_WP_AK47) - return 3; + return 1; if (iid == IID_WP_AK112_M) - return 3; + return 1; if (iid == IID_WP_AK74) - return 5; + return 1; if (iid == IID_WP_ACR) - return 5; + return 2; if (iid == IID_WP_DKS1) - return 3; + return 1; if (iid == IID_WP_DKS1_S) - return 3; + return 1; if (iid == IID_WP_MOONLIGHT) - return 5; + return 2; if (iid == IID_WP_G11) - return 5; + return 2; if (iid == IID_WP_GAUSERIFLE) - return 7; + return 2; if (iid == IID_WP_PULSERIFLE) - return 7; + return 2; if (iid == IID_WP_TURBOPLASMA) - return 7; + return 2; if (iid == IID_WP_PLASMACARBINE) - return 7; + return 2; if (iid == IID_WP_FNFAL) - return 5; + return 2; if (iid == IID_WP_ROCKETLAUNCHER) - return 7; + return 2; if (iid == IID_WP_LASERGATLING) - return 7; + return 2; if (iid == IID_ARM_LEATHER) - return 1; + return 0; if (iid == IID_ARM_VANDAL) - return 1; + return 0; if (iid == IID_ARM_METAL) - return 1; + return 0; if (iid == IID_ARM_TESLA) return 1; if (iid == IID_ARM_COMBAT) - return 3; + return 1; if (iid == IID_ARM_SEVA) - return 3; + return 1; if (iid == IID_ARM_FORCE) - return 5; + return 2; if (iid == IID_ARM_LPOWER) - return 7; + return 2; diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index d086fa372..fae0a0317 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -98,8 +98,7 @@ void () CrawlSound = rand = random (); - if (self.sneak != 0) - return; + if (self.velocity == '0 0 0') { self.crawltime = 0; @@ -128,6 +127,14 @@ void () CrawlSound = void () player_lay = [ 45, player_run ] { + if (self.velocity != '0 0 0') + self.frame = 8 - self.crawltime; + else if (self.velocity == '0 0 0') + { + self.frame = 0; + return; + } + self.crawltime = self.crawltime - 1; if (self.crawltime <= 0) @@ -135,6 +142,8 @@ void () player_lay = [ 45, player_run ] CrawlSound(); self.crawltime = 8; } + + }; void () player_single_shot = [ 89, player_single_shot2 ]{}; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 899513969..cdde64983 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -488,8 +488,8 @@ void(float slotno) UsePerk = { if (te.classname == "monster") { - te.hold = 180; - spawn_stop(te, 10); + te.hold = 120; + spawn_stop(te, 8); mcount = mcount + 1; } te = te.chain; @@ -504,7 +504,7 @@ void(float slotno) UsePerk = sound (self, CHAN_BODY, "items/damage.wav", 1, ATTN_NORM); sprint(self, 2, "it is time...\n"); - self.supertime = 20; + self.supertime = 15; self.skill_combat = self.skill_combat + 20; self.skill_doctor = self.skill_doctor + 20; self.skill_sneak = self.skill_sneak + 20; @@ -777,6 +777,24 @@ void () player_single2_s = [ 183, player_run ] self.weaponframe = 2; }; + + + +void () player_fire_prone = +{ + + if (self.weaponframe == 0) + { + self.weaponframe = 1; + self.frame = 1; + } + else + { + self.weaponframe = 1; + self.frame = 1; + } +}; + //============================================================================ vector() wall_velocity = @@ -3231,7 +3249,7 @@ void (float dam, float ap, string snd, float rng, float rate) FirePistol = if (self.position == 1) player_single1_s(); if (self.position == 2) - player_single1_s(); + player_fire_prone(); if (self.position == 0) @@ -3715,7 +3733,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (self.position == 1) player_single1_s (); if (self.position == 2) - player_single1 (); + player_fire_prone (); } if (self.attack >= 1) { @@ -3724,7 +3742,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (self.position == 1) autofire_s (); if (self.position == 2) - player_single1 (); + player_fire_prone (); } tmp = accuracy * 10; @@ -6147,8 +6165,10 @@ void (float rec, float number, float dam, float spread, float ran, float auto, s if (self.position == 0) player_single1 (); - else + else if (self.position == 1) player_single1_s (); + else if (self.position == 2) + player_fire_prone(); if (self.steadyaim == 0) { @@ -6510,7 +6530,11 @@ void () HostageReport = void () clone_think = { - self.model = self.owner.model; + if (self.owner.velocity == '0 0 0') + setmodel(self, "progs/lay.mdl"); + else + setmodel(self, "progs/prone.mdl"); + self.frame = self.owner.frame; self.nextthink = time + 0.01; }; @@ -6520,7 +6544,11 @@ void () AddClone = local entity clone; clone = spawn (); - setmodel(clone, "progs/guy.mdl"); + + + setmodel(clone, "progs/prone.mdl"); + + clone.owner = self; clone.movetype = MOVETYPE_BOUNCE; clone.solid = SOLID_NOT; diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 6c888c538..0f68107e5 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -129,8 +129,8 @@ void() get_difficulty = //challenge rating system // //0-24 level of difficulty - //0 = barely equipped players - //24 = using the best arms and equipment + //0 = barely equipped players + //6 = 1 player using best arms and armor challenge_rating = 0; @@ -326,13 +326,13 @@ void() map_startup = world.map_ent2_percent = t; world.map_ent3_percent = x; -if (challenge_rating < 4) +if (challenge_rating < 2) { world.map_ent1 = 2 + ceil(random()*6); world.map_ent2 = ceil(random()*8); world.map_ent3 = ceil(random()*8); } -else if (challenge_rating < 8) +else if (challenge_rating < 4) { world.map_ent1 = 2 + ceil(random()*8); world.map_ent2 = 4 + ceil(random()*6); @@ -1591,6 +1591,7 @@ void() worldspawn = precache_model ("progs/melee.mdl"); precache_model ("progs/guy.mdl"); precache_model ("progs/lay.mdl"); + precache_model ("progs/prone.mdl"); precache_model ("progs/eyes.mdl"); precache_model ("progs/h_player.mdl"); precache_model ("progs/gib1.mdl"); @@ -1786,11 +1787,8 @@ void() worldspawn = precache_sound ("ogre/ak47.wav"); precache_sound ("weapons/usp.wav"); precache_sound ("weapons/10mmpistol.wav"); - precache_sound ("weapons/auto2.wav"); precache_sound ("weapons/ak112.wav"); precache_sound ("weapons/amr.wav"); - precache_sound ("weapons/blowoff-1.wav"); - precache_sound ("weapons/blowoff-2.wav"); precache_sound ("misc/bounce_1.wav"); precache_sound ("misc/bounce_2.wav"); precache_sound ("misc/bounce_3.wav"); @@ -1798,13 +1796,11 @@ void() worldspawn = precache_sound ("weapons/click.wav"); precache_sound ("weapons/deagle.wav"); precache_sound ("weapons/dks-1.wav"); - precache_sound ("weapons/fnfal.wav"); precache_sound ("weapons/g11.wav"); precache_sound ("weapons/gauss.wav"); precache_sound ("weapons/gpull.wav"); precache_sound ("weapons/citykiller.wav"); precache_sound ("weapons/laser.wav"); - precache_sound ("weapons/laserburst1.wav"); precache_sound ("weapons/blaster.wav"); precache_sound ("weapons/moonlight-1.wav"); precache_sound ("weapons/moonlight-2.wav"); @@ -1812,20 +1808,13 @@ void() worldspawn = precache_sound ("weapons/bozar.wav"); precache_sound ("weapons/lsw.wav"); precache_sound ("weapons/amr.wav"); - precache_sound ("weapons/smg_s.wav"); - precache_sound ("weapons/shotgun1.wav"); - precache_sound ("weapons/mp5.wav"); - precache_sound ("weapons/mp7.wav"); + precache_sound ("weapons/greasegun.wav"); + precache_sound ("weapons/mp9.wav"); precache_sound ("weapons/rangem.wav"); precache_sound ("weapons/tink1.wav"); - precache_sound ("weapons/shell.wav"); precache_sound ("weapons/reload.wav"); - precache_sound ("weapons/silenced.wav"); - precache_sound ("misc/greload.wav"); - precache_sound ("misc/build1.wav"); - precache_sound ("misc/build2.wav"); - precache_sound ("misc/build3.wav"); + precache_sound ("player/agdie1.wav"); precache_sound ("player/agdie2.wav"); precache_sound ("player/agdie3.wav"); @@ -1840,19 +1829,6 @@ void() worldspawn = precache_sound ("contact/armor2.wav"); precache_sound ("contact/armor3.wav"); - precache_sound ("contact/rico1.wav"); - precache_sound ("contact/rico2.wav"); - precache_sound ("contact/rico3.wav"); - precache_sound ("contact/rico4.wav"); - precache_sound ("contact/rico5.wav"); - precache_sound ("contact/rico6.wav"); - precache_sound ("contact/rico7.wav"); - precache_sound ("contact/rico8.wav"); - precache_sound ("contact/rico9.wav"); - precache_sound ("contact/rico10.wav"); - precache_sound ("contact/rico11.wav"); - precache_sound ("contact/rico12.wav"); - precache_sound ("player/paina.wav"); precache_sound ("player/painb.wav"); precache_sound ("player/yourturn.wav"); @@ -1860,20 +1836,14 @@ void() worldspawn = precache_model ("progs/bolt2.mdl"); // for lightning gun precache_model ("progs/bolt3.mdl"); // for boss shock precache_model ("progs/lavaball.mdl"); // for testing - - precache_model ("progs/bomb.mdl"); precache_model ("progs/missile.mdl"); precache_model ("progs/grenade.mdl"); precache_model ("progs/spike.mdl"); precache_model ("progs/s_spike.mdl"); - precache_model ("progs/backpack.mdl"); - precache_model ("progs/zom_gib.mdl"); - precache_model ("progs/v_light.mdl"); - precache_model ("maps/crate.bsp"); // From 8a0bd1abd954d4e75fee644c5c78aa2033113bc4 Mon Sep 17 00:00:00 2001 From: Magnus Date: Sun, 22 Nov 2009 02:04:38 +0000 Subject: [PATCH 35/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3472 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/invent.qc | 217 ++++++++++++++++++++------------- quakec/fallout2/csqc/main.qc | 10 +- quakec/fallout2/world.qc | 19 --- 3 files changed, 136 insertions(+), 110 deletions(-) diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index e0f450729..7e4213b48 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -71,7 +71,7 @@ void(vector pos, float slotno) TraderImage = return; itname = ftos(it); it = strlen(itname); - drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); + drawstring(pos + IMGSIZEV - '0 8 0'*(scrwidth/640) - '8 0 0'*it*(scrwidth/640), itname, '8 8 8'*(scrwidth/640), '1 1 1', 1); }; @@ -120,7 +120,7 @@ void(vector pos, float slotno) SlotImage = return; itname = ftos(it); it = strlen(itname); - drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); + drawstring(pos + IMGSIZEV - '0 8 0'*(scrwidth/640) - '8 0 0'*it*(scrwidth/640), itname, '8 8 8'*(scrwidth/640), '1 1 1', 1); }; void(vector pos, float slotno, vector imgsize) SlotImageBig = @@ -164,7 +164,7 @@ void(vector pos, float slotno, vector imgsize) SlotImageBig = return; itname = ftos(it); it = strlen(itname); - drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); + drawstring(pos + IMGSIZEV - '0 8 0'*(scrwidth/640) - '8 0 0'*it*(scrwidth/640), itname, '8 8 8'*(scrwidth/640), '1 1 1', 1); }; @@ -210,7 +210,7 @@ void(vector pos, float slotno) SlotImageSmall = return; itname = ftos(it); it = strlen(itname); - drawstring(pos + IMGSIZEZ - '0 16 0' - '16 0 0'*it, itname, '8 8 8', '1 1 1', 1); + drawstring(pos + IMGSIZEZ - '0 16 0'*(scrwidth/640) - '16 0 0'*it*(scrwidth/640), itname, '8 8 8'*(scrwidth/640), '1 1 1', 1); }; void(vector pos, float slotno) QuickImage = @@ -233,7 +233,7 @@ void(vector pos, float slotno) QuickImage = return; itname = ftos(it); it = strlen(itname); - drawstring(pos + IMGSIZEH - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1); + drawstring(pos + IMGSIZEH - '0 8 0' - '8 0 0'*it, itname, '8 8 8'*(scrwidth/640), '1 1 1', 1); }; void() ScreenImage = @@ -264,33 +264,33 @@ void() ScreenImage = if (getstati(57) == 3) { if (getstati(105) == 1) - drawstring(w, "the players were slain...", '8 8 8', '1 1 1', 1); + drawstring(w, "the players were slain...", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 2) - drawstring(w, "the hostages were slain...", '8 8 8', '1 1 1', 1); + drawstring(w, "the hostages were slain...", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 3) - drawstring(w, "the hostages were saved!", '8 8 8', '1 1 1', 1); + drawstring(w, "the hostages were saved!", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 4) - drawstring(w, "some hostages were saved.", '8 8 8', '1 1 1', 1); + drawstring(w, "some hostages were saved.", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 5) - drawstring(w, "no hostages were saved...", '8 8 8', '1 1 1', 1); + drawstring(w, "no hostages were saved...", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 6) - drawstring(w, "the bombs were defused!", '8 8 8', '1 1 1', 1); + drawstring(w, "the bombs were defused!", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 7) - drawstring(w, "the bombs were not defused...", '8 8 8', '1 1 1', 1); + drawstring(w, "the bombs were not defused...", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 8) - drawstring(w, "the supplies were not found...", '8 8 8', '1 1 1', 1); + drawstring(w, "the supplies were not found...", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 9) - drawstring(w, "the supplies were found!", '8 8 8', '1 1 1', 1); + drawstring(w, "the supplies were found!", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 10) - drawstring(w, "all commanders were slain!", '8 8 8', '1 1 1', 1); + drawstring(w, "all commanders were slain!", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 11) - drawstring(w, "the players did not escape...", '8 8 8', '1 1 1', 1); + drawstring(w, "the players did not escape...", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 12) - drawstring(w, "the players were discovered...", '8 8 8', '1 1 1', 1); + drawstring(w, "the players were discovered...", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 13) - drawstring(w, "the fuel tanks were destroyed!", '8 8 8', '1 1 1', 1); + drawstring(w, "the fuel tanks were destroyed!", '8 8 8'*(scrwidth/640), '1 1 1', 1); if (getstati(105) == 14) - drawstring(w, "the fuel tanks were not destroyed...", '8 8 8', '1 1 1', 1); + drawstring(w, "the fuel tanks were not destroyed...", '8 8 8'*(scrwidth/640), '1 1 1', 1); } }; @@ -483,58 +483,58 @@ void() Trader_Draw = - 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); + drawpic('0 0 0', "gui/pipboy/buyscreen.jpg", '468 468 0'*(scrwidth/640), '1 1 1', 1); + TraderImage('1 1 0'*IMGSIZEF*(scrwidth/640), 1); + TraderImage('2 1 0'*IMGSIZEF*(scrwidth/640), 2); + TraderImage('3 1 0'*IMGSIZEF*(scrwidth/640), 3); + TraderImage('4 1 0'*IMGSIZEF*(scrwidth/640), 4); + TraderImage('5 1 0'*IMGSIZEF*(scrwidth/640), 5); + TraderImage('1 2 0'*IMGSIZEF*(scrwidth/640), 6); + TraderImage('2 2 0'*IMGSIZEF*(scrwidth/640), 7); + TraderImage('3 2 0'*IMGSIZEF*(scrwidth/640), 8); + TraderImage('4 2 0'*IMGSIZEF*(scrwidth/640), 9); + TraderImage('5 2 0'*IMGSIZEF*(scrwidth/640), 10); + TraderImage('1 3 0'*IMGSIZEF*(scrwidth/640), 11); + TraderImage('2 3 0'*IMGSIZEF*(scrwidth/640), 12); + TraderImage('3 3 0'*IMGSIZEF*(scrwidth/640), 13); + TraderImage('4 3 0'*IMGSIZEF*(scrwidth/640), 14); + TraderImage('5 3 0'*IMGSIZEF*(scrwidth/640), 15); + TraderImage('1 4 0'*IMGSIZEF*(scrwidth/640), 16); + TraderImage('2 4 0'*IMGSIZEF*(scrwidth/640), 17); + TraderImage('3 4 0'*IMGSIZEF*(scrwidth/640), 18); + TraderImage('4 4 0'*IMGSIZEF*(scrwidth/640), 19); + TraderImage('5 4 0'*IMGSIZEF*(scrwidth/640), 20); - if (mousepos_x >= 1*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) - if (mousepos_y >= 1*IMGSIZEF && mousepos_y <= 2*IMGSIZEF) + if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 2*IMGSIZEF*(scrwidth/640)) slotnum = floor((mousepos_x)/IMGSIZEF) + 0; - if (mousepos_x >= 1*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) - if (mousepos_y >= 2*IMGSIZEF && mousepos_y <= 3*IMGSIZEF) + if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 2*IMGSIZEF*(scrwidth/640) && mousepos_y <= 3*IMGSIZEF*(scrwidth/640)) slotnum = floor((mousepos_x)/IMGSIZEF) + 5; - if (mousepos_x >= 1*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) - if (mousepos_y >= 3*IMGSIZEF && mousepos_y <= 4*IMGSIZEF) + if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 3*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640)) slotnum = floor((mousepos_x)/IMGSIZEF) + 10; - if (mousepos_x >= 1*IMGSIZEF && mousepos_x <= 6*IMGSIZEF) - if (mousepos_y >= 4*IMGSIZEF && mousepos_y <= 5*IMGSIZEF) + if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 4*IMGSIZEF*(scrwidth/640) && mousepos_y <= 5*IMGSIZEF*(scrwidth/640)) slotnum = floor((mousepos_x)/IMGSIZEF) + 15; if (showcontextmenu && show_trader) { - drawfill(contextpos - '8 8 0', '48 48 0', '0 0 0', 1.0); - op = floor((mousepos_y - contextpos_y)/8); - drawstring(contextpos + '0 8 0', "buy?", '8 8 0', '1 1 0' + (op!=1)*'0 0 1', + drawfill(contextpos*(scrwidth/640) - '8 8 0'*(scrwidth/640), '48 48 0'*(scrwidth/640), '0 0 0', 1.0); + op = floor((mousepos_y*(scrwidth/640) - contextpos_y*(scrwidth/640))/8*(scrwidth/640)); + drawstring(contextpos*(scrwidth/640) + '0 8 0'*(scrwidth/640), "buy?", '8 8 0'*(scrwidth/640), '1 1 0' + (op!=1)*'0 0 1', 1); } if (slotnum <= 20) it = getstati(70+slotnum); itname = GetItemName(ToIID(it)); - drawstring('32 16 0', itname, '8 8 0', '1 1 1', 1); + drawstring('32 16 0'*(scrwidth/640), itname, '8 8 0'*(scrwidth/640), '1 1 1', 1); price = GetBaseValue(ToIID(it)); price = ceil(price * (1 - (getstati(104)/30))); @@ -542,12 +542,20 @@ void() Trader_Draw = 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); + drawstring('2 6 0'*IMGSIZEF*(scrwidth/640) - '16 48 0'*(scrwidth/640), " TOTAL ", '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('2 6 0'*IMGSIZEF*(scrwidth/640) - '16 32 0'*(scrwidth/640), " PRICE ", '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('2 6 0'*IMGSIZEF*(scrwidth/640) + '16 0 0'*(scrwidth/640), price2, '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('4 6 0'*IMGSIZEF*(scrwidth/640) - '16 48 0'*(scrwidth/640), " TOTAL ", '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('4 6 0'*IMGSIZEF*(scrwidth/640) - '16 32 0'*(scrwidth/640), " MONEY ", '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('4 6 0'*IMGSIZEF*(scrwidth/640) + '16 0 0'*(scrwidth/640), money2, '16 16 0'*(scrwidth/640), '1 1 1', 1); + + + if (mousepos_x > scrwidth*0.95) + mousepos_x = scrwidth*0.95; + + if (mousepos_y > scrheight*0.95) + mousepos_y = scrheight*0.95; + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -571,13 +579,10 @@ void() Perks_Draw = } else if (mousepos_y >= 390*(scrwidth/640) && mousepos_y <= 425*(scrwidth/640)) { - - if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 335*(scrwidth/640)) selected_class = 6; else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 385*(scrwidth/640)) selected_class = 7; - else if (mousepos_x >= 400*(scrwidth/640) && mousepos_x <= 435*(scrwidth/640)) selected_class = 8; else @@ -601,6 +606,12 @@ void() Perks_Draw = + if (mousepos_x > scrwidth*0.95) + mousepos_x = scrwidth*0.95; + + if (mousepos_y > scrheight*0.95) + mousepos_y = scrheight*0.95; + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -613,19 +624,17 @@ void() Items_Draw = if (mousepos_y >= 390*(scrwidth/640) && mousepos_y <= 425*(scrwidth/640)) { - - drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); - - if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 325*(scrwidth/640)) + if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 335*(scrwidth/640)) selected_class = 6; else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 385*(scrwidth/640)) selected_class = 7; - else if (mousepos_x >= 400*(scrwidth/640) && mousepos_x <= 435*(scrwidth/640)) selected_class = 8; else selected_class = 0; } + else + selected_class = 0; SlotImageBig('3 1.25 0'*IMGSIZEF*(scrwidth/640), 1, '180 64 0'*(scrwidth/640)); @@ -670,6 +679,14 @@ void() Items_Draw = drawstring('7 5 0'*IMGSIZEF*(scrwidth/640) + '0 0 0'*(scrwidth/640), "weight\n", '8 8 0'*(scrwidth/640), '1 1 1', 1); drawstring('7 5 0'*IMGSIZEF*(scrwidth/640) + '0 8 0'*(scrwidth/640), strcat(w1, "/", w2, "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + + + if (mousepos_x > scrwidth*0.95) + mousepos_x = scrwidth*0.95; + + if (mousepos_y > scrheight*0.95) + mousepos_y = scrheight*0.95; + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -741,6 +758,14 @@ void() GainPerk_Draw = drawstring('32 32 0'*(scrwidth/640), pd, '8 8 0'*(scrwidth/640), '1 1 1', 1); drawstring('32 40 0'*(scrwidth/640), pd2, '8 8 0'*(scrwidth/640), '1 1 1', 1); + + + if (mousepos_x > scrwidth*0.95) + mousepos_x = scrwidth*0.95; + + if (mousepos_y > scrheight*0.95) + mousepos_y = scrheight*0.95; + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; @@ -752,27 +777,40 @@ void() Pipboy_Draw = vector w; - - if (mousepos_x >= 192 && mousepos_x <= 512) - if (mousepos_y >= 240 && mousepos_y <= 304) - selected_class = ceil((mousepos_x-191)/64); - - - else if (mousepos_y >= 390*(scrwidth/640) && mousepos_y <= 425*(scrwidth/640)) + if (mousepos_y >= 240*(scrwidth/640) && mousepos_y <= 304*(scrwidth/640)) { - drawpic('0 0 0', "gui/pipboy/items.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); + if (mousepos_x >= 192*(scrwidth/640) && mousepos_x <= 256*(scrwidth/640)) + selected_class = 1; + else if (mousepos_x >= 256*(scrwidth/640) && mousepos_x <= 320*(scrwidth/640)) + selected_class = 2; + else if (mousepos_x >= 320*(scrwidth/640) && mousepos_x <= 384*(scrwidth/640)) + selected_class = 3; + else if (mousepos_x >= 384*(scrwidth/640) && mousepos_x <= 448*(scrwidth/640)) + selected_class = 4; + else if (mousepos_x >= 448*(scrwidth/640) && mousepos_x <= 512*(scrwidth/640)) + selected_class = 5; + else + selected_class = 0; - if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 325*(scrwidth/640)) + } + else if (mousepos_y >= 390*(scrwidth/640) && mousepos_y <= 425*(scrwidth/640)) + { + if (mousepos_x >= 300*(scrwidth/640) && mousepos_x <= 335*(scrwidth/640)) selected_class = 6; else if (mousepos_x >= 350*(scrwidth/640) && mousepos_x <= 385*(scrwidth/640)) selected_class = 7; - else if (mousepos_x >= 400*(scrwidth/640) && mousepos_x <= 435*(scrwidth/640)) selected_class = 8; else selected_class = 0; } + else + selected_class = 0; + + skill = ftos(getstati(selected_class)); + + drawstring('128 64 0'*(scrwidth/640), skill, '16 16 0'*(scrwidth/640), '1 1 1', 1); drawpic('0 0 0', "gui/pipboy/pipboy.png", '640 480 0'*(scrwidth/640), '1 1 1', 1); @@ -784,27 +822,27 @@ void() Pipboy_Draw = drawpic('448 256 0'*(scrwidth/640), "gui/pipboy/speech.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); if (selected_class == 1) - drawpic('128 64 0'*(scrwidth/640), "gui/pipboy/combat.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); + drawpic('192 64 0'*(scrwidth/640), "gui/pipboy/combat.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); else if (selected_class == 2) - drawpic('128 64 0'*(scrwidth/640), "gui/pipboy/doctor.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); + drawpic('192 64 0'*(scrwidth/640), "gui/pipboy/doctor.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); else if (selected_class == 3) - drawpic('128 64 0'*(scrwidth/640), "gui/pipboy/sneak.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); + drawpic('192 64 0'*(scrwidth/640), "gui/pipboy/sneak.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); else if (selected_class == 4) - drawpic('128 64 0'*(scrwidth/640), "gui/pipboy/science.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); + drawpic('192 64 0'*(scrwidth/640), "gui/pipboy/science.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); else if (selected_class == 5) - drawpic('128 64 0'*(scrwidth/640), "gui/pipboy/speech.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); + drawpic('192 64 0'*(scrwidth/640), "gui/pipboy/speech.png", '128 128 0'*(scrwidth/640), '1 1 1', 1); if (selected_class == 1) - drawstring('196 64 0'*(scrwidth/640), "combat", '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('320 64 0'*(scrwidth/640), "combat", '16 16 0'*(scrwidth/640), '1 1 1', 1); else if (selected_class == 2) - drawstring('196 64 0'*(scrwidth/640), "doctor", '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('320 64 0'*(scrwidth/640), "doctor", '16 16 0'*(scrwidth/640), '1 1 1', 1); else if (selected_class == 3) - drawstring('196 64 0'*(scrwidth/640), "sneak", '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('320 64 0'*(scrwidth/640), "sneak", '16 16 0'*(scrwidth/640), '1 1 1', 1); else if (selected_class == 4) - drawstring('196 64 0'*(scrwidth/640), "science", '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('320 64 0'*(scrwidth/640), "science", '16 16 0'*(scrwidth/640), '1 1 1', 1); else if (selected_class == 5) - drawstring('196 64 0'*(scrwidth/640), "speech", '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('320 64 0'*(scrwidth/640), "speech", '16 16 0'*(scrwidth/640), '1 1 1', 1); bar = 0; lvl = getstati(100); @@ -858,6 +896,13 @@ void() Pipboy_Draw = } drawstring('472 230 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '12 12 0'*(scrwidth/640), '1 1 1', 1); + + if (mousepos_x > scrwidth*0.95) + mousepos_x = scrwidth*0.95; + + if (mousepos_y > scrheight*0.95) + mousepos_y = scrheight*0.95; + drawpic(mousepos, "gui/cursor.jpg", '1 1 0'*CURSORSIZE, '1 1 1', 1); }; diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index b8cb5912a..d0557d76c 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -130,7 +130,7 @@ void() Time_Draw = rtime = ftos(ztime); shadowtime = ftos(getstati(63)); - drawstring('0 0 0'+('1 0 0'*(scrwidth*0.25))+('0 1 0'*(scrheight*0.86)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8', '1 1 1', 1); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.25))+('0 1 0'*(scrheight*0.86)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8'*(scrwidth/640), '1 1 1', 1); obj = getstati(66); @@ -144,22 +144,22 @@ void() Time_Draw = if (obj == 4) text = "rescue citizens\n"; - drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.86)), text, '8 8 8', '1 1 1', 1); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.86)), text, '8 8 8'*(scrwidth/640), '1 1 1', 1); text = "citizens rescued: "; text2 = ftos(getstati(113)); - drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.90)), strcat(text, text2), '8 8 8', '1 1 1', 1); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.90)), strcat(text, text2), '8 8 8'*(scrwidth/640), '1 1 1', 1); text = "citizens slain: "; text2 = ftos(getstati(114)); - drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.92)), strcat(text, text2), '8 8 8', '1 1 1', 1); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.92)), strcat(text, text2), '8 8 8'*(scrwidth/640), '1 1 1', 1); text = "citizens left: "; text2 = ftos(getstati(115)); - drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.94)), strcat(text, text2), '8 8 8', '1 1 1', 1); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.94)), strcat(text, text2), '8 8 8'*(scrwidth/640), '1 1 1', 1); }; diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 0f68107e5..f2e241a08 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -1728,31 +1728,15 @@ void() worldspawn = precache_sound ("items/lockpick1.wav"); precache_sound ("items/lockpick2.wav"); - - precache_sound ("radio/1_yes.wav"); - precache_sound ("radio/2_no.wav"); - precache_sound ("radio/3_letsgo.wav"); - precache_sound ("radio/4_cover.wav"); - precache_sound ("radio/5_recon.wav"); - precache_sound ("radio/6_backup.wav"); - precache_sound ("radio/7_hold.wav"); - precache_sound ("radio/8_behind.wav"); - precache_sound ("radio/9_secure.wav"); - precache_sound ("radio/10_suppressing.wav"); - precache_sound ("radio/11_silence.wav"); precache_sound ("radio/medic.wav"); precache_sound ("radio/grenade.wav"); precache_sound ("ambience/gunfire1.wav"); precache_sound ("ambience/gunfire5.wav"); - precache_sound ("weapons/smoke.wav"); - precache_sound ("weapons/energy2.wav"); - precache_sound ("misc/hosdie1.wav"); precache_sound ("misc/hosdie2.wav"); - precache_sound ("misc/hosdown.wav"); precache_sound ("misc/rescued.wav"); precache_sound ("misc/beep1.wav"); precache_sound ("misc/beep2.wav"); @@ -1783,16 +1767,13 @@ void() worldspawn = precache_sound ("dog/dpain1.wav"); precache_sound ("dog/dsight.wav"); precache_sound ("dog/idle.wav"); - precache_sound ("ogre/ak74.wav"); precache_sound ("ogre/ak47.wav"); - precache_sound ("weapons/usp.wav"); precache_sound ("weapons/10mmpistol.wav"); precache_sound ("weapons/ak112.wav"); precache_sound ("weapons/amr.wav"); precache_sound ("misc/bounce_1.wav"); precache_sound ("misc/bounce_2.wav"); precache_sound ("misc/bounce_3.wav"); - precache_sound ("weapons/burst.wav"); precache_sound ("weapons/click.wav"); precache_sound ("weapons/deagle.wav"); precache_sound ("weapons/dks-1.wav"); From 9a5379f76e894aed586acd88cb5f3086344a67c6 Mon Sep 17 00:00:00 2001 From: Magnus Date: Mon, 23 Nov 2009 05:04:45 +0000 Subject: [PATCH 36/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3473 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 37 ++++++++-- quakec/fallout2/cmds.qc | 12 +++- quakec/fallout2/combat.qc | 123 ++++++++++----------------------- quakec/fallout2/csqc/invent.qc | 11 ++- quakec/fallout2/csqc/main.qc | 4 ++ quakec/fallout2/inventory.qc | 26 ++++++- quakec/fallout2/player.qc | 108 ++++++++++++++--------------- quakec/fallout2/weapons.qc | 74 +++++++++++++++----- quakec/fallout2/world.qc | 40 +++-------- 9 files changed, 227 insertions(+), 208 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 18bc8a92e..59093ec9a 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -1080,6 +1080,9 @@ void() PlayerJump = if (!(self.flags & FL_ONGROUND)) return; + if (self.position > 0) + return; + if ( !(self.flags & FL_JUMPRELEASED) ) return; // don't pogo stick @@ -1610,7 +1613,7 @@ void() PlayerPreThink = { self.score = 200; - sound (self, CHAN_BODY, "misc/levelup.wav", 1, ATTN_NORM); + sound (self, CHAN_BODY, "player/levelup.wav", 1, ATTN_NORM); sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n"); } } @@ -1620,7 +1623,7 @@ void() PlayerPreThink = { self.score = 200; - sound (self, CHAN_BODY, "misc/levelup.wav", 1, ATTN_NORM); + sound (self, CHAN_BODY, "player/levelup.wav", 1, ATTN_NORM); sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n"); } } @@ -1706,6 +1709,18 @@ void() PlayerPreThink = self.cycle1 = time + 0.5; } + + if (walkmove(0, 0) && self.solid != SOLID_SLIDEBOX) + { + self.materialize = 0; + self.solid = SOLID_SLIDEBOX; + } + else + { + self.materialize = 5; + self.solid = SOLID_NOT; + } + if (self.materialize > 0) { self.materialize = self.materialize - 1; @@ -1715,12 +1730,13 @@ void() PlayerPreThink = if (walkmove(0, 0)) { self.solid = SOLID_SLIDEBOX; - //bprint(2, "turning solid\n"); + bprint(2, "turning solid\n"); } else { self.materialize = 50; - //bprint(2, "stuck in object, returning non-solid\n"); + bprint(2, "stuck in object, returning non-solid\n"); + self.solid = SOLID_NOT; } } } @@ -1794,12 +1810,19 @@ void() PlayerPreThink = if (ToIID(self.islot4) == IID_EQUIP_GOGGLES) stuffcmd(self, "v_cshift 25 0 25 25\n"); - x = ftos(self.recoil); + if (self.position == 0) + x = ftos(self.recoil); + else if (self.position == 1) + x = ftos(self.recoil/2); + else if (self.position == 2) + x = ftos(self.recoil/4); if (self.steadyaim == 0) stuffcmd(self, "v_idlescale 0\n"); - else + else if (self.recoil > 0) stuffcmd(self, strcat("v_idlescale ", x, "\n")); + else if (self.velocity != '0 0 0') + stuffcmd(self, "v_idlescale 1\n"); } self.cycle2 = time + 1; @@ -1818,7 +1841,7 @@ void() PlayerPreThink = { PlayerJump (); } - else + else if (self.position > 0) self.flags = self.flags | FL_JUMPRELEASED; // teleporters can force a non-moving pause time diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index e4dc1f7b0..5610d7276 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -321,7 +321,7 @@ void(string arg1) Cmd_InvBuy = if (x == 0) { sprint(self, 2, "no more room in inventory!\n"); - sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + sound (self, CHAN_BODY, "misc/beep2.wav", 1, ATTN_NORM); return; } @@ -370,8 +370,14 @@ void(string arg1) Cmd_InvBuy = iid = ToIID(item); amount = ToStatus(item); money = GetBaseValue(iid); - money = ceil(money * (1 - (self.skill_speech/30))); - + if (self.supertime <= 0) + money = ceil(money * (1 - (self.skill_speech/30))); + else + { + sprint(self, 2, "We don't serve your kind here!\n"); + sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); + return; + } if (self.ammo_shells < money) { sprint(self, 2, "not enough money.\n"); diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 3daab2280..38e6d732c 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -147,22 +147,14 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = damage = floor(damage); targ.health = floor(targ.health); -/* - if (attacker.classname == "player" && total_players == 4) - damage = floor(damage * 0.75); - if (attacker.classname == "player" && total_players == 3) - damage = floor(damage * 0.80); - else if (attacker.classname == "player" && total_players == 2) - damage = floor(damage * 0.90); - - if (targ.classname == "player") - damage = floor(damage * 0.60);*/ - if (challenge_rating <= 6 && attacker.classname == "monster") - damage = damage * 0.70; - if (challenge_rating <= 9 && attacker.classname == "monster") - damage = damage * 0.80; + if (challenge_rating >= 20 && attacker.classname == "monster") + damage = damage * 1.30; + else if (challenge_rating <= 12 && attacker.classname == "monster") + damage = damage * 1.20; + else if (challenge_rating <= 9 && attacker.classname == "monster") + damage = damage * 1.10; if (targ.radiation > 0) { @@ -191,7 +183,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (attacker.classname == "player" && targ.classname == "monster" && attacker.recoil <= 5) attacker.score = attacker.score + 1; -//attacker a monster from behind awards points +//attacking a monster from behind awards points local vector vec; local float dot; @@ -202,21 +194,27 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = vec = normalize (attacker.origin - targ.origin); dot = (vec * v_forward); - if (dot > 0.3) + if (dot < 0.3) attacker.score = attacker.score + 1; + + if (attacker.perk1 == 15 || attacker.perk2 == 15) + { + bprint(2, "SNEAK ATTACK\n"); + damage = damage * (1 + (attacker.skill_sneak/15)); + } } //attacking a team-mate is a HUGE penalty if (attacker.classname == "player" && targ.classname == "player") { - attacker.score = attacker.score - 3; + attacker.score = attacker.score - 5; sprint(attacker, 2, "you just shot a teammate! be careful!\n"); } //attacking a hostage is a HUGE penalty if (attacker.classname == "player" && targ.classname == "hostage") { - attacker.score = attacker.score - 3; + attacker.score = attacker.score - 5; sprint(attacker, 2, "you just shot a hostage! be careful!\n"); } @@ -231,36 +229,23 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); return; } - else if (targ.position == 1 && random()<0.05) + else if (targ.position == 1 && random()<0.10) { sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); return; } - else if (targ.position == 2 && random()<0.10) + else if (targ.position == 2 && random()<0.20) { sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); return; } - damage = damage * 1.25; - -//nintendo gamer: going into the zone gives a 50% miss chance - - if (targ.rage == 255) - { - if (random()<0.50) - { - sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); - return; - } - } - -//paranoia: if taking cover, 25% miss chance (others get 10% bonus) +//stay low: if taking cover, 20% miss chance (others get 10% bonus) if (targ.rage == 777) { - if (targ.perk1 == 2 || targ.perk2 == 2) + if (targ.perk1 == 4 || targ.perk2 == 4) { if (random()<0.20) { @@ -270,7 +255,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = } else { - if (random()<0.05) + if (random()<0.10) { sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); return; @@ -279,51 +264,35 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = } //master blaster: the more you burst, the higher the damage bonus - if (attacker.perk1 == 18 || attacker.perk2 == 18) + if (attacker.perk1 == 14 || attacker.perk2 == 14) { - if (attacker.recoil > 10) + if (attacker.recoil > 5) { - sprint(attacker, 2, "!MASTER BLASTER\n"); - damage = damage * (1 + (attacker.recoil * 0.01)); + damage = damage * (1 + (attacker.recoil * 0.03)); } } - //hit the deck + //stay low if (targ.perk1 == 4 || targ.perk2 == 4) { if (targ.position == 2) - damage = damage * 0.90; + damage = damage * 0.75; } //sneak attack: if you attack a creature who isn't fighting you, bonus damage - if (attacker.skill_sneak > 0) + if (attacker.skill_sneak > 0 && attacker.sneak > 0) { if (targ.enemy != attacker) - damage = damage * (1 + (attacker.skill_sneak/100)); + { + bprint(2, "SNEAK ATTACK\n"); + damage = damage * (1 + (attacker.skill_sneak/15)); + } } - //death wish: 20% damage bonus to targ, 10% to attacker - if (targ.perk1 == 19 || targ.perk2 == 19) - damage = damage * 1.10; - //death wish: 20% damage bonus to targ, 10% to attacker - if (attacker.perk1 == 19 || attacker.perk2 == 19) - damage = damage * 1.20; -//die hard: if below 50% health, 25% damage resistance - if (targ.perk1 == 1 || targ.perk2 == 1) - { - if (targ.health < (targ.max_health*0.5)) - damage = damage * 0.75; - } - - if ((targ.perk1 == 17 || targ.perk2 == 17) && random()<0.02) - { - damage = damage * 0.10; - sprint(self, 2, "!ONE IN A MILLION\n"); - } // used by buttons and triggers to set activator for target firing damage_attacker = attacker; @@ -336,7 +305,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = attacker.critical = 0; } - if (attacker.critical == 3 && targ.classname != "car")//attacker scored a headshot/critical + if (attacker.critical == 3 && targ.classname == "car")//attacker scored a headshot/critical { if (attacker.critical == 3) { @@ -346,24 +315,8 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (targ.classname == "monster") attacker.score = attacker.score + 1; - helm = targ.armortype; - if (targ.helmet == 0) - { - sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM); - helm = 0; - } - if (targ.helmet == 1) - { - sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); - helm = 0.30; - } - if (targ.helmet == 2) - { - sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM); - helm = 0.45; - } - - damage = (damage - (damage * helm)); + sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM); + makevectors (targ.v_angle); } @@ -518,7 +471,7 @@ take = damage; if (targ.classname == "player" && targ.zoom > 0) { targ.maxspeed = targ.maxspeed * 0.33; - stuffcmd(targ, "v_idlescale 20\n"); + stuffcmd(targ, "v_idlescale 10\n"); } else if (take > 20 && targ.classname == "player") { @@ -532,15 +485,15 @@ take = damage; stuffcmd(targ, "v_cshift 100 0 0 50\n"); } + + ArmorNoise(targ, attacker); + if (take <= 0) { take = 0; - sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM); return; } - ArmorNoise(targ, attacker); - if (targ.hold <= 0) targ.health = targ.health - take; diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 7e4213b48..e1a771f63 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -476,9 +476,6 @@ void() Trader_Draw = float width,height,lvl,bar; vector w; - width = cvar("vid_conwidth"); - height = cvar("vid_conheight"); - //w = '1 1 0'*height; @@ -508,19 +505,19 @@ void() Trader_Draw = if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 2*IMGSIZEF*(scrwidth/640)) - slotnum = floor((mousepos_x)/IMGSIZEF) + 0; + slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 0; if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) if (mousepos_y >= 2*IMGSIZEF*(scrwidth/640) && mousepos_y <= 3*IMGSIZEF*(scrwidth/640)) - slotnum = floor((mousepos_x)/IMGSIZEF) + 5; + slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 5; if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) if (mousepos_y >= 3*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640)) - slotnum = floor((mousepos_x)/IMGSIZEF) + 10; + slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 10; if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) if (mousepos_y >= 4*IMGSIZEF*(scrwidth/640) && mousepos_y <= 5*IMGSIZEF*(scrwidth/640)) - slotnum = floor((mousepos_x)/IMGSIZEF) + 15; + slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 15; if (showcontextmenu && show_trader) diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index d0557d76c..f83f47997 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -508,6 +508,7 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = drawpic('0 0 0'+('1 0 0'*(scrwidth*0.01)) +('0 1 0'*(scrheight*0.45)), "gui/hud/radiation.png", '0 0 0'+'25 155 0'*(scrwidth/640), '1 1 1'); drawpic('0 0 0' + ('0 1 0'*(scrheight*0.84)), "gui/hud/hud.png", '0 0 0'+'80 10 0'*(scrwidth/80), '1 1 1'); + Health_Draw(); Radiation_Draw(); @@ -528,6 +529,9 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = if (getstati(42) > 0) SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.77)) +('0 1 0'*(scrheight*0.90)), 11); + if (getstati(110) == 0) + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.64)) +('0 1 0'*(scrheight*0.97)), "gui/hud/aim.png", '16 16 0'*(scrheight/640), '1 1 1'); + HUD_Perks_Draw(); Position_Draw(); diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 680af4f11..9e5b5ae5d 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -2586,6 +2586,12 @@ string (float slot, float int) PerkName = return "Economic Moves"; if (int == 11) return "Nuclear Man"; + if (int == 12) + return "Commander"; + if (int == 14) + return "Blaster Master"; + if (int == 15) + return "Fighting Dirty"; }; string (float slot, float int) PerkNameCentered = @@ -2612,6 +2618,12 @@ string (float slot, float int) PerkNameCentered = return " Economic Moves "; if (int == 11) return " Nuclear Man "; + if (int == 12) + return " Commander "; + if (int == 14) + return " Blaster Master "; + if (int == 15) + return " Fighting Dirty "; }; @@ -2641,6 +2653,10 @@ string(float int) GetPerkImage = return "gui/perks/Nuclear Man.jpg"; else if (int == 12) return "gui/perks/Commander.jpg"; + else if (int == 14) + return "gui/perks/Blaster Master.jpg"; + else if (int == 15) + return "gui/perks/Fighting Dirty.jpg"; else return "gui/perks/none.jpg"; @@ -2673,6 +2689,10 @@ string(float int) GetPerkDesc = return "Your body has adapted to radiation to the point that you"; else if (int == 12) return "Your supreme leadership affects all of those around you,"; + else if (int == 14) + return "Your mastery of burst weapons is complete. You receive a"; + else if (int == 15) + return "You are an expert in stealth and can now sneak attack an"; else return ""; @@ -2704,6 +2724,10 @@ string(float int) GetPerkDesc2 = return "can absorb small amounts, healing you as well!"; else if (int == 12) return " inspiring allies and causing foes to tremble."; + else if (int == 14) + return " damage bonus the longer you hold the trigger."; + else if (int == 15) + return " enemy who is not facing you."; else return ""; @@ -2724,7 +2748,7 @@ string(float int) GetPerkRequirements = else if (int == 6) return "None"; else if (int == 7) - return "Sneak: 7"; + return "None"; else if (int == 8) return "None"; else if (int == 9) diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index fae0a0317..d6b966e2a 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -124,9 +124,19 @@ void () CrawlSound = }; +void() idle_frames = +{ + + + self.weaponframe = 0; + +}; + void () player_lay = [ 45, player_run ] { + idle_frames(); + if (self.velocity != '0 0 0') self.frame = 8 - self.crawltime; else if (self.velocity == '0 0 0') @@ -152,15 +162,7 @@ void () player_single_shot_duck = [ 183, player_single_shot_duck2 ]{}; void () player_single_shot_duck2 = [ 184, player_run ]{}; -void() idle_frames = -{ - local float weap; - local string x; - self.weaponframe = 0; - return; - -}; @@ -300,40 +302,33 @@ void () Footstep = rand = random (); - if (self.sneak != 0) - return; - r = 1 - (self.skill_sneak/40); - if (self.classname == "player") + + + + + if (self.sneak <= 0) { - loud_noise(20 - self.skill_sneak); + r = 1 - (self.skill_sneak/40); } + else + r = 0.25; + + if (self.position == 1) + r = r * 0.5; + + if (rand < 0.25) + sound (self, CHAN_ITEM, "player/step1.wav", r, ATTN_NORM); + else if (rand < 0.5) + sound (self, CHAN_ITEM, "player/step2.wav", r, ATTN_NORM); + else if (rand < 0.75) + sound (self, CHAN_ITEM, "player/step3.wav", r, ATTN_NORM); + else + sound (self, CHAN_ITEM, "player/step4.wav", r, ATTN_NORM); - if (world.worldtype == 1 || world.worldtype == 2) - { - if ((rand < 0.25)) - sound (self, CHAN_ITEM, "player/step1.wav", r, ATTN_NORM); - else if ((rand < 0.5)) - sound (self, CHAN_ITEM, "player/step2.wav", r, ATTN_NORM); - else if ((rand < 0.75)) - sound (self, CHAN_ITEM, "player/step3.wav", r, ATTN_NORM); - else - sound (self, CHAN_ITEM, "player/step4.wav", r, ATTN_NORM); - } - if (world.worldtype == 0) - { - if ((rand < 0.25)) - sound (self, CHAN_ITEM, "player/step1a.wav", r, ATTN_NORM); - else if ((rand < 0.5)) - sound (self, CHAN_ITEM, "player/step2a.wav", r, ATTN_NORM); - else if ((rand < 0.75)) - sound (self, CHAN_ITEM, "player/step3a.wav", r, ATTN_NORM); - else - sound (self, CHAN_ITEM, "player/step4a.wav", r, ATTN_NORM); - } }; float (entity guy) holding_melee = @@ -362,13 +357,10 @@ void () player_stand1 = [ 149, player_stand1 ] player_crouch (); return; } - else + else if (self.position == 2) { - if (self.position == 2) - { - player_lay (); - return; - } + player_lay (); + return; } if (self.velocity_x || self.velocity_y) { @@ -393,19 +385,22 @@ void () player_crouch = [ 45, player_run ] self.frame = 45; return; } - else + else if (self.position == 2) { - if (self.position == 2) - { - player_lay (); - return; - } + player_lay (); + return; } idle_frames(); self.frame = (35 + self.walkframe); + + if (self.walkframe == 3 && self.ghost == 0 && self.velocity_z == 0) + Footstep (); + if (self.walkframe == 8 && self.ghost == 0 && self.velocity_z == 0) + Footstep (); + if (self.walkframe == 11) self.walkframe = 0; @@ -443,23 +438,20 @@ void () player_run = [ 137, player_run ] } } - if ((!self.velocity_x && !self.velocity_y)) + if (!self.velocity_x && !self.velocity_y) { player_stand1 (); return; } - if ((self.position == 1)) + else if (self.position == 1) { player_crouch (); return; } - else + else if (self.position == 2) { - if ((self.position == 2)) - { - player_lay (); - return; - } + player_lay (); + return; } if (self.speedmulti <= 0.60) @@ -882,6 +874,12 @@ void() player_auto_duck2 = [182, player_run ] {muzzleflash();}; void() player_auto_ducka1 = [183, player_auto_ducka2 ] {muzzleflash();}; void() player_auto_ducka2 = [183, player_run ] {muzzleflash();}; +void() player_auto_prone1 = [1, player_auto_prone2 ] {muzzleflash();}; +void() player_auto_prone2 = [1, player_run ] {muzzleflash();}; + +void() player_auto_pronea1 = [0, player_auto_pronea2 ] {muzzleflash();}; +void() player_auto_pronea2 = [0, player_run ] {muzzleflash();}; + void () player_single1_left = [ 88, player_single2_left ] { self.weaponframe = 4; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index cdde64983..76fc477bf 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -19,6 +19,8 @@ void (float dam, float xrecoil, string snd, float rng, float rate) FireMinigun; void(float db) loud_noise; void() player_auto_duck1; void() player_auto_ducka1; +void() player_auto_prone1; +void() player_auto_pronea1; void(vector org, float damage) SpawnBlood; void(vector org, float damage) SpawnNonBlood; void() SuperDamageSound; @@ -779,22 +781,31 @@ void () player_single2_s = [ 183, player_run ] - void () player_fire_prone = { - - if (self.weaponframe == 0) + if (self.weaponframe == 1) + { + self.weaponframe = 2; + self.frame = 1; + } + else if (self.weaponframe == 2) { self.weaponframe = 1; - self.frame = 1; + self.frame = 0; } else { - self.weaponframe = 1; + self.weaponframe = 2; self.frame = 1; } }; + + + + + + //============================================================================ vector() wall_velocity = @@ -2635,6 +2646,28 @@ void() autofire_s = }; +void() autofire_p = +{ + if (self.attack == 0) + self.cnt = 0; + + if (self.weaponframe == 1) + self.weaponframe = 2; + else + self.weaponframe = 1; + + if (self.cnt == 0) + player_auto_prone1(); + else if (self.cnt == 1) + player_auto_pronea1(); + + self.cnt = self.cnt + 1; + + if (self.cnt == 2) + self.cnt = 0; +}; + + void (vector org) bullet_hole = { local float r; @@ -3386,8 +3419,10 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = if (self.position == 0) autofire (); - if (self.position >= 1) + if (self.position == 1) autofire_s (); + if (self.position == 2) + autofire_p (); if (self.position == 0) adjust = '0 0 0'; @@ -3526,8 +3561,10 @@ void (float rec, float speed, float dam, float type) FirePulseRifle = if (self.position == 0) autofire (); - if (self.position >= 1) + if (self.position == 1) autofire_s (); + if (self.position == 2) + autofire_p (); if (self.position == 0) adjust = '0 0 -4'; @@ -3733,7 +3770,8 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (self.position == 1) player_single1_s (); if (self.position == 2) - player_fire_prone (); + autofire_p (); + //player_fire_prone (); } if (self.attack >= 1) { @@ -3742,16 +3780,18 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (self.position == 1) autofire_s (); if (self.position == 2) - player_fire_prone (); + autofire_p (); } tmp = accuracy * 10; xrecoil = dam / 2; - //for the snipers - if (self.position == 2 && self.recoil == 0) + + if (self.position == 1) tmp = tmp * 0.75; + else if (self.position == 2) + tmp = tmp * 0.50; if (self.steadyaim == 0) tmp = tmp * 0.25; @@ -3770,11 +3810,10 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (tmp > 500) tmp = 500; - tmp = tmp * 0.75; source = self.origin + '0 0 22'; - targ = self.origin + '0 0 22' + v_right*self.driftx + v_up*self.drifty + v_right*crandom()* tmp + v_up*random()*tmp + v_up*random()*tmp; + targ = self.origin + '0 0 22' + v_right*self.driftx + v_up*self.drifty + v_right*crandom()*tmp + v_up*random()*tmp + v_up*random()*tmp; y = xrecoil * 12; @@ -3789,10 +3828,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (self.position == 2 && weap == IID_WP_AK112_M) { - if (self.recoil >= 8) - self.recoil = 8; - - y = y * 0.25; + y = y * 0.10; tmp = tmp * 0.80; } if (random()*3<=2) @@ -3800,9 +3836,9 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR else self.driftx = self.driftx - y; - if (random()*2<=1) + if (random()*3<=2) self.drifty = self.drifty + y; - else + else if (self.drifty > 0) self.drifty = self.drifty - y; traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index f2e241a08..8cb1c403a 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -1338,11 +1338,6 @@ void () RecoilControl = while (te) { - te.lastman = te.lastman - 0.01; - - if (te.lastman < 0) - te.lastman = 0; - //superstims: heal at an incredible rate! if ((te.xregen > 0 && te.health < te.max_health) && random()<0.5) { @@ -1363,20 +1358,14 @@ void () RecoilControl = te.health = te.max_health; } - te.lastman = te.lastman - 0.01; - //steady aim: for living anatomy, and aimed shots by standing still if (te.recoil != 0) te.steadyaim = 6; else if (te.recoil == 0 && te.steadyaim > 0) - { te.steadyaim = te.steadyaim - 0.05; - - if (te.perk1 == 13 || te.perk2 == 13) - te.steadyaim = te.steadyaim - 0.05; - } - if (te.steadyaim > 0 && te.steadyaim <= 0.10) + + if (te.steadyaim <= 0) te.steadyaim = 0; @@ -1403,7 +1392,7 @@ void () RecoilControl = } - te.recoil = te.recoil - (0.15+(te.skill_combat*0.005) + (te.skill_doctor*0.003) + (te.skill_sneak*0.002)); + te.recoil = te.recoil - (0.10+(te.skill_combat*0.01)); } else { @@ -1420,16 +1409,6 @@ void () RecoilControl = te.drifty = te.drifty + 0.5; } - if (te.recoil > 5) - te.recoil = te.recoil - 0.05; - - if (te.recoil <= 5) - { - te.recoil = te.recoil + 0.10; - - if (te.recoil >= 5) - te.recoil = 5; - } } if (te.driftx > 250) @@ -1437,10 +1416,13 @@ void () RecoilControl = if (te.drifty > 250) te.drifty = 250; - //support fire: going prone gives a -10 recoil bonus with this perk during heavy fire + //support fire: going prone gives a -10 recoil bonus with this perk if (getperk(1) && self.position == 2 && te.recoil > 3) - te.recoil = te.recoil - 0.10; - + { + te.recoil = te.recoil - 0.20; + te.driftx = te.driftx * 0.5; + te.drifty = te.drifty * 0.5; + } //prone: going prone gives a -5 recoil bonus @@ -1758,10 +1740,6 @@ void() worldspawn = precache_sound ("player/step2.wav"); precache_sound ("player/step3.wav"); precache_sound ("player/step4.wav"); - precache_sound ("player/step1a.wav"); - precache_sound ("player/step2a.wav"); - precache_sound ("player/step3a.wav"); - precache_sound ("player/step4a.wav"); precache_sound ("dog/dattack1.wav"); precache_sound ("dog/ddeath.wav"); precache_sound ("dog/dpain1.wav"); From 7c6eaec76681ddd83bd6817f2e2a827bcb734e0e Mon Sep 17 00:00:00 2001 From: Magnus Date: Mon, 23 Nov 2009 06:50:21 +0000 Subject: [PATCH 37/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3474 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 4 +- quakec/fallout2/inventory.qc | 18 ++-- quakec/fallout2/ogre.qc | 2 +- quakec/fallout2/soldier.qc | 8 +- quakec/fallout2/weapons.qc | 159 +++++++++++------------------------ 5 files changed, 67 insertions(+), 124 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 59093ec9a..dc36b60c9 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -1817,12 +1817,12 @@ void() PlayerPreThink = else if (self.position == 2) x = ftos(self.recoil/4); - if (self.steadyaim == 0) + if (self.steadyaim == 0 && self.velocity == '0 0 0') stuffcmd(self, "v_idlescale 0\n"); else if (self.recoil > 0) stuffcmd(self, strcat("v_idlescale ", x, "\n")); else if (self.velocity != '0 0 0') - stuffcmd(self, "v_idlescale 1\n"); + stuffcmd(self, "v_idlescale 4\n"); } self.cycle2 = time + 1; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 9e5b5ae5d..9d5deefa3 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -906,11 +906,11 @@ float(float iid) WeaponAmmoType = if (iid == IID_WP_JACKHAMMER) return IID_AM_12GAUGESHELLS; if (iid == IID_WP_GREASEGUN) - return IID_AM_45ACP; + return IID_AM_10MM; if (iid == IID_WP_MP9) return IID_AM_10MM; if (iid == IID_WP_GREASEGUN_S) - return IID_AM_45ACP; + return IID_AM_10MM; if (iid == IID_WP_MP9_S) return IID_AM_10MM; if (iid == IID_WP_RANGEMASTER) @@ -985,11 +985,11 @@ float(float iid) WeaponMagQuant = if (iid == IID_WP_JACKHAMMER) return 20; if (iid == IID_WP_GREASEGUN) - return 25; + return 30; if (iid == IID_WP_MP9) return 30; if (iid == IID_WP_GREASEGUN_S) - return 25; + return 30; if (iid == IID_WP_MP9_S) return 30; if (iid == IID_WP_RANGEMASTER) @@ -1463,9 +1463,9 @@ float(float iid) GetBaseValue = if (iid == IID_WP_JACKHAMMER) return 250; if (iid == IID_WP_GREASEGUN) - return 100; + return 150; if (iid == IID_WP_GREASEGUN_S) - return 125; + return 25; if (iid == IID_WP_MP9) return 110; if (iid == IID_WP_MP9_S) @@ -1699,13 +1699,13 @@ string(float iid) GetItemDesc = if (iid == IID_WP_JACKHAMMER) return "the ultimate for close range battles"; if (iid == IID_WP_GREASEGUN) - return "higher recoil due to larger .45 acp round"; + return "a subpar smg rechambered for 10mm"; if (iid == IID_WP_GREASEGUN_S) - return "higher recoil due to larger .45 acp round"; + return "a subpar smg in extremely poor condition"; if (iid == IID_WP_MP9) return "great all-around weapon; good burst fire"; if (iid == IID_WP_MP9_S) - return "silenced 10mm smg; less recoil"; + return "great all-around weapon in extremely poor condition"; if (iid == IID_WP_RANGEMASTER) return "civilian battle rifle. sturdy and effective"; if (iid == IID_WP_RANGEMASTER_SCOPE) diff --git a/quakec/fallout2/ogre.qc b/quakec/fallout2/ogre.qc index a41515f25..2ceaf4bf6 100644 --- a/quakec/fallout2/ogre.qc +++ b/quakec/fallout2/ogre.qc @@ -119,7 +119,7 @@ void (float tmp, float dam) ogre_smg = self.weapon = 5; - sound (self, CHAN_WEAPON, "weapons/mp7.wav", 1, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/mp9.wav", 1, ATTN_NORM); tmp = 300; diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index de88582d4..14e201458 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -79,7 +79,7 @@ void (float tmp, float dam) army_fire = makevectors (self.angles); - sound (self, CHAN_WEAPON, "weapons/usp.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/10mmpistol.wav", PLAT_LOW_TRIGGER, ATTN_NORM); src = self.origin + v_forward*10; src_z = self.absmin_z + self.size_z * 0.7; @@ -323,7 +323,7 @@ void (float tmp, float dam) army_fire3 = if (self.enemy.sneak == 1) tmp = tmp * 2; - sound (self, CHAN_WEAPON, "weapons/mp5.wav", PLAT_LOW_TRIGGER, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/greasegun.wav", PLAT_LOW_TRIGGER, ATTN_NORM); self.mag1 = self.mag1 - 1; @@ -1476,7 +1476,7 @@ void () army_die = if (self.weapon == 3) DropFromChest(self, IID_WP_WINCHESTER, 1); if (self.weapon == 4) - DropFromChest(self, IID_WP_GREASEGUN, 15); + DropFromChest(self, IID_WP_GREASEGUN_S, 15); if (self.weapon == 5) DropFromChest(self, IID_WP_AK47, 12); @@ -1487,7 +1487,7 @@ void () army_die = if (self.weapon == 3) DropFromChest(self, IID_AM_12GAUGESHELLS, 8); if (self.weapon == 4) - DropFromChest(self, IID_AM_45ACP, 30); + DropFromChest(self, IID_AM_10MM, 30); if (self.weapon == 5) DropFromChest(self, IID_AM_5MMHIGHVEL, 24); diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 76fc477bf..7ab7a9582 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -609,53 +609,32 @@ void(float damage, float dist, float rate) FireMelee = { tdam = 20 + (60*self.skill_sneak); - if (getperk(9)) - tdam = 900; - - if (self.steadyaim == 0) - tdam = tdam + 10; - - if (trace_ent.solid != SOLID_BSP && trace_ent.classname != "car") - SpawnBlood (org, 1); - else - SpawnNonBlood (org, 1); - - T_Damage (trace_ent, self, self, tdam); - self.attack_finished = time + 2; + if (trace_ent.solid != SOLID_BSP) + SpawnBlood (org, 1); + else + SpawnNonBlood (org, 1); + T_Damage (trace_ent, self, self, tdam); + self.attack_finished = time + 2; if (trace_ent.health > 0)//victim survived the attack { - bprint(2, self.netname); - bprint(2, " ambushes "); - bprint(2, trace_ent.netname); - bprint(2, "!\n"); + bprint(2, self.netname); + bprint(2, " ambushes "); + bprint(2, trace_ent.netname); + bprint(2, "!\n"); - if (random()*4<2) - sound (trace_ent, CHAN_WEAPON, "player/headshot.wav", 1, ATTN_NONE); - else - sound (trace_ent, CHAN_WEAPON, "player/udeath.wav", 1, ATTN_NONE); + if (random()*4<2) + sound (trace_ent, CHAN_WEAPON, "player/headshot.wav", 1, ATTN_NONE); + else + sound (trace_ent, CHAN_WEAPON, "player/udeath.wav", 1, ATTN_NONE); - loud_noise(15); - self.equipment_slot = 0; - sprint(self, PRINT_HIGH, " Uncloaked \n"); - setmodel (self, "progs/guy.mdl"); - self.sneak = 0; - spawn_excla(self, 3); + + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + spawn_excla(self, 3); } - else - { - bprint(2, self.netname); - bprint(2, " assassinates "); - bprint(2, trace_ent.netname); - bprint(2, "!\n"); - self.score = self.score + 5; - - if (random()*4<2) - sound (trace_ent, CHAN_WEAPON, "player/headshot.wav", 0.25, ATTN_IDLE); - else - sound (trace_ent, CHAN_WEAPON, "player/udeath.wav", 0.25, ATTN_IDLE); - } - return; } else if (trace_ent.takedamage) { @@ -2047,13 +2026,13 @@ void() W_Attack = else if (weap == IID_WP_JACKHAMMER) W_FireShotgun (1, 5, 6, 30, 1750, 2, "weapons/citykiller.wav"); else if (weap == IID_WP_GREASEGUN) - FireSMG(14, 0, "weapons/mp5.wav", 1500, 0.10); + FireSMG(12, 0, "weapons/greasegun.wav", 1500, 0.08); else if (weap == IID_WP_MP9) - FireSMG(12, 0, "ogre/ak74.wav", 1500, 0.08); + FireSMG(12, 0, "weapons/mp9.wav", 1500, 0.08); else if (weap == IID_WP_GREASEGUN_S) - FireSMG(12, 0, "weapons/smg_s.wav", 1500, 0.10); + FireSMG(9, 0, "weapons/greasegun.wav", 1200, 0.08); else if (weap == IID_WP_MP9_S) - FireSMG(10, 0, "weapons/smg_s.wav", 1500, 0.08); + FireSMG(9, 0, "weapons/mp9.wav", 1200, 0.08); else if (weap == IID_WP_RANGEMASTER) FireAssaultRifle(18, 4, "weapons/rangem.wav", 4000, 0.1); else if (weap == IID_WP_AK112) @@ -2679,38 +2658,7 @@ void (vector org) bullet_hole = WriteCoord (MSG_MULTICAST, org_y); WriteCoord (MSG_MULTICAST, org_z); multicast (self.origin, MULTICAST_PHS); -/* - r = random(); - ric = spawn(); - setorigin(ric, org); - if (r <= 0.08) - sound (ric, CHAN_WEAPON, "contact/rico1.wav", TRUE, ATTN_NORM); - else if (r <= 0.16) - sound (ric, CHAN_WEAPON, "contact/rico2.wav", TRUE, ATTN_NORM); - else if (r <= 0.24) - sound (ric, CHAN_WEAPON, "contact/rico3.wav", TRUE, ATTN_NORM); - else if (r <= 0.32) - sound (ric, CHAN_WEAPON, "contact/rico4.wav", TRUE, ATTN_NORM); - else if (r <= 0.40) - sound (ric, CHAN_WEAPON, "contact/rico5.wav", TRUE, ATTN_NORM); - else if (r <= 0.48) - sound (ric, CHAN_WEAPON, "contact/rico6.wav", TRUE, ATTN_NORM); - else if (r <= 0.56) - sound (ric, CHAN_WEAPON, "contact/rico7.wav", TRUE, ATTN_NORM); - else if (r <= 0.64) - sound (ric, CHAN_WEAPON, "contact/rico8.wav", TRUE, ATTN_NORM); - else if (r <= 0.72) - sound (ric, CHAN_WEAPON, "contact/rico9.wav", TRUE, ATTN_NORM); - else if (r <= 0.80) - sound (ric, CHAN_WEAPON, "contact/rico10.wav", TRUE, ATTN_NORM); - else if (r <= 0.90) - sound (ric, CHAN_WEAPON, "contact/rico11.wav", TRUE, ATTN_NORM); - else - sound (ric, CHAN_WEAPON, "contact/rico12.wav", TRUE, ATTN_NORM); - - ric.think = SUB_Remove; - ric.nextthink = time + 1;*/ }; void (vector test, float length, float dam) penetrate = @@ -3396,24 +3344,16 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = } sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); - if (weap == IID_WP_GREASEGUN) - loud_noise(50); - else if (weap == IID_WP_MP9) - loud_noise(40); - else if (weap == IID_WP_GREASEGUN_S) - loud_noise(5); - else if (weap == IID_WP_MP9_S) - loud_noise(5); + loud_noise(40); + + + + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); - //only silenced weapons do not break stealth - if (weap != IID_WP_GREASEGUN_S && weap != IID_WP_MP9_S && self.sneak > 0) - { - self.equipment_slot = 0; - sprint(self, PRINT_HIGH, " Uncloaked \n"); - setmodel (self, "progs/guy.mdl"); - self.sneak = 0; - sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); - } self.attack_finished = (time + rate); @@ -3453,6 +3393,12 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = tmp = 150; + if (weap == IID_WP_MP9) + { + tmp = 200; + dam = dam * 1.25; + } + if (self.velocity == '0 0 0') tmp = tmp + (15*self.recoil); else @@ -3501,20 +3447,10 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = dam = dam + random()*dam; - if (weap == IID_WP_GREASEGUN) - T_Damage (trace_ent, self, self, dam); - else if (weap == IID_WP_MP9) - T_Damage (trace_ent, self, self, dam); - else if (weap == IID_WP_GREASEGUN_S) - T_Damage (trace_ent, self, self, dam); - else if (weap == IID_WP_MP9_S) - T_Damage (trace_ent, self, self, dam); T_Damage (trace_ent, self, self, dam); self.critical = 0; - if (trace_ent.solid == SOLID_BSP || trace_ent.classname == "car") - penetrate (org, (dam / 2), (dam / 2)); } else { @@ -3821,16 +3757,23 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR y = y * 0.90; if (self.velocity == '0 0 0') y = y * 0.90; - if (self.position == 2) - y = y * 0.80; + if (self.position == 1) - y = y * 0.90; + y = y * 0.75; + else if (self.position == 2) + y = y * 0.50; if (self.position == 2 && weap == IID_WP_AK112_M) { - y = y * 0.10; - tmp = tmp * 0.80; + y = y * 0.50; + tmp = tmp * 0.50; } + else if (self.position < 2 && weap == IID_WP_AK112_M) + { + y = y * 1.25; + tmp = tmp * 1.25; + } + if (random()*3<=2) self.driftx = self.driftx + y; else From 5f7d753be1431cc7518758c45c314323b3f82e12 Mon Sep 17 00:00:00 2001 From: Magnus Date: Tue, 24 Nov 2009 07:31:19 +0000 Subject: [PATCH 38/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3475 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/ai.qc | 41 ++- quakec/fallout2/client.qc | 58 +++-- quakec/fallout2/cmds.qc | 49 +++- quakec/fallout2/combat.qc | 37 ++- quakec/fallout2/csqc/invent.qc | 70 +++-- quakec/fallout2/csqc/main.qc | 2 - quakec/fallout2/defs.qc | 2 + quakec/fallout2/inventory.qc | 109 ++++++-- quakec/fallout2/items.qc | 16 +- quakec/fallout2/misc.qc | 4 +- quakec/fallout2/player.qc | 6 +- quakec/fallout2/soldier.qc | 39 ++- quakec/fallout2/triggers.qc | 6 +- quakec/fallout2/weapons.qc | 449 +++++++++++++++++---------------- quakec/fallout2/world.qc | 48 ++-- 15 files changed, 577 insertions(+), 359 deletions(-) diff --git a/quakec/fallout2/ai.qc b/quakec/fallout2/ai.qc index 7508a7d0e..a4de914d9 100644 --- a/quakec/fallout2/ai.qc +++ b/quakec/fallout2/ai.qc @@ -269,8 +269,7 @@ void() ChangeYaw = void() HuntTarget = { - if (self.enemy == self.friend) - return; + self.goalentity = self.enemy; self.think = self.th_run; @@ -371,7 +370,11 @@ float() FindTarget = self.charmed = self.charmed - 1; return FALSE; } - + if (self.charmed <= 0) + { + self.friend = world; + return FALSE; + } if (sight_entity_time >= time - 0.1 && !(self.spawnflags & 3) ) { @@ -534,6 +537,7 @@ void(float dist) ai_walk = return; } + movedist = dist; // check for noticing a player @@ -648,6 +652,12 @@ float() DogCheckAttack; float() CheckAnyAttack = { + + if (self.charmed >= 1 && self.enemy == self.friend) + return; + + + if (!enemy_vis) return FALSE; if (self.classname == "monster_army") @@ -678,8 +688,13 @@ void() ai_run_melee = self.ideal_yaw = enemy_yaw; ChangeYaw (); + if (FacingIdeal()) { + + if (self.enemy == self.friend) + return; + self.th_melee (); self.attack_state = AS_STRAIGHT; } @@ -695,10 +710,15 @@ Turn in place until within an angle to launch a missile attack */ void() ai_run_missile = { + self.ideal_yaw = enemy_yaw; ChangeYaw (); if (FacingIdeal()) { + + if (self.enemy == self.friend) + return; + self.th_missile (); self.attack_state = AS_STRAIGHT; } @@ -756,6 +776,19 @@ void(float dist) ai_run = return; } + + if (self.charmed >= 1) + { + if (self.enemy.classname != "monster" || (self.enemy.classname == "monster" && self.enemy.health <= 0)) + { + self.enemy = self.friend; + self.movetarget = self.friend; + self.goalentity = self.friend; + self.pausetime = time + 0.1; + } + } + + movedist = dist; // see if the enemy is dead if (self.enemy.health <= 0) @@ -791,10 +824,12 @@ void(float dist) ai_run = return; } + enemy_infront = infront(self.enemy); enemy_range = range(self.enemy); enemy_yaw = vectoyaw(self.enemy.origin - self.origin); + if (self.attack_state == AS_MISSILE) { //dprint ("ai_run_missile\n"); diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index dc36b60c9..20461db1f 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -48,11 +48,11 @@ void() SetChangeParms = { self.supertime = 0; sprint(self, 2, "you are now back to your normal self.\n"); - self.skill_combat = self.skill_combat - 20; - self.skill_doctor = self.skill_doctor - 20; - self.skill_sneak = self.skill_sneak - 20; - self.skill_science = self.skill_science - 20; - self.skill_speech = self.skill_speech - 20; + self.skill_combat = self.skill_combat - 10; + self.skill_doctor = self.skill_doctor - 10; + self.skill_sneak = self.skill_sneak - 10; + self.skill_science = self.skill_science - 10; + self.skill_speech = self.skill_speech - 10; } self.items = self.items - (self.items & @@ -66,7 +66,7 @@ void() SetChangeParms = parm16 = self.skill_speech; - parm8 = self.ammo_shells; + parm8 = self.score; parm9 = self.perk1; parm10 = self.perk2; parm17 = self.islot1; @@ -148,7 +148,7 @@ void() DecodeLevelParms = self.skill_science = parm14; self.skill_speech = parm16; - self.ammo_shells = parm8; + self.score = parm8; self.perk1 = parm9; self.perk2 = parm10; @@ -625,12 +625,12 @@ void() PutClientInServer = if (self.islot1 == 0 && self.islot2 == 0 && self.islot3 == 0 && self.islot4 == 0 && self.islot5 == 0 && self.islot6 == 0 && self.islot7 == 0 && self.islot8 == 0 && self.islot9 == 0 && self.islot10 == 0 && self.islot11 == 0 && self.islot12 == 0) { - self.islot1 = SlotVal(IID_WP_GLOCK, 15); - self.islot2 = SlotVal(IID_WP_KNIFE, 1); + self.islot1 = SlotVal(IID_WP_KNIFE, 1); + self.islot2 = 0; self.islot3 = SlotVal(IID_ARM_LEATHER, 1); self.islot5 = SlotVal(IID_CHEM_STIMPACK, 5); - self.islot7 = SlotVal(IID_AM_10MM, 70); - self.islot8 = 0; + self.islot7 = 0; + self.islot8 = SlotVal(IID_MONEY, 100); self.islot9 = 0; self.islot10 = 0; self.islot11 = SlotVal(IID_CHEM_MEDICALBAG, 25); @@ -664,7 +664,7 @@ void() PutClientInServer = self.fixangle = TRUE; // turn this way immediately - self.max_health = 80 + (self.skill_combat*4) + (self.skill_doctor*2) + (self.skill_sneak*2) + (self.skill_speech); + self.max_health = 100 + (self.skill_combat*4) + (self.skill_doctor*2) + (self.skill_sneak*2) + (self.skill_speech*2) + (self.skill_science); self.equipment_slot = 0; @@ -773,9 +773,9 @@ void() PutClientInServer = if (world.model == "maps/r_bunker.bsp") - stuffcmd(self, "play music/afterglow\n"); + stuffcmd(self, "play music/vault\n"); else if (world.map_obj == OBJ_DEADTOWN) - stuffcmd(self, "play music/necropolis\n"); + stuffcmd(self, "play music/afterglow\n"); }; @@ -1635,7 +1635,7 @@ void() PlayerPreThink = self.perk2timer = self.perk2timer - 1; //speech skill provides faster perk regeneration - if (random()*40 < self.skill_speech) + if (random()*30 < self.skill_speech) { if (self.perk1timer > 0) self.perk1timer = self.perk1timer - 1; @@ -1643,6 +1643,9 @@ void() PlayerPreThink = self.perk2timer = self.perk2timer - 1; } + + + self.shadowtime = time_left; if (self.cycle1 < time) @@ -1681,11 +1684,11 @@ void() PlayerPreThink = self.supertime = 0; sound (self, CHAN_BODY, "items/damage2.wav", 1, ATTN_NORM); sprint(self, 2, "you are now back to your normal self.\n"); - self.skill_combat = self.skill_combat - 20; - self.skill_doctor = self.skill_doctor - 20; - self.skill_sneak = self.skill_sneak - 20; - self.skill_science = self.skill_science - 20; - self.skill_speech = self.skill_speech - 20; + self.skill_combat = self.skill_combat - 10; + self.skill_doctor = self.skill_doctor - 10; + self.skill_sneak = self.skill_sneak - 10; + self.skill_science = self.skill_science - 10; + self.skill_speech = self.skill_speech - 10; } local float lgrip, rgrip; @@ -1709,7 +1712,7 @@ void() PlayerPreThink = self.cycle1 = time + 0.5; } - +/* if (walkmove(0, 0) && self.solid != SOLID_SLIDEBOX) { self.materialize = 0; @@ -1719,7 +1722,7 @@ void() PlayerPreThink = { self.materialize = 5; self.solid = SOLID_NOT; - } + }*/ if (self.materialize > 0) { @@ -1752,6 +1755,13 @@ void() PlayerPreThink = if (self.cycle2 < time) { + if (self.blurtime > 0 && self.blurtime <= 1) + stuffcmd(self, "gl_motionblur 0\n"); + else if (self.blurtime > 0) + { + stuffcmd(self, "gl_motionblur 0.9\n"); + self.blurtime -= 1; + } if (self.ragetime > 0) self.ragetime -= 1; @@ -1784,9 +1794,9 @@ void() PlayerPreThink = if (self.musictimer == 0) { if (world.model == "maps/r_bunker.bsp") - stuffcmd(self, "play music/afterglow\n"); + stuffcmd(self, "play music/vault\n"); else if (world.map_obj == OBJ_DEADTOWN) - stuffcmd(self, "play music/necropolis\n"); + stuffcmd(self, "play music/afterglow\n"); self.musictimer = 1; } diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 5610d7276..ecc46115d 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -282,6 +282,13 @@ void(string arg1, string arg2) Cmd_GainPerk = self.perk1 = 10; if (arg1 == "11") self.perk1 = 11; + if (arg1 == "12") + self.perk1 = 12; + if (arg1 == "14") + self.perk1 = 14; + if (arg1 == "15") + self.perk1 = 15; + } if (arg2 == "2") { @@ -307,13 +314,19 @@ void(string arg1, string arg2) Cmd_GainPerk = self.perk2 = 10; if (arg1 == "11") self.perk2 = 11; + if (arg1 == "12") + self.perk2 = 12; + if (arg1 == "14") + self.perk2 = 14; + if (arg1 == "15") + self.perk2 = 15; } }; void(string arg1) Cmd_InvBuy = { - local float x,y, iid, amount, money, item; + local float x,y, iid, amount, money, item, m, n, p; x = FindEmptySlot(self); @@ -378,14 +391,28 @@ void(string arg1) Cmd_InvBuy = sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); return; } - if (self.ammo_shells < money) + + m = SlotOfItem(self, IID_MONEY); + p = ItemInSlot(self, m); + n = ToStatus(p); + + if (m == 0) { sprint(self, 2, "not enough money.\n"); sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); return; } + if (n < 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; + { + SetItemSlot(self, m, 0); + TryGiveStackable(self, IID_MONEY, n-money); + } if (NotStackable(iid)) SetItemSlot(self, x, item); @@ -396,7 +423,8 @@ void(string arg1) Cmd_InvBuy = { sprint(self, 2, "full inventory.\n"); sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); - self.ammo_shells = self.ammo_shells + money; + m = SlotOfItem(self, IID_MONEY); + SetItemSlot(self, m, n); return; } sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); @@ -431,14 +459,23 @@ void(string arg1) Cmd_InvSell = self.missionbrief = 0; - SetItemSlot(self, slotno, 0); + x = GetBaseValue(iid); x = ceil(x * (1 + (self.skill_speech/30))); x = ceil(x / 5); y = ftos(x); z = GetItemName(iid); - self.ammo_shells += x; + if (!TryGiveStackable(self, IID_MONEY, x)) + { + sprint(self, 2, "not enough room.\n"); + return; + } + + SetItemSlot(self, slotno, 0); + + + sprint(self, 2, "you sell "); sprint(self, 2, z); sprint(self, 2, " for $"); diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 38e6d732c..81d95f4d5 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -148,6 +148,15 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = damage = floor(damage); targ.health = floor(targ.health); + if (total_players == 1) + damage = damage * 0.70; + else if (total_players == 2) + damage = damage * 0.80; + else if (total_players == 3) + damage = damage * 0.90; + else + damage = damage * 1.00; + if (challenge_rating >= 20 && attacker.classname == "monster") damage = damage * 1.30; @@ -222,6 +231,19 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (targ.classname == "monster" && attacker.classname == "player" && attacker.rage == 777) attacker.score = attacker.score + 1; + +//charmed monsters will protect their master + if (targ.classname == "player" && targ.friend.classname == "monster") + { + if (targ.friend.enemy.classname != "monster") + targ.friend.enemy = attacker; + } +//charmed monsters will assist their master + if (attacker.classname == "player" && attacker.friend.classname == "monster") + { + if (attacker.friend.enemy.classname != "monster") + attacker.friend.enemy = targ; + } //dodge chance if (targ.position == 0 && random()<0.05) @@ -242,12 +264,12 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = -//stay low: if taking cover, 20% miss chance (others get 10% bonus) +//stay low: if taking cover, 33% miss chance (others get 10% bonus) if (targ.rage == 777) { if (targ.perk1 == 4 || targ.perk2 == 4) { - if (random()<0.20) + if (random()<(0.33+(self.skill_speech*0.01))) { sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); return; @@ -268,18 +290,11 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = { if (attacker.recoil > 5) { - damage = damage * (1 + (attacker.recoil * 0.03)); + damage = damage * (1 + (attacker.recoil * (0.03+(self.skill_speech*0.002)))); } } - //stay low - if (targ.perk1 == 4 || targ.perk2 == 4) - { - if (targ.position == 2) - damage = damage * 0.75; - } - //sneak attack: if you attack a creature who isn't fighting you, bonus damage if (attacker.skill_sneak > 0 && attacker.sneak > 0) @@ -305,7 +320,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = attacker.critical = 0; } - if (attacker.critical == 3 && targ.classname == "car")//attacker scored a headshot/critical + if (attacker.critical == 3)//attacker scored a headshot/critical { if (attacker.critical == 3) { diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index e1a771f63..9e68ae364 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -469,7 +469,7 @@ void(vector pos, string image) Crosshair = void() Trader_Draw = { - local float i, price, money; + local float i, price, money, m, n, p; 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; @@ -503,6 +503,8 @@ void() Trader_Draw = TraderImage('5 4 0'*IMGSIZEF*(scrwidth/640), 20); + slotnum = 0; + if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 2*IMGSIZEF*(scrwidth/640)) slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 0; @@ -532,21 +534,27 @@ void() Trader_Draw = it = getstati(70+slotnum); itname = GetItemName(ToIID(it)); drawstring('32 16 0'*(scrwidth/640), itname, '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = GetItemDesc(ToIID(it)); + drawstring('32 32 0'*(scrwidth/640), itname, '8 8 0'*(scrwidth/640), '1 1 1', 1); - price = GetBaseValue(ToIID(it)); - price = ceil(price * (1 - (getstati(104)/30))); - price2 = ftos(price); - money = getstati(50); - money2 = ftos(money); + if (slotnum > 0) + { + price = GetBaseValue(ToIID(it)); + price = ceil(price * (1 - (getstati(104)/30))); + price2 = ftos(price); - drawstring('2 6 0'*IMGSIZEF*(scrwidth/640) - '16 48 0'*(scrwidth/640), " TOTAL ", '16 16 0'*(scrwidth/640), '1 1 1', 1); - drawstring('2 6 0'*IMGSIZEF*(scrwidth/640) - '16 32 0'*(scrwidth/640), " PRICE ", '16 16 0'*(scrwidth/640), '1 1 1', 1); - drawstring('2 6 0'*IMGSIZEF*(scrwidth/640) + '16 0 0'*(scrwidth/640), price2, '16 16 0'*(scrwidth/640), '1 1 1', 1); - drawstring('4 6 0'*IMGSIZEF*(scrwidth/640) - '16 48 0'*(scrwidth/640), " TOTAL ", '16 16 0'*(scrwidth/640), '1 1 1', 1); - drawstring('4 6 0'*IMGSIZEF*(scrwidth/640) - '16 32 0'*(scrwidth/640), " MONEY ", '16 16 0'*(scrwidth/640), '1 1 1', 1); - drawstring('4 6 0'*IMGSIZEF*(scrwidth/640) + '16 0 0'*(scrwidth/640), money2, '16 16 0'*(scrwidth/640), '1 1 1', 1); + m = ShadowSlotOfItem(self, IID_MONEY); + p = ShadowItemInSlot(self, m); + n = ToStatus(p); + money2 = ftos(n); + TraderImage('2 5 0'*IMGSIZEF*(scrwidth/640), slotnum); + drawpic('4 5 0'*IMGSIZEF*(scrwidth/640) + '16 0 0'*(scrwidth/640), "gui/bottlecaps.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawstring('2 6 0'*IMGSIZEF*(scrwidth/640) + '16 0 0'*(scrwidth/640), price2, '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('4 6 0'*IMGSIZEF*(scrwidth/640) + '16 0 0'*(scrwidth/640), money2, '16 16 0'*(scrwidth/640), '1 1 1', 1); + + } if (mousepos_x > scrwidth*0.95) mousepos_x = scrwidth*0.95; @@ -730,12 +738,18 @@ void() GainPerk_Draw = { if (mousepos_x >= 2*IMGSIZEF*(scrwidth/640) && mousepos_x <= 3*IMGSIZEF*(scrwidth/640)) which_perk = 11; + else if (mousepos_x >= 3*IMGSIZEF*(scrwidth/640) && mousepos_x <= 4*IMGSIZEF*(scrwidth/640)) + which_perk = 12; + else if (mousepos_x >= 4*IMGSIZEF*(scrwidth/640) && mousepos_x <= 5*IMGSIZEF*(scrwidth/640)) + which_perk = 14; + else if (mousepos_x >= 5*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) + which_perk = 15; else which_perk = 0; } drawpic('2 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Support Fire.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); - drawpic('3 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Duck And Cover", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('3 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/I Disappear.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('4 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Puppet Master.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('5 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Stay Low.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('6 2 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Surgical Precision.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); @@ -747,6 +761,9 @@ void() GainPerk_Draw = drawpic('6 3 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Economic Moves.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); drawpic('2 4 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Nuclear Man.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('3 4 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Commander.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('4 4 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Blaster Master.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); + drawpic('5 4 0'*IMGSIZEF*(scrwidth/640), "gui/perks/Fighting Dirty.png", '64 64 0'*(scrwidth/640), '1 1 1', 1); pn = PerkName(1, which_perk); pd = GetPerkDesc(which_perk); @@ -769,7 +786,7 @@ void() GainPerk_Draw = void() Pipboy_Draw = { - float width,height,lvl,bar; + float width,height,lvl,bar, top, s; string skill; vector w; @@ -894,6 +911,25 @@ void() Pipboy_Draw = drawstring('472 230 0'*(scrwidth/640) - ('0 4 0'*(lvl+4)*(scrwidth/640)), skill, '12 12 0'*(scrwidth/640), '1 1 1', 1); + bar = 0; + s = getstati(127); + top = ceil(200 * (s/200)); + if (top > 200) + top = 200; + + while (bar < top) + bar = bar + 1; + + + top = 200; + + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.32)) +('0 1 0'*(scrheight*0.69)), "experience: ", '8 8 0'*(scrwidth/640), '1 1 1', 1); + + drawpic('0 0 0'+('1 0 0'*(scrwidth*0.48)) +('0 1 0'*(scrheight*0.685)) + ('0 1 0'*(scrheight/640)), "gui/pipboy/graph/blue.jpg", '1 16 0'*(scrheight/640)+'1 0 0'*(scrwidth/640)*bar, '1 1 1', 1); + + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.6)) +('0 1 0'*(scrheight*0.69)), strcat(ftos(s),"/", ftos(top), "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + + if (mousepos_x > scrwidth*0.95) mousepos_x = scrwidth*0.95; @@ -1072,7 +1108,9 @@ if (slotnum <= 24) } itname = GetItemName(ToIID(it)); - drawstring('32 16 0'*(scrwidth/640), itname, '16 16 0'*(scrwidth/640), '1 1 1', 1); + drawstring('32 12 0'*(scrwidth/640), itname, '8 8 0'*(scrwidth/640), '1 1 1', 1); + itname = GetItemDesc(ToIID(it)); + drawstring('32 22 0'*(scrwidth/640), itname, '7 7 0'*(scrwidth/640), '1 1 1', 1); } @@ -1235,7 +1273,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = return; if (which_perk == getstati(59)) return; - if (which_perk >= 1 && which_perk <= 11) + if (which_perk >= 1 && which_perk <= 15) localcmd(strcat("cmd gainperk ", ftos(which_perk), " ", ftos(perkslot), "\n")); show_inventory = false; show_pipboy = false; diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index f83f47997..ebdc603d8 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -529,8 +529,6 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView = if (getstati(42) > 0) SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.77)) +('0 1 0'*(scrheight*0.90)), 11); - if (getstati(110) == 0) - drawpic('0 0 0'+('1 0 0'*(scrwidth*0.64)) +('0 1 0'*(scrheight*0.97)), "gui/hud/aim.png", '16 16 0'*(scrheight/640), '1 1 1'); HUD_Perks_Draw(); diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 08b2a467b..f58eb80e2 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -669,6 +669,8 @@ float intermission_running; .float hostage; .float xregen; .float sneak; +.float morale; +.float blurtime; .float skill_combat; .float skill_doctor; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index 9d5deefa3..a06fddc4e 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -2,11 +2,11 @@ float IID_NONE = 0; #define IsMelee(iid) (iid == IID_NONE || (iid >= IID_WP_WRENCH && iid <= IID_WP_POWERAXE)) #define IsGrenade(iid) (iid >= IID_GREN_FRAG && iid <= IID_GREN_STUN) -#define IsRanged(iid) (iid >= IID_WP_GLOCK && iid <= IID_WP_ACR) - +#define IsRanged(iid) ((iid >= IID_WP_GLOCK && iid <= IID_WP_ACR)) +#define IsMoney(iid) (iid == IID_MONEY) //weapons with ammo, things with a toggle state -#define NotStackable(iid) (IsRanged(iid)) +#define NotStackable(iid) (IsRanged(iid) || IsMoney(iid)) //the ammoless weapons float IID_WP_WRENCH = 399; @@ -146,6 +146,7 @@ float IID_MISC_HMXCOMPOUND = 320; float IID_MISC_GUM = 321; float IID_MISC_XRAYTUBE = 322; +float IID_MONEY = 300; #define IsShootable(iid) (IsMelee(iid) || IsRanged(iid) || IsGrenade(iid)) @@ -268,6 +269,62 @@ float(entity e, float slotno) ItemInSlot = return 0; }; + +float(entity e, float slotno) ShadowItemInSlot = +{ + if (slotno == 1) + return getstati(32); + if (slotno == 2) + return getstati(33); + if (slotno == 3) + return getstati(34); + if (slotno == 4) + return getstati(35); + if (slotno == 5) + return getstati(36); + if (slotno == 6) + return getstati(37); + if (slotno == 7) + return getstati(38); + if (slotno == 8) + return getstati(39); + if (slotno == 9) + return getstati(40); + if (slotno == 10) + return getstati(41); + if (slotno == 11) + return getstati(42); + if (slotno == 12) + return getstati(43); + if (slotno == 13) + return getstati(44); + if (slotno == 14) + return getstati(45); + if (slotno == 15) + return getstati(46); + if (slotno == 16) + return getstati(47); + if (slotno == 17) + return getstati(91); + if (slotno == 18) + return getstati(92); + if (slotno == 19) + return getstati(93); + if (slotno == 20) + return getstati(94); + if (slotno == 21) + return getstati(95); + if (slotno == 22) + return getstati(96); + if (slotno == 23) + return getstati(97); + if (slotno == 24) + return getstati(98); + return 0; +}; + + + void(entity e, float slotno, float item) SetItemSlot = { if (slotno == 1) @@ -432,10 +489,7 @@ 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; }; @@ -858,10 +912,11 @@ string(float iid) GetItemWModel = return "maps/b_bh100.bsp"; if (iid == IID_CHEM_RADX) return "maps/b_bh25.bsp"; - if (iid >= IID_MISC_JUNK && iid <= IID_MISC_XRAYTUBE) return "progs/junk1.mdl"; + if (iid == IID_MONEY) + return "progs/money.mdl"; return "progs/s_light.spr"; //no model. :/ }; @@ -981,9 +1036,9 @@ float(float iid) WeaponMagQuant = if (iid == IID_WP_WINCHESTER) return 2; if (iid == IID_WP_MOSSBERG) - return 12; + return 8; if (iid == IID_WP_JACKHAMMER) - return 20; + return 10; if (iid == IID_WP_GREASEGUN) return 30; if (iid == IID_WP_MP9) @@ -1221,6 +1276,10 @@ string(float iid) GetItemName = return "grease gun"; if (iid == IID_WP_MP9) return "mp9"; + if (iid == IID_WP_GREASEGUN_S) + return "damaged grease gun"; + if (iid == IID_WP_MP9_S) + return "damaged mp9"; if (iid == IID_WP_RANGEMASTER) return "rangemaster"; if (iid == IID_WP_RANGEMASTER_SCOPE) @@ -1376,6 +1435,7 @@ string(float iid) GetItemName = if (iid == IID_EQUIP_XRAY) return "x-ray device"; + if (iid == IID_MISC_JUNK) return "random junk"; if (iid == IID_MISC_NUKACOLA) @@ -1403,6 +1463,8 @@ string(float iid) GetItemName = if (iid == IID_MISC_XRAYTUBE) return "x-ray tube"; + if (iid == IID_MONEY) + return "bottle caps"; bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n"); return strcat("unknown", ftos(iid)); @@ -1412,7 +1474,8 @@ float(float iid) GetBaseValue = { if (iid == IID_NONE) return 0; - + if (iid == IID_MONEY) + return 1; if (iid == IID_WP_WRENCH) return 5; @@ -1425,13 +1488,13 @@ float(float iid) GetBaseValue = if (iid == IID_WP_USP) - return 40; - if (iid == IID_WP_USP_S) - return 60; - if (iid == IID_WP_GLOCK) return 30; + if (iid == IID_WP_USP_S) + return 30; + if (iid == IID_WP_GLOCK) + return 20; if (iid == IID_WP_GLOCK_S) - return 50; + return 20; if (iid == IID_WP_DEAGLE) return 70; if (iid == IID_WP_DEAGLE_M) @@ -1471,9 +1534,9 @@ float(float iid) GetBaseValue = if (iid == IID_WP_MP9_S) return 125; if (iid == IID_WP_RANGEMASTER) - return 80; + return 70; if (iid == IID_WP_RANGEMASTER_SCOPE) - return 120; + return 100; if (iid == IID_WP_AK47) return 150; if (iid == IID_WP_AK112) @@ -1858,6 +1921,9 @@ string(float iid) GetItemDesc = if (iid == IID_EQUIP_XRAY) return "allows for enemy detection through walls"; + if (iid == IID_MONEY) + return "the standard currency of the wasteland"; + if (iid == IID_MISC_NUKACOLA) return "a bottle of tasty nuka-cola"; if (iid == IID_MISC_JUNK) @@ -2164,6 +2230,10 @@ string(float iid) GetItemImage = return "greasegun.jpg"; if (iid == IID_WP_MP9) return "mp9.jpg"; + if (iid == IID_WP_GREASEGUN_S) + return "greasegun.jpg"; + if (iid == IID_WP_MP9_S) + return "mp9.jpg"; if (iid == IID_WP_RANGEMASTER) return "rangem.png"; if (iid == IID_WP_RANGEMASTER_SCOPE) @@ -2342,6 +2412,9 @@ string(float iid) GetItemImage = if (iid == IID_MISC_XRAYTUBE) return "junk/tube.jpg"; + if (iid == IID_MONEY) + return "bottlecaps.png"; + bprint(PRINT_MEDIUM, ftos(iid), " without a name!\n"); return strcat("unknown.jpg", ftos(iid)); }; diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 31542d8b9..091559011 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -2343,6 +2343,8 @@ DropMoney void() MoneyTouch = { + local float x, y; + if (other.classname != "player") return; @@ -2350,9 +2352,15 @@ void() MoneyTouch = return; sound (self, CHAN_VOICE, "items/item1.wav", 1, ATTN_IDLE); - sprint(other, 2, "a small amount of wasteland currency.\n"); - other.ammo_shells += self.islot1; - remove(self); + + x = ToIID(self.islot1); + y = ToStatus(self.islot1); + + if (TryGiveStackable(other, x, y)) + { + sprint(other, 2, "found some bottle caps.\n"); + remove(self); + } }; void() DropMoney = @@ -2373,7 +2381,7 @@ void() DropMoney = item.movetype = MOVETYPE_TOSS; setmodel (item, "progs/money.mdl"); setsize (item, '-16 -16 0', '16 16 56'); - item.islot1 = 2 + random()*5; + item.islot1 = SlotVal(IID_MONEY, 1); item.skin = ToIID(item.islot1) - 506; item.touch = MoneyTouch; diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index cdd02940e..4e2d5e524 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -949,8 +949,8 @@ void() brotherhood_merchant = - self.xslot1 = SlotVal(IID_WP_USP, 1); - self.xslot6 = SlotVal(IID_AM_45ACP, 100); + self.xslot1 = SlotVal(IID_WP_GLOCK, 1); + self.xslot6 = SlotVal(IID_AM_10MM, 100); self.xslot2 = SlotVal(IID_WP_PIPERIFLE, 1); self.xslot7 = SlotVal(IID_AM_44MAGNUM, 100); diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index d6b966e2a..587a5f552 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -105,12 +105,12 @@ void () CrawlSound = return; } - - self.attack_finished = time + 1; self.rtime = time + 1; - r = 1 - (self.skill_sneak/40); + r = 0.5; + if (self.sneak > 0) + r = r / 2; if ((rand < 0.25)) sound (self, CHAN_ITEM, "player/prone1.wav", r, ATTN_NORM); diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index 14e201458..4bebce59c 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -103,7 +103,7 @@ void (float tmp, float dam) army_fire = if (trace_ent.takedamage) { - dam = 1 + random()*dam + random()*dam; + dam = dam + random()*dam; dam = dam - (1 - (trace_fraction/2)); SpawnBlood (org, PLAT_LOW_TRIGGER); T_Damage (trace_ent, self, self, dam); @@ -175,7 +175,7 @@ void (float tmp, float dam) army_fire1 = if (trace_ent.takedamage) { SpawnBlood (org, PLAT_LOW_TRIGGER); - dam = 10 + random()*dam + random()*dam; + dam = dam + random()*dam; dam = dam * (1 - (trace_fraction/2)); X_Damage (trace_ent, self, self, dam); } @@ -241,7 +241,7 @@ void (float tmp, float dam) army_fire2 = direction = dir; shot = 5; - var_o = crandom()*50; + var_o = crandom()*75; while (shot > 0) { @@ -281,9 +281,8 @@ void (float tmp, float dam) army_fire2 = if (trace_ent.takedamage) { SpawnBlood (org, PLAT_LOW_TRIGGER); - dam = 1 + random()*dam + random()*dam; dam = dam * (1 - (trace_fraction/2)); - T_Damage (trace_ent, self, self, dam); + T_Damage (trace_ent, self, self, dam+random()*dam); } else bullet_hole (trace_endpos); @@ -352,7 +351,7 @@ void (float tmp, float dam) army_fire3 = if (trace_ent.takedamage) { SpawnBlood (org, PLAT_LOW_TRIGGER); - dam = 1 + random()*dam + random()*dam; + dam = dam + random()*dam; dam = dam * (1 - (trace_fraction/2)); T_Damage (trace_ent, self, self, dam); } @@ -410,7 +409,7 @@ void (float tmp, float dam) army_fire4 = if (trace_ent.takedamage) { SpawnBlood (org, PLAT_LOW_TRIGGER); - dam = 1 + random()*dam + random()*dam; + dam = dam + random()*dam; dam = dam * (1 - (trace_fraction/2)); T_Damage (trace_ent, self, self, dam); } @@ -657,7 +656,7 @@ void () army_walk8 = [ 80, army_walk1 ] void () army_run1 = [ 73, army_run2 ] { - if ((random()<0.25 || self.health <= 25) && self.charmed != 1) + if ((self.health <= 25) && self.charmed <= 1) find_hide(); ai_run (TE_TELEPORT); @@ -789,7 +788,7 @@ void () army_atka4 = [ 84, army_atka5 ] void () army_atka5 = [ 85, army_atka6 ] { ai_face (); - army_fire2 (250, 7); + army_fire2 (250, 5); }; void () army_atka6 = [ 86, army_atka7 ] @@ -850,7 +849,7 @@ void () army_atkb5 = [ 85, army_atkb6 ] if (r == RANGE_NEAR || r == RANGE_MELEE) self.recoil = 1; - army_fire3 (120, 15); + army_fire3 (120, 9); }; void () army_atkb6 = [ 86, army_atkb7 ] @@ -858,8 +857,8 @@ void () army_atkb6 = [ 86, army_atkb7 ] ai_face (); if (self.recoil == 1) { - army_fire3 (160, 14); - army_fire3 (160, 14); + army_fire3 (160, 9); + army_fire3 (160, 9); } }; @@ -867,7 +866,7 @@ void () army_atkb7 = [ 87, army_atkb8 ] { ai_face (); if (self.recoil == 1) - army_fire3 (160, 14); + army_fire3 (200, 9); }; void () army_atkb8 = [ 88, army_atkb9 ] @@ -875,8 +874,8 @@ void () army_atkb8 = [ 88, army_atkb9 ] ai_face (); if (self.recoil == 1) { - army_fire3 (160, 14); - army_fire3 (160, 14); + army_fire3 (200, 9); + army_fire3 (200, 9); } }; @@ -885,8 +884,8 @@ void () army_atkb9 = [ 89, army_run1 ] ai_face (); if (self.recoil == 1) { - army_fire3 (170, 14); - army_fire3 (170, 14); + army_fire3 (240, 9); + army_fire3 (240, 9); } }; @@ -1384,7 +1383,7 @@ void () grunt_pain = { if (random()*100<10) { - remove(self); + self.solid = SOLID_NOT; return; } if (random()*100<50) @@ -1703,7 +1702,7 @@ void () monster_army = self.movetype = MOVETYPE_STEP; setmodel (self, "progs/soldier.mdl"); setsize (self, '-12 -12 -24', '12 12 28'); - self.max_health = 80; + self.max_health = 120; self.health = self.max_health; self.team = 3; self.islot3 = SlotVal(IID_ARM_LEATHER, 1); @@ -1899,7 +1898,7 @@ void () monster_commander = commanders = commanders + 1; setsize (self, '-12 -12 -24', '12 12 32'); - self.max_health = 200; + self.max_health = 160; self.health = self.max_health; self.islot3 = SlotVal(IID_ARM_COMBAT, 1); self.armortype = 0.5; diff --git a/quakec/fallout2/triggers.qc b/quakec/fallout2/triggers.qc index 551e5587a..da312ec89 100644 --- a/quakec/fallout2/triggers.qc +++ b/quakec/fallout2/triggers.qc @@ -421,10 +421,10 @@ local vector org; spawn_tfog (org); //spawn_tdeath(t.origin, other); - if (self.classname == "player") + if (other.classname == "player") { - self.solid = SOLID_NOT; - self.materialize = 200; + other.solid = SOLID_NOT; + other.materialize = 200; } // move the player and lock him down for a little while if (!other.health) diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 7ab7a9582..2dbf20fc6 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1,5 +1,4 @@ -/* -*/ +void () player_use1; void() show_light_level; void() UseStimpack; void() UseSuperStim; @@ -123,7 +122,7 @@ float (entity healer, entity saved) RevivePlayer = self = oself; -// saved.materialize = 200; + saved.materialize = 200; saved.ghost = 0; saved.health = 20 + (healer.skill_doctor); saved.air_finished = time + 10; @@ -239,28 +238,83 @@ void () puppet_master = { local entity te; local float charm_monster; + local vector org; //this allows you to control other monsters - charm_monster = 0; - te = findradius(self.origin, 400); - while (te) + makevectors (self.v_angle); + traceline (self.origin, self.origin+v_forward*4000, FALSE, self); + + org = self.origin; + + if (trace_ent.classname == "monster" && trace_ent != self.friend) { - if (te.classname == "monster" && (charm_monster == 0) && (visible(te))) - { - spawn_heart(te, 300); - charm_monster = 1; - te.friend = self; - te.charmed = 300; - te.enemy = world; - te.goalentity = self; - self.friend = te; - } - te = te.chain; + trace_ent.friend = self; + trace_ent.charmed = 30000; + self.friend = trace_ent; + spawn_heart(trace_ent, 3000); + + self.friend.think = HuntTarget; + self.friend.nextthink = time + 0.25; + + 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); } }; +void () puppet_master_command = +{ + local entity te, ent; + local vector org; + local float charm_monster; + //this allows you to control other monsters + + makevectors (self.v_angle); + traceline (self.origin, self.origin+v_forward*4000, FALSE, self); + + if (self.friend.classname != "monster") + return; + + org = self.origin; + + if (trace_ent.classname == "monster" && trace_ent != self.friend) + { + self.friend.enemy = trace_ent; + self.friend.think = HuntTarget; + self.friend.nextthink = time + 0.25; + + 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); + } + else + { + self.friend.enemy = self; + self.friend.oldenemy = self; + self.friend.movetarget = self; + self.friend.goalentity = self; + self.friend.pausetime = time + 0.01; + return; + } +}; + + void () illusion_heal = { @@ -302,26 +356,7 @@ void () illusion_heal = source = self.origin + '0 0 0'; traceline (source, source + v_forward*64, FALSE, self); - if (trace_fraction == 1.0)//nobody in front of user, so heal self - { - if (self.health >= self.max_health) - sprint(self, PRINT_MEDIUM, "you are not injured.\n"); - else if (self.health < self.max_health) - { - - sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); - sprint(self, PRINT_MEDIUM, "you heal yourself with a placebo stimpack\n"); - - self.health = self.max_health; - spawn_healing(self); - spawn_healing(self); - spawn_healing(self); - spawn_healing(self); - spawn_healing(self); - spawn_healing(self); - } - } - else if (trace_ent.classname == "player")//healing another team-mate + if (trace_ent.classname == "player")//healing another team-mate { if (trace_ent.health >= trace_ent.max_health) { @@ -361,34 +396,30 @@ void () illusion_heal = } } } -}; -void () puppet_master_command = -{ - local entity te, ent; - local float charm_monster; - //this allows you to control other monsters - - makevectors (self.v_angle); - traceline (self.origin, self.origin+v_forward*4000, FALSE, self); - - if (self.friend.classname != "monster") - return; - - if (trace_ent.classname == "monster" && trace_ent != self.friend) + else//nobody in front of user, so heal self { - self.friend.enemy = trace_ent; - self.friend.think = HuntTarget; - self.friend.nextthink = time + 0.25; - } - else - { - self.friend.enemy = self; - self.friend.think = HuntTarget; - self.friend.nextthink = time + 0.25; + if (self.health >= self.max_health) + sprint(self, PRINT_MEDIUM, "you are not injured.\n"); + else if (self.health < self.max_health) + { + + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + sprint(self, PRINT_MEDIUM, "you heal yourself with a placebo stimpack\n"); + + self.health = self.max_health; + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + } } }; + + void(float slotno) UsePerk = { local float x, mcount, eat; @@ -449,25 +480,21 @@ void(float slotno) UsePerk = } if ((self.perk1 == 3 && slotno == 1) || (self.perk2 == 3 && slotno == 2)) { - if (slotno == 1) - self.perk1timer = 2000; - if (slotno == 2) - self.perk2timer = 2000; - sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); - org = self.origin; - WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); - WriteByte (MSG_MULTICAST, TE_TELEPORT); - WriteCoord (MSG_MULTICAST, org_x); - WriteCoord (MSG_MULTICAST, org_y); - WriteCoord (MSG_MULTICAST, org_z); if (self.friend.classname != "monster") puppet_master(); else puppet_master_command(); + if (self.friend.classname == "monster") + { + if (slotno == 1) + self.perk1timer = 2000; + if (slotno == 2) + self.perk2timer = 2000; + } } else if ((self.perk1 == 7 && slotno == 1) || (self.perk2 == 7 && slotno == 2)) { @@ -485,13 +512,16 @@ void(float slotno) UsePerk = WriteCoord (MSG_MULTICAST, org_y); WriteCoord (MSG_MULTICAST, org_z); + stuffcmd(self, "gl_motionblur 0.9\n"); + self.blurtime = 5; + te = findradius (self.origin, 6000); while (te) { if (te.classname == "monster") { te.hold = 120; - spawn_stop(te, 8); + spawn_stop(te, 5); mcount = mcount + 1; } te = te.chain; @@ -507,11 +537,11 @@ void(float slotno) UsePerk = sound (self, CHAN_BODY, "items/damage.wav", 1, ATTN_NORM); sprint(self, 2, "it is time...\n"); self.supertime = 15; - self.skill_combat = self.skill_combat + 20; - self.skill_doctor = self.skill_doctor + 20; - self.skill_sneak = self.skill_sneak + 20; - self.skill_science = self.skill_science + 20; - self.skill_speech = self.skill_speech + 20; + self.skill_combat = self.skill_combat + 10; + self.skill_doctor = self.skill_doctor + 10; + self.skill_sneak = self.skill_sneak + 10; + self.skill_science = self.skill_science + 10; + self.skill_speech = self.skill_speech + 10; } else if ((self.perk1 == 9 && slotno == 1) || (self.perk2 == 9 && slotno == 2)) { @@ -584,7 +614,7 @@ void(float damage, float dist, float rate) FireMelee = if (getperk(5))//living anatomy { if (self.steadyaim == 0) - damage = damage + self.skill_doctor; + damage = damage + self.skill_doctor + self.skill_speech; } self.recoil = self.recoil + 5; @@ -2252,13 +2282,13 @@ void () ProneOff = sprint (self, 2, "position: stand.\n"); if (getperk(10)) { - self.attack_finished = time + 0.5; - self.rtime = time + 0.5; + self.attack_finished = time + 0.75 - (self.skill_speech*0.05); + self.rtime = time + 0.75 - (self.skill_speech*0.05); } else { - self.attack_finished = time + 1.5; - self.rtime = time + 1.5; + self.attack_finished = time + 1.5 - (self.skill_speech*0.05); + self.rtime = time + 1.5 - (self.skill_speech*0.05); } self.position = 0; PositionControl(); @@ -2291,10 +2321,15 @@ void () ProneOn = self.position = 2; self.view_ofs = '0 0 -10'; sprint (self, 2, "position: prone.\n"); - if (!getperk(10)) + if (getperk(10)) { - self.attack_finished = time + 1.5; - self.rtime = time + 1.5; + self.attack_finished = time + 0.75 - (self.skill_speech*0.05); + self.rtime = time + 0.75 - (self.skill_speech*0.05); + } + else + { + self.attack_finished = time + 1.5 - (self.skill_speech*0.05); + self.rtime = time + 1.5 - (self.skill_speech*0.05); } PositionControl(); }; @@ -2312,10 +2347,15 @@ void () DuckOff = return; } sprint (self, 2, "position: stand.\n"); - if (!getperk(10)) + if (getperk(10)) { - self.attack_finished = time + 0.2; - self.rtime = time + 0.2; + self.attack_finished = time + 0.25 - (self.skill_speech*0.05); + self.rtime = time + 0.75 - (self.skill_speech*0.05); + } + else + { + self.attack_finished = time + 0.75 - (self.skill_speech*0.05); + self.rtime = time + 1.5 - (self.skill_speech*0.05); } self.view_ofs = '0 0 22'; self.position = 0; @@ -2351,10 +2391,15 @@ void () DuckOn = return; } - if (!getperk(10)) + if (getperk(10)) { - self.attack_finished = time + 0.5; - self.rtime = time + 0.5; + self.attack_finished = time + 0.25 - (self.skill_speech*0.05); + self.rtime = time + 0.25 - (self.skill_speech*0.05); + } + else + { + self.attack_finished = time + 0.75 - (self.skill_speech*0.05); + self.rtime = time + 0.75 - (self.skill_speech*0.05); } self.walk = 0; self.speedmulti = 1.00; @@ -2421,25 +2466,15 @@ void() ImpulseCommands = } - if (self.impulse == 11) - ServerflagsCommand (); if (self.impulse == 200) DuckOn (); if (self.impulse == 201) ProneOn (); - - if (self.impulse == 240) - AddClone (); - if (self.impulse == 50) ReloadWeapon (self.current_slot); -// if (self.impulse == 51) -// UseChem (); - if (self.impulse == 52) - BuyMenu (); if (self.impulse == 53) - Special (); + Sneak (); if (self.impulse == 100) ExitScreen (); if (self.impulse == 55) @@ -2455,39 +2490,13 @@ void() ImpulseCommands = if (self.impulse == 62) UsePerk (2); - if (self.impulse == 65) - HostageReport (); + if (self.impulse == 66) WalkOn (); if (self.impulse == 67) WalkOff (); - if (self.impulse == 212) - function_radio ("radio/1_yes.wav", 1); - if (self.impulse == 213) - function_radio ("radio/2_no.wav", 2); - if (self.impulse == 214) - function_radio ("radio/3_letsgo.wav", 3); - if (self.impulse == 215) - function_radio ("radio/4_cover.wav", 4); - if (self.impulse == 216) - function_radio ("radio/5_recon.wav", 5); - if (self.impulse == 217) - function_radio ("radio/6_backup.wav", 6); - if (self.impulse == 218) - function_radio ("radio/7_hold.wav", 7); - if (self.impulse == 219) - function_radio ("radio/8_behind.wav", 8); - if (self.impulse == 220) - function_radio ("radio/9_secure.wav", 9); - if (self.impulse == 221) - function_radio ("radio/10_suppressing.wav", 10); - if (self.impulse == 222) - function_radio ("radio/11_quiet.wav", 11); - if (self.impulse == 223) - CheatCommand(); - if (self.impulse == 224) - show_light_level(); + if (self.impulse == 225) UseStimpack(); if (self.impulse == 226) @@ -2519,16 +2528,11 @@ void() W_WeaponFrame = // check for attack if (self.button0) - { - SuperDamageSound (); W_Attack (); - } if (!self.button0) { - if (self.attack > 0) player_run (); - self.attack = 0; } }; @@ -3196,7 +3200,7 @@ void (float dam, float ap, string snd, float rng, float rate) FirePistol = if (getperk(5)) { if (self.steadyaim == 0) - dam = dam + self.skill_doctor; + dam = dam + self.skill_doctor + self.skill_speech; } @@ -3340,20 +3344,21 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = if (getperk(5)) { if (self.steadyaim == 0) - dam = dam + self.skill_doctor; + dam = dam + self.skill_doctor + self.skill_speech; } sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); loud_noise(40); - - self.equipment_slot = 0; - sprint(self, PRINT_HIGH, " Uncloaked \n"); - setmodel (self, "progs/guy.mdl"); - self.sneak = 0; - sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); - + if (self.sneak > 0) + { + self.equipment_slot = 0; + sprint(self, PRINT_HIGH, " Uncloaked \n"); + setmodel (self, "progs/guy.mdl"); + self.sneak = 0; + sound (self, CHAN_BODY, "misc/r_tele4.wav", 1, ATTN_NORM); + } self.attack_finished = (time + rate); @@ -3395,8 +3400,8 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = if (weap == IID_WP_MP9) { - tmp = 200; - dam = dam * 1.25; + tmp = 165; + dam = dam * 1.1; } if (self.velocity == '0 0 0') @@ -3631,7 +3636,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR if (getperk(5)) { if (self.steadyaim == 0) - dam = dam + self.skill_doctor; + dam = dam + self.skill_doctor + self.skill_speech; } if (weap == IID_WP_MOONLIGHT) @@ -3913,7 +3918,7 @@ void (float dam, float xrecoil, string snd, float rng, float rate) FireMinigun = if (getperk(5)) { if (self.steadyaim == 0) - dam = dam + self.skill_doctor; + dam = dam + self.skill_doctor + self.skill_speech; } loud_noise(50); @@ -4521,43 +4526,8 @@ void () UseStimpack = source = self.origin + '0 0 0'; traceline (source, source + v_forward*64, FALSE, self); - if (trace_fraction == 1.0)//nobody in front of user, so heal self - { - x = SlotOfItem(self, IID_CHEM_STIMPACK); - if (x == 0) - { - sprint(self, PRINT_MEDIUM, "you don't have a stimpack\n"); - return; - } - if (self.regen > 0) - sprint(self, PRINT_MEDIUM, "you are already affected by a stimpack\n"); - else if (self.health >= self.max_health) - sprint(self, PRINT_MEDIUM, "you are not injured.\n"); - else if (self.health < self.max_health) - { - DecreaseDestroySlot(x);//take away a stimpack - - sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); - sprint(self, PRINT_MEDIUM, "you heal yourself with a stimpack\n"); - - thing = findradius(self.origin, 400); - while (thing) - { - if (thing.classname == "player" && thing.health < self.health) - self.score = self.score - 50; - - thing = thing.chain; - } - - self.health = self.health + 30 + (self.skill_doctor); - self.regen = self.regen + (5 + (self.skill_doctor/2)); - spawn_healing(self); - spawn_healing(self); - spawn_healing(self); - } - } - else if (trace_ent.classname == "player")//healing another team-mate + if (trace_ent.classname == "player")//healing another team-mate { if (trace_ent.regen >= 1 && trace_ent.health > 0) { @@ -4633,6 +4603,42 @@ void () UseStimpack = } } } + else + { + x = SlotOfItem(self, IID_CHEM_STIMPACK); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you don't have a stimpack\n"); + return; + } + + if (self.regen > 0) + sprint(self, PRINT_MEDIUM, "you are already affected by a stimpack\n"); + else if (self.health >= self.max_health) + sprint(self, PRINT_MEDIUM, "you are not injured.\n"); + else if (self.health < self.max_health) + { + DecreaseDestroySlot(x);//take away a stimpack + + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + sprint(self, PRINT_MEDIUM, "you heal yourself with a stimpack\n"); + + thing = findradius(self.origin, 400); + while (thing) + { + if (thing.classname == "player" && thing.health < self.health) + self.score = self.score - 50; + + thing = thing.chain; + } + + self.health = self.health + 30 + (self.skill_doctor); + self.regen = self.regen + (5 + (self.skill_doctor/2)); + spawn_healing(self); + spawn_healing(self); + spawn_healing(self); + } + } }; void () UseSuperStim = @@ -4758,40 +4764,7 @@ void () UseMedicalBag = source = self.origin + '0 0 0'; traceline (source, source + v_forward*64, FALSE, self); - if (trace_fraction == 1.0)//nobody in front of user, so heal self - { - x = SlotOfItem(self, IID_CHEM_MEDICALBAG); - if (x == 0) - { - sprint(self, PRINT_MEDIUM, "you don't have a medkit\n"); - return; - } - - if (self.regen > 0) - sprint(self, PRINT_MEDIUM, "you are already affected by a healing chem\n"); - else if (self.health >= self.max_health) - sprint(self, PRINT_MEDIUM, "you are not injured.\n"); - else if (self.health < self.max_health) - { - DecreaseDestroySlot(x);//take away a medkit - - local entity thing; - thing = findradius(self.origin, 400); - while (thing) - { - if (thing.classname == "player" && (thing.health+20) < self.health) - self.score = self.score - 25; - - thing = thing.chain; - } - - sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); - self.health = self.health + 5 + (self.skill_doctor/2); - self.regen = self.regen + 3 + (self.skill_doctor/2); - spawn_healing(self); - } - } - else if (trace_ent.classname == "player")//healing another team-mate + if (trace_ent.classname == "player")//healing another team-mate { if (trace_ent.regen >= 1 && trace_ent.health > 0) { @@ -4844,6 +4817,40 @@ void () UseMedicalBag = } } } + else//nobody in front of user, so heal self + { + x = SlotOfItem(self, IID_CHEM_MEDICALBAG); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "you don't have a medkit\n"); + return; + } + + if (self.regen > 0) + sprint(self, PRINT_MEDIUM, "you are already affected by a healing chem\n"); + else if (self.health >= self.max_health) + sprint(self, PRINT_MEDIUM, "you are not injured.\n"); + else if (self.health < self.max_health) + { + DecreaseDestroySlot(x);//take away a medkit + + local entity thing; + thing = findradius(self.origin, 400); + while (thing) + { + if (thing.classname == "player" && (thing.health+20) < self.health) + self.score = self.score - 25; + + thing = thing.chain; + } + + sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + self.health = self.health + 5 + (self.skill_doctor/2); + self.regen = self.regen + 3 + (self.skill_doctor/2); + spawn_healing(self); + } + } + }; void () DisplayMenu = @@ -5111,7 +5118,7 @@ void () ExitScreen = makevectors (self.v_angle); traceline (self.origin, self.origin + v_forward*128, FALSE, self); - +/* if (self.pickup == 1) { self.pickup = 0; @@ -5134,7 +5141,7 @@ void () ExitScreen = return; } else if (self.pickup == 1) - self.pickup = 0; + self.pickup = 0;*/ if (trace_ent.classname == "bomb") { @@ -6132,7 +6139,7 @@ void (float rec, float number, float dam, float spread, float ran, float auto, s if (getperk(5)) { if (self.steadyaim == 0) - dam = dam + self.skill_doctor/3; + dam = dam + (self.skill_doctor/3) + (self.skill_speech/3); } weap = ToIID(self.(SlotField(self.current_slot))); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 8cb1c403a..5005666f4 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -202,24 +202,22 @@ void() load_monster = { self.zone = 1; - if (world.map_ent2 == 1) + if (world.map_ent2 == 1 || world.map_ent2 == 2) monster_dog(); - if (world.map_ent2 == 2) - monster_zombie(); if (world.map_ent2 == 3 || world.map_ent2 == 4) monster_army(); - if (world.map_ent2 == 5 || world.map_ent2 == 6) + if (world.map_ent2 == 5) + monster_army(); + if (world.map_ent2 == 6) monster_ogre(); if (world.map_ent2 == 7) - monster_army(); + monster_enforcer(); if (world.map_ent2 == 8) - monster_demon1(); + monster_enforcer(); if (world.map_ent2 == 9) monster_demon1(); if (world.map_ent2 == 10) - monster_enforcer(); - if (world.map_ent2 == 11) - monster_shalrath(); + monster_demon1(); if (world.map_ent2 == 12) monster_shambler(); } @@ -233,8 +231,6 @@ void() load_monster = monster_zombie(); else if (random()<0.10) monster_army(); - else if (random()<0.10) - monster_ogre(); else if (random()<0.10) monster_army(); else if (random()<0.10) @@ -326,23 +322,23 @@ void() map_startup = world.map_ent2_percent = t; world.map_ent3_percent = x; -if (challenge_rating < 2) +if (challenge_rating < 4) +{ + world.map_ent1 = ceil(random()*6); + world.map_ent2 = ceil(random()*6); + world.map_ent3 = ceil(random()*6); +} +else if (challenge_rating < 8) { world.map_ent1 = 2 + ceil(random()*6); - world.map_ent2 = ceil(random()*8); - world.map_ent3 = ceil(random()*8); -} -else if (challenge_rating < 4) -{ - world.map_ent1 = 2 + ceil(random()*8); - world.map_ent2 = 4 + ceil(random()*6); - world.map_ent3 = 6 + ceil(random()*4); + world.map_ent2 = 2 + ceil(random()*6); + world.map_ent3 = 2 + ceil(random()*6); } else { - world.map_ent1 = 4 + ceil(random()*8); - world.map_ent2 = 6 + ceil(random()*6); - world.map_ent3 = 8 + ceil(random()*4); + world.map_ent1 = 4 + ceil(random()*6); + world.map_ent2 = 4 + ceil(random()*6); + world.map_ent3 = 4 + ceil(random()*6); } if (world.map_obj == OBJ_HOSTAGE) @@ -1392,7 +1388,7 @@ void () RecoilControl = } - te.recoil = te.recoil - (0.10+(te.skill_combat*0.01)); + te.recoil = te.recoil - (0.15+(te.skill_combat*0.01)); } else { @@ -1419,7 +1415,7 @@ void () RecoilControl = //support fire: going prone gives a -10 recoil bonus with this perk if (getperk(1) && self.position == 2 && te.recoil > 3) { - te.recoil = te.recoil - 0.20; + te.recoil = te.recoil - (0.15 +(self.skill_speech*0.01)); te.driftx = te.driftx * 0.5; te.drifty = te.drifty * 0.5; } @@ -1758,7 +1754,7 @@ void() worldspawn = precache_sound ("weapons/g11.wav"); precache_sound ("weapons/gauss.wav"); precache_sound ("weapons/gpull.wav"); - precache_sound ("weapons/citykiller.wav"); + precache_sound ("weapons/shotgun1.wav"); precache_sound ("weapons/laser.wav"); precache_sound ("weapons/blaster.wav"); precache_sound ("weapons/moonlight-1.wav"); From 2b8b589b269adb308a36450bb1b7cb59039c13ae Mon Sep 17 00:00:00 2001 From: Magnus Date: Tue, 24 Nov 2009 14:10:10 +0000 Subject: [PATCH 39/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3476 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 24 ++++----------- quakec/fallout2/cmds.qc | 16 +++++----- quakec/fallout2/combat.qc | 8 ++--- quakec/fallout2/csqc/invent.qc | 52 ++++++++++++++++---------------- quakec/fallout2/fight.qc | 23 +++++++++----- quakec/fallout2/inventory.qc | 25 ++++++++++++---- quakec/fallout2/items.qc | 8 ++--- quakec/fallout2/player.qc | 2 +- quakec/fallout2/soldier.qc | 2 +- quakec/fallout2/weapons.qc | 55 ++++++++++++++-------------------- quakec/fallout2/world.qc | 1 + 11 files changed, 108 insertions(+), 108 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 20461db1f..5374eb1c8 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -1328,7 +1328,7 @@ void() SneakLevel = te = findradius(self.origin, q); while (te) { - if (visible(te) && te.classname == "monster" && (check_fov_num(te) > 0.5) && te.health > 3) + if ((te.enemy.classname != "player" || te.enemy != self) && visible(te) && te.classname == "monster" && (check_fov_num(te) > 0.5) && te.health > 3) { if (c == 0) { @@ -1340,14 +1340,7 @@ void() SneakLevel = y = r / t; ze = te; c = 1; -/* - bprint(2, "test1: "); - bprint(2, ftos(r)); - bprint(2, " "); - bprint(2, ftos(q)); - bprint(2, " "); - bprint(2, ftos(t)); - bprint(2, "\n");*/ + } else { @@ -1357,14 +1350,7 @@ void() SneakLevel = t = t * (check_fov_num(te)); t = t * (check_fov_num(te)); z = r / t; - /* - bprint(2, "test2: "); - bprint(2, ftos(r)); - bprint(2, " "); - bprint(2, ftos(q)); - bprint(2, " "); - bprint(2, ftos(t)); - bprint(2, "\n");*/ + if (z < y) { @@ -2412,12 +2398,12 @@ void(entity targ, entity attacker) ClientObituary = if (attacker.critical == 778) //wall headshot { bprint (PRINT_MEDIUM, "& "); - attacker.score = attacker.score + 75; + attacker.score = attacker.score + 10; } if (attacker.velocity_z != 0) { bprint (PRINT_MEDIUM, "@ "); - attacker.score = attacker.score - 2; + attacker.score = attacker.score + 2; } // if (attacker.current_slot == 1 && attacker.mag1 == 0) // bprint (PRINT_MEDIUM, "! "); diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index ecc46115d..8121ab460 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -424,7 +424,8 @@ void(string arg1) Cmd_InvBuy = sprint(self, 2, "full inventory.\n"); sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); m = SlotOfItem(self, IID_MONEY); - SetItemSlot(self, m, n); + SetItemSlot(self, m, 0); + TryGiveStackable(self, IID_MONEY, n); return; } sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); @@ -743,16 +744,15 @@ void(string arg1) Cmd_InvMix = sprint(self, PRINT_MEDIUM, "silencer created\n"); sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); } - else if ((iid1 == IID_WP_NEEDLER && iid2 == IID_WP_NEEDLER) || - (iid2 == IID_WP_NEEDLER && iid1 == IID_WP_NEEDLER)) + else if ((iid1 == IID_ARM_VANDAL && iid2 == IID_MISC_JUNK) || + (iid2 == IID_ARM_VANDAL && iid1 == IID_MISC_JUNK)) { - if (random()*100 > (self.skill_science*10)) + if (random()*100 > (self.skill_science*20)) { - sprint(self, PRINT_MEDIUM, "your concoction exploded!\n"); - Explosion(); + sprint(self, PRINT_MEDIUM, "your concoction failed.\n"); return; } @@ -768,8 +768,8 @@ void(string arg1) Cmd_InvMix = DecreaseDestroySlot(23); DecreaseDestroySlot(24); - SetItemSlot(self, x, SlotVal(IID_WP_ACR, 1)); - sprint(self, PRINT_MEDIUM, "Steyr ACR created\n"); + SetItemSlot(self, x, SlotVal(IID_ARM_WASTELAND, 1)); + sprint(self, PRINT_MEDIUM, "Wasteland Jacket created\n"); sound (self, CHAN_BODY, "misc/item1.wav", 1, ATTN_NORM); } else diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 81d95f4d5..a5771e4a7 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -180,10 +180,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (targ.classname == "player" && attacker.classname == "monster") targ.superenemy = attacker; -//getting hurt is slightly painful to the score, play cautiously! - if (attacker.classname == "monster" && targ.classname == "player") - targ.score = targ.score - 1; - //flanking monsters awards points if (attacker.classname == "player" && targ.classname == "monster" && targ.enemy != attacker) attacker.score = attacker.score + 1; @@ -216,14 +212,14 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = //attacking a team-mate is a HUGE penalty if (attacker.classname == "player" && targ.classname == "player") { - attacker.score = attacker.score - 5; + attacker.score = attacker.score - 2; sprint(attacker, 2, "you just shot a teammate! be careful!\n"); } //attacking a hostage is a HUGE penalty if (attacker.classname == "player" && targ.classname == "hostage") { - attacker.score = attacker.score - 5; + attacker.score = attacker.score - 2; sprint(attacker, 2, "you just shot a hostage! be careful!\n"); } diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 9e68ae364..5ebfd2f0a 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -503,30 +503,32 @@ void() Trader_Draw = TraderImage('5 4 0'*IMGSIZEF*(scrwidth/640), 20); - slotnum = 0; + if (!showcontextmenu) + { + slotnum = 0; - if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) - if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 2*IMGSIZEF*(scrwidth/640)) - slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 0; + if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 2*IMGSIZEF*(scrwidth/640)) + slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 0; - if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) - if (mousepos_y >= 2*IMGSIZEF*(scrwidth/640) && mousepos_y <= 3*IMGSIZEF*(scrwidth/640)) - slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 5; + if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 2*IMGSIZEF*(scrwidth/640) && mousepos_y <= 3*IMGSIZEF*(scrwidth/640)) + slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 5; - if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) - if (mousepos_y >= 3*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640)) - slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 10; - - if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) - if (mousepos_y >= 4*IMGSIZEF*(scrwidth/640) && mousepos_y <= 5*IMGSIZEF*(scrwidth/640)) - slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 15; + if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 3*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640)) + slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 10; + if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) + if (mousepos_y >= 4*IMGSIZEF*(scrwidth/640) && mousepos_y <= 5*IMGSIZEF*(scrwidth/640)) + slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 15; + } if (showcontextmenu && show_trader) { - drawfill(contextpos*(scrwidth/640) - '8 8 0'*(scrwidth/640), '48 48 0'*(scrwidth/640), '0 0 0', 1.0); - op = floor((mousepos_y*(scrwidth/640) - contextpos_y*(scrwidth/640))/8*(scrwidth/640)); - drawstring(contextpos*(scrwidth/640) + '0 8 0'*(scrwidth/640), "buy?", '8 8 0'*(scrwidth/640), '1 1 0' + (op!=1)*'0 0 1', + drawfill(contextpos - '8 8 0'*(scrwidth/640), '48 48 0'*(scrwidth/640), '0 0 0', 1.0); + op = floor((mousepos_y - contextpos_y)/8*(scrwidth/640)); + drawstring(contextpos + '0 8 0'*(scrwidth/640), "buy?", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=1)*'0 0 1'*(scrwidth/640), 1); } @@ -1013,18 +1015,18 @@ void() Invent_Draw = if (showcontextmenu && show_inventory) { - drawfill(contextpos - '8 8 0', '88 24 0'+'32 16 0'*(scrwidth/640), '0 0 0', 1); + drawfill(contextpos - '8 8 0', '32 48 0'+'32 16 0'*(scrwidth/640), '0 0 0', 1); op = floor((mousepos_y - contextpos_y)/8); - drawstring(contextpos + (0 * '0 8 0'), "use/reload", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1); - drawstring(contextpos + (1 * '0 8 0'), "drop", '8 8 0', '1 1 0' + (op!=1)*'0 0 1', 1); + drawstring(contextpos + (0 * ('0 8 0'*(scrwidth/640))), "use", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=0)*'0 0 1'*(scrwidth/640), 1); + drawstring(contextpos + (2 * ('0 8 0'*(scrwidth/640))), "drop", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=2)*'0 0 1'*(scrwidth/640), 1); if (getstati(108) == 1) - drawstring(contextpos + (2 * '0 8 0'), "sell", '8 8 0', '1 1 0' + (op!=2)*'0 0 1', 1); + drawstring(contextpos + (4 * ('0 8 0'*(scrwidth/640))), "sell", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=4)*'0 0 1'*(scrwidth/640), 1); } else if (showmixmenu && show_inventory) { - drawfill(contextpos - '8 8 0', '88 24 0'+'96 96 0', '0 0 0', 0.9); + drawfill(contextpos - '8 8 0', '16 24 0'+'96 96 0', '0 0 0', 1); op = floor((mousepos_y - contextpos_y)/8); drawstring(contextpos + (0 * '0 8 0'), "mix items", '8 8 0', '1 1 0' + (op!=0)*'0 0 1', 1); @@ -1227,13 +1229,13 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = { if (showcontextmenu && show_inventory) { - op = floor((mousepos_y - contextpos_y)/8); + op = ceil((mousepos_y - contextpos_y)/(8*(scrwidth/640))); if (op == 0) localcmd(strcat("cmd invuse ", ftos(slotnum), "\n")); - else if ((op == 1)) + else if ((op == 2)) localcmd(strcat("cmd invdrop ", ftos(slotnum), "\n")); - else if (op == 2) + else if (op == 4) localcmd(strcat("cmd invsell ", ftos(slotnum), "\n")); showcontextmenu = false; diff --git a/quakec/fallout2/fight.qc b/quakec/fallout2/fight.qc index c50723796..e2fb5eeaf 100644 --- a/quakec/fallout2/fight.qc +++ b/quakec/fallout2/fight.qc @@ -94,16 +94,23 @@ float() CheckAttack = else if (enemy_range == RANGE_NEAR) { if (self.th_melee) - chance = 0.2; + chance = 0.95; else - chance = 0.4; + chance = 0.95; } else if (enemy_range == RANGE_MID) { if (self.th_melee) - chance = 0.05; + chance = 0.95; else - chance = 0.1; + chance = 0.95; + } + else if (enemy_range == RANGE_FAR) + { + if (self.th_melee) + chance = 0.9; + else + chance = 0.9; } else chance = 0; @@ -111,7 +118,7 @@ float() CheckAttack = if (random () < chance) { self.th_missile (); - SUB_AttackFinished (2*random()); + SUB_AttackFinished (3*random()); return TRUE; } @@ -261,9 +268,11 @@ float() SoldierCheckAttack = if (enemy_range == RANGE_MELEE) chance = 0.9; else if (enemy_range == RANGE_NEAR) - chance = 0.4; + chance = 0.9; else if (enemy_range == RANGE_MID) - chance = 0.05; + chance = 0.9; + else if (enemy_range == RANGE_FAR) + chance = 0.9; else chance = 0; diff --git a/quakec/fallout2/inventory.qc b/quakec/fallout2/inventory.qc index a06fddc4e..ed2222295 100644 --- a/quakec/fallout2/inventory.qc +++ b/quakec/fallout2/inventory.qc @@ -85,7 +85,7 @@ float IID_GREN_STUN = 105; float IID_GREN_FLARE = 106; //armour -#define IsArmor(iid) (iid >= IID_ARM_DESERT && iid <= IID_ARM_LPOWER) +#define IsArmor(iid) (iid >= IID_ARM_DESERT && iid <= IID_ARM_WASTELAND) float IID_ARM_DESERT = 200; float IID_ARM_LEATHER = 201; float IID_ARM_VANDAL = 202; @@ -95,6 +95,7 @@ float IID_ARM_COMBAT = 205; float IID_ARM_SEVA = 206; float IID_ARM_FORCE = 207; float IID_ARM_LPOWER = 208; +float IID_ARM_WASTELAND = 208; //stims #define IsChem(iid) (iid >= IID_CHEM_STIMPACK && iid <= IID_CHEM_BESERK) @@ -915,6 +916,9 @@ string(float iid) GetItemWModel = if (iid >= IID_MISC_JUNK && iid <= IID_MISC_XRAYTUBE) return "progs/junk1.mdl"; + if (iid >= IID_ARM_LEATHER && iid <= IID_ARM_WASTELAND) + return "progs/armor.mdl"; + if (iid == IID_MONEY) return "progs/money.mdl"; @@ -1375,7 +1379,8 @@ string(float iid) GetItemName = return "force armor"; if (iid == IID_ARM_LPOWER) return "power armor"; - + if (iid == IID_ARM_WASTELAND) + return "wasteland jacket"; if (iid == IID_CHEM_STIMPACK) return "stimpack"; @@ -1577,7 +1582,7 @@ float(float iid) GetBaseValue = if (iid == IID_AM_2MMEC) return 120; if (iid == IID_AM_10MM) - return 12; + return 10; if (iid == IID_AM_556MM) return 20; if (iid == IID_AM_5MMHIGHVEL) @@ -1630,7 +1635,8 @@ float(float iid) GetBaseValue = return 300; if (iid == IID_ARM_LPOWER) return 450; - + if (iid == IID_ARM_WASTELAND) + return 150; if (iid == IID_CHEM_STIMPACK) return 5; @@ -1864,7 +1870,8 @@ string(float iid) GetItemDesc = return "experimental energy-field armor, very low absorb"; if (iid == IID_ARM_LPOWER) return "the heaviest armor with great protection"; - + if (iid == IID_ARM_WASTELAND) + return "upgraded vandal armor with extra small arms protection"; if (iid == IID_CHEM_STIMPACK) return "advanced healing chem that replaces lost blood"; @@ -1964,6 +1971,8 @@ float(float iid) GetArmorThreshold = return 3; if (iid == IID_ARM_VANDAL) return 4; + if (iid == IID_ARM_VANDAL) + return 5; if (iid == IID_ARM_METAL) return 1; if (iid == IID_ARM_TESLA) @@ -1988,6 +1997,8 @@ float(float iid) GetArmorAbsorb = return 20; if (iid == IID_ARM_VANDAL) return 30; + if (iid == IID_ARM_WASTELAND) + return 30; if (iid == IID_ARM_METAL) return 50; if (iid == IID_ARM_TESLA) @@ -2316,6 +2327,8 @@ string(float iid) GetItemImage = return "leather.jpg"; if (iid == IID_ARM_VANDAL) return "vandal.jpg"; + if (iid == IID_ARM_WASTELAND) + return "vandal.jpg"; if (iid == IID_ARM_METAL) return "metal.jpg"; if (iid == IID_ARM_TESLA) @@ -2925,6 +2938,8 @@ float(float iid) GetItemThreatLevel = return 0; if (iid == IID_ARM_VANDAL) return 0; + if (iid == IID_ARM_WASTELAND) + return 0; if (iid == IID_ARM_METAL) return 0; if (iid == IID_ARM_TESLA) diff --git a/quakec/fallout2/items.qc b/quakec/fallout2/items.qc index 091559011..2b61041ba 100644 --- a/quakec/fallout2/items.qc +++ b/quakec/fallout2/items.qc @@ -316,13 +316,13 @@ void(vector loc) SpawnJunk = - if (random()*100 <= 50) + if (random()*100 <= 25) junk.islot1 = SlotVal(IID_MISC_HMXCOMPOUND, 1); - else if (random()*100 <= 50) + else if (random()*100 <= 25) junk.islot1 = SlotVal(IID_MISC_CHEMICALS, 1); - else if (random()*100 <= 33) + else if (random()*100 <= 25) junk.islot1 = SlotVal(IID_MISC_NUKACOLA, 1); - else if (random()*100 <= 33) + else if (random()*100 <= 25) junk.islot1 = SlotVal(IID_MISC_AEROSOL, 1); else if (random()*100 <= 10) junk.islot1 = SlotVal(IID_MISC_RDXCRYSTAL, 1); diff --git a/quakec/fallout2/player.qc b/quakec/fallout2/player.qc index 587a5f552..5391371cd 100644 --- a/quakec/fallout2/player.qc +++ b/quakec/fallout2/player.qc @@ -194,7 +194,7 @@ void (float db) loud_noise = while (te) { - if (te.classname == "monster" && te.enemy.classname != "player") + if (te.classname == "monster" && (te.enemy.classname != "player" && te.charmed <= 0)) { dir = normalize(te.origin - self.origin); v = vlen(te.origin - self.origin); diff --git a/quakec/fallout2/soldier.qc b/quakec/fallout2/soldier.qc index 4bebce59c..08b024c66 100644 --- a/quakec/fallout2/soldier.qc +++ b/quakec/fallout2/soldier.qc @@ -351,7 +351,7 @@ void (float tmp, float dam) army_fire3 = if (trace_ent.takedamage) { SpawnBlood (org, PLAT_LOW_TRIGGER); - dam = dam + random()*dam; + dam = 6 + random()*6; dam = dam * (1 - (trace_fraction/2)); T_Damage (trace_ent, self, self, dam); } diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 2dbf20fc6..adece7085 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -637,7 +637,10 @@ void(float damage, float dist, float rate) FireMelee = if (dot < 0.5 && trace_ent.takedamage) { - tdam = 20 + (60*self.skill_sneak); + if (trace_ent.enemy.classname == "player") + tdam = 20 + (60*self.skill_sneak); + else + tdam = 20 + (50*self.skill_sneak); if (trace_ent.solid != SOLID_BSP) SpawnBlood (org, 1); @@ -665,6 +668,18 @@ void(float damage, float dist, float rate) FireMelee = self.sneak = 0; spawn_excla(self, 3); } + else + { + bprint(2, self.netname); + bprint(2, " assassinates "); + bprint(2, trace_ent.netname); + bprint(2, "!\n"); + + if (random()*4<2) + sound (trace_ent, CHAN_WEAPON, "player/headshot.wav", 1, ATTN_NONE); + else + sound (trace_ent, CHAN_WEAPON, "player/udeath.wav", 1, ATTN_NONE); + } } else if (trace_ent.takedamage) { @@ -2060,9 +2075,9 @@ void() W_Attack = else if (weap == IID_WP_MP9) FireSMG(12, 0, "weapons/mp9.wav", 1500, 0.08); else if (weap == IID_WP_GREASEGUN_S) - FireSMG(9, 0, "weapons/greasegun.wav", 1200, 0.08); + FireSMG(12, 0, "weapons/greasegun.wav", 1200, 0.08); else if (weap == IID_WP_MP9_S) - FireSMG(9, 0, "weapons/mp9.wav", 1200, 0.08); + FireSMG(12, 0, "weapons/mp9.wav", 1200, 0.08); else if (weap == IID_WP_RANGEMASTER) FireAssaultRifle(18, 4, "weapons/rangem.wav", 4000, 0.1); else if (weap == IID_WP_AK112) @@ -2661,7 +2676,7 @@ void (vector org) bullet_hole = WriteCoord (MSG_MULTICAST, org_x); WriteCoord (MSG_MULTICAST, org_y); WriteCoord (MSG_MULTICAST, org_z); - multicast (self.origin, MULTICAST_PHS); + multicast (org, MULTICAST_PHS); }; @@ -3404,6 +3419,10 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG = dam = dam * 1.1; } + if (weap == IID_WP_GREASEGUN_S) + tmp = 210; + + if (self.velocity == '0 0 0') tmp = tmp + (15*self.recoil); else @@ -4623,15 +4642,6 @@ void () UseStimpack = sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); sprint(self, PRINT_MEDIUM, "you heal yourself with a stimpack\n"); - thing = findradius(self.origin, 400); - while (thing) - { - if (thing.classname == "player" && thing.health < self.health) - self.score = self.score - 50; - - thing = thing.chain; - } - self.health = self.health + 30 + (self.skill_doctor); self.regen = self.regen + (5 + (self.skill_doctor/2)); spawn_healing(self); @@ -4672,15 +4682,6 @@ void () UseSuperStim = sprint(self, PRINT_MEDIUM, "you are not injured.\n"); else if (self.health < self.max_health) { - local entity thing; - thing = findradius(self.origin, 400); - while (thing) - { - if (thing.classname == "player" && (thing.health+20) < self.health) - self.score = self.score - 50; - - thing = thing.chain; - } DecreaseDestroySlot(x);//take away a stimpack sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); @@ -4834,16 +4835,6 @@ void () UseMedicalBag = { DecreaseDestroySlot(x);//take away a medkit - local entity thing; - thing = findradius(self.origin, 400); - while (thing) - { - if (thing.classname == "player" && (thing.health+20) < self.health) - self.score = self.score - 25; - - thing = thing.chain; - } - sound (self, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); self.health = self.health + 5 + (self.skill_doctor/2); self.regen = self.regen + 3 + (self.skill_doctor/2); diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index 5005666f4..ef63cc506 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -1799,6 +1799,7 @@ void() worldspawn = precache_model ("progs/backpack.mdl"); precache_model ("progs/zom_gib.mdl"); precache_model ("progs/v_light.mdl"); + precache_model ("progs/armor.mdl"); precache_model ("maps/crate.bsp"); // From fb59b3495608afcdbc99249d91f5cf4ff0669051 Mon Sep 17 00:00:00 2001 From: Magnus Date: Tue, 24 Nov 2009 14:26:18 +0000 Subject: [PATCH 40/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3477 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/csqc/invent.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 5ebfd2f0a..21931713e 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -1229,7 +1229,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = { if (showcontextmenu && show_inventory) { - op = ceil((mousepos_y - contextpos_y)/(8*(scrwidth/640))); + op = floor((mousepos_y - contextpos_y)/(8*(scrwidth/640))); if (op == 0) localcmd(strcat("cmd invuse ", ftos(slotnum), "\n")); From 7a5f49e879a9e0a83ec841589c7cc41abcf816f2 Mon Sep 17 00:00:00 2001 From: Magnus Date: Tue, 24 Nov 2009 14:28:23 +0000 Subject: [PATCH 41/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3478 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/fight.qc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/quakec/fallout2/fight.qc b/quakec/fallout2/fight.qc index e2fb5eeaf..10482d327 100644 --- a/quakec/fallout2/fight.qc +++ b/quakec/fallout2/fight.qc @@ -88,7 +88,7 @@ float() CheckAttack = if (enemy_range == RANGE_MELEE) { - chance = 0.9; + chance = 0.99; self.attack_finished = 0; } else if (enemy_range == RANGE_NEAR) @@ -108,9 +108,9 @@ float() CheckAttack = else if (enemy_range == RANGE_FAR) { if (self.th_melee) - chance = 0.9; + chance = 0.95; else - chance = 0.9; + chance = 0.95; } else chance = 0; @@ -118,7 +118,7 @@ float() CheckAttack = if (random () < chance) { self.th_missile (); - SUB_AttackFinished (3*random()); + SUB_AttackFinished (4*random()); return TRUE; } @@ -266,20 +266,20 @@ float() SoldierCheckAttack = return FALSE; if (enemy_range == RANGE_MELEE) - chance = 0.9; + chance = 0.95; else if (enemy_range == RANGE_NEAR) - chance = 0.9; + chance = 0.95; else if (enemy_range == RANGE_MID) - chance = 0.9; + chance = 0.95; else if (enemy_range == RANGE_FAR) - chance = 0.9; + chance = 0.95; else chance = 0; if (random () < chance) { self.th_missile (); - SUB_AttackFinished (1 + random()); + SUB_AttackFinished (2 + random()); if (random() < 0.3) self.lefty = !self.lefty; From f3350239fca8360a6ad32612754fd519dadbe000 Mon Sep 17 00:00:00 2001 From: Magnus Date: Wed, 25 Nov 2009 08:02:54 +0000 Subject: [PATCH 42/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3479 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 24 +----- quakec/fallout2/cmds.qc | 7 +- quakec/fallout2/dog.qc | 3 +- quakec/fallout2/misc.qc | 2 +- quakec/fallout2/weapons.qc | 147 ++++++++++++++++++++++++------------- 5 files changed, 107 insertions(+), 76 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 5374eb1c8..548a7ab19 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -628,6 +628,7 @@ void() PutClientInServer = self.islot1 = SlotVal(IID_WP_KNIFE, 1); self.islot2 = 0; self.islot3 = SlotVal(IID_ARM_LEATHER, 1); + self.islot4 = SlotVal(IID_EQUIP_CLIMBINGGEAR, 1); self.islot5 = SlotVal(IID_CHEM_STIMPACK, 5); self.islot7 = 0; self.islot8 = SlotVal(IID_MONEY, 100); @@ -2216,6 +2217,7 @@ void() ClientConnect = stuffcmd(self, "alias perk2 impulse 62\n"); stuffcmd(self, "alias stimpack impulse 225\n"); + stuffcmd(self, "alias radx impulse 228\n"); stuffcmd(self, "alias equip \"cmd invuse 4\"\n"); stuffcmd(self, "alias q1 \"cmd invuse 5\"\n"); stuffcmd(self, "alias q2 \"cmd invuse 11\"\n"); @@ -2224,28 +2226,6 @@ void() ClientConnect = stuffcmd(self, "alias toolkit \"cmd invswap toolkit 2;impulse 2\"\n"); - stuffcmd (self, "alias radio1 impulse 212\n"); - stuffcmd (self, "alias radio2 impulse 213\n"); - stuffcmd (self, "alias radio3 impulse 214\n"); - stuffcmd (self, "alias radio4 impulse 215\n"); - stuffcmd (self, "alias radio5 impulse 216\n"); - stuffcmd (self, "alias radio6 impulse 217\n"); - stuffcmd (self, "alias radio7 impulse 218\n"); - stuffcmd (self, "alias radio8 impulse 219\n"); - stuffcmd (self, "alias radio9 impulse 220\n"); - stuffcmd (self, "alias radio10 impulse 221\n"); - stuffcmd (self, "alias radio11 impulse 222\n"); - stuffcmd (self, "bind f1 radio1\n"); - stuffcmd (self, "bind f2 radio2\n"); - stuffcmd (self, "bind f3 radio3\n"); - stuffcmd (self, "bind f4 radio4\n"); - stuffcmd (self, "bind f5 radio5\n"); - stuffcmd (self, "bind f6 radio6\n"); - stuffcmd (self, "bind f7 radio7\n"); - stuffcmd (self, "bind f8 radio8\n"); - stuffcmd (self, "bind f9 radio9\n"); - stuffcmd (self, "bind f10 radio10\n"); - stuffcmd (self, "bind f11 radio11\n"); stuffcmd(self, "bind 9 impulse 9\n"); stuffcmd(self, "bind 0 impulse 10\n"); diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index 8121ab460..ac397b20e 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -142,6 +142,12 @@ void(string arg1) Cmd_InvUse = return; } + if (iid == IID_CHEM_RADX) + { + UseRadX(); + return; + } + if (iid == IID_GREN_FLARE) { ToggleFlare(); @@ -156,7 +162,6 @@ void(string arg1) Cmd_InvUse = if (iid == IID_CHEM_ADRENALINE || iid == IID_CHEM_PSYCHO || - iid == IID_CHEM_RADX || iid == IID_CHEM_BESERK) { if (UseBoostingChem(iid)) diff --git a/quakec/fallout2/dog.qc b/quakec/fallout2/dog.qc index 2b937ba06..ec49865ab 100644 --- a/quakec/fallout2/dog.qc +++ b/quakec/fallout2/dog.qc @@ -62,11 +62,10 @@ local float ldmg; if (vlen(delta) > (100)) return; - ldmg = 5+random()*5; + ldmg = 7+random()*5; T_Damage (self.enemy, self, self, ldmg); - self.enemy.attack_finished = time + 0.25; }; diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index 4e2d5e524..20c76d251 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -1087,7 +1087,7 @@ void() brotherhood_doctor = self.xslot17 = SlotVal(IID_CHEM_MEDICALBAG, 25); self.xslot18 = SlotVal(IID_CHEM_SUPERSTIM, 1); self.xslot19 = SlotVal(IID_CHEM_ADRENALINE, 1); - self.xslot20 = SlotVal(IID_CHEM_PSYCHO, 1); + self.xslot20 = SlotVal(IID_CHEM_RADX, 1); }; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index adece7085..58406b023 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1,6 +1,7 @@ void () player_use1; void() show_light_level; void() UseStimpack; +void() UseRadX; void() UseSuperStim; void() UseMedicalBag; void (entity chest, float iid, float num) DropFromChest; @@ -2518,6 +2519,8 @@ void() ImpulseCommands = UseSuperStim(); if (self.impulse == 227) UseMedicalBag(); + if (self.impulse == 228) + UseRadX(); if (self.impulse == 255) self.ammo_shells = 200; @@ -4509,6 +4512,8 @@ void () UseStimpack = if (self.attack_finished > time) return; + +/* te = findradius (self.origin, 100); while (te) { @@ -4536,7 +4541,7 @@ void () UseStimpack = } if (found == 1) - return; + return;*/ self.attack_finished = time + 1; self.rtime = time + 1; @@ -4563,7 +4568,9 @@ void () UseStimpack = x = SlotOfItem(self, IID_CHEM_STIMPACK); if (x > 0) DecreaseDestroySlot(x);//take away a stimpack - else if (x == 0) + else if (x == 0 && !trace_ent.deadflag) + sprint(self, PRINT_MEDIUM, "no stims!\n"); + else if (x == 0 && trace_ent.deadflag) { sprint(self, PRINT_MEDIUM, "no stims! searching "); sprint(self, PRINT_MEDIUM, trace_ent.netname); @@ -4573,13 +4580,13 @@ void () UseStimpack = if (x == 0) { sprint(self, PRINT_MEDIUM, trace_ent.netname); - sprint(self, PRINT_MEDIUM, " had no stims!\n"); + sprint(self, PRINT_MEDIUM, " had no stimpacks!\n"); } if (x >= 1) { self.score = self.score + 5; sprint(self, PRINT_MEDIUM, trace_ent.netname); - sprint(self, PRINT_MEDIUM, " had a stim. using it to heal.\n"); + sprint(self, PRINT_MEDIUM, " had a stimpack. using it to heal.\n"); DecreaseDestroySlotOther(trace_ent, x);//take away a stimpack return; } @@ -4587,13 +4594,13 @@ void () UseStimpack = if (x == 0) { sprint(self, PRINT_MEDIUM, trace_ent.netname); - sprint(self, PRINT_MEDIUM, " had no medical bag!\n"); + sprint(self, PRINT_MEDIUM, " had no medkit!\n"); } if (x >= 1) { self.score = self.score + 5; sprint(self, PRINT_MEDIUM, trace_ent.netname); - sprint(self, PRINT_MEDIUM, " had a stim. using it to heal.\n"); + sprint(self, PRINT_MEDIUM, " had a medkit. using it to heal.\n"); DecreaseDestroySlotOther(trace_ent, x);//take away a stimpack return; } @@ -4651,6 +4658,84 @@ void () UseStimpack = } }; + +void () UseRadX = +{ + local float x, found; + local vector source; + local entity thing, te; + + + if (self.attack_finished > time) + return; + + + self.attack_finished = time + 1; + self.rtime = time + 1; + + makevectors (self.v_angle); + source = self.origin + '0 0 0'; + traceline (source, source + v_forward*64, FALSE, self); + + + if (trace_ent.classname == "player")//healing another team-mate + { + if (trace_ent.radiation <= 0) + { + sprint(self, PRINT_MEDIUM, trace_ent.netname); + sprint(self, PRINT_MEDIUM, " is not irradiated.\n"); + } + else if (trace_ent.radiation > 0) + { + x = SlotOfItem(self, IID_CHEM_RADX); + if (x > 0) + DecreaseDestroySlot(x);//take away radx + else if (x == 0 && !trace_ent.deadflag) + sprint(self, PRINT_MEDIUM, "you don't have any radx\n"); + + + else + { + sound (trace_ent, CHAN_BODY, "items/r_item1.wav", 1, ATTN_NORM); + self.score = self.score + 1; + sprint(trace_ent, PRINT_MEDIUM, self.netname); + sprint(trace_ent, PRINT_MEDIUM, " gives you some Rad-X.\n"); + sprint(self, PRINT_MEDIUM, "Your radiation levels decrease.\n"); + + + trace_ent.radiation = trace_ent.radiation - (5 + (self.skill_doctor*2)); + if (self.radiation < 0) + self.radiation = 0; + } + } + } + else + { + x = SlotOfItem(self, IID_CHEM_RADX); + if (x == 0) + { + sprint(self, PRINT_MEDIUM, "You don't have any Rad-X.\n"); + return; + } + + + else if (self.radiation <= 0) + sprint(self, PRINT_MEDIUM, "You are not irradiated.\n"); + else if (self.radiation > 0) + { + DecreaseDestroySlot(x);//take away a stimpack + + sound (self, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM); + sprint(self, PRINT_MEDIUM, "You take some Rad-X.\n"); + sprint(self, PRINT_MEDIUM, "Your radiation levels decrease.\n"); + + self.radiation = self.radiation - (5 + (self.skill_doctor*2)); + if (self.radiation < 0) + self.radiation = 0; + } + } +}; + void () UseSuperStim = { local float x; @@ -5989,58 +6074,20 @@ void () CharacterSheet = void () UseEquipment = { - - if (self.equipment == 0) + if (self.equipment_slot == 0) { - centerprint(self, "‘ no extra equipment ‘\n"); - return; - } - if (self.equipment == 1) - { - centerprint(self, "‘ medic's bag ‘\nlets you carry more stimpacks\n"); - return; - } - if (self.equipment == 4) - { - centerprint(self, "‘ belt pouch ‘\ngives you room for two extra grenades\n"); - return; - } - if (self.equipment == 5) - { - centerprint(self, "‘ backpack ‘\nlets you carry more ammunition\n"); - return; - } - if (self.equipment == 6) - { - centerprint(self, "‘ toolkit mark ii ‘\nbuild, defuse and open doors faster\n"); - return; - } -/* - if (self.equipment == 7 && self.equipment_slot == 0) - { - sprint (self, PRINT_HIGH, "climbing gear in place.\n"); + sprint (self, PRINT_HIGH, "you are now attempting to climb.\n"); sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); self.maxspeed = 100; self.velocity_z = 0; - self.equipment_state = 1; + self.equipment_slot = 1; } - if (self.equipment == 7 && self.equipment_state == 1) + else if (self.equipment_slot == 1) { - sprint (self, PRINT_HIGH, "climbing gear retrieved.\n"); + sprint (self, PRINT_HIGH, "no longer attempting to climb.\n"); sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM); self.grab = 0; - self.equipment_state = 0; - return; - } -*/ - if (self.equipment == 8) - { - centerprint(self, "‘ enhanced battery ‘\nallows longer cloaking\n"); - return; - } - if (self.equipment == 9) - { - Sneak(); + self.equipment_slot = 0; return; } From 6401a36d2ee4353b57c06b7d29db43b7fc276ec2 Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 26 Nov 2009 20:38:53 +0000 Subject: [PATCH 43/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3480 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 28 ++++++- quakec/fallout2/csqc/invent.qc | 6 +- quakec/fallout2/csqc/main.qc | 28 ++++--- quakec/fallout2/defs.qc | 1 + quakec/fallout2/misc.qc | 143 ++++++++++++++++++++++++++++++++- quakec/fallout2/weapons.qc | 3 +- 6 files changed, 185 insertions(+), 24 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 548a7ab19..1e53807e8 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -346,7 +346,8 @@ void() execute_changelevel = - localcmd("map r_bunker\n"); + localcmd(strcat("map ", self.map, "\n")); + }; @@ -385,6 +386,8 @@ void() changelevel_touch = sprint (other, 2,"there are still bombs to disarm.\n"); return; } + else + localcmd(strcat("map ", self.map, "\n")); if (world.map_obj == OBJ_HOSTAGE && hostages > 0) return; @@ -412,7 +415,7 @@ void() changelevel_touch = other = find (other, classname, "player"); } - localcmd("serverinfo objective return\n"); + //localcmd("serverinfo objective return\n"); SUB_UseTargets (); @@ -1651,6 +1654,10 @@ void() PlayerPreThink = SneakLevel(); self.accept = 0; + + if (self.safezone > 0) + self.safezone = self.safezone - 1; + self.endinfo1 = rescue; self.endinfo2 = dead_hostage; self.endinfo3 = hostages; @@ -1742,6 +1749,8 @@ void() PlayerPreThink = if (self.cycle2 < time) { + + if (self.blurtime > 0 && self.blurtime <= 1) stuffcmd(self, "gl_motionblur 0\n"); else if (self.blurtime > 0) @@ -1780,7 +1789,11 @@ void() PlayerPreThink = if (self.musictimer == 0) { - if (world.model == "maps/r_bunker.bsp") + if (self.soundmode == 1) + stuffcmd(self, "play music/exploring\n"); + else if (self.soundmode == 2) + stuffcmd(self, "play music/vault\n"); + else if (world.model == "maps/r_bunker.bsp") stuffcmd(self, "play music/vault\n"); else if (world.map_obj == OBJ_DEADTOWN) stuffcmd(self, "play music/afterglow\n"); @@ -2693,5 +2706,12 @@ void(entity targ, entity attacker) ClientObituary = void() Identify = { -return; + local vector source; + + makevectors (self.v_angle); + source = self.origin + '0 0 0'; + traceline (source, source + v_forward*128, FALSE, self); + + if (trace_ent.netname) + centerprint (self, trace_ent.netname); }; diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 21931713e..556765d3d 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -43,7 +43,7 @@ float mouseisdown; #define IMGSIZEZ ('1 1 0'*IMGSIZEX) #define IMGSIZEQ ('1 1 0'*2) -#define CURSORSIZE 8 +#define CURSORSIZE 32 @@ -1020,7 +1020,7 @@ void() Invent_Draw = op = floor((mousepos_y - contextpos_y)/8); drawstring(contextpos + (0 * ('0 8 0'*(scrwidth/640))), "use", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=0)*'0 0 1'*(scrwidth/640), 1); drawstring(contextpos + (2 * ('0 8 0'*(scrwidth/640))), "drop", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=2)*'0 0 1'*(scrwidth/640), 1); - if (getstati(108) == 1) + if (getstati(108) > 0) drawstring(contextpos + (4 * ('0 8 0'*(scrwidth/640))), "sell", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=4)*'0 0 1'*(scrwidth/640), 1); } @@ -1186,7 +1186,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = show_items = false; show_gainperk = false; } - if (param1 == 'b' && (getstati(108) == 1)) + if (param1 == 'b' && (getstati(108) > 0)) { show_trader = !show_trader; show_pipboy = false; diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index ebdc603d8..f7db11595 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -123,16 +123,6 @@ void() Time_Draw = local float xtime, ytime, ztime, obj; local string qtime, rtime, shadowtime, text, text2; - xtime = getstati(63); - ytime = floor(xtime/60); - ztime = xtime - (ytime*60); - qtime = ftos(ytime); - rtime = ftos(ztime); - shadowtime = ftos(getstati(63)); - - drawstring('0 0 0'+('1 0 0'*(scrwidth*0.25))+('0 1 0'*(scrheight*0.86)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8'*(scrwidth/640), '1 1 1', 1); - - obj = getstati(66); if (obj == 1) @@ -143,12 +133,27 @@ void() Time_Draw = text = "assassinate commanders\n"; if (obj == 4) text = "rescue citizens\n"; + else + text = "no active mission.\n"; - drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.86)), text, '8 8 8'*(scrwidth/640), '1 1 1', 1); + xtime = getstati(63); + ytime = floor(xtime/60); + ztime = xtime - (ytime*60); + qtime = ftos(ytime); + rtime = ftos(ztime); + shadowtime = ftos(getstati(63)); + + if (obj >= 1) + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.25))+('0 1 0'*(scrheight*0.88)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8'*(scrwidth/640), '1 1 1', 1); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.88)), text, '8 8 8'*(scrwidth/640), '1 1 1', 1); + + + if (obj >= 1) + { text = "citizens rescued: "; text2 = ftos(getstati(113)); drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.90)), strcat(text, text2), '8 8 8'*(scrwidth/640), '1 1 1', 1); @@ -160,6 +165,7 @@ void() Time_Draw = text = "citizens left: "; text2 = ftos(getstati(115)); drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.94)), strcat(text, text2), '8 8 8'*(scrwidth/640), '1 1 1', 1); + } }; diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index f58eb80e2..1ca7b2517 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -684,6 +684,7 @@ float intermission_running; .float shadowskill_speech; .float musictimer; +.float soundmode; .float rescued; .float scale; diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index 20c76d251..6c3e9afbc 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -909,10 +909,139 @@ void() misc_noisemaker = }; + +void() explore_think = +{ + local entity te; + + self.think = explore_think; + self.nextthink = time + 0.5; + + te = findradius(self.origin, 128); + + while (te.classname == "player") + { + if (te.soundmode != 1) + { + te.musictimer = 0; + te.soundmode = 1; + } + + te = te.chain; + } +}; + +void() sound_explore = +{ + + self.think = explore_think; + self.nextthink = time + 0.5; + + +}; + +void() vault_think = +{ + local entity te; + + self.think = vault_think; + self.nextthink = time + 0.5; + + te = findradius(self.origin, 128); + + while (te.classname == "player") + { + if (te.soundmode != 2) + { + te.musictimer = 0; + te.soundmode = 2; + } + + te = te.chain; + } +}; + +void() sound_vault = +{ + + self.think = vault_think; + self.nextthink = time + 0.5; + + +}; + + +void() env_grass1 = +{ + local entity grass; + + setmodel (self, "progs/grass1.spr"); + self.touch = SUB_Null; + self.solid = SOLID_NOT; + setsize (self, '-16 -16 -16', '16 16 0'); + self.takedamage = DAMAGE_NO; + self.classname = "env_grass"; + self.movetype = MOVETYPE_BOUNCE; + + grass = spawn(); + + grass.origin = self.origin; + setmodel (grass, "progs/grass1.spr"); + grass.touch = SUB_Null; + grass.solid = SOLID_NOT; + setsize (grass, '-16 -16 -16', '16 16 0'); + grass.takedamage = DAMAGE_NO; + grass.classname = "env_grass"; + grass.angles_y = grass.angles_y + 90; + grass.movetype = MOVETYPE_BOUNCE; + +}; + +void() env_grass2 = +{ + local entity grass; + + setmodel (self, "progs/grass2.spr"); + self.touch = SUB_Null; + self.solid = SOLID_NOT; + setsize (self, '-16 -16 -16', '16 16 0'); + self.takedamage = DAMAGE_NO; + self.classname = "env_grass"; + self.movetype = MOVETYPE_BOUNCE; + + grass = spawn(); + + grass.origin = self.origin; + setmodel (grass, "progs/grass2.spr"); + grass.touch = SUB_Null; + grass.solid = SOLID_NOT; + setsize (grass, '-16 -16 -16', '16 16 0'); + grass.takedamage = DAMAGE_NO; + grass.classname = "env_grass"; + grass.angles_y = grass.angles_y + 90; + grass.movetype = MOVETYPE_BOUNCE; +}; + + +void() env_car = +{ + + setmodel (self, "progs/car.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + setsize (self, '-16 -16 -16', '16 16 16'); + self.takedamage = DAMAGE_NO; + self.classname = "env_grass"; + self.movetype = MOVETYPE_BOUNCE; + + +}; + + void() brotherhood_merchant = { local entity sign; - +/* sign = spawn(); sign.movetype = MOVETYPE_BOUNCE; sign.velocity_x = crandom()*50; @@ -933,7 +1062,7 @@ void() brotherhood_merchant = sign.origin = self.origin + '0 32 32'; setmodel(sign, "progs/money.mdl"); sign.solid = SOLID_BBOX; - sign.scale = 10; + sign.scale = 10;*/ @@ -946,7 +1075,7 @@ void() brotherhood_merchant = self.classname = "merchant"; self.think = shop_face; self.nextthink = time + 0.5; - + self.netname = "merchant"; self.xslot1 = SlotVal(IID_WP_GLOCK, 1); @@ -1001,11 +1130,13 @@ void() brotherhood_sergeant = self.movetype = MOVETYPE_BOUNCE; self.velocity_z = -200; - setmodel (self, "progs/enforcer.mdl"); + setmodel (self, "progs/hknight.mdl"); self.touch = SUB_Null; self.solid = SOLID_SLIDEBOX; setsize (self, '-16 -16 -24', '16 16 32'); self.takedamage = DAMAGE_NO; + self.classname = "sergeant"; + self.netname = "rupert starfall, the commander"; }; void() brotherhood_soldier = @@ -1041,6 +1172,7 @@ void() brotherhood_soldier = self.xslot19 = SlotVal(IID_WP_MOONLIGHT, 1); self.xslot20 = SlotVal(IID_WP_MOSSBERG, 1); + self.netname = "soldier"; self.think = shop_face; self.nextthink = time + 0.5; @@ -1063,6 +1195,7 @@ void() brotherhood_guard = self.solid = SOLID_SLIDEBOX; setsize (self, '-16 -16 -24', '16 16 32'); self.takedamage = DAMAGE_NO; + self.netname = "guard"; }; void() brotherhood_doctor = @@ -1088,6 +1221,8 @@ void() brotherhood_doctor = self.xslot18 = SlotVal(IID_CHEM_SUPERSTIM, 1); self.xslot19 = SlotVal(IID_CHEM_ADRENALINE, 1); self.xslot20 = SlotVal(IID_CHEM_RADX, 1); + + self.netname = "doctor"; }; diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index 58406b023..d0f37437e 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1962,7 +1962,6 @@ void() W_Attack = weap = ToIID(self.(SlotField(self.current_slot))); - self.safezone = 0; if (weap == IID_NONE) { @@ -5970,7 +5969,7 @@ void () shop_face = if (te.classname == "player") { self.enemy = te; - te.safezone = 1; + te.safezone = 2; te.xslot1 = self.xslot1; te.xslot2 = self.xslot2; te.xslot3 = self.xslot3; From d788f223b5271abe7ffa6fd9fca344f3cbc5a1e6 Mon Sep 17 00:00:00 2001 From: Magnus Date: Wed, 2 Dec 2009 02:45:16 +0000 Subject: [PATCH 44/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3481 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/client.qc | 94 ++++++++++++++++++------ quakec/fallout2/cmds.qc | 8 ++- quakec/fallout2/combat.qc | 8 +-- quakec/fallout2/csqc/invent.qc | 35 +++++---- quakec/fallout2/csqc/main.qc | 2 +- quakec/fallout2/defs.qc | 3 + quakec/fallout2/misc.qc | 128 ++++++++++++++++++++++++++++++++- quakec/fallout2/weapons.qc | 41 ++--------- quakec/fallout2/world.qc | 6 ++ quakec/fallout2/zombie.qc | 33 +++++++++ 10 files changed, 277 insertions(+), 81 deletions(-) diff --git a/quakec/fallout2/client.qc b/quakec/fallout2/client.qc index 1e53807e8..89b697851 100644 --- a/quakec/fallout2/client.qc +++ b/quakec/fallout2/client.qc @@ -347,7 +347,7 @@ void() execute_changelevel = localcmd(strcat("map ", self.map, "\n")); - + localcmd(strcat("serverinfo direction ", self.direction, "\n")); }; @@ -387,7 +387,25 @@ void() changelevel_touch = return; } else + { + + if (infokey(world, "worldtime") == "1") + localcmd("serverinfo worldtime 2\n"); + else if (infokey(world, "worldtime") == "2") + localcmd("serverinfo worldtime 3\n"); + else if (infokey(world, "worldtime") == "3") + localcmd("serverinfo worldtime 3\n"); + else if (infokey(world, "worldtime") == "4") + localcmd("serverinfo worldtime 5\n"); + else if (infokey(world, "worldtime") == "5") + localcmd("serverinfo worldtime 6\n"); + else if (infokey(world, "worldtime") == "6") + localcmd("serverinfo worldtime 1\n"); + localcmd(strcat("map ", self.map, "\n")); + localcmd(strcat("serverinfo direction ", self.direction, "\n")); + return; + } if (world.map_obj == OBJ_HOSTAGE && hostages > 0) return; @@ -425,6 +443,20 @@ void() changelevel_touch = // in the middle of C movement code, so set a think time to do it self.think = execute_changelevel; self.nextthink = time + 10; + + + if (infokey(world, "worldtime") == "1") + localcmd("serverinfo worldtime 2\n"); + else if (infokey(world, "worldtime") == "2") + localcmd("serverinfo worldtime 3\n"); + else if (infokey(world, "worldtime") == "3") + localcmd("serverinfo worldtime 3\n"); + else if (infokey(world, "worldtime") == "4") + localcmd("serverinfo worldtime 5\n"); + else if (infokey(world, "worldtime") == "5") + localcmd("serverinfo worldtime 6\n"); + else if (infokey(world, "worldtime") == "6") + localcmd("serverinfo worldtime 1\n"); }; /*QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION @@ -514,8 +546,19 @@ entity() SelectSpawnPoint = if (coop == 0) ent1 = "info_player_deathmatch"; else - ent1 = "info_player_coop"; + { + if (infokey(world, "direction") == "north") + ent1 = "info_player_coop_south"; + else if (infokey(world, "direction") == "west") + ent1 = "info_player_coop_east"; + else if (infokey(world, "direction") == "east") + ent1 = "info_player_coop_west"; + else if (infokey(world, "direction") == "south") + ent1 = "info_player_coop_north"; + else + ent1 = "info_player_coop"; + } if (ent1 == "spawn3") { if (self.team == 1) @@ -651,6 +694,7 @@ void() PutClientInServer = self.islot22 = 0; self.islot23 = 0; self.islot24 = 0; + self.score = 200; } self.attack_finished = time; @@ -780,6 +824,13 @@ void() PutClientInServer = stuffcmd(self, "play music/vault\n"); else if (world.map_obj == OBJ_DEADTOWN) stuffcmd(self, "play music/afterglow\n"); + + if (infokey(world, "worldtime") == "1" || infokey(world, "worldtime") == "2") + stuffcmd(self, "r_skybox dawn\n"); + else if (infokey(world, "worldtime") == "3" || infokey(world, "worldtime") == "4") + stuffcmd(self, "r_skybox dusk\n"); + else if (infokey(world, "worldtime") == "5" || infokey(world, "worldtime") == "6") + stuffcmd(self, "r_skybox night\n"); }; @@ -846,6 +897,21 @@ void() info_player_coop = { }; +void() info_player_coop_north = +{ +}; + +void() info_player_coop_west = +{ +}; + +void() info_player_coop_east = +{ +}; + +void() info_player_coop_south = +{ +}; void() spawn1 = { @@ -1596,26 +1662,14 @@ void() PlayerPreThink = + self.tnl = self.skill_combat + self.skill_doctor + self.skill_sneak + self.skill_science + self.skill_speech; + self.tnl = 10 + 10*self.tnl; - if (self.score < 200) + if (self.score > self.tnl) { - if ((self.skill_combat + self.skill_doctor + self.skill_sneak + self.skill_science + self.skill_speech) <= 8) - { - self.score = 200; - - sound (self, CHAN_BODY, "player/levelup.wav", 1, ATTN_NORM); - sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n"); - } - } - else if (self.score > 200) - { - if ((self.skill_combat + self.skill_doctor + self.skill_sneak + self.skill_science + self.skill_speech) > 8) - { - self.score = 200; - - sound (self, CHAN_BODY, "player/levelup.wav", 1, ATTN_NORM); - sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n"); - } + self.score = self.tnl; + sound (self, CHAN_BODY, "player/levelup.wav", 1, ATTN_NORM); + sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n"); } //perk1timer and perk2timer are "cooldowns" for each perk diff --git a/quakec/fallout2/cmds.qc b/quakec/fallout2/cmds.qc index ac397b20e..d13eae748 100644 --- a/quakec/fallout2/cmds.qc +++ b/quakec/fallout2/cmds.qc @@ -233,16 +233,16 @@ void(string arg1) Cmd_InvDrop = void(string arg1) Cmd_GainLevel = { - if (self.score < 200) + if (self.score < self.tnl) { sprint(self, 2, "not enough experience points.\n"); sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); return; } - if (self.score >= 200) + if (self.score >= self.tnl) { sound (self, CHAN_BODY, "buttons/switch02.wav", 1, ATTN_NORM); - self.score = self.score - 200; + self.score = self.score - self.tnl; } if (arg1 == "combat") @@ -255,6 +255,8 @@ void(string arg1) Cmd_GainLevel = self.skill_science = self.skill_science + 1; else if (arg1 == "speech") self.skill_speech = self.skill_speech + 1; + + self.max_health = 80 + (self.skill_combat*4) + (self.skill_doctor*2) + (self.skill_sneak*2) + (self.skill_speech*2) + (self.skill_science); }; void(string arg1, string arg2) Cmd_GainPerk = diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index a5771e4a7..90b811ecd 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -116,11 +116,11 @@ void(entity targ, entity attacker) ArmorNoise = r = random(); if (r <= 0.33) - sound (targ, CHAN_WEAPON, "contact/armor1.wav", 1, ATTN_NORM); + sound (targ, CHAN_BODY, "contact/armor1.wav", 1, ATTN_NONE); else if (r <= 0.67) - sound (targ, CHAN_WEAPON, "contact/armor2.wav", 1, ATTN_NORM); + sound (targ, CHAN_BODY, "contact/armor2.wav", 1, ATTN_NONE); else - sound (targ, CHAN_WEAPON, "contact/armor3.wav", 1, ATTN_NORM); + sound (targ, CHAN_BODY, "contact/armor3.wav", 1, ATTN_NONE); }; @@ -326,7 +326,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (targ.classname == "monster") attacker.score = attacker.score + 1; - sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM); + sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NONE); makevectors (targ.v_angle); diff --git a/quakec/fallout2/csqc/invent.qc b/quakec/fallout2/csqc/invent.qc index 556765d3d..49d73e680 100644 --- a/quakec/fallout2/csqc/invent.qc +++ b/quakec/fallout2/csqc/invent.qc @@ -526,9 +526,9 @@ void() Trader_Draw = if (showcontextmenu && show_trader) { - drawfill(contextpos - '8 8 0'*(scrwidth/640), '48 48 0'*(scrwidth/640), '0 0 0', 1.0); + drawfill(contextpos - '8 8 0'*(scrwidth/640), '64 64 0'*(scrwidth/640), '0 0 0', 1.0); op = floor((mousepos_y - contextpos_y)/8*(scrwidth/640)); - drawstring(contextpos + '0 8 0'*(scrwidth/640), "buy?", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=1)*'0 0 1'*(scrwidth/640), + drawstring(contextpos + '0 8 0'*(scrwidth/640), "buy?", '12 12 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op>=6||op<0)*'0 0 1'*(scrwidth/640), 1); } @@ -788,7 +788,7 @@ void() GainPerk_Draw = void() Pipboy_Draw = { - float width,height,lvl,bar, top, s; + float width,height,lvl,bar, top, s, tnl; string skill; vector w; @@ -915,7 +915,8 @@ void() Pipboy_Draw = bar = 0; s = getstati(127); - top = ceil(200 * (s/200)); + tnl = getstati(116); + top = ceil(200 * (s/tnl)); if (top > 200) top = 200; @@ -929,7 +930,7 @@ void() Pipboy_Draw = drawpic('0 0 0'+('1 0 0'*(scrwidth*0.48)) +('0 1 0'*(scrheight*0.685)) + ('0 1 0'*(scrheight/640)), "gui/pipboy/graph/blue.jpg", '1 16 0'*(scrheight/640)+'1 0 0'*(scrwidth/640)*bar, '1 1 1', 1); - drawstring('0 0 0'+('1 0 0'*(scrwidth*0.6)) +('0 1 0'*(scrheight*0.69)), strcat(ftos(s),"/", ftos(top), "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); + drawstring('0 0 0'+('1 0 0'*(scrwidth*0.6)) +('0 1 0'*(scrheight*0.69)), strcat(ftos(s),"/", ftos(tnl), "\n"), '8 8 0'*(scrwidth/640), '1 1 1', 1); if (mousepos_x > scrwidth*0.95) @@ -1015,13 +1016,19 @@ void() Invent_Draw = if (showcontextmenu && show_inventory) { - drawfill(contextpos - '8 8 0', '32 48 0'+'32 16 0'*(scrwidth/640), '0 0 0', 1); + drawfill(contextpos - '8 8 0', '64 128 0'+'32 16 0'*(scrwidth/640), '0 0 0', 1); - op = floor((mousepos_y - contextpos_y)/8); - drawstring(contextpos + (0 * ('0 8 0'*(scrwidth/640))), "use", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=0)*'0 0 1'*(scrwidth/640), 1); - drawstring(contextpos + (2 * ('0 8 0'*(scrwidth/640))), "drop", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=2)*'0 0 1'*(scrwidth/640), 1); + + itname = GetItemName(ToIID(it)); + drawstring(contextpos + (0 * ('0 32 0'*(scrwidth/640))), itname, '8 8 0'*(scrwidth/640), '1 1 1', 1); + + + op = floor((mousepos_y - contextpos_y)/(32*(scrwidth/640))); + drawstring(contextpos + (1 * ('0 32 0'*(scrwidth/640))), "------", '8 8 0'*(scrwidth/640), '1 1 1'*(scrwidth/640), 1); + drawstring(contextpos + (2 * ('0 32 0'*(scrwidth/640))), "[use]", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=2)*'0 0 1'*(scrwidth/640), 1); + drawstring(contextpos + (3 * ('0 32 0'*(scrwidth/640))), "[drop]", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=3)*'0 0 1'*(scrwidth/640), 1); if (getstati(108) > 0) - drawstring(contextpos + (4 * ('0 8 0'*(scrwidth/640))), "sell", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=4)*'0 0 1'*(scrwidth/640), 1); + drawstring(contextpos + (4 * ('0 32 0'*(scrwidth/640))), "[sell]", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=4)*'0 0 1'*(scrwidth/640), 1); } else if (showmixmenu && show_inventory) @@ -1229,11 +1236,11 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = { if (showcontextmenu && show_inventory) { - op = floor((mousepos_y - contextpos_y)/(8*(scrwidth/640))); + op = floor((mousepos_y - contextpos_y)/(32*(scrwidth/640))); - if (op == 0) + if (op == 2) localcmd(strcat("cmd invuse ", ftos(slotnum), "\n")); - else if ((op == 2)) + else if ((op == 3)) localcmd(strcat("cmd invdrop ", ftos(slotnum), "\n")); else if (op == 4) localcmd(strcat("cmd invsell ", ftos(slotnum), "\n")); @@ -1254,7 +1261,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent = { op = floor((mousepos_y - contextpos_y)/8); - if (op == 1) + if (op >= 0 && op <=6) localcmd(strcat("cmd invbuy ", ftos(slotnum), "\n")); showcontextmenu = false; diff --git a/quakec/fallout2/csqc/main.qc b/quakec/fallout2/csqc/main.qc index f7db11595..1fdd2211e 100644 --- a/quakec/fallout2/csqc/main.qc +++ b/quakec/fallout2/csqc/main.qc @@ -88,7 +88,7 @@ void() Position_Draw = //drawstring('0 0 0'+('1 0 0'*(scrwidth*0.20)) +('0 1 0'*(scrheight*0.78)), strcat("%", sn), '12 12 12'*(scrheight/640), '1 1 1', 1); } - if (lvl >= 200) + if (lvl >= getstati(116)) { drawpic('0 0 0'+('1 0 0'*(scrwidth*0.70)) +('0 1 0'*(scrheight*0.80)), "gui/hud/level.png", '0 0 0'+'132 22 0'*(scrwidth/640), '1 1 1'); } diff --git a/quakec/fallout2/defs.qc b/quakec/fallout2/defs.qc index 1ca7b2517..a779e595b 100644 --- a/quakec/fallout2/defs.qc +++ b/quakec/fallout2/defs.qc @@ -535,6 +535,8 @@ float s_p2; float s_p3; float challenge_rating; + +.string direction; //================================================ // @@ -630,6 +632,7 @@ float intermission_running; .float ghost; .float ghostcnt; +.float tnl; .float dtime; .float active; .float zone; diff --git a/quakec/fallout2/misc.qc b/quakec/fallout2/misc.qc index 6c3e9afbc..52a267944 100644 --- a/quakec/fallout2/misc.qc +++ b/quakec/fallout2/misc.qc @@ -908,6 +908,62 @@ void() misc_noisemaker = self.think = noise_think; }; +void() random_monster = +{ + load_monster(); +}; + +void () npc_doctor = +{ + precache_model ("progs/hosguy.mdl"); + precache_sound ("misc/hosdie1.wav"); + precache_sound ("misc/hosdie2.wav"); + hos_stand1 (); + self.movetype = MOVETYPE_STEP; + self.velocity = VEC_ORIGIN; + self.touch = SUB_Null; + self.takedamage = DAMAGE_NO; + setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); + setmodel (self, "progs/hosguy.mdl"); + self.health = 70; + self.think = hostage_think; + self.nextthink = (time + START_OFF); + self.team = START_OFF; + self.solid = SOLID_BBOX; + self.th_die = hostage_die; + self.th_pain = hostage_pain; + self.rescued = MULTICAST_ALL; + self.netname = "doctor"; + + 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, 1); + self.xslot17 = SlotVal(IID_CHEM_MEDICALBAG, 25); + self.xslot18 = SlotVal(IID_CHEM_SUPERSTIM, 1); + self.xslot19 = SlotVal(IID_CHEM_ADRENALINE, 1); + self.xslot20 = SlotVal(IID_CHEM_RADX, 1); +}; + + +void () hurt_citizen = +{ + precache_model ("progs/hoshurt.mdl"); + self.velocity = VEC_ORIGIN; + self.touch = SUB_Null; + self.classname = "citizen"; + self.takedamage = DAMAGE_NO; + setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); + setmodel (self, "progs/hoshurt.mdl"); + self.solid = SOLID_BBOX; + self.netname = "injured citizen"; + self.movetype = MOVETYPE_STEP; +}; + void() explore_think = @@ -971,10 +1027,49 @@ void() sound_vault = }; +void() env_gun1 = +{ + precache_model ("progs/w_rangem.mdl"); + setmodel (self, "progs/w_rangem.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + setsize (self, '-8 -8 -1', '8 8 1'); + self.takedamage = DAMAGE_NO; + self.classname = "env_gun1"; + self.movetype = MOVETYPE_BOUNCE; + self.netname = "rangemaster rifle"; +}; + +void() env_gun2 = +{ + precache_model ("progs/w_10mmpistol.mdl"); + setmodel (self, "progs/w_10mmpistol.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_BBOX; + setsize (self, '-8 -8 -1', '8 8 1'); + self.takedamage = DAMAGE_NO; + self.classname = "env_gun2"; + self.movetype = MOVETYPE_BOUNCE; + self.netname = "10mm pistol"; +}; + +void() env_armor = +{ + precache_model ("progs/w_armor.mdl"); + setmodel (self, "progs/w_armor.mdl"); + self.solid = SOLID_BBOX; + setsize (self, '-16 -16 -16', '16 16 16'); + self.takedamage = DAMAGE_NO; + self.classname = "env_gun2"; + self.movetype = MOVETYPE_BOUNCE; + self.classname = "armor"; +}; + void() env_grass1 = { local entity grass; + precache_model ("progs/grass1.spr"); setmodel (self, "progs/grass1.spr"); self.touch = SUB_Null; self.solid = SOLID_NOT; @@ -1000,7 +1095,7 @@ void() env_grass1 = void() env_grass2 = { local entity grass; - + precache_model ("progs/grass2.spr"); setmodel (self, "progs/grass2.spr"); self.touch = SUB_Null; self.solid = SOLID_NOT; @@ -1025,7 +1120,7 @@ void() env_grass2 = void() env_car = { - + precache_model ("progs/car.mdl"); setmodel (self, "progs/car.mdl"); self.touch = SUB_Null; self.solid = SOLID_BBOX; @@ -1037,6 +1132,15 @@ void() env_car = }; +void() func_transparent = +{ + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + setorigin (self, self.origin); + self.classname = "glass"; + self.netname = "unbreakable glass"; +}; + void() brotherhood_merchant = { @@ -1198,6 +1302,26 @@ void() brotherhood_guard = self.netname = "guard"; }; +void() npc_guard = +{ + precache_model ("progs/enforcer.mdl"); + precache_sound ("enforcer/sight1.wav"); + precache_sound ("enforcer/sight2.wav"); + precache_sound ("enforcer/sight3.wav"); + precache_sound ("enforcer/sight4.wav"); + + setorigin(self, self.origin + '0 0 64'); + self.movetype = MOVETYPE_BOUNCE; + self.velocity_z = -200; + + setmodel (self, "progs/enforcer.mdl"); + self.touch = SUB_Null; + self.solid = SOLID_SLIDEBOX; + setsize (self, '-16 -16 -24', '16 16 32'); + self.takedamage = DAMAGE_NO; + self.netname = "guard"; +}; + void() brotherhood_doctor = { setorigin(self, self.origin + '0 0 64'); diff --git a/quakec/fallout2/weapons.qc b/quakec/fallout2/weapons.qc index d0f37437e..9003cea50 100644 --- a/quakec/fallout2/weapons.qc +++ b/quakec/fallout2/weapons.qc @@ -1819,41 +1819,8 @@ void (float slotno) ReloadWeapon = r = 3; - if (wid == IID_WP_ROCKETLAUNCHER || wid == IID_WP_WINCHESTER || wid == IID_WP_MOSSBERG) - { - sound (self, CHAN_VOICE, "weapons/shell.wav", TRUE, ATTN_NORM); - r = 1; - if (self.current_slot == slotno) - self.currentammo = ToStatus(ItemInSlot(self, slotno)); - self.attack_finished = time + r; - self.rtime = time + r; - return; - } - else if (wid == IID_WP_PIPERIFLE_R || wid == IID_WP_PIPERIFLE_S_R || wid == IID_WP_PIPERIFLE_SCOPE_R || wid == IID_WP_PIPERIFLE_SCOPE_S_R) - { - sound (self, CHAN_VOICE, "weapons/shell.wav", TRUE, ATTN_NORM); - r = 0.5; - if (self.current_slot == slotno) - self.currentammo = ToStatus(ItemInSlot(self, slotno)); - self.attack_finished = time + r; - self.rtime = time + r; - - return; - } - else if (wid >= IID_WP_PIPERIFLE && wid <= IID_WP_PIPERIFLE_S_R) - { - sound (self, CHAN_VOICE, "weapons/shell.wav", TRUE, ATTN_NORM); - r = 1; - if (self.current_slot == slotno) - self.currentammo = ToStatus(ItemInSlot(self, slotno)); - self.attack_finished = time + r; - self.rtime = time + r; - - return; - } - else - sound (self, CHAN_WEAPON, "weapons/reload.wav", TRUE, ATTN_NORM); + sound (self, CHAN_WEAPON, "weapons/reload.wav", TRUE, ATTN_NORM); sprint(self, 2, "reloading...\n"); @@ -2067,9 +2034,9 @@ void() W_Attack = else if (weap == IID_WP_WINCHESTER) W_FireShotgun (2, 5, 7, 50, 1500, 0, "weapons/shotgun1.wav"); else if (weap == IID_WP_MOSSBERG) - W_FireShotgun (2, 5, 6, 20, 2000, 1, "weapons/citykiller.wav"); + W_FireShotgun (2, 5, 6, 20, 2000, 1, "weapons/shotgun1.wav"); else if (weap == IID_WP_JACKHAMMER) - W_FireShotgun (1, 5, 6, 30, 1750, 2, "weapons/citykiller.wav"); + W_FireShotgun (1, 5, 6, 30, 1750, 2, "weapons/shotgun1.wav"); else if (weap == IID_WP_GREASEGUN) FireSMG(12, 0, "weapons/greasegun.wav", 1500, 0.08); else if (weap == IID_WP_MP9) @@ -2522,7 +2489,7 @@ void() ImpulseCommands = UseRadX(); if (self.impulse == 255) - self.ammo_shells = 200; + self.islot10 = SlotVal(IID_MONEY, 300); self.impulse = 0; }; diff --git a/quakec/fallout2/world.qc b/quakec/fallout2/world.qc index ef63cc506..ab2333068 100644 --- a/quakec/fallout2/world.qc +++ b/quakec/fallout2/world.qc @@ -112,6 +112,7 @@ void() SetupStats = clientstat(113, 2, endinfo1); clientstat(114, 2, endinfo2); clientstat(115, 2, endinfo3); + clientstat(116, 2, tnl); clientstat(125, 2, timer); clientstat(126, 2, popup); clientstat(127, 2, score); @@ -261,6 +262,11 @@ void() map_startup = localcmd("serverinfo total zero\n"); + + + localcmd("serverinfo worldtime 3\n"); + + if (infokey(world, "objective") == "return") world.map_obj = 0; if (infokey(world, "objective") == "hostage") diff --git a/quakec/fallout2/zombie.qc b/quakec/fallout2/zombie.qc index 5f7922cdf..c08d3e480 100644 --- a/quakec/fallout2/zombie.qc +++ b/quakec/fallout2/zombie.qc @@ -1031,3 +1031,36 @@ void() monster_zombie = if (random()<0.25 && world.map_obj == 4) spawn_civilian(self.origin); }; + + + + +void() zombie_generator = +{ + local entity zombie, lair; + local entity te, ze; + local float stop; + local vector spot; + local float zomc, pcount; + + + + + + spot = self.origin; + lair = spawn (); + setorigin(lair, spot); + lair.origin = spot; + lair.solid = SOLID_NOT; + lair.health = 1000; + lair.max_health = 1000; + setmodel (lair, ""); + lair.movetype = MOVETYPE_STEP; + setsize (lair, '-8 -8 -24', '8 8 24'); + lair.netname = "lair"; + lair.classname = "lair"; + lair.think = spawn_ghoul_copy; + lair.nextthink = time + 1*random(); + + +}; \ No newline at end of file From 7d2d7ba88d02041664f5b36ef536ef4929b5c4a7 Mon Sep 17 00:00:00 2001 From: Magnus Date: Wed, 2 Dec 2009 02:47:08 +0000 Subject: [PATCH 45/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3482 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/fallout2/combat.qc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/quakec/fallout2/combat.qc b/quakec/fallout2/combat.qc index 90b811ecd..eaf4e58e9 100644 --- a/quakec/fallout2/combat.qc +++ b/quakec/fallout2/combat.qc @@ -107,10 +107,9 @@ void(entity targ, entity attacker) ArmorNoise = { local float r; - if (targ.classname != "player" && targ.classname != "monster") + if (attacker.classname != "player" && targ.classname != "monster") return; - - if (attacker.classname != "player" && attacker.classname != "monster") + else if (targ.classname != "player" && attacker.classname != "monster") return; r = random(); From c8308c46f201842cb9067212c0f0e234d9fd1bcb Mon Sep 17 00:00:00 2001 From: Blub Date: Tue, 22 Dec 2009 21:38:52 +0000 Subject: [PATCH 46/76] Patch by div0: add temp locking to ADDSTOREP emulation This avoids the issue that temps used in += operations can be overwritten by function calls in the expression. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3483 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qcc_pr_comp.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index cb7abd285..fa2fcf59e 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -1381,7 +1381,12 @@ static void QCC_LockActiveTemps(void) t->scope = pr_scope; t = t->next; } - +} + +static void QCC_LockTemp(QCC_def_t *d) +{ + if (d->temp && d->temp->used) + d->temp->scope = pr_scope; } static void QCC_RemapLockedTemp(temp_t *t, int firststatement, int laststatement) @@ -2234,19 +2239,26 @@ QCC_def_t *QCC_PR_Statement ( QCC_opcode_t *op, QCC_def_t *var_a, QCC_def_t *var //don't chain these... this expansion is not the same. { int st; - + int need_lock = false; for (st = numstatements-2; st>=0; st--) { if (statements[st].op == OP_ADDRESS) if (statements[st].c == var_b->ofs) break; + if (statements[st].op >= OP_CALL0 && statements[st].op <= OP_CALL8 || statements[st].op >= OP_CALL1H && statements[st].op <= OP_CALL8H) + need_lock = true; + + //printf("%s\n", pr_opcodes[statements[st].op].opname); + if (statements[st].c == var_b->ofs) QCC_PR_ParseWarning(0, "Temp-reuse may have broken your %s", op->name); } if (st < 0) QCC_PR_ParseError(ERR_INTERNAL, "XSTOREP_F: pointer was not generated from previous statement"); var_c = QCC_GetTemp(*op->type_c); + if(need_lock) + QCC_LockTemp(var_c); // this will cause the temp to be remapped by QCC_RemapLockedTemps statement_linenums[statement-statements] = statement_linenums[st]; statement->op = OP_ADDRESS; @@ -2351,6 +2363,7 @@ QCC_def_t *QCC_PR_Statement ( QCC_opcode_t *op, QCC_def_t *var_a, QCC_def_t *var op = &pr_opcodes[OP_STOREP_F]; QCC_FreeTemp(var_c); + var_c = NULL; QCC_FreeTemp(var_b); @@ -2367,18 +2380,24 @@ QCC_def_t *QCC_PR_Statement ( QCC_opcode_t *op, QCC_def_t *var_a, QCC_def_t *var //don't chain these... this expansion is not the same. { int st; + int need_lock = false; for (st = numstatements-2; st>=0; st--) { if (statements[st].op == OP_ADDRESS) if (statements[st].c == var_b->ofs) break; + if (statements[st].op >= OP_CALL0 && statements[st].op <= OP_CALL8 || statements[st].op >= OP_CALL1H && statements[st].op <= OP_CALL8H) + need_lock = true; + if (statements[st].c == var_b->ofs) QCC_PR_ParseWarning(0, "Temp-reuse may have broken your %s", op->name); } if (st < 0) QCC_PR_ParseError(ERR_INTERNAL, "XSTOREP_V couldn't find pointer generation"); var_c = QCC_GetTemp(*op->type_c); + if(need_lock) + QCC_LockTemp(var_c); // this will cause the temp to be remapped by QCC_RemapLockedTemps statement_linenums[statement-statements] = statement_linenums[st]; statement->op = OP_ADDRESS; From df421399136d6bd0e851697f3679bdbde0f22239 Mon Sep 17 00:00:00 2001 From: Lance Date: Fri, 25 Dec 2009 02:57:16 +0000 Subject: [PATCH 47/76] Added various 4:3, 16:10 (8:5), 16:9, 5:4 aspect-based resolutions, cleaned up the video mode list, added refresh rate option to video menu (driver default (0), 59hz, 60hz, 70hz, 72hz, 75hz, 85hz, 100hz) git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3484 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/renderer.c | 117 +++++++++++++++++++++++++++++++++------ 1 file changed, 100 insertions(+), 17 deletions(-) diff --git a/engine/client/renderer.c b/engine/client/renderer.c index e8f7807b2..6ab6b435a 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -986,23 +986,42 @@ typedef struct vidmode_s vidmode_t vid_modes[] = { - { "320x200", 320, 200}, - { "320x240", 320, 240}, - { "400x300", 400, 300}, - { "512x384", 512, 384}, - { "640x480", 640, 480}, - { "800x600", 800, 600}, - { "960x720", 960, 720}, - { "1024x768 (XGA: 14-15inch LCD Native)", 1024, 768}, - { "1152x864", 1152, 864}, - { "1280x960", 1280, 960}, - { "1280x1024 (SXGA: 17-19inch LCD Native)", 1280, 1024}, - { "1440x900 (WXGA: 19inch Widescreen LCD Native Resolution)", 1440, 900}, - { "1600x1200 (UXGA: 20+inch LCD Native Resolution)", 1600, 1200}, //sw height is bound to 200 to 1024 - { "1680x1050 (WSXGA: 20inch Widescreen LCD Native)", 1680, 1050}, - { "1920x1200 (WUXGA: 24inch Widescreen LCD Native)", 1920, 1200}, - { "2048x1536", 2048, 1536}, //too much width will disable water warping (>1280) (but at that resolution, it's almost unnoticable) - { "2560x1600 (30inch Widescreen LCD Native)", 2560, 1600} + { "320x200 (16:10)", 320, 200}, // CGA, MCGA + { "320x240 (4:3)", 320, 240}, // QVGA + { "400x300 (4:3)", 400, 300}, // Quarter SVGA + { "512x384 (4:3)", 512, 384}, // Mac LC + { "640x400 (16:10)", 640, 400}, // Atari ST mono, Amiga OCS NTSC Hires interlace + { "640x480 (4:3)", 640, 480}, // VGA, MCGA + { "800x600 (4:3)", 800, 600}, // SVGA + { "856x480 (16:9)", 856, 480}, // WVGA + { "960x720 (4:3)", 960, 720}, // unnamed + { "1024x576 (16:9)", 1024, 576}, // WSVGA + { "1024x640 (16:10)", 1024, 640}, // unnamed + { "1024x768 (4:3)", 1024, 768}, // XGA + { "1152x720 (16:10)", 1152, 720}, // XGA+ + { "1152x864 (4:3)", 1152, 864}, // XGA+ + { "1280x720 (16:9)", 1280, 720}, // WXGA min. + { "1280x800 (16:10)", 1280, 800}, // WXGA avg (native resolution of 17" widescreen LCDs) + { "1280x960 (4:3)", 1280, 960}, //SXGA- + { "1280x1024 (5:4)", 1280, 1024}, // SXGA (native resolution of 17-19" LCDs) + { "1366x768 (16:9)", 1366, 768}, // WXGA + { "1400x1050 (4:3)", 1400, 1050}, // SXGA+ + { "1440x900 (16:10)", 1440, 900}, // WXGA+ (native resolution of 19" widescreen LCDs) + { "1440x1080 (4:3)", 1440, 1080}, // unnamed + { "1600x900 (16:9)", 1600, 900}, // 900p + { "1600x1200 (4:3)", 1600, 1200}, // UXGA (native resolution of 20"+ LCDs) //sw height is bound to 200 to 1024 + { "1680x1050 (16:10)", 1680, 1050}, // WSXGA+ (native resolution of 22" widescreen LCDs) + { "1792x1344 (4:3)", 1792, 1344}, // unnamed + { "1800x1440 (5:4)", 1800, 1440}, // unnamed + { "1856x1392 (4:3)", 1856, 1392}, //unnamed + { "1920x1080 (16:9)", 1920, 1080}, // 1080p (native resolution of cheap 24" LCDs, which really are 23.6") + { "1920x1200 (16:10)", 1920, 1200}, // WUXGA (native resolution of good 24" widescreen LCDs) + { "1920x1440 (4:3)", 1920, 1440}, // TXGA + { "2048x1152 (16:9)", 2048, 1152}, // QWXGA (native resolution of 23" ultra-widescreen LCDs) + { "2048x1536 (4:3)", 2048, 1536}, // QXGA //too much width will disable water warping (>1280) (but at that resolution, it's almost unnoticable) + { "2304x1440 (16:10)", 2304, 1440}, // (unnamed; maximum resolution of the Sony GDM-FW900 and Hewlett Packard A7217A) + { "2560x1600 (16:10)", 2560, 1600}, // WQXGA (maximum resolution of 30" widescreen LCDs, Dell for example) + { "2560x2048 (5:4)", 2560, 2048} // QSXGA }; #define NUMVIDMODES sizeof(vid_modes)/sizeof(vid_modes[0]) @@ -1021,6 +1040,7 @@ typedef struct { menucombo_t *modecombo; menucombo_t *conscalecombo; menucombo_t *bppcombo; + menucombo_t *refreshratecombo; menucombo_t *texturefiltercombo; menuedit_t *customwidth; menuedit_t *customheight; @@ -1108,6 +1128,35 @@ qboolean M_VideoApply (union menuoption_s *op,struct menu_s *menu,int key) Cbuf_AddText(va("vid_bpp %i\n", selectedbpp), RESTRICT_LOCAL); + switch(info->refreshratecombo->selectedoption) + { + case 0: + Cbuf_AddText(va("vid_displayfrequency %i\n", 0), RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText(va("vid_displayfrequency %i\n", 59), RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText(va("vid_displayfrequency %i\n", 60), RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText(va("vid_displayfrequency %i\n", 70), RESTRICT_LOCAL); + break; + case 4: + Cbuf_AddText(va("vid_displayfrequency %i\n", 72), RESTRICT_LOCAL); + break; + case 5: + Cbuf_AddText(va("vid_displayfrequency %i\n", 75), RESTRICT_LOCAL); + break; + case 6: + Cbuf_AddText(va("vid_displayfrequency %i\n", 85), RESTRICT_LOCAL); + break; + case 7: + Cbuf_AddText(va("vid_displayfrequency %i\n", 100), RESTRICT_LOCAL); + break; + } + + switch(info->renderer->selectedoption) { #ifdef RGLQUAKE @@ -1157,11 +1206,25 @@ void M_Menu_Video_f (void) NULL }; + static const char *refreshrates[] = + { + "0Hz (OS Driver refresh rate)", + "59Hz (NTSC is 59.94i)", + "60Hz", + "70Hz", + "72Hz", // VESA minimum setting to avoid eye damage on CRT monitors + "75Hz", + "85Hz", + "100Hz", + NULL + }; + videomenuinfo_t *info; menu_t *menu; int prefabmode; int prefab2dmode; int currentbpp; + int currentrefreshrate; #ifdef RGLQUAKE int currenttexturefilter; #endif @@ -1199,6 +1262,25 @@ void M_Menu_Video_f (void) else currentbpp = 0; + if (vid_refreshrate.value >= 100) + currentrefreshrate = 7; + else if (vid_refreshrate.value >= 85) + currentrefreshrate = 6; + else if (vid_refreshrate.value >= 75) + currentrefreshrate = 5; + else if (vid_refreshrate.value >= 72) + currentrefreshrate = 4; + else if (vid_refreshrate.value >= 70) + currentrefreshrate = 3; + else if (vid_refreshrate.value >= 60) + currentrefreshrate = 2; + else if (vid_refreshrate.value >= 59) + currentrefreshrate = 1; + else if (vid_refreshrate.value >= 0) + currentrefreshrate = 0; + else + currentrefreshrate = 0; + #ifdef RGLQUAKE if (!Q_strcasecmp(gl_texturemode.string, "gl_nearest_mipmap_nearest")) currenttexturefilter = 0; @@ -1216,6 +1298,7 @@ void M_Menu_Video_f (void) y = 32; info->renderer = MC_AddCombo(menu, 16, y, " Renderer ", rendererops, i); y+=8; info->bppcombo = MC_AddCombo(menu, 16, y, " Color Depth ", bppnames, currentbpp); y+=8; + info->refreshratecombo = MC_AddCombo(menu, 16, y, " Refresh Rate ", refreshrates, currentrefreshrate); y+=8; info->modecombo = MC_AddCombo(menu, 16, y, " Video Size ", modenames, prefabmode+1); y+=8; info->conscalecombo = MC_AddCombo(menu, 16, y, " 2d Size ", modenames, prefab2dmode+1); y+=8; MC_AddCheckBox(menu, 16, y, " Fullscreen ", &vid_fullscreen,0); y+=8; From 7f0e91037c299084cc65e061a205454524c878cb Mon Sep 17 00:00:00 2001 From: Lance Date: Tue, 29 Dec 2009 14:00:56 +0000 Subject: [PATCH 48/76] Menu code work in progress, menu_video is less cluttered, new menus within menu_options, sound, 3d rendering, texture, shadow & lighting etc git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3486 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_items.c | 2 + engine/client/m_options.c | 640 +++++++++++++++++++++++++++++++++----- engine/client/menu.c | 9 + engine/client/renderer.c | 93 +++--- 4 files changed, 625 insertions(+), 119 deletions(-) diff --git a/engine/client/m_items.c b/engine/client/m_items.c index 062f794dd..9d78b7d07 100644 --- a/engine/client/m_items.c +++ b/engine/client/m_items.c @@ -848,6 +848,8 @@ menucheck_t *MC_AddCheckBox(menu_t *menu, int x, int y, const char *text, cvar_t if (var) if (!(var->flags & CVAR_ARCHIVE)) Con_Printf("Warning: %s is not set for archiving\n", var->name); + else if (var->flags & CVAR_RENDERERLATCH) + Con_Printf("Warning: %s requires a vid_restart\n", var->name); n->common.next = menu->options; menu->options = (menuoption_t *)n; diff --git a/engine/client/m_options.c b/engine/client/m_options.c index ae8156218..fae462964 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -19,7 +19,7 @@ qboolean M_Options_AlwaysRun (menucheck_t *option, struct menu_s *menu, chk_set_ Cvar_SetValue (&cl_forwardspeed, 400); Cvar_SetValue (&cl_backspeed, 400); return true; - } + } } qboolean M_Options_InvertMouse (menucheck_t *option, struct menu_s *menu, chk_set_t set) { @@ -29,7 +29,7 @@ qboolean M_Options_InvertMouse (menucheck_t *option, struct menu_s *menu, chk_se { Cvar_SetValue (&m_pitch, -m_pitch.value); return m_pitch.value < 0; - } + } } //options menu. @@ -68,36 +68,40 @@ void M_Menu_Options_f (void) } menu->selecteditem = (union menuoption_s *) - MC_AddConsoleCommand(menu, 16, y, " Customize controls", "menu_keys\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Go to console", "toggleconsole\nplay misc/menu2.wav\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Reset to defaults", "exec default.cfg\nplay misc/menu2.wav\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Customize controls", "menu_keys\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Go to console", "toggleconsole\nplay misc/menu2.wav\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Reset to defaults", "exec default.cfg\nplay misc/menu2.wav\n"); y+=8; - MC_AddSlider(menu, 16, y, " Mouse Speed", &sensitivity, 1, 10, 0.5); y+=8; - MC_AddSlider(menu, 16, y, " Crosshair", &crosshair, 0, 22, 1); y+=8; + MC_AddSlider(menu, 16, y, " Mouse Speed", &sensitivity, 1, 10, 0.5); y+=8; + MC_AddSlider(menu, 16, y, " Crosshair", &crosshair, 0, 22, 1); y+=8; - MC_AddCheckBox(menu, 16, y, " Always Run", NULL,0)->func = M_Options_AlwaysRun; y+=8; - MC_AddCheckBox(menu, 16, y, " Invert Mouse", NULL,0)->func = M_Options_InvertMouse; y+=8; - MC_AddCheckBox(menu, 16, y, " Lookspring", &lookspring,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Lookstrafe", &lookstrafe,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Use old status bar", &cl_sbar,0); y+=8; - MC_AddCheckBox(menu, 16, y, " HUD on left side", &cl_hudswap,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Old-style chatting", &cl_standardchat,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Old-style messages", &cl_standardmsg,0);y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Imitate FPS", "cl_netfps"); y+=8+4; + MC_AddCheckBox(menu, 16, y, " Always Run", NULL,0)->func = M_Options_AlwaysRun; y+=8; + MC_AddCheckBox(menu, 16, y, " Invert Mouse", NULL,0)->func = M_Options_InvertMouse; y+=8; + MC_AddCheckBox(menu, 16, y, " Lookspring", &lookspring,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Lookstrafe", &lookstrafe,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Use old status bar", &cl_sbar,0); y+=8; + MC_AddCheckBox(menu, 16, y, " HUD on left side", &cl_hudswap,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Old-style chatting", &cl_standardchat,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Old-style messages", &cl_standardmsg,0);y+=8; + y+=4;MC_AddEditCvar(menu, 16, y, " Imitate FPS", "cl_netfps"); y+=8+4; - MC_AddConsoleCommand(menu, 16, y, " Video Options", "menu_video\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " FPS Options", "menu_fps\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Audio Options", "menu_audio\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Downloads", "menu_download\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Video Options", "menu_video\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, "Shadow & Lighting Options", "menu_shadow_lighting\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " 3D Rendering Options", "menu_3d\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Texture Options", "menu_textures\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Particle Options", "menu_particles\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " FPS Options", "menu_fps\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Audio Options", "menu_audio\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Downloads", "menu_download\n"); y+=8; #ifdef _WIN32 - if (!vid_isfullscreen) + if (!vid_isfullscreen) #endif { MC_AddCheckBox(menu, 16, y, " Use Mouse", &_windowed_mouse,0); y+=8; } - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 215, 32, NULL, false); } #ifndef __CYGWIN__ @@ -127,7 +131,7 @@ qboolean M_Audio_Key (int key, struct menu_s *menu) return true; } - + if (key == K_DOWNARROW) { info->testsoundsource->common.posy+=10; @@ -230,7 +234,7 @@ void M_Menu_Audio_f (void) int y = 32; menu_t *menu; int mgt; - extern cvar_t nosound, precache, snd_leftisright, snd_khz, snd_eax, snd_speakers, ambient_level; + extern cvar_t nosound, precache, snd_leftisright, snd_khz, snd_eax, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices, snd_noextraupdate, snd_show, bgmbuffer; static const char *soundqualityoptions[] = { "11025 Hz", @@ -285,19 +289,29 @@ void M_Menu_Audio_f (void) menu->selecteditem = (union menuoption_s *) - MC_AddSlider(menu, 16, y, " CD Music Volume", &bgmvolume, 0, 1, 0.1);y+=8; - MC_AddSlider(menu, 16, y, " Sound Volume", &volume, 0, 1, 0.1);y+=8; - MC_AddSlider(menu, 16, y, " Ambient Volume", &ambient_level, 0, 1, 0.1);y+=8; - MC_AddCheckBox(menu, 16, y, " no sound", &nosound,0);y+=8; - MC_AddCheckBox(menu, 16, y, " precache", &precache,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Low Quality Sound", &loadas8bit,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Flip Sound", &snd_leftisright,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Experimental EAX 2", &snd_eax,0);y+=8; - MC_AddCvarCombo(menu, 16, y, " Speaker setup", &snd_speakers, speakeroptions, speakervalues);y+=8; - MC_AddCvarCombo(menu, 16, y, " Sound speed", &snd_khz, soundqualityoptions, soundqualityvalues);y+=8; - MC_AddConsoleCommand(menu, 16, y, " Restart sound", "snd_restart\n");y+=8; + MC_AddSlider(menu, 16, y, " CD Music Volume", &bgmvolume, 0, 1, 0.1);y+=8; + MC_AddSlider(menu, 16, y, " CD Music Buffer", &bgmbuffer, 0, 10240, 1024);y+=8; + MC_AddSlider(menu, 16, y, " Sound Volume", &volume, 0, 1, 0.1);y+=8; + MC_AddSlider(menu, 16, y, " Player Sound Volume", &snd_playersoundvolume,0,1,0.1);y+=8; + MC_AddSlider(menu, 16, y, " Ambient Volume", &ambient_level, 0, 1, 0.1);y+=8; + MC_AddSlider(menu, 16, y, " Ambient Fade", &ambient_fade, 0, 1000, 1);y+=8; + MC_AddCheckBox(menu, 16, y, " No Sound", &nosound,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Static Sounds", &cl_staticsounds,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Precache", &precache,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Low Quality Sound (8bit)", &loadas8bit,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Flip Sound", &snd_leftisright,0);y+=8; + MC_AddCheckBox(menu, 16, y, "Play Sound While Inactive", &snd_inactive,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Experimental EAX 2", &snd_eax,0);y+=8; + MC_AddCvarCombo(menu, 16, y, " Speaker Setup", &snd_speakers, speakeroptions, speakervalues);y+=8; + MC_AddCvarCombo(menu, 16, y, " Sound Speed", &snd_khz, soundqualityoptions, soundqualityvalues);y+=8; + MC_AddSlider(menu, 16, y, " Sound Mixahead", &_snd_mixahead,0,1,0.05);y+=8; + MC_AddCheckBox(menu, 16, y, " Multiple Devices", &snd_usemultipledevices,0);y+=8; + MC_AddCheckBox(menu, 16, y, " No Extra Sound Update", &snd_noextraupdate,0);y+=8; + //MC_AddCombo(menu, 16, y, " Show Sounds Playing", &snd_show,0);y+=8; + y+=8; + MC_AddConsoleCommand(menu, 16, y, " = Restart Sound =", "snd_restart\n");y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 225, 32, NULL, false); } #else @@ -314,7 +328,7 @@ void M_Menu_Particles_f (void) int y = 32; menu_t *menu; int mgt; - extern cvar_t r_bouncysparks, r_part_rain, gl_part_flame, r_particlesystem; + extern cvar_t r_bouncysparks, r_part_rain, gl_part_flame, r_particlesystem, r_grenadetrail, r_rockettrail, r_part_sparks_textured, r_part_sparks_trifan, r_part_rain_quantity, r_part_beams, r_part_beams_textured, r_particle_tracelimit; char *psystemopts[] = { @@ -352,15 +366,22 @@ void M_Menu_Particles_f (void) menu->selecteditem = (union menuoption_s *) - MC_AddCvarCombo(menu, 16, y, " particle system", &r_particlesystem, psystemopts, psystemvals);y+=8; + MC_AddCvarCombo(menu, 16, y, " particle system", &r_particlesystem, psystemopts, psystemvals);y+=8; //fixme: hide the rest of the options if r_particlesystem==classic - MC_AddConsoleCommand(menu, 16, y, " Choose particle set", "menu_particlesets");y+=8; - MC_AddCheckBox(menu, 16, y, " sparks bounce", &r_bouncysparks,0);y+=8; -// MC_AddSlider(menu, 16, y, " exp spark count", &r_particles_in_explosion, 16, 1024);y+=8; - MC_AddCheckBox(menu, 16, y, " texture emittance", &r_part_rain, 0);y+=8; - MC_AddCheckBox(menu, 16, y, " model emitters", &gl_part_flame, 0);y+=8; - + MC_AddConsoleCommand(menu, 16, y, " Choose particle set", "menu_particlesets");y+=8; +// MC_AddSlider(menu, 16, y, " exp spark count", &r_particles_in_explosion, 16, 1024);y+=8; + MC_AddSlider(menu, 16, y, " Grenade Trail", &r_grenadetrail,0,10,1); y+=8; + MC_AddSlider(menu, 16, y, " Rocket Trail", &r_rockettrail,0,10,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Bouncy Sparks", &r_bouncysparks,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Textured Sparks", &r_part_sparks_textured,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Trifan Sparks", &r_part_sparks_trifan,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Rain", &r_part_rain,0); y+=8; + MC_AddSlider(menu, 16, y, " Rain Quantity", &r_part_rain_quantity,0,10,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Torch Flame", &gl_part_flame,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Particle Beams", &r_part_beams,0); y+=8; + MC_AddCheckBox(menu, 16, y, "Textured Particle Beams", &r_part_beams_textured,0); y+=8; + MC_AddSlider(menu, 16, y, " Particle Tracelimit", &r_particle_tracelimit,0,2000,50); y+=8; menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); } @@ -445,10 +466,8 @@ void M_Menu_FPS_f (void) menu_t *menu; int mgt; int i, len; -#ifdef RGLQUAKE - extern cvar_t gl_compress, gl_detail, gl_bump, r_flashblend, r_shadow_realtime_world, gl_motionblur; -#endif - extern cvar_t r_stains, r_bloodstains, r_loadlits, r_dynamic, v_contentblend, show_fps; + + extern cvar_t v_contentblend, show_fps, cl_r2g, cl_gibfilter, cl_expsprite, cl_deadbodyfilter; key_dest = key_menu; m_state = m_complex; @@ -473,41 +492,506 @@ void M_Menu_FPS_f (void) menu->selecteditem = (union menuoption_s *) - MC_AddConsoleCommand(menu, 48, y, " Particle Options", "menu_particles\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Particle Options", "menu_particles\n"); y+=8; for (i = 0; i < PRESET_MAX; i++) { len = strlen(preset[0].value[i]); - MC_AddConsoleCommand(menu, 48+8*(9-len), y, va("(preset) %s", preset[0].value[i]), va("fps_preset %s\n", preset[0].value[i])); y+=8; + MC_AddConsoleCommand(menu, 115+8*(9-len), y, va("(preset) %s", preset[0].value[i]), va("fps_preset %s\n", preset[0].value[i])); y+=8; } - MC_AddCheckBox(menu, 48, y, " Show FPS", &show_fps,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Show FPS", &show_fps,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Content blend", &v_contentblend,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Dynamic lights", &r_dynamic,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Stainmaps", &r_stains,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Content blend", &v_contentblend,0);y+=8; + MC_AddCheckBox(menu, 16, y, "Convert Rockets to Grenades", &cl_r2g,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Gib Filter", &cl_gibfilter,0); y+=8; + MC_AddSlider(menu, 16, y, " Dead Body Filter", &cl_deadbodyfilter,0,2,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Explosion Sprite", &cl_expsprite,0); y+=8; + y+=4;MC_AddEditCvar(menu, 16, y, " Skybox", "r_skybox");y+=8;y+=4; - y+=4;MC_AddEditCvar(menu, 48, y, " Skybox", "r_skybox");y+=8;y+=4; - - switch(qrenderer) - { -#ifdef RGLQUAKE - case QR_OPENGL: - MC_AddCheckBox(menu, 48, y, " Blood stains", &r_bloodstains,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Load .lit files", &r_loadlits,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Flashblending", &r_flashblend,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Detail Texturing", &gl_detail,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Bumpmaps", &gl_bump,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Tex Compression", &gl_compress,0);y+=8; - MC_AddCheckBox(menu, 48, y, " 32 bit textures", &gl_load24bit,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Dynamic shadows", &r_shadows,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Realtime Lights", &r_shadow_realtime_world,0);y+=8; - MC_AddCheckBox(menu, 48, y, " Waterwarp", &r_waterwarp,0);y+=8; - MC_AddSlider(menu, 48, y, " Motion blur", &gl_motionblur, 0, 0.99, 0);y+=8; - break; -#endif - default: - break; - } - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 250, 32, NULL, false); } + +//copy and pasted from renderer.c +qboolean M_VideoApply2 (union menuoption_s *op,struct menu_s *menu,int key) +{ + if (key != K_ENTER) + return false; + + // r_shadows too + + + Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); + + M_RemoveMenu(menu); + Cbuf_AddText("menu_options\n", RESTRICT_LOCAL); + return true; +} + +typedef struct { + menucombo_t *multisamplingcombo; +} threeDmenuinfo_t; + +qboolean M_VideoApply3D (union menuoption_s *op,struct menu_s *menu,int key) +{ + threeDmenuinfo_t *info = menu->data; + + if (key != K_ENTER) + return false; + + /*switch(info->multisamplingcombo->selectedoption) + { + case 0: + Cbuf_AddText("vid_multisample 0\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("vid_multisample 2\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("vid_multisample 4\n", RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText("vid_multisample 6\n", RESTRICT_LOCAL); + break; + case 4: + Cbuf_AddText("vid_multisample 8\n", RESTRICT_LOCAL); + break; + }*/ + + Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); + + M_RemoveMenu(menu); + Cbuf_AddText("menu_3d\n", RESTRICT_LOCAL); + return true; +} + +void M_Menu_3D_f (void) +{ + static const char *msaalevels[] = + { + "Off", + "2x", + "4x", + "6x", + "8x", + NULL + }; + + + int y = 32; + threeDmenuinfo_t *info; + menu_t *menu; + int mgt; + int i, len; + int currentmsaalevel; +#ifdef RGLQUAKE +#endif + extern cvar_t r_novis, gl_dither, cl_item_bobbing, r_waterwarp, r_nolerp, r_fastsky, gl_shadeq1, gl_shadeq3, gl_nocolors, gl_lerpimages, gl_keeptjunctions, gl_lateswap, r_mirroralpha, r_wateralpha, r_drawviewmodel, r_xflip, gl_maxdist, gl_motionblur, gl_motionblurscale, gl_blend2d, gl_blendsprites, r_flashblend, gl_cshiftenabled; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(sizeof(threeDmenuinfo_t)); + info = menu->data; + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + /*if (vid_multisample.value == 8) + currentmsaalevel = 4; + else if (vid_multisample.value == 6) + currentmsaalevel = 3; + else if (vid_multisample.value == 4) + currentmsaalevel = 2; + else if (vid_multisample.value == 2) + currentmsaalevel = 1; + else if (vid_multisample.value <= 1) + currentmsaalevel = 0; + else + currentmsaalevel = 0;*/ + + menu->selecteditem = (union menuoption_s *) + + //info->multisamplingcombo = MC_AddCombo(menu, 16, y, " Multisample Anti-Aliasing", msaalevels, currentmsaalevel); y+=8; + MC_AddCheckBox(menu, 16, y, " Calculate VIS", &r_novis,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Water Warp", &r_waterwarp,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Model Interpollation", &r_nolerp,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Toggle Sky", &r_fastsky,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Q1 Shaders", &gl_shadeq1,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Q3 Shaders", &gl_shadeq3,0); y+=8; + MC_AddCheckBox(menu, 16, y, "Ignore Player Model Colors", &gl_nocolors,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Lerp Images", &gl_lerpimages,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Toggle Colinear Vertexes", &gl_keeptjunctions,0); y+=8; + MC_AddCheckBox(menu, 16, y, " GL Swapbuffer Delay", &gl_lateswap,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Mirror Reflections", &r_mirroralpha,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Water Transparency", &r_wateralpha,0); y+=8; + MC_AddSlider(menu, 16, y, " View Model Transparency", &r_drawviewmodel,0,1,0.1); y+=8; + MC_AddCheckBox(menu, 16, y, " Flip Horizontal View", &r_xflip,0); y+=8; + MC_AddSlider(menu, 16, y, " Maximum Distance", &gl_maxdist,1,8192,128); y+=8; + MC_AddSlider(menu, 16, y, " Motion Blur", &gl_motionblur,0,1,0.5); y+=8; + MC_AddSlider(menu, 16, y, " Motion Blur Scale", &gl_motionblurscale,0,1,0.5); y+=8; + MC_AddCheckBox(menu, 16, y, " 2D Blending", &gl_blend2d,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Sprite Blending", &gl_blendsprites,0); y+=8; + MC_AddSlider(menu, 16, y, " Flash Blending", &r_flashblend,0,2,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Poly Blending", &gl_cshiftenabled,0); y+=8; + MC_AddCheckBox(menu, 16, y, " 16bit Color Dithering", &gl_dither,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Model Bobbing", &cl_item_bobbing,0); y+=8; + y+=8; + MC_AddCommand(menu, 16, y, " Apply", M_VideoApply3D); y+=8; + + //menu->selecteditem = (union menuoption_s *)info->multisamplingcombo; + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 225, 32, NULL, false); +} + +typedef struct { + menucombo_t *texturefiltercombo; + menucombo_t *anisotropycombo; + menucombo_t *maxtexturesizecombo; +} texturemenuinfo_t; + +qboolean M_VideoApplyTextures (union menuoption_s *op,struct menu_s *menu,int key) +{ + texturemenuinfo_t *info = menu->data; + + if (key != K_ENTER) + return false; + + switch(info->texturefiltercombo->selectedoption) + { + case 0: + Cbuf_AddText("gl_texturemode gl_nearest_mipmap_nearest\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("gl_texturemode gl_linear_mipmap_nearest\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("gl_texturemode gl_linear_mipmap_linear\n", RESTRICT_LOCAL); + break; + } + + switch(info->anisotropycombo->selectedoption) + { + case 0: + Cbuf_AddText("gl_texture_anisotropic_filtering 0\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("gl_texture_anisotropic_filtering 2\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("gl_texture_anisotropic_filtering 4\n", RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText("gl_texture_anisotropic_filtering 8\n", RESTRICT_LOCAL); + break; + case 4: + Cbuf_AddText("gl_texture_anisotropic_filtering 16\n", RESTRICT_LOCAL); + break; + } + + switch(info->maxtexturesizecombo->selectedoption) + { + case 0: + Cbuf_AddText("gl_max_size 1\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("gl_max_size 2\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("gl_max_size 4\n", RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText("gl_max_size 8\n", RESTRICT_LOCAL); + break; + case 4: + Cbuf_AddText("gl_max_size 16\n", RESTRICT_LOCAL); + break; + case 5: + Cbuf_AddText("gl_max_size 32\n", RESTRICT_LOCAL); + break; + case 6: + Cbuf_AddText("gl_max_size 64\n", RESTRICT_LOCAL); + break; + case 7: + Cbuf_AddText("gl_max_size 128\n", RESTRICT_LOCAL); + break; + case 8: + Cbuf_AddText("gl_max_size 256\n", RESTRICT_LOCAL); + break; + case 9: + Cbuf_AddText("gl_max_size 512\n", RESTRICT_LOCAL); + break; + case 10: + Cbuf_AddText("gl_max_size 1024\n", RESTRICT_LOCAL); + break; + case 11: + Cbuf_AddText("gl_max_size 2048\n", RESTRICT_LOCAL); + break; + case 12: + Cbuf_AddText("gl_max_size 4096\n", RESTRICT_LOCAL); + break; + case 13: + Cbuf_AddText("gl_max_size 8192\n", RESTRICT_LOCAL); + break; + } + + Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); + + M_RemoveMenu(menu); + Cbuf_AddText("menu_textures\n", RESTRICT_LOCAL); + return true; +} + +void M_Menu_Textures_f (void) +{ + static const char *texturefilternames[] = + { + "Nearest", + "Bilinear", + "Trilinear", + NULL + }; + + static const char *anisotropylevels[] = + { + "Off", + "2x", + "4x", + "8x", + "16x", + NULL + }; + + static const char *texturesizeoptions[] = + { + "1x1", + "2x2", + "4x4", + "8x8", + "16x16", + "32x32", + "64x64", + "128x128", + "256x256", + "512x512", + "1024x1024", + "2048x2048", + "4096x4096", + "8192x8192", + NULL + }; + + int y = 32; + texturemenuinfo_t *info; + menu_t *menu; + int mgt; + int i, len; + int currenttexturefilter; + int currentanisotropylevel; + int currentmaxtexturesize; + extern cvar_t r_bloom, gl_load24bit, gl_specular, gl_fontinwardstep, gl_smoothfont, r_waterlayers, gl_bump, gl_detail, gl_detailscale, gl_compress, gl_savecompressedtex, gl_ztrick, gl_triplebuffer, gl_picmip, gl_picmip2d, gl_playermip, gl_max_size, r_stains, r_bloodstains, r_stainfadetime, r_stainfadeammount, gl_skyboxdist, r_drawflat, gl_schematics, gl_texturemode, gl_texture_anisotropic_filtering; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(sizeof(texturemenuinfo_t)); + info = menu->data; + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + if (!Q_strcasecmp(gl_texturemode.string, "gl_nearest_mipmap_nearest")) + currenttexturefilter = 0; + else if (!Q_strcasecmp(gl_texturemode.string, "gl_linear_mipmap_linear")) + currenttexturefilter = 2; + else if (!Q_strcasecmp(gl_texturemode.string, "gl_linear_mipmap_nearest")) + currenttexturefilter = 1; + else + currenttexturefilter = 1; + + if (gl_texture_anisotropic_filtering.value == 16) + currentanisotropylevel = 4; + else if (gl_texture_anisotropic_filtering.value == 8) + currentanisotropylevel = 3; + else if (gl_texture_anisotropic_filtering.value == 4) + currentanisotropylevel = 2; + else if (gl_texture_anisotropic_filtering.value == 2) + currentanisotropylevel = 1; + else if (gl_texture_anisotropic_filtering.value <= 1) + currentanisotropylevel = 0; + else + currentanisotropylevel = 0; + + if (gl_max_size.value == 8192) + currentmaxtexturesize = 13; + else if (gl_max_size.value == 4096) + currentmaxtexturesize = 12; + else if (gl_max_size.value == 2048) + currentmaxtexturesize = 11; + else if (gl_max_size.value == 1024) + currentmaxtexturesize = 10; + else if (gl_max_size.value == 512) + currentmaxtexturesize = 9; + else if (gl_max_size.value == 256) + currentmaxtexturesize = 8; + else if (gl_max_size.value == 128) + currentmaxtexturesize = 7; + else if (gl_max_size.value == 64) + currentmaxtexturesize = 6; + else if (gl_max_size.value == 32) + currentmaxtexturesize = 5; + else if (gl_max_size.value == 16) + currentmaxtexturesize = 4; + else if (gl_max_size.value == 8) + currentmaxtexturesize = 3; + else if (gl_max_size.value == 4) + currentmaxtexturesize = 2; + else if (gl_max_size.value == 2) + currentmaxtexturesize = 1; + else if (gl_max_size.value <= 1) + currentmaxtexturesize = 0; + else + currentmaxtexturesize = 0; + + + info->texturefiltercombo = MC_AddCombo(menu, 16, y, " Texture Filter", texturefilternames, currenttexturefilter); y+=8; + info->anisotropycombo = MC_AddCombo(menu, 16, y, " Anisotropy Level", anisotropylevels, currentanisotropylevel); y+=8; + MC_AddCheckBox(menu, 16, y, " 32bit Textures", &gl_load24bit,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Bloom", &r_bloom,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Bumpmapping", &gl_bump,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Specular Highlights", &gl_specular,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Texture Detail", &gl_detail,0); y+=8; + MC_AddSlider(menu, 16, y, " Texture Detail Scale", &gl_detailscale,0,10,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Texture Compression", &gl_compress,0); y+=8; + MC_AddCheckBox(menu, 16, y, "Save Compressed Textures", &gl_savecompressedtex,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Z Trick", &gl_ztrick,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Triple Buffering", &gl_triplebuffer,0); y+=8; + MC_AddSlider(menu, 16, y, " 3D Texture Picmip", &gl_picmip,0,16,1); y+=8; + MC_AddSlider(menu, 16, y, " 2D Texture Picmip", &gl_picmip2d,0,16,1); y+=8; + MC_AddSlider(menu, 16, y, " Model Texture Picmip", &gl_playermip,0,16,1); y+=8; + info->maxtexturesizecombo = MC_AddCombo(menu,16, y, " Maximum Texture Size", texturesizeoptions, currentmaxtexturesize); y+=8; + MC_AddCheckBox(menu, 16, y, " Stain Maps", &r_stains,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Blood Stains", &r_bloodstains,0); y+=8; + MC_AddSlider(menu, 16, y, " Stain Fade Time (secs)", &r_stainfadetime,0,30,0.5); y+=8; + MC_AddSlider(menu, 16, y, " Stain Fade Ammount", &r_stainfadeammount,0,30,1); y+=8; + MC_AddSlider(menu, 16, y, " Skybox Distance", &gl_skyboxdist,0,10000,100); y+=8; + MC_AddSlider(menu, 16, y, " Draw Flat Surfaces", &r_drawflat,0,2,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Map Schematics", &gl_schematics,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Font Edge Clamp", &gl_fontinwardstep,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Smooth Font", &gl_smoothfont,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Smooth Models", &gl_smoothmodels,0); y+=8; + MC_AddSlider(menu, 16, y, " Water Layers", &r_waterlayers,0,10,1); y+=8; + y+=8; + MC_AddCommand(menu, 16, y, " Apply", M_VideoApplyTextures); y+=8; + + menu->selecteditem = (union menuoption_s *)info->texturefiltercombo; + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 220, 32, NULL, false); +} + +typedef struct { +} shadowlightingmenuinfo_t; + +qboolean M_VideoApplyShadowLighting (union menuoption_s *op,struct menu_s *menu,int key) +{ + shadowlightingmenuinfo_t *info = menu->data; + + if (key != K_ENTER) + return false; + + Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); + + M_RemoveMenu(menu); + Cbuf_AddText("menu_shadow_lighting\n", RESTRICT_LOCAL); + return true; +} + +void M_Menu_Shadow_Lighting_f (void) +{ + int y = 32; + menu_t *menu; + int mgt; + int i, len; +#ifdef RGLQUAKE +#endif + extern cvar_t r_noaliasshadows, r_shadows, r_shadow_realtime_world, r_loadlits, gl_maxshadowlights, r_lightmap_saturation, r_dynamic, r_vertexlight, r_vertexdlights, r_lightstylesmooth, r_lightstylespeed, r_nolightdir, r_shadow_realtime_world_lightmaps, r_shadow_glsl_offsetmapping, r_shadow_glsl_offsetmapping_bias, r_shadow_glsl_offsetmapping_scale, r_shadow_bumpscale_basetexture, r_shadow_bumpscale_bumpmap, r_fb_bmodels, r_fb_models, gl_overbright, r_rocketlight, r_powerupglow, v_powerupshell, r_lightflicker, r_explosionlight; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(0); + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + menu->selecteditem = (union menuoption_s *) + + + MC_AddCheckBox(menu, 16, y, " Alias Model Shadows", &r_noaliasshadows,0); y+=8; + MC_AddSlider(menu, 16, y, " Shadows", &r_shadows,0,2,1); y+=8; + MC_AddCheckBox(menu, 16, y, "Realtime World Shadows & Lighting", &r_shadow_realtime_world,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Realtime World Lightmaps", &r_shadow_realtime_world_lightmaps,0); y+=8; + MC_AddCheckBox(menu, 16, y, " GLSL Shadow Offsetmapping", &r_shadow_glsl_offsetmapping,0); y+=8; + MC_AddSlider(menu, 16, y, " GLSL Shadow Offsetmapping Bias", &r_shadow_glsl_offsetmapping_bias,0,1,0.01); y+=8; + MC_AddSlider(menu, 16, y, " GLSL Shadow Offsetmapping Scale", &r_shadow_glsl_offsetmapping_scale,0,-1,0.01); y+=8; + MC_AddSlider(menu, 16, y, " Shadow Bumpscale Basetexture", &r_shadow_bumpscale_basetexture,0,10,1); y+=8; + MC_AddSlider(menu, 16, y, " Shadow Bumpscale Bumpmap", &r_shadow_bumpscale_bumpmap,0,50,1); y+=8; + MC_AddSlider(menu, 16, y, " LIT Loading", &r_loadlits,0,2,1); y+=8; + MC_AddSlider(menu, 16, y, " Maximum Shadow Lights", &gl_maxshadowlights,0,1000,2); y+=8; + //MC_AddSlider(menu, 16, y, " Light Map Mode", &gl_lightmapmode,0,2,1); y+=8; + MC_AddSlider(menu, 16, y, " Light Map Saturation", &r_lightmap_saturation,0,1,0.1); y+=8; + MC_AddCheckBox(menu, 16, y, " Dynamic Lighting", &r_dynamic,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Vertex Lighting", &r_vertexlight,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Dynamic Vertex Lights", &r_vertexdlights,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Lightstyle Smoothing", &r_lightstylesmooth,0); y+=8; + MC_AddSlider(menu, 16, y, " Lightstyle Animation Speed", &r_lightstylespeed,0,50,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Surface Direction Model Lighting", &r_nolightdir,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Fullbright BSP Models", &r_fb_bmodels,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Fullbright Alias Models", &r_fb_models,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Overbright Bits", &gl_overbright,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Rocket Dynamic Lighting", &r_rocketlight,0); y+=8; + MC_AddSlider(menu, 16, y, " Powerup Glow", &r_powerupglow,0,2,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Powerup Shell", &v_powerupshell,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Light Flickering", &r_lightflicker,0); y+=8; + MC_AddSlider(menu, 16, y, " Explosion Light", &r_explosionlight,0,1,0.1); y+=8; + y+=8; + MC_AddCommand(menu, 16, y, " Apply", M_VideoApplyShadowLighting); y+=8; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 285, 32, NULL, false); +} \ No newline at end of file diff --git a/engine/client/menu.c b/engine/client/menu.c index a549f4f3a..eebebd105 100644 --- a/engine/client/menu.c +++ b/engine/client/menu.c @@ -886,6 +886,9 @@ void M_QuickConnect_f(void); void M_Menu_MediaFiles_f (void); void M_Menu_FPS_f (void); +void M_Menu_Shadow_Lighting_f (void); +void M_Menu_3D_f (void); +void M_Menu_Textures_f (void); void M_Menu_Particles_f (void); void M_Menu_ParticleSets_f (void); void M_Menu_Audio_Speakers_f (void); @@ -934,6 +937,9 @@ void M_Init_Internal (void) Cmd_AddRemCommand ("menu_speakers", M_Menu_Audio_Speakers_f); #endif Cmd_AddRemCommand ("menu_fps", M_Menu_FPS_f); + Cmd_AddRemCommand ("menu_3d" , M_Menu_3D_f); + Cmd_AddRemCommand ("menu_shadow_lighting", M_Menu_Shadow_Lighting_f); + Cmd_AddRemCommand ("menu_textures", M_Menu_Textures_f); Cmd_AddRemCommand ("menu_particles", M_Menu_Particles_f); Cmd_AddRemCommand ("menu_particlesets", M_Menu_ParticleSets_f); @@ -981,6 +987,9 @@ void M_DeInit_Internal (void) Cmd_RemoveCommand ("menu_audio"); Cmd_RemoveCommand ("menu_speakers"); Cmd_RemoveCommand ("menu_fps"); + Cmd_RemoveCommand ("menu_3d"); + Cmd_RemoveCommand ("menu_shadow_lighting"); + Cmd_RemoveCommand ("menu_textures"); Cmd_RemoveCommand ("menu_particles"); Cmd_RemoveCommand ("menu_particlesets"); diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 6ab6b435a..013996ead 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -1041,7 +1041,7 @@ typedef struct { menucombo_t *conscalecombo; menucombo_t *bppcombo; menucombo_t *refreshratecombo; - menucombo_t *texturefiltercombo; + menucombo_t *vsynccombo; menuedit_t *customwidth; menuedit_t *customheight; } videomenuinfo_t; @@ -1113,19 +1113,20 @@ qboolean M_VideoApply (union menuoption_s *op,struct menu_s *menu,int key) break; } - switch(info->texturefiltercombo->selectedoption) + switch(info->vsynccombo->selectedoption) { case 0: - Cbuf_AddText("gl_texturemode gl_nearest_mipmap_nearest\n", RESTRICT_LOCAL); + Cbuf_AddText(va("vid_wait %i\n", 0), RESTRICT_LOCAL); break; case 1: - Cbuf_AddText("gl_texturemode gl_linear_mipmap_nearest\n", RESTRICT_LOCAL); + Cbuf_AddText(va("vid_wait %i\n", 1), RESTRICT_LOCAL); break; case 2: - Cbuf_AddText("gl_texturemode gl_linear_mipmap_linear\n", RESTRICT_LOCAL); + Cbuf_AddText(va("vid_wait %i\n", 2), RESTRICT_LOCAL); break; } + Cbuf_AddText(va("vid_bpp %i\n", selectedbpp), RESTRICT_LOCAL); switch(info->refreshratecombo->selectedoption) @@ -1176,11 +1177,9 @@ qboolean M_VideoApply (union menuoption_s *op,struct menu_s *menu,int key) } void M_Menu_Video_f (void) { - extern cvar_t r_stains, v_contrast; + extern cvar_t v_contrast; #if defined(RGLQUAKE) - extern cvar_t r_bloom; #endif - extern cvar_t r_bouncysparks; static const char *modenames[128] = {"Custom"}; static const char *rendererops[] = { #ifdef RGLQUAKE @@ -1219,15 +1218,25 @@ void M_Menu_Video_f (void) NULL }; + static const char *vsyncoptions[] = + { + "Off", + "Wait for Vertical Sync", + "Wait for Display Enable", + NULL + }; + videomenuinfo_t *info; menu_t *menu; int prefabmode; int prefab2dmode; int currentbpp; int currentrefreshrate; -#ifdef RGLQUAKE - int currenttexturefilter; -#endif + int currentvsync; + int aspectratio; + char *aspectratio2; + + extern cvar_t _vid_wait_override; int i, y; prefabmode = -1; @@ -1281,47 +1290,49 @@ void M_Menu_Video_f (void) else currentrefreshrate = 0; -#ifdef RGLQUAKE - if (!Q_strcasecmp(gl_texturemode.string, "gl_nearest_mipmap_nearest")) - currenttexturefilter = 0; - else if (!Q_strcasecmp(gl_texturemode.string, "gl_linear_mipmap_linear")) - currenttexturefilter = 2; - else if (!Q_strcasecmp(gl_texturemode.string, "gl_linear_mipmap_nearest")) - currenttexturefilter = 1; - else - currenttexturefilter = 1; -#endif + aspectratio = (vid_width.value / vid_height.value * 100); // times by 100 so don't have to deal with floats + if (aspectratio == 125) // 1.25 + aspectratio2 = "5:4"; + else if (aspectratio == 160) // 1.6 + aspectratio2 = "16:10"; + else if (aspectratio == 133) // 1.333333 + aspectratio2 = "4:3"; + else if (aspectratio == 177) // 1.777778 + aspectratio2 = "16:9"; + else + aspectratio2 = "Unknown Ratio"; + + currentvsync = _vid_wait_override.value; MC_AddCenterPicture(menu, 4, "vidmodes"); y = 32; - info->renderer = MC_AddCombo(menu, 16, y, " Renderer ", rendererops, i); y+=8; - info->bppcombo = MC_AddCombo(menu, 16, y, " Color Depth ", bppnames, currentbpp); y+=8; - info->refreshratecombo = MC_AddCombo(menu, 16, y, " Refresh Rate ", refreshrates, currentrefreshrate); y+=8; - info->modecombo = MC_AddCombo(menu, 16, y, " Video Size ", modenames, prefabmode+1); y+=8; - info->conscalecombo = MC_AddCombo(menu, 16, y, " 2d Size ", modenames, prefab2dmode+1); y+=8; - MC_AddCheckBox(menu, 16, y, " Fullscreen ", &vid_fullscreen,0); y+=8; - y+=4;info->customwidth = MC_AddEdit(menu, 16, y, " Custom width ", vid_width.string); y+=8; + info->renderer = MC_AddCombo(menu, 16, y, " Renderer", rendererops, i); y+=8; + info->bppcombo = MC_AddCombo(menu, 16, y, " Color Depth", bppnames, currentbpp); y+=8; + info->refreshratecombo = MC_AddCombo(menu, 16, y, " Refresh Rate", refreshrates, currentrefreshrate); y+=8; + info->modecombo = MC_AddCombo(menu, 16, y, " Video Size", modenames, prefabmode+1); y+=8; + MC_AddWhiteText(menu, 16, y, " Current A/R", false); + MC_AddWhiteText(menu, 160, y, aspectratio2, false); y+=8; + info->conscalecombo = MC_AddCombo(menu, 16, y, " 2D Size", modenames, prefab2dmode+1); y+=8; + MC_AddCheckBox(menu, 16, y, " Fullscreen", &vid_fullscreen,0); y+=8; + y+=4;info->customwidth = MC_AddEdit(menu, 16, y, " Custom width", vid_width.string); y+=8; y+=4;info->customheight = MC_AddEdit(menu, 16, y, " Custom height", vid_height.string); y+=12; + info->vsynccombo = MC_AddCombo(menu, 16, y, " VSync", vsyncoptions, currentvsync); y+=8; + //MC_AddCheckBox(menu, 16, y, " Override VSync", &_vid_wait_override,0); y+=8; y+=8; MC_AddCommand(menu, 16, y, " Apply", M_VideoApply); y+=8; y+=8; - MC_AddCheckBox(menu, 16, y, " Stain maps", &r_stains,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Bouncy sparks", &r_bouncysparks,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Rain", &r_part_rain,0); y+=8; -#ifdef RGLQUAKE - MC_AddCheckBox(menu, 16, y, " GL Bumpmapping", &gl_bump,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Bloom", &r_bloom,0); y+=8; -#endif - MC_AddCheckBox(menu, 16, y, " Dynamic lights", &r_dynamic,0); y+=8; - MC_AddSlider(menu, 16, y, " Screen size", &scr_viewsize, 30, 120, 0.1);y+=8; + MC_AddSlider(menu, 16, y, " Screen size", &scr_viewsize, 30, 120, 1);y+=8; MC_AddSlider(menu, 16, y, " Gamma", &v_gamma, 0.3, 1, 0.05); y+=8; + MC_AddCheckBox(menu, 16, y, " Desktop Gamma", &vid_desktopgamma,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Hardware Gamma", &vid_hardwaregamma,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Preserve Gamma", &vid_preservegamma,0); y+=8; MC_AddSlider(menu, 16, y, " Contrast", &v_contrast, 1, 3, 0.05); y+=8; -#ifdef RGLQUAKE - info->texturefiltercombo = MC_AddCombo(menu, 16, y, " Texture Filter ", texturefilternames, currenttexturefilter); y+=8; - MC_AddSlider(menu, 16, y, "Anisotropy Level", &gl_texture_anisotropic_filtering, 1, 16, 1); y+=8; //urm, this shouldn't really be a slider, but should be a combo instead -#endif + y+=8; + MC_AddCheckBox(menu, 16, y, " Stretching", &vid_stretch,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Allow ModeX", &vid_allow_modex,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Windowed Mouse", &_windowed_mouse,0); y+=8; menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 152, 32, NULL, false); menu->selecteditem = (union menuoption_s *)info->renderer; From 22df64de9159b9fdfd016caf9c7dbd0acd14ff7b Mon Sep 17 00:00:00 2001 From: Lance Date: Wed, 30 Dec 2009 04:06:14 +0000 Subject: [PATCH 49/76] Gasp, teamplay menus, and fixups to other menus I added last commit git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3487 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_options.c | 306 +++++++++++++++++++++++++++++++++++++- engine/client/menu.c | 12 ++ engine/client/renderer.c | 2 +- 3 files changed, 311 insertions(+), 9 deletions(-) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index fae462964..c052f63cb 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -91,6 +91,7 @@ void M_Menu_Options_f (void) MC_AddConsoleCommand(menu, 16, y, " Texture Options", "menu_textures\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Particle Options", "menu_particles\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " FPS Options", "menu_fps\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Teamplay Options", "menu_teamplay\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Audio Options", "menu_audio\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Downloads", "menu_download\n"); y+=8; @@ -497,16 +498,16 @@ void M_Menu_FPS_f (void) for (i = 0; i < PRESET_MAX; i++) { len = strlen(preset[0].value[i]); - MC_AddConsoleCommand(menu, 115+8*(9-len), y, va("(preset) %s", preset[0].value[i]), va("fps_preset %s\n", preset[0].value[i])); y+=8; + MC_AddConsoleCommand(menu, 100+8*(9-len), y, va("(preset) %s", preset[0].value[i]), va("fps_preset %s\n", preset[0].value[i])); y+=8; } - MC_AddCheckBox(menu, 16, y, " Show FPS", &show_fps,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Show FPS", &show_fps,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Content blend", &v_contentblend,0);y+=8; - MC_AddCheckBox(menu, 16, y, "Convert Rockets to Grenades", &cl_r2g,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Gib Filter", &cl_gibfilter,0); y+=8; - MC_AddSlider(menu, 16, y, " Dead Body Filter", &cl_deadbodyfilter,0,2,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Explosion Sprite", &cl_expsprite,0); y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Skybox", "r_skybox");y+=8;y+=4; + MC_AddCheckBox(menu, 16, y, " Content blend", &v_contentblend,0);y+=8; + MC_AddCheckBox(menu, 16, y, "Rockets to Grenades", &cl_r2g,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Gib Filter", &cl_gibfilter,0); y+=8; + MC_AddSlider(menu, 16, y, " Dead Body Filter", &cl_deadbodyfilter,0,2,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Explosion Sprite", &cl_expsprite,0); y+=8; + y+=4;MC_AddEditCvar(menu, 16, y, " Skybox", "r_skybox");y+=8;y+=4; menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 250, 32, NULL, false); } @@ -994,4 +995,293 @@ void M_Menu_Shadow_Lighting_f (void) MC_AddCommand(menu, 16, y, " Apply", M_VideoApplyShadowLighting); y+=8; menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 285, 32, NULL, false); +} + +typedef struct { +menucombo_t *noskinscombo; +} teamplaymenuinfo_t; + +qboolean M_Apply_Teamplay (union menuoption_s *op,struct menu_s *menu,int key) +{ + teamplaymenuinfo_t *info = menu->data; + + if (key != K_ENTER) + return false; + + switch(info->noskinscombo->selectedoption) + { + case 0: + Cbuf_AddText("noskins 0\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("noskins 1\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("noskins 2\n", RESTRICT_LOCAL); + break; + } + + M_RemoveMenu(menu); + Cbuf_AddText("menu_teamplay\n", RESTRICT_LOCAL); + return true; +} + +void M_Menu_Teamplay_f (void) +{ + static const char *noskinsoptions[] = + { + "Enable Skins (Do Download New Skins)", + "Disable Skins", + "Enable Skins (Don't Download New Skins)", + NULL + }; + + int y = 32; + teamplaymenuinfo_t *info; + menu_t *menu; + int mgt; + int i, len; + int currentnoskins; + extern cvar_t cl_parseSay, cl_triggers, tp_forceTriggers, tp_loadlocs, cl_parseFunChars, cl_noblink, noskins; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(sizeof(teamplaymenuinfo_t)); + info = menu->data; + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + currentnoskins = noskins.value; + + info->noskinscombo = MC_AddCombo(menu, 16, y, " Skins", noskinsoptions, currentnoskins); y+=8; + y+=4;MC_AddEditCvar(menu, 16, y, " Enemy Skin", "cl_enemyskin"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Team Skin", "cl_teamskin"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Base Skin", "baseskin"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Fake Name", "cl_fakename"); y+=8+4; + MC_AddCheckBox(menu, 16, y, " Parse Fun Chars", &cl_parseFunChars,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Parse Macros", &cl_parseSay,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Teamplay Triggers", &cl_triggers,0); y+=8; + MC_AddCheckBox(menu, 16, y, "Force Teamplay Triggers", &tp_forceTriggers,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Load Locs", &tp_loadlocs,0); y+=8; + MC_AddCheckBox(menu, 16, y, " No Blink", &cl_noblink,0); y+=8; + y+=4;MC_AddEditCvar(menu, 16, y, " Sound Trigger", "tp_soundtrigger"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Fake Name", "cl_fakename"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Weapon Order", "tp_weapon_order"); y+=8+4; + + MC_AddCommand(menu, 16, y, " Apply", M_Apply_Teamplay); y+=8; + + y+=8; + MC_AddConsoleCommand(menu, 16, y, "Teamplay Location Names", "menu_teamplay_locations\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Teamplay Item Needs", "menu_teamplay_needs\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Teamplay Item Names", "menu_teamplay_items\n"); y+=8; + + menu->selecteditem = (union menuoption_s *)info->noskinscombo; + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); +} + +void M_Menu_Teamplay_Locations_f (void) +{ + int y = 32; + menu_t *menu; + int mgt; + int i, len; + extern cvar_t ; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(0); + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + //menu->selecteditem = (union menuoption_s *) + + MC_AddWhiteText(menu, 16, y, "Teamplay Location Names", false); y+=8; + + y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor ", "loc_name_ga"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, "Grenade Launcher", "loc_name_gl"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Lightning Gun", "loc_name_lg"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Nailgun", "loc_name_ng"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Pentagram", "loc_name_pent"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Quad", "loc_name_quad"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "loc_name_ra"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Ring", "loc_name_ring"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rocket Launcher", "loc_name_rl"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Seperator", "loc_name_seperator"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Super Nailgun", "loc_name_sng"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Super Shotgun", "loc_name_ssg"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Suit", "loc_name_suit"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "loc_name_ya"); y+=8+4; + + y+=8; + MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); +} + +void M_Menu_Teamplay_Needs_f (void) +{ + int y = 32; + menu_t *menu; + int mgt; + int i, len; + extern cvar_t ; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(0); + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + //menu->selecteditem = (union menuoption_s *) + + MC_AddWhiteText(menu, 16, y, "Teamplay Needed Items", false); y+=8; + + y+=4;MC_AddEditCvar(menu, 16, y, " Cells", "tp_need_cells"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor", "tp_need_ga"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Health", "tp_need_health"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Nails", "tp_need_nails"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "tp_need_ra"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, "Rocket Launcher", "tp_need_rl"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rockets", "tp_need_rockets"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Shells", "tp_need_shells"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Weapon", "tp_need_weapon"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "tp_need_ya"); y+=8+4; + + y+=8; + MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); +} + +void M_Menu_Teamplay_Items_f (void) +{ + int y = 32; + menu_t *menu; + int mgt; + int i, len; + extern cvar_t ; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(0); + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + //menu->selecteditem = (union menuoption_s *) + + MC_AddWhiteText(menu, 16, y, "Teamplay Item Names", false); y+=8; + + y+=4;MC_AddEditCvar(menu, 16, y, " Armor", "tp_name_armor"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Green", "tp_name_armortype_ga"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Red", "tp_name_armortype_ra"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, "Armor Type - Yellow", "tp_name_armortype_ya"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " AT?", "tp_name_at"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Axe", "tp_name_axe"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Backpack", "tp_name_backpack"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Cells", "tp_name_cells"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Dispenser", "tp_name_disp"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Enemy", "tp_name_enemy"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Eyes", "tp_name_eyes"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Flag", "tp_name_flag"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor", "tp_name_ga"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Grenade Launcher", "tp_name_gl"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Health", "tp_name_health"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Lightning Gun", "tp_name_lg"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Mega Health", "tp_name_mh"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Nails", "tp_name_nails"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Nailgun", "tp_name_ng"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " None", "tp_name_none"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Nothing", "tp_name_nothing"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Pentagram", "tp_name_pent"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Pented", "tp_name_pented"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Quad", "tp_name_quad"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Quaded", "tp_name_quaded"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "tp_name_ra"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Ring", "tp_name_ring"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rocket Launcher", "tp_name_rl"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rockets", "tp_name_rockets"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rune 1", "tp_name_rune_1"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rune 2", "tp_name_rune_2"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rune 3", "tp_name_rune_3"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rune 4", "tp_name_rune_4"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Sentry Gun", "tp_name_sentry"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Seperator", "tp_name_seperator"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Shotgun", "tp_name_sg"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Shells", "tp_name_shells"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Super Nailgun", "tp_name_sng"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Someplace", "tp_name_someplace"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Super Shotgun", "tp_name_ssg"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Status Blue", "tp_name_status_blue"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Status Green", "tp_name_status_green"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Status Red", "tp_name_status_red"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Status Yellow", "tp_name_status_yellow"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Suit", "tp_name_suit"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Teammate", "tp_name_teammate"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Weapon", "tp_name_weapon"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "tp_name_ya"); y+=8+4; + + y+=8; + MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); } \ No newline at end of file diff --git a/engine/client/menu.c b/engine/client/menu.c index eebebd105..2bef3a131 100644 --- a/engine/client/menu.c +++ b/engine/client/menu.c @@ -889,6 +889,10 @@ void M_Menu_FPS_f (void); void M_Menu_Shadow_Lighting_f (void); void M_Menu_3D_f (void); void M_Menu_Textures_f (void); +void M_Menu_Teamplay_f (void); +void M_Menu_Teamplay_Locations_f (void); +void M_Menu_Teamplay_Needs_f (void); +void M_Menu_Teamplay_Items_f (void); void M_Menu_Particles_f (void); void M_Menu_ParticleSets_f (void); void M_Menu_Audio_Speakers_f (void); @@ -940,6 +944,10 @@ void M_Init_Internal (void) Cmd_AddRemCommand ("menu_3d" , M_Menu_3D_f); Cmd_AddRemCommand ("menu_shadow_lighting", M_Menu_Shadow_Lighting_f); Cmd_AddRemCommand ("menu_textures", M_Menu_Textures_f); + Cmd_AddRemCommand ("menu_teamplay", M_Menu_Teamplay_f); + Cmd_AddRemCommand ("menu_teamplay_locations", M_Menu_Teamplay_Locations_f); + Cmd_AddRemCommand ("menu_teamplay_needs", M_Menu_Teamplay_Needs_f); + Cmd_AddRemCommand ("menu_teamplay_items", M_Menu_Teamplay_Items_f); Cmd_AddRemCommand ("menu_particles", M_Menu_Particles_f); Cmd_AddRemCommand ("menu_particlesets", M_Menu_ParticleSets_f); @@ -986,6 +994,10 @@ void M_DeInit_Internal (void) Cmd_RemoveCommand ("menu_video"); Cmd_RemoveCommand ("menu_audio"); Cmd_RemoveCommand ("menu_speakers"); + Cmd_RemoveCommand ("menu_teamplay"); + Cmd_RemoveCommand ("menu_teamplay_locations"); + Cmd_RemoveCommand ("menu_teamplay_needs"); + Cmd_RemoveCommand ("menu_teamplay_items"); Cmd_RemoveCommand ("menu_fps"); Cmd_RemoveCommand ("menu_3d"); Cmd_RemoveCommand ("menu_shadow_lighting"); diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 013996ead..174151f33 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -1313,7 +1313,7 @@ void M_Menu_Video_f (void) info->refreshratecombo = MC_AddCombo(menu, 16, y, " Refresh Rate", refreshrates, currentrefreshrate); y+=8; info->modecombo = MC_AddCombo(menu, 16, y, " Video Size", modenames, prefabmode+1); y+=8; MC_AddWhiteText(menu, 16, y, " Current A/R", false); - MC_AddWhiteText(menu, 160, y, aspectratio2, false); y+=8; + MC_AddWhiteText(menu, 160, y, aspectratio2, false); y+=8; info->conscalecombo = MC_AddCombo(menu, 16, y, " 2D Size", modenames, prefab2dmode+1); y+=8; MC_AddCheckBox(menu, 16, y, " Fullscreen", &vid_fullscreen,0); y+=8; y+=4;info->customwidth = MC_AddEdit(menu, 16, y, " Custom width", vid_width.string); y+=8; From 4062c0b38752b17802671eb2eeeaf1da01688bed Mon Sep 17 00:00:00 2001 From: Lance Date: Wed, 30 Dec 2009 04:29:14 +0000 Subject: [PATCH 50/76] Updated gl_max_size to be renderer latched requiring a vid_restart to take effect git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3488 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 174151f33..064a71b0d 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -263,7 +263,7 @@ cvar_t gl_lightmap_shift = SCVARF ("gl_lightmap_shift", "0", cvar_t gl_load24bit = SCVARF ("gl_load24bit", "1", CVAR_ARCHIVE); -cvar_t gl_max_size = SCVAR ("gl_max_size", "1024"); +cvar_t gl_max_size = SCVARF ("gl_max_size", "1024", CVAR_RENDERERLATCH); cvar_t gl_maxshadowlights = SCVARF ("gl_maxshadowlights", "2", CVAR_ARCHIVE); cvar_t gl_menutint_shader = SCVAR ("gl_menutint_shader", "1"); From e411c79c49f406c085c00792f87a5b781a881e3b Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 7 Jan 2010 02:10:03 +0000 Subject: [PATCH 51/76] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3489 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- specs/particles.txt | 273 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 specs/particles.txt diff --git a/specs/particles.txt b/specs/particles.txt new file mode 100644 index 000000000..8e76cae7c --- /dev/null +++ b/specs/particles.txt @@ -0,0 +1,273 @@ +Example: +r_part blah +{ + texture textures/particles/myimage.tga + tcoords 0 0 64 64 64 + die 2 + scalefactor 1 + scale 20 + alpha 0.5 + rgb 255 0 0 + rgbdelta 0 128 128 + spawnmode ball + spawnorg 32 +} + +will give transparent (0.5) red particles that will fade to fully white when they go fully transparent 2 seconds later. +they will spawn within a ball of 32 units radius. + + + + +texture + specifies to use an image named TEXTURENAME for this effect. + +tcoords [tscale] [rsmax] [rsstep] + specifies to use a subsection of the image. + if tscale is set, all units are divided by this. it is the virtual size of your texture. So a value of 1 means that your texture coords must be between 0 and 1. But if it properly matches your texture's size, the coords are in pixels. + if rsmax is present, each particle will use a random image. These images must be on a single row in your particle font. + rsstep specifies the stride (gap from one to the next) in your particle font, and is only needed if rsmax is present and greater than 1. + +rotationstart [max] + the particle will start with a rotation rotated between min and max. + if max is missing, the particle will always start with the min value. + +beamtexstep + only valid if the effect is a beam. + specifies the number of quake units per beam texture repitition. + +beamtexspeed + only valid if the effect is a beam. + controls how fast the texture scrolls on the beam. + +scale [max] + particles will start with a diameter of this many quake units. + actual scale will be randomly chosen between min and max (max defaults to equal min is missing) + +scalerand + obsolete + overrides the scale max value + actual scale will be now be randomly chosen between min and min+extra + +scalefactor + controls how the particle scales with distance. + 1 makes the particle scale the same as anything else + 0 makes the particle not change size no matter how far it is + +scaledelta + controls how the particle scales over time + specifies the change in the particle scale per second. + +step + trails/beams only + specifies the distance between each particle in the trail (or beam). + +count + point/box effects only (not trails or beams) + specifies how many particles are spawned per effect (some classic effects contain an extra scaler which is multiplied by the resulting value) + +alpha + specifies the initial alpha value of the effect + +alphadelta + specifies how much the alpha value of the effect changes per second (subtracted) + +die + specifies the maximum age of the particle + +diesubrand + specifies the maximum starting age of the particle. + basically the particle will live up to this much less time. the alpha value will also be aged by the amount chosen by this value + +randomvel [vert] + controls how fast the particle moves when it spawns. This works regardless of any requested velocities. + if vert is not specified, horiz is used instead. + +veladd + controls how much of the effect's spawn velocity is used, can be greater than 1, or negative. + +orgadd + biases how much to add to the starting origin relative to the requested velocity. + +friction <1> <2> <3> + FIXME + +gravity + amount that the particle's velocity changes per second, in quake units. + +clipbounce + how much of the particle's velocity to use if the particle is clipped. See cliptype. + Defaults to 0.8 + +cliptype + Specifies which new effect to spawn when the particle hits something. + The origin and velocity of the particle are used to spawn the new effect. + The clipbounce value is used as a scaler for the reflected velocity. + If the effect named is the effect itself, the particle will merely bounce, instead of spawning a new effect. + FIXME: make default to bounce if clipbounce is set without cliptype. + +clipcount + The scaler to use for the number of particles to spawn upon a clip event. + Only valid in conjunction with cliptype. + +assoc + Specifies another effect to spawn at the same time that this effect is spawned. + Thus allowing two sets of particles from one effect. + +inwater + Specifies a replacement effect to use when this one is spawned underwater. + assoc used is the replacement effect. the assoc value from the replaced effect is ignored. + +colorindex [rand] + Specifies a palette index to spawn the particle with. + The index used is between index and index+rand. + overrides the normal starting colours. + +colorrand + obsolete. + replaces the [rand] part of the colorindex setting. + +citracer + only valid if colorindex is set. + adds a palette index between 0 and 3, based on the particle index in the effect or trail. + +red +green +blue +rgb +rgb + Specifies the initial red, green, and/or blue values for each particle. + Fully opaque is 255 or above. + Values above 255 are valid, but will remain opaque until the value drops below 255 from the colour deltas. + +redrand +greenrand +bluerand +rgbrand +rgbrand + Specifies how much extra red, green, and/or blue there may be for particles. + The initial colour will be multiplied by this amount before addition. + Each componant is separately randomized. EG, red might add nothing, while the full green is added, and only half the blue. + Fully opaque is 255 or above. + +redrandsync +greenrandsync +bluerandsync +rgbrandsync +rgbrandsync + Specifies how much extra red, green, and/or blue there may be for particles. + The initial colour will be multiplied by this amount before addition. + Componants are syncronised. EG, if the full amount of red is added, the full amount of green and blue will also be added. + Fully opaque is 255 or above. + +reddelta +greendelta +bluedelta +rgbdelta +rgbdelta + Specifies how much the red, green, and/or blue values of each particle change over time. + The value 255 is the value required to go from opaque to invisible in 1 second. + +rgbdeltatime + Specifies for how long the particle may change colours for. After this many seconds, the particle may no longer change colours (delta becomes 0). + +rampmode + mode may be one of: + none: uses rgb+rand+sync+delta+scale+scaledelta values. + absolute: the ramp overrides all colour+scale values. The effect moves from one absolute ramp index to the next. + delta: uses rgb+rand+sync+scale, but not delta values. All delta values come from the colour ramp instead. + + if not none, the ramp index used is based upon the particle's age, its lifetime, and how many ramp elements there are. + +rampindexlist [ [idx3 ...]] + Scale used is the currently set scale value. + Specifies a set of palette index values to use for the effect as part of the effect's colour ramp. + +rampindex + Specifies an individual palette index value and particle scale to use for the effect as part of the effect's colour ramp + +ramp [alpha] [scale] + Specifies a ramp index in rgb terms, regardless of palette. + +stains + How much the effect discolours the wall upon impact. + The stained colour is based upon the colour of the particle upon impact. + +blend + mode may be one of: add, subtract, blendcolour/blendcolor, blend + if the texture used is actually a shader, this is ignored. + +spawnmode [arg1] [arg2] + This affects how particles are positioned when they first spawn, and their initial velocities. + for point effects, mode may be one of: + circle: particles spawn within a ball with uniform distance from the center + ball: particles spawn randomly within a ball. + telebox: matches quake's telebox + lavasplash: like chthon's lava splash + uniformcircle: particles are spawned in a circle with uniform distance between and from the center. z=0. + syncfield: particles spawn at predictable locations based upon time within a rough sphere. Only useful for effects that are regenerated+replaced every frame. + distball: + *default*: regular box. particles are spawned inside an axially aligned box. + + for trail effects, mode may be one of: + spiral: particles are given velocities perpendicular to the direction based on the distance moved. + tracer: particles spawn with alternating horizontal velocities (a wake effect). + *default*: particles spawn as a regular trail. + +spawnparam1 + obsolete + +spawnparam2 + obsolete + +up + the particle's origin is moved upwards by this amount + +type + How the particles look. + mode may be: + beam: valid only for trails. Particles form a single textured beam acting as nodes along it. + spark: particles are lines, their length depending upon their speed. + sparkfan: particles are non-planar triangle fans, their length depending upon their speed. + texturedspark: textured particles are aligned along their direction of movement, their length depending upon their speed. + decal: particles are spawned only upon bsp geometry. They are clipped by it. + *default*: Particles are regular, rotating, 2d images. + +isbeam + obsolete. + please use 'type beam' instead. + +spawntime +spawnchance + + +emit + Specifies the effect to periodically emit. + +emitinterval + Particles will not emit additional effects for this duration after emitting one. + +emitintervalrand + FIXME: fold into emitinterval + + +emitstart + Prevents the particle from emitting anything for this duration when it first spawns. + +spawnorg [vert] +spawnvel [vert] + +perframe + apply inverse frametime to count (causes emits to be per frame) + +averageout + average trail points from start to end, useful with t_lightning, etc + +nostate + Causes the particle system to ignore all state information. + +nospreadfirst + don't randomize org/vel for first generated particle + +nospreadlast + don't randomize org/vel for last generated particle From 051e8ff18c0e7ba0ea46776341beb65c17cf822e Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 10 Jan 2010 13:15:06 +0000 Subject: [PATCH 52/76] Fixed calling convention errors. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3490 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/svq3_game.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/engine/server/svq3_game.c b/engine/server/svq3_game.c index de05ec8f6..486146741 100644 --- a/engine/server/svq3_game.c +++ b/engine/server/svq3_game.c @@ -1634,7 +1634,7 @@ void SVQ3_ShutdownGame(void) } #ifdef USEBOTLIB -void VARGS BL_Print(int l, char *fmt, ...) +void QDECL BL_Print(int l, char *fmt, ...) { va_list argptr; char text[1024]; @@ -1647,11 +1647,11 @@ void VARGS BL_Print(int l, char *fmt, ...) } int botlibmemoryavailable; -int BL_AvailableMemory(void) +int QDECL BL_AvailableMemory(void) { return botlibmemoryavailable; } -void *BL_Malloc(int size) +void *QDECL BL_Malloc(int size) { int *mem; botlibmemoryavailable-=size; @@ -1661,22 +1661,22 @@ void *BL_Malloc(int size) return (void *)(mem + 1); } -void BL_Free(void *mem) +void QDECL BL_Free(void *mem) { int *memref = ((int *)mem) - 1; botlibmemoryavailable+=memref[0]; Z_TagFree(memref); } -void *BL_HunkMalloc(int size) +void *QDECL BL_HunkMalloc(int size) { return BL_Malloc(size);//Hunk_AllocName(size, "botlib"); } -int BL_FOpenFile(const char *name, fileHandle_t *handle, fsMode_t mode) +int QDECL BL_FOpenFile(const char *name, fileHandle_t *handle, fsMode_t mode) { return VM_fopen((char*)name, (int*)handle, mode, Z_TAG_BOTLIB); } -int BL_FRead( void *buffer, int len, fileHandle_t f ) +int QDECL BL_FRead( void *buffer, int len, fileHandle_t f ) { return VM_FRead(buffer, len, (int)f, Z_TAG_BOTLIB); } @@ -1684,7 +1684,7 @@ int BL_FRead( void *buffer, int len, fileHandle_t f ) //{ // return VM_FWrite(buffer, len, f, Z_TAG_BOTLIB); //} -void BL_FCloseFile( fileHandle_t f ) +void QDECL BL_FCloseFile( fileHandle_t f ) { VM_fclose((int)f, Z_TAG_BOTLIB); } @@ -1692,11 +1692,11 @@ void BL_FCloseFile( fileHandle_t f ) //{ // VM_fseek(f, Z_TAG_BOTLIB) //} -char *BL_BSPEntityData(void) +char *QDECL BL_BSPEntityData(void) { return sv.worldmodel->entities; } -void BL_Trace(bsp_trace_t *trace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int passent, int contentmask) +void QDECL BL_Trace(bsp_trace_t *trace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int passent, int contentmask) { q3trace_t tr; SVQ3_Trace(&tr, start, mins, maxs, end, passent, contentmask); @@ -1714,17 +1714,17 @@ void BL_Trace(bsp_trace_t *trace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t trace->contents = 0;//tr.contents; trace->ent = tr.entityNum; } -int BL_PointContents(vec3_t point) +int QDECL BL_PointContents(vec3_t point) { return SVQ3_PointContents(point, -1); } -int BL_inPVS(vec3_t p1, vec3_t p2) +int QDECL BL_inPVS(vec3_t p1, vec3_t p2) { return true;// FIXME: :( } -void BL_EntityTrace(bsp_trace_t *trace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int entnum, int contentmask) +void QDECL BL_EntityTrace(bsp_trace_t *trace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int entnum, int contentmask) { trace->allsolid = 0;//tr.allsolid; trace->startsolid = 0;//tr.startsolid; @@ -1740,7 +1740,7 @@ void BL_EntityTrace(bsp_trace_t *trace, vec3_t start, vec3_t mins, vec3_t maxs, // trace->ent = tr.entityNum; } -void BL_BSPModelMinsMaxsOrigin(int modelnum, vec3_t angles, vec3_t outmins, vec3_t outmaxs, vec3_t origin) +void QDECL BL_BSPModelMinsMaxsOrigin(int modelnum, vec3_t angles, vec3_t outmins, vec3_t outmaxs, vec3_t origin) { model_t *mod; vec3_t mins, maxs; @@ -1769,7 +1769,7 @@ void BL_BSPModelMinsMaxsOrigin(int modelnum, vec3_t angles, vec3_t outmins, vec3 if (origin) VectorClear(origin); } -void BL_BotClientCommand(int clientnum, char *command) +void QDECL BL_BotClientCommand(int clientnum, char *command) { Cmd_TokenizeString(command, false, false); VM_Call(q3gamevm, GAME_CLIENT_COMMAND, clientnum); From a16e0c84e66603a4d319c7e22c5fb61affd1143a Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Sun, 10 Jan 2010 15:15:20 +0000 Subject: [PATCH 53/76] Don't allow duplicate bans. (overlapping bans are however still OK). git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3491 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/sv_ccmds.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/engine/server/sv_ccmds.c b/engine/server/sv_ccmds.c index 8009ba4b3..c49c7ea9c 100644 --- a/engine/server/sv_ccmds.c +++ b/engine/server/sv_ccmds.c @@ -890,6 +890,17 @@ void SV_FilterIP_f (void) return; } + nb = svs.bannedips; + while (nb) + { + if (NET_CompareAdr(nb->adr, banadr) && NET_CompareAdr(nb->adrmask, banmask)) + { + Con_Printf("%s is already banned\n", Cmd_Argv(1)); + break; + } + nb = nb->next; + } + // loop through clients and kick the ones that match for (i = 0, cl = svs.clients; i < sv.allocated_client_slots; i++, cl++) { From af15a5945cd76fa9fcabaf1e6f8998cf82cbabdf Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Mon, 11 Jan 2010 17:39:56 +0000 Subject: [PATCH 54/76] Fixed the demolist usercmd to output to the user rather than the server console. Fixed all file-related functionality in sv_mvd.c to actually work. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3493 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/sv_mvd.c | 14 +++++++------- engine/server/sv_user.c | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/engine/server/sv_mvd.c b/engine/server/sv_mvd.c index b86888311..cf3662eca 100644 --- a/engine/server/sv_mvd.c +++ b/engine/server/sv_mvd.c @@ -681,7 +681,7 @@ dir_t *Sys_listdir (char *path, char *ext, qboolean usesorting) dir->files = (file_t*)(dir+1); dir->maxfiles = maxfiles; - Q_strncpyz(searchterm, va("%s/*.%s", path, ext), sizeof(searchterm)); + Q_strncpyz(searchterm, va("%s/*%s", path, ext), sizeof(searchterm)); COM_EnumerateFiles(searchterm, Sys_listdirFound, dir); return dir; @@ -2444,12 +2444,12 @@ void SV_UserCmdMVDList_f (void) float f; int i,j,show; - Con_Printf("available demos\n"); + SV_ClientPrintf(host_client, PRINT_HIGH, "available demos:\n"); dir = Sys_listdir(sv_demoDir.string, ".mvd", SORT_BY_DATE); list = dir->files; if (!list->name[0]) { - Con_Printf("no demos\n"); + SV_ClientPrintf(host_client, PRINT_HIGH, "no demos\n"); } for (i = 1; i <= dir->numfiles; i++, list++) @@ -2464,23 +2464,23 @@ void SV_UserCmdMVDList_f (void) for (d = demo.dest; d; d = d->nextdest) { if (!strcmp(list->name, d->name)) - Con_Printf("*%d: %s %dk\n", i, list->name, d->totalsize/1024); + SV_ClientPrintf(host_client, PRINT_HIGH, "*%d: %s %dk\n", i, list->name, d->totalsize/1024); } if (!d) - Con_Printf("%d: %s %dk\n", i, list->name, list->size/1024); + SV_ClientPrintf(host_client, PRINT_HIGH, "%d: %s %dk\n", i, list->name, list->size/1024); } } for (d = demo.dest; d; d = d->nextdest) dir->size += d->totalsize; - Con_Printf("\ndirectory size: %.1fMB\n",(float)dir->size/(1024*1024)); + SV_ClientPrintf(host_client, PRINT_HIGH, "\ndirectory size: %.1fMB\n",(float)dir->size/(1024*1024)); if (sv_demoMaxDirSize.value) { f = (sv_demoMaxDirSize.value*1024 - dir->size)/(1024*1024); if ( f < 0) f = 0; - Con_Printf("space available: %.1fMB\n", f); + SV_ClientPrintf(host_client, PRINT_HIGH, "space available: %.1fMB\n", f); } Sys_freedir(dir); diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index 77d7c5d41..21033097b 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -3841,7 +3841,7 @@ void SV_DisableClientsCSQC(void) #endif } -void SV_MVDList_f (void); +void SV_UserCmdMVDList_f (void); void SV_MVDInfo_f (void); typedef struct { @@ -3905,7 +3905,7 @@ ucmd_t ucmds[] = {"setpos", Cmd_SetPos_f}, {"stopdownload", SV_StopDownload_f}, - {"demolist", SV_MVDList_f}, + {"demolist", SV_UserCmdMVDList_f}, {"demoinfo", SV_MVDInfo_f}, {NULL, NULL} From 8901f51133f94a1bc9b57455aee0404ab9f19d48 Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Mon, 11 Jan 2010 18:15:42 +0000 Subject: [PATCH 55/76] Fixed Sys_EnumerateFiles(): Doesn't treat directories as files anymore and actually manages to figure out file sizes now. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3494 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/sys_linux.c | 33 +++++++++++++++------------------ engine/server/sv_sys_unix.c | 33 +++++++++++++++------------------ 2 files changed, 30 insertions(+), 36 deletions(-) diff --git a/engine/client/sys_linux.c b/engine/client/sys_linux.c index b28d9e8a4..a564761d5 100644 --- a/engine/client/sys_linux.c +++ b/engine/client/sys_linux.c @@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #ifndef __CYGWIN__ #include #include @@ -244,13 +245,13 @@ int Sys_DebugLog(char *file, char *fmt, ...) int Sys_EnumerateFiles (const char *gpath, const char *match, int (*func)(const char *, int, void *), void *parm) { -#include - DIR *dir, *dir2; + DIR *dir; char apath[MAX_OSPATH]; char file[MAX_OSPATH]; char truepath[MAX_OSPATH]; char *s; struct dirent *ent; + struct stat st; //printf("path = %s\n", gpath); //printf("match = %s\n", match); @@ -291,29 +292,25 @@ int Sys_EnumerateFiles (const char *gpath, const char *match, int (*func)(const if (!ent) break; if (*ent->d_name != '.') + { if (wildcmp(match, ent->d_name)) { - Q_snprintfz(file, sizeof(file), "%s/%s", gpath, ent->d_name); -//would use stat, but it breaks on fat32. + Q_snprintfz(file, sizeof(file), "%s/%s", truepath, ent->d_name); - if ((dir2 = opendir(file))) + if (stat(file, &st) == 0) { - closedir(dir2); - Q_snprintfz(file, sizeof(file), "%s%s/", apath, ent->d_name); -//printf("is directory = %s\n", file); + Q_snprintfz(file, sizeof(file), "%s%s%s", apath, ent->d_name, S_ISDIR(st.st_mode)?"/":""); + + if (!func(file, st.st_size, parm)) + { + closedir(dir); + return false; + } } else - { - Q_snprintfz(file, sizeof(file), "%s%s", apath, ent->d_name); -//printf("file = %s\n", file); - } - - if (!func(file, -2, parm)) - { - closedir(dir); - return false; - } + printf("Stat failed for \"%s\"\n", file); } + } } while(1); closedir(dir); diff --git a/engine/server/sv_sys_unix.c b/engine/server/sv_sys_unix.c index aba86331f..83419d88b 100644 --- a/engine/server/sv_sys_unix.c +++ b/engine/server/sv_sys_unix.c @@ -35,6 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #ifdef MULTITHREAD #include @@ -697,13 +698,13 @@ int main(int argc, char *argv[]) int Sys_EnumerateFiles (const char *gpath, const char *match, int (*func)(const char *, int, void *), void *parm) { -#include - DIR *dir, *dir2; + DIR *dir; char apath[MAX_OSPATH]; char file[MAX_OSPATH]; char truepath[MAX_OSPATH]; char *s; struct dirent *ent; + struct stat st; //printf("path = %s\n", gpath); //printf("match = %s\n", match); @@ -744,29 +745,25 @@ int Sys_EnumerateFiles (const char *gpath, const char *match, int (*func)(const if (!ent) break; if (*ent->d_name != '.') + { if (wildcmp(match, ent->d_name)) { - Q_snprintfz(file, sizeof(file), "%s/%s", gpath, ent->d_name); -//would use stat, but it breaks on fat32. + Q_snprintfz(file, sizeof(file), "%s/%s", truepath, ent->d_name); - if ((dir2 = opendir(file))) + if (stat(file, &st) == 0) { - closedir(dir2); - Q_snprintfz(file, sizeof(file), "%s%s/", apath, ent->d_name); -//printf("is directory = %s\n", file); + Q_snprintfz(file, sizeof(file), "%s%s%s", apath, ent->d_name, S_ISDIR(st.st_mode)?"/":""); + + if (!func(file, st.st_size, parm)) + { + closedir(dir); + return false; + } } else - { - Q_snprintfz(file, sizeof(file), "%s%s", apath, ent->d_name); -//printf("file = %s\n", file); - } - - if (!func(file, -2, parm)) - { - closedir(dir); - return false; - } + printf("Stat failed for \"%s\"\n", file); } + } } while(1); closedir(dir); From d55c03b072a3682878b5b3b81b8bdc89e313187b Mon Sep 17 00:00:00 2001 From: Lance Date: Fri, 15 Jan 2010 05:35:27 +0000 Subject: [PATCH 56/76] Menu work in progress, additions, tweaks etc, still more to do git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3495 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_items.c | 104 ++++++++++---------- engine/client/m_options.c | 10 +- engine/client/renderer.c | 198 ++++++++++++++++++++++++-------------- 3 files changed, 187 insertions(+), 125 deletions(-) diff --git a/engine/client/m_items.c b/engine/client/m_items.c index 9d78b7d07..8cdc8e42f 100644 --- a/engine/client/m_items.c +++ b/engine/client/m_items.c @@ -204,7 +204,7 @@ void MenuTooltipSplit(menu_t *menu, const char *text) return; // calc a line maximum, use a third of the screen or 30 characters, whichever is bigger - lnmax = (vid.width / 24) - 2; + lnmax = (vid.width / 24) - 2; if (lnmax < 30) lnmax = 30; // word wrap @@ -289,7 +289,7 @@ void MenuTooltipSplit(menu_t *menu, const char *text) void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu) { int i; - mpic_t *p; + mpic_t *p; while (option) { if (mousemoved && !bindingactive) @@ -476,9 +476,9 @@ void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu) x += strlen(option->bind.caption)*8+28; { l = strlen (option->bind.command); - + M_FindKeysForCommand (option->bind.command, keys); - + if (bindingactive && menu->selecteditem == option) { Draw_String (x, y, "Press key"); @@ -577,7 +577,7 @@ menutext_t *MC_AddWhiteText(menu_t *menu, int x, int y, const char *text, qboole { menutext_t *n = Z_Malloc(sizeof(menutext_t)); n->common.type = mt_text; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->text = text; @@ -594,7 +594,7 @@ menutext_t *MC_AddBufferedText(menu_t *menu, int x, int y, const char *text, qbo { menutext_t *n = Z_Malloc(sizeof(menutext_t) + strlen(text)+1); n->common.type = mt_text; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->text = (char *)(n+1); @@ -621,7 +621,7 @@ menubind_t *MC_AddBind(menu_t *menu, int x, int y, const char *caption, char *co { menubind_t *n = Z_Malloc(sizeof(menutext_t) + strlen(caption)+1 + strlen(command)+1); n->common.type = mt_bind; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->caption = (char *)(n+1); @@ -766,7 +766,7 @@ menuedit_t *MC_AddEdit(menu_t *menu, int x, int y, char *text, char *def) { menuedit_t *n = Z_Malloc(sizeof(menuedit_t)); n->common.type = mt_edit; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->modified = true; @@ -784,7 +784,7 @@ menuedit_t *MC_AddEditCvar(menu_t *menu, int x, int y, char *text, char *name) cvar_t *cvar; cvar = Cvar_Get(name, "", CVAR_USERCREATED|CVAR_ARCHIVE, NULL); //well, this is a menu/ n->common.type = mt_edit; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->common.width = (strlen(text)+17)*8; @@ -835,7 +835,7 @@ menucheck_t *MC_AddCheckBox(menu_t *menu, int x, int y, const char *text, cvar_t { menucheck_t *n = Z_Malloc(sizeof(menucheck_t)+strlen(text)+1); n->common.type = mt_checkbox; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->common.height = 8; @@ -845,11 +845,13 @@ menucheck_t *MC_AddCheckBox(menu_t *menu, int x, int y, const char *text, cvar_t n->var = var; n->bits = bits; + #ifdef _DEBUG if (var) if (!(var->flags & CVAR_ARCHIVE)) Con_Printf("Warning: %s is not set for archiving\n", var->name); - else if (var->flags & CVAR_RENDERERLATCH) + else if (var->flags & CVAR_RENDERERLATCH) Con_Printf("Warning: %s requires a vid_restart\n", var->name); + #endif n->common.next = menu->options; menu->options = (menuoption_t *)n; @@ -859,7 +861,7 @@ menucheck_t *MC_AddCheckBoxFunc(menu_t *menu, int x, int y, const char *text, qb { menucheck_t *n = Z_Malloc(sizeof(menucheck_t)+strlen(text)+1); n->common.type = mt_checkbox; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->common.height = 8; @@ -876,10 +878,10 @@ menucheck_t *MC_AddCheckBoxFunc(menu_t *menu, int x, int y, const char *text, qb //delta may be 0 menuslider_t *MC_AddSlider(menu_t *menu, int x, int y, const char *text, cvar_t *var, float min, float max, float delta) -{ +{ menuslider_t *n = Z_Malloc(sizeof(menuslider_t)+strlen(text)+1); n->common.type = mt_slider; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->common.height = 8; @@ -892,8 +894,10 @@ menuslider_t *MC_AddSlider(menu_t *menu, int x, int y, const char *text, cvar_t { n->current = var->value; +#ifdef _DEBUG if (!(var->flags & CVAR_ARCHIVE)) Con_Printf("Warning: %s is not set for archiving\n", var->name); +#endif } n->min = min; @@ -930,15 +934,15 @@ menucombo_t *MC_AddCombo(menu_t *menu, int x, int y, const char *caption, const optbufsize += optlen+1+sizeof(char*); numopts++; } - - + + n = Z_Malloc(sizeof(*n) + optbufsize); newops = (char **)(n+1); optbuf = (char*)(newops + numopts+1); n->common.type = mt_combo; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; - n->common.posy = y; + n->common.posy = y; n->common.height = 8; n->common.width = strlen(caption)*8 + maxoptlen*8; n->caption = caption; @@ -956,7 +960,7 @@ menucombo_t *MC_AddCombo(menu_t *menu, int x, int y, const char *caption, const } newops[i] = NULL; - if (initialvalue >= n->numoptions) + if (initialvalue >= n->numoptions) { Con_Printf("WARNING: Fixed initialvalue for %s\n", caption); initialvalue = n->numoptions-1; @@ -990,17 +994,17 @@ menucombo_t *MC_AddCvarCombo(menu_t *menu, int x, int y, const char *caption, cv optbufsize += strlen(values[numopts])+1+sizeof(char*); numopts++; } - - + + n = Z_Malloc(sizeof(*n) + optbufsize); newops = (char **)(n+1); newvalues = (char**)(newops + numopts+1); optbuf = (char*)(newvalues + numopts+1); n->common.type = mt_combo; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; - n->common.posy = y; + n->common.posy = y; n->common.height = 8; n->common.width = strlen(caption)*8 + maxoptlen*8; @@ -1044,7 +1048,7 @@ menubutton_t *MC_AddConsoleCommand(menu_t *menu, int x, int y, const char *text, { menubutton_t *n = Z_Malloc(sizeof(menubutton_t)+strlen(text)+1+strlen(command)+1); n->common.type = mt_button; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->common.height = 8; @@ -1063,7 +1067,7 @@ menubutton_t *MC_AddConsoleCommandQBigFont(menu_t *menu, int x, int y, const cha { menubutton_t *n = Z_Malloc(sizeof(menubutton_t)+strlen(text)+1+strlen(command)+1); n->common.type = mt_qbuttonbigfont; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->common.height = 20; @@ -1081,7 +1085,7 @@ menubutton_t *MC_AddConsoleCommandHexen2BigFont(menu_t *menu, int x, int y, cons { menubutton_t *n = Z_Malloc(sizeof(menubutton_t)+strlen(text)+1+strlen(command)+1); n->common.type = mt_hexen2buttonbigfont; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->common.height = 8; @@ -1100,7 +1104,7 @@ menubutton_t *MC_AddCommand(menu_t *menu, int x, int y, char *text, qboolean (*c { menubutton_t *n = Z_Malloc(sizeof(menubutton_t)); n->common.type = mt_button; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; n->text = text; @@ -1119,17 +1123,17 @@ menubutton_t *VARGS MC_AddConsoleCommandf(menu_t *menu, int x, int y, const char va_list argptr; static char string[1024]; menubutton_t *n; - + va_start (argptr, command); vsnprintf (string,sizeof(string)-1, command,argptr); - va_end (argptr); + va_end (argptr); n = Z_Malloc(sizeof(menubutton_t) + strlen(string)+1); n->common.type = mt_button; - n->common.iszone = true; + n->common.iszone = true; n->common.posx = x; n->common.posy = y; - n->text = text; + n->text = text; n->command = (char *)(n+1); strcpy((char *)(n+1), string); @@ -1330,7 +1334,7 @@ void M_HideMenu (menu_t *menu) } } void M_RemoveMenu (menu_t *menu) -{ +{ menuoption_t *op, *oop; if (menu->remove) menu->remove(menu); @@ -1454,7 +1458,7 @@ menuoption_t *M_NextSelectableItem(menu_t *m, menuoption_t *old) if (!old) old = M_NextItem(m, old); - + op = old; while (1) @@ -1481,11 +1485,11 @@ menuoption_t *M_NextSelectableItem(menu_t *m, menuoption_t *old) menuoption_t *M_PrevSelectableItem(menu_t *m, menuoption_t *old) { - menuoption_t *op; + menuoption_t *op; if (!old) old = currentmenu->options; - + op = old; while (1) @@ -1510,7 +1514,7 @@ void M_Complex_Key(int key) { if (!currentmenu) return; //erm... - + if (currentmenu->key) if (currentmenu->key(key, currentmenu)) return; @@ -1534,7 +1538,7 @@ void M_Complex_Key(int key) return; } } - + switch(key) { case K_MOUSE2: @@ -1547,7 +1551,7 @@ void M_Complex_Key(int key) case K_DOWNARROW: currentmenu->selecteditem = M_NextSelectableItem(currentmenu, currentmenu->selecteditem); - if (currentmenu->selecteditem) + if (currentmenu->selecteditem) { S_LocalSound ("misc/menu1.wav"); if (currentmenu->cursoritem) @@ -1557,7 +1561,7 @@ void M_Complex_Key(int key) case K_UPARROW: currentmenu->selecteditem = M_PrevSelectableItem(currentmenu, currentmenu->selecteditem); - if (currentmenu->selecteditem) + if (currentmenu->selecteditem) { S_LocalSound ("misc/menu1.wav"); if (currentmenu->cursoritem) @@ -1630,7 +1634,7 @@ qboolean MC_GuiKey(int key, menu_t *menu) guiinfo_t *info = (guiinfo_t *)menu->data; switch(key) { - case K_ESCAPE: + case K_ESCAPE: if (info->dropout) MC_GuiKey(key, info->dropout); else @@ -1670,7 +1674,7 @@ qboolean MC_GuiKey(int key, menu_t *menu) gui->text[1] = "Hello again"; gui->text[2] = "Hello yet again"; for (y = 0, i = 0; gui->text[i]; i++, y+=1*8) - { + { info->op[i] = MC_AddRedText(info->dropout, 0, y, gui->text[i], false); } } @@ -1753,7 +1757,7 @@ void M_Menu_Main_f (void) mainm = M_CreateMenu(sizeof(guiinfo_t)); mainm->key = MC_GuiKey; mainm->xpos=0; - gui = (guiinfo_t *)mainm->data; + gui = (guiinfo_t *)mainm->data; gui->text[0] = "Single"; gui->text[1] = "Multiplayer"; gui->text[2] = "Quit"; @@ -1761,7 +1765,7 @@ void M_Menu_Main_f (void) { gui->op[i] = MC_AddRedText(mainm, x, 0, gui->text[i], false); x+=(strlen(gui->text[i])+1)*8; - } + } return; } */ @@ -1772,12 +1776,12 @@ void M_Menu_Main_f (void) if (mgt == MGT_QUAKE2) //quake2 main menu. { if (Draw_SafeCachePic("pics/m_main_game")) - { + { m_state = m_complex; key_dest = key_menu; - mainm = M_CreateMenu(0); - mainm->key = MC_Main_Key; + mainm = M_CreateMenu(0); + mainm->key = MC_Main_Key; MC_AddPicture(mainm, 0, 4, "pics/m_main_plaque"); p = Draw_SafeCachePic("pics/m_main_logo"); @@ -1822,8 +1826,8 @@ void M_Menu_Main_f (void) { m_state = m_complex; key_dest = key_menu; - mainm = M_CreateMenu(0); - mainm->key = MC_Main_Key; + mainm = M_CreateMenu(0); + mainm->key = MC_Main_Key; MC_AddPicture(mainm, 16, 0, "gfx/menu/hplaque.lmp"); p = Draw_SafeCachePic("gfx/menu/title0.lmp"); @@ -1856,7 +1860,7 @@ void M_Menu_Main_f (void) { m_state = m_complex; key_dest = key_menu; - mainm = M_CreateMenu(0); + mainm = M_CreateMenu(0); p = Draw_SafeCachePic("gfx/ttl_main.lmp"); if (!p) @@ -1890,7 +1894,7 @@ void M_Menu_Main_f (void) { m_state = m_complex; key_dest = key_menu; - mainm = M_CreateMenu(0); + mainm = M_CreateMenu(0); p = Draw_SafeCachePic("gfx/ttl_main.lmp"); if (!p) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index c052f63cb..0dcb8c105 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -913,12 +913,12 @@ void M_Menu_Textures_f (void) menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 220, 32, NULL, false); } -typedef struct { -} shadowlightingmenuinfo_t; +/*typedef struct { +} shadowlightingmenuinfo_t;*/ qboolean M_VideoApplyShadowLighting (union menuoption_s *op,struct menu_s *menu,int key) { - shadowlightingmenuinfo_t *info = menu->data; + //shadowlightingmenuinfo_t *info = menu->data; if (key != K_ENTER) return false; @@ -965,7 +965,7 @@ void M_Menu_Shadow_Lighting_f (void) MC_AddCheckBox(menu, 16, y, " Alias Model Shadows", &r_noaliasshadows,0); y+=8; - MC_AddSlider(menu, 16, y, " Shadows", &r_shadows,0,2,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Shadows", &r_shadows,0); y+=8; MC_AddCheckBox(menu, 16, y, "Realtime World Shadows & Lighting", &r_shadow_realtime_world,0); y+=8; MC_AddCheckBox(menu, 16, y, " Realtime World Lightmaps", &r_shadow_realtime_world_lightmaps,0); y+=8; MC_AddCheckBox(menu, 16, y, " GLSL Shadow Offsetmapping", &r_shadow_glsl_offsetmapping,0); y+=8; @@ -1284,4 +1284,4 @@ void M_Menu_Teamplay_Items_f (void) MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); -} \ No newline at end of file +} diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 064a71b0d..b5801febc 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -3,6 +3,7 @@ #ifdef RGLQUAKE #include "gl_draw.h" #endif +#include qboolean vid_isfullscreen; @@ -986,42 +987,42 @@ typedef struct vidmode_s vidmode_t vid_modes[] = { - { "320x200 (16:10)", 320, 200}, // CGA, MCGA - { "320x240 (4:3)", 320, 240}, // QVGA - { "400x300 (4:3)", 400, 300}, // Quarter SVGA - { "512x384 (4:3)", 512, 384}, // Mac LC - { "640x400 (16:10)", 640, 400}, // Atari ST mono, Amiga OCS NTSC Hires interlace - { "640x480 (4:3)", 640, 480}, // VGA, MCGA - { "800x600 (4:3)", 800, 600}, // SVGA - { "856x480 (16:9)", 856, 480}, // WVGA - { "960x720 (4:3)", 960, 720}, // unnamed - { "1024x576 (16:9)", 1024, 576}, // WSVGA - { "1024x640 (16:10)", 1024, 640}, // unnamed - { "1024x768 (4:3)", 1024, 768}, // XGA - { "1152x720 (16:10)", 1152, 720}, // XGA+ - { "1152x864 (4:3)", 1152, 864}, // XGA+ - { "1280x720 (16:9)", 1280, 720}, // WXGA min. - { "1280x800 (16:10)", 1280, 800}, // WXGA avg (native resolution of 17" widescreen LCDs) - { "1280x960 (4:3)", 1280, 960}, //SXGA- - { "1280x1024 (5:4)", 1280, 1024}, // SXGA (native resolution of 17-19" LCDs) - { "1366x768 (16:9)", 1366, 768}, // WXGA - { "1400x1050 (4:3)", 1400, 1050}, // SXGA+ - { "1440x900 (16:10)", 1440, 900}, // WXGA+ (native resolution of 19" widescreen LCDs) - { "1440x1080 (4:3)", 1440, 1080}, // unnamed - { "1600x900 (16:9)", 1600, 900}, // 900p - { "1600x1200 (4:3)", 1600, 1200}, // UXGA (native resolution of 20"+ LCDs) //sw height is bound to 200 to 1024 - { "1680x1050 (16:10)", 1680, 1050}, // WSXGA+ (native resolution of 22" widescreen LCDs) - { "1792x1344 (4:3)", 1792, 1344}, // unnamed - { "1800x1440 (5:4)", 1800, 1440}, // unnamed - { "1856x1392 (4:3)", 1856, 1392}, //unnamed - { "1920x1080 (16:9)", 1920, 1080}, // 1080p (native resolution of cheap 24" LCDs, which really are 23.6") - { "1920x1200 (16:10)", 1920, 1200}, // WUXGA (native resolution of good 24" widescreen LCDs) - { "1920x1440 (4:3)", 1920, 1440}, // TXGA - { "2048x1152 (16:9)", 2048, 1152}, // QWXGA (native resolution of 23" ultra-widescreen LCDs) - { "2048x1536 (4:3)", 2048, 1536}, // QXGA //too much width will disable water warping (>1280) (but at that resolution, it's almost unnoticable) - { "2304x1440 (16:10)", 2304, 1440}, // (unnamed; maximum resolution of the Sony GDM-FW900 and Hewlett Packard A7217A) - { "2560x1600 (16:10)", 2560, 1600}, // WQXGA (maximum resolution of 30" widescreen LCDs, Dell for example) - { "2560x2048 (5:4)", 2560, 2048} // QSXGA + { "320x200\n16:10", 320, 200}, // CGA, MCGA + { "320x240\n4:3", 320, 240}, // QVGA + { "400x300\n4:3", 400, 300}, // Quarter SVGA + { "512x384\n4:3", 512, 384}, // Mac LC + { "640x400\n16:10", 640, 400}, // Atari ST mono, Amiga OCS NTSC Hires interlace + { "640x480\n4:3", 640, 480}, // VGA, MCGA + { "800x600\n4:3", 800, 600}, // SVGA + { "856x480\n16:9", 856, 480}, // WVGA + { "960x720\n4:3", 960, 720}, // unnamed + { "1024x576\n16:9", 1024, 576}, // WSVGA + { "1024x640\n16:10", 1024, 640}, // unnamed + { "1024x768\n4:3", 1024, 768}, // XGA + { "1152x720\n16:10", 1152, 720}, // XGA+ + { "1152x864\n4:3", 1152, 864}, // XGA+ + { "1280x720\n16:9", 1280, 720}, // WXGA min. + { "1280x800\n16:10", 1280, 800}, // WXGA avg native resolution of 17" widescreen LCDs + { "1280x960\n4:3", 1280, 960}, //SXGA- + { "1280x1024\n5:4", 1280, 1024}, // SXGA native resolution of 17-19" LCDs + { "1366x768\n16:9", 1366, 768}, // WXGA + { "1400x1050\n4:3", 1400, 1050}, // SXGA+ + { "1440x900\n16:10", 1440, 900}, // WXGA+ native resolution of 19" widescreen LCDs + { "1440x1080\n4:3", 1440, 1080}, // unnamed + { "1600x900\n16:9", 1600, 900}, // 900p + { "1600x1200\n4:3", 1600, 1200}, // UXGA native resolution of 20"+ LCDs //sw height is bound to 200 to 1024 + { "1680x1050\n16:10", 1680, 1050}, // WSXGA+ native resolution of 22" widescreen LCDs + { "1792x1344\n4:3", 1792, 1344}, // unnamed + { "1800x1440\n5:4", 1800, 1440}, // unnamed + { "1856x1392\n4:3", 1856, 1392}, //unnamed + { "1920x1080\n16:9", 1920, 1080}, // 1080p native resolution of cheap 24" LCDs, which really are 23.6" + { "1920x1200\n16:10", 1920, 1200}, // WUXGA native resolution of good 24" widescreen LCDs + { "1920x1440\n4:3", 1920, 1440}, // TXGA + { "2048x1152\n16:9", 2048, 1152}, // QWXGA native resolution of 23" ultra-widescreen LCDs + { "2048x1536\n4:3", 2048, 1536}, // QXGA //too much width will disable water warping >1280 but at that resolution, it's almost unnoticable + { "2304x1440\n16:10", 2304, 1440}, // unnamed; maximum resolution of the Sony GDM-FW900 and Hewlett Packard A7217A + { "2560x1600\n16:10", 2560, 1600}, // WQXGA maximum resolution of 30" widescreen LCDs, Dell for example + { "2560x2048\n5:4", 2560, 2048} // QSXGA }; #define NUMVIDMODES sizeof(vid_modes)/sizeof(vid_modes[0]) @@ -1233,8 +1234,15 @@ void M_Menu_Video_f (void) int currentbpp; int currentrefreshrate; int currentvsync; - int aspectratio; - char *aspectratio2; + int aspectratio3d; + int aspectratio2d; + char *aspectratio23d; + char *aspectratio22d; + char *rendererstring; + static char current3dres[10]; // enough to fit 1920x1200 + static char current2dres[10]; // same as above + static char colordepth[6]; // enough to fit 32bit + static char currenthz[6]; // enough to fit 120hz extern cvar_t _vid_wait_override; @@ -1290,49 +1298,99 @@ void M_Menu_Video_f (void) else currentrefreshrate = 0; - aspectratio = (vid_width.value / vid_height.value * 100); // times by 100 so don't have to deal with floats + aspectratio3d = (vid_width.value / vid_height.value * 100); // times by 100 so don't have to deal with floats - if (aspectratio == 125) // 1.25 - aspectratio2 = "5:4"; - else if (aspectratio == 160) // 1.6 - aspectratio2 = "16:10"; - else if (aspectratio == 133) // 1.333333 - aspectratio2 = "4:3"; - else if (aspectratio == 177) // 1.777778 - aspectratio2 = "16:9"; + if (aspectratio3d == 125) // 1.25 + aspectratio23d = "5:4"; + else if (aspectratio3d == 160) // 1.6 + aspectratio23d = "16:10"; + else if (aspectratio3d == 133) // 1.333333 + aspectratio23d = "4:3"; + else if (aspectratio3d == 177) // 1.777778 + aspectratio23d = "16:9"; else - aspectratio2 = "Unknown Ratio"; + aspectratio23d = "Non-standard Ratio"; + + aspectratio2d = (vid_conwidth.value / vid_conheight.value * 100); // times by 100 so don't have to deal with floats + + if (aspectratio2d == 125) // 1.25 + aspectratio22d = "5:4"; + else if (aspectratio2d == 160) // 1.6 + aspectratio22d = "16:10"; + else if (aspectratio2d == 133) // 1.333333 + aspectratio22d = "4:3"; + else if (aspectratio2d == 177) // 1.777778 + aspectratio22d = "16:9"; + else + aspectratio22d = "Non-standard Ratio"; currentvsync = _vid_wait_override.value; + snprintf(current3dres, sizeof(current3dres), "%sx%s", vid_width.string, vid_height.string); + snprintf(current2dres, sizeof(current2dres), "%sx%s", vid_conwidth.string, vid_conheight.string); + snprintf(currenthz, sizeof(currenthz), "%sHz", vid_refreshrate.string); + + if ( stricmp(vid_renderer.string,"gl" ) == 0 ) + rendererstring = "OpenGL"; + else if ( stricmp(vid_renderer.string,"d3d7") == 0 ) + rendererstring = "DirectX 7"; + else if ( stricmp(vid_renderer.string,"d3d9") == 0 ) + rendererstring = "DirectX 9"; + else if ( stricmp(vid_renderer.string,"d3d") == 0) + rendererstring = "DirectX"; + else if ( stricmp(vid_renderer.string,"sw") == 0) + rendererstring = "Software"; + else + rendererstring = "Unknown Renderer?"; + + sprintf(colordepth,"%sbit", vid_bpp.string); + MC_AddCenterPicture(menu, 4, "vidmodes"); y = 32; - info->renderer = MC_AddCombo(menu, 16, y, " Renderer", rendererops, i); y+=8; - info->bppcombo = MC_AddCombo(menu, 16, y, " Color Depth", bppnames, currentbpp); y+=8; - info->refreshratecombo = MC_AddCombo(menu, 16, y, " Refresh Rate", refreshrates, currentrefreshrate); y+=8; - info->modecombo = MC_AddCombo(menu, 16, y, " Video Size", modenames, prefabmode+1); y+=8; - MC_AddWhiteText(menu, 16, y, " Current A/R", false); - MC_AddWhiteText(menu, 160, y, aspectratio2, false); y+=8; - info->conscalecombo = MC_AddCombo(menu, 16, y, " 2D Size", modenames, prefab2dmode+1); y+=8; - MC_AddCheckBox(menu, 16, y, " Fullscreen", &vid_fullscreen,0); y+=8; - y+=4;info->customwidth = MC_AddEdit(menu, 16, y, " Custom width", vid_width.string); y+=8; - y+=4;info->customheight = MC_AddEdit(menu, 16, y, " Custom height", vid_height.string); y+=12; - info->vsynccombo = MC_AddCombo(menu, 16, y, " VSync", vsyncoptions, currentvsync); y+=8; - //MC_AddCheckBox(menu, 16, y, " Override VSync", &_vid_wait_override,0); y+=8; + + MC_AddRedText(menu, 0, y, " Current Renderer", false); + MC_AddRedText(menu, 180, y, rendererstring, false); y+=8; + MC_AddRedText(menu, 0, y, " Current Color Depth", false); + MC_AddRedText(menu, 180, y, colordepth, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 3D Res", false); + MC_AddRedText(menu, 180, y, current3dres, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 3D A/R", false); + MC_AddRedText(menu, 180, y, aspectratio23d, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 2D Res", false); + MC_AddRedText(menu, 180, y, current2dres, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 2D A/R", false); + MC_AddRedText(menu, 180, y, aspectratio22d, false); y+=8; + MC_AddRedText(menu, 0, y, "Current Refresh Rate", false); + MC_AddRedText(menu, 180, y, currenthz, false); y+=8; + MC_AddRedText(menu, 0, y, "---------------------------------------------", false); y+=8; y+=8; - MC_AddCommand(menu, 16, y, " Apply", M_VideoApply); y+=8; + info->renderer = MC_AddCombo(menu, 16, y, " Renderer", rendererops, i); y+=8; + info->bppcombo = MC_AddCombo(menu, 16, y, " Color Depth", bppnames, currentbpp); y+=8; + info->refreshratecombo = MC_AddCombo(menu, 16, y, " Refresh Rate", refreshrates, currentrefreshrate); y+=8; + info->modecombo = MC_AddCombo(menu, 16, y, " Video Size", modenames, prefabmode+1); y+=8; + MC_AddWhiteText(menu, 16, y, " 3D Aspect Ratio", false); y+=8; + info->conscalecombo = MC_AddCombo(menu, 16, y, " 2D Size", modenames, prefab2dmode+1); y+=8; + MC_AddWhiteText(menu, 16, y, " 2D Aspect Ratio", false); y+=8; + MC_AddCheckBox(menu, 16, y, " Fullscreen", &vid_fullscreen,0); y+=8; + y+=4;info->customwidth = MC_AddEdit(menu, 16, y, " Custom width", vid_width.string); y+=8; + y+=4;info->customheight = MC_AddEdit(menu, 16, y, " Custom height", vid_height.string); y+=12; + info->vsynccombo = MC_AddCombo(menu, 16, y, " VSync", vsyncoptions, currentvsync); y+=8; + //MC_AddCheckBox(menu, 16, y, " Override VSync", &_vid_wait_override,0); y+=8; y+=8; - MC_AddSlider(menu, 16, y, " Screen size", &scr_viewsize, 30, 120, 1);y+=8; - MC_AddSlider(menu, 16, y, " Gamma", &v_gamma, 0.3, 1, 0.05); y+=8; - MC_AddCheckBox(menu, 16, y, " Desktop Gamma", &vid_desktopgamma,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Hardware Gamma", &vid_hardwaregamma,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Preserve Gamma", &vid_preservegamma,0); y+=8; - MC_AddSlider(menu, 16, y, " Contrast", &v_contrast, 1, 3, 0.05); y+=8; + MC_AddCommand(menu, 16, y, "= Apply Changes =", M_VideoApply); y+=8; y+=8; - MC_AddCheckBox(menu, 16, y, " Stretching", &vid_stretch,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Allow ModeX", &vid_allow_modex,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Windowed Mouse", &_windowed_mouse,0); y+=8; + MC_AddSlider(menu, 16, y, " Screen size", &scr_viewsize, 30, 120, 1);y+=8; + MC_AddSlider(menu, 16, y, "Console Autoscale",&vid_conautoscale, 0, 6, 0.25); y+=8; + MC_AddSlider(menu, 16, y, " Gamma", &v_gamma, 0.3, 1, 0.05); y+=8; + MC_AddCheckBox(menu, 16, y, " Desktop Gamma", &vid_desktopgamma,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Hardware Gamma", &vid_hardwaregamma,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Preserve Gamma", &vid_preservegamma,0); y+=8; + MC_AddSlider(menu, 16, y, " Contrast", &v_contrast, 1, 3, 0.05); y+=8; + y+=8; + MC_AddCheckBox(menu, 16, y, " Stretching", &vid_stretch,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Allow ModeX", &vid_allow_modex,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Windowed Mouse", &_windowed_mouse,0); y+=8; menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 152, 32, NULL, false); menu->selecteditem = (union menuoption_s *)info->renderer; From 923c57717226ff0ac0aef1f23884750a359547c4 Mon Sep 17 00:00:00 2001 From: Lance Date: Fri, 15 Jan 2010 13:23:08 +0000 Subject: [PATCH 57/76] Teamplay item name section split up into individual sections, still ugly but functional git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3496 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_options.c | 388 +++++++++++++++++++++++++++++++------- engine/client/menu.c | 18 ++ 2 files changed, 333 insertions(+), 73 deletions(-) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 0dcb8c105..0ed035353 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -582,7 +582,6 @@ void M_Menu_3D_f (void) threeDmenuinfo_t *info; menu_t *menu; int mgt; - int i, len; int currentmsaalevel; #ifdef RGLQUAKE #endif @@ -797,7 +796,6 @@ void M_Menu_Textures_f (void) texturemenuinfo_t *info; menu_t *menu; int mgt; - int i, len; int currenttexturefilter; int currentanisotropylevel; int currentmaxtexturesize; @@ -935,7 +933,6 @@ void M_Menu_Shadow_Lighting_f (void) int y = 32; menu_t *menu; int mgt; - int i, len; #ifdef RGLQUAKE #endif extern cvar_t r_noaliasshadows, r_shadows, r_shadow_realtime_world, r_loadlits, gl_maxshadowlights, r_lightmap_saturation, r_dynamic, r_vertexlight, r_vertexdlights, r_lightstylesmooth, r_lightstylespeed, r_nolightdir, r_shadow_realtime_world_lightmaps, r_shadow_glsl_offsetmapping, r_shadow_glsl_offsetmapping_bias, r_shadow_glsl_offsetmapping_scale, r_shadow_bumpscale_basetexture, r_shadow_bumpscale_bumpmap, r_fb_bmodels, r_fb_models, gl_overbright, r_rocketlight, r_powerupglow, v_powerupshell, r_lightflicker, r_explosionlight; @@ -1040,7 +1037,6 @@ void M_Menu_Teamplay_f (void) teamplaymenuinfo_t *info; menu_t *menu; int mgt; - int i, len; int currentnoskins; extern cvar_t cl_parseSay, cl_triggers, tp_forceTriggers, tp_loadlocs, cl_parseFunChars, cl_noblink, noskins; @@ -1099,7 +1095,6 @@ void M_Menu_Teamplay_Locations_f (void) int y = 32; menu_t *menu; int mgt; - int i, len; extern cvar_t ; key_dest = key_menu; @@ -1125,27 +1120,28 @@ void M_Menu_Teamplay_Locations_f (void) //menu->selecteditem = (union menuoption_s *) - MC_AddWhiteText(menu, 16, y, "Teamplay Location Names", false); y+=8; + MC_AddRedText(menu, 16, y, " Teamplay Location Names", false); y+=8; + MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor ", "loc_name_ga"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, "Grenade Launcher", "loc_name_gl"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Lightning Gun", "loc_name_lg"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Nailgun", "loc_name_ng"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Pentagram", "loc_name_pent"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Quad", "loc_name_quad"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "loc_name_ra"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Ring", "loc_name_ring"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rocket Launcher", "loc_name_rl"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Seperator", "loc_name_seperator"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Super Nailgun", "loc_name_sng"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Super Shotgun", "loc_name_ssg"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Suit", "loc_name_suit"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "loc_name_ya"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor ", "loc_name_ga"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Grenade Launcher", "loc_name_gl"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Lightning Gun", "loc_name_lg"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Nailgun", "loc_name_ng"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Pentagram", "loc_name_pent"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Quad", "loc_name_quad"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "loc_name_ra"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Ring", "loc_name_ring"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rocket Launcher", "loc_name_rl"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Seperator", "loc_name_seperator"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Super Nailgun", "loc_name_sng"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Super Shotgun", "loc_name_ssg"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Suit", "loc_name_suit"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "loc_name_ya"); y+=8+4; y+=8; MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 232, 32, NULL, false); } void M_Menu_Teamplay_Needs_f (void) @@ -1153,7 +1149,6 @@ void M_Menu_Teamplay_Needs_f (void) int y = 32; menu_t *menu; int mgt; - int i, len; extern cvar_t ; key_dest = key_menu; @@ -1179,18 +1174,19 @@ void M_Menu_Teamplay_Needs_f (void) //menu->selecteditem = (union menuoption_s *) - MC_AddWhiteText(menu, 16, y, "Teamplay Needed Items", false); y+=8; + MC_AddRedText(menu, 16, y, " Teamplay Needed Items", false); y+=8; + MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Cells", "tp_need_cells"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor", "tp_need_ga"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Health", "tp_need_health"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Nails", "tp_need_nails"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "tp_need_ra"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, "Rocket Launcher", "tp_need_rl"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rockets", "tp_need_rockets"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Shells", "tp_need_shells"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Weapon", "tp_need_weapon"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "tp_need_ya"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Cells", "tp_need_cells"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor", "tp_need_ga"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Health", "tp_need_health"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Nails", "tp_need_nails"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "tp_need_ra"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rocket Launcher", "tp_need_rl"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rockets", "tp_need_rockets"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Shells", "tp_need_shells"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Weapon", "tp_need_weapon"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "tp_need_ya"); y+=8+4; y+=8; MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; @@ -1203,7 +1199,6 @@ void M_Menu_Teamplay_Items_f (void) int y = 32; menu_t *menu; int mgt; - int i, len; extern cvar_t ; key_dest = key_menu; @@ -1229,59 +1224,306 @@ void M_Menu_Teamplay_Items_f (void) //menu->selecteditem = (union menuoption_s *) - MC_AddWhiteText(menu, 16, y, "Teamplay Item Names", false); y+=8; + MC_AddRedText(menu, 16, y, " Teamplay Item Names", false); y+=8; + MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; + + MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Armor Names", "menu_teamplay_armor\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Weapon Names", "menu_teamplay_weapons\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Powerup Names", "menu_teamplay_powerups\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Ammo & Health Names", "menu_teamplay_ammo_health\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Team Fortress Item Names", "menu_teamplay_team_fortress\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Status, Location & Misc Names", "menu_teamplay_status_location_misc\n"); y+=8; + + y+=8; + MC_AddConsoleCommand(menu, 16, y, " <- Teamplay Options", "menu_teamplay\n"); y+=8; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 64, 32, NULL, false); +} + +void M_Menu_Teamplay_Items_Armor_f (void) +{ + int y = 32; + menu_t *menu; + int mgt; + extern cvar_t ; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(0); + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + //menu->selecteditem = (union menuoption_s *) + + MC_AddRedText(menu, 16, y, " Teamplay Armor Names", false); y+=8; + MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; + + y+=4;MC_AddEditCvar(menu, 16, y, " Armor", "tp_name_armor"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Green", "tp_name_armortype_ga"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Red", "tp_name_armortype_ra"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Yellow", "tp_name_armortype_ya"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor", "tp_name_ga"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "tp_name_ra"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "tp_name_ya"); y+=8+4; + + y+=8; + MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 232, 32, NULL, false); +} + +void M_Menu_Teamplay_Items_Weapons_f (void) +{ + int y = 32; + menu_t *menu; + int mgt; + extern cvar_t ; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(0); + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + //menu->selecteditem = (union menuoption_s *) + + MC_AddRedText(menu, 16, y, " Teamplay Weapon Names", false); y+=8; + MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; + + y+=4;MC_AddEditCvar(menu, 16, y, " Axe", "tp_name_axe"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Grenade Launcher", "tp_name_gl"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Lightning Gun", "tp_name_lg"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Nailgun", "tp_name_ng"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rocket Launcher", "tp_name_rl"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Shotgun", "tp_name_sg"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Super Nailgun", "tp_name_sng"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Super Shotgun", "tp_name_ssg"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Weapon", "tp_name_weapon"); y+=8+4; + + y+=8; + MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); +} + +void M_Menu_Teamplay_Items_Powerups_f (void) +{ + int y = 32; + menu_t *menu; + int mgt; + extern cvar_t ; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(0); + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + //menu->selecteditem = (union menuoption_s *) + + MC_AddRedText(menu, 16, y, " Teamplay Powerup Names", false); y+=8; + MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; + + y+=4;MC_AddEditCvar(menu, 16, y, " Pentagram", "tp_name_pent"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Pented", "tp_name_pented"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Quad", "tp_name_quad"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Quaded", "tp_name_quaded"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Ring", "tp_name_ring"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Eyes (Ring)", "tp_name_eyes"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Resistance Rune", "tp_name_rune_1"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Strength Rune", "tp_name_rune_2"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Haste Rune", "tp_name_rune_3"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Regeneration Rune", "tp_name_rune_4"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Suit", "tp_name_suit"); y+=8+4; + + y+=8; + MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); +} + +void M_Menu_Teamplay_Items_Ammo_Health_f (void) +{ + int y = 32; + menu_t *menu; + int mgt; + extern cvar_t ; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(0); + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + //menu->selecteditem = (union menuoption_s *) + + MC_AddRedText(menu, 16, y, " Teamplay Ammo & Health Names", false); y+=8; + MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Armor", "tp_name_armor"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Green", "tp_name_armortype_ga"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Red", "tp_name_armortype_ra"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, "Armor Type - Yellow", "tp_name_armortype_ya"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " AT?", "tp_name_at"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Axe", "tp_name_axe"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Backpack", "tp_name_backpack"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Cells", "tp_name_cells"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Dispenser", "tp_name_disp"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Enemy", "tp_name_enemy"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Eyes", "tp_name_eyes"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Flag", "tp_name_flag"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor", "tp_name_ga"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Grenade Launcher", "tp_name_gl"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Health", "tp_name_health"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Lightning Gun", "tp_name_lg"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Mega Health", "tp_name_mh"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Nails", "tp_name_nails"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Nailgun", "tp_name_ng"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Rockets", "tp_name_rockets"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Shells", "tp_name_shells"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Health", "tp_name_health"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Mega Health", "tp_name_mh"); y+=8+4; + + y+=8; + MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); +} + +void M_Menu_Teamplay_Items_Team_Fortress_f (void) +{ + int y = 32; + menu_t *menu; + int mgt; + extern cvar_t ; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(0); + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + //menu->selecteditem = (union menuoption_s *) + + MC_AddRedText(menu, 16, y, " Teamplay Team Fortress Item Names", false); y+=8; + MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; + + y+=4;MC_AddEditCvar(menu, 16, y, " Sentry Gun", "tp_name_sentry"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Dispenser", "tp_name_disp"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Flag", "tp_name_flag"); y+=8+4; + + y+=8; + MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); +} + +void M_Menu_Teamplay_Items_Status_Location_Misc_f (void) +{ + int y = 32; + menu_t *menu; + int mgt; + extern cvar_t ; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(0); + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 32; + } + else if (mgt == MGT_HEXEN2) + { + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + //menu->selecteditem = (union menuoption_s *) + + MC_AddRedText(menu, 16, y, " Teamplay Status, Location & Misc. Names", false); y+=8; + MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; + + y+=4;MC_AddEditCvar(menu, 16, y, " At (Location)", "tp_name_at"); y+=8+4; + y+=4;MC_AddEditCvar(menu, 16, y, " Enemy", "tp_name_enemy"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " None", "tp_name_none"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Nothing", "tp_name_nothing"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Pentagram", "tp_name_pent"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Pented", "tp_name_pented"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Quad", "tp_name_quad"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Quaded", "tp_name_quaded"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "tp_name_ra"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Ring", "tp_name_ring"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rocket Launcher", "tp_name_rl"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rockets", "tp_name_rockets"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rune 1", "tp_name_rune_1"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rune 2", "tp_name_rune_2"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rune 3", "tp_name_rune_3"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rune 4", "tp_name_rune_4"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Sentry Gun", "tp_name_sentry"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Seperator", "tp_name_seperator"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Shotgun", "tp_name_sg"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Shells", "tp_name_shells"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Super Nailgun", "tp_name_sng"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Someplace", "tp_name_someplace"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Super Shotgun", "tp_name_ssg"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Status Blue", "tp_name_status_blue"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Status Green", "tp_name_status_green"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Status Red", "tp_name_status_red"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Status Yellow", "tp_name_status_yellow"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Suit", "tp_name_suit"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Teammate", "tp_name_teammate"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Weapon", "tp_name_weapon"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "tp_name_ya"); y+=8+4; y+=8; - MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); -} +} \ No newline at end of file diff --git a/engine/client/menu.c b/engine/client/menu.c index 2bef3a131..790b2c70d 100644 --- a/engine/client/menu.c +++ b/engine/client/menu.c @@ -893,6 +893,12 @@ void M_Menu_Teamplay_f (void); void M_Menu_Teamplay_Locations_f (void); void M_Menu_Teamplay_Needs_f (void); void M_Menu_Teamplay_Items_f (void); +void M_Menu_Teamplay_Items_Armor_f (void); +void M_Menu_Teamplay_Items_Weapons_f (void); +void M_Menu_Teamplay_Items_Powerups_f (void); +void M_Menu_Teamplay_Items_Ammo_Health_f (void); +void M_Menu_Teamplay_Items_Team_Fortress_f (void); +void M_Menu_Teamplay_Items_Status_Location_Misc_f (void); void M_Menu_Particles_f (void); void M_Menu_ParticleSets_f (void); void M_Menu_Audio_Speakers_f (void); @@ -948,6 +954,12 @@ void M_Init_Internal (void) Cmd_AddRemCommand ("menu_teamplay_locations", M_Menu_Teamplay_Locations_f); Cmd_AddRemCommand ("menu_teamplay_needs", M_Menu_Teamplay_Needs_f); Cmd_AddRemCommand ("menu_teamplay_items", M_Menu_Teamplay_Items_f); + Cmd_AddRemCommand ("menu_teamplay_armor", M_Menu_Teamplay_Items_Armor_f); + Cmd_AddRemCommand ("menu_teamplay_weapons", M_Menu_Teamplay_Items_Weapons_f); + Cmd_AddRemCommand ("menu_teamplay_powerups", M_Menu_Teamplay_Items_Powerups_f); + Cmd_AddRemCommand ("menu_teamplay_ammo_health", M_Menu_Teamplay_Items_Ammo_Health_f); + Cmd_AddRemCommand ("menu_teamplay_team_fortress", M_Menu_Teamplay_Items_Team_Fortress_f); + Cmd_AddRemCommand ("menu_teamplay_status_location_misc", M_Menu_Teamplay_Items_Status_Location_Misc_f); Cmd_AddRemCommand ("menu_particles", M_Menu_Particles_f); Cmd_AddRemCommand ("menu_particlesets", M_Menu_ParticleSets_f); @@ -998,6 +1010,12 @@ void M_DeInit_Internal (void) Cmd_RemoveCommand ("menu_teamplay_locations"); Cmd_RemoveCommand ("menu_teamplay_needs"); Cmd_RemoveCommand ("menu_teamplay_items"); + Cmd_RemoveCommand ("menu_teamplay_armor"); + Cmd_RemoveCommand ("menu_teamplay_weapons"); + Cmd_RemoveCommand ("menu_teamplay_powerups"); + Cmd_RemoveCommand ("menu_teamplay_ammo_health"); + Cmd_RemoveCommand ("menu_teamplay_team_fortress"); + Cmd_RemoveCommand ("menu_teamplay_status_location_misc"); Cmd_RemoveCommand ("menu_fps"); Cmd_RemoveCommand ("menu_3d"); Cmd_RemoveCommand ("menu_shadow_lighting"); From 22a3c2bc6df1f65ef086b5170302948bf27e02ad Mon Sep 17 00:00:00 2001 From: Lance Date: Sat, 16 Jan 2010 04:59:13 +0000 Subject: [PATCH 58/76] Menu code commit, Hexen 2 menus supported better (even includes sound in the menus now), menus are now mostly aligned and not underneath pictures anymore, Quake2 menus looking abit too git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3497 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_items.c | 41 ++++- engine/client/m_options.c | 361 +++++++++++++++++++++++++++----------- engine/client/menu.c | 39 +++- 3 files changed, 325 insertions(+), 116 deletions(-) diff --git a/engine/client/m_items.c b/engine/client/m_items.c index 8cdc8e42f..4c4c92db3 100644 --- a/engine/client/m_items.c +++ b/engine/client/m_items.c @@ -290,6 +290,11 @@ void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu) { int i; mpic_t *p; + + int mgt; + + mgt = M_GameType(); + while (option) { if (mousemoved && !bindingactive) @@ -300,7 +305,11 @@ void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu) if (menu->selecteditem != option) { if (!option->common.noselectionsound) - S_LocalSound ("misc/menu1.wav"); + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu1.wav"); + else + S_LocalSound ("misc/menu1.wav"); + menu->selecteditem = option; menu->tooltiptime = realtime + 1; MenuTooltipSplit(menu, menu->selecteditem->common.tooltip); @@ -1512,6 +1521,9 @@ menuoption_t *M_PrevSelectableItem(menu_t *m, menuoption_t *old) void M_Complex_Key(int key) { + int mgt; + mgt = M_GameType(); + if (!currentmenu) return; //erm... @@ -1528,7 +1540,10 @@ void M_Complex_Key(int key) { if (bindingactive) { - S_LocalSound ("misc/menu1.wav"); + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu1.wav"); + else + S_LocalSound ("misc/menu1.wav"); if (key != K_ESCAPE && key != '`') { @@ -1545,7 +1560,10 @@ void M_Complex_Key(int key) case K_ESCAPE: //remove M_RemoveMenu(currentmenu); - S_LocalSound ("misc/menu3.wav"); + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu3.wav"); + else + S_LocalSound ("misc/menu3.wav"); break; case K_TAB: case K_DOWNARROW: @@ -1553,7 +1571,11 @@ void M_Complex_Key(int key) if (currentmenu->selecteditem) { - S_LocalSound ("misc/menu1.wav"); + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu1.wav"); + else + S_LocalSound ("misc/menu1.wav"); + if (currentmenu->cursoritem) currentmenu->cursoritem->common.posy = currentmenu->selecteditem->common.posy; } @@ -1563,7 +1585,11 @@ void M_Complex_Key(int key) if (currentmenu->selecteditem) { - S_LocalSound ("misc/menu1.wav"); + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu1.wav"); + else + S_LocalSound ("misc/menu1.wav"); + if (currentmenu->cursoritem) currentmenu->cursoritem->common.posy = currentmenu->selecteditem->common.posy; } @@ -1591,7 +1617,10 @@ void M_Complex_Key(int key) else if (key == K_ENTER || key == K_MOUSE1) { Cbuf_AddText(currentmenu->selecteditem->button.command, RESTRICT_LOCAL); - S_LocalSound ("misc/menu2.wav"); + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu2.wav"); + else + S_LocalSound ("misc/menu2.wav"); } break; case mt_custom: diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 0ed035353..b1ecc94af 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -235,6 +235,7 @@ void M_Menu_Audio_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t nosound, precache, snd_leftisright, snd_khz, snd_eax, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices, snd_noextraupdate, snd_show, bgmbuffer; static const char *soundqualityoptions[] = { @@ -277,10 +278,13 @@ void M_Menu_Audio_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title3.lmp"); + y += 25+8; } else { @@ -288,8 +292,14 @@ void M_Menu_Audio_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + menu->selecteditem = (union menuoption_s *) + MC_AddRedText(menu, 16, y, " Sound Options", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; + MC_AddSlider(menu, 16, y, " CD Music Volume", &bgmvolume, 0, 1, 0.1);y+=8; MC_AddSlider(menu, 16, y, " CD Music Buffer", &bgmbuffer, 0, 10240, 1024);y+=8; MC_AddSlider(menu, 16, y, " Sound Volume", &volume, 0, 1, 0.1);y+=8; @@ -299,20 +309,20 @@ void M_Menu_Audio_f (void) MC_AddCheckBox(menu, 16, y, " No Sound", &nosound,0);y+=8; MC_AddCheckBox(menu, 16, y, " Static Sounds", &cl_staticsounds,0);y+=8; MC_AddCheckBox(menu, 16, y, " Precache", &precache,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Low Quality Sound (8bit)", &loadas8bit,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Flip Sound", &snd_leftisright,0);y+=8; - MC_AddCheckBox(menu, 16, y, "Play Sound While Inactive", &snd_inactive,0);y+=8; MC_AddCheckBox(menu, 16, y, " Experimental EAX 2", &snd_eax,0);y+=8; MC_AddCvarCombo(menu, 16, y, " Speaker Setup", &snd_speakers, speakeroptions, speakervalues);y+=8; MC_AddCvarCombo(menu, 16, y, " Sound Speed", &snd_khz, soundqualityoptions, soundqualityvalues);y+=8; MC_AddSlider(menu, 16, y, " Sound Mixahead", &_snd_mixahead,0,1,0.05);y+=8; MC_AddCheckBox(menu, 16, y, " Multiple Devices", &snd_usemultipledevices,0);y+=8; MC_AddCheckBox(menu, 16, y, " No Extra Sound Update", &snd_noextraupdate,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Low Quality Sound (8bit)", &loadas8bit,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Flip Sound", &snd_leftisright,0);y+=8; + MC_AddCheckBox(menu, 16, y, "Play Sound While Inactive", &snd_inactive,0);y+=8; //MC_AddCombo(menu, 16, y, " Show Sounds Playing", &snd_show,0);y+=8; y+=8; MC_AddConsoleCommand(menu, 16, y, " = Restart Sound =", "snd_restart\n");y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 225, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 225, cursorpositionY, NULL, false); } #else @@ -329,6 +339,7 @@ void M_Menu_Particles_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t r_bouncysparks, r_part_rain, gl_part_flame, r_particlesystem, r_grenadetrail, r_rockettrail, r_part_sparks_textured, r_part_sparks_trifan, r_part_rain_quantity, r_part_beams, r_part_beams_textured, r_particle_tracelimit; char *psystemopts[] = @@ -354,10 +365,13 @@ void M_Menu_Particles_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title6.lmp"); + y += 25+8; } else { @@ -365,8 +379,14 @@ void M_Menu_Particles_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + menu->selecteditem = (union menuoption_s *) + MC_AddRedText(menu, 16, y, " Particle Options", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; + MC_AddCvarCombo(menu, 16, y, " particle system", &r_particlesystem, psystemopts, psystemvals);y+=8; //fixme: hide the rest of the options if r_particlesystem==classic MC_AddConsoleCommand(menu, 16, y, " Choose particle set", "menu_particlesets");y+=8; @@ -380,11 +400,11 @@ void M_Menu_Particles_f (void) MC_AddCheckBox(menu, 16, y, " Rain", &r_part_rain,0); y+=8; MC_AddSlider(menu, 16, y, " Rain Quantity", &r_part_rain_quantity,0,10,1); y+=8; MC_AddCheckBox(menu, 16, y, " Torch Flame", &gl_part_flame,0); y+=8; + MC_AddSlider(menu, 16, y, " Particle Tracelimit", &r_particle_tracelimit,0,2000,50); y+=8; MC_AddCheckBox(menu, 16, y, " Particle Beams", &r_part_beams,0); y+=8; MC_AddCheckBox(menu, 16, y, "Textured Particle Beams", &r_part_beams_textured,0); y+=8; - MC_AddSlider(menu, 16, y, " Particle Tracelimit", &r_particle_tracelimit,0,2000,50); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); } enum { @@ -466,6 +486,7 @@ void M_Menu_FPS_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; int i, len; extern cvar_t v_contentblend, show_fps, cl_r2g, cl_gibfilter, cl_expsprite, cl_deadbodyfilter; @@ -480,10 +501,13 @@ void M_Menu_FPS_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title3.lmp"); + y += 25+8; } else { @@ -491,25 +515,29 @@ void M_Menu_FPS_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + menu->selecteditem = (union menuoption_s *) - MC_AddConsoleCommand(menu, 16, y, " Particle Options", "menu_particles\n"); y+=8; + MC_AddRedText(menu, 16, y, " FPS Options", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; for (i = 0; i < PRESET_MAX; i++) { len = strlen(preset[0].value[i]); - MC_AddConsoleCommand(menu, 100+8*(9-len), y, va("(preset) %s", preset[0].value[i]), va("fps_preset %s\n", preset[0].value[i])); y+=8; + MC_AddConsoleCommand(menu, 116, y, va("(preset) %s", preset[0].value[i]), va("fps_preset %s\n", preset[0].value[i])); y+=8; } - MC_AddCheckBox(menu, 16, y, " Show FPS", &show_fps,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Show FPS", &show_fps,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Content blend", &v_contentblend,0);y+=8; - MC_AddCheckBox(menu, 16, y, "Rockets to Grenades", &cl_r2g,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Gib Filter", &cl_gibfilter,0); y+=8; - MC_AddSlider(menu, 16, y, " Dead Body Filter", &cl_deadbodyfilter,0,2,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Explosion Sprite", &cl_expsprite,0); y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Skybox", "r_skybox");y+=8;y+=4; + MC_AddCheckBox(menu, 16, y, " Content blend", &v_contentblend,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Gib Filter", &cl_gibfilter,0); y+=8; + MC_AddSlider(menu, 16, y, " Dead Body Filter", &cl_deadbodyfilter,0,2,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Explosion Sprite", &cl_expsprite,0); y+=8; + y+=4;MC_AddEditCvar(menu, 16, y, " Skybox", "r_skybox");y+=8;y+=4; + MC_AddCheckBox(menu, 16, y, " Rockets to Grenades", &cl_r2g,0); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 250, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 188, cursorpositionY, NULL, false); } //copy and pasted from renderer.c @@ -539,7 +567,7 @@ qboolean M_VideoApply3D (union menuoption_s *op,struct menu_s *menu,int key) if (key != K_ENTER) return false; - /*switch(info->multisamplingcombo->selectedoption) + switch(info->multisamplingcombo->selectedoption) { case 0: Cbuf_AddText("vid_multisample 0\n", RESTRICT_LOCAL); @@ -556,7 +584,7 @@ qboolean M_VideoApply3D (union menuoption_s *op,struct menu_s *menu,int key) case 4: Cbuf_AddText("vid_multisample 8\n", RESTRICT_LOCAL); break; - }*/ + } Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); @@ -568,7 +596,7 @@ qboolean M_VideoApply3D (union menuoption_s *op,struct menu_s *menu,int key) void M_Menu_3D_f (void) { static const char *msaalevels[] = - { + { "Off", "2x", "4x", @@ -582,10 +610,12 @@ void M_Menu_3D_f (void) threeDmenuinfo_t *info; menu_t *menu; int mgt; - int currentmsaalevel; + int cursorpositionY; + //int currentmsaalevel; #ifdef RGLQUAKE #endif extern cvar_t r_novis, gl_dither, cl_item_bobbing, r_waterwarp, r_nolerp, r_fastsky, gl_shadeq1, gl_shadeq3, gl_nocolors, gl_lerpimages, gl_keeptjunctions, gl_lateswap, r_mirroralpha, r_wateralpha, r_drawviewmodel, r_xflip, gl_maxdist, gl_motionblur, gl_motionblurscale, gl_blend2d, gl_blendsprites, r_flashblend, gl_cshiftenabled; + //static extern cvar_t vid_multisample; key_dest = key_menu; m_state = m_complex; @@ -598,10 +628,13 @@ void M_Menu_3D_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title3.lmp"); + y += 25+8; } else { @@ -609,6 +642,8 @@ void M_Menu_3D_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + /*if (vid_multisample.value == 8) currentmsaalevel = 4; else if (vid_multisample.value == 6) @@ -624,6 +659,10 @@ void M_Menu_3D_f (void) menu->selecteditem = (union menuoption_s *) + MC_AddRedText(menu, 16, y, " 3D Renderering Options", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; + //info->multisamplingcombo = MC_AddCombo(menu, 16, y, " Multisample Anti-Aliasing", msaalevels, currentmsaalevel); y+=8; MC_AddCheckBox(menu, 16, y, " Calculate VIS", &r_novis,0); y+=8; MC_AddCheckBox(menu, 16, y, " Water Warp", &r_waterwarp,0); y+=8; @@ -631,15 +670,15 @@ void M_Menu_3D_f (void) MC_AddCheckBox(menu, 16, y, " Toggle Sky", &r_fastsky,0); y+=8; MC_AddCheckBox(menu, 16, y, " Q1 Shaders", &gl_shadeq1,0); y+=8; MC_AddCheckBox(menu, 16, y, " Q3 Shaders", &gl_shadeq3,0); y+=8; - MC_AddCheckBox(menu, 16, y, "Ignore Player Model Colors", &gl_nocolors,0); y+=8; MC_AddCheckBox(menu, 16, y, " Lerp Images", &gl_lerpimages,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Toggle Colinear Vertexes", &gl_keeptjunctions,0); y+=8; + MC_AddSlider(menu, 16, y, " Maximum Distance", &gl_maxdist,1,8192,128); y+=8; MC_AddCheckBox(menu, 16, y, " GL Swapbuffer Delay", &gl_lateswap,0); y+=8; MC_AddCheckBox(menu, 16, y, " Mirror Reflections", &r_mirroralpha,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Flip Horizontal View", &r_xflip,0); y+=8; MC_AddCheckBox(menu, 16, y, " Water Transparency", &r_wateralpha,0); y+=8; MC_AddSlider(menu, 16, y, " View Model Transparency", &r_drawviewmodel,0,1,0.1); y+=8; - MC_AddCheckBox(menu, 16, y, " Flip Horizontal View", &r_xflip,0); y+=8; - MC_AddSlider(menu, 16, y, " Maximum Distance", &gl_maxdist,1,8192,128); y+=8; + MC_AddCheckBox(menu, 16, y, "Ignore Player Model Colors", &gl_nocolors,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Toggle Colinear Vertexes", &gl_keeptjunctions,0); y+=8; MC_AddSlider(menu, 16, y, " Motion Blur", &gl_motionblur,0,1,0.5); y+=8; MC_AddSlider(menu, 16, y, " Motion Blur Scale", &gl_motionblurscale,0,1,0.5); y+=8; MC_AddCheckBox(menu, 16, y, " 2D Blending", &gl_blend2d,0); y+=8; @@ -652,7 +691,7 @@ void M_Menu_3D_f (void) MC_AddCommand(menu, 16, y, " Apply", M_VideoApply3D); y+=8; //menu->selecteditem = (union menuoption_s *)info->multisamplingcombo; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 225, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 225, cursorpositionY, NULL, false); } typedef struct { @@ -796,6 +835,7 @@ void M_Menu_Textures_f (void) texturemenuinfo_t *info; menu_t *menu; int mgt; + int cursorpositionY; int currenttexturefilter; int currentanisotropylevel; int currentmaxtexturesize; @@ -812,10 +852,13 @@ void M_Menu_Textures_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title3.lmp"); + y += 25+8; } else { @@ -823,6 +866,8 @@ void M_Menu_Textures_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + if (!Q_strcasecmp(gl_texturemode.string, "gl_nearest_mipmap_nearest")) currenttexturefilter = 0; else if (!Q_strcasecmp(gl_texturemode.string, "gl_linear_mipmap_linear")) @@ -877,6 +922,10 @@ void M_Menu_Textures_f (void) currentmaxtexturesize = 0; + MC_AddRedText(menu, 16, y, " Texturing Options", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; + info->texturefiltercombo = MC_AddCombo(menu, 16, y, " Texture Filter", texturefilternames, currenttexturefilter); y+=8; info->anisotropycombo = MC_AddCombo(menu, 16, y, " Anisotropy Level", anisotropylevels, currentanisotropylevel); y+=8; MC_AddCheckBox(menu, 16, y, " 32bit Textures", &gl_load24bit,0); y+=8; @@ -908,19 +957,33 @@ void M_Menu_Textures_f (void) MC_AddCommand(menu, 16, y, " Apply", M_VideoApplyTextures); y+=8; menu->selecteditem = (union menuoption_s *)info->texturefiltercombo; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 220, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 220, cursorpositionY, NULL, false); } -/*typedef struct { -} shadowlightingmenuinfo_t;*/ +typedef struct { + menucombo_t *loadlitcombo; +} shadowlightingmenuinfo_t; qboolean M_VideoApplyShadowLighting (union menuoption_s *op,struct menu_s *menu,int key) { - //shadowlightingmenuinfo_t *info = menu->data; + shadowlightingmenuinfo_t *info = menu->data; if (key != K_ENTER) return false; + switch(info->loadlitcombo->selectedoption) + { + case 0: + Cbuf_AddText("gl_loadlit 0\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("gl_loadlit 1\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("gl_loadlit 2\n", RESTRICT_LOCAL); + break; + } + Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); M_RemoveMenu(menu); @@ -932,25 +995,40 @@ void M_Menu_Shadow_Lighting_f (void) { int y = 32; menu_t *menu; + shadowlightingmenuinfo_t *info; int mgt; + int cursorpositionY; + int currentloadlit; #ifdef RGLQUAKE #endif extern cvar_t r_noaliasshadows, r_shadows, r_shadow_realtime_world, r_loadlits, gl_maxshadowlights, r_lightmap_saturation, r_dynamic, r_vertexlight, r_vertexdlights, r_lightstylesmooth, r_lightstylespeed, r_nolightdir, r_shadow_realtime_world_lightmaps, r_shadow_glsl_offsetmapping, r_shadow_glsl_offsetmapping_bias, r_shadow_glsl_offsetmapping_scale, r_shadow_bumpscale_basetexture, r_shadow_bumpscale_bumpmap, r_fb_bmodels, r_fb_models, gl_overbright, r_rocketlight, r_powerupglow, v_powerupshell, r_lightflicker, r_explosionlight; + static const char *loadlitoptions[] = + { + "Off", + "On", + "On (Regenerate Lighting)", + NULL + }; + key_dest = key_menu; m_state = m_complex; - menu = M_CreateMenu(0); + menu = M_CreateMenu(sizeof(shadowlightingmenuinfo_t)); + info = menu->data; mgt = M_GameType(); if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title3.lmp"); + y += 25+8; } else { @@ -958,9 +1036,32 @@ void M_Menu_Shadow_Lighting_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + + currentloadlit = r_loadlits.value; + menu->selecteditem = (union menuoption_s *) + MC_AddRedText(menu, 16, y, " Shadow & Lighting Options", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; + //MC_AddSlider(menu, 16, y, " Light Map Mode", &gl_lightmapmode,0,2,1); y+=8; + MC_AddSlider(menu, 16, y, " Light Map Saturation", &r_lightmap_saturation,0,1,0.1); y+=8; + MC_AddCheckBox(menu, 16, y, " Dynamic Lighting", &r_dynamic,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Vertex Lighting", &r_vertexlight,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Dynamic Vertex Lights", &r_vertexdlights,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Lightstyle Smoothing", &r_lightstylesmooth,0); y+=8; + MC_AddSlider(menu, 16, y, " Lightstyle Animation Speed", &r_lightstylespeed,0,50,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Fullbright BSP Models", &r_fb_bmodels,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Fullbright Alias Models", &r_fb_models,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Overbright Bits", &gl_overbright,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Rocket Dynamic Lighting", &r_rocketlight,0); y+=8; + MC_AddSlider(menu, 16, y, " Powerup Glow", &r_powerupglow,0,2,1); y+=8; + MC_AddCheckBox(menu, 16, y, " Powerup Shell", &v_powerupshell,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Light Flickering", &r_lightflicker,0); y+=8; + MC_AddSlider(menu, 16, y, " Explosion Light", &r_explosionlight,0,1,0.1); y+=8; + MC_AddCheckBox(menu, 16, y, " Surface Direction Model Lighting", &r_nolightdir,0); y+=8; MC_AddCheckBox(menu, 16, y, " Alias Model Shadows", &r_noaliasshadows,0); y+=8; MC_AddCheckBox(menu, 16, y, " Shadows", &r_shadows,0); y+=8; MC_AddCheckBox(menu, 16, y, "Realtime World Shadows & Lighting", &r_shadow_realtime_world,0); y+=8; @@ -970,28 +1071,14 @@ void M_Menu_Shadow_Lighting_f (void) MC_AddSlider(menu, 16, y, " GLSL Shadow Offsetmapping Scale", &r_shadow_glsl_offsetmapping_scale,0,-1,0.01); y+=8; MC_AddSlider(menu, 16, y, " Shadow Bumpscale Basetexture", &r_shadow_bumpscale_basetexture,0,10,1); y+=8; MC_AddSlider(menu, 16, y, " Shadow Bumpscale Bumpmap", &r_shadow_bumpscale_bumpmap,0,50,1); y+=8; - MC_AddSlider(menu, 16, y, " LIT Loading", &r_loadlits,0,2,1); y+=8; + info->loadlitcombo = MC_AddCombo(menu,16, y, " LIT Loading", loadlitoptions, currentloadlit); y+=8; MC_AddSlider(menu, 16, y, " Maximum Shadow Lights", &gl_maxshadowlights,0,1000,2); y+=8; - //MC_AddSlider(menu, 16, y, " Light Map Mode", &gl_lightmapmode,0,2,1); y+=8; - MC_AddSlider(menu, 16, y, " Light Map Saturation", &r_lightmap_saturation,0,1,0.1); y+=8; - MC_AddCheckBox(menu, 16, y, " Dynamic Lighting", &r_dynamic,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Vertex Lighting", &r_vertexlight,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Dynamic Vertex Lights", &r_vertexdlights,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Lightstyle Smoothing", &r_lightstylesmooth,0); y+=8; - MC_AddSlider(menu, 16, y, " Lightstyle Animation Speed", &r_lightstylespeed,0,50,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Surface Direction Model Lighting", &r_nolightdir,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Fullbright BSP Models", &r_fb_bmodels,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Fullbright Alias Models", &r_fb_models,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Overbright Bits", &gl_overbright,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Rocket Dynamic Lighting", &r_rocketlight,0); y+=8; - MC_AddSlider(menu, 16, y, " Powerup Glow", &r_powerupglow,0,2,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Powerup Shell", &v_powerupshell,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Light Flickering", &r_lightflicker,0); y+=8; - MC_AddSlider(menu, 16, y, " Explosion Light", &r_explosionlight,0,1,0.1); y+=8; y+=8; MC_AddCommand(menu, 16, y, " Apply", M_VideoApplyShadowLighting); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 285, 32, NULL, false); + menu->selecteditem = (union menuoption_s *)info->loadlitcombo; + + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 285, cursorpositionY, NULL, false); } typedef struct { @@ -1027,9 +1114,9 @@ void M_Menu_Teamplay_f (void) { static const char *noskinsoptions[] = { - "Enable Skins (Do Download New Skins)", + "Enable Skins (Download)", "Disable Skins", - "Enable Skins (Don't Download New Skins)", + "Enable Skins (No Download))", NULL }; @@ -1037,6 +1124,7 @@ void M_Menu_Teamplay_f (void) teamplaymenuinfo_t *info; menu_t *menu; int mgt; + int cursorpositionY; int currentnoskins; extern cvar_t cl_parseSay, cl_triggers, tp_forceTriggers, tp_loadlocs, cl_parseFunChars, cl_noblink, noskins; @@ -1051,10 +1139,13 @@ void M_Menu_Teamplay_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; } else { @@ -1062,8 +1153,14 @@ void M_Menu_Teamplay_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + currentnoskins = noskins.value; + MC_AddRedText(menu, 16, y, " Teamplay Options", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; + info->noskinscombo = MC_AddCombo(menu, 16, y, " Skins", noskinsoptions, currentnoskins); y+=8; y+=4;MC_AddEditCvar(menu, 16, y, " Enemy Skin", "cl_enemyskin"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Team Skin", "cl_teamskin"); y+=8+4; @@ -1071,13 +1168,13 @@ void M_Menu_Teamplay_f (void) y+=4;MC_AddEditCvar(menu, 16, y, " Fake Name", "cl_fakename"); y+=8+4; MC_AddCheckBox(menu, 16, y, " Parse Fun Chars", &cl_parseFunChars,0); y+=8; MC_AddCheckBox(menu, 16, y, " Parse Macros", &cl_parseSay,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Teamplay Triggers", &cl_triggers,0); y+=8; - MC_AddCheckBox(menu, 16, y, "Force Teamplay Triggers", &tp_forceTriggers,0); y+=8; MC_AddCheckBox(menu, 16, y, " Load Locs", &tp_loadlocs,0); y+=8; MC_AddCheckBox(menu, 16, y, " No Blink", &cl_noblink,0); y+=8; y+=4;MC_AddEditCvar(menu, 16, y, " Sound Trigger", "tp_soundtrigger"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Fake Name", "cl_fakename"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Weapon Order", "tp_weapon_order"); y+=8+4; + MC_AddCheckBox(menu, 16, y, " Teamplay Triggers", &cl_triggers,0); y+=8; + MC_AddCheckBox(menu, 16, y, "Force Teamplay Triggers", &tp_forceTriggers,0); y+=8; MC_AddCommand(menu, 16, y, " Apply", M_Apply_Teamplay); y+=8; @@ -1087,7 +1184,7 @@ void M_Menu_Teamplay_f (void) MC_AddConsoleCommand(menu, 16, y, " Teamplay Item Names", "menu_teamplay_items\n"); y+=8; menu->selecteditem = (union menuoption_s *)info->noskinscombo; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); } void M_Menu_Teamplay_Locations_f (void) @@ -1095,6 +1192,7 @@ void M_Menu_Teamplay_Locations_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t ; key_dest = key_menu; @@ -1107,10 +1205,13 @@ void M_Menu_Teamplay_Locations_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; } else { @@ -1118,11 +1219,13 @@ void M_Menu_Teamplay_Locations_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + //menu->selecteditem = (union menuoption_s *) - MC_AddRedText(menu, 16, y, " Teamplay Location Names", false); y+=8; - MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - + MC_AddRedText(menu, 16, y, " Teamplay Location Names", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor ", "loc_name_ga"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Grenade Launcher", "loc_name_gl"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Lightning Gun", "loc_name_lg"); y+=8+4; @@ -1141,7 +1244,7 @@ void M_Menu_Teamplay_Locations_f (void) y+=8; MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 232, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 232, cursorpositionY, NULL, false); } void M_Menu_Teamplay_Needs_f (void) @@ -1149,6 +1252,7 @@ void M_Menu_Teamplay_Needs_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t ; key_dest = key_menu; @@ -1161,10 +1265,13 @@ void M_Menu_Teamplay_Needs_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; } else { @@ -1172,11 +1279,13 @@ void M_Menu_Teamplay_Needs_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + //menu->selecteditem = (union menuoption_s *) - MC_AddRedText(menu, 16, y, " Teamplay Needed Items", false); y+=8; - MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - + MC_AddRedText(menu, 16, y, " Teamplay Needed Items", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; y+=4;MC_AddEditCvar(menu, 16, y, " Cells", "tp_need_cells"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor", "tp_need_ga"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Health", "tp_need_health"); y+=8+4; @@ -1191,7 +1300,7 @@ void M_Menu_Teamplay_Needs_f (void) y+=8; MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); } void M_Menu_Teamplay_Items_f (void) @@ -1199,6 +1308,7 @@ void M_Menu_Teamplay_Items_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t ; key_dest = key_menu; @@ -1211,10 +1321,13 @@ void M_Menu_Teamplay_Items_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; } else { @@ -1222,11 +1335,13 @@ void M_Menu_Teamplay_Items_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + //menu->selecteditem = (union menuoption_s *) - MC_AddRedText(menu, 16, y, " Teamplay Item Names", false); y+=8; - MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - + MC_AddRedText(menu, 16, y, " Teamplay Item Names", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Armor Names", "menu_teamplay_armor\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Weapon Names", "menu_teamplay_weapons\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Powerup Names", "menu_teamplay_powerups\n"); y+=8; @@ -1237,7 +1352,7 @@ void M_Menu_Teamplay_Items_f (void) y+=8; MC_AddConsoleCommand(menu, 16, y, " <- Teamplay Options", "menu_teamplay\n"); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 64, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 64, cursorpositionY, NULL, false); } void M_Menu_Teamplay_Items_Armor_f (void) @@ -1245,6 +1360,7 @@ void M_Menu_Teamplay_Items_Armor_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t ; key_dest = key_menu; @@ -1257,10 +1373,13 @@ void M_Menu_Teamplay_Items_Armor_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; } else { @@ -1268,11 +1387,13 @@ void M_Menu_Teamplay_Items_Armor_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + //menu->selecteditem = (union menuoption_s *) - MC_AddRedText(menu, 16, y, " Teamplay Armor Names", false); y+=8; - MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - + MC_AddRedText(menu, 16, y, " Teamplay Armor Names", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; y+=4;MC_AddEditCvar(menu, 16, y, " Armor", "tp_name_armor"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Green", "tp_name_armortype_ga"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Red", "tp_name_armortype_ra"); y+=8+4; @@ -1284,7 +1405,7 @@ void M_Menu_Teamplay_Items_Armor_f (void) y+=8; MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 232, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 232, cursorpositionY, NULL, false); } void M_Menu_Teamplay_Items_Weapons_f (void) @@ -1292,6 +1413,7 @@ void M_Menu_Teamplay_Items_Weapons_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t ; key_dest = key_menu; @@ -1304,10 +1426,13 @@ void M_Menu_Teamplay_Items_Weapons_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; } else { @@ -1315,11 +1440,13 @@ void M_Menu_Teamplay_Items_Weapons_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + //menu->selecteditem = (union menuoption_s *) - MC_AddRedText(menu, 16, y, " Teamplay Weapon Names", false); y+=8; - MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - + MC_AddRedText(menu, 16, y, " Teamplay Weapon Names", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; y+=4;MC_AddEditCvar(menu, 16, y, " Axe", "tp_name_axe"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Grenade Launcher", "tp_name_gl"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Lightning Gun", "tp_name_lg"); y+=8+4; @@ -1333,7 +1460,7 @@ void M_Menu_Teamplay_Items_Weapons_f (void) y+=8; MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); } void M_Menu_Teamplay_Items_Powerups_f (void) @@ -1341,6 +1468,7 @@ void M_Menu_Teamplay_Items_Powerups_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t ; key_dest = key_menu; @@ -1353,10 +1481,13 @@ void M_Menu_Teamplay_Items_Powerups_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; } else { @@ -1364,11 +1495,13 @@ void M_Menu_Teamplay_Items_Powerups_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + //menu->selecteditem = (union menuoption_s *) - MC_AddRedText(menu, 16, y, " Teamplay Powerup Names", false); y+=8; - MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - + MC_AddRedText(menu, 16, y, " Teamplay Powerup Names", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; y+=4;MC_AddEditCvar(menu, 16, y, " Pentagram", "tp_name_pent"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Pented", "tp_name_pented"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Quad", "tp_name_quad"); y+=8+4; @@ -1384,7 +1517,7 @@ void M_Menu_Teamplay_Items_Powerups_f (void) y+=8; MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); } void M_Menu_Teamplay_Items_Ammo_Health_f (void) @@ -1392,6 +1525,7 @@ void M_Menu_Teamplay_Items_Ammo_Health_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t ; key_dest = key_menu; @@ -1404,10 +1538,13 @@ void M_Menu_Teamplay_Items_Ammo_Health_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; } else { @@ -1415,11 +1552,13 @@ void M_Menu_Teamplay_Items_Ammo_Health_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + //menu->selecteditem = (union menuoption_s *) - MC_AddRedText(menu, 16, y, " Teamplay Ammo & Health Names", false); y+=8; - MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - + MC_AddRedText(menu, 16, y, " Teamplay Ammo & Health Names", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; y+=4;MC_AddEditCvar(menu, 16, y, " Backpack", "tp_name_backpack"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Cells", "tp_name_cells"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Nails", "tp_name_nails"); y+=8+4; @@ -1431,7 +1570,7 @@ void M_Menu_Teamplay_Items_Ammo_Health_f (void) y+=8; MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); } void M_Menu_Teamplay_Items_Team_Fortress_f (void) @@ -1439,6 +1578,7 @@ void M_Menu_Teamplay_Items_Team_Fortress_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t ; key_dest = key_menu; @@ -1451,10 +1591,13 @@ void M_Menu_Teamplay_Items_Team_Fortress_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; } else { @@ -1462,11 +1605,13 @@ void M_Menu_Teamplay_Items_Team_Fortress_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + //menu->selecteditem = (union menuoption_s *) - MC_AddRedText(menu, 16, y, " Teamplay Team Fortress Item Names", false); y+=8; - MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - + MC_AddRedText(menu, 16, y, " Teamplay Team Fortress Item Names", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; y+=4;MC_AddEditCvar(menu, 16, y, " Sentry Gun", "tp_name_sentry"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Dispenser", "tp_name_disp"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Flag", "tp_name_flag"); y+=8+4; @@ -1474,7 +1619,7 @@ void M_Menu_Teamplay_Items_Team_Fortress_f (void) y+=8; MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); } void M_Menu_Teamplay_Items_Status_Location_Misc_f (void) @@ -1482,6 +1627,7 @@ void M_Menu_Teamplay_Items_Status_Location_Misc_f (void) int y = 32; menu_t *menu; int mgt; + int cursorpositionY; extern cvar_t ; key_dest = key_menu; @@ -1494,10 +1640,13 @@ void M_Menu_Teamplay_Items_Status_Location_Misc_f (void) if (mgt == MGT_QUAKE2) { MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); - y += 32; + y += 8; } else if (mgt == MGT_HEXEN2) { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; } else { @@ -1505,11 +1654,13 @@ void M_Menu_Teamplay_Items_Status_Location_Misc_f (void) MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); } + cursorpositionY = (y + 24); + //menu->selecteditem = (union menuoption_s *) - MC_AddRedText(menu, 16, y, " Teamplay Status, Location & Misc. Names", false); y+=8; - MC_AddRedText(menu, 16, y, "-------------------------------------------------------------------", false); y+=8; - + MC_AddRedText(menu, 16, y, " Teamplay Status, Location & Misc. Names", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; y+=4;MC_AddEditCvar(menu, 16, y, " At (Location)", "tp_name_at"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " Enemy", "tp_name_enemy"); y+=8+4; y+=4;MC_AddEditCvar(menu, 16, y, " None", "tp_name_none"); y+=8+4; @@ -1525,5 +1676,5 @@ void M_Menu_Teamplay_Items_Status_Location_Misc_f (void) y+=8; MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); } \ No newline at end of file diff --git a/engine/client/menu.c b/engine/client/menu.c index 790b2c70d..29b437019 100644 --- a/engine/client/menu.c +++ b/engine/client/menu.c @@ -545,10 +545,22 @@ void M_Keys_Key (int k) { char cmd[80]; int keys[2]; + int mgt; + + mgt = M_GameType(); + + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu1.wav"); + else + S_LocalSound ("misc/menu1.wav"); if (bind_grab) { // defining a key - S_LocalSound ("misc/menu1.wav"); + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu1.wav"); + else + S_LocalSound ("misc/menu1.wav"); + if (k == K_ESCAPE) { bind_grab = false; @@ -571,7 +583,11 @@ void M_Keys_Key (int k) case K_LEFTARROW: case K_UPARROW: - S_LocalSound ("misc/menu1.wav"); + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu1.wav"); + else + S_LocalSound ("misc/menu1.wav"); + keys_cursor--; if (keys_cursor < 0) keys_cursor = numbindnames-1; @@ -579,7 +595,11 @@ void M_Keys_Key (int k) case K_DOWNARROW: case K_RIGHTARROW: - S_LocalSound ("misc/menu1.wav"); + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu1.wav"); + else + S_LocalSound ("misc/menu1.wav"); + keys_cursor++; if (keys_cursor >= numbindnames) keys_cursor = 0; @@ -587,7 +607,12 @@ void M_Keys_Key (int k) case K_ENTER: // go into bind mode M_FindKeysForCommand (bindnames[keys_cursor].command, keys); - S_LocalSound ("misc/menu2.wav"); + + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu2.wav"); + else + S_LocalSound ("misc/menu2.wav"); + if (keys[1] != -1) M_UnbindCommand (bindnames[keys_cursor].command); bind_grab = true; @@ -595,7 +620,11 @@ void M_Keys_Key (int k) case K_BACKSPACE: // delete bindings case K_DEL: // delete bindings - S_LocalSound ("misc/menu2.wav"); + if (mgt == MGT_HEXEN2) + S_LocalSound ("raven/menu1.wav"); + else + S_LocalSound ("misc/menu1.wav"); + M_UnbindCommand (bindnames[keys_cursor].command); break; } From a9326e3ea17080b0cd162cfc706cca29a94ca3d4 Mon Sep 17 00:00:00 2001 From: Lance Date: Sat, 16 Jan 2010 06:16:42 +0000 Subject: [PATCH 59/76] Fix for MinGL, and minor menu fixup git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3498 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_options.c | 16 ++++++++--- engine/client/renderer.c | 60 +++++++++++++++++++++++++++------------ 2 files changed, 54 insertions(+), 22 deletions(-) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index b1ecc94af..c58eb9eac 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -612,9 +612,10 @@ void M_Menu_3D_f (void) int mgt; int cursorpositionY; //int currentmsaalevel; -#ifdef RGLQUAKE +#ifndef MINIMAL + extern cvar_t gl_shadeq1, gl_shadeq3, r_xflip; #endif - extern cvar_t r_novis, gl_dither, cl_item_bobbing, r_waterwarp, r_nolerp, r_fastsky, gl_shadeq1, gl_shadeq3, gl_nocolors, gl_lerpimages, gl_keeptjunctions, gl_lateswap, r_mirroralpha, r_wateralpha, r_drawviewmodel, r_xflip, gl_maxdist, gl_motionblur, gl_motionblurscale, gl_blend2d, gl_blendsprites, r_flashblend, gl_cshiftenabled; + extern cvar_t r_novis, gl_dither, cl_item_bobbing, r_waterwarp, r_nolerp, r_fastsky, gl_nocolors, gl_lerpimages, gl_keeptjunctions, gl_lateswap, r_mirroralpha, r_wateralpha, r_drawviewmodel, gl_maxdist, gl_motionblur, gl_motionblurscale, gl_blend2d, gl_blendsprites, r_flashblend, gl_cshiftenabled; //static extern cvar_t vid_multisample; key_dest = key_menu; @@ -668,13 +669,17 @@ void M_Menu_3D_f (void) MC_AddCheckBox(menu, 16, y, " Water Warp", &r_waterwarp,0); y+=8; MC_AddCheckBox(menu, 16, y, " Model Interpollation", &r_nolerp,0); y+=8; MC_AddCheckBox(menu, 16, y, " Toggle Sky", &r_fastsky,0); y+=8; + #ifndef MINIMAL MC_AddCheckBox(menu, 16, y, " Q1 Shaders", &gl_shadeq1,0); y+=8; MC_AddCheckBox(menu, 16, y, " Q3 Shaders", &gl_shadeq3,0); y+=8; + #endif MC_AddCheckBox(menu, 16, y, " Lerp Images", &gl_lerpimages,0); y+=8; MC_AddSlider(menu, 16, y, " Maximum Distance", &gl_maxdist,1,8192,128); y+=8; MC_AddCheckBox(menu, 16, y, " GL Swapbuffer Delay", &gl_lateswap,0); y+=8; MC_AddCheckBox(menu, 16, y, " Mirror Reflections", &r_mirroralpha,0); y+=8; + #ifndef MINIMAL MC_AddCheckBox(menu, 16, y, " Flip Horizontal View", &r_xflip,0); y+=8; + #endif MC_AddCheckBox(menu, 16, y, " Water Transparency", &r_wateralpha,0); y+=8; MC_AddSlider(menu, 16, y, " View Model Transparency", &r_drawviewmodel,0,1,0.1); y+=8; MC_AddCheckBox(menu, 16, y, "Ignore Player Model Colors", &gl_nocolors,0); y+=8; @@ -999,9 +1004,10 @@ void M_Menu_Shadow_Lighting_f (void) int mgt; int cursorpositionY; int currentloadlit; -#ifdef RGLQUAKE +#ifndef MINIMAL + extern cvar_t r_vertexlight; #endif - extern cvar_t r_noaliasshadows, r_shadows, r_shadow_realtime_world, r_loadlits, gl_maxshadowlights, r_lightmap_saturation, r_dynamic, r_vertexlight, r_vertexdlights, r_lightstylesmooth, r_lightstylespeed, r_nolightdir, r_shadow_realtime_world_lightmaps, r_shadow_glsl_offsetmapping, r_shadow_glsl_offsetmapping_bias, r_shadow_glsl_offsetmapping_scale, r_shadow_bumpscale_basetexture, r_shadow_bumpscale_bumpmap, r_fb_bmodels, r_fb_models, gl_overbright, r_rocketlight, r_powerupglow, v_powerupshell, r_lightflicker, r_explosionlight; + extern cvar_t r_noaliasshadows, r_shadows, r_shadow_realtime_world, r_loadlits, gl_maxshadowlights, r_lightmap_saturation, r_dynamic, r_vertexdlights, r_lightstylesmooth, r_lightstylespeed, r_nolightdir, r_shadow_realtime_world_lightmaps, r_shadow_glsl_offsetmapping, r_shadow_glsl_offsetmapping_bias, r_shadow_glsl_offsetmapping_scale, r_shadow_bumpscale_basetexture, r_shadow_bumpscale_bumpmap, r_fb_bmodels, r_fb_models, gl_overbright, r_rocketlight, r_powerupglow, v_powerupshell, r_lightflicker, r_explosionlight; static const char *loadlitoptions[] = { @@ -1049,7 +1055,9 @@ void M_Menu_Shadow_Lighting_f (void) //MC_AddSlider(menu, 16, y, " Light Map Mode", &gl_lightmapmode,0,2,1); y+=8; MC_AddSlider(menu, 16, y, " Light Map Saturation", &r_lightmap_saturation,0,1,0.1); y+=8; MC_AddCheckBox(menu, 16, y, " Dynamic Lighting", &r_dynamic,0); y+=8; + #ifndef MINIMAL MC_AddCheckBox(menu, 16, y, " Vertex Lighting", &r_vertexlight,0); y+=8; + #endif MC_AddCheckBox(menu, 16, y, " Dynamic Vertex Lights", &r_vertexdlights,0); y+=8; MC_AddCheckBox(menu, 16, y, " Lightstyle Smoothing", &r_lightstylesmooth,0); y+=8; MC_AddSlider(menu, 16, y, " Lightstyle Animation Speed", &r_lightstylespeed,0,50,1); y+=8; diff --git a/engine/client/renderer.c b/engine/client/renderer.c index b5801febc..719d69b02 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -1247,6 +1247,8 @@ void M_Menu_Video_f (void) extern cvar_t _vid_wait_override; int i, y; + int mgt; + int cursorpositionY; prefabmode = -1; prefab2dmode = -1; for (i = 0; i < sizeof(vid_modes)/sizeof(vidmode_t); i++) @@ -1345,25 +1347,46 @@ void M_Menu_Video_f (void) sprintf(colordepth,"%sbit", vid_bpp.string); - MC_AddCenterPicture(menu, 4, "vidmodes"); + mgt = M_GameType(); - y = 32; + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y = 0; + cursorpositionY = 120; + } + else if (mgt == MGT_HEXEN2) + { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title7.lmp"); + y = 25; + cursorpositionY = 145; + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + y = 0; + cursorpositionY = 120; + } - MC_AddRedText(menu, 0, y, " Current Renderer", false); - MC_AddRedText(menu, 180, y, rendererstring, false); y+=8; - MC_AddRedText(menu, 0, y, " Current Color Depth", false); - MC_AddRedText(menu, 180, y, colordepth, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 3D Res", false); - MC_AddRedText(menu, 180, y, current3dres, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 3D A/R", false); - MC_AddRedText(menu, 180, y, aspectratio23d, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 2D Res", false); - MC_AddRedText(menu, 180, y, current2dres, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 2D A/R", false); - MC_AddRedText(menu, 180, y, aspectratio22d, false); y+=8; - MC_AddRedText(menu, 0, y, "Current Refresh Rate", false); - MC_AddRedText(menu, 180, y, currenthz, false); y+=8; - MC_AddRedText(menu, 0, y, "---------------------------------------------", false); y+=8; + y += 40; + MC_AddRedText(menu, 0, y, " Current Renderer", false); + MC_AddRedText(menu, 225, y, rendererstring, false); y+=8; + MC_AddRedText(menu, 0, y, " Current Color Depth", false); + MC_AddRedText(menu, 225, y, colordepth, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 3D Res", false); + MC_AddRedText(menu, 225, y, current3dres, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 3D A/R", false); + MC_AddRedText(menu, 225, y, aspectratio23d, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 2D Res", false); + MC_AddRedText(menu, 225, y, current2dres, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 2D A/R", false); + MC_AddRedText(menu, 225, y, aspectratio22d, false); y+=8; + MC_AddRedText(menu, 0, y, " Current Refresh Rate", false); + MC_AddRedText(menu, 225, y, currenthz, false); y+=8; + y+=8; + MC_AddRedText(menu, 0, y, " €‚ ", false); y+=8; y+=8; info->renderer = MC_AddCombo(menu, 16, y, " Renderer", rendererops, i); y+=8; info->bppcombo = MC_AddCombo(menu, 16, y, " Color Depth", bppnames, currentbpp); y+=8; @@ -1377,6 +1400,7 @@ void M_Menu_Video_f (void) y+=4;info->customheight = MC_AddEdit(menu, 16, y, " Custom height", vid_height.string); y+=12; info->vsynccombo = MC_AddCombo(menu, 16, y, " VSync", vsyncoptions, currentvsync); y+=8; //MC_AddCheckBox(menu, 16, y, " Override VSync", &_vid_wait_override,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Desktop Settings", &vid_desktopsettings,0); y+=8; y+=8; MC_AddCommand(menu, 16, y, "= Apply Changes =", M_VideoApply); y+=8; y+=8; @@ -1392,7 +1416,7 @@ void M_Menu_Video_f (void) MC_AddCheckBox(menu, 16, y, " Allow ModeX", &vid_allow_modex,0); y+=8; MC_AddCheckBox(menu, 16, y, " Windowed Mouse", &_windowed_mouse,0); y+=8; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 152, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 152, cursorpositionY, NULL, false); menu->selecteditem = (union menuoption_s *)info->renderer; menu->event = CheckCustomMode; } From 3eac223fc2bf31746ff5cf0ab4fd0bb069cbf187 Mon Sep 17 00:00:00 2001 From: Lance Date: Sat, 16 Jan 2010 08:18:08 +0000 Subject: [PATCH 60/76] clang error fix git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3499 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_options.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index c58eb9eac..76a9d7892 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -1201,7 +1201,7 @@ void M_Menu_Teamplay_Locations_f (void) menu_t *menu; int mgt; int cursorpositionY; - extern cvar_t ; + key_dest = key_menu; m_state = m_complex; @@ -1261,7 +1261,7 @@ void M_Menu_Teamplay_Needs_f (void) menu_t *menu; int mgt; int cursorpositionY; - extern cvar_t ; + key_dest = key_menu; m_state = m_complex; @@ -1317,7 +1317,7 @@ void M_Menu_Teamplay_Items_f (void) menu_t *menu; int mgt; int cursorpositionY; - extern cvar_t ; + key_dest = key_menu; m_state = m_complex; @@ -1369,7 +1369,7 @@ void M_Menu_Teamplay_Items_Armor_f (void) menu_t *menu; int mgt; int cursorpositionY; - extern cvar_t ; + key_dest = key_menu; m_state = m_complex; @@ -1422,7 +1422,7 @@ void M_Menu_Teamplay_Items_Weapons_f (void) menu_t *menu; int mgt; int cursorpositionY; - extern cvar_t ; + key_dest = key_menu; m_state = m_complex; @@ -1477,7 +1477,7 @@ void M_Menu_Teamplay_Items_Powerups_f (void) menu_t *menu; int mgt; int cursorpositionY; - extern cvar_t ; + key_dest = key_menu; m_state = m_complex; @@ -1534,7 +1534,7 @@ void M_Menu_Teamplay_Items_Ammo_Health_f (void) menu_t *menu; int mgt; int cursorpositionY; - extern cvar_t ; + key_dest = key_menu; m_state = m_complex; @@ -1587,7 +1587,7 @@ void M_Menu_Teamplay_Items_Team_Fortress_f (void) menu_t *menu; int mgt; int cursorpositionY; - extern cvar_t ; + key_dest = key_menu; m_state = m_complex; @@ -1636,7 +1636,7 @@ void M_Menu_Teamplay_Items_Status_Location_Misc_f (void) menu_t *menu; int mgt; int cursorpositionY; - extern cvar_t ; + key_dest = key_menu; m_state = m_complex; From bfc4c15d487f61789ee5146d537e444b5054c1e8 Mon Sep 17 00:00:00 2001 From: Lance Date: Sun, 17 Jan 2010 06:42:30 +0000 Subject: [PATCH 61/76] Fixed a menu crash, tweaked some menus, added bloom options, and a method of decreasing the time vid_restart takes in each menu by not trying to apply menu options which don't differ from the current cvar value. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3500 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_options.c | 323 +++++++++++++++++++++++++++++--------- engine/client/renderer.c | 2 +- engine/gl/gl_bloom.c | 98 ++++++------ 3 files changed, 296 insertions(+), 127 deletions(-) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 76a9d7892..5ae5021dd 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -563,28 +563,52 @@ typedef struct { qboolean M_VideoApply3D (union menuoption_s *op,struct menu_s *menu,int key) { threeDmenuinfo_t *info = menu->data; + int currentmsaalevel; + extern cvar_t vid_multisample; if (key != K_ENTER) return false; - switch(info->multisamplingcombo->selectedoption) + if (vid_multisample.value == 8) + currentmsaalevel = 4; + else if (vid_multisample.value == 6) + currentmsaalevel = 3; + else if (vid_multisample.value == 4) + currentmsaalevel = 2; + else if (vid_multisample.value == 2) + currentmsaalevel = 1; + else if (vid_multisample.value <= 1) + currentmsaalevel = 0; + else + currentmsaalevel = 0; + + if (info->multisamplingcombo->selectedoption != currentmsaalevel) // if MSAA doesn't change, don't bother applying it when the video system is restarted { - case 0: - Cbuf_AddText("vid_multisample 0\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("vid_multisample 2\n", RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText("vid_multisample 4\n", RESTRICT_LOCAL); - break; - case 3: - Cbuf_AddText("vid_multisample 6\n", RESTRICT_LOCAL); - break; - case 4: - Cbuf_AddText("vid_multisample 8\n", RESTRICT_LOCAL); - break; + switch(info->multisamplingcombo->selectedoption) + { + case 0: + Cbuf_AddText("vid_multisample 0\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("vid_multisample 2\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("vid_multisample 4\n", RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText("vid_multisample 6\n", RESTRICT_LOCAL); + break; + case 4: + Cbuf_AddText("vid_multisample 8\n", RESTRICT_LOCAL); + break; + } } + #ifdef _DEBUG + else + { + Con_Printf("MSAA: Selected option matches current CVAR value (%d & %d), no change made.\n",info->multisamplingcombo->selectedoption, currentmsaalevel); + } + #endif Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); @@ -611,12 +635,11 @@ void M_Menu_3D_f (void) menu_t *menu; int mgt; int cursorpositionY; - //int currentmsaalevel; + int currentmsaalevel; #ifndef MINIMAL extern cvar_t gl_shadeq1, gl_shadeq3, r_xflip; #endif - extern cvar_t r_novis, gl_dither, cl_item_bobbing, r_waterwarp, r_nolerp, r_fastsky, gl_nocolors, gl_lerpimages, gl_keeptjunctions, gl_lateswap, r_mirroralpha, r_wateralpha, r_drawviewmodel, gl_maxdist, gl_motionblur, gl_motionblurscale, gl_blend2d, gl_blendsprites, r_flashblend, gl_cshiftenabled; - //static extern cvar_t vid_multisample; + extern cvar_t r_novis, gl_dither, cl_item_bobbing, r_waterwarp, r_nolerp, r_fastsky, gl_nocolors, gl_lerpimages, gl_keeptjunctions, gl_lateswap, r_mirroralpha, r_wateralpha, r_drawviewmodel, gl_maxdist, gl_motionblur, gl_motionblurscale, gl_blend2d, gl_blendsprites, r_flashblend, gl_cshiftenabled, vid_multisample; key_dest = key_menu; m_state = m_complex; @@ -645,7 +668,7 @@ void M_Menu_3D_f (void) cursorpositionY = (y + 24); - /*if (vid_multisample.value == 8) + if (vid_multisample.value == 8) currentmsaalevel = 4; else if (vid_multisample.value == 6) currentmsaalevel = 3; @@ -656,7 +679,7 @@ void M_Menu_3D_f (void) else if (vid_multisample.value <= 1) currentmsaalevel = 0; else - currentmsaalevel = 0;*/ + currentmsaalevel = 0; menu->selecteditem = (union menuoption_s *) @@ -664,7 +687,6 @@ void M_Menu_3D_f (void) MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; y+=8; - //info->multisamplingcombo = MC_AddCombo(menu, 16, y, " Multisample Anti-Aliasing", msaalevels, currentmsaalevel); y+=8; MC_AddCheckBox(menu, 16, y, " Calculate VIS", &r_novis,0); y+=8; MC_AddCheckBox(menu, 16, y, " Water Warp", &r_waterwarp,0); y+=8; MC_AddCheckBox(menu, 16, y, " Model Interpollation", &r_nolerp,0); y+=8; @@ -692,6 +714,7 @@ void M_Menu_3D_f (void) MC_AddCheckBox(menu, 16, y, " Poly Blending", &gl_cshiftenabled,0); y+=8; MC_AddCheckBox(menu, 16, y, " 16bit Color Dithering", &gl_dither,0); y+=8; MC_AddCheckBox(menu, 16, y, " Model Bobbing", &cl_item_bobbing,0); y+=8; + info->multisamplingcombo = MC_AddCombo(menu, 16, y, " Multisample Anti-Aliasing", msaalevels, currentmsaalevel); y+=8; y+=8; MC_AddCommand(menu, 16, y, " Apply", M_VideoApply3D); y+=8; @@ -703,11 +726,19 @@ typedef struct { menucombo_t *texturefiltercombo; menucombo_t *anisotropycombo; menucombo_t *maxtexturesizecombo; + menucombo_t *bloomsamplesizecombo; + menucombo_t *bloomdiamondcombo; } texturemenuinfo_t; qboolean M_VideoApplyTextures (union menuoption_s *op,struct menu_s *menu,int key) { texturemenuinfo_t *info = menu->data; + int currentbloomdiamond; + int currentbloomsamplesize; + +#ifndef MINIMAL + extern cvar_t r_bloom_sample_size, r_bloom_diamond_size; +#endif if (key != K_ENTER) return false; @@ -747,49 +778,126 @@ qboolean M_VideoApplyTextures (union menuoption_s *op,struct menu_s *menu,int ke switch(info->maxtexturesizecombo->selectedoption) { case 0: - Cbuf_AddText("gl_max_size 1\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("gl_max_size 2\n", RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText("gl_max_size 4\n", RESTRICT_LOCAL); - break; - case 3: - Cbuf_AddText("gl_max_size 8\n", RESTRICT_LOCAL); - break; - case 4: - Cbuf_AddText("gl_max_size 16\n", RESTRICT_LOCAL); - break; - case 5: - Cbuf_AddText("gl_max_size 32\n", RESTRICT_LOCAL); - break; - case 6: - Cbuf_AddText("gl_max_size 64\n", RESTRICT_LOCAL); - break; - case 7: Cbuf_AddText("gl_max_size 128\n", RESTRICT_LOCAL); break; - case 8: + case 1: + Cbuf_AddText("gl_max_size 196\n", RESTRICT_LOCAL); + break; + case 2: Cbuf_AddText("gl_max_size 256\n", RESTRICT_LOCAL); break; - case 9: + case 3: + Cbuf_AddText("gl_max_size 384\n", RESTRICT_LOCAL); + break; + case 4: Cbuf_AddText("gl_max_size 512\n", RESTRICT_LOCAL); break; - case 10: + case 5: + Cbuf_AddText("gl_max_size 768\n", RESTRICT_LOCAL); + break; + case 6: Cbuf_AddText("gl_max_size 1024\n", RESTRICT_LOCAL); break; - case 11: + case 7: Cbuf_AddText("gl_max_size 2048\n", RESTRICT_LOCAL); break; - case 12: + case 8: Cbuf_AddText("gl_max_size 4096\n", RESTRICT_LOCAL); break; - case 13: + case 9: Cbuf_AddText("gl_max_size 8192\n", RESTRICT_LOCAL); break; } +#ifndef MINIMAL + if (r_bloom_sample_size.value >= 512) + currentbloomsamplesize = 7; + else if (r_bloom_sample_size.value == 384) + currentbloomsamplesize = 6; + else if (r_bloom_sample_size.value == 256) + currentbloomsamplesize = 5; + else if (r_bloom_sample_size.value == 192) + currentbloomsamplesize = 4; + else if (r_bloom_sample_size.value == 128) + currentbloomsamplesize = 3; + else if (r_bloom_sample_size.value == 96) + currentbloomsamplesize = 2; + else if (r_bloom_sample_size.value == 64) + currentbloomsamplesize = 1; + else if (r_bloom_sample_size.value <= 32) + currentbloomsamplesize = 0; + else + currentbloomsamplesize = 0; + + if (info->bloomsamplesizecombo->selectedoption != currentbloomsamplesize) + { + switch(info->bloomsamplesizecombo->selectedoption) + { + case 0: + Cbuf_AddText("r_bloom_sample_size 32\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("r_bloom_sample_size 64\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("r_bloom_sample_size 96\n", RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText("r_bloom_sample_size 128\n", RESTRICT_LOCAL); + break; + case 4: + Cbuf_AddText("r_bloom_sample_size 192\n", RESTRICT_LOCAL); + break; + case 5: + Cbuf_AddText("r_bloom_sample_size 256\n", RESTRICT_LOCAL); + break; + case 6: + Cbuf_AddText("r_bloom_sample_size 384\n", RESTRICT_LOCAL); + break; + case 7: + Cbuf_AddText("r_bloom_sample_size 512\n", RESTRICT_LOCAL); + break; + } + } + #ifdef _DEBUG + else + { + Con_Printf("Bloom Sample Size: Selected option matches current CVAR value (%d & %d), no change made.\n",info->bloomsamplesizecombo->selectedoption, currentbloomsamplesize); + } + #endif + + if (r_bloom_diamond_size.value >= 8) + currentbloomdiamond = 2; + else if (r_bloom_diamond_size.value == 6) + currentbloomdiamond = 1; + else if (r_bloom_diamond_size.value <= 4) + currentbloomdiamond = 0; + else + currentbloomdiamond = 0; + + if (info->bloomdiamondcombo->selectedoption != currentbloomdiamond) + { + switch(info->bloomdiamondcombo->selectedoption) + { + case 0: + Cbuf_AddText("r_bloom_diamond_size 4\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("r_bloom_diamond_size 6\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("r_bloom_diamond_size 8\n", RESTRICT_LOCAL); + break; + } + } + #ifdef _DEBUG + else + { + Con_Printf("Bloom Diamond Size: Selected option matches current CVAR value (%d & %d), no change made.\n",info->bloomdiamondcombo->selectedoption, currentbloomdiamond); + } + #endif +#endif + Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); M_RemoveMenu(menu); @@ -819,16 +927,20 @@ void M_Menu_Textures_f (void) static const char *texturesizeoptions[] = { - "1x1", - "2x2", - "4x4", - "8x8", - "16x16", - "32x32", - "64x64", + // uncommented out the unreadable console text ones + //"1x1", + //"2x2", + //"4x4", + //"8x8", + //"16x16", + //"32x32", + //"64x64", "128x128", + "196x196", "256x256", + "384x384", "512x512", + "768x768", "1024x1024", "2048x2048", "4096x4096", @@ -836,6 +948,27 @@ void M_Menu_Textures_f (void) NULL }; + static const char *bloomsamplesizeoptions[] = + { + "32x32", + "64x64", + "96x96", + "128x128", + "192x192", + "256x256", + "384x384", + "512x512", + NULL + }; + + static const char *bloomdiamondoptions[] = + { + "4x", + "6x", + "8x", + NULL + }; + int y = 32; texturemenuinfo_t *info; menu_t *menu; @@ -844,8 +977,13 @@ void M_Menu_Textures_f (void) int currenttexturefilter; int currentanisotropylevel; int currentmaxtexturesize; - extern cvar_t r_bloom, gl_load24bit, gl_specular, gl_fontinwardstep, gl_smoothfont, r_waterlayers, gl_bump, gl_detail, gl_detailscale, gl_compress, gl_savecompressedtex, gl_ztrick, gl_triplebuffer, gl_picmip, gl_picmip2d, gl_playermip, gl_max_size, r_stains, r_bloodstains, r_stainfadetime, r_stainfadeammount, gl_skyboxdist, r_drawflat, gl_schematics, gl_texturemode, gl_texture_anisotropic_filtering; + int currentbloomsamplesize; + int currentbloomdiamond; +#ifndef MINIMAL + extern cvar_t r_bloom_sample_size, r_bloom_darken, r_bloom_intensity, r_bloom_diamond_size, r_bloom_alpha, r_bloom_fast_sample; +#endif + extern cvar_t r_bloom, gl_load24bit, gl_specular, gl_fontinwardstep, gl_smoothfont, r_waterlayers, gl_bump, gl_detail, gl_detailscale, gl_compress, gl_savecompressedtex, gl_ztrick, gl_triplebuffer, gl_picmip, gl_picmip2d, gl_playermip, gl_max_size, r_stains, r_bloodstains, r_stainfadetime, r_stainfadeammount, gl_skyboxdist, r_drawflat, gl_schematics, gl_texturemode, gl_texture_anisotropic_filtering; key_dest = key_menu; m_state = m_complex; @@ -873,6 +1011,38 @@ void M_Menu_Textures_f (void) cursorpositionY = (y + 24); +#ifndef MINIMAL + + if (r_bloom_sample_size.value >= 512) + currentbloomsamplesize = 7; + else if (r_bloom_sample_size.value == 384) + currentbloomsamplesize = 6; + else if (r_bloom_sample_size.value == 256) + currentbloomsamplesize = 5; + else if (r_bloom_sample_size.value == 192) + currentbloomsamplesize = 4; + else if (r_bloom_sample_size.value == 128) + currentbloomsamplesize = 3; + else if (r_bloom_sample_size.value == 96) + currentbloomsamplesize = 2; + else if (r_bloom_sample_size.value == 64) + currentbloomsamplesize = 1; + else if (r_bloom_sample_size.value <= 32) + currentbloomsamplesize = 0; + else + currentbloomsamplesize = 0; + + if (r_bloom_diamond_size.value >= 8) + currentbloomdiamond = 2; + else if (r_bloom_diamond_size.value == 6) + currentbloomdiamond = 1; + else if (r_bloom_diamond_size.value <= 4) + currentbloomdiamond = 0; + else + currentbloomdiamond = 0; + +#endif + if (!Q_strcasecmp(gl_texturemode.string, "gl_nearest_mipmap_nearest")) currenttexturefilter = 0; else if (!Q_strcasecmp(gl_texturemode.string, "gl_linear_mipmap_linear")) @@ -882,7 +1052,7 @@ void M_Menu_Textures_f (void) else currenttexturefilter = 1; - if (gl_texture_anisotropic_filtering.value == 16) + if (gl_texture_anisotropic_filtering.value >= 16) currentanisotropylevel = 4; else if (gl_texture_anisotropic_filtering.value == 8) currentanisotropylevel = 3; @@ -895,38 +1065,29 @@ void M_Menu_Textures_f (void) else currentanisotropylevel = 0; - if (gl_max_size.value == 8192) - currentmaxtexturesize = 13; - else if (gl_max_size.value == 4096) - currentmaxtexturesize = 12; - else if (gl_max_size.value == 2048) - currentmaxtexturesize = 11; - else if (gl_max_size.value == 1024) - currentmaxtexturesize = 10; - else if (gl_max_size.value == 512) + if (gl_max_size.value >= 8192) currentmaxtexturesize = 9; - else if (gl_max_size.value == 256) + else if (gl_max_size.value == 4096) currentmaxtexturesize = 8; - else if (gl_max_size.value == 128) + else if (gl_max_size.value == 2048) currentmaxtexturesize = 7; - else if (gl_max_size.value == 64) + else if (gl_max_size.value == 1024) currentmaxtexturesize = 6; - else if (gl_max_size.value == 32) + else if (gl_max_size.value == 768) currentmaxtexturesize = 5; - else if (gl_max_size.value == 16) + else if (gl_max_size.value == 512) currentmaxtexturesize = 4; - else if (gl_max_size.value == 8) + else if (gl_max_size.value == 384) currentmaxtexturesize = 3; - else if (gl_max_size.value == 4) + else if (gl_max_size.value == 256) currentmaxtexturesize = 2; - else if (gl_max_size.value == 2) + else if (gl_max_size.value == 196) currentmaxtexturesize = 1; - else if (gl_max_size.value <= 1) + else if (gl_max_size.value <= 128) currentmaxtexturesize = 0; else currentmaxtexturesize = 0; - MC_AddRedText(menu, 16, y, " Texturing Options", false); y+=8; MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; y+=8; @@ -935,6 +1096,14 @@ void M_Menu_Textures_f (void) info->anisotropycombo = MC_AddCombo(menu, 16, y, " Anisotropy Level", anisotropylevels, currentanisotropylevel); y+=8; MC_AddCheckBox(menu, 16, y, " 32bit Textures", &gl_load24bit,0); y+=8; MC_AddCheckBox(menu, 16, y, " Bloom", &r_bloom,0); y+=8; +#ifndef MINIMAL + MC_AddCheckBox(menu, 16, y, " Bloom Fast Sample", &r_bloom_fast_sample,0); y+=8; + info->bloomsamplesizecombo = MC_AddCombo(menu,16, y," Bloom Sample Size", bloomsamplesizeoptions, currentbloomsamplesize); y+=8; + MC_AddSlider(menu, 16, y, " Bloom Darken", &r_bloom_darken,0,5,0.25); y+=8; + MC_AddSlider(menu, 16, y, " Bloom Intensity", &r_bloom_intensity,0,20,1); y+=8; + info->bloomdiamondcombo = MC_AddCombo(menu,16, y, " Bloom Diamond Size", bloomdiamondoptions, currentbloomdiamond); y+=8; + MC_AddSlider(menu, 16, y, " Bloom Alpha", &r_bloom_alpha,0,1,0.1); y+=8; +#endif MC_AddCheckBox(menu, 16, y, " Bumpmapping", &gl_bump,0); y+=8; MC_AddCheckBox(menu, 16, y, " Specular Highlights", &gl_specular,0); y+=8; MC_AddCheckBox(menu, 16, y, " Texture Detail", &gl_detail,0); y+=8; diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 719d69b02..6570e260a 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -186,7 +186,7 @@ static cvar_t vid_fullscreen = SCVARF ("vid_fullscreen", "1", #endif cvar_t vid_height = SCVARF ("vid_height", "0", CVAR_ARCHIVE | CVAR_RENDERERLATCH); -static cvar_t vid_multisample = SCVARF ("vid_multisample", "0", +cvar_t vid_multisample = SCVARF ("vid_multisample", "0", CVAR_ARCHIVE | CVAR_RENDERERLATCH); static cvar_t vid_refreshrate = SCVARF ("vid_displayfrequency", "0", CVAR_ARCHIVE | CVAR_RENDERERLATCH); diff --git a/engine/gl/gl_bloom.c b/engine/gl/gl_bloom.c index 910c997ed..0283d4157 100644 --- a/engine/gl/gl_bloom.c +++ b/engine/gl/gl_bloom.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -29,45 +29,45 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern vrect_t gl_truescreenrect; -/* -============================================================================== - - LIGHT BLOOMS - -============================================================================== -*/ +/* +============================================================================== -static float Diamond8x[8][8] = { - {0.0f, 0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.0f, 0.0f}, - {0.0f, 0.0f, 0.2f, 0.3f, 0.3f, 0.2f, 0.0f, 0.0f}, - {0.0f, 0.2f, 0.4f, 0.6f, 0.6f, 0.4f, 0.2f, 0.0f}, - {0.1f, 0.3f, 0.6f, 0.9f, 0.9f, 0.6f, 0.3f, 0.1f}, - {0.1f, 0.3f, 0.6f, 0.9f, 0.9f, 0.6f, 0.3f, 0.1f}, - {0.0f, 0.2f, 0.4f, 0.6f, 0.6f, 0.4f, 0.2f, 0.0f}, - {0.0f, 0.0f, 0.2f, 0.3f, 0.3f, 0.2f, 0.0f, 0.0f}, + LIGHT BLOOMS + +============================================================================== +*/ + +static float Diamond8x[8][8] = { + {0.0f, 0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, 0.2f, 0.3f, 0.3f, 0.2f, 0.0f, 0.0f}, + {0.0f, 0.2f, 0.4f, 0.6f, 0.6f, 0.4f, 0.2f, 0.0f}, + {0.1f, 0.3f, 0.6f, 0.9f, 0.9f, 0.6f, 0.3f, 0.1f}, + {0.1f, 0.3f, 0.6f, 0.9f, 0.9f, 0.6f, 0.3f, 0.1f}, + {0.0f, 0.2f, 0.4f, 0.6f, 0.6f, 0.4f, 0.2f, 0.0f}, + {0.0f, 0.0f, 0.2f, 0.3f, 0.3f, 0.2f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.0f, 0.0f} }; -static float Diamond6x[6][6] = { - {0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.0f}, - {0.0f, 0.3f, 0.5f, 0.5f, 0.3f, 0.0f}, - {0.1f, 0.5f, 0.9f, 0.9f, 0.5f, 0.1f}, - {0.1f, 0.5f, 0.9f, 0.9f, 0.5f, 0.1f}, - {0.0f, 0.3f, 0.5f, 0.5f, 0.3f, 0.0f}, +static float Diamond6x[6][6] = { + {0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.0f}, + {0.0f, 0.3f, 0.5f, 0.5f, 0.3f, 0.0f}, + {0.1f, 0.5f, 0.9f, 0.9f, 0.5f, 0.1f}, + {0.1f, 0.5f, 0.9f, 0.9f, 0.5f, 0.1f}, + {0.0f, 0.3f, 0.5f, 0.5f, 0.3f, 0.0f}, {0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.0f} }; -static float Diamond4x[4][4] = { - {0.3f, 0.4f, 0.4f, 0.3f}, - {0.4f, 0.9f, 0.9f, 0.4f}, - {0.4f, 0.9f, 0.9f, 0.4f}, +static float Diamond4x[4][4] = { + {0.3f, 0.4f, 0.4f, 0.3f}, + {0.4f, 0.9f, 0.9f, 0.4f}, + {0.4f, 0.9f, 0.9f, 0.4f}, {0.3f, 0.4f, 0.4f, 0.3f} }; cvar_t r_bloom = FCVAR("r_bloom", "gl_bloom", "0", CVAR_ARCHIVE); -static cvar_t r_bloom_alpha = SCVAR("r_bloom_alpha", "0.5"); -static cvar_t r_bloom_diamond_size = SCVAR("r_bloom_diamond_size", "8"); -static cvar_t r_bloom_intensity = SCVAR("r_bloom_intensity", "1"); -static cvar_t r_bloom_darken = SCVAR("r_bloom_darken", "3"); -static cvar_t r_bloom_sample_size = SCVARF("r_bloom_sample_size", "256", CVAR_RENDERERLATCH); -static cvar_t r_bloom_fast_sample = SCVARF("r_bloom_fast_sample", "0", CVAR_RENDERERLATCH); + cvar_t r_bloom_alpha = SCVAR("r_bloom_alpha", "0.5"); + cvar_t r_bloom_diamond_size = SCVAR("r_bloom_diamond_size", "8"); + cvar_t r_bloom_intensity = SCVAR("r_bloom_intensity", "1"); + cvar_t r_bloom_darken = SCVAR("r_bloom_darken", "3"); + cvar_t r_bloom_sample_size = SCVARF("r_bloom_sample_size", "256", CVAR_RENDERERLATCH); + cvar_t r_bloom_fast_sample = SCVARF("r_bloom_fast_sample", "0", CVAR_RENDERERLATCH); typedef struct { //texture numbers @@ -139,12 +139,12 @@ R_Bloom_InitBackUpTexture void R_Bloom_InitBackUpTexture(int widthheight) { qbyte *data; - + data = Z_Malloc(widthheight * widthheight * 4); bs.size_backup = widthheight; bs.tx_backup = GL_LoadTexture32("***bs.tx_backup***", bs.size_backup, bs.size_backup, (unsigned int*)data, false, false); - + Z_Free (data); } @@ -157,7 +157,7 @@ void R_Bloom_InitEffectTexture(void) { qbyte *data; float bloomsizecheck; - + if (r_bloom_sample_size.value < 32) Cvar_SetValue (&r_bloom_sample_size, 32); @@ -183,7 +183,7 @@ void R_Bloom_InitEffectTexture(void) data = Z_Malloc(bs.size_sample * bs.size_sample * 4); bs.tx_effect = GL_LoadTexture32("***bs.tx_effect***", bs.size_sample, bs.size_sample, (unsigned int*)data, false, false); - + Z_Free (data); } @@ -198,7 +198,7 @@ void R_Bloom_InitTextures(void) int size; int maxtexsize; - //find closer power of 2 to screen size + //find closer power of 2 to screen size for (bs.scr_w = 1;bs.scr_w < glwidth;bs.scr_w *= 2); for (bs.scr_h = 1;bs.scr_h < glheight;bs.scr_h *= 2); @@ -286,7 +286,7 @@ void R_Bloom_DrawEffect(void) qglBlendFunc(GL_ONE, GL_ONE); qglColor4f(r_bloom_alpha.value, r_bloom_alpha.value, r_bloom_alpha.value, 1.0f); GL_TexEnv(GL_MODULATE); - qglBegin(GL_QUADS); + qglBegin(GL_QUADS); qglTexCoord2f (0, bs.smp_t); qglVertex2f (bs.vp_x, bs.vp_y); qglTexCoord2f (0, 0); @@ -296,7 +296,7 @@ void R_Bloom_DrawEffect(void) qglTexCoord2f (bs.smp_s, bs.smp_t); qglVertex2f (bs.vp_x + bs.vp_w, bs.vp_y); qglEnd(); - + qglDisable(GL_BLEND); } @@ -337,7 +337,7 @@ void R_Bloom_GeneratexCross(void) { qglBlendFunc(GL_DST_COLOR, GL_ZERO); GL_TexEnv(GL_MODULATE); - + for(i=0; iinteger ;i++) { R_Bloom_SamplePass( 0, 0 ); } @@ -346,7 +346,7 @@ void R_Bloom_GeneratexCross(void) //bluring passes if( BLOOM_BLUR_RADIUS ) { - + qglBlendFunc(GL_ONE, GL_ONE); range = (float)BLOOM_BLUR_RADIUS; @@ -381,7 +381,7 @@ void R_Bloom_GeneratexCross(void) qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, bs.smp_w, bs.smp_h); } - + //restore full screen workspace qglViewport( 0, 0, glState.width, glState.height ); qglMatrixMode( GL_PROJECTION ); @@ -424,7 +424,7 @@ void R_Bloom_GeneratexDiamonds(void) { qglBlendFunc(GL_DST_COLOR, GL_ZERO); GL_TexEnv(GL_MODULATE); - + for (i=0; i 7 || r_bloom_diamond_size.value <= 3) { if (r_bloom_diamond_size.value != 8) @@ -487,7 +487,7 @@ void R_Bloom_GeneratexDiamonds(void) } } } - + qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, bs.smp_w, bs.smp_h); //restore full screen workspace @@ -497,7 +497,7 @@ void R_Bloom_GeneratexDiamonds(void) qglOrtho(0, glwidth, glheight, 0, -10, 100); qglMatrixMode(GL_MODELVIEW); qglLoadIdentity (); -} +} /* ================= @@ -514,7 +514,7 @@ void R_Bloom_DownsampleView( void ) { int midsample_width = bs.size_downsample * bs.smp_s; int midsample_height = bs.size_downsample * bs.smp_t; - + //copy the screen and draw resized GL_Bind(bs.tx_screen); qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bs.vp_x, glheight - (bs.vp_y + bs.vp_h), bs.vp_w, bs.vp_h); @@ -605,7 +605,7 @@ void R_BloomBlend (void)//refdef_t *fd, meshlist_t *meshlist ) buw = bs.size_downsample * bs.smp_s; buh = bs.size_downsample * bs.smp_t; - + //copy the screen space we'll use to work into the backup texture GL_Bind(bs.tx_backup); qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, buw, buh); @@ -620,7 +620,7 @@ void R_BloomBlend (void)//refdef_t *fd, meshlist_t *meshlist ) qglDisable(GL_BLEND); GL_Bind(bs.tx_backup); qglColor4f(1, 1, 1, 1); - R_Bloom_Quad(0, + R_Bloom_Quad(0, glheight - (buh), buw, buh, From b3511f7ea250ec0f11d249a9acdf3129cf1e7223 Mon Sep 17 00:00:00 2001 From: Lance Date: Sun, 17 Jan 2010 06:49:27 +0000 Subject: [PATCH 62/76] my bad, no such thing as gl_loadlit, it's r_loadlit git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3501 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_options.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 5ae5021dd..4598d8e9d 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -1148,13 +1148,13 @@ qboolean M_VideoApplyShadowLighting (union menuoption_s *op,struct menu_s *menu, switch(info->loadlitcombo->selectedoption) { case 0: - Cbuf_AddText("gl_loadlit 0\n", RESTRICT_LOCAL); + Cbuf_AddText("r_loadlit 0\n", RESTRICT_LOCAL); break; case 1: - Cbuf_AddText("gl_loadlit 1\n", RESTRICT_LOCAL); + Cbuf_AddText("r_loadlit 1\n", RESTRICT_LOCAL); break; case 2: - Cbuf_AddText("gl_loadlit 2\n", RESTRICT_LOCAL); + Cbuf_AddText("r_loadlit 2\n", RESTRICT_LOCAL); break; } From 04d181973a319762cfc4c894ee2418796206e9fc Mon Sep 17 00:00:00 2001 From: TimeServ Date: Mon, 18 Jan 2010 02:10:55 +0000 Subject: [PATCH 63/76] fix glerror for systems without gl_ext_shared_texture_palette git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3502 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_vidnt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/engine/gl/gl_vidnt.c b/engine/gl/gl_vidnt.c index 802e509d6..40bbeeaeb 100644 --- a/engine/gl/gl_vidnt.c +++ b/engine/gl/gl_vidnt.c @@ -1680,17 +1680,20 @@ qboolean GLVID_Is8bit() { return is8bit; } -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB void VID_Init8bitPalette() { +#ifdef GL_USE8BITTEX +#ifdef GL_EXT_paletted_texture +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + // Check for 8bit Extensions and initialize them. int i; char thePalette[256*3]; char *oldPalette, *newPalette; qglColorTableEXT = (void *)qwglGetProcAddress("glColorTableEXT"); - if (!qglColorTableEXT || strstr(gl_extensions, "GL_EXT_shared_texture_palette") || + if (!qglColorTableEXT || !strstr(gl_extensions, "GL_EXT_shared_texture_palette") || COM_CheckParm("-no8bit")) return; @@ -1707,6 +1710,9 @@ void VID_Init8bitPalette() qglColorTableEXT(GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGB, 256, GL_RGB, GL_UNSIGNED_BYTE, (void *) thePalette); is8bit = TRUE; + +#endif +#endif } void GLVID_DeInit (void) From 6c425bc3df74314f9cfe6bb61b471e9cf41433e8 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Mon, 18 Jan 2010 20:09:55 +0000 Subject: [PATCH 64/76] fix bloom fast sample, limit sample to gl_max_size, use tableless algorithm for diamond size git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3503 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_bloom.c | 97 ++++++++++---------------------------------- 1 file changed, 21 insertions(+), 76 deletions(-) diff --git a/engine/gl/gl_bloom.c b/engine/gl/gl_bloom.c index 0283d4157..abe795dd2 100644 --- a/engine/gl/gl_bloom.c +++ b/engine/gl/gl_bloom.c @@ -37,37 +37,13 @@ extern vrect_t gl_truescreenrect; ============================================================================== */ -static float Diamond8x[8][8] = { - {0.0f, 0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.0f, 0.0f}, - {0.0f, 0.0f, 0.2f, 0.3f, 0.3f, 0.2f, 0.0f, 0.0f}, - {0.0f, 0.2f, 0.4f, 0.6f, 0.6f, 0.4f, 0.2f, 0.0f}, - {0.1f, 0.3f, 0.6f, 0.9f, 0.9f, 0.6f, 0.3f, 0.1f}, - {0.1f, 0.3f, 0.6f, 0.9f, 0.9f, 0.6f, 0.3f, 0.1f}, - {0.0f, 0.2f, 0.4f, 0.6f, 0.6f, 0.4f, 0.2f, 0.0f}, - {0.0f, 0.0f, 0.2f, 0.3f, 0.3f, 0.2f, 0.0f, 0.0f}, - {0.0f, 0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.0f, 0.0f} }; - -static float Diamond6x[6][6] = { - {0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.0f}, - {0.0f, 0.3f, 0.5f, 0.5f, 0.3f, 0.0f}, - {0.1f, 0.5f, 0.9f, 0.9f, 0.5f, 0.1f}, - {0.1f, 0.5f, 0.9f, 0.9f, 0.5f, 0.1f}, - {0.0f, 0.3f, 0.5f, 0.5f, 0.3f, 0.0f}, - {0.0f, 0.0f, 0.1f, 0.1f, 0.0f, 0.0f} }; - -static float Diamond4x[4][4] = { - {0.3f, 0.4f, 0.4f, 0.3f}, - {0.4f, 0.9f, 0.9f, 0.4f}, - {0.4f, 0.9f, 0.9f, 0.4f}, - {0.3f, 0.4f, 0.4f, 0.3f} }; - - cvar_t r_bloom = FCVAR("r_bloom", "gl_bloom", "0", CVAR_ARCHIVE); - cvar_t r_bloom_alpha = SCVAR("r_bloom_alpha", "0.5"); - cvar_t r_bloom_diamond_size = SCVAR("r_bloom_diamond_size", "8"); - cvar_t r_bloom_intensity = SCVAR("r_bloom_intensity", "1"); - cvar_t r_bloom_darken = SCVAR("r_bloom_darken", "3"); - cvar_t r_bloom_sample_size = SCVARF("r_bloom_sample_size", "256", CVAR_RENDERERLATCH); - cvar_t r_bloom_fast_sample = SCVARF("r_bloom_fast_sample", "0", CVAR_RENDERERLATCH); +cvar_t r_bloom = FCVAR("r_bloom", "gl_bloom", "0", CVAR_ARCHIVE); +cvar_t r_bloom_alpha = SCVAR("r_bloom_alpha", "0.5"); +cvar_t r_bloom_diamond_size = SCVAR("r_bloom_diamond_size", "8"); +cvar_t r_bloom_intensity = SCVAR("r_bloom_intensity", "1"); +cvar_t r_bloom_darken = SCVAR("r_bloom_darken", "3"); +cvar_t r_bloom_sample_size = SCVARF("r_bloom_sample_size", "256", CVAR_RENDERERLATCH); +cvar_t r_bloom_fast_sample = SCVARF("r_bloom_fast_sample", "0", CVAR_RENDERERLATCH); typedef struct { //texture numbers @@ -162,7 +138,7 @@ void R_Bloom_InitEffectTexture(void) Cvar_SetValue (&r_bloom_sample_size, 32); //make sure bloom size is a power of 2 - bs.size_sample = r_bloom_sample_size.value; + bs.size_sample = min(r_bloom_sample_size.value, gl_max_size.value); bloomsizecheck = (float)bs.size_sample; while (bloomsizecheck > 1.0f) bloomsizecheck /= 2.0f; if (bloomsizecheck != 1.0f) @@ -436,54 +412,23 @@ void R_Bloom_GeneratexDiamonds(void) //qglBlendFunc(GL_ONE, GL_ONE); qglBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); - if (r_bloom_diamond_size.value > 7 || r_bloom_diamond_size.value <= 3) { - if (r_bloom_diamond_size.value != 8) - Cvar_SetValue(&r_bloom_diamond_size, 8); + int size = r_bloom_diamond_size.value; + float rad = r_bloom_diamond_size.value / 2.0f; + float point = (r_bloom_diamond_size.value - 1) / 2.0f; + float mult = min(1.0f, r_bloom_intensity.value * 2.0f / rad); - for (i=0; i 5) - { - if (r_bloom_diamond_size.value != 6) - Cvar_SetValue(&r_bloom_diamond_size, 6); - - for(i=0; i 3) - { - if (r_bloom_diamond_size.value != 4) - Cvar_SetValue(&r_bloom_diamond_size, 4); - - for (i=0; i Date: Thu, 21 Jan 2010 03:28:52 +0000 Subject: [PATCH 65/76] Spike's "sendflags" bugfix git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3504 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/sv_ents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/server/sv_ents.c b/engine/server/sv_ents.c index 7d429d1ae..876dccb46 100644 --- a/engine/server/sv_ents.c +++ b/engine/server/sv_ents.c @@ -298,7 +298,7 @@ void SV_EmitCSQCUpdate(client_t *client, sizebuf_t *msg) csqcmsgbuffer.currentbit = 0; //Ask CSQC to write a buffer for it. G_INT(OFS_PARM0) = EDICT_TO_PROG(svprogfuncs, client->edict); - G_INT(OFS_PARM1) = 0xffffff; //psudo compatibility with SendFlags (fte doesn't support properly) + G_FLOAT(OFS_PARM1) = 0xffffff; //psudo compatibility with SendFlags (fte doesn't support properly) pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent); PR_ExecuteProgram(svprogfuncs, ent->xv->SendEntity); if (G_INT(OFS_RETURN)) //0 means not to tell the client about it. @@ -2654,7 +2654,7 @@ void SV_Snapshot_Clear(packet_entities_t *pack) csqcnuments = 0; numnails = 0; } - + /* ============= SVQ3Q1_BuildEntityPacket From 8e3fca993e317b8451a1b65744066eea03e039cc Mon Sep 17 00:00:00 2001 From: Lance Date: Sat, 23 Jan 2010 07:14:37 +0000 Subject: [PATCH 66/76] Quake, Quake2 & Hexen now have fully functional singleplayer cheat menus. Existing tweaks to other menus, like more bloom diamond size combobox options (2x, 4x, 6x, 8x, 10x), video menu has a more reliable width & height value source to display current resolution incase vid_height and vid_width are 0 git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3505 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_options.c | 1163 +++++++++++++++++++++++++++++++++++-- engine/client/menu.c | 9 + engine/client/renderer.c | 60 +- 3 files changed, 1183 insertions(+), 49 deletions(-) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 4598d8e9d..87f19d9bf 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -68,32 +68,50 @@ void M_Menu_Options_f (void) } menu->selecteditem = (union menuoption_s *) - MC_AddConsoleCommand(menu, 16, y, " Customize controls", "menu_keys\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Go to console", "toggleconsole\nplay misc/menu2.wav\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Reset to defaults", "exec default.cfg\nplay misc/menu2.wav\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Customize controls", "menu_keys\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Go to console", "toggleconsole\nplay misc/menu2.wav\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Reset to defaults", "exec default.cfg\nplay misc/menu2.wav\n"); y+=8; - MC_AddSlider(menu, 16, y, " Mouse Speed", &sensitivity, 1, 10, 0.5); y+=8; - MC_AddSlider(menu, 16, y, " Crosshair", &crosshair, 0, 22, 1); y+=8; + MC_AddSlider(menu, 16, y, " Mouse Speed", &sensitivity, 1, 10, 0.5); y+=8; + MC_AddSlider(menu, 16, y, " Crosshair", &crosshair, 0, 22, 1); y+=8; - MC_AddCheckBox(menu, 16, y, " Always Run", NULL,0)->func = M_Options_AlwaysRun; y+=8; - MC_AddCheckBox(menu, 16, y, " Invert Mouse", NULL,0)->func = M_Options_InvertMouse; y+=8; - MC_AddCheckBox(menu, 16, y, " Lookspring", &lookspring,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Lookstrafe", &lookstrafe,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Use old status bar", &cl_sbar,0); y+=8; - MC_AddCheckBox(menu, 16, y, " HUD on left side", &cl_hudswap,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Old-style chatting", &cl_standardchat,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Old-style messages", &cl_standardmsg,0);y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Imitate FPS", "cl_netfps"); y+=8+4; + MC_AddCheckBox(menu, 16, y, " Always Run", NULL,0)->func = M_Options_AlwaysRun; y+=8; + MC_AddCheckBox(menu, 16, y, " Invert Mouse", NULL,0)->func = M_Options_InvertMouse; y+=8; + MC_AddCheckBox(menu, 16, y, " Lookspring", &lookspring,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Lookstrafe", &lookstrafe,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Use old status bar", &cl_sbar,0); y+=8; + MC_AddCheckBox(menu, 16, y, " HUD on left side", &cl_hudswap,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Old-style chatting", &cl_standardchat,0);y+=8; + MC_AddCheckBox(menu, 16, y, " Old-style messages", &cl_standardmsg,0);y+=8; + y+=4;MC_AddEditCvar(menu, 16, y, " Imitate FPS", "cl_netfps"); y+=8+4; - MC_AddConsoleCommand(menu, 16, y, " Video Options", "menu_video\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, "Shadow & Lighting Options", "menu_shadow_lighting\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " 3D Rendering Options", "menu_3d\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Texture Options", "menu_textures\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Particle Options", "menu_particles\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " FPS Options", "menu_fps\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Teamplay Options", "menu_teamplay\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Audio Options", "menu_audio\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Downloads", "menu_download\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Video Options", "menu_video\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Shadow & Lighting Options", "menu_shadow_lighting\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " 3D Rendering Options", "menu_3d\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Texture Options", "menu_textures\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Particle Options", "menu_particles\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " FPS Options", "menu_fps\n"); y+=8; + + if ((mgt != MGT_QUAKE2) && (mgt != MGT_HEXEN2)) + { + MC_AddConsoleCommand(menu, 16, y, " Teamplay Options", "menu_teamplay\n"); y+=8; + } + + if (mgt == MGT_QUAKE2) + { + MC_AddConsoleCommand(menu, 16, y, "Singleplayer Cheat Options", "menu_quake2_spcheats\n"); y+=8; + } + else if (mgt == MGT_HEXEN2) + { + MC_AddConsoleCommand(menu, 16, y, "Singleplayer Cheat Options", "menu_hexen2_spcheats\n"); y+=8; + } + else + { + MC_AddConsoleCommand(menu, 16, y, "Singleplayer Cheat Options", "menu_spcheats\n"); y+=8; + } + + MC_AddConsoleCommand(menu, 16, y, " Audio Options", "menu_audio\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Downloads", "menu_download\n"); y+=8; #ifdef _WIN32 if (!vid_isfullscreen) @@ -102,7 +120,7 @@ void M_Menu_Options_f (void) MC_AddCheckBox(menu, 16, y, " Use Mouse", &_windowed_mouse,0); y+=8; } - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 215, 32, NULL, false); + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 225, 32, NULL, false); } #ifndef __CYGWIN__ @@ -866,11 +884,15 @@ qboolean M_VideoApplyTextures (union menuoption_s *op,struct menu_s *menu,int ke } #endif - if (r_bloom_diamond_size.value >= 8) + if (r_bloom_diamond_size.value >= 10) + currentbloomdiamond = 4; + else if (r_bloom_diamond_size.value >= 8) + currentbloomdiamond = 3; + else if (r_bloom_diamond_size.value >= 6) currentbloomdiamond = 2; - else if (r_bloom_diamond_size.value == 6) + else if (r_bloom_diamond_size.value >= 4) currentbloomdiamond = 1; - else if (r_bloom_diamond_size.value <= 4) + else if (r_bloom_diamond_size.value <= 2) currentbloomdiamond = 0; else currentbloomdiamond = 0; @@ -880,14 +902,20 @@ qboolean M_VideoApplyTextures (union menuoption_s *op,struct menu_s *menu,int ke switch(info->bloomdiamondcombo->selectedoption) { case 0: - Cbuf_AddText("r_bloom_diamond_size 4\n", RESTRICT_LOCAL); + Cbuf_AddText("r_bloom_diamond_size 2\n", RESTRICT_LOCAL); break; case 1: - Cbuf_AddText("r_bloom_diamond_size 6\n", RESTRICT_LOCAL); + Cbuf_AddText("r_bloom_diamond_size 4\n", RESTRICT_LOCAL); break; case 2: + Cbuf_AddText("r_bloom_diamond_size 6\n", RESTRICT_LOCAL); + break; + case 3: Cbuf_AddText("r_bloom_diamond_size 8\n", RESTRICT_LOCAL); break; + case 4: + Cbuf_AddText("r_bloom_diamond_size 10\n", RESTRICT_LOCAL); + break; } } #ifdef _DEBUG @@ -963,9 +991,11 @@ void M_Menu_Textures_f (void) static const char *bloomdiamondoptions[] = { + "2x", "4x", "6x", "8x", + "10x", NULL }; @@ -1032,15 +1062,18 @@ void M_Menu_Textures_f (void) else currentbloomsamplesize = 0; - if (r_bloom_diamond_size.value >= 8) + if (r_bloom_diamond_size.value >= 10) + currentbloomdiamond = 4; + else if (r_bloom_diamond_size.value >= 8) + currentbloomdiamond = 3; + else if (r_bloom_diamond_size.value >= 6) currentbloomdiamond = 2; - else if (r_bloom_diamond_size.value == 6) + else if (r_bloom_diamond_size.value >= 4) currentbloomdiamond = 1; - else if (r_bloom_diamond_size.value <= 4) + else if (r_bloom_diamond_size.value <= 2) currentbloomdiamond = 0; else currentbloomdiamond = 0; - #endif if (!Q_strcasecmp(gl_texturemode.string, "gl_nearest_mipmap_nearest")) @@ -1854,4 +1887,1068 @@ void M_Menu_Teamplay_Items_Status_Location_Misc_f (void) MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); +} + +typedef struct { +menucombo_t *skillcombo; +menucombo_t *mapcombo; +} singleplayerinfo_t; + +qboolean M_Apply_SP_Cheats (union menuoption_s *op,struct menu_s *menu,int key) +{ + singleplayerinfo_t *info = menu->data; + + if (key != K_ENTER) + return false; + + switch(info->skillcombo->selectedoption) + { + case 0: + Cbuf_AddText("skill 0\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("skill 1\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("skill 2\n", RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText("skill 3\n", RESTRICT_LOCAL); + break; + } + + switch(info->mapcombo->selectedoption) + { + case 0: + Cbuf_AddText("map start\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("map e1m2\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("map e1m2\n", RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText("map e1m3\n", RESTRICT_LOCAL); + break; + case 4: + Cbuf_AddText("map e1m4\n", RESTRICT_LOCAL); + break; + case 5: + Cbuf_AddText("map e1m5\n", RESTRICT_LOCAL); + break; + case 6: + Cbuf_AddText("map e1m6\n", RESTRICT_LOCAL); + break; + case 7: + Cbuf_AddText("map e1m7\n", RESTRICT_LOCAL); + break; + case 8: + Cbuf_AddText("map e1m8\n", RESTRICT_LOCAL); + break; + case 9: + Cbuf_AddText("map e2m1\n", RESTRICT_LOCAL); + break; + case 10: + Cbuf_AddText("map e2m2\n", RESTRICT_LOCAL); + break; + case 11: + Cbuf_AddText("map e2m3\n", RESTRICT_LOCAL); + break; + case 12: + Cbuf_AddText("map e2m4\n", RESTRICT_LOCAL); + break; + case 13: + Cbuf_AddText("map e2m5\n", RESTRICT_LOCAL); + break; + case 14: + Cbuf_AddText("map e2m6\n", RESTRICT_LOCAL); + break; + case 15: + Cbuf_AddText("map e2m7\n", RESTRICT_LOCAL); + break; + case 16: + Cbuf_AddText("map e3m1\n", RESTRICT_LOCAL); + break; + case 17: + Cbuf_AddText("map e3m2\n", RESTRICT_LOCAL); + break; + case 18: + Cbuf_AddText("map e3m3\n", RESTRICT_LOCAL); + break; + case 19: + Cbuf_AddText("map e3m4\n", RESTRICT_LOCAL); + break; + case 20: + Cbuf_AddText("map e3m5\n", RESTRICT_LOCAL); + break; + case 21: + Cbuf_AddText("map e3m6\n", RESTRICT_LOCAL); + break; + case 22: + Cbuf_AddText("map e3m7\n", RESTRICT_LOCAL); + break; + case 23: + Cbuf_AddText("map e4m1\n", RESTRICT_LOCAL); + break; + case 24: + Cbuf_AddText("map e4m2\n", RESTRICT_LOCAL); + break; + case 25: + Cbuf_AddText("map e4m3\n", RESTRICT_LOCAL); + break; + case 26: + Cbuf_AddText("map e4m4\n", RESTRICT_LOCAL); + break; + case 27: + Cbuf_AddText("map e4m5\n", RESTRICT_LOCAL); + break; + case 28: + Cbuf_AddText("map e4m6\n", RESTRICT_LOCAL); + break; + case 29: + Cbuf_AddText("map e4m7\n", RESTRICT_LOCAL); + break; + case 30: + Cbuf_AddText("map e4m8\n", RESTRICT_LOCAL); + break; + case 31: + Cbuf_AddText("map end\n", RESTRICT_LOCAL); + break; + } + + M_RemoveMenu(menu); + Cbuf_AddText("menu_spcheats\n", RESTRICT_LOCAL); + return true; +} + + +void M_Menu_Singleplayer_Cheats_f (void) +{ + + static const char *skilloptions[] = + { + "Easy", + "Normal", + "Hard", + "Nightmare", + "None Set", + NULL + }; + + static const char *mapoptions[] = + { + "Start (Introduction)", + "E1M1 (The Slipgate Complex)", + "E1M2 (Castle Of The Damned)", + "E1M3 (The Necropolis)", + "E1M4 (The Grisly Grotto)", + "E1M5 (Gloom Keep)", + "E1M6 (The Door To Chthon)", + "E1M7 (The House Of Chthon)", + "E1M8 (Ziggarat Vertigo)", + "E2M1 (The Installation)", + "E2M2 (The Ogre Citadel)", + "E2M3 (The Crypt Of Decay)", + "E2M4 (The Ebon Fortress)", + "E2M5 (The Wizard's Manse)", + "E2M6 (The Dismal Oubliette", + "E2M7 (The Underearth)", + "E3M1 (Termination Central)", + "E3M2 (The Vaults Of Zin)", + "E3M3 (The Tomb Of Terror)", + "E3M4 (Satan's Dark Delight)", + "E3M5 (The Wind Tunnels)", + "E3M6 (Chambers Of Torment)", + "E3M7 (Tha Haunted Halls)", + "E4M1 (The Sewage System)", + "E4M2 (The Tower Of Despair)", + "E4M3 (The Elder God Shrine)", + "E4M4 (The Palace Of Hate)", + "E4M5 (Hell's Atrium)", + "E4M6 (The Pain Maze)", + "E4M7 (Azure Agony)", + "E4M8 (The Nameless City)", + "End (Shub-Niggurath's Pit)", + NULL + }; + + int y = 32; + singleplayerinfo_t *info; + menu_t *menu; + int mgt; + int cursorpositionY; + int currentskill; + int currentmap; + extern cvar_t host_mapname, sv_gravity, sv_cheats, sv_friction, skill; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(sizeof(singleplayerinfo_t)); + info = menu->data; + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 8; + } + else if (mgt == MGT_HEXEN2) + { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + cursorpositionY = (y + 24); + + currentskill = skill.value; + + if ( !currentskill ) + currentskill = 4; // no skill selected + + if ( strcmp ( host_mapname.string, "" ) == 0) + currentmap = 0; + else if ( stricmp ( host_mapname.string, "start" ) == 0 ) + currentmap = 0; + else if ( stricmp ( host_mapname.string, "e1m1" ) == 0 ) + currentmap = 1; + else if ( stricmp ( host_mapname.string, "e1m2" ) == 0 ) + currentmap = 2; + else if ( stricmp ( host_mapname.string, "e1m3" ) == 0 ) + currentmap = 3; + else if ( stricmp ( host_mapname.string, "e1m4" ) == 0 ) + currentmap = 4; + else if ( stricmp ( host_mapname.string, "e1m5" ) == 0 ) + currentmap = 5; + else if ( stricmp ( host_mapname.string, "e1m6" ) == 0 ) + currentmap = 6; + else if ( stricmp ( host_mapname.string, "e1m7" ) == 0 ) + currentmap = 7; + else if ( stricmp ( host_mapname.string, "e1m8" ) == 0 ) + currentmap = 8; + else if ( stricmp ( host_mapname.string, "e2m1" ) == 0 ) + currentmap = 9; + else if ( stricmp ( host_mapname.string, "e2m2" ) == 0 ) + currentmap = 10; + else if ( stricmp ( host_mapname.string, "e2m3" ) == 0 ) + currentmap = 11; + else if ( stricmp ( host_mapname.string, "e2m4" ) == 0 ) + currentmap = 12; + else if ( stricmp ( host_mapname.string, "e2m5" ) == 0 ) + currentmap = 13; + else if ( stricmp ( host_mapname.string, "e2m6" ) == 0 ) + currentmap = 14; + else if ( stricmp ( host_mapname.string, "e2m7" ) == 0 ) + currentmap = 15; + else if ( stricmp ( host_mapname.string, "e3m1" ) == 0 ) + currentmap = 16; + else if ( stricmp ( host_mapname.string, "e3m2" ) == 0 ) + currentmap = 17; + else if ( stricmp ( host_mapname.string, "e3m3" ) == 0 ) + currentmap = 18; + else if ( stricmp ( host_mapname.string, "e3m4" ) == 0 ) + currentmap = 19; + else if ( stricmp ( host_mapname.string, "e3m5" ) == 0 ) + currentmap = 20; + else if ( stricmp ( host_mapname.string, "e3m6" ) == 0 ) + currentmap = 21; + else if ( stricmp ( host_mapname.string, "e3m7" ) == 0 ) + currentmap = 22; + else if ( stricmp ( host_mapname.string, "e4m1" ) == 0 ) + currentmap = 23; + else if ( stricmp ( host_mapname.string, "e4m2" ) == 0 ) + currentmap = 24; + else if ( stricmp ( host_mapname.string, "e4m3" ) == 0 ) + currentmap = 25; + else if ( stricmp ( host_mapname.string, "e4m4" ) == 0 ) + currentmap = 26; + else if ( stricmp ( host_mapname.string, "e4m5" ) == 0 ) + currentmap = 27; + else if ( stricmp ( host_mapname.string, "e4m6" ) == 0 ) + currentmap = 28; + else if ( stricmp ( host_mapname.string, "e4m7" ) == 0 ) + currentmap = 29; + else if ( stricmp ( host_mapname.string, "e4m8" ) == 0 ) + currentmap = 30; + else if ( stricmp ( host_mapname.string, "end" ) == 0 ) + currentmap = 31; + else + currentmap = 0; + + MC_AddRedText(menu, 16, y, " Quake Singleplayer Cheats", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; + info->skillcombo = MC_AddCombo(menu,16, y, " Difficulty", skilloptions, currentskill); y+=8; + info->mapcombo = MC_AddCombo(menu,16, y, " Map", mapoptions, currentmap); y+=8; + MC_AddCheckBox(menu, 16, y, " Cheats", &sv_cheats,0); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Toggle Godmode", "god\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Toggle Flymode", "fly\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Toggle Noclip", "noclip\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Quad Damage", "impulse 255\n"); y+=8; + MC_AddSlider(menu, 16, y, " Gravity", &sv_gravity,0,800,25); y+=8; + MC_AddSlider(menu, 16, y, " Forward Speed", &cl_forwardspeed,0,1000,50); y+=8; + MC_AddSlider(menu, 16, y, " Side Speed", &cl_sidespeed,0,1000,50); y+=8; + MC_AddSlider(menu, 16, y, " Back Speed", &cl_backspeed,0,1000,50); y+=8; + MC_AddSlider(menu, 16, y, " Max Movement Speed", &sv_maxspeed,0,1000,50); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Silver & Gold Keys", "impulse 13\nimpulse 14\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, "All Weapons & Items", "impulse 9\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, "No Enemy Targetting", "notarget\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Restart Map", "kill\n"); y+=8; + + y+=8; + MC_AddCommand(menu, 16, y, " Apply Changes", M_Apply_SP_Cheats); y+=8; + + menu->selecteditem = (union menuoption_s *)info->skillcombo; + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 170, cursorpositionY, NULL, false); +} + +// Quake 2 + +typedef struct { +menucombo_t *skillcombo; +menucombo_t *mapcombo; +} singleplayerq2info_t; + +qboolean M_Apply_SP_Cheats_Q2 (union menuoption_s *op,struct menu_s *menu,int key) +{ + singleplayerq2info_t *info = menu->data; + + if (key != K_ENTER) + return false; + + switch(info->skillcombo->selectedoption) + { + case 0: + Cbuf_AddText("skill 0\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("skill 1\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("skill 2\n", RESTRICT_LOCAL); + break; + } + + switch(info->mapcombo->selectedoption) + { + case 0: + Cbuf_AddText("map base1\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("map base2\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("map base3\n", RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText("map train\n", RESTRICT_LOCAL); + break; + case 4: + Cbuf_AddText("map bunk1\n", RESTRICT_LOCAL); + break; + case 5: + Cbuf_AddText("map ware1\n", RESTRICT_LOCAL); + break; + case 6: + Cbuf_AddText("map ware2\n", RESTRICT_LOCAL); + break; + case 7: + Cbuf_AddText("map jail1\n", RESTRICT_LOCAL); + break; + case 8: + Cbuf_AddText("map jail2\n", RESTRICT_LOCAL); + break; + case 9: + Cbuf_AddText("map jail3\n", RESTRICT_LOCAL); + break; + case 10: + Cbuf_AddText("map jail4\n", RESTRICT_LOCAL); + break; + case 11: + Cbuf_AddText("map jail5\n", RESTRICT_LOCAL); + break; + case 12: + Cbuf_AddText("map security\n", RESTRICT_LOCAL); + break; + case 13: + Cbuf_AddText("map mintro\n", RESTRICT_LOCAL); + break; + case 14: + Cbuf_AddText("map mine1\n", RESTRICT_LOCAL); + break; + case 15: + Cbuf_AddText("map mine2\n", RESTRICT_LOCAL); + break; + case 16: + Cbuf_AddText("map mine3\n", RESTRICT_LOCAL); + break; + case 17: + Cbuf_AddText("map mine4\n", RESTRICT_LOCAL); + break; + case 18: + Cbuf_AddText("map fact1\n", RESTRICT_LOCAL); + break; + case 19: + Cbuf_AddText("map fact3\n", RESTRICT_LOCAL); + break; + case 20: + Cbuf_AddText("map fact2\n", RESTRICT_LOCAL); + break; + case 21: + Cbuf_AddText("map power1\n", RESTRICT_LOCAL); + break; + case 22: + Cbuf_AddText("map power2\n", RESTRICT_LOCAL); + break; + case 23: + Cbuf_AddText("map cool1\n", RESTRICT_LOCAL); + break; + case 24: + Cbuf_AddText("map waste1\n", RESTRICT_LOCAL); + break; + case 25: + Cbuf_AddText("map waste2\n", RESTRICT_LOCAL); + break; + case 26: + Cbuf_AddText("map waste3\n", RESTRICT_LOCAL); + break; + case 27: + Cbuf_AddText("map biggun\n", RESTRICT_LOCAL); + break; + case 28: + Cbuf_AddText("map hangar1\n", RESTRICT_LOCAL); + break; + case 29: + Cbuf_AddText("map space\n", RESTRICT_LOCAL); + break; + case 30: + Cbuf_AddText("map lab\n", RESTRICT_LOCAL); + break; + case 31: + Cbuf_AddText("map hangar2\n", RESTRICT_LOCAL); + break; + case 32: + Cbuf_AddText("map command\n", RESTRICT_LOCAL); + break; + case 33: + Cbuf_AddText("map strike\n", RESTRICT_LOCAL); + break; + case 34: + Cbuf_AddText("map city1\n", RESTRICT_LOCAL); + break; + case 35: + Cbuf_AddText("map city2\n", RESTRICT_LOCAL); + break; + case 36: + Cbuf_AddText("map city3\n", RESTRICT_LOCAL); + break; + case 37: + Cbuf_AddText("map boss1\n", RESTRICT_LOCAL); + break; + case 38: + Cbuf_AddText("map boss2\n", RESTRICT_LOCAL); + break; + } + + M_RemoveMenu(menu); + Cbuf_AddText("menu_quake2_spcheats\n", RESTRICT_LOCAL); + return true; +} + + +void M_Menu_Singleplayer_Cheats_Quake2_f (void) +{ + + static const char *skilloptions[] = + { + "Easy", + "Normal", + "Hard", + "None Set", + NULL + }; + + static const char *mapoptions[] = + { + "base1 (Unit 1 Base Unit: Outer Base)", + "base2 (Unit 1 Base Unit: Installation)", + "base3 (Unit 1 Base Unit: Comm Center)", + "train (Unit 1 Base Unit: Lost Station)", + "bunk1 (Unit 2 Warehouse Unit: Ammo Depot)", + "ware1 (Unit 2 Warehouse Unit: Supply Station)", + "ware2 (Unit 2 Warehouse Unit: Warehouse)", + "jail1 (Unit 3 Jail Unit: Main Gate)", + "jail2 (Unit 3 Jail Unit: Destination Center)", + "jail3 (Unit 3 Jail Unit: Security Compex)", + "jail4 (Unit 3 Jail Unit: Torture Chambers)", + "jail5 (Unit 3 Jail Unit: Guard House)", + "security (Unit 3 Jail Unit: Grid Control)", + "mintro (Unit 4 Mine Unit: Mine Entrance)", + "mine1 (Unit 4 Mine Unit: Upper Mines)", + "mine2 (Unit 4 Mine Unit: Borehole)", + "mine3 (Unit 4 Mine Unit: Drilling Area)", + "mine4 (Unit 4 Mine Unit: Lower Mines)", + "fact1 (Unit 5 Factory Unit: Receiving Center)", + "fact3 (Unit 5 Factory Unit: Sudden Death)", + "fact2 (Unit 5 Factory Unit: Processing Plant)", + "power1 (Unit 6 Power Unit/Big Gun: Power Plant)", + "power2 (Unit 6 Power Unit/Big Gun: The Reactor)", + "cool1 (Unit 6 Power Unit/Big Gun: Cooling Facility)", + "waste1 (Unit 6 Power Unit/Big Gun: Toxic Waste Dump)", + "waste2 (Unit 6 Power Unit/Big Gun: Pumping Station 1)", + "waste3 (Unit 6 Power Unit/Big Gun: Pumping Station 2)", + "biggun (Unit 6 Power Unit/Big Gun: Big Gun)", + "hangar1 (Unit 7 Hangar Unit: Outer Hangar)", + "space (Unit 7 Hangar Unit: Comm Satelite)", + "lab (Unit 7 Hangar Unit: Research Lab)", + "hangar2 (Unit 7 Hangar Unit: Inner Hangar)", + "command (Unit 7 Hangar Unit: Launch Command)", + "strike (Unit 7 Hangar Unit: Outlands)", + "city1 (Unit 8 City Unit: Outer Courts)", + "city2 (Unit 8 City Unit: Lower Palace)", + "city3 (Unit 8 City Unit: Upper Palace)", + "boss1 (Unit 9 Boss Levels: Inner Chamber)", + "boss2 (Unit 9 Boss Levels: Final Showdown)", + NULL + }; + + int y = 32; + singleplayerq2info_t *info; + menu_t *menu; + int mgt; + int cursorpositionY; + int currentskill; + int currentmap; + extern cvar_t host_mapname, sv_gravity, sv_cheats, sv_friction, skill; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(sizeof(singleplayerq2info_t)); + info = menu->data; + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 8; + } + else if (mgt == MGT_HEXEN2) + { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + cursorpositionY = (y + 24); + + currentskill = skill.value; + + if ( !currentskill ) + currentskill = 4; // no skill selected + + if ( strcmp ( host_mapname.string, "" ) == 0) + currentmap = 0; + else if ( stricmp ( host_mapname.string, "base1" ) == 0 ) + currentmap = 0; + else if ( stricmp ( host_mapname.string, "base2" ) == 0 ) + currentmap = 1; + else if ( stricmp ( host_mapname.string, "base3" ) == 0 ) + currentmap = 2; + else if ( stricmp ( host_mapname.string, "train" ) == 0 ) + currentmap = 3; + else if ( stricmp ( host_mapname.string, "bunk1" ) == 0 ) + currentmap = 4; + else if ( stricmp ( host_mapname.string, "ware1" ) == 0 ) + currentmap = 5; + else if ( stricmp ( host_mapname.string, "ware2" ) == 0 ) + currentmap = 6; + else if ( stricmp ( host_mapname.string, "jail1" ) == 0 ) + currentmap = 7; + else if ( stricmp ( host_mapname.string, "jail2" ) == 0 ) + currentmap = 8; + else if ( stricmp ( host_mapname.string, "jail3" ) == 0 ) + currentmap = 9; + else if ( stricmp ( host_mapname.string, "jail4" ) == 0 ) + currentmap = 10; + else if ( stricmp ( host_mapname.string, "jail5" ) == 0 ) + currentmap = 11; + else if ( stricmp ( host_mapname.string, "security" ) == 0 ) + currentmap = 12; + else if ( stricmp ( host_mapname.string, "mintro" ) == 0 ) + currentmap = 13; + else if ( stricmp ( host_mapname.string, "mine1" ) == 0 ) + currentmap = 14; + else if ( stricmp ( host_mapname.string, "mine2" ) == 0 ) + currentmap = 15; + else if ( stricmp ( host_mapname.string, "mine3" ) == 0 ) + currentmap = 16; + else if ( stricmp ( host_mapname.string, "mine4" ) == 0 ) + currentmap = 17; + else if ( stricmp ( host_mapname.string, "fact1" ) == 0 ) + currentmap = 18; + else if ( stricmp ( host_mapname.string, "fact3" ) == 0 ) + currentmap = 19; + else if ( stricmp ( host_mapname.string, "fact2" ) == 0 ) + currentmap = 20; + else if ( stricmp ( host_mapname.string, "power1" ) == 0 ) + currentmap = 21; + else if ( stricmp ( host_mapname.string, "power2" ) == 0 ) + currentmap = 22; + else if ( stricmp ( host_mapname.string, "cool1" ) == 0 ) + currentmap = 23; + else if ( stricmp ( host_mapname.string, "waste1" ) == 0 ) + currentmap = 24; + else if ( stricmp ( host_mapname.string, "waste2" ) == 0 ) + currentmap = 25; + else if ( stricmp ( host_mapname.string, "waste3" ) == 0 ) + currentmap = 26; + else if ( stricmp ( host_mapname.string, "biggun" ) == 0 ) + currentmap = 27; + else if ( stricmp ( host_mapname.string, "hangar1" ) == 0 ) + currentmap = 28; + else if ( stricmp ( host_mapname.string, "space" ) == 0 ) + currentmap = 29; + else if ( stricmp ( host_mapname.string, "lab" ) == 0 ) + currentmap = 30; + else if ( stricmp ( host_mapname.string, "hangar2" ) == 0 ) + currentmap = 31; + else if ( stricmp ( host_mapname.string, "command" ) == 0 ) + currentmap = 32; + else if ( stricmp ( host_mapname.string, "strike" ) == 0 ) + currentmap = 33; + else if ( stricmp ( host_mapname.string, "city1" ) == 0 ) + currentmap = 34; + else if ( stricmp ( host_mapname.string, "city2" ) == 0 ) + currentmap = 35; + else if ( stricmp ( host_mapname.string, "city3" ) == 0 ) + currentmap = 36; + else if ( stricmp ( host_mapname.string, "boss1" ) == 0 ) + currentmap = 37; + else if ( stricmp ( host_mapname.string, "boss2" ) == 0 ) + currentmap = 38; + else + currentmap = 0; + + MC_AddRedText(menu, 16, y, " Quake2 Singleplayer Cheats", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; + info->skillcombo = MC_AddCombo(menu,16, y, " Difficulty", skilloptions, currentskill); y+=8; + info->mapcombo = MC_AddCombo(menu,16, y, " Map", mapoptions, currentmap); y+=8; + MC_AddCheckBox(menu, 16, y, " Cheats", &sv_cheats,0); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Toggle Godmode", "god\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Toggle Noclip", "noclip\n"); y+=8; + MC_AddSlider(menu, 16, y, " Gravity", &sv_gravity,0,850,25); y+=8; + MC_AddSlider(menu, 16, y, " Forward Speed", &cl_forwardspeed,0,1000,50); y+=8; + MC_AddSlider(menu, 16, y, " Side Speed", &cl_sidespeed,0,1000,50); y+=8; + MC_AddSlider(menu, 16, y, " Back Speed", &cl_backspeed,0,1000,50); y+=8; + MC_AddSlider(menu, 16, y, " Max Movement Speed", &sv_maxspeed,0,1000,50); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Unlimited Ammo", "dmflags 8192\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Quad Damage", "give quad damage\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Blue & Red Key", "give blue key\ngive red key\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Pyramid Key", "give pyramid key\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, "All Weapons & Items", "give all\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Data Spinner", "give data spinner\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Power Cube", "give power cube\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Data CD", "give data cd\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Ammo Pack", "give ammo pack\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Bandolier", "give bandolier\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Adrenaline", "give adrenaline\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Ancient Head", "give ancient head\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Environment Suit", "give environment suit\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Rebreather", "give rebreather\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Invulnerability", "give invulnerability\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Silencer", "give silencer\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Power Shield", "give power shield\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Commander's Head", "give commander's head\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Security Pass", "give security pass\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Airstrike Marker", "give airstrike marker\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Restart Map", va("map %s\n", host_mapname.string)); y+=8; + + y+=8; + MC_AddCommand(menu, 16, y, " Apply Changes", M_Apply_SP_Cheats_Q2); y+=8; + + menu->selecteditem = (union menuoption_s *)info->skillcombo; + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 170, cursorpositionY, NULL, false); +} + +// Hexen 2 + +// Quake 2 + +typedef struct { +menucombo_t *skillcombo; +menucombo_t *mapcombo; +} singleplayerh2info_t; + +qboolean M_Apply_SP_Cheats_H2 (union menuoption_s *op,struct menu_s *menu,int key) +{ + singleplayerh2info_t *info = menu->data; + + if (key != K_ENTER) + return false; + + switch(info->skillcombo->selectedoption) + { + case 0: + Cbuf_AddText("skill 0\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("skill 1\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("skill 2\n", RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText("skill 3\n", RESTRICT_LOCAL); + break; + } + + switch(info->mapcombo->selectedoption) + { + case 0: + Cbuf_AddText("map demo1\n", RESTRICT_LOCAL); + break; + case 1: + Cbuf_AddText("map demo2\n", RESTRICT_LOCAL); + break; + case 2: + Cbuf_AddText("map demo3\n", RESTRICT_LOCAL); + break; + case 3: + Cbuf_AddText("map village1\n", RESTRICT_LOCAL); + break; + case 4: + Cbuf_AddText("map village2\n", RESTRICT_LOCAL); + break; + case 5: + Cbuf_AddText("map village3\n", RESTRICT_LOCAL); + break; + case 6: + Cbuf_AddText("map village4\n", RESTRICT_LOCAL); + break; + case 7: + Cbuf_AddText("map village5\n", RESTRICT_LOCAL); + break; + case 8: + Cbuf_AddText("map rider1a\n", RESTRICT_LOCAL); + break; + case 9: + Cbuf_AddText("map meso1\n", RESTRICT_LOCAL); + break; + case 10: + Cbuf_AddText("map meso2\n", RESTRICT_LOCAL); + break; + case 11: + Cbuf_AddText("map meso3\n", RESTRICT_LOCAL); + break; + case 12: + Cbuf_AddText("map meso4\n", RESTRICT_LOCAL); + break; + case 13: + Cbuf_AddText("map meso5\n", RESTRICT_LOCAL); + break; + case 14: + Cbuf_AddText("map meso6\n", RESTRICT_LOCAL); + break; + case 15: + Cbuf_AddText("map meso8\n", RESTRICT_LOCAL); + break; + case 16: + Cbuf_AddText("map meso9\n", RESTRICT_LOCAL); + break; + case 17: + Cbuf_AddText("map egypt1\n", RESTRICT_LOCAL); + break; + case 18: + Cbuf_AddText("map egypt2\n", RESTRICT_LOCAL); + break; + case 19: + Cbuf_AddText("map egypt3\n", RESTRICT_LOCAL); + break; + case 20: + Cbuf_AddText("map egypt4\n", RESTRICT_LOCAL); + break; + case 21: + Cbuf_AddText("map egypt5\n", RESTRICT_LOCAL); + break; + case 22: + Cbuf_AddText("map egypt6\n", RESTRICT_LOCAL); + break; + case 23: + Cbuf_AddText("map egypt7\n", RESTRICT_LOCAL); + break; + case 24: + Cbuf_AddText("map rider2c\n", RESTRICT_LOCAL); + break; + case 25: + Cbuf_AddText("map romeric1\n", RESTRICT_LOCAL); + break; + case 26: + Cbuf_AddText("map romeric2\n", RESTRICT_LOCAL); + break; + case 27: + Cbuf_AddText("map romeric3\n", RESTRICT_LOCAL); + break; + case 28: + Cbuf_AddText("map romeric4\n", RESTRICT_LOCAL); + break; + case 29: + Cbuf_AddText("map romeric5\n", RESTRICT_LOCAL); + break; + case 30: + Cbuf_AddText("map romeric6\n", RESTRICT_LOCAL); + break; + case 31: + Cbuf_AddText("map romeric7\n", RESTRICT_LOCAL); + break; + case 32: + Cbuf_AddText("map castle4\n", RESTRICT_LOCAL); + break; + case 33: + Cbuf_AddText("map castle5\n", RESTRICT_LOCAL); + break; + case 34: + Cbuf_AddText("map cath\n", RESTRICT_LOCAL); + break; + case 35: + Cbuf_AddText("map tower\n", RESTRICT_LOCAL); + break; + case 36: + Cbuf_AddText("map eidolon\n", RESTRICT_LOCAL); + break; + } + + M_RemoveMenu(menu); + Cbuf_AddText("menu_hexen2_spcheats\n", RESTRICT_LOCAL); + return true; +} + + +void M_Menu_Singleplayer_Cheats_Hexen2_f (void) +{ + + static const char *skilloptions[] = + { + "Easy", + "Normal", + "Hard", + "Nightmare", + "None Set", + NULL + }; + + static const char *mapoptions[] = + { + "demo1 (Blackmarsh: Hub 1 Blackmarsh)", + "demo2 (Barbican: Hub 1 Blackmarsh)", + "demo3 (The Mill: Hub 1 Blackmarsh)", + "village1 (King's Court: Hub 1 Blackmarsh)", + "village3 (Stables: Hub 1 Blackmarsh)", + "village2 (Inner Courtyard: Hub 1 Blackmarsh)", + "village4 (Palance Entrance: Hub 1 Blackmarsh)", + "village5 (The Forgotten Chapel: Hub 1 Blackmarsh)", + "rider1a (Famine's Domain: Hub 1 Blackmarsh)", + "meso1 (Palance of Columns: Hub 2 Mazaera)", + "meso2 (Plaza of the Sun: Hub 2 Mazaera)", + "meso3 (Square of the Stream: Hub 2 Mazaera)", + "meso4 (Tomb of the High Priest: Hub 2 Mazaera)", + "meso5 (Obelisk of the Moon: Hub 2 Mazaera)", + "meso6 (Court of 1000 Warriors: Hub 2 Mazaera)", + "meso8 (Bridge of Stars: Hub 2 Mazaera)", + "meso9 (Well of Souls: Hub 2 Mazaera)", + "egypt1 (Temple of Horus: Hub 3 Thysis)", + "egypt2 (Ancient Tempor of Nefertum: Hub 3 Thysis)", + "egypt3 (Tempor of Nefertum: Hub 3 Thysis)", + "egypt4 (Palace of the Pharaoh: Hub 3 Thysis", + "egypt5 (Pyramid of Anubus: Hub 3 Thysis)", + "egypt6 (Temple of Light: Hub 3 Thysis)", + "egypt7 (Shrine of Naos: Hub 3 Thysis)", + "rider2c (Pestilence's Lair: Hub 3 Thysis)", + "romeric1 (The Hall of Heroes: Hub 4 Septimus)", + "romeric2 (Gardens of Athena: Hub 4 Septimus)", + "romeric3 (Forum of Zeus: Hub 4 Septimus)", + "romeric4 (Baths of Demetrius: Hub 4 Septimus)", + "romeric5 (Temple of Mars: Hub 4 Septimus)", + "romeric6 (Coliseum of War: Hub 4 Septimus)", + "romeric7 (Reflecting Pool: Hub 4 Septimus)", + "castle4 (The Underhalls: Hub 5 Return to Blackmarsh)", + "castle5 (Eidolon's Ordeal: Hub 5 Return to Blackmarsh)", + "cath (Cathedral: Hub 5 Return to Blackmarsh)", + "tower (Tower of the Dark Mage: Hub 5 Return to Blackmarsh)", + "eidolon (Eidolon's Lair: Hub 5 Return to Blackmarsh)", + NULL + }; + + int y = 32; + singleplayerh2info_t *info; + menu_t *menu; + int mgt; + int cursorpositionY; + int currentskill; + int currentmap; + extern cvar_t host_mapname, sv_gravity, sv_cheats, sv_friction, skill; + + key_dest = key_menu; + m_state = m_complex; + + menu = M_CreateMenu(sizeof(singleplayerh2info_t)); + info = menu->data; + + mgt = M_GameType(); + + if (mgt == MGT_QUAKE2) + { + MC_AddCenterPicture(menu, 4, "pics/m_banner_options"); + y += 8; + } + else if (mgt == MGT_HEXEN2) + { + MC_AddPicture(menu, 16, 0, "gfx/menu/hplaque.lmp"); + MC_AddCenterPicture(menu, 0, "gfx/menu/title4.lmp"); + y += 25+8; + } + else + { + MC_AddPicture(menu, 16, 4, "gfx/qplaque.lmp"); + MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp"); + } + + cursorpositionY = (y + 24); + + currentskill = skill.value; + + if ( !currentskill ) + currentskill = 4; // no skill selected + + if ( strcmp ( host_mapname.string, "" ) == 0) + currentmap = 0; + else if ( stricmp ( host_mapname.string, "demo1" ) == 0 ) + currentmap = 0; + else if ( stricmp ( host_mapname.string, "demo2" ) == 0 ) + currentmap = 1; + else if ( stricmp ( host_mapname.string, "demo3" ) == 0 ) + currentmap = 2; + else if ( stricmp ( host_mapname.string, "village1" ) == 0 ) + currentmap = 3; + else if ( stricmp ( host_mapname.string, "village2" ) == 0 ) + currentmap = 4; + else if ( stricmp ( host_mapname.string, "village3" ) == 0 ) + currentmap = 5; + else if ( stricmp ( host_mapname.string, "village4" ) == 0 ) + currentmap = 6; + else if ( stricmp ( host_mapname.string, "village5" ) == 0 ) + currentmap = 7; + else if ( stricmp ( host_mapname.string, "rider1a" ) == 0 ) + currentmap = 8; + else if ( stricmp ( host_mapname.string, "meso1" ) == 0 ) + currentmap = 9; + else if ( stricmp ( host_mapname.string, "meso2" ) == 0 ) + currentmap = 10; + else if ( stricmp ( host_mapname.string, "meso3" ) == 0 ) + currentmap = 11; + else if ( stricmp ( host_mapname.string, "meso4" ) == 0 ) + currentmap = 12; + else if ( stricmp ( host_mapname.string, "meso5" ) == 0 ) + currentmap = 13; + else if ( stricmp ( host_mapname.string, "meso6" ) == 0 ) + currentmap = 14; + else if ( stricmp ( host_mapname.string, "meso8" ) == 0 ) + currentmap = 15; + else if ( stricmp ( host_mapname.string, "meso9" ) == 0 ) + currentmap = 16; + else if ( stricmp ( host_mapname.string, "egypt1" ) == 0 ) + currentmap = 17; + else if ( stricmp ( host_mapname.string, "egypt2" ) == 0 ) + currentmap = 18; + else if ( stricmp ( host_mapname.string, "egypt3" ) == 0 ) + currentmap = 19; + else if ( stricmp ( host_mapname.string, "egypt4" ) == 0 ) + currentmap = 20; + else if ( stricmp ( host_mapname.string, "egypt5" ) == 0 ) + currentmap = 21; + else if ( stricmp ( host_mapname.string, "egypt6" ) == 0 ) + currentmap = 22; + else if ( stricmp ( host_mapname.string, "egypt7" ) == 0 ) + currentmap = 23; + else if ( stricmp ( host_mapname.string, "rider2c" ) == 0 ) + currentmap = 24; + else if ( stricmp ( host_mapname.string, "romeric1" ) == 0 ) + currentmap = 25; + else if ( stricmp ( host_mapname.string, "romeric2" ) == 0 ) + currentmap = 26; + else if ( stricmp ( host_mapname.string, "romeric3" ) == 0 ) + currentmap = 27; + else if ( stricmp ( host_mapname.string, "romeric4" ) == 0 ) + currentmap = 28; + else if ( stricmp ( host_mapname.string, "romeric5" ) == 0 ) + currentmap = 29; + else if ( stricmp ( host_mapname.string, "romeric6" ) == 0 ) + currentmap = 30; + else if ( stricmp ( host_mapname.string, "romeric7" ) == 0 ) + currentmap = 31; + else if ( stricmp ( host_mapname.string, "castle4" ) == 0 ) + currentmap = 32; + else if ( stricmp ( host_mapname.string, "castle5" ) == 0 ) + currentmap = 33; + else if ( stricmp ( host_mapname.string, "cath" ) == 0 ) + currentmap = 34; + else if ( stricmp ( host_mapname.string, "tower" ) == 0 ) + currentmap = 35; + else if ( stricmp ( host_mapname.string, "eidolon" ) == 0 ) + currentmap = 36; + else + currentmap = 0; + + MC_AddRedText(menu, 16, y, " Hexen2 Singleplayer Cheats", false); y+=8; + MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; + y+=8; +info->skillcombo = MC_AddCombo(menu,16, y, " Difficulty", skilloptions, currentskill); y+=8; +info->mapcombo = MC_AddCombo(menu,16, y, " Map", mapoptions, currentmap); y+=8; + MC_AddCheckBox(menu, 16, y, " Cheats", &sv_cheats,0); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Toggle Godmode", "god\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Toggle Flymode", "fly\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Toggle Noclip", "noclip\n"); y+=8; + MC_AddSlider(menu, 16, y, " Gravity", &sv_gravity,0,800,25); y+=8; + MC_AddSlider(menu, 16, y, " Forward Speed", &cl_forwardspeed,0,1000,50); y+=8; + MC_AddSlider(menu, 16, y, " Side Speed", &cl_sidespeed,0,1000,50); y+=8; + MC_AddSlider(menu, 16, y, " Back Speed", &cl_backspeed,0,1000,50); y+=8; + MC_AddSlider(menu, 16, y, " Max Movement Speed", &sv_maxspeed,0,1000,50); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Sheep Transformation", "impulse 14\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Change To Paladin (lvl3+)", "impulse 171\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Change To Crusader (lvl3+)", "impulse 172\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, "Change to Necromancer (lvl3+)", "impulse 173\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Change to Assassin (lvl3+)", "impulse 174\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Remove Monsters", "impulse 35\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Freeze Monsters", "impulse 36\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Unfreeze Monsters", "impulse 37\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Increase Level By 1", "impulse 40\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Increase Experience", "impulse 41\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Display Co-ordinates", "impulse 42\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " All Weapons & Mana", "impulse 9\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " All Weapons & Mana & Items", "impulse 43\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " No Enemy Targetting", "notarget\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Enable Crosshair", "crosshair 1\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " 20 Of Each Artifact", "impulse 299\n"); y+=8; + MC_AddConsoleCommand(menu, 16, y, " Restart Map", "impulse 99\n"); y+=8; + + y+=8; + MC_AddCommand(menu, 16, y, " Apply Changes", M_Apply_SP_Cheats_H2); y+=8; + + menu->selecteditem = (union menuoption_s *)info->skillcombo; + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 250, cursorpositionY, NULL, false); } \ No newline at end of file diff --git a/engine/client/menu.c b/engine/client/menu.c index 29b437019..f52fa15e1 100644 --- a/engine/client/menu.c +++ b/engine/client/menu.c @@ -928,6 +928,9 @@ void M_Menu_Teamplay_Items_Powerups_f (void); void M_Menu_Teamplay_Items_Ammo_Health_f (void); void M_Menu_Teamplay_Items_Team_Fortress_f (void); void M_Menu_Teamplay_Items_Status_Location_Misc_f (void); +void M_Menu_Singleplayer_Cheats_f (void); +void M_Menu_Singleplayer_Cheats_Quake2_f (void); +void M_Menu_Singleplayer_Cheats_Hexen2_f (void); void M_Menu_Particles_f (void); void M_Menu_ParticleSets_f (void); void M_Menu_Audio_Speakers_f (void); @@ -975,6 +978,9 @@ void M_Init_Internal (void) #ifndef __CYGWIN__ Cmd_AddRemCommand ("menu_speakers", M_Menu_Audio_Speakers_f); #endif + Cmd_AddRemCommand ("menu_spcheats", M_Menu_Singleplayer_Cheats_f); + Cmd_AddRemCommand ("menu_quake2_spcheats", M_Menu_Singleplayer_Cheats_Quake2_f); + Cmd_AddRemCommand ("menu_hexen2_spcheats", M_Menu_Singleplayer_Cheats_Hexen2_f); Cmd_AddRemCommand ("menu_fps", M_Menu_FPS_f); Cmd_AddRemCommand ("menu_3d" , M_Menu_3D_f); Cmd_AddRemCommand ("menu_shadow_lighting", M_Menu_Shadow_Lighting_f); @@ -1045,6 +1051,9 @@ void M_DeInit_Internal (void) Cmd_RemoveCommand ("menu_teamplay_ammo_health"); Cmd_RemoveCommand ("menu_teamplay_team_fortress"); Cmd_RemoveCommand ("menu_teamplay_status_location_misc"); + Cmd_RemoveCommand ("menu_spcheats"); + Cmd_RemoveCommand ("menu_hexen2_spcheats"); + Cmd_RemoveCommand ("menu_quake2_spcheats"); Cmd_RemoveCommand ("menu_fps"); Cmd_RemoveCommand ("menu_3d"); Cmd_RemoveCommand ("menu_shadow_lighting"); diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 6570e260a..fc5a2e643 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -1241,10 +1241,13 @@ void M_Menu_Video_f (void) char *rendererstring; static char current3dres[10]; // enough to fit 1920x1200 static char current2dres[10]; // same as above - static char colordepth[6]; // enough to fit 32bit static char currenthz[6]; // enough to fit 120hz + static char currentcolordepth[6]; extern cvar_t _vid_wait_override; + extern int glwidth, glheight; + float vidwidth = glwidth; + float vidheight = glheight; int i, y; int mgt; @@ -1275,9 +1278,15 @@ void M_Menu_Video_f (void) i = 0; if (vid_bpp.value >= 32) + { currentbpp = 2; + strcpy(currentcolordepth, va("%sbit (16.7m colors)",vid_bpp.string) ); + } else if (vid_bpp.value >= 16) + { currentbpp = 1; + strcpy(currentcolordepth, va("%sbit (65.5k colors)",vid_bpp.string) ); + } else currentbpp = 0; @@ -1300,7 +1309,9 @@ void M_Menu_Video_f (void) else currentrefreshrate = 0; - aspectratio3d = (vid_width.value / vid_height.value * 100); // times by 100 so don't have to deal with floats + strcpy(currenthz, va("%sHz",vid_refreshrate.string) ); + + aspectratio3d = (vidwidth / vidheight * 100); // times by 100 so don't have to deal with floats if (aspectratio3d == 125) // 1.25 aspectratio23d = "5:4"; @@ -1311,7 +1322,10 @@ void M_Menu_Video_f (void) else if (aspectratio3d == 177) // 1.777778 aspectratio23d = "16:9"; else + { aspectratio23d = "Non-standard Ratio"; + Con_Printf("Ratio: %i, width: %i, height: %i\n", aspectratio3d, glwidth, glheight); + } aspectratio2d = (vid_conwidth.value / vid_conheight.value * 100); // times by 100 so don't have to deal with floats @@ -1328,10 +1342,6 @@ void M_Menu_Video_f (void) currentvsync = _vid_wait_override.value; - snprintf(current3dres, sizeof(current3dres), "%sx%s", vid_width.string, vid_height.string); - snprintf(current2dres, sizeof(current2dres), "%sx%s", vid_conwidth.string, vid_conheight.string); - snprintf(currenthz, sizeof(currenthz), "%sHz", vid_refreshrate.string); - if ( stricmp(vid_renderer.string,"gl" ) == 0 ) rendererstring = "OpenGL"; else if ( stricmp(vid_renderer.string,"d3d7") == 0 ) @@ -1345,7 +1355,8 @@ void M_Menu_Video_f (void) else rendererstring = "Unknown Renderer?"; - sprintf(colordepth,"%sbit", vid_bpp.string); + strcpy(current3dres, va("%ix%i", glwidth, glheight) ); + strcpy(current2dres, va("%sx%s", vid_conwidth.string, vid_conheight.string) ); mgt = M_GameType(); @@ -1374,15 +1385,32 @@ void M_Menu_Video_f (void) MC_AddRedText(menu, 0, y, " Current Renderer", false); MC_AddRedText(menu, 225, y, rendererstring, false); y+=8; MC_AddRedText(menu, 0, y, " Current Color Depth", false); - MC_AddRedText(menu, 225, y, colordepth, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 3D Res", false); - MC_AddRedText(menu, 225, y, current3dres, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 3D A/R", false); - MC_AddRedText(menu, 225, y, aspectratio23d, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 2D Res", false); - MC_AddRedText(menu, 225, y, current2dres, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 2D A/R", false); - MC_AddRedText(menu, 225, y, aspectratio22d, false); y+=8; + MC_AddRedText(menu, 225, y, currentcolordepth, false); y+=8; + if ( ( vidwidth == 0) || ( vidheight == 0) ) + y+=16; + else + { + MC_AddRedText(menu, 0, y, " Current 3D Res", false); + MC_AddRedText(menu, 225, y, current3dres, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 3D A/R", false); + MC_AddRedText(menu, 225, y, aspectratio23d, false); y+=8; + } + + if ( ( vid_conwidth.value == 0) || ( vid_conheight.value == 0) ) // same as 3d resolution + { + MC_AddRedText(menu, 0, y, " Current 2D Res", false); + MC_AddRedText(menu, 225, y, current3dres, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 2D A/R", false); + MC_AddRedText(menu, 225, y, aspectratio23d, false); y+=8; + } + else + { + MC_AddRedText(menu, 0, y, " Current 2D Res", false); + MC_AddRedText(menu, 225, y, current2dres, false); y+=8; + MC_AddRedText(menu, 0, y, " Current 2D A/R", false); + MC_AddRedText(menu, 225, y, aspectratio22d, false); y+=8; + } + MC_AddRedText(menu, 0, y, " Current Refresh Rate", false); MC_AddRedText(menu, 225, y, currenthz, false); y+=8; y+=8; From b9b5355c727147edf3ad6c4d6c94d20b29f8f762 Mon Sep 17 00:00:00 2001 From: Lance Date: Sat, 23 Jan 2010 07:32:21 +0000 Subject: [PATCH 67/76] GCC fix for previous commit git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3506 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 87f19d9bf..4f127d3d7 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -2080,7 +2080,7 @@ void M_Menu_Singleplayer_Cheats_f (void) int cursorpositionY; int currentskill; int currentmap; - extern cvar_t host_mapname, sv_gravity, sv_cheats, sv_friction, skill; + extern cvar_t host_mapname, sv_gravity, sv_cheats, skill, sv_maxspeed; key_dest = key_menu; m_state = m_complex; From 0dc38e60623fbe87655c2aba72946899ce910356 Mon Sep 17 00:00:00 2001 From: Lance Date: Sat, 23 Jan 2010 07:50:08 +0000 Subject: [PATCH 68/76] GCC fix attempt #2 git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3507 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_options.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 4f127d3d7..10045cf8f 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -2427,7 +2427,7 @@ void M_Menu_Singleplayer_Cheats_Quake2_f (void) int cursorpositionY; int currentskill; int currentmap; - extern cvar_t host_mapname, sv_gravity, sv_cheats, sv_friction, skill; + extern cvar_t host_mapname, sv_gravity, sv_cheats, sv_maxspeed, skill; key_dest = key_menu; m_state = m_complex; @@ -2801,7 +2801,7 @@ void M_Menu_Singleplayer_Cheats_Hexen2_f (void) int cursorpositionY; int currentskill; int currentmap; - extern cvar_t host_mapname, sv_gravity, sv_cheats, sv_friction, skill; + extern cvar_t host_mapname, sv_gravity, sv_cheats, sv_maxspeed, skill; key_dest = key_menu; m_state = m_complex; From 6043fec697526e4bdfb49592011e22bfe78ccc64 Mon Sep 17 00:00:00 2001 From: Lance Date: Sat, 23 Jan 2010 08:13:21 +0000 Subject: [PATCH 69/76] GCC Fix attempt #3 + mingl hacks git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3508 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_options.c | 45 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 10045cf8f..6c4de4487 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -2080,7 +2080,10 @@ void M_Menu_Singleplayer_Cheats_f (void) int cursorpositionY; int currentskill; int currentmap; - extern cvar_t host_mapname, sv_gravity, sv_cheats, skill, sv_maxspeed; + #ifndef MINIMAL + extern cvar_t sv_gravity, sv_cheats, sv_maxspeed, skill; + #endif + extern cvar_t host_mapname; key_dest = key_menu; m_state = m_complex; @@ -2109,7 +2112,9 @@ void M_Menu_Singleplayer_Cheats_f (void) cursorpositionY = (y + 24); + #ifndef MINIMAL currentskill = skill.value; + #endif if ( !currentskill ) currentskill = 4; // no skill selected @@ -2186,18 +2191,26 @@ void M_Menu_Singleplayer_Cheats_f (void) MC_AddRedText(menu, 16, y, " Quake Singleplayer Cheats", false); y+=8; MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; y+=8; + #ifndef MINIMAL info->skillcombo = MC_AddCombo(menu,16, y, " Difficulty", skilloptions, currentskill); y+=8; + #endif info->mapcombo = MC_AddCombo(menu,16, y, " Map", mapoptions, currentmap); y+=8; + #ifndef MINIMAL MC_AddCheckBox(menu, 16, y, " Cheats", &sv_cheats,0); y+=8; + #endif MC_AddConsoleCommand(menu, 16, y, " Toggle Godmode", "god\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Toggle Flymode", "fly\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Toggle Noclip", "noclip\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Quad Damage", "impulse 255\n"); y+=8; + #ifndef MINIMAL MC_AddSlider(menu, 16, y, " Gravity", &sv_gravity,0,800,25); y+=8; + #endif MC_AddSlider(menu, 16, y, " Forward Speed", &cl_forwardspeed,0,1000,50); y+=8; MC_AddSlider(menu, 16, y, " Side Speed", &cl_sidespeed,0,1000,50); y+=8; MC_AddSlider(menu, 16, y, " Back Speed", &cl_backspeed,0,1000,50); y+=8; + #ifndef MINIMAL MC_AddSlider(menu, 16, y, " Max Movement Speed", &sv_maxspeed,0,1000,50); y+=8; + #endif MC_AddConsoleCommand(menu, 16, y, " Silver & Gold Keys", "impulse 13\nimpulse 14\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, "All Weapons & Items", "impulse 9\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, "No Enemy Targetting", "notarget\n"); y+=8; @@ -2427,7 +2440,10 @@ void M_Menu_Singleplayer_Cheats_Quake2_f (void) int cursorpositionY; int currentskill; int currentmap; - extern cvar_t host_mapname, sv_gravity, sv_cheats, sv_maxspeed, skill; + #ifndef MINIMAL + extern cvar_t sv_gravity, sv_cheats, sv_maxspeed, skill; + #endif + extern cvar_t host_mapname; key_dest = key_menu; m_state = m_complex; @@ -2456,10 +2472,12 @@ void M_Menu_Singleplayer_Cheats_Quake2_f (void) cursorpositionY = (y + 24); + #ifndef MINIMAL currentskill = skill.value; if ( !currentskill ) currentskill = 4; // no skill selected + #endif if ( strcmp ( host_mapname.string, "" ) == 0) currentmap = 0; @@ -2547,16 +2565,24 @@ void M_Menu_Singleplayer_Cheats_Quake2_f (void) MC_AddRedText(menu, 16, y, " Quake2 Singleplayer Cheats", false); y+=8; MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; y+=8; + #ifndef MINIMAL info->skillcombo = MC_AddCombo(menu,16, y, " Difficulty", skilloptions, currentskill); y+=8; + #endif info->mapcombo = MC_AddCombo(menu,16, y, " Map", mapoptions, currentmap); y+=8; + #ifndef MINIMAL MC_AddCheckBox(menu, 16, y, " Cheats", &sv_cheats,0); y+=8; + #endif MC_AddConsoleCommand(menu, 16, y, " Toggle Godmode", "god\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Toggle Noclip", "noclip\n"); y+=8; + #ifndef MINIMAL MC_AddSlider(menu, 16, y, " Gravity", &sv_gravity,0,850,25); y+=8; + #endif MC_AddSlider(menu, 16, y, " Forward Speed", &cl_forwardspeed,0,1000,50); y+=8; MC_AddSlider(menu, 16, y, " Side Speed", &cl_sidespeed,0,1000,50); y+=8; MC_AddSlider(menu, 16, y, " Back Speed", &cl_backspeed,0,1000,50); y+=8; + #ifndef MINIMAL MC_AddSlider(menu, 16, y, " Max Movement Speed", &sv_maxspeed,0,1000,50); y+=8; + #endif MC_AddConsoleCommand(menu, 16, y, " Unlimited Ammo", "dmflags 8192\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Quad Damage", "give quad damage\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Blue & Red Key", "give blue key\ngive red key\n"); y+=8; @@ -2801,7 +2827,10 @@ void M_Menu_Singleplayer_Cheats_Hexen2_f (void) int cursorpositionY; int currentskill; int currentmap; - extern cvar_t host_mapname, sv_gravity, sv_cheats, sv_maxspeed, skill; + #ifndef MINIMAL + extern cvar_t sv_gravity, sv_cheats, sv_maxspeed, skill; + #endif + extern cvar_t host_mapname; key_dest = key_menu; m_state = m_complex; @@ -2830,10 +2859,12 @@ void M_Menu_Singleplayer_Cheats_Hexen2_f (void) cursorpositionY = (y + 24); + #ifndef MINIMAL currentskill = skill.value; if ( !currentskill ) currentskill = 4; // no skill selected + #endif if ( strcmp ( host_mapname.string, "" ) == 0) currentmap = 0; @@ -2917,17 +2948,25 @@ void M_Menu_Singleplayer_Cheats_Hexen2_f (void) MC_AddRedText(menu, 16, y, " Hexen2 Singleplayer Cheats", false); y+=8; MC_AddWhiteText(menu, 16, y, " €‚ ", false); y+=8; y+=8; +#ifndef MINIMAL info->skillcombo = MC_AddCombo(menu,16, y, " Difficulty", skilloptions, currentskill); y+=8; +#endif info->mapcombo = MC_AddCombo(menu,16, y, " Map", mapoptions, currentmap); y+=8; + #ifndef MINIMAL MC_AddCheckBox(menu, 16, y, " Cheats", &sv_cheats,0); y+=8; + #endif MC_AddConsoleCommand(menu, 16, y, " Toggle Godmode", "god\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Toggle Flymode", "fly\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Toggle Noclip", "noclip\n"); y+=8; + #ifndef MINIMAL MC_AddSlider(menu, 16, y, " Gravity", &sv_gravity,0,800,25); y+=8; + #endif MC_AddSlider(menu, 16, y, " Forward Speed", &cl_forwardspeed,0,1000,50); y+=8; MC_AddSlider(menu, 16, y, " Side Speed", &cl_sidespeed,0,1000,50); y+=8; MC_AddSlider(menu, 16, y, " Back Speed", &cl_backspeed,0,1000,50); y+=8; + #ifndef MINIMAL MC_AddSlider(menu, 16, y, " Max Movement Speed", &sv_maxspeed,0,1000,50); y+=8; + #endif MC_AddConsoleCommand(menu, 16, y, " Sheep Transformation", "impulse 14\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Change To Paladin (lvl3+)", "impulse 171\n"); y+=8; MC_AddConsoleCommand(menu, 16, y, " Change To Crusader (lvl3+)", "impulse 172\n"); y+=8; From b00e7ffb761c25c2e2e83def5722368486565749 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 6 Feb 2010 02:06:26 +0000 Subject: [PATCH 70/76] fix up some comments git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3510 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/pr_csqc.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index a703de00a..790d4f30d 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -3760,7 +3760,7 @@ static void PF_skel_create (progfuncs_t *prinst, struct globalvars_s *pr_globals G_FLOAT(OFS_RETURN) = (skelobj - skelobjects) + 1; } -//float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone) skel_get_numbones (FTE_CSQC_SKELETONOBJECTS) +//float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone) skel_build (FTE_CSQC_SKELETONOBJECTS) static void PF_skel_build(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); @@ -5120,20 +5120,20 @@ static struct { {"htos", PF_htos, 262}, {"skel_create", PF_skel_create, 263},//float(float modlindex) skel_create = #263; // (FTE_CSQC_SKELETONOBJECTS) - {"skel_build", PF_skel_build, 264},//float(float skel, entity ent, float modlindex, float firstbone, float lastbone) skel_build = #263; // (FTE_CSQC_SKELETONOBJECTS) - {"skel_get_numbones", PF_skel_get_numbones, 265},//float(float skel) skel_get_numbones = #264; // (FTE_CSQC_SKELETONOBJECTS) - {"skel_get_bonename", PF_skel_get_bonename, 266},//string(float skel, float bonenum) skel_get_bonename = #265; // (FTE_CSQC_SKELETONOBJECTS) (returns tempstring) - {"skel_get_boneparent", PF_skel_get_boneparent, 267},//float(float skel, float bonenum) skel_get_boneparent = #266; // (FTE_CSQC_SKELETONOBJECTS) - {"skel_find_bone", PF_skel_find_bone, 268},//float(float skel, string tagname) skel_get_boneidx = #267; // (FTE_CSQC_SKELETONOBJECTS) - {"skel_get_bonerel", PF_skel_get_bonerel, 269},//vector(float skel, float bonenum) skel_get_bonerel = #268; // (FTE_CSQC_SKELETONOBJECTS) (sets v_forward etc) - {"skel_get_boneabs", PF_skel_get_boneabs, 270},//vector(float skel, float bonenum) skel_get_boneabs = #269; // (FTE_CSQC_SKELETONOBJECTS) (sets v_forward etc) - {"skel_set_bone", PF_skel_set_bone, 271},//void(float skel, float bonenum, vector org) skel_set_bone = #270; // (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc) - {"skel_mul_bone", PF_skel_mul_bone, 272},//void(float skel, float bonenum, vector org) skel_mul_bone = #271; // (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc) - {"skel_mul_bones", PF_skel_mul_bones, 273},//void(float skel, float startbone, float endbone, vector org) skel_mul_bone = #272; // (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc) - {"skel_copybones", PF_skel_copybones, 274},//void(float skeldst, float skelsrc, float startbone, float entbone) skel_copybones = #273; // (FTE_CSQC_SKELETONOBJECTS) - {"skel_delete", PF_skel_delete, 275},//void(float skel) skel_delete = #274; // (FTE_CSQC_SKELETONOBJECTS) - {"frameforname", PF_frameforname, 276},//void(float modidx, string framename) frameforname = #275 (FTE_CSQC_SKELETONOBJECTS) - {"frameduration", PF_frameduration, 277},//void(float modidx, float framenum) frameduration = #276 (FTE_CSQC_SKELETONOBJECTS) + {"skel_build", PF_skel_build, 264},//float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // (FTE_CSQC_SKELETONOBJECTS) + {"skel_get_numbones", PF_skel_get_numbones, 265},//float(float skel) skel_get_numbones = #265; // (FTE_CSQC_SKELETONOBJECTS) + {"skel_get_bonename", PF_skel_get_bonename, 266},//string(float skel, float bonenum) skel_get_bonename = #266; // (FTE_CSQC_SKELETONOBJECTS) (returns tempstring) + {"skel_get_boneparent", PF_skel_get_boneparent, 267},//float(float skel, float bonenum) skel_get_boneparent = #267; // (FTE_CSQC_SKELETONOBJECTS) + {"skel_find_bone", PF_skel_find_bone, 268},//float(float skel, string tagname) skel_get_boneidx = #268; // (FTE_CSQC_SKELETONOBJECTS) + {"skel_get_bonerel", PF_skel_get_bonerel, 269},//vector(float skel, float bonenum) skel_get_bonerel = #269; // (FTE_CSQC_SKELETONOBJECTS) (sets v_forward etc) + {"skel_get_boneabs", PF_skel_get_boneabs, 270},//vector(float skel, float bonenum) skel_get_boneabs = #270; // (FTE_CSQC_SKELETONOBJECTS) (sets v_forward etc) + {"skel_set_bone", PF_skel_set_bone, 271},//void(float skel, float bonenum, vector org) skel_set_bone = #271; // (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc) + {"skel_mul_bone", PF_skel_mul_bone, 272},//void(float skel, float bonenum, vector org) skel_mul_bone = #272; // (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc) + {"skel_mul_bones", PF_skel_mul_bones, 273},//void(float skel, float startbone, float endbone, vector org) skel_mul_bone = #273; // (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc) + {"skel_copybones", PF_skel_copybones, 274},//void(float skeldst, float skelsrc, float startbone, float entbone) skel_copybones = #274; // (FTE_CSQC_SKELETONOBJECTS) + {"skel_delete", PF_skel_delete, 275},//void(float skel) skel_delete = #275; // (FTE_CSQC_SKELETONOBJECTS) + {"frameforname", PF_frameforname, 276},//void(float modidx, string framename) frameforname = #276 (FTE_CSQC_SKELETONOBJECTS) + {"frameduration", PF_frameduration, 277},//void(float modidx, float framenum) frameduration = #277 (FTE_CSQC_SKELETONOBJECTS) //300 {"clearscene", PF_R_ClearScene, 300}, // #300 void() clearscene (EXT_CSQC) From 7f84d14ef75c0cc227ca86d39542199df415478a Mon Sep 17 00:00:00 2001 From: Lance Date: Sun, 7 Feb 2010 08:19:35 +0000 Subject: [PATCH 71/76] Added Winquake.rc to the Dotnet 2005 project file, icons are back. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3511 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/dotnet2005/ftequake.vcproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/dotnet2005/ftequake.vcproj b/engine/dotnet2005/ftequake.vcproj index 447775e66..9978da1b2 100644 --- a/engine/dotnet2005/ftequake.vcproj +++ b/engine/dotnet2005/ftequake.vcproj @@ -30875,6 +30875,10 @@ RelativePath="..\client\q2.ico" > + + Date: Sun, 7 Feb 2010 08:39:23 +0000 Subject: [PATCH 72/76] MSVC .NET 2008 project files git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3513 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/dotnet2005/ftequake.sln | 4 +- engine/dotnet2005/ftequake.vcproj | 93 +++++++++++++------------------ engine/dotnet2005/gas2masm.vcproj | 13 ++--- engine/dotnet2005/npqtv.vcproj | 23 ++++---- 4 files changed, 56 insertions(+), 77 deletions(-) diff --git a/engine/dotnet2005/ftequake.sln b/engine/dotnet2005/ftequake.sln index 7ff2a96d9..45ab6ba28 100644 --- a/engine/dotnet2005/ftequake.sln +++ b/engine/dotnet2005/ftequake.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftequake", "ftequake.vcproj", "{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}" ProjectSection(ProjectDependencies) = postProject {382E6790-D1CA-48F5-8E53-D114635EB61D} = {382E6790-D1CA-48F5-8E53-D114635EB61D} diff --git a/engine/dotnet2005/ftequake.vcproj b/engine/dotnet2005/ftequake.vcproj index 9978da1b2..62b781cec 100644 --- a/engine/dotnet2005/ftequake.vcproj +++ b/engine/dotnet2005/ftequake.vcproj @@ -1,10 +1,11 @@ - @@ -189,6 +189,8 @@ GenerateMapFile="true" MapFileName=".\ftequake___Win32_MinGLDebug/fteminglqw_dbg.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -290,6 +289,8 @@ GenerateMapFile="true" MapFileName=".\D3DDebug/fted3dqw_dbg.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - @@ -392,6 +390,8 @@ GenerateMapFile="true" MapFileName=".\D3DDebug/fted3dqw_dbg.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -495,6 +492,8 @@ IgnoreDefaultLibraryNames="libc.lib;msvcrt.lib" GenerateMapFile="true" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - @@ -599,6 +595,8 @@ GenerateMapFile="true" MapFileName=".\ftequake___Win32_MinGLRelease/fteminglqw.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -702,6 +697,8 @@ GenerateDebugInformation="true" GenerateMapFile="true" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - @@ -806,6 +800,8 @@ GenerateMapFile="true" MapFileName=".\GLDebug/fteglqw_dbg.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -909,6 +902,8 @@ GenerateMapFile="true" MapFileName=".\ftequake___Win32_Release_Dedicated_Server/fteqwsv.map" SubSystem="1" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - @@ -1011,6 +1003,8 @@ GenerateMapFile="true" MapFileName=".\ftequake___Win32_Release_Dedicated_Server/fteqwsv.map" SubSystem="1" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -1114,6 +1105,8 @@ GenerateMapFile="true" MapFileName=".\MRelease/fteqw.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - @@ -1217,6 +1207,8 @@ GenerateMapFile="true" MapFileName=".\MRelease/fteqw.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -1318,6 +1307,8 @@ GenerateDebugInformation="true" GenerateMapFile="true" SubSystem="1" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - @@ -1421,6 +1409,8 @@ GenerateMapFile="true" MapFileName=".\DebugServer/fteqwsv.map" SubSystem="1" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -1522,6 +1509,8 @@ GenerateDebugInformation="true" GenerateMapFile="true" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - @@ -1625,6 +1611,8 @@ GenerateMapFile="true" MapFileName=".\MDebug/fteqw_dbg.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -1739,6 +1724,8 @@ OptimizeReferences="2" EnableCOMDATFolding="2" OptimizeForWindows98="1" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - @@ -1843,6 +1827,8 @@ GenerateMapFile="true" MapFileName=".\ftequake___Win32_GLRelease/fteglqw.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - diff --git a/engine/dotnet2005/gas2masm.vcproj b/engine/dotnet2005/gas2masm.vcproj index 62679ed32..8c6780987 100644 --- a/engine/dotnet2005/gas2masm.vcproj +++ b/engine/dotnet2005/gas2masm.vcproj @@ -1,9 +1,10 @@ - @@ -168,6 +168,8 @@ GenerateDebugInformation="true" ProgramDatabaseFile="..\gas2masm\Debug\gas2masm.pdb" SubSystem="1" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - diff --git a/engine/dotnet2005/npqtv.vcproj b/engine/dotnet2005/npqtv.vcproj index d67b62857..43a071d2b 100644 --- a/engine/dotnet2005/npqtv.vcproj +++ b/engine/dotnet2005/npqtv.vcproj @@ -1,10 +1,11 @@ - @@ -190,6 +190,8 @@ GenerateMapFile="true" MapFileName=".\GLDebug/fteglqw_dbg.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -292,6 +291,8 @@ ModuleDefinitionFile="../ftequake/npapi.def" GenerateMapFile="true" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - @@ -395,6 +393,8 @@ GenerateMapFile="true" MapFileName=".\npqtv___Win32_GLRelease/fteglqw.map" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - From 7707135846afca4001ea14b170a26ec81290b69b Mon Sep 17 00:00:00 2001 From: Lance Date: Sun, 7 Feb 2010 09:07:09 +0000 Subject: [PATCH 73/76] Undo my mistake in #3513 git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3514 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/dotnet2005/ftequake.sln | 4 +- engine/dotnet2005/ftequake.vcproj | 93 ++++++++++++++++++------------- engine/dotnet2005/gas2masm.vcproj | 13 +++-- engine/dotnet2005/npqtv.vcproj | 23 ++++---- 4 files changed, 77 insertions(+), 56 deletions(-) diff --git a/engine/dotnet2005/ftequake.sln b/engine/dotnet2005/ftequake.sln index 45ab6ba28..7ff2a96d9 100644 --- a/engine/dotnet2005/ftequake.sln +++ b/engine/dotnet2005/ftequake.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftequake", "ftequake.vcproj", "{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}" ProjectSection(ProjectDependencies) = postProject {382E6790-D1CA-48F5-8E53-D114635EB61D} = {382E6790-D1CA-48F5-8E53-D114635EB61D} diff --git a/engine/dotnet2005/ftequake.vcproj b/engine/dotnet2005/ftequake.vcproj index 62b781cec..9978da1b2 100644 --- a/engine/dotnet2005/ftequake.vcproj +++ b/engine/dotnet2005/ftequake.vcproj @@ -1,11 +1,10 @@ + @@ -189,8 +189,6 @@ GenerateMapFile="true" MapFileName=".\ftequake___Win32_MinGLDebug/fteminglqw_dbg.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + @@ -289,8 +290,6 @@ GenerateMapFile="true" MapFileName=".\D3DDebug/fted3dqw_dbg.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="1" /> + @@ -390,8 +392,6 @@ GenerateMapFile="true" MapFileName=".\D3DDebug/fted3dqw_dbg.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + @@ -492,8 +495,6 @@ IgnoreDefaultLibraryNames="libc.lib;msvcrt.lib" GenerateMapFile="true" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="1" /> + @@ -595,8 +599,6 @@ GenerateMapFile="true" MapFileName=".\ftequake___Win32_MinGLRelease/fteminglqw.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + @@ -697,8 +702,6 @@ GenerateDebugInformation="true" GenerateMapFile="true" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="1" /> + @@ -800,8 +806,6 @@ GenerateMapFile="true" MapFileName=".\GLDebug/fteglqw_dbg.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + @@ -902,8 +909,6 @@ GenerateMapFile="true" MapFileName=".\ftequake___Win32_Release_Dedicated_Server/fteqwsv.map" SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="1" /> + @@ -1003,8 +1011,6 @@ GenerateMapFile="true" MapFileName=".\ftequake___Win32_Release_Dedicated_Server/fteqwsv.map" SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + @@ -1105,8 +1114,6 @@ GenerateMapFile="true" MapFileName=".\MRelease/fteqw.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="1" /> + @@ -1207,8 +1217,6 @@ GenerateMapFile="true" MapFileName=".\MRelease/fteqw.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + @@ -1307,8 +1318,6 @@ GenerateDebugInformation="true" GenerateMapFile="true" SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="1" /> + @@ -1409,8 +1421,6 @@ GenerateMapFile="true" MapFileName=".\DebugServer/fteqwsv.map" SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + @@ -1509,8 +1522,6 @@ GenerateDebugInformation="true" GenerateMapFile="true" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="1" /> + @@ -1611,8 +1625,6 @@ GenerateMapFile="true" MapFileName=".\MDebug/fteqw_dbg.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + @@ -1724,8 +1739,6 @@ OptimizeReferences="2" EnableCOMDATFolding="2" OptimizeForWindows98="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="1" /> + @@ -1827,8 +1843,6 @@ GenerateMapFile="true" MapFileName=".\ftequake___Win32_GLRelease/fteglqw.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + diff --git a/engine/dotnet2005/gas2masm.vcproj b/engine/dotnet2005/gas2masm.vcproj index 8c6780987..62679ed32 100644 --- a/engine/dotnet2005/gas2masm.vcproj +++ b/engine/dotnet2005/gas2masm.vcproj @@ -1,10 +1,9 @@ + @@ -168,8 +168,6 @@ GenerateDebugInformation="true" ProgramDatabaseFile="..\gas2masm\Debug\gas2masm.pdb" SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + diff --git a/engine/dotnet2005/npqtv.vcproj b/engine/dotnet2005/npqtv.vcproj index 43a071d2b..d67b62857 100644 --- a/engine/dotnet2005/npqtv.vcproj +++ b/engine/dotnet2005/npqtv.vcproj @@ -1,11 +1,10 @@ + @@ -190,8 +190,6 @@ GenerateMapFile="true" MapFileName=".\GLDebug/fteglqw_dbg.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + @@ -291,8 +292,6 @@ ModuleDefinitionFile="../ftequake/npapi.def" GenerateMapFile="true" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="1" /> + @@ -393,8 +395,6 @@ GenerateMapFile="true" MapFileName=".\npqtv___Win32_GLRelease/fteglqw.map" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" TargetMachine="17" /> + From d2475339c2fdca389db2340dfd70c4ba019515d5 Mon Sep 17 00:00:00 2001 From: Lance Date: Sun, 7 Feb 2010 09:11:44 +0000 Subject: [PATCH 74/76] MSVC .NET 2008 project files (done properly unlike my screwup in #3513) git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3515 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/dotnet2008/ftequake.sln | 144 + engine/dotnet2008/ftequake.vcproj | 33081 +++++++++++++++++++++ engine/dotnet2008/gas2masm.vcproj | 225 + engine/dotnet2008/npqtv.vcproj | 43499 ++++++++++++++++++++++++++++ engine/dotnet2008/resource.h | 14 + 5 files changed, 76963 insertions(+) create mode 100644 engine/dotnet2008/ftequake.sln create mode 100644 engine/dotnet2008/ftequake.vcproj create mode 100644 engine/dotnet2008/gas2masm.vcproj create mode 100644 engine/dotnet2008/npqtv.vcproj create mode 100644 engine/dotnet2008/resource.h diff --git a/engine/dotnet2008/ftequake.sln b/engine/dotnet2008/ftequake.sln new file mode 100644 index 000000000..09d6cc397 --- /dev/null +++ b/engine/dotnet2008/ftequake.sln @@ -0,0 +1,144 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftequake", "ftequake.vcproj", "{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}" + ProjectSection(ProjectDependencies) = postProject + {382E6790-D1CA-48F5-8E53-D114635EB61D} = {382E6790-D1CA-48F5-8E53-D114635EB61D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gas2masm", "gas2masm.vcproj", "{382E6790-D1CA-48F5-8E53-D114635EB61D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "npqtv", "npqtv.vcproj", "{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}" + ProjectSection(ProjectDependencies) = postProject + {382E6790-D1CA-48F5-8E53-D114635EB61D} = {382E6790-D1CA-48F5-8E53-D114635EB61D} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + D3DDebug|Win32 = D3DDebug|Win32 + D3DDebug|x64 = D3DDebug|x64 + Debug Dedicated Server|Win32 = Debug Dedicated Server|Win32 + Debug Dedicated Server|x64 = Debug Dedicated Server|x64 + GLDebug|Win32 = GLDebug|Win32 + GLDebug|x64 = GLDebug|x64 + GLRelease|Win32 = GLRelease|Win32 + GLRelease|x64 = GLRelease|x64 + MDebug|Win32 = MDebug|Win32 + MDebug|x64 = MDebug|x64 + MinGLDebug|Win32 = MinGLDebug|Win32 + MinGLDebug|x64 = MinGLDebug|x64 + MinGLRelease|Win32 = MinGLRelease|Win32 + MinGLRelease|x64 = MinGLRelease|x64 + MRelease|Win32 = MRelease|Win32 + MRelease|x64 = MRelease|x64 + Release Dedicated Server|Win32 = Release Dedicated Server|Win32 + Release Dedicated Server|x64 = Release Dedicated Server|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DDebug|Win32.ActiveCfg = D3DDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DDebug|Win32.Build.0 = D3DDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DDebug|x64.ActiveCfg = D3DDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.D3DDebug|x64.Build.0 = D3DDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Debug Dedicated Server|Win32.ActiveCfg = MRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Debug Dedicated Server|Win32.Build.0 = MRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Debug Dedicated Server|x64.ActiveCfg = GLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Debug Dedicated Server|x64.Build.0 = GLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.GLDebug|Win32.ActiveCfg = GLDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.GLDebug|Win32.Build.0 = GLDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.GLDebug|x64.ActiveCfg = GLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.GLDebug|x64.Build.0 = GLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.GLRelease|Win32.ActiveCfg = GLRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.GLRelease|Win32.Build.0 = GLRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.GLRelease|x64.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.GLRelease|x64.Build.0 = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MDebug|Win32.ActiveCfg = MDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MDebug|Win32.Build.0 = MDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MDebug|x64.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MDebug|x64.Build.0 = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MinGLDebug|Win32.ActiveCfg = MinGLDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MinGLDebug|Win32.Build.0 = MinGLDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MinGLDebug|x64.ActiveCfg = MinGLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MinGLDebug|x64.Build.0 = MinGLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MinGLRelease|Win32.ActiveCfg = MinGLRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MinGLRelease|Win32.Build.0 = MinGLRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MinGLRelease|x64.ActiveCfg = MinGLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MinGLRelease|x64.Build.0 = MinGLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MRelease|Win32.ActiveCfg = MRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MRelease|Win32.Build.0 = MRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MRelease|x64.ActiveCfg = MRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.MRelease|x64.Build.0 = MRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Release Dedicated Server|Win32.ActiveCfg = Release Dedicated Server|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Release Dedicated Server|Win32.Build.0 = Release Dedicated Server|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Release Dedicated Server|x64.ActiveCfg = Release Dedicated Server|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}.Release Dedicated Server|x64.Build.0 = Release Dedicated Server|x64 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.D3DDebug|Win32.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.D3DDebug|Win32.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.D3DDebug|x64.ActiveCfg = Debug|x64 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.D3DDebug|x64.Build.0 = Debug|x64 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.Debug Dedicated Server|Win32.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.Debug Dedicated Server|Win32.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.Debug Dedicated Server|x64.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.GLDebug|Win32.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.GLDebug|Win32.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.GLDebug|x64.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.GLDebug|x64.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.GLRelease|Win32.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.GLRelease|Win32.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.GLRelease|x64.ActiveCfg = Debug|x64 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.GLRelease|x64.Build.0 = Debug|x64 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MDebug|Win32.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MDebug|Win32.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MDebug|x64.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MDebug|x64.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MinGLDebug|Win32.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MinGLDebug|Win32.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MinGLDebug|x64.ActiveCfg = Debug|x64 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MinGLDebug|x64.Build.0 = Debug|x64 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MinGLRelease|Win32.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MinGLRelease|Win32.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MinGLRelease|x64.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MinGLRelease|x64.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MRelease|Win32.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MRelease|Win32.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MRelease|x64.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.MRelease|x64.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.Release Dedicated Server|Win32.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.Release Dedicated Server|Win32.Build.0 = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.Release Dedicated Server|x64.ActiveCfg = Debug|Win32 + {382E6790-D1CA-48F5-8E53-D114635EB61D}.Release Dedicated Server|x64.Build.0 = Debug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DDebug|Win32.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DDebug|x64.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.D3DDebug|x64.Build.0 = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug Dedicated Server|Win32.ActiveCfg = GLDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug Dedicated Server|x64.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Debug Dedicated Server|x64.Build.0 = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLDebug|Win32.ActiveCfg = GLDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLDebug|Win32.Build.0 = GLDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLDebug|x64.ActiveCfg = GLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLDebug|x64.Build.0 = GLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLRelease|Win32.ActiveCfg = GLRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLRelease|Win32.Build.0 = GLRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLRelease|x64.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.GLRelease|x64.Build.0 = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MDebug|Win32.ActiveCfg = GLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MDebug|x64.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MDebug|x64.Build.0 = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLDebug|Win32.ActiveCfg = GLDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLDebug|Win32.Build.0 = GLDebug|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLDebug|x64.ActiveCfg = GLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLDebug|x64.Build.0 = GLDebug|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLRelease|Win32.ActiveCfg = GLRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLRelease|Win32.Build.0 = GLRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLRelease|x64.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MinGLRelease|x64.Build.0 = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MRelease|Win32.ActiveCfg = GLRelease|Win32 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MRelease|x64.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.MRelease|x64.Build.0 = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release Dedicated Server|Win32.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release Dedicated Server|x64.ActiveCfg = GLRelease|x64 + {88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1365}.Release Dedicated Server|x64.Build.0 = GLRelease|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/engine/dotnet2008/ftequake.vcproj b/engine/dotnet2008/ftequake.vcproj new file mode 100644 index 000000000..4e63e7fbf --- /dev/null +++ b/engine/dotnet2008/ftequake.vcproj @@ -0,0 +1,33081 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/engine/dotnet2008/gas2masm.vcproj b/engine/dotnet2008/gas2masm.vcproj new file mode 100644 index 000000000..8c6780987 --- /dev/null +++ b/engine/dotnet2008/gas2masm.vcproj @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/engine/dotnet2008/npqtv.vcproj b/engine/dotnet2008/npqtv.vcproj new file mode 100644 index 000000000..43a071d2b --- /dev/null +++ b/engine/dotnet2008/npqtv.vcproj @@ -0,0 +1,43499 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/engine/dotnet2008/resource.h b/engine/dotnet2008/resource.h new file mode 100644 index 000000000..c6f7916bc --- /dev/null +++ b/engine/dotnet2008/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by npqtv.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif From a2fbc53631da53b14bbac643f526ce41de7cf12a Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 26 Mar 2010 03:44:22 +0000 Subject: [PATCH 75/76] Migrated QCLib stuff over from WIP branch. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3525 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/cmdlib.h | 11 ++- engine/qclib/execloop.h | 10 +- engine/qclib/initlib.c | 8 +- engine/qclib/pr_edict.c | 21 +++-- engine/qclib/pr_x86.c | 62 +++++++++++-- engine/qclib/progsint.h | 18 ++-- engine/qclib/progslib.h | 31 +++++-- engine/qclib/qcc.h | 1 + engine/qclib/qcc_pr_comp.c | 52 ++++------- engine/qclib/qcc_pr_lex.c | 38 ++++++-- engine/qclib/qccmain.c | 186 +++++++++++++++++++++---------------- 11 files changed, 281 insertions(+), 157 deletions(-) diff --git a/engine/qclib/cmdlib.h b/engine/qclib/cmdlib.h index 2da377959..768d899a1 100644 --- a/engine/qclib/cmdlib.h +++ b/engine/qclib/cmdlib.h @@ -43,9 +43,18 @@ int QC_strcasecmp (const char *s1, const char *s2); #define QC_vsnprintf vsnprintf #endif +#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) + #ifndef LIKEPRINTF + #define LIKEPRINTF(x) __attribute__((format(printf,x,x+1))) + #endif +#endif +#ifndef LIKEPRINTF +#define LIKEPRINTF(x) +#endif + double I_FloatTime (void); -void VARGS QCC_Error (int errortype, const char *error, ...); +void VARGS QCC_Error (int errortype, const char *error, ...) LIKEPRINTF(2); int CheckParm (char *check); diff --git a/engine/qclib/execloop.h b/engine/qclib/execloop.h index ad40f0e5b..365c93a49 100644 --- a/engine/qclib/execloop.h +++ b/engine/qclib/execloop.h @@ -431,7 +431,7 @@ reeval: st--; goto cont; #else - PR_RunError (progfuncs, "OP_ADDRESS references invalid entity in %s", progfuncs->stringtable + pr_xfunction->s_name); + PR_RunError (progfuncs, "OP_ADDRESS references invalid entity in %s", PR_StringToNative(progfuncs, pr_xfunction->s_name)); #endif } ed = PROG_TO_EDICT(progfuncs, OPA->edict); @@ -448,7 +448,13 @@ reeval: st--; goto cont; #else - PR_RunError (progfuncs, "assignment to read-only entity in %s", progfuncs->stringtable + pr_xfunction->s_name); + { + ddef16_t *d16; + fdef_t *f; + d16 = ED_GlobalAtOfs16(progfuncs, st->a); + f = ED_FieldAtOfs(progfuncs, OPB->_int + progfuncs->fieldadjust); + PR_RunError (progfuncs, "assignment to read-only entity in %s (%s.%s)", PR_StringToNative(progfuncs, pr_xfunction->s_name), PR_StringToNative(progfuncs, d16->s_name), f?f->name:NULL); + } #endif } diff --git a/engine/qclib/initlib.c b/engine/qclib/initlib.c index ca44b7813..1ca5728b3 100644 --- a/engine/qclib/initlib.c +++ b/engine/qclib/initlib.c @@ -95,9 +95,12 @@ int PR_InitEnts(progfuncs_t *progfuncs, int max_ents) sv_edicts = PRHunkAlloc(progfuncs, externs->edictsize); prinst->edicttable[0] = sv_edicts; ((edictrun_t*)prinst->edicttable[0])->fields = PRAddressableAlloc(progfuncs, max_fields_size); - ED_ClearEdict(progfuncs, (edictrun_t *)sv_edicts); + QC_ClearEdict(progfuncs, sv_edicts); sv_num_edicts = 1; + if (externs->entspawn) + externs->entspawn((struct edict_s *)sv_edicts, false); + return max_fields_size; } edictrun_t tempedict; //used as a safty buffer @@ -643,7 +646,8 @@ progfuncs_t deffuncs = { PR_StringToProgs, PR_StringToNative, 0, - PR_QueryField + PR_QueryField, + QC_ClearEdict }; #undef printf diff --git a/engine/qclib/pr_edict.c b/engine/qclib/pr_edict.c index 6ee3963e9..d6c211998 100644 --- a/engine/qclib/pr_edict.c +++ b/engine/qclib/pr_edict.c @@ -45,13 +45,14 @@ static gefv_cache gefvCache[GEFV_CACHESIZE] = {{NULL, ""}, {NULL, ""}}; /* ================= -ED_ClearEdict +QC_ClearEdict Sets everything to NULL ================= */ -void ED_ClearEdict (progfuncs_t *progfuncs, edictrun_t *e) +void QC_ClearEdict (progfuncs_t *progfuncs, struct edict_s *ed) { + edictrun_t *e = (edictrun_t *)ed; int num = e->entnum; memset (e->fields, 0, fields_size); e->isfree = false; @@ -66,7 +67,7 @@ edictrun_t *ED_AllocIntoTable (progfuncs_t *progfuncs, int num) memset(e, 0, externs->edictsize); e->fields = PRAddressableAlloc(progfuncs, fields_size); e->entnum = num; - ED_ClearEdict(progfuncs, e); + QC_ClearEdict(progfuncs, (struct edict_s*)e); return e; } @@ -97,7 +98,7 @@ struct edict_s *ED_Alloc (progfuncs_t *progfuncs) if (!e) e = ED_AllocIntoTable(progfuncs, i); else - ED_ClearEdict (progfuncs, e); + QC_ClearEdict (progfuncs, (struct edict_s*)e); if (externs->entspawn) externs->entspawn((struct edict_s *) e, false); @@ -117,7 +118,7 @@ struct edict_s *ED_Alloc (progfuncs_t *progfuncs) if (!e) e = ED_AllocIntoTable(progfuncs, i); else - ED_ClearEdict (progfuncs, e); + QC_ClearEdict (progfuncs, (struct edict_s*)e); if (externs->entspawn) externs->entspawn((struct edict_s *) e, false); @@ -146,7 +147,7 @@ struct edict_s *ED_Alloc (progfuncs_t *progfuncs) if (!e) e = ED_AllocIntoTable(progfuncs, i); else - ED_ClearEdict (progfuncs, e); + QC_ClearEdict (progfuncs, (struct edict_s*)e); if (externs->entspawn) externs->entspawn((struct edict_s *) e, false); @@ -1165,7 +1166,7 @@ char *ED_ParseEdict (progfuncs_t *progfuncs, char *data, edictrun_t *ent) break; if (!data) { - printf ("ED_ParseEntity: EOF without closing brace"); + printf ("ED_ParseEntity: EOF without closing brace\n"); return NULL; } @@ -1184,13 +1185,13 @@ char *ED_ParseEdict (progfuncs_t *progfuncs, char *data, edictrun_t *ent) data = QCC_COM_Parse (data); if (!data) { - printf ("ED_ParseEntity: EOF without closing brace"); + printf ("ED_ParseEntity: EOF without closing brace\n"); return NULL; } if (qcc_token[0] == '}') { - printf ("ED_ParseEntity: closing brace without data"); + printf ("ED_ParseEntity: closing brace without data\n"); return NULL; } @@ -3112,6 +3113,6 @@ unsigned int NUM_FOR_EDICT(progfuncs_t *progfuncs, struct edict_s *e) { edictrun_t *er = (edictrun_t*)e; if (er->entnum >= maxedicts) - Sys_Error ("QCLIB: NUM_FOR_EDICT: bad pointer (%i)", e); + Sys_Error ("QCLIB: NUM_FOR_EDICT: bad pointer (%p)", e); return er->entnum; } diff --git a/engine/qclib/pr_x86.c b/engine/qclib/pr_x86.c index acd0a1f44..4ebfdda20 100644 --- a/engine/qclib/pr_x86.c +++ b/engine/qclib/pr_x86.c @@ -119,7 +119,7 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) int *glob = (int*)current_progstate->globals; if (current_progstate->numbuiltins) - return; + return false; jitstatements = numstatements; @@ -259,7 +259,7 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) //remember to change the je above //err... exit depth? no idea - EmitByte(0xcd);EmitByte(op[i].op); + EmitByte(0xcd);EmitByte(op[i].op); //int $X //ret @@ -560,7 +560,7 @@ EmitByte(0xcc); //jmp 10 EmitByte(0xeb);EmitByte(0x0a); //mov 1.0f,glob[C] - EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(1.0f); + EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].c);EmitFloat(1.0f); break; case OP_BITOR: //floats... @@ -972,7 +972,55 @@ EmitByte(0xcc); //add $12,%esp EmitByte(0x83); EmitByte(0xc4); EmitByte(0x0c); break; -/* +#if 0 + case OP_NOT_V: + //flds 0 + //flds glob[A+0] + //fcomip %st(1),%st + //jne _true + //flds glob[A+1] + //fcomip %st(1),%st + //jne _true + //flds glob[A+1] + //fcomip %st(1),%st + //jne _true + //mov 1,C + //jmp done + //_true: + //mov 0,C + //done: + break; + + case OP_EQ_V: + //flds glob[A] + EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+0); + //flds glob[B] + EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].b+0); + //fcomip %st(1),%st + EmitByte(0xdf);EmitByte(0xe9); + //fstp %st(0) (aka: pop) + EmitByte(0xdd);EmitByte(0xd8); + + //jncc _true + if (op[i].op == OP_NE_V) + EmitByte(0x74); //je + else + EmitByte(0x75); //jne + EmitByte(0x0c); +//_false0: + //mov 0.0f,c + EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(1.0f); + //jmp done + EmitByte(0xeb); EmitByte(0x0a); + + +//_true: + //mov 1.0f,c + EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(0.0f); +//_done: + break; + + case OP_EQ_V: EmitByte(0xcd);EmitByte(op[i].op); printf("QCJIT: instruction %i is not implemented\n", op[i].op); @@ -987,7 +1035,7 @@ EmitByte(0xcc); EmitByte(0xcd);EmitByte(op[i].op); printf("QCJIT: instruction %i is not implemented\n", op[i].op); break; -*/ +#endif default: printf("QCJIT: Extended instruction set %i is not supported, not using jit.\n", op[i].op); @@ -1021,7 +1069,7 @@ void PR_EnterJIT(progfuncs_t *progfuncs, int statement) { #ifdef __GNUC__ //call, it clobbers pretty much everything. - asm("call %0" :: "r"(statementoffsets[statement+1]),"b"(prinst->edicttable):"cc","memory","eax","ecx","edx"); + asm("call *%0" :: "r"(statementoffsets[statement+1]),"b"(prinst->edicttable):"cc","memory","eax","ecx","edx"); #elif defined(_MSC_VER) void *entry = statementoffsets[statement+1]; void *edicttable = prinst->edicttable; @@ -1036,4 +1084,4 @@ void PR_EnterJIT(progfuncs_t *progfuncs, int statement) #error "Sorry, no idea how to enter assembler safely for your compiler" #endif } -#endif \ No newline at end of file +#endif diff --git a/engine/qclib/progsint.h b/engine/qclib/progsint.h index e73d7afdd..39c316e50 100644 --- a/engine/qclib/progsint.h +++ b/engine/qclib/progsint.h @@ -1,4 +1,4 @@ -#ifdef WIN32 +#ifdef _WIN32 #ifndef AVAIL_ZLIB #ifdef _MSC_VER @@ -89,8 +89,13 @@ void PRHunkFree(progfuncs_t *progfuncs, int mark); void *PRHunkAlloc(progfuncs_t *progfuncs, int size); void *PRAddressableAlloc(progfuncs_t *progfuncs, int ammount); +#ifdef printf +#undef LIKEPRINTF +#define LIKEPRINTF(x) +#endif + //void *HunkAlloc (int size); -char *VARGS qcva (char *text, ...); +char *VARGS qcva (char *text, ...) LIKEPRINTF(1); void QC_InitShares(progfuncs_t *progfuncs); void QC_StartShares(progfuncs_t *progfuncs); void QC_AddSharedVar(progfuncs_t *progfuncs, int num, int type); @@ -129,8 +134,6 @@ typedef union eval_s #endif */ - -#define MAX_ENT_LEAFS 16 typedef struct edictrun_s { pbool isfree; @@ -281,7 +284,7 @@ const extern unsigned int type_size[]; extern unsigned short pr_crc; -void VARGS PR_RunError (progfuncs_t *progfuncs, char *error, ...); +void VARGS PR_RunError (progfuncs_t *progfuncs, char *error, ...) LIKEPRINTF(2); void ED_PrintEdicts (progfuncs_t *progfuncs); void ED_PrintNum (progfuncs_t *progfuncs, int ent); @@ -447,7 +450,7 @@ func_t PR_FindFunc(progfuncs_t *progfncs, char *funcname, progsnum_t pnum); void PR_Configure (progfuncs_t *progfncs, int addressable_size, int max_progs); int PR_InitEnts(progfuncs_t *progfncs, int maxents); char *PR_ValueString (progfuncs_t *progfuncs, etype_t type, eval_t *val); -void ED_ClearEdict (progfuncs_t *progfuncs, edictrun_t *e); +void QC_ClearEdict (progfuncs_t *progfuncs, struct edict_s *ed); void PRAddressableFlush(progfuncs_t *progfuncs, int totalammount); void QC_FlushProgsOffsets(progfuncs_t *progfuncs); @@ -466,6 +469,9 @@ char *PR_GlobalStringNoContents (progfuncs_t *progfuncs, int ofs); pbool CompileFile(progfuncs_t *progfuncs, char *filename); +pbool PR_GenerateJit(progfuncs_t *progfuncs); +void PR_EnterJIT(progfuncs_t *progfuncs, int statement); + char *QCC_COM_Parse (char *data); extern char qcc_token[1024]; #endif diff --git a/engine/qclib/progslib.h b/engine/qclib/progslib.h index 45aa91bf8..f3f4488a4 100644 --- a/engine/qclib/progslib.h +++ b/engine/qclib/progslib.h @@ -22,10 +22,16 @@ typedef char *string_t; */ #ifdef _MSC_VER -#define VARGS __cdecl + #define VARGS __cdecl +#endif +#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) + #define LIKEPRINTF(x) __attribute__((format(printf,x,x+1))) +#endif +#ifndef LIKEPRINTF + #define LIKEPRINTF(x) #endif #ifndef VARGS -#define VARGS + #define VARGS #endif @@ -60,7 +66,7 @@ struct progfuncs_s { struct globalvars_s *(*globals) (progfuncs_t *prinst, progsnum_t num); //get the globals of a progs struct entvars_s *(*entvars) (progfuncs_t *prinst, struct edict_s *ent); //return a pointer to the entvars of an ent. can be achieved via the edict_t structure instead, so obsolete. - void (VARGS *RunError) (progfuncs_t *prinst, char *msg, ...); //builtins call this to say there was a problem + void (VARGS *RunError) (progfuncs_t *prinst, char *msg, ...) LIKEPRINTF(2); //builtins call this to say there was a problem void (*PrintEdict) (progfuncs_t *prinst, struct edict_s *ed); //get a listing of all vars on an edict (sent back via 'print') struct edict_s *(*EntAlloc) (progfuncs_t *prinst); @@ -137,7 +143,9 @@ struct progfuncs_s { char *(*StringToNative) (progfuncs_t *prinst, string_t str); int stringtablesize; - int (*QueryField) (progfuncs_t *prinst, unsigned int fieldoffset, etype_t *type, char **name, evalc_t *fieldcache); //find info on a field definition at an offset + int (*QueryField) (progfuncs_t *prinst, unsigned int fieldoffset, etype_t *type, char **name, evalc_t *fieldcache); //find info on a field definition at an offset + + void (*EntClear) (progfuncs_t *progfuncs, struct edict_s *e); }; typedef struct progexterns_s { @@ -146,9 +154,9 @@ typedef struct progexterns_s { unsigned char *(*ReadFile) (char *fname, void *buffer, int len); int (*FileSize) (char *fname); //-1 if file does not exist pbool (*WriteFile) (char *name, void *data, int len); - int (VARGS *printf) (const char *, ...); - void (VARGS *Sys_Error) (const char *, ...); - void (VARGS *Abort) (char *, ...); + int (VARGS *printf) (const char *, ...) LIKEPRINTF(1); + void (VARGS *Sys_Error) (const char *, ...) LIKEPRINTF(1); + void (VARGS *Abort) (char *, ...) LIKEPRINTF(1); int edictsize; //size of edict_t void (*entspawn) (struct edict_s *ent, int loading); //ent has been spawned, but may not have all the extra variables (that may need to be set) set @@ -183,7 +191,9 @@ typedef struct progexterns_s { //FIXMEs void QC_AddSharedVar(progfuncs_t *progfuncs, int start, int size); void QC_AddSharedFieldVar(progfuncs_t *progfuncs, int num, char *relstringtable); -void ED_Print (progfuncs_t *progfuncs, struct edict_s *ed); +void ED_Print(progfuncs_t *progfuncs, struct edict_s *ed); +char *PR_RemoveProgsString(progfuncs_t *progfuncs, string_t str); +int PR_GetFuncArgCount(progfuncs_t *progfuncs, func_t func); #if defined(QCLIBDLL_EXPORTS) __declspec(dllexport) @@ -218,7 +228,7 @@ typedef union eval_s #define PR_LoadProgs(pf, s, headercrc, builtins, numb) (*pf->LoadProgs) (pf, s, headercrc, builtins, numb) #define PR_InitEnts(pf, maxents) (*pf->InitEnts) (pf, maxents) #define PR_ExecuteProgram(pf, fnum) (*pf->ExecuteProgram) (pf, fnum) -#define PR_SwitchProgs(pf, num) (*pf->SwitchProgs) (pf, num); +#define PR_SwitchProgs(pf, num) (*pf->SwitchProgs) (pf, num) #define PR_globals(pf, num) (*pf->globals) (pf, num) #define PR_entvars(pf, ent) (*pf->entvars) (pf, ent) @@ -226,6 +236,7 @@ typedef union eval_s #define ED_Alloc(pf) (*pf->EntAlloc) (pf) #define ED_Free(pf, ed) (*pf->EntFree) (pf, ed) +#define ED_Clear(pf, ed) (*pf->EntClear) (pf, ed) #define PR_LoadEnts(pf, s, kf) (*pf->load_ents) (pf, s, kf) #define PR_SaveEnts(pf, buf, size, mode) (*pf->save_ents) (pf, buf, size, mode) @@ -251,7 +262,7 @@ typedef union eval_s #define PR_Alloc(pf,size) (*pf->Tempmem) (pf, size) #define PROG_TO_EDICT(pf, ed) (*pf->ProgsToEdict) (pf, ed) -#define EDICT_TO_PROG(pf, ed) (*pf->EdictToProgs) (pf, ed) +#define EDICT_TO_PROG(pf, ed) (*pf->EdictToProgs) (pf, (struct edict_s*)ed) #define PR_RegisterBuiltin(pf, name, func) (*pf->RegisterBuiltin) (pf, name, func) diff --git a/engine/qclib/qcc.h b/engine/qclib/qcc.h index 75b2b378c..65b360baf 100644 --- a/engine/qclib/qcc.h +++ b/engine/qclib/qcc.h @@ -477,6 +477,7 @@ extern pbool flag_laxcasts; extern pbool flag_hashonly; extern pbool flag_fasttrackarrays; extern pbool flag_assume_integer; +extern pbool flag_msvcstyle; extern pbool opt_overlaptemps; extern pbool opt_shortenifnots; diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index fa2fcf59e..a76f2701e 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -74,6 +74,7 @@ pbool flag_caseinsensative; //symbols will be matched to an insensative case if pbool flag_laxcasts; //Allow lax casting. This'll produce loadsa warnings of course. But allows compilation of certain dodgy code. pbool flag_hashonly; //Allows use of only #constant for precompiler constants, allows certain preqcc using mods to compile pbool flag_fasttrackarrays; //Faster arrays, dynamically detected, activated only in supporting engines. +pbool flag_msvcstyle; //MSVC style warnings, so msvc's ide works properly pbool flag_assume_integer; //5 - is that an integer or a float? qcc says float. but we support int too, so maybe we want that instead? pbool opt_overlaptemps; //reduce numpr_globals by reuse of temps. When they are not needed they are freed for reuse. The way this is implemented is better than frikqcc's. (This is the single most important optimisation) @@ -1381,12 +1382,7 @@ static void QCC_LockActiveTemps(void) t->scope = pr_scope; t = t->next; } -} - -static void QCC_LockTemp(QCC_def_t *d) -{ - if (d->temp && d->temp->used) - d->temp->scope = pr_scope; + } static void QCC_RemapLockedTemp(temp_t *t, int firststatement, int laststatement) @@ -2239,26 +2235,19 @@ QCC_def_t *QCC_PR_Statement ( QCC_opcode_t *op, QCC_def_t *var_a, QCC_def_t *var //don't chain these... this expansion is not the same. { int st; - int need_lock = false; + for (st = numstatements-2; st>=0; st--) { if (statements[st].op == OP_ADDRESS) if (statements[st].c == var_b->ofs) break; - if (statements[st].op >= OP_CALL0 && statements[st].op <= OP_CALL8 || statements[st].op >= OP_CALL1H && statements[st].op <= OP_CALL8H) - need_lock = true; - - //printf("%s\n", pr_opcodes[statements[st].op].opname); - if (statements[st].c == var_b->ofs) QCC_PR_ParseWarning(0, "Temp-reuse may have broken your %s", op->name); } if (st < 0) QCC_PR_ParseError(ERR_INTERNAL, "XSTOREP_F: pointer was not generated from previous statement"); var_c = QCC_GetTemp(*op->type_c); - if(need_lock) - QCC_LockTemp(var_c); // this will cause the temp to be remapped by QCC_RemapLockedTemps statement_linenums[statement-statements] = statement_linenums[st]; statement->op = OP_ADDRESS; @@ -2363,7 +2352,6 @@ QCC_def_t *QCC_PR_Statement ( QCC_opcode_t *op, QCC_def_t *var_a, QCC_def_t *var op = &pr_opcodes[OP_STOREP_F]; QCC_FreeTemp(var_c); - var_c = NULL; QCC_FreeTemp(var_b); @@ -2380,24 +2368,18 @@ QCC_def_t *QCC_PR_Statement ( QCC_opcode_t *op, QCC_def_t *var_a, QCC_def_t *var //don't chain these... this expansion is not the same. { int st; - int need_lock = false; for (st = numstatements-2; st>=0; st--) { if (statements[st].op == OP_ADDRESS) if (statements[st].c == var_b->ofs) break; - if (statements[st].op >= OP_CALL0 && statements[st].op <= OP_CALL8 || statements[st].op >= OP_CALL1H && statements[st].op <= OP_CALL8H) - need_lock = true; - if (statements[st].c == var_b->ofs) QCC_PR_ParseWarning(0, "Temp-reuse may have broken your %s", op->name); } if (st < 0) QCC_PR_ParseError(ERR_INTERNAL, "XSTOREP_V couldn't find pointer generation"); var_c = QCC_GetTemp(*op->type_c); - if(need_lock) - QCC_LockTemp(var_c); // this will cause the temp to be remapped by QCC_RemapLockedTemps statement_linenums[statement-statements] = statement_linenums[st]; statement->op = OP_ADDRESS; @@ -3448,6 +3430,7 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could { //t = (a/%1) / (nextent(world)/%1) //a/%1 does a (int)entity to float conversion type thing + func->initialized = 1; e = QCC_PR_Expression(TOP_PRIORITY, EXPR_DISALLOW_COMMA); QCC_PR_Expect(")"); @@ -4069,7 +4052,7 @@ PR_ParseValue Returns the global ofs for the current token ============ */ -QCC_def_t *QCC_PR_ParseValue (QCC_type_t *assumeclass) +QCC_def_t *QCC_PR_ParseValue (QCC_type_t *assumeclass, pbool allowarrayassign) { QCC_def_t *ao=NULL; //arrayoffset QCC_def_t *d, *nd, *od; @@ -4369,7 +4352,7 @@ reloop: if (d->scope) QCC_PR_ParseError(0, "Scoped array without specific engine support"); - if (QCC_PR_CheckToken("=")) + if (allowarrayassign && QCC_PR_CheckToken("=")) { QCC_def_t *args[2]; @@ -4662,7 +4645,7 @@ reloop: QCC_PR_Expect(")"); } else - field = QCC_PR_ParseValue(d->type); + field = QCC_PR_ParseValue(d->type, false); if (field->type->type == ev_field) { if (!field->type->aux_type) @@ -4997,7 +4980,7 @@ QCC_def_t *QCC_PR_Term (void) return e; } } - return QCC_PR_ParseValue (pr_classtype); + return QCC_PR_ParseValue (pr_classtype, true); } @@ -6546,7 +6529,7 @@ void QCC_PR_ParseAsm(void) { patch1 = &statements[numstatements]; - a = QCC_PR_ParseValue(pr_classtype); + a = QCC_PR_ParseValue(pr_classtype, false); QCC_PR_Statement3(&pr_opcodes[op], a, NULL, NULL, true); if (pr_token_type == tt_name) @@ -6565,8 +6548,8 @@ void QCC_PR_ParseAsm(void) { patch1 = &statements[numstatements]; - a = QCC_PR_ParseValue(pr_classtype); - b = QCC_PR_ParseValue(pr_classtype); + a = QCC_PR_ParseValue(pr_classtype, false); + b = QCC_PR_ParseValue(pr_classtype, false); QCC_PR_Statement3(&pr_opcodes[op], a, b, NULL, true); if (pr_token_type == tt_name) @@ -6585,15 +6568,15 @@ void QCC_PR_ParseAsm(void) else { if (pr_opcodes[op].type_a != &type_void) - a = QCC_PR_ParseValue(pr_classtype); + a = QCC_PR_ParseValue(pr_classtype, false); else a=NULL; if (pr_opcodes[op].type_b != &type_void) - b = QCC_PR_ParseValue(pr_classtype); + b = QCC_PR_ParseValue(pr_classtype, false); else b=NULL; if (pr_opcodes[op].associative==ASSOC_LEFT && pr_opcodes[op].type_c != &type_void) - c = QCC_PR_ParseValue(pr_classtype); + c = QCC_PR_ParseValue(pr_classtype, false); else c=NULL; @@ -9151,8 +9134,13 @@ void QCC_PR_ParseDefs (char *classname) i = 0; do { - if (QCC_PR_CheckImmediate("0")) + if (pr_token_type == tt_immediate && ( + (pr_immediate_type == type_integer && pr_immediate._int == 0) || + (pr_immediate_type == type_float && pr_immediate._float == 0))) + { + QCC_PR_Lex(); G_FUNCTION(def->ofs+i) = 0; + } else { name = QCC_PR_ParseName (); diff --git a/engine/qclib/qcc_pr_lex.c b/engine/qclib/qcc_pr_lex.c index 6b442bca8..286da96f6 100644 --- a/engine/qclib/qcc_pr_lex.c +++ b/engine/qclib/qcc_pr_lex.c @@ -1401,7 +1401,7 @@ void QCC_PR_LexNumber (void) pr_file_p++; } pr_token[tokenlen++] = 0; - pr_immediate._float = atof(pr_token); + pr_immediate._float = (float)atof(pr_token); return; } else if (c == 'i') @@ -2419,7 +2419,7 @@ int QCC_PR_CheakCompConst(void) if (!strncmp(pr_file_p, "__NULL__", 8)) { static char retbuf[256]; - sprintf(retbuf, "~0"); + sprintf(retbuf, "0i"); pr_file_p = retbuf; QCC_PR_Lex(); //translate the macro's value pr_file_p = oldpr_file_p+8; @@ -2599,7 +2599,12 @@ void QCC_PR_ParsePrintDef (int type, QCC_def_t *def) if (qccwarningdisabled[type]) return; if (def->s_file) - printf ("%s:%i: %s is defined here\n", strings + def->s_file, def->s_line, def->name); + { + if (flag_msvcstyle) + printf ("%s(%i) : %s is defined here\n", strings + def->s_file, def->s_line, def->name); + else + printf ("%s:%i: %s is defined here\n", strings + def->s_file, def->s_line, def->name); + } } void *errorscope; void QCC_PR_PrintScope (void) @@ -2645,7 +2650,10 @@ void VARGS QCC_PR_ParseError (int errortype, char *error, ...) #endif QCC_PR_PrintScope(); - printf ("%s:%i: error: %s\n", strings + s_file, pr_source_line, string); + if (flag_msvcstyle) + printf ("%s(%i) : error: %s\n", strings + s_file, pr_source_line, string); + else + printf ("%s:%i: error: %s\n", strings + s_file, pr_source_line, string); longjmp (pr_parse_abort, 1); } @@ -2662,7 +2670,10 @@ void VARGS QCC_PR_ParseErrorPrintDef (int errortype, QCC_def_t *def, char *error editbadfile(strings+s_file, pr_source_line); #endif QCC_PR_PrintScope(); - printf ("%s:%i: error: %s\n", strings + s_file, pr_source_line, string); + if (flag_msvcstyle) + printf ("%s(%i) : error: %s\n", strings + s_file, pr_source_line, string); + else + printf ("%s:%i: error: %s\n", strings + s_file, pr_source_line, string); QCC_PR_ParsePrintDef(WARN_ERROR, def); @@ -2683,12 +2694,18 @@ void VARGS QCC_PR_ParseWarning (int type, char *error, ...) QCC_PR_PrintScope(); if (type >= ERR_PARSEERRORS) { - printf ("%s:%i: error: %s\n", strings + s_file, pr_source_line, string); + if (flag_msvcstyle) + printf ("%s(%i) : error: %s\n", strings + s_file, pr_source_line, string); + else + printf ("%s:%i: error: %s\n", strings + s_file, pr_source_line, string); pr_error_count++; } else { - printf ("%s:%i: warning: %s\n", strings + s_file, pr_source_line, string); + if (flag_msvcstyle) + printf ("%s(%i) : warning: %s\n", strings + s_file, pr_source_line, string); + else + printf ("%s:%i: warning: %s\n", strings + s_file, pr_source_line, string); pr_warning_count++; } } @@ -2707,7 +2724,12 @@ void VARGS QCC_PR_Warning (int type, char *file, int line, char *error, ...) QCC_PR_PrintScope(); if (file) - printf ("%s:%i: warning: %s\n", file, line, string); + { + if (flag_msvcstyle) + printf ("%s(%i) : warning: %s\n", file, line, string); + else + printf ("%s:%i: warning: %s\n", file, line, string); + } else printf ("warning: %s\n", string); pr_warning_count++; diff --git a/engine/qclib/qccmain.c b/engine/qclib/qccmain.c index 48d1994e0..770fb44ea 100644 --- a/engine/qclib/qccmain.c +++ b/engine/qclib/qccmain.c @@ -15,6 +15,7 @@ extern int optres_test2; int writeasm; static pbool pr_werror; +pbool verbose; pbool QCC_PR_SimpleGetToken (void); @@ -230,6 +231,7 @@ compiler_flag_t compiler_flag[] = { {&flag_laxcasts, FLAG_MIDCOMPILE,"lax", "Lax type checks", "Disables many errors (generating warnings instead) when function calls or operations refer to two normally incompatible types. This is required for reacc support, and can also allow certain (evil) mods to compile that were originally written for frikqcc."}, //Allow lax casting. This'll produce loadsa warnings of course. But allows compilation of certain dodgy code. {&flag_hashonly, FLAG_MIDCOMPILE,"hashonly", "Hash-only constants", "Allows use of only #constant for precompiler constants, allows certain preqcc using mods to compile"}, {&opt_logicops, FLAG_MIDCOMPILE,"lo", "Logic ops", "This changes the behaviour of your code. It generates additional if operations to early-out in if statements. With this flag, the line if (0 && somefunction()) will never call the function. It can thus be considered an optimisation. However, due to the change of behaviour, it is not considered so by fteqcc. Note that due to inprecisions with floats, this flag can cause runaway loop errors within the player walk and run functions (without iffloat also enabled). This code is advised:\nplayer_stand1:\n if (self.velocity_x || self.velocity_y)\nplayer_run\n if (!(self.velocity_x || self.velocity_y))"}, + {&flag_msvcstyle, FLAG_MIDCOMPILE,"msvcstyle", "MSVC-style errors", "Generates warning and error messages in a format that msvc understands, to facilitate ide integration."}, {&flag_fasttrackarrays, FLAG_MIDCOMPILE|FLAG_ASDEFAULT,"fastarrays","fast arrays where possible", "Generates extra instructions inside array handling functions to detect engine and use extension opcodes only in supporting engines.\nAdds a global which is set by the engine if the engine supports the extra opcodes. Note that this applies to all arrays or none."}, {&flag_assume_integer, FLAG_MIDCOMPILE,"assumeint", "Assume Integers", "Numerical constants are assumed to be integers, instead of floats."}, {NULL} @@ -634,10 +636,13 @@ pbool QCC_WriteData (int crc) //include a type block? types = debugtarget;//!!QCC_PR_CheckCompConstDefined("TYPES"); //useful for debugging and saving (maybe, anyway...). - if (qcc_targetformat == QCF_DARKPLACES) - printf("DarkPlaces or FTE will be required\n"); - else - printf("An FTE executor will be required\n"); + if (verbose) + { + if (qcc_targetformat == QCF_DARKPLACES) + printf("DarkPlaces or FTE will be required\n"); + else + printf("An FTE executor will be required\n"); + } break; case QCF_KK7: if (bodylessfuncs) @@ -845,16 +850,20 @@ pbool QCC_WriteData (int crc) //PrintGlobals (); strofs = (strofs+3)&~3; - printf ("%6i strofs (of %i)\n", strofs, MAX_STRINGS); - printf ("%6i numstatements (of %i)\n", numstatements, MAX_STATEMENTS); - printf ("%6i numfunctions (of %i)\n", numfunctions, MAX_FUNCTIONS); - printf ("%6i numglobaldefs (of %i)\n", numglobaldefs, MAX_GLOBALS); - printf ("%6i numfielddefs (%i unique) (of %i)\n", numfielddefs, pr.size_fields, MAX_FIELDS); - printf ("%6i numpr_globals (of %i)\n", numpr_globals, MAX_REGS); + if (verbose) + { + printf ("%6i strofs (of %i)\n", strofs, MAX_STRINGS); + printf ("%6i numstatements (of %i)\n", numstatements, MAX_STATEMENTS); + printf ("%6i numfunctions (of %i)\n", numfunctions, MAX_FUNCTIONS); + printf ("%6i numglobaldefs (of %i)\n", numglobaldefs, MAX_GLOBALS); + printf ("%6i numfielddefs (%i unique) (of %i)\n", numfielddefs, pr.size_fields, MAX_FIELDS); + printf ("%6i numpr_globals (of %i)\n", numpr_globals, MAX_REGS); + } if (!*destfile) strcpy(destfile, "progs.dat"); - printf("Writing %s\n", destfile); + if (verbose) + printf("Writing %s\n", destfile); h = SafeOpenWrite (destfile, 2*1024*1024); SafeWrite (h, &progs, sizeof(progs)); SafeWrite (h, "\r\n\r\n", 4); @@ -1187,7 +1196,8 @@ strofs = (strofs+3)&~3; break; } - printf ("%6i TOTAL SIZE\n", (int)SafeSeek (h, 0, SEEK_CUR)); + if (verbose) + printf ("%6i TOTAL SIZE\n", (int)SafeSeek (h, 0, SEEK_CUR)); progs.entityfields = pr.size_fields; @@ -1215,7 +1225,8 @@ strofs = (strofs+3)&~3; unsigned int version = 1; StripExtension(destfile); strcat(destfile, ".lno"); - printf("Writing %s\n", destfile); + if (verbose) + printf("Writing %s for debugging\n", destfile); h = SafeOpenWrite (destfile, 2*1024*1024); SafeWrite (h, &lnotype, sizeof(int)); SafeWrite (h, &version, sizeof(int)); @@ -1608,8 +1619,9 @@ int QCC_PR_FinishCompilation (void) } else { - QCC_PR_Warning(WARN_NOTDEFINED, strings + d->s_file, d->s_line, "function %s was not defined",d->name); + QCC_PR_ParseErrorPrintDef(ERR_NOFUNC, d, "function %s was not defined",d->name); bodylessfuncs = true; + errors = true; } // errors = true; } @@ -1887,28 +1899,35 @@ unsigned short QCC_PR_WriteProgdefs (char *filename) case 12923: //#pragma sourcefile usage break; case 54730: - printf("Recognised progs as QuakeWorld\n"); + if (verbose) + printf("Recognised progs as QuakeWorld\n"); break; case 5927: - printf("Recognised progs as NetQuake server gamecode\n"); + if (verbose) + printf("Recognised progs as NetQuake server gamecode\n"); break; case 26940: - printf("Recognised progs as Quake pre-release...\n"); + if (verbose) + printf("Recognised progs as Quake pre-release...\n"); break; case 38488: - printf("Recognised progs as original Hexen2\n"); + if (verbose) + printf("Recognised progs as original Hexen2\n"); break; case 26905: - printf("Recognised progs as Hexen2 Mission Pack\n"); + if (verbose) + printf("Recognised progs as Hexen2 Mission Pack\n"); break; case 14046: - printf("Recognised progs as Hexen2 (demo)\n"); + if (verbose) + printf("Recognised progs as Hexen2 (demo)\n"); break; case 22390: //EXT_CSQC_1 - printf("Recognised progs as a CSQC module\n"); + if (verbose) + printf("Recognised progs as an EXT_CSQC_1 module\n"); break; case 17105: case 32199: //outdated ext_csqc @@ -1918,7 +1937,8 @@ unsigned short QCC_PR_WriteProgdefs (char *filename) printf("Recognised progs as outdated CSQC module\n"); break; case 10020: - printf("Recognised progs as a DP/FTE Menu module\n"); + if (verbose) + printf("Recognised progs as a DP/FTE Menu module\n"); break; case 32401: @@ -2274,14 +2294,17 @@ void QCC_CopyFiles (void) char srcdir[1024], destdir[1024]; int p; - if (numsounds > 0) - printf ("%3i unique precache_sounds\n", numsounds); - if (nummodels > 0) - printf ("%3i unique precache_models\n", nummodels); - if (numtextures > 0) - printf ("%3i unique precache_textures\n", numtextures); - if (numfiles > 0) - printf ("%3i unique precache_files\n", numfiles); + if (verbose) + { + if (numsounds > 0) + printf ("%3i unique precache_sounds\n", numsounds); + if (nummodels > 0) + printf ("%3i unique precache_models\n", nummodels); + if (numtextures > 0) + printf ("%3i unique precache_textures\n", numtextures); + if (numfiles > 0) + printf ("%3i unique precache_files\n", numfiles); + } p = QCC_CheckParm ("-copy"); if (p && p < myargc-2) @@ -3157,7 +3180,9 @@ void QCC_ContinueCompile(void) if (autoprototype) printf ("prototyping %s\n", qccmfilename); else + { printf ("compiling %s\n", qccmfilename); + } QCC_LoadFile (qccmfilename, (void *)&qccmsrc2); if (!QCC_PR_CompileFile (qccmsrc2, qccmfilename) ) @@ -3217,58 +3242,61 @@ void QCC_FinishCompile(void) if (donesomething) { - printf ("Compile Complete\n\n"); + if (verbose) + { + printf ("Compile Complete\n\n"); - if (optres_shortenifnots) - printf("optres_shortenifnots %i\n", optres_shortenifnots); - if (optres_overlaptemps) - printf("optres_overlaptemps %i\n", optres_overlaptemps); - if (optres_noduplicatestrings) - printf("optres_noduplicatestrings %i\n", optres_noduplicatestrings); - if (optres_constantarithmatic) - printf("optres_constantarithmatic %i\n", optres_constantarithmatic); - if (optres_nonvec_parms) - printf("optres_nonvec_parms %i\n", optres_nonvec_parms); - if (optres_constant_names) - printf("optres_constant_names %i\n", optres_constant_names); - if (optres_constant_names_strings) - printf("optres_constant_names_strings %i\n", optres_constant_names_strings); - if (optres_precache_file) - printf("optres_precache_file %i\n", optres_precache_file); - if (optres_filenames) - printf("optres_filenames %i\n", optres_filenames); - if (optres_assignments) - printf("optres_assignments %i\n", optres_assignments); - if (optres_unreferenced) - printf("optres_unreferenced %i\n", optres_unreferenced); - if (optres_locals) - printf("optres_locals %i\n", optres_locals); - if (optres_function_names) - printf("optres_function_names %i\n", optres_function_names); - if (optres_dupconstdefs) - printf("optres_dupconstdefs %i\n", optres_dupconstdefs); - if (optres_return_only) - printf("optres_return_only %i\n", optres_return_only); - if (optres_compound_jumps) - printf("optres_compound_jumps %i\n", optres_compound_jumps); - // if (optres_comexprremoval) - // printf("optres_comexprremoval %i\n", optres_comexprremoval); - if (optres_stripfunctions) - printf("optres_stripfunctions %i\n", optres_stripfunctions); - if (optres_locals_marshalling) - printf("optres_locals_marshalling %i\n", optres_locals_marshalling); - if (optres_logicops) - printf("optres_logicops %i\n", optres_logicops); + if (optres_shortenifnots) + printf("optres_shortenifnots %i\n", optres_shortenifnots); + if (optres_overlaptemps) + printf("optres_overlaptemps %i\n", optres_overlaptemps); + if (optres_noduplicatestrings) + printf("optres_noduplicatestrings %i\n", optres_noduplicatestrings); + if (optres_constantarithmatic) + printf("optres_constantarithmatic %i\n", optres_constantarithmatic); + if (optres_nonvec_parms) + printf("optres_nonvec_parms %i\n", optres_nonvec_parms); + if (optres_constant_names) + printf("optres_constant_names %i\n", optres_constant_names); + if (optres_constant_names_strings) + printf("optres_constant_names_strings %i\n", optres_constant_names_strings); + if (optres_precache_file) + printf("optres_precache_file %i\n", optres_precache_file); + if (optres_filenames) + printf("optres_filenames %i\n", optres_filenames); + if (optres_assignments) + printf("optres_assignments %i\n", optres_assignments); + if (optres_unreferenced) + printf("optres_unreferenced %i\n", optres_unreferenced); + if (optres_locals) + printf("optres_locals %i\n", optres_locals); + if (optres_function_names) + printf("optres_function_names %i\n", optres_function_names); + if (optres_dupconstdefs) + printf("optres_dupconstdefs %i\n", optres_dupconstdefs); + if (optres_return_only) + printf("optres_return_only %i\n", optres_return_only); + if (optres_compound_jumps) + printf("optres_compound_jumps %i\n", optres_compound_jumps); + // if (optres_comexprremoval) + // printf("optres_comexprremoval %i\n", optres_comexprremoval); + if (optres_stripfunctions) + printf("optres_stripfunctions %i\n", optres_stripfunctions); + if (optres_locals_marshalling) + printf("optres_locals_marshalling %i\n", optres_locals_marshalling); + if (optres_logicops) + printf("optres_logicops %i\n", optres_logicops); - if (optres_test1) - printf("optres_test1 %i\n", optres_test1); - if (optres_test2) - printf("optres_test2 %i\n", optres_test2); - - printf("numtemps %i\n", numtemps); - - printf("%i warnings\n", pr_warning_count); + if (optres_test1) + printf("optres_test1 %i\n", optres_test1); + if (optres_test2) + printf("optres_test2 %i\n", optres_test2); + + printf("numtemps %i\n", numtemps); + } + if (!flag_msvcstyle) + printf("%i warnings\n", pr_warning_count); } qcc_compileactive = false; From d57438adf3e24b6ee01cb5ab0e173cb6eb7dee6d Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 25 Apr 2010 13:52:27 +0000 Subject: [PATCH 76/76] Ported the linux q2dll stuff over to SDL, attempts to load gamei386.so still. This is wrong. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3530 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/sys_sdl.c | 66 +++++++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/engine/client/sys_sdl.c b/engine/client/sys_sdl.c index b7ed77ae3..4c7bd38aa 100644 --- a/engine/client/sys_sdl.c +++ b/engine/client/sys_sdl.c @@ -139,18 +139,6 @@ void Sys_ServerActivity(void) { } - - -//Without these two we cannot run Q2 gamecode. -void Sys_UnloadGame (void) -{ -} -void *Sys_GetGameAPI (void *parms) -{ - return NULL; -} - - void Sys_CloseLibrary(dllhandle_t *lib) { SDL_UnloadObject((void*)lib); @@ -179,6 +167,60 @@ dllhandle_t *Sys_LoadLibrary(char *name, dllfunction_t *funcs) return (dllhandle_t*)lib; } +//Without these two we cannot run Q2 gamecode. +dllhandle_t *q2gamedll; +void Sys_UnloadGame (void) +{ + if (q2gamedll) + Sys_CloseLibrary(q2gamedll); + q2gamedll = NULL; +} +void *Sys_GetGameAPI (void *parms) +{ + void *(*GetGameAPI)(void *); + dllfunction_t funcs[] = + { + {(void**)GetGameAPI, "GetGameAPI"}, + {NULL,NULL} + }; + + char name[MAX_OSPATH]; + char curpath[MAX_OSPATH]; + char *searchpath; + const char *gamename = "gamei386.so"; + + void *ret; + + Con_DPrintf("Searching for %s\n", gamename); + + getcwd(curpath, sizeof(curpath)); + + searchpath = 0; + while((searchpath = COM_NextPath(searchpath))) + { + if (searchpath[0] == '/') + snprintf(name, sizeof(name), "%s/%s", searchpath, gamename); + else + snprintf(name, sizeof(name), "%s/%s/%s", curpath, searchpath, gamename); + + q2gamedll = Sys_LoadLibrary(name, funcs); + if (q2gamedll && gamename) + { + ret = GetGameAPI(parms); + if (ret) + { + return ret; + } + + Sys_CloseLibrary(q2gamedll); + q2gamedll = 0; + } + } + + return NULL; +} + + //used to see if a file exists or not. int Sys_FileTime (char *path)