]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_fireball.qc
Even more cleanup of SetupProjVelocity
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_fireball.qc
index 019ce9b0058859e55f91db9bcea3337ed75b34b7..0a19c3df0496dae873d962e16aaae2de2c5fce58 100644 (file)
@@ -1,45 +1,46 @@
 #ifdef REGISTER_WEAPON
 REGISTER_WEAPON(
 /* WEP_##id */ FIREBALL,
-/* function */ w_fireball,
-/* ammotype */ 0,
+/* function */ W_Fireball,
+/* ammotype */ ammo_none,
 /* impulse  */ 9,
 /* flags    */ WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_MID,
+/* color       */ '1 0.5 0',
 /* model    */ "fireball",
 /* netname  */ "fireball",
 /* fullname */ _("Fireball")
 );
 
-#define FIREBALL_SETTINGS(w_cvar,w_prop) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, animtime) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, refire) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, damage) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, damageforcescale) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, speed) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, spread) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, lifetime) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, laserburntime) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, laserdamage) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, laseredgedamage) \
-       w_cvar(WEP_FIREBALL, fireball, MO_BOTH, laserradius) \
-       w_cvar(WEP_FIREBALL, fireball, MO_PRI,  edgedamage) \
-       w_cvar(WEP_FIREBALL, fireball, MO_PRI,  force) \
-       w_cvar(WEP_FIREBALL, fireball, MO_PRI,  radius) \
-       w_cvar(WEP_FIREBALL, fireball, MO_PRI,  health) \
-       w_cvar(WEP_FIREBALL, fireball, MO_PRI,  refire2) \
-       w_cvar(WEP_FIREBALL, fireball, MO_PRI,  bfgdamage) \
-       w_cvar(WEP_FIREBALL, fireball, MO_PRI,  bfgforce) \
-       w_cvar(WEP_FIREBALL, fireball, MO_PRI,  bfgradius) \
-       w_cvar(WEP_FIREBALL, fireball, MO_SEC,  damagetime) \
-       w_cvar(WEP_FIREBALL, fireball, MO_SEC,  speed_up) \
-       w_cvar(WEP_FIREBALL, fireball, MO_SEC,  speed_z) \
-       w_prop(WEP_FIREBALL, fireball, float,  reloading_ammo, reload_ammo) \
-       w_prop(WEP_FIREBALL, fireball, float,  reloading_time, reload_time) \
-       w_prop(WEP_FIREBALL, fireball, float,  switchdelay_raise, switchdelay_raise) \
-       w_prop(WEP_FIREBALL, fireball, float,  switchdelay_drop, switchdelay_drop) \
-       w_prop(WEP_FIREBALL, fireball, string, weaponreplace, weaponreplace) \
-       w_prop(WEP_FIREBALL, fireball, float,  weaponstart, weaponstart)
+#define FIREBALL_SETTINGS(w_cvar,w_prop) FIREBALL_SETTINGS_LIST(w_cvar, w_prop, FIREBALL, fireball)
+#define FIREBALL_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
+       w_cvar(id, sn, BOTH, animtime) \
+       w_cvar(id, sn, BOTH, refire) \
+       w_cvar(id, sn, BOTH, damage) \
+       w_cvar(id, sn, BOTH, damageforcescale) \
+       w_cvar(id, sn, BOTH, speed) \
+       w_cvar(id, sn, BOTH, spread) \
+       w_cvar(id, sn, BOTH, lifetime) \
+       w_cvar(id, sn, BOTH, laserburntime) \
+       w_cvar(id, sn, BOTH, laserdamage) \
+       w_cvar(id, sn, BOTH, laseredgedamage) \
+       w_cvar(id, sn, BOTH, laserradius) \
+       w_cvar(id, sn, PRI,  edgedamage) \
+       w_cvar(id, sn, PRI,  force) \
+       w_cvar(id, sn, PRI,  radius) \
+       w_cvar(id, sn, PRI,  health) \
+       w_cvar(id, sn, PRI,  refire2) \
+       w_cvar(id, sn, PRI,  bfgdamage) \
+       w_cvar(id, sn, PRI,  bfgforce) \
+       w_cvar(id, sn, PRI,  bfgradius) \
+       w_cvar(id, sn, SEC,  damagetime) \
+       w_cvar(id, sn, SEC,  speed_up) \
+       w_cvar(id, sn, SEC,  speed_z) \
+       w_prop(id, sn, float,  switchdelay_raise, switchdelay_raise) \
+       w_prop(id, sn, float,  switchdelay_drop, switchdelay_drop) \
+       w_prop(id, sn, string, weaponreplace, weaponreplace) \
+       w_prop(id, sn, float,  weaponstart, weaponstart) \
+       w_prop(id, sn, float,  weaponstartoverride, weaponstartoverride)
 
 #ifdef SVQC
 FIREBALL_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
@@ -199,7 +200,7 @@ void W_Fireball_Attack1()
        setorigin(proj, w_shotorg);
 
        proj.movetype = MOVETYPE_FLY;
-       WEP_SETUPPROJVELOCITY_PRI(proj, fireball);
+       W_SetupProjVelocity_PRI(proj, fireball);
        proj.angles = vectoangles(proj.velocity);
        proj.touch = W_Fireball_TouchExplode;
        setsize(proj, '-16 -16 -16', '16 16 16');
@@ -249,7 +250,7 @@ void W_Fireball_Attack1_Frame0()
        weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame1);
 }
 
-void W_Firemine_Think()
+void W_Fireball_Firemine_Think()
 {
        if(time > self.pushltime)
        {
@@ -275,7 +276,7 @@ void W_Firemine_Think()
        self.nextthink = time + 0.1;
 }
 
-void W_Firemine_Touch (void)
+void W_Fireball_Firemine_Touch (void)
 {
        PROJECTILE_TOUCH;
        if (other.takedamage == DAMAGE_AIM)
@@ -323,15 +324,15 @@ void W_Fireball_Attack2()
        proj.bot_dodgerating = WEP_CVAR_SEC(fireball, damage);
        proj.movetype = MOVETYPE_BOUNCE;
        proj.projectiledeathtype = WEP_FIREBALL | HITTYPE_SECONDARY;
-       proj.touch = W_Firemine_Touch;
+       proj.touch = W_Fireball_Firemine_Touch;
        PROJECTILE_MAKETRIGGER(proj);
        setsize(proj, '-4 -4 -4', '4 4 4');
        setorigin(proj, w_shotorg);
-       proj.think = W_Firemine_Think;
+       proj.think = W_Fireball_Firemine_Think;
        proj.nextthink = time;
        proj.damageforcescale = WEP_CVAR_SEC(fireball, damageforcescale);
        proj.pushltime = time + WEP_CVAR_SEC(fireball, lifetime);
-       WEP_SETUPPROJVELOCITY_UP_SEC(proj, fireball);
+       W_SetupProjVelocity_UP_SEC(proj, fireball);
 
        proj.angles = vectoangles(proj.velocity);
        proj.flags = FL_PROJECTILE;
@@ -342,7 +343,7 @@ void W_Fireball_Attack2()
        other = proj; MUTATOR_CALLHOOK(EditProjectile);
 }
 
-float w_fireball(float req)
+float W_Fireball(float req)
 {
        switch(req)
        {
@@ -442,7 +443,7 @@ float w_fireball(float req)
 }
 #endif
 #ifdef CSQC
-float w_fireball(float req)
+float W_Fireball(float req)
 {
        switch(req)
        {