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"
{
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;
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))
{
/* 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
/* 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
/* 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
#include "weapon/arc.qc"
#include "weapon/hmg.qc"
#include "weapon/rpc.qc"
+
+#include "../../server/mutators/gamemode_nexball_weapon.qc"
/** 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 */
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)
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();
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;
#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;
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);
}
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)
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);
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';
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)
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);
--- /dev/null
+#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
+++ /dev/null
-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"