From 215d90b4288c1f8f43fa6cc48ef5b7e51d6416a5 Mon Sep 17 00:00:00 2001 From: kadaverjack Date: Sat, 12 Nov 2005 03:12:33 +0000 Subject: [PATCH] added minstagib mutator, killmessages and a first bunch of announcer messages (soundfiles will be added when they are finished) fixed messages for colored playernames git-svn-id: svn://svn.icculus.org/nexuiz/trunk@579 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/default.cfg | 6 +- data/qcsrc/gamec/cl_client.c | 92 ++++++++++++- data/qcsrc/gamec/cl_impulse.c | 8 +- data/qcsrc/gamec/cl_physics.c | 5 + data/qcsrc/gamec/cl_player.c | 13 +- data/qcsrc/gamec/cl_weapons.c | 9 +- data/qcsrc/gamec/clientcommands.c | 2 + data/qcsrc/gamec/constants.h | 1 + data/qcsrc/gamec/ctf.c | 28 ++-- data/qcsrc/gamec/defs.h | 5 + data/qcsrc/gamec/domination.c | 2 +- data/qcsrc/gamec/g_damage.c | 176 ++++++++++++++++++------ data/qcsrc/gamec/g_world.c | 16 ++- data/qcsrc/gamec/t_items.c | 216 +++++++++++++++++++++++------- data/qcsrc/gamec/teamplay.c | 19 ++- data/qcsrc/gamec/w_nex.c | 107 ++++++++++++++- 16 files changed, 580 insertions(+), 125 deletions(-) diff --git a/data/default.cfg b/data/default.cfg index 37701d123..13f55ecf5 100755 --- a/data/default.cfg +++ b/data/default.cfg @@ -100,6 +100,10 @@ set g_start_ammo_cells 0 set g_use_ammunition 1 set g_pickup_items 1 set g_instagib 0 +set g_minstagib 0 // enable minstagib +set g_minstagib_extralives 2 // how many extra lives you will get per powerup +set g_minstagib_ammo_start 10 // starting ammo +set g_minstagib_ammo_drop 5 // how much ammo you'll get for weapons or cells set g_rocketarena 0 set g_vampire 0 set g_homing_missile 0 @@ -408,4 +412,4 @@ bind F2 vno //used for spectate/observer mode alias "spec" "cmd spectate" -bind F3 spec \ No newline at end of file +bind F3 spec diff --git a/data/qcsrc/gamec/cl_client.c b/data/qcsrc/gamec/cl_client.c index 75e4c82a1..2e3f2b555 100644 --- a/data/qcsrc/gamec/cl_client.c +++ b/data/qcsrc/gamec/cl_client.c @@ -210,7 +210,7 @@ void PutObserverInServer (void) self.killcount = -666; self.frags = -666; //stuffcmd(self, "set viewsize 120 \n"); - bprint (strcat("^4", self.netname, " is spectating now\n")); + bprint (strcat("^4", self.netname, "^4 is spectating now\n")); } @@ -361,7 +361,19 @@ void PutClientInServer (void) self.items = self.items | IT_ROCKET_LAUNCHER; self.switchweapon = WEP_ROCKET_LAUNCHER; } - + + if(cvar("g_minstagib")) + { + self.health = 100; + self.armorvalue = 0; + self.items = IT_NEX; + self.switchweapon = WEP_NEX; + self.ammo_cells = cvar("g_minstagib_ammo_start"); + self.extralives = 0; + self.jump_interval = time; + stuffcmd(self, strcat("crosshair_static ", self.crosshair_static, "\n")); + } + self.event_damage = PlayerDamage; self.statdraintime = time + 5; @@ -444,7 +456,7 @@ void ClientConnect (void) //stuffcmd(self, "set tmpviewsize $viewsize \n"); bprint ("^4",self.netname); - bprint (" connected"); + bprint ("^4 connected"); if(cvar("g_domination") || cvar("g_ctf")) { @@ -467,7 +479,6 @@ void ClientConnect (void) stuffcmd(self, strcat("cl_movement_jumpvelocity ", ftos(cvar("g_balance_jumpheight")), "\n")); stuffcmd(self, strcat("cl_movement_stepheight ", ftos(cvar("sv_stepheight")), "\n")); stuffcmd(self, strcat("cl_movement_edgefriction 0\n")); - // Wazat's grappling hook SetGrappleHookBindings(); @@ -477,6 +488,9 @@ void ClientConnect (void) // get version info from player stuffcmd(self, "cmd clientversion $g_nexuizversion\n"); + + // get crosshair_static + stuffcmd(self, "cmd crosshair $crosshair_static\n"); } /* @@ -490,7 +504,7 @@ Called when a client disconnects from the server void ClientDisconnect (void) { bprint ("^4",self.netname); - bprint (" disconnected\n"); + bprint ("^4 disconnected\n"); if (self.chatbubbleentity) { @@ -604,6 +618,11 @@ void PlayerJump (void) } } + if(cvar("g_minstagib") && (self.items & IT_INVINCIBLE)) + { + mjumpheight = mjumpheight * cvar("g_balance_rune_speed_jumpheight"); + } + self.velocity_z = self.velocity_z + mjumpheight; self.oldvelocity_z = self.velocity_z; @@ -649,6 +668,50 @@ void respawn(void) void player_powerups (void) { + if (cvar("g_minstagib")) + { + self.effects = EF_FULLBRIGHT; + if (self.items & IT_STRENGTH) + { + self.effects = EF_NODRAW; + if (time > self.strength_finished) + { + self.items = self.items - (self.items & IT_STRENGTH); + stuffcmd(self, strcat("crosshair_static ", self.crosshair_static, "\n")); + sprint(self, "^3Invisibility has worn off\n"); + } + } + else + { + if (time < self.strength_finished) + { + stuffcmd(self, "crosshair_static 1\n"); + self.items = self.items | IT_STRENGTH; + sprint(self, "^3You are invisible\n"); + } + } + + if (self.items & IT_INVINCIBLE) + { + if (time > self.invincible_finished) + { + self.items = self.items - (self.items & IT_INVINCIBLE); + //stuffcmd(self, strcat("crosshair_static ", ftos(self.crosshair_static), "\n")); + sprint(self, "^3Speed has worn off\n"); + } + } + else + { + if (time < self.invincible_finished) + { + stuffcmd(self, "crosshair_static 1\n"); + self.items = self.items | IT_INVINCIBLE; + sprint(self, "^3You are on speed\n"); + } + } + return; + } + self.effects = self.effects - (self.effects & (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT)); if (self.items & IT_STRENGTH) { @@ -696,6 +759,13 @@ void player_regen (void) maxh = cvar("g_balance_health_stable"); maxa = cvar("g_balance_armor_stable"); + if (cvar("g_minstagib")) + { + maxh = 100; + maxa = 0; + return; + } + if(cvar("g_runematch")) { max_mod = regen_mod = rot_mod = 1; @@ -924,7 +994,15 @@ void PlayerPreThink (void) if (self.button4 || (self.weapon == WEP_NEX && self.button3)) { - if (self.viewzoom > 0.4) + if (cvar("g_minstagib") && self.button3) + { + if (self.jump_interval <= (time + 0.1)) + { + self.jump_interval = time + 1; + weapon_doattack(laser_check, laser_check, W_Laser_Attack); + } + } + else if (self.viewzoom > 0.4) self.viewzoom = max (0.4, self.viewzoom - frametime * 2); } else if (self.viewzoom < 1.0) @@ -957,7 +1035,7 @@ void PlayerPreThink (void) if (self.button2) { self.flags = self.flags & !FL_JUMPRELEASED; self.classname = "player"; - bprint (strcat("^4", self.netname, " is playing now\n")); + bprint (strcat("^4", self.netname, "^4 is playing now\n")); PutClientInServer(); centerprint(self,""); return; diff --git a/data/qcsrc/gamec/cl_impulse.c b/data/qcsrc/gamec/cl_impulse.c index c656653d2..8f2e1c8a3 100644 --- a/data/qcsrc/gamec/cl_impulse.c +++ b/data/qcsrc/gamec/cl_impulse.c @@ -19,11 +19,11 @@ void DummyThink(void) void ImpulseCommands (void) { - if (self.impulse >= 1 && self.impulse <= 9) + if (self.impulse >= 1 && self.impulse <= 9 && !cvar("g_minstagib")) W_SwitchWeapon (self.impulse); - else if (self.impulse == 10) + else if (self.impulse == 10 && !cvar("g_minstagib")) W_NextWeapon (); - else if (self.impulse == 12) + else if (self.impulse == 12 && !cvar("g_minstagib")) W_PreviousWeapon (); else if (self.impulse == 13 && cvar("sv_cheats")) { @@ -61,4 +61,4 @@ void ImpulseCommands (void) } //TetrisImpulses(); self.impulse = 0; -} \ No newline at end of file +} diff --git a/data/qcsrc/gamec/cl_physics.c b/data/qcsrc/gamec/cl_physics.c index fe725be95..65883f613 100644 --- a/data/qcsrc/gamec/cl_physics.c +++ b/data/qcsrc/gamec/cl_physics.c @@ -54,6 +54,11 @@ void SV_PlayerPhysics() } } + if(cvar("g_minstagib") && (self.items & IT_INVINCIBLE)) + { + maxspd_mod = maxspd_mod * cvar("g_balance_rune_speed_moverate"); + } + spd = sv_maxspeed * maxspd_mod; if(self.speed != spd) diff --git a/data/qcsrc/gamec/cl_player.c b/data/qcsrc/gamec/cl_player.c index 32b01f3be..6f1892369 100644 --- a/data/qcsrc/gamec/cl_player.c +++ b/data/qcsrc/gamec/cl_player.c @@ -116,6 +116,7 @@ void SpawnThrownWeapon (vector org, float w) local entity oldself; if (!cvar("g_pickup_items")) + if (!cvar("g_minstagib")) return; if (w == IT_LASER) return; @@ -236,8 +237,16 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht self.pain_finished = time + 0.5; //Supajoe } - save = bound(0, damage * cvar("g_balance_armor_blockpercent"), self.armorvalue); - take = bound(0, damage - save, damage); + if (!cvar("g_minstagib")) + { + save = bound(0, damage * cvar("g_balance_armor_blockpercent"), self.armorvalue); + take = bound(0, damage - save, damage); + } + else + { + save = 0; + take = damage; + } if (save > 10) sound (self, CHAN_IMPACT, "misc/armorimpact.wav", 1, ATTN_NORM); diff --git a/data/qcsrc/gamec/cl_weapons.c b/data/qcsrc/gamec/cl_weapons.c index b6b2c9875..137d3f235 100644 --- a/data/qcsrc/gamec/cl_weapons.c +++ b/data/qcsrc/gamec/cl_weapons.c @@ -2,6 +2,13 @@ // add new weapons here void(float wpn, float wrequest) weapon_action = { + if (cvar("g_minstagib")) + { + if (wpn == WEP_NEX) + w_nex(wrequest); + return; + } + if (wpn == WEP_LASER) w_laser(wrequest); else if (wpn == WEP_SHOTGUN) @@ -199,4 +206,4 @@ void() W_WeaponFrame = else self.weaponentity.finaldest = '0 0 0'; self.weaponentity.origin = realorg + boblayer + layer1 - self.weaponentity.view_ofs; -}; \ No newline at end of file +}; diff --git a/data/qcsrc/gamec/clientcommands.c b/data/qcsrc/gamec/clientcommands.c index d5bdf5ba6..5a84608eb 100644 --- a/data/qcsrc/gamec/clientcommands.c +++ b/data/qcsrc/gamec/clientcommands.c @@ -173,6 +173,8 @@ void SV_ParseClientCommand(string s) { self.classname = "observer"; PutClientInServer(); } + } else if(argv(0) == "crosshair") { + self.crosshair_static = argv(1); } else { clientcommand(self,s); } diff --git a/data/qcsrc/gamec/constants.h b/data/qcsrc/gamec/constants.h index c03994017..9082320ee 100644 --- a/data/qcsrc/gamec/constants.h +++ b/data/qcsrc/gamec/constants.h @@ -138,6 +138,7 @@ float DEATH_HURTTRIGGER = 10003; float DEATH_LAVA = 10004; float DEATH_SLIME = 10005; float DEATH_KILL = 10006; +float DEATH_NOAMMO = 10007; float IT_LASER = 4096; float IT_SHOTGUN = 1; diff --git a/data/qcsrc/gamec/ctf.c b/data/qcsrc/gamec/ctf.c index a56c731e6..0961019cb 100644 --- a/data/qcsrc/gamec/ctf.c +++ b/data/qcsrc/gamec/ctf.c @@ -81,9 +81,9 @@ void(entity e) DropFlag = } bprint(p.netname); if (e.team == 5) - bprint(" lost the RED flag\n"); + bprint("^7 lost the RED flag\n"); else - bprint(" lost the BLUE flag\n"); + bprint("^7 lost the BLUE flag\n"); if (p.flagcarried == e) p.flagcarried = world; e.owner = world; @@ -213,25 +213,25 @@ void() FlagTouch = if (flagcaptimerecord == 0) { if (other.flagcarried.team == 5) - bprint(other.netname, " captured the RED flag in ", ftos(t), " seconds\n"); + bprint(other.netname, "^7 captured the RED flag in ", ftos(t), " seconds\n"); else - bprint(other.netname, " captured the BLUE flag in ", ftos(t), " seconds\n"); + bprint(other.netname, "^7 captured the BLUE flag in ", ftos(t), " seconds\n"); flagcaptimerecord = t; } else if (t < flagcaptimerecord) { if (other.flagcarried.team == 5) - bprint(other.netname, " captured the RED flag in ", ftos(t), ", breaking the previous record of", ftos(flagcaptimerecord), " seconds\n"); + bprint(other.netname, "^7 captured the RED flag in ", ftos(t), ", breaking the previous record of", ftos(flagcaptimerecord), " seconds\n"); else - bprint(other.netname, " captured the BLUE flag in ", ftos(t), ", breaking the previous record of", ftos(flagcaptimerecord), " seconds\n"); + bprint(other.netname, "^7 captured the BLUE flag in ", ftos(t), ", breaking the previous record of", ftos(flagcaptimerecord), " seconds\n"); flagcaptimerecord = t; } else { if (other.flagcarried.team == 5) - bprint(other.netname, " captured the RED flag in ", ftos(t), ", failing to break the previous record of", ftos(flagcaptimerecord), " seconds\n"); + bprint(other.netname, "^7 captured the RED flag in ", ftos(t), ", failing to break the previous record of", ftos(flagcaptimerecord), " seconds\n"); else - bprint(other.netname, " captured the BLUE flag in ", ftos(t), ", failing to break the previous record of", ftos(flagcaptimerecord), " seconds\n"); + bprint(other.netname, "^7 captured the BLUE flag in ", ftos(t), ", failing to break the previous record of", ftos(flagcaptimerecord), " seconds\n"); } other.frags = other.frags + cvar("g_ctf_flagscore_capture");//FLAGSCORE_CAPTURE; head = find(head, classname, "player"); @@ -257,9 +257,9 @@ void() FlagTouch = other.flagcarried = self; self.cnt = FLAG_CARRY; if (other.flagcarried.team == 5) - bprint(other.netname, " got the RED flag\n"); + bprint(other.netname, "^7 got the RED flag\n"); else - bprint(other.netname, " got the BLUE flag\n"); + bprint(other.netname, "^7 got the BLUE flag\n"); other.frags = other.frags + cvar("g_ctf_flagscore_pickup");//FLAGSCORE_PICKUP; sound (self, CHAN_AUTO, self.noise, 1, ATTN_NONE); @@ -279,9 +279,9 @@ void() FlagTouch = { // return flag if (self.team == 5) - bprint(other.netname, " returned the RED flag\n"); + bprint(other.netname, "^7 returned the RED flag\n"); else - bprint(other.netname, " returned the BLUE flag\n"); + bprint(other.netname, "^7 returned the BLUE flag\n"); if (other.team == 5 || other.team == 14) other.frags = other.frags + cvar("g_ctf_flagscore_return");//FLAGSCORE_RETURN; else @@ -299,9 +299,9 @@ void() FlagTouch = other.flagcarried = self; self.cnt = FLAG_CARRY; if (self.team == 5) - bprint(other.netname, " picked up the RED flag\n"); + bprint(other.netname, "^7 picked up the RED flag\n"); else - bprint(other.netname, " picked up the BLUE flag\n"); + bprint(other.netname, "^7 picked up the BLUE flag\n"); other.frags = other.frags + cvar("g_ctf_flagscore_pickup");//FLAGSCORE_PICKUP; sound (self, CHAN_AUTO, self.noise, 1, ATTN_NONE); diff --git a/data/qcsrc/gamec/defs.h b/data/qcsrc/gamec/defs.h index ff504c6c7..50e2715e4 100644 --- a/data/qcsrc/gamec/defs.h +++ b/data/qcsrc/gamec/defs.h @@ -206,3 +206,8 @@ float GRAPHOOK_RELEASE = 21; // Laser target for laser-guided weapons .entity lasertarget; .float laser_on; + +// minstagib vars +.float extralives; +.float jump_interval; // laser refire +.string crosshair_static; diff --git a/data/qcsrc/gamec/domination.c b/data/qcsrc/gamec/domination.c index 979388403..3f7f3283f 100644 --- a/data/qcsrc/gamec/domination.c +++ b/data/qcsrc/gamec/domination.c @@ -39,7 +39,7 @@ void dompoint_captured () //bprint(self.message); //bprint("\n"); - bprint(strcat("^3", head.netname, self.message, "\n")); + bprint(strcat("^3", head.netname, "^3", self.message, "\n")); if (head.noise != "") sound(self, CHAN_BODY, head.noise, 1, ATTN_NORM); diff --git a/data/qcsrc/gamec/g_damage.c b/data/qcsrc/gamec/g_damage.c index 3e4a7df61..f55dd95dc 100644 --- a/data/qcsrc/gamec/g_damage.c +++ b/data/qcsrc/gamec/g_damage.c @@ -25,30 +25,41 @@ void Obituary (entity attacker, entity targ, float deathtype) if (targ == attacker) { + if (deathtype == DEATH_NOAMMO) + centerprint(targ, strcat("^1You were killed for running out of ammo...\n\n\n")); + else + centerprint(targ, strcat("^1You killed your dumb self!\n\n\n")); + if (deathtype == IT_GRENADE_LAUNCHER) - bprint ("^1",s, " detonated\n"); + bprint ("^1",s, "^1 detonated\n"); else if (deathtype == IT_ELECTRO) - bprint ("^1",s, " played with plasma\n"); + bprint ("^1",s, "^1 played with plasma\n"); else if (deathtype == IT_ROCKET_LAUNCHER) - bprint ("^1",s, " exploded\n"); + bprint ("^1",s, "^1 exploded\n"); else if (deathtype == DEATH_KILL) - bprint ("^1",s, " couldn't take it anymore\n"); + bprint ("^1",s, "^1 couldn't take it anymore\n"); + else if (deathtype == DEATH_NOAMMO) + { + bprint ("^7",s, " ^7suicided after wasting all his ammo\n"); + sound (self, CHAN_BODY, "minstagib/mockery.ogg", 1, ATTN_NONE); + } else - bprint ("^1",s, " couldn't resist the urge to self-destruct\n"); + bprint ("^1",s, "^1 couldn't resist the urge to self-destruct\n"); GiveFrags(attacker, targ, -1); //targ.frags = targ.frags - 1; if (targ.killcount > 2) - bprint ("^1",s," ended it all with a ",ftos(targ.killcount)," kill spree\n"); + bprint ("^1",s,"^1 ended it all with a ",ftos(targ.killcount)," kill spree\n"); } else if (teamplay && attacker.team == targ.team) { - bprint ("^1", attacker.netname, " mows down a teammate\n"); + centerprint(attacker, strcat("^1Moron! You killed a teammate!\n\n\n")); + bprint ("^1", attacker.netname, "^1 mows down a teammate\n"); GiveFrags(attacker, targ, -1); //attacker.frags = attacker.frags - 1; if (targ.killcount > 2) - bprint ("^1",s,"'s ",ftos(targ.killcount)," kill spree was endeded by a teammate!\n"); + bprint ("^1",s,"'s ^1",ftos(targ.killcount)," kill spree was endeded by a teammate!\n"); if (attacker.killcount > 2) - bprint ("^1",attacker.netname," ended a ",ftos(attacker.killcount)," kill spree by killing a teammate\n"); + bprint ("^1",attacker.netname,"^1 ended a ",ftos(attacker.killcount)," kill spree by killing a teammate\n"); attacker.killcount = 0; } else if (attacker.classname == "player" || attacker.classname == "gib") @@ -57,68 +68,121 @@ void Obituary (entity attacker, entity targ, float deathtype) { checkrules_firstblood = TRUE; //sound(world, CHAN_AUTO, "announcer/firstblood.wav", 1, ATTN_NONE); - bprint("^1",attacker.netname, " drew first blood", "\n"); + if (cvar("g_minstagib")) + sound(world, CHAN_AUTO, "announce/male/mapkill1.ogg", 1, ATTN_NONE); + bprint("^1",attacker.netname, "^1 drew first blood", "\n"); } + centerprint(attacker, strcat("^4You killed ^7", s, "\n\n\n")); + centerprint(targ, strcat("^1You were killed by ^7", attacker.netname, "\n\n\n")); + if (deathtype == IT_LASER) - bprint ("^1",s, " was blasted by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n"); else if (deathtype == IT_UZI) - bprint ("^1",s, " was riddled full of holes by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was riddled full of holes by ", attacker.netname, "\n"); else if (deathtype == IT_SHOTGUN) - bprint ("^1",s, " was gunned by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was gunned by ", attacker.netname, "\n"); else if (deathtype == IT_GRENADE_LAUNCHER) - bprint ("^1", s, " was blasted by ", attacker.netname, "\n"); + bprint ("^1", s, "^1 was blasted by ", attacker.netname, "\n"); else if (deathtype == IT_ELECTRO) - bprint ("^1",s, " was blasted by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n"); else if (deathtype == IT_CRYLINK) - bprint ("^1",s, " was blasted by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n"); else if (deathtype == IT_NEX) - bprint ("^1",s, " has been vaporized by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 has been vaporized by ", attacker.netname, "\n"); else if (deathtype == IT_HAGAR) - bprint ("^1",s, " was pummeled by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was pummeled by ", attacker.netname, "\n"); else if (deathtype == IT_ROCKET_LAUNCHER) - bprint ("^1",s, " was blasted by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n"); else if (deathtype == DEATH_TELEFRAG) - bprint ("^1",s, " was telefragged by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was telefragged by ", attacker.netname, "\n"); else if (deathtype == DEATH_DROWN) - bprint ("^1",s, " was drowned by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was drowned by ", attacker.netname, "\n"); else if (deathtype == DEATH_SLIME) - bprint ("^1",s, " was slimed by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was slimed by ", attacker.netname, "\n"); else if (deathtype == DEATH_LAVA) - bprint ("^1",s, " was cooked by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was cooked by ", attacker.netname, "\n"); else if (deathtype == DEATH_FALL) - bprint ("^1",s, " was grounded by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was grounded by ", attacker.netname, "\n"); else if (deathtype == DEATH_HURTTRIGGER) - bprint ("^1",s, " was thrown into a world of hurt by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was thrown into a world of hurt by ", attacker.netname, "\n"); else - bprint ("^1",s, " was killed by ", attacker.netname, "\n"); + bprint ("^1",s, "^1 was killed by ", attacker.netname, "\n"); GiveFrags(attacker, targ, 1); //attacker.frags = attacker.frags + 1; if (targ.killcount > 2) - bprint ("^1",s,"'s ", ftos(targ.killcount), " kill spree was ended by ", attacker.netname, "\n"); + bprint ("^1",s,"'s ^1", ftos(targ.killcount), " kill spree was ended by ", attacker.netname, "\n"); attacker.killcount = attacker.killcount + 1; if (attacker.killcount > 2) - bprint ("^1",attacker.netname," has ",ftos(attacker.killcount)," kills in a row\n"); + bprint ("^1",attacker.netname,"^1 has ",ftos(attacker.killcount)," kills in a row\n"); + + if (attacker.killcount == 3) + { + bprint (attacker.netname,"^7 made a ^1Multikill\n"); + stuffcmd(attacker, "play2 announce/male/kill3.ogg\n"); + } + else if (attacker.killcount == 4) + { + bprint (attacker.netname,"^7 made a ^1Ultrakill\n"); + stuffcmd(attacker, "play2 announce/male/kill4.ogg\n"); + } + else if (attacker.killcount == 5) + { + bprint (attacker.netname,"^7 made a ^1MONSTERKILL\n"); + stuffcmd(attacker, "play2 announce/male/kill5.ogg\n"); + } + else if (attacker.killcount == 6) + { + bprint (attacker.netname,"^7 is on a ^1Killingspree\n"); + stuffcmd(attacker, "play2 announce/male/kill6.ogg\n"); + } + else if (attacker.killcount == 10) + { + bprint (attacker.netname,"^7 is on a ^1Rampage\n"); + sound(world, CHAN_AUTO, "announce/male/kill10.ogg", 1, ATTN_NONE); + } + else if (attacker.killcount == 15) + { + bprint (attacker.netname,"^7 is ^1Dominating\n"); + sound(world, CHAN_AUTO, "announce/male/kill15.ogg", 1, ATTN_NONE); + } + else if (attacker.killcount == 20) + { + bprint (attacker.netname,"^7 is ^1Unstoppable\n"); + sound(world, CHAN_AUTO, "announce/male/kill20.ogg", 1, ATTN_NONE); + } + else if (attacker.killcount == 25) + { + bprint (attacker.netname,"^7 is ^1Godlike\n"); + sound(world, CHAN_AUTO, "announce/male/kill25.ogg", 1, ATTN_NONE); + } + else if (attacker.killcount >= 30) + { + bprint (attacker.netname,"^7 is ^1Cheating!!!\n"); + sound(world, CHAN_AUTO, "announce/male/kill30.ogg", 1, ATTN_NONE); + } + } else { + centerprint(targ, strcat("^1Watch your step!\n\n\n")); if (deathtype == DEATH_HURTTRIGGER && attacker.message != "") - bprint ("^1",s, " ", attacker.message, "\n"); + bprint ("^1",s, "^1 ", attacker.message, "\n"); else if (deathtype == DEATH_DROWN) - bprint ("^1",s, " drowned\n"); + bprint ("^1",s, "^1 drowned\n"); else if (deathtype == DEATH_SLIME) - bprint ("^1",s, " was slimed\n"); + bprint ("^1",s, "^1 was slimed\n"); else if (deathtype == DEATH_LAVA) - bprint ("^1",s, " turned into hot slag\n"); + bprint ("^1",s, "^1 turned into hot slag\n"); else if (deathtype == DEATH_FALL) - bprint ("^1",s, " hit the ground with a crunch\n"); + bprint ("^1",s, "^1 hit the ground with a crunch\n"); else - bprint ("^1",s, " died\n"); + bprint ("^1",s, "^1 died\n"); GiveFrags(targ, targ, -1); //targ.frags = targ.frags - 1; if (targ.killcount > 2) - bprint ("^1",s," died with a ",ftos(targ.killcount)," kill spree\n"); + bprint ("^1",s,"^1 died with a ",ftos(targ.killcount)," kill spree\n"); } // FIXME: this should go in PutClientInServer if (targ.killcount) @@ -148,7 +212,41 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if (attacker.team == targ.team) if (teamplay == 1 || (teamplay == 3 && attacker != targ)) damage = 0; - + + if (cvar("g_minstagib")) + { + if ((deathtype == DEATH_FALL) || + (deathtype == DEATH_DROWN) || + (deathtype == DEATH_SLIME) || + (deathtype == DEATH_LAVA)) + return; + if (targ.extralives && (deathtype == IT_NEX)) + { + targ.extralives = targ.extralives - 1; + centerprint(targ, strcat("^3Remaining extra lives: ",ftos(targ.extralives),"\n")); + damage = 0; + targ.armorvalue = targ.extralives; + stuffcmd(targ, "play2 misc/hit.wav\n"); + stuffcmd(attacker, "play2 misc/hit.wav\n"); + } + else if (deathtype == IT_NEX && targ.items & IT_STRENGTH) + { + stuffcmd(attacker, "play2 announce/male/lucky_shot.ogg\n"); + } + if (deathtype == IT_LASER) + { + damage = 0; + if (targ != attacker) + { + if (targ.classname == "player") + centerprint(attacker, "Secondary fire inflicts no damage!\n"); + damage = 0; + force = '0 0 0'; + attacker = targ; + } + } + } + // midair gamemode: damage only while in the air if (cvar("g_midair") && self.classname == "player" // e.g. grenades take damage @@ -157,13 +255,13 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float } // apply strength multiplier - if (attacker.items & IT_STRENGTH) + if (attacker.items & IT_STRENGTH && !cvar("g_minstagib")) { damage = damage * cvar("g_balance_powerup_strength_damage"); force = force * cvar("g_balance_powerup_strength_force"); } // apply invincibility multiplier - if (targ.items & IT_INVINCIBLE) + if (targ.items & IT_INVINCIBLE && !cvar("g_minstagib")) damage = damage * cvar("g_balance_powerup_invincible_takedamage"); @@ -215,7 +313,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if(targ.classname == "player" && attacker.classname == "player" && attacker != targ && attacker.health > 2) { // Savage: vampire mode - if(cvar("g_vampire")) + if(cvar("g_vampire") && !cvar("g_minstagib")) { attacker.health += damage; } diff --git a/data/qcsrc/gamec/g_world.c b/data/qcsrc/gamec/g_world.c index 9d40f88f3..c345a14cf 100644 --- a/data/qcsrc/gamec/g_world.c +++ b/data/qcsrc/gamec/g_world.c @@ -162,7 +162,20 @@ void worldspawn (void) precache_sound ("weapons/weapon_switch.wav"); precache_sound ("weapons/weaponpickup.wav"); - + // announcer sounds + precache_sound ("announce/male/kill10.ogg"); + precache_sound ("announce/male/kill15.ogg"); + precache_sound ("announce/male/kill20.ogg"); + precache_sound ("announce/male/kill25.ogg"); + precache_sound ("announce/male/kill3.ogg"); + precache_sound ("announce/male/kill30.ogg"); + precache_sound ("announce/male/kill4.ogg"); + precache_sound ("announce/male/kill5.ogg"); + precache_sound ("announce/male/kill6.ogg"); + precache_sound ("announce/male/mapkill1.ogg"); + precache_sound ("announce/robotic/last_second_save.ogg"); + precache_sound ("announce/robotic/narrowly_averted.ogg"); + precache_sound ("minstagib/mockery.ogg"); // plays music for the level if there is any if (self.noise) @@ -535,7 +548,6 @@ void() NextLevel = */ other = find (other, classname, "player"); } - WriteByte (MSG_ALL, SVC_INTERMISSION); }; diff --git a/data/qcsrc/gamec/t_items.c b/data/qcsrc/gamec/t_items.c index 4f474fbf4..9d397f68d 100644 --- a/data/qcsrc/gamec/t_items.c +++ b/data/qcsrc/gamec/t_items.c @@ -10,14 +10,13 @@ void Item_Respawn (void) setorigin (self, self.origin); // Savage: Add simple Respawn effect and make sure it gets removed - self.effects = EF_STARDUST; + self.effects = self.effects | EF_STARDUST; self.think = Item_ClearRespawnEffect; self.nextthink = time + 0.1; } void Item_Touch (void) { - local entity oldself; local float _switchweapon; @@ -39,44 +38,90 @@ void Item_Touch (void) // probably want to switch to an even better weapon after items are given _switchweapon = (other.autoswitch && (other.switchweapon == w_getbestweapon(other))); - if (self.ammo_shells) - other.ammo_shells = min (other.ammo_shells + self.ammo_shells, 999); - if (self.ammo_nails) - other.ammo_nails = min (other.ammo_nails + self.ammo_nails, 999); - if (self.ammo_rockets) - other.ammo_rockets = min (other.ammo_rockets + self.ammo_rockets, 999); - if (self.ammo_cells) - other.ammo_cells = min (other.ammo_cells + self.ammo_cells, 999); - - if (self.items & IT_UZI) W_GiveWeapon (other, IT_UZI, "Machine gun"); - if (self.items & IT_SHOTGUN) W_GiveWeapon (other, IT_SHOTGUN, "Shotgun"); - if (self.items & IT_GRENADE_LAUNCHER) W_GiveWeapon (other, IT_GRENADE_LAUNCHER, "Mortar"); - if (self.items & IT_ELECTRO) W_GiveWeapon (other, IT_ELECTRO, "Electro"); - if (self.items & IT_NEX) W_GiveWeapon (other, IT_NEX, "Nex"); - if (self.items & IT_HAGAR) W_GiveWeapon (other, IT_HAGAR, "Hagar"); - if (self.items & IT_ROCKET_LAUNCHER) W_GiveWeapon (other, IT_ROCKET_LAUNCHER, "Rocket Launcher"); - if (self.items & IT_CRYLINK) W_GiveWeapon (other, IT_CRYLINK, "Crylink"); - - if (self.strength_finished) - other.strength_finished = max(other.strength_finished, time) + cvar("g_balance_powerup_strength_time"); - if (self.invincible_finished) - other.invincible_finished = max(other.invincible_finished, time) + cvar("g_balance_powerup_invincible_time"); - //if (self.speed_finished) - // other.speed_finished = max(other.speed_finished, time) + cvar("g_balance_powerup_speed_time"); - //if (self.slowmo_finished) - // other.slowmo_finished = max(other.slowmo_finished, time) + (cvar("g_balance_powerup_slowmo_time") * cvar("g_balance_powerup_slowmo_speed")); - - if (self.max_health) + if (cvar("g_minstagib")) { - other.health = other.health + self.max_health; - other.pauserothealth_finished = max(other.pauserothealth_finished, time + 5); + if (self.ammo_cells) + { + // play some cool sounds ;) + centerprint(other, "\n"); + if (other.health <= 5) + stuffcmd(other, "play2 misc/save.ogg\n"); + else if (other.health < 50) + stuffcmd(other, "play2 misc/averted.ogg\n"); + else + stuffcmd(other, "play2 announce/robotic/ammo.ogg\n"); + + if (self.items & IT_NEX) + W_GiveWeapon (other, IT_NEX, "Nex"); + if (self.ammo_cells) + other.ammo_cells = min (other.ammo_cells + cvar("g_minstagib_ammo_drop"), 999); + other.health = 100; + } + + // extralife powerup + if (self.max_health) + { + stuffcmd(other, "play2 announce/robotic/extra.ogg\nplay2 announce/robotic/_lives.ogg\n"); + other.extralives = other.extralives + cvar("g_minstagib_extralives"); + other.armorvalue = other.extralives; + sprint(other, "^3You picked up some extra lives\n"); + } + + // invis powerup + if (self.strength_finished) + { + stuffcmd(other, "play2 announce/robotic/invisible.ogg\n"); + other.strength_finished = max(other.strength_finished, time) + cvar("g_balance_powerup_strength_time"); + } + + // speed powerup + if (self.invincible_finished) + { + stuffcmd(other, "play2 announce/robotic/speed.ogg\n"); + other.invincible_finished = max(other.invincible_finished, time) + cvar("g_balance_powerup_strength_time"); + } } - if (self.health && other.health < other.max_health) - other.health = min(other.health + self.health, other.max_health); - if (self.armorvalue) + else { - other.armorvalue = other.armorvalue + self.armorvalue; - other.pauserotarmor_finished = max(other.pauserotarmor_finished, time + 5); + if (self.ammo_shells) + other.ammo_shells = min (other.ammo_shells + self.ammo_shells, 999); + if (self.ammo_nails) + other.ammo_nails = min (other.ammo_nails + self.ammo_nails, 999); + if (self.ammo_rockets) + other.ammo_rockets = min (other.ammo_rockets + self.ammo_rockets, 999); + if (self.ammo_cells) + other.ammo_cells = min (other.ammo_cells + self.ammo_cells, 999); + + if (self.items & IT_UZI) W_GiveWeapon (other, IT_UZI, "Machine gun"); + if (self.items & IT_SHOTGUN) W_GiveWeapon (other, IT_SHOTGUN, "Shotgun"); + if (self.items & IT_GRENADE_LAUNCHER) W_GiveWeapon (other, IT_GRENADE_LAUNCHER, "Mortar"); + if (self.items & IT_ELECTRO) W_GiveWeapon (other, IT_ELECTRO, "Electro"); + if (self.items & IT_NEX) W_GiveWeapon (other, IT_NEX, "Nex"); + if (self.items & IT_HAGAR) W_GiveWeapon (other, IT_HAGAR, "Hagar"); + if (self.items & IT_ROCKET_LAUNCHER) W_GiveWeapon (other, IT_ROCKET_LAUNCHER, "Rocket Launcher"); + if (self.items & IT_CRYLINK) W_GiveWeapon (other, IT_CRYLINK, "Crylink"); + + if (self.strength_finished) + other.strength_finished = max(other.strength_finished, time) + cvar("g_balance_powerup_strength_time"); + if (self.invincible_finished) + other.invincible_finished = max(other.invincible_finished, time) + cvar("g_balance_powerup_invincible_time"); + //if (self.speed_finished) + // other.speed_finished = max(other.speed_finished, time) + cvar("g_balance_powerup_speed_time"); + //if (self.slowmo_finished) + // other.slowmo_finished = max(other.slowmo_finished, time) + (cvar("g_balance_powerup_slowmo_time") * cvar("g_balance_powerup_slowmo_speed")); + + if (self.max_health) + { + other.health = other.health + self.max_health; + other.pauserothealth_finished = max(other.pauserothealth_finished, time + 5); + } + if (self.health && other.health < other.max_health) + other.health = min(other.health + self.health, other.max_health); + if (self.armorvalue) + { + other.armorvalue = other.armorvalue + self.armorvalue; + other.pauserotarmor_finished = max(other.pauserotarmor_finished, time + 5); + } } oldself = self; @@ -85,8 +130,8 @@ void Item_Touch (void) if (_switchweapon) self.switchweapon = w_getbestweapon(self); - //W_UpdateWeapon (); - //W_UpdateAmmo (); + //w_updateweapon (); + //w_updateammo (); weapon_action(self.weapon, WR_UPDATECOUNTS); self = oldself; @@ -112,11 +157,23 @@ void RemoveItem(void) = { void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, string itemname, float itemid, float itemflags) { - if (!cvar("g_pickup_items")) + if (!cvar("g_pickup_items") && !cvar("g_minstagib")) { remove (self); return; } + + if (cvar("g_minstagib")) + { + // don't remove dropped items and powerups + if (self.classname != "droppedweapon" && + self.classname != "minstagib") + { + remove (self); + return; + } + } + self.mdl = itemmodel; self.noise = pickupsound; // let mappers override respawntime @@ -155,14 +212,83 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, } +/* replace items in minstagib + * IT_STRENGTH = invisibility + * IT_NAILS = extra lives + * IT_INVINCIBLE = speed + */ +void minstagib_items (float itemid) +{ + // we don't want to replace dropped weapons ;) + if (self.classname == "droppedweapon") + { + self.ammo_cells = 25; + StartItem ("models/weapons/g_nex.md3", + "weapons/weaponpickup.wav", 15, + "Nex Gun", IT_NEX, FL_WEAPON); + return; + } + + local float rnd; + self.classname = "minstagib"; + + // replace rocket launchers and nex guns with ammo cells + if (itemid == IT_CELLS) + { + self.ammo_cells = 1; + StartItem ("models/items/a_cells.md3", + "misc/itempickup.wav", 45, + "Nex Ammo", IT_CELLS, 0); + return; + } + + // randomize + rnd = random() * 3; + if (rnd <= 1) + itemid = IT_STRENGTH; + else if (rnd <= 2) + itemid = IT_NAILS; + else + itemid = IT_INVINCIBLE; + + // replace with invis + if (itemid == IT_STRENGTH) + { + self.effects = EF_ADDITIVE; + self.strength_finished = 30; + StartItem ("models/items/g_strength.md3", + "misc/powerup.wav", 120, + "Invisibility", IT_STRENGTH, FL_POWERUP); + } + // replace with extra lives + if (itemid == IT_NAILS) + { + self.max_health = 1; + StartItem ("models/items/g_h100.md3", + "misc/powerup.wav", 120, + "Extralife", IT_NAILS, FL_POWERUP); + + } + // replace with ammo + if (itemid == IT_INVINCIBLE) + { + self.effects = EF_ADDITIVE; + self.invincible_finished = 30; + StartItem ("models/items/g_invincible.md3", + "misc/powerup.wav", 120, + "Speed", IT_INVINCIBLE, FL_POWERUP); + } + +} + void weapon_uzi (void) {self.ammo_nails = 120;StartItem ("models/weapons/g_uzi.md3", "weapons/weaponpickup.wav", 15, "Uzi", IT_UZI, FL_WEAPON);} void weapon_shotgun (void) {self.ammo_shells = 15;StartItem ("models/weapons/g_shotgun.md3", "weapons/weaponpickup.wav", 15, "Shotgun", IT_SHOTGUN, FL_WEAPON);} void weapon_grenadelauncher (void) {self.ammo_rockets = 15;StartItem ("models/weapons/g_gl.md3", "weapons/weaponpickup.wav", 15, "Grenade Launcher", IT_GRENADE_LAUNCHER, FL_WEAPON);} void weapon_electro (void) {self.ammo_cells = 25;StartItem ("models/weapons/g_electro.md3", "weapons/weaponpickup.wav", 15, "Electro", IT_ELECTRO, FL_WEAPON);} void weapon_crylink (void) {self.ammo_cells = 25;StartItem ("models/weapons/g_crylink.md3", "weapons/weaponpickup.wav", 15, "Crylink", IT_CRYLINK, FL_WEAPON);} -void weapon_nex (void) {self.ammo_cells = 25;StartItem ("models/weapons/g_nex.md3", "weapons/weaponpickup.wav", 15, "Nex Gun", IT_NEX, FL_WEAPON);} +void weapon_nex (void) {if (cvar("g_minstagib")) {minstagib_items(IT_CELLS);} else {self.ammo_cells = 25;StartItem ("models/weapons/g_nex.md3", "weapons/weaponpickup.wav", 15, "Nex Gun", IT_NEX, FL_WEAPON);}} void weapon_hagar (void) {self.ammo_rockets = 15;StartItem ("models/weapons/g_hagar.md3", "weapons/weaponpickup.wav", 15, "Hagar", IT_HAGAR, FL_WEAPON);} -void weapon_rocketlauncher (void) {self.ammo_rockets = 15;StartItem ("models/weapons/g_rl.md3", "weapons/weaponpickup.wav", 15, "Rocket Launcher", IT_ROCKET_LAUNCHER, FL_WEAPON);} +void weapon_rocketlauncher (void) {if (cvar("g_minstagib")) {minstagib_items(IT_CELLS);} else {self.ammo_rockets = 15;StartItem ("models/weapons/g_rl.md3", "weapons/weaponpickup.wav", 15, "Rocket Launcher", IT_ROCKET_LAUNCHER, FL_WEAPON);}} void item_rockets (void) {self.ammo_rockets = 15;StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", 15, "rockets", IT_ROCKETS, 0);} void item_bullets (void) {self.ammo_nails = 120;StartItem ("models/items/a_bullets.mdl", "misc/itempickup.wav", 15, "bullets", IT_NAILS, 0);} @@ -173,10 +299,10 @@ void item_armor1 (void) {self.armorvalue = 5;StartItem ("models/items/g_a1.md3", void item_armor25 (void) {self.armorvalue = 100;StartItem ("models/items/g_a25.md3", "misc/armor25.wav", 30, "Armor", 0, 0);} void item_health1 (void) {self.max_health = 5;StartItem ("models/items/g_h1.md3", "misc/minihealth.wav", 15, "5 Health", 0, 0);} void item_health25 (void) {self.max_health = 25;StartItem ("models/items/g_h25.md3", "misc/mediumhealth.wav", 15, "25 Health", 0, 0);} -void item_health100 (void) {self.max_health = 100;StartItem ("models/items/g_h100.md3", "misc/megahealth.wav", 30, "100 Health", 0, 0);} +void item_health100 (void) {if(cvar("g_minstagib")) {minstagib_items(IT_NAILS);} else {self.max_health = 100;StartItem ("models/items/g_h100.md3", "misc/megahealth.wav", 30, "100 Health", 0, 0);}} -void item_strength (void) {self.strength_finished = 30;self.effects = EF_ADDITIVE;StartItem ("models/items/g_strength.md3", "misc/powerup.wav", 120, "Strength Powerup", IT_STRENGTH, FL_POWERUP);} -void item_invincible (void) {self.invincible_finished = 30;self.effects = EF_ADDITIVE;StartItem ("models/items/g_invincible.md3", "misc/powerup.wav", 120, "Invulnerability", IT_INVINCIBLE, FL_POWERUP);} +void item_strength (void) {if(cvar("g_minstagib")) {minstagib_items(IT_STRENGTH);} else {self.strength_finished = 30;self.effects = EF_ADDITIVE;StartItem ("models/items/g_strength.md3", "misc/powerup.wav", 120, "Strength Powerup", IT_STRENGTH, FL_POWERUP);}} +void item_invincible (void) {if(cvar("g_minstagib")) {minstagib_items(IT_INVINCIBLE);} else {self.invincible_finished = 30;self.effects = EF_ADDITIVE;StartItem ("models/items/g_invincible.md3", "misc/powerup.wav", 120, "Invulnerability", IT_INVINCIBLE, FL_POWERUP);}} //void item_speed (void) {self.speed_finished = 30;StartItem ("models/items/g_speed.md3", "misc/powerup.wav", 120, "Speed Powerup", IT_SPEED, FL_POWERUP);} //void item_slowmo (void) {self.slowmo_finished = 30;StartItem ("models/items/g_slowmo.md3", "misc/powerup.wav", 120, "Slow Motion", IT_SLOWMO, FL_POWERUP);} diff --git a/data/qcsrc/gamec/teamplay.c b/data/qcsrc/gamec/teamplay.c index f542ccaeb..50711cf5f 100644 --- a/data/qcsrc/gamec/teamplay.c +++ b/data/qcsrc/gamec/teamplay.c @@ -132,7 +132,7 @@ void InitGameplayMode() gamemode_name = "Capture the Flag"; teams_matter = 1; } - else if(game == GAME_RUNEMATCH || cvar("g_runematch")) + else if((game == GAME_RUNEMATCH || cvar("g_runematch")) && !cvar("g_minstagib")) { game = GAME_RUNEMATCH; cvar_set("g_runematch", "1"); @@ -230,11 +230,15 @@ void InitGameplayMode() cvar_set("g_pickup_items", ftos(FALSE)); cvar_set("g_use_ammunition", ftos(FALSE)); } + if (cvar("g_minstagib")) { + cvar_set("g_pickup_items", ftos(FALSE)); + cvar_set("g_use_ammunition", ftos(TRUE)); + } } void PrintWelcomeMessage(entity pl) { - string s, grap_msg, temp; + string s, grap_msg, temp, temp2; float colored; if(self.welcomemessage_time < time) @@ -244,12 +248,16 @@ void PrintWelcomeMessage(entity pl) self.welcomemessage_time2 = time + 0.8; colored = 1; + if(colored) { + if(cvar("g_minstagib")) + temp2 = strcat("^2Minstagib ^1", gamemode_name); + if(cvar("g_grappling_hook")) grap_msg = strzone("\n\nBind a key to ^1+hook^8 to use the grappling hook\n"); - s = strcat("\n\nThis is Nexuiz ", cvar_string("g_nexuizversion"), "\n", self.versionmessage, "^8\n\nMatch type is ^1", gamemode_name, "^8\n"); + s = strcat("\n\nThis is Nexuiz ", cvar_string("g_nexuizversion"), "\n", self.versionmessage, "^8\n\nMatch type is ^1", temp2, "^8\n"); s = strzone(s); temp = strcat( @@ -284,10 +292,13 @@ void PrintWelcomeMessage(entity pl) } else { + if(cvar("g_minstagib")) + temp2 = strcat("Minstagib ", gamemode_name); + if(cvar("g_grappling_hook")) grap_msg = strzone("\n\nBind a key to +hook to use the grappling hook\n"); - s = strcat("Match type is ", gamemode_name, "\n"); + s = strcat("Match type is ", temp2, "\n"); s = strzone(s); temp = strcat( diff --git a/data/qcsrc/gamec/w_nex.c b/data/qcsrc/gamec/w_nex.c index c9297a41c..3873d8243 100644 --- a/data/qcsrc/gamec/w_nex.c +++ b/data/qcsrc/gamec/w_nex.c @@ -2,14 +2,102 @@ void() nex_ready_01; void() nex_fire1_01; void() nex_deselect_01; void() nex_select_01; +void() nex_selfkill; float() nex_check = { - if (self.ammo_cells >= 5) - return TRUE; + if (cvar("g_minstagib")) + { + if (self.ammo_cells >= 1) + return TRUE; + } else { + if (self.ammo_cells >= 5) + return TRUE; + } return FALSE; }; +void nex_selfkill (void) +{ + if (!cvar("g_minstagib")) + return; + + if (self.ammo_cells <= 0) + { + if (self.health == 5) + { + centerprint(self, "you're dead now...\n"); + Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/termination.ogg\n"); + } + if (self.health == 10) + { + centerprint(self, "^11^7 second left to find some ammo\n"); + Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/1p.ogg\n"); + } + if (self.health == 20) + { + centerprint(self, "^12^7 seconds left to find some ammo\n"); + Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/2p.ogg\n"); + } + if (self.health == 30) + { + centerprint(self, "^13^7 seconds left to find some ammo\n"); + Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/3p.ogg\n"); + } + if (self.health == 40) + { + centerprint(self, "^14^7 seconds left to find some ammo\n"); + Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/4p.ogg\n"); + } + if (self.health == 50) + { + centerprint(self, "^15^7 seconds left to find some ammo\n"); + Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/5p.ogg\n"); + } + if (self.health == 60) + { + centerprint(self, "^36^7 seconds left to find some ammo\n"); + Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/6.ogg\n"); + } + if (self.health == 70) + { + centerprint(self, "^37^7 seconds left to find some ammo\n"); + Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/7.ogg\n"); + } + if (self.health == 80) + { + centerprint(self, "^38^7 seconds left to find some ammo\n"); + Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/8.ogg\n"); + } + if (self.health == 90) + { + centerprint(self, "^39^7 seconds left to find some ammo\n"); + Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/9.ogg\n"); + } + if (self.health == 100) + { + weapon_prepareattack(nex_check, nex_check, nex_fire1_01, 1.0); + centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds..."); + Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0'); + stuffcmd(self, "play2 announce/robotic/10.ogg\n"); + } + + } + self.think = nex_selfkill; + self.nextthink = time + 1; + +} + void(float req) w_nex = { if (req == WR_IDLE) @@ -40,7 +128,11 @@ void W_Nex_Attack (void) org = self.origin + self.view_ofs + v_forward * 5 + v_right * 14 + v_up * -7; end = self.origin + self.view_ofs + v_forward * 4096; - FireRailgunBullet (org, end, cvar("g_balance_nex_damage"), IT_NEX); + // assure that nexdamage is high enough in minstagib + if (cvar("g_minstagib")) + FireRailgunBullet (org, end, 200, IT_NEX); + else + FireRailgunBullet (org, end, cvar("g_balance_nex_damage"), IT_NEX); // trace as if shot started inside gun traceline (org, end, TRUE, self); @@ -79,7 +171,12 @@ void W_Nex_Attack (void) PointSound (trace_endpos, "weapons/neximpact.ogg", 1, ATTN_NORM); if (cvar("g_use_ammunition")) - self.ammo_cells = self.ammo_cells - 5; + { + if (cvar("g_minstagib")) + self.ammo_cells = self.ammo_cells - 1; + else + self.ammo_cells = self.ammo_cells - 5; + } flash = spawn (); org = self.origin + self.view_ofs + v_forward * 33 + v_right * 14 + v_up * -7; @@ -93,7 +190,7 @@ void W_Nex_Attack (void) // weapon frames void() nex_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, nex_ready_01); self.weaponentity.state = WS_READY;}; -void() nex_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; +void() nex_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0'); nex_selfkill();}; void() nex_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; void() nex_fire1_01 = { -- 2.39.2