]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Split port-o-launch and nexball ball stealer
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 26 Sep 2015 05:55:57 +0000 (15:55 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 26 Sep 2015 05:55:57 +0000 (15:55 +1000)
12 files changed:
defaultXonotic.cfg
qcsrc/client/view.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/turrets/unit/plasma_dual.qc
qcsrc/common/vehicles/unit/racer.qc
qcsrc/common/weapons/all.inc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon/porto.qc
qcsrc/server/autocvars.qh
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/gamemode_nexball_weapon.qc [new file with mode: 0644]
weapons.cfg [deleted file]

index 338808f3d10aea1ea4819ca78be0fba2407c8f3d..c51dfc1a26d29a261d76defc752415d489eecadc 100644 (file)
@@ -640,7 +640,6 @@ alias weapon_group_7 "impulse 7"
 alias weapon_group_8 "impulse 8"
 alias weapon_group_9 "impulse 9"
 alias weapon_group_0 "impulse 14" // cycles the superweapons
-exec weapons.cfg
 
 // score log
 set sv_logscores_console 0     "print scores to server console"
index 80d1fe1dfe11b5a5e2994637d4aed41720957442..d4eb7ba22deef925bd9b7d8fb74cf276ae77adaf 100644 (file)
@@ -321,6 +321,7 @@ float TrueAimCheck()
        {
                case WEP_TUBA.m_id: // no aim
                case WEP_PORTO.m_id: // shoots from eye
+               case WEP_NEXBALL.m_id: // shoots from eye
                case WEP_HOOK.m_id: // no trueaim
                case WEP_MORTAR.m_id: // toss curve
                        return SHOTTYPE_HITWORLD;
@@ -440,7 +441,7 @@ bool WantEventchase()
                        return true;
                if(MUTATOR_CALLHOOK(WantEventchase, self))
                        return true;
-               if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WepSet_FromWeapon(WEP_PORTO.m_id)))
+               if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WepSet_FromWeapon(WEP_NEXBALL.m_id)))
                        return true;
                if(autocvar_cl_eventchase_death && (getstati(STAT_HEALTH) <= 0))
                {
index a3114812b61f8ccc1ca41ecf5fcb71fc4843bd5e..949e6ad3c75a791bddb2b0a2cc65be7fdbb10cd6 100644 (file)
@@ -23,9 +23,7 @@ CLASS(MageSpike, PortoLaunch)
 /* refname   */ ATTRIB(MageSpike, netname, string, "magespike");
 /* wepname   */ ATTRIB(MageSpike, message, string, _("Mage spike"));
 ENDCLASS(MageSpike)
-REGISTER_WEAPON(MAGE_SPIKE, NEW(MageSpike)) {
-       localcmd(sprintf("alias weapon_%s \"impulse %d\"\n", this.netname, 230 + this.m_id - 1));
-}
+REGISTER_WEAPON(MAGE_SPIKE, NEW(MageSpike));
 
 #ifdef SVQC
 
index 7f761bad15cdcb5bdeeb939fbe3cc28ce4fcd304..1744f54f5157dbac645143c78f68a26780ce90e3 100644 (file)
@@ -19,9 +19,7 @@ CLASS(PlasmaDualAttack, PortoLaunch)
 /* refname   */ ATTRIB(PlasmaDualAttack, netname, string, "plasmadual");
 /* wepname   */ ATTRIB(PlasmaDualAttack, message, string, _("Dual plasma"));
 ENDCLASS(PlasmaDualAttack)
-REGISTER_WEAPON(PLASMA_DUAL, NEW(PlasmaDualAttack)) {
-       localcmd(sprintf("alias weapon_%s \"impulse %d\"\n", this.netname, 230 + this.m_id - 1));
-}
+REGISTER_WEAPON(PLASMA_DUAL, NEW(PlasmaDualAttack));
 
 #ifdef SVQC
 
index 4f8325517830b38fb39a15437963ca66624cb3c5..be146dfc2be9f81c11e9bcca6a5e0b22c3f92956 100644 (file)
@@ -29,9 +29,7 @@ CLASS(RacerAttack, PortoLaunch)
 /* refname   */ ATTRIB(RacerAttack, netname, string, "racercannon");
 /* wepname   */ ATTRIB(RacerAttack, message, string, _("Racer cannon"));
 ENDCLASS(RacerAttack)
-REGISTER_WEAPON(RACER, NEW(RacerAttack)) {
-       localcmd(sprintf("alias weapon_%s \"impulse %d\"\n", this.netname, 230 + this.m_id - 1));
-}
+REGISTER_WEAPON(RACER, NEW(RacerAttack));
 
 #endif
 
index fc89a0cd20360dc8f447542253a57c3e886d61d6..3257215a9fef5b84ef4c073b87774689f496f7c3 100644 (file)
@@ -27,3 +27,5 @@
 #include "weapon/arc.qc"
 #include "weapon/hmg.qc"
 #include "weapon/rpc.qc"
+
+#include "../../server/mutators/gamemode_nexball_weapon.qc"
index c2ed2af7bef0ac769898438c95475abaa67b7989..1b7cc72724fb6ecae7ee77d3b96bc3b2b3bf5fbe 100644 (file)
@@ -193,7 +193,7 @@ CLASS(Weapon, Object)
     /** A: WEPSET_id : WEPSET_... */
     ATTRIB(Weapon, weapons, WepSet, '0 0 0');
     /** M: function  : w_... */
-    ATTRIB(Weapon, weapon_func, bool(entity thiswep, int req), w_new);
+    METHOD(Weapon, weapon_func, bool(entity this, int req)) { return w_new(this, req); }
     /** M: ammotype  : main ammo field */
     ATTRIB(Weapon, ammo_field, .int, ammo_none);
     /** M: impulse   : weapon impulse */
@@ -284,6 +284,7 @@ entity dummy_weapon_info;
                WEPSET_ALL |= (WEPSET_##id = WepSet_FromWeapon(this.m_id)); \
                if ((this.spawnflags) & WEP_FLAG_SUPERWEAPON) WEPSET_SUPERWEAPONS |= WEPSET_##id; \
                register_weapon(this, this.m_id, WEPSET_##id); \
+               localcmd(sprintf("alias weapon_%s \"impulse %d\"\n", this.netname, 230 + this.m_id - 1)); \
        } \
        REGISTER_INIT(WEP, id)
 
index bdd5bb59f2bd1c39f5f00cdf936e4e7e2e7cf42c..765f2606b1e9b52cc568601768d8316994437b21 100644 (file)
@@ -284,13 +284,6 @@ void W_Porto_Attack(float type)
        MUTATOR_CALLHOOK(EditProjectile, self, gren);
 }
 
-bool w_nexball_weapon(int req); // WEAPONTODO
-
-METHOD(PortoLaunch, weapon_func, bool(entity this, int req)) {
-       if(g_nexball) { return w_nexball_weapon(req); }
-       return super.weapon_func(this, req);
-}
-
                METHOD(PortoLaunch, wr_aim, bool(entity thiswep))
                {
                        SELFPARAM();
index fcf209faca6ddbdb2e7e7ea44c4ee407dea503af..83677a24c5977852730998b72812067031c8e015 100644 (file)
@@ -416,22 +416,8 @@ float autocvar_g_multijump_speed;
 float autocvar_g_multijump_maxspeed;
 float autocvar_g_multijump_dodging = 1;
 string autocvar_g_mutatormsg;
-float autocvar_g_nexball_basketball_bouncefactor;
-float autocvar_g_nexball_basketball_bouncestop;
-float autocvar_g_nexball_basketball_carrier_highspeed;
-bool autocvar_g_nexball_basketball_meter;
-float autocvar_g_nexball_basketball_meter_maxpower;
-float autocvar_g_nexball_basketball_meter_minpower;
-float autocvar_g_nexball_delay_collect;
-float autocvar_g_nexball_delay_goal;
-float autocvar_g_nexball_delay_start;
-float autocvar_g_nexball_football_bouncefactor;
-float autocvar_g_nexball_football_bouncestop;
 int autocvar_g_nexball_goalleadlimit;
 #define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
-bool autocvar_g_nexball_radar_showallplayers;
-bool autocvar_g_nexball_sound_bounce;
-int autocvar_g_nexball_trail_color;
 //float autocvar_g_nick_flood_penalty;
 int autocvar_g_nick_flood_penalty_red;
 int autocvar_g_nick_flood_penalty_yellow;
index c3f00d61ba870a006e1ec7114e5da505bf29b7a5..8bf3b8424f738448c99917b52599bfa3ad8b6d38 100644 (file)
@@ -3,6 +3,21 @@
 
 #include "gamemode.qh"
 
+float autocvar_g_nexball_basketball_bouncefactor;
+float autocvar_g_nexball_basketball_bouncestop;
+float autocvar_g_nexball_basketball_carrier_highspeed;
+bool autocvar_g_nexball_basketball_meter;
+float autocvar_g_nexball_basketball_meter_maxpower;
+float autocvar_g_nexball_basketball_meter_minpower;
+float autocvar_g_nexball_delay_collect;
+float autocvar_g_nexball_delay_goal;
+float autocvar_g_nexball_delay_start;
+float autocvar_g_nexball_football_bouncefactor;
+float autocvar_g_nexball_football_bouncestop;
+bool autocvar_g_nexball_radar_showallplayers;
+bool autocvar_g_nexball_sound_bounce;
+int autocvar_g_nexball_trail_color;
+
 float autocvar_g_nexball_safepass_turnrate;
 float autocvar_g_nexball_safepass_maxdist;
 float autocvar_g_nexball_safepass_holdtime;
@@ -153,11 +168,11 @@ void GiveBall(entity plyr, entity ball)
 
        plyr.weaponentity.weapons = plyr.weapons;
        plyr.weaponentity.switchweapon = plyr.weapon;
-       plyr.weapons = WEPSET_PORTO;
+       plyr.weapons = WEPSET_NEXBALL;
        setself(plyr);
-       WEP_ACTION(WEP_PORTO, WR_RESETPLAYER);
-       plyr.switchweapon = WEP_PORTO.m_id;
-       W_SwitchWeapon(WEP_PORTO.m_id);
+       WEP_ACTION(WEP_NEXBALL, WR_RESETPLAYER);
+       plyr.switchweapon = WEP_NEXBALL.m_id;
+       W_SwitchWeapon(WEP_NEXBALL.m_id);
        setself(this);
 }
 
@@ -826,6 +841,11 @@ float ball_customize()
        return true;
 }
 
+float w_nexball_weapon(float req);
+METHOD(BallStealer, weapon_func, bool(entity this, int req)) {
+       return w_nexball_weapon(req);
+}
+
 float w_nexball_weapon(float req)
 {SELFPARAM();
        if(req == WR_THINK)
@@ -929,7 +949,7 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
                        if(self.weaponentity.weapons)
                        {
                                self.weapons = self.weaponentity.weapons;
-                               WEP_ACTION(WEP_PORTO, WR_RESETPLAYER);
+                               WEP_ACTION(WEP_NEXBALL, WR_RESETPLAYER);
                                self.switchweapon = self.weaponentity.switchweapon;
                                W_SwitchWeapon(self.switchweapon);
 
@@ -949,7 +969,7 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
        self.weaponentity.weapons = '0 0 0';
 
        if(nexball_mode & NBM_BASKETBALL)
-               self.weapons |= WEPSET_PORTO;
+               self.weapons |= WEPSET_NEXBALL;
        else
                self.weapons = '0 0 0';
 
@@ -966,13 +986,6 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPhysics)
        return false;
 }
 
-MUTATOR_HOOKFUNCTION(nexball_SetStartItems)
-{
-       start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
-
-       return false;
-}
-
 MUTATOR_HOOKFUNCTION(nexball_ForbidThrowing)
 {SELFPARAM();
        if(self.weapon == WEP_MORTAR.m_id)
@@ -998,7 +1011,6 @@ MUTATOR_DEFINITION(gamemode_nexball)
        MUTATOR_HOOK(PlayerSpawn, nexball_PlayerSpawn, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerPreThink, nexball_PlayerPreThink, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerPhysics, nexball_PlayerPhysics, CBC_ORDER_ANY);
-       MUTATOR_HOOK(SetStartItems, nexball_SetStartItems, CBC_ORDER_ANY);
        MUTATOR_HOOK(ForbidThrowCurrentWeapon, nexball_ForbidThrowing, CBC_ORDER_ANY);
        MUTATOR_HOOK(FilterItem, nexball_FilterItem, CBC_ORDER_ANY);
 
diff --git a/qcsrc/server/mutators/gamemode_nexball_weapon.qc b/qcsrc/server/mutators/gamemode_nexball_weapon.qc
new file mode 100644 (file)
index 0000000..a8822f8
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef IMPLEMENTATION
+
+CLASS(BallStealer, PortoLaunch)
+/* flags     */ ATTRIB(BallStealer, spawnflags, int, WEP_TYPE_OTHER);
+/* impulse   */ ATTRIB(BallStealer, impulse, int, 2);
+/* refname   */ ATTRIB(BallStealer, netname, string, "ballstealer");
+/* wepname   */ ATTRIB(BallStealer, message, string, _("Ball Stealer"));
+ENDCLASS(BallStealer)
+REGISTER_WEAPON(NEXBALL, NEW(BallStealer));
+
+#endif
diff --git a/weapons.cfg b/weapons.cfg
deleted file mode 100644 (file)
index eb768df..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-alias weapon_blaster "impulse 230"
-alias weapon_shotgun "impulse 231"
-alias weapon_machinegun "impulse 232"
-alias weapon_mortar "impulse 233"
-alias weapon_minelayer "impulse 234"
-alias weapon_electro "impulse 235"
-alias weapon_crylink "impulse 236"
-alias weapon_vortex "impulse 237"
-alias weapon_hagar "impulse 238"
-alias weapon_devastator "impulse 239"
-alias weapon_porto "impulse 240"
-alias weapon_vaporizer "impulse 241"
-alias weapon_hook "impulse 242"
-alias weapon_hlac "impulse 243"
-alias weapon_tuba "impulse 244"
-alias weapon_rifle "impulse 245"
-alias weapon_fireball "impulse 246"
-alias weapon_seeker "impulse 247"
-alias weapon_shockwave "impulse 248"
-alias weapon_arc "impulse 249"
-
-// Backwards compatibility with 0.7.0
-alias weapon_laser "weapon_blaster"
-alias weapon_uzi "weapon_machinegun"
-alias weapon_grenadelauncher "weapon_mortar"
-alias weapon_nex "weapon_vortex"
-alias weapon_rocketlauncher "weapon_devastator"
-alias weapon_minstanex "weapon_vaporizer"