]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/fireball.qc
Merge branch 'master' into TimePath/spawnfunc
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / fireball.qc
index 4f8f3787c3443335c0d91ca11aa72c5648d5b484..c334932f165f74fb96e7b120522584337460bbc3 100644 (file)
@@ -55,10 +55,10 @@ FIREBALL_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_fireball(void) { weapon_defaultspawnfunc(WEP_FIREBALL.m_id); }
+spawnfunc(weapon_fireball) { weapon_defaultspawnfunc(WEP_FIREBALL.m_id); }
 
 void W_Fireball_Explode(void)
-{
+{SELFPARAM();
        entity e;
        float dist;
        float points;
@@ -114,7 +114,7 @@ void W_Fireball_TouchExplode(void)
 }
 
 void W_Fireball_LaserPlay(float dt, float dist, float damage, float edgedamage, float burntime)
-{
+{SELFPARAM();
        entity e;
        float d;
        vector p;
@@ -148,7 +148,7 @@ void W_Fireball_LaserPlay(float dt, float dist, float damage, float edgedamage,
 }
 
 void W_Fireball_Think(void)
-{
+{SELFPARAM();
        if(time > self.pushltime)
        {
                self.cnt = 1;
@@ -163,7 +163,7 @@ void W_Fireball_Think(void)
 }
 
 void W_Fireball_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{
+{SELFPARAM();
        if(self.health <= 0)
                return;
 
@@ -179,10 +179,10 @@ void W_Fireball_Damage(entity inflictor, entity attacker, float damage, int deat
 }
 
 void W_Fireball_Attack1(void)
-{
+{SELFPARAM();
        entity proj;
 
-       W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 2, W_Sound("fireball_fire2"), CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage));
+       W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 2, SND(FIREBALL_FIRE2), CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage));
 
        Send_Effect(EFFECT_FIREBALL_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
@@ -218,7 +218,7 @@ void W_Fireball_Attack1(void)
 }
 
 void W_Fireball_AttackEffect(float i, vector f_diff)
-{
+{SELFPARAM();
        W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 0, "", 0, 0);
        w_shotorg += f_diff.x * v_up + f_diff.y * v_right;
        Send_Effect(EFFECT_FIREBALL_PRE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
@@ -249,14 +249,14 @@ void W_Fireball_Attack1_Frame1(void)
 }
 
 void W_Fireball_Attack1_Frame0(void)
-{
+{SELFPARAM();
        W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
-       sound(self, CH_WEAPON_SINGLE, W_Sound("fireball_prefire2"), VOL_BASE, ATTEN_NORM);
+       sound(self, CH_WEAPON_SINGLE, SND_FIREBALL_PREFIRE2, VOL_BASE, ATTEN_NORM);
        weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame1);
 }
 
 void W_Fireball_Firemine_Think(void)
-{
+{SELFPARAM();
        if(time > self.pushltime)
        {
                remove(self);
@@ -282,7 +282,7 @@ void W_Fireball_Firemine_Think(void)
 }
 
 void W_Fireball_Firemine_Touch(void)
-{
+{SELFPARAM();
        PROJECTILE_TOUCH;
        if(other.takedamage == DAMAGE_AIM)
        if(Fire_AddDamage(other, self.realowner, WEP_CVAR_SEC(fireball, damage), WEP_CVAR_SEC(fireball, damagetime), self.projectiledeathtype) >= 0)
@@ -294,7 +294,7 @@ void W_Fireball_Firemine_Touch(void)
 }
 
 void W_Fireball_Attack2(void)
-{
+{SELFPARAM();
        entity proj;
        vector f_diff;
        float c;
@@ -316,7 +316,7 @@ void W_Fireball_Attack2(void)
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
-       W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 2, W_Sound("fireball_fire"), CH_WEAPON_A, WEP_CVAR_SEC(fireball, damage));
+       W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 2, SND(FIREBALL_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(fireball, damage));
        traceline(w_shotorg, w_shotorg + f_diff_x * v_up + f_diff_y * v_right, MOVE_NORMAL, self);
        w_shotorg = trace_endpos;
 
@@ -349,7 +349,7 @@ void W_Fireball_Attack2(void)
 }
 
 bool W_Fireball(int req)
-{
+{SELFPARAM();
        switch(req)
        {
                case WR_AIM:
@@ -399,13 +399,6 @@ bool W_Fireball(int req)
                }
                case WR_INIT:
                {
-                       precache_model(W_Model("g_fireball.md3"));
-                       precache_model(W_Model("v_fireball.md3"));
-                       precache_model(W_Model("h_fireball.iqm"));
-                       precache_model("models/sphere/sphere.md3");
-                       precache_sound(W_Sound("fireball_fire"));
-                       precache_sound(W_Sound("fireball_fire2"));
-                       precache_sound(W_Sound("fireball_prefire2"));
                        FIREBALL_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -449,7 +442,7 @@ bool W_Fireball(int req)
 #endif
 #ifdef CSQC
 bool W_Fireball(int req)
-{
+{SELFPARAM();
        switch(req)
        {
                case WR_IMPACTEFFECT:
@@ -464,14 +457,13 @@ bool W_Fireball(int req)
                                org2 = w_org + w_backoff * 16;
                                pointparticles(particleeffectnum(EFFECT_FIREBALL_EXPLODE), org2, '0 0 0', 1);
                                if(!w_issilent)
-                                       sound(self, CH_SHOTS, W_Sound("fireball_impact2"), VOL_BASE, ATTEN_NORM * 0.25); // long range boom
+                                       sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom
                        }
 
                        return true;
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("fireball_impact2"));
                        return true;
                }
                case WR_ZOOMRETICLE: