]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_blaster.qc
Some balance fixes for arc
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_blaster.qc
index fb8c7db076618a8704af27b3f0ea4a8d31e1b701..aa8d0a89b665bbbcd18a58bf3db6887fc98c00f8 100644 (file)
@@ -1,36 +1,41 @@
 #ifdef REGISTER_WEAPON
 REGISTER_WEAPON(
-/* WEP_##id */ BLASTER,
-/* function */ W_Blaster,
-/* ammotype */ 0,
-/* impulse  */ 1,
-/* flags    */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
-/* rating   */ 0,
-/* model    */ "laser",
-/* netname  */ "laser",
-/* fullname */ _("Blaster")
+/* WEP_##id  */ BLASTER,
+/* function  */ W_Blaster,
+/* ammotype  */ ammo_none,
+/* impulse   */ 1,
+/* flags     */ WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
+/* rating    */ 0,
+/* color     */ '1 0.5 0.5',
+/* modelname */ "laser",
+/* simplemdl */ "foobar",
+/* crosshair */ "gfx/crosshairlaser 0.4",
+/* wepimg    */ "weaponlaser",
+/* refname   */ "blaster",
+/* wepname   */ _("Blaster")
 );
 
-#define BLASTER_SETTINGS(w_cvar,w_prop) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, animtime) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, damage) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, delay) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, edgedamage) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, force) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, lifetime) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, radius) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, refire) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, shotangle) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, speed) \
-       w_cvar(WEP_BLASTER, blaster, MO_BOTH, spread) \
-       w_cvar(WEP_BLASTER, blaster, MO_NONE, secondary) \
-       w_prop(WEP_BLASTER, blaster, float,  reloading_ammo, reload_ammo) \
-       w_prop(WEP_BLASTER, blaster, float,  reloading_time, reload_time) \
-       w_prop(WEP_BLASTER, blaster, float,  switchdelay_raise, switchdelay_raise) \
-       w_prop(WEP_BLASTER, blaster, float,  switchdelay_drop, switchdelay_drop) \
-       w_prop(WEP_BLASTER, blaster, string, weaponreplace, weaponreplace) \
-       w_prop(WEP_BLASTER, blaster, float,  weaponstart, weaponstart) \
-       w_prop(WEP_BLASTER, blaster, float,  weaponstartoverride, weaponstartoverride)
+#define BLASTER_SETTINGS(w_cvar,w_prop) BLASTER_SETTINGS_LIST(w_cvar, w_prop, BLASTER, blaster)
+#define BLASTER_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
+       w_cvar(id, sn, BOTH, animtime) \
+       w_cvar(id, sn, BOTH, damage) \
+       w_cvar(id, sn, BOTH, delay) \
+       w_cvar(id, sn, BOTH, edgedamage) \
+       w_cvar(id, sn, BOTH, force) \
+       w_cvar(id, sn, BOTH, force_zscale) \
+       w_cvar(id, sn, BOTH, lifetime) \
+       w_cvar(id, sn, BOTH, radius) \
+       w_cvar(id, sn, BOTH, refire) \
+       w_cvar(id, sn, BOTH, shotangle) \
+       w_cvar(id, sn, BOTH, speed) \
+       w_cvar(id, sn, BOTH, spread) \
+       w_cvar(id, sn, NONE, secondary) \
+       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) \
+       w_prop(id, sn, float,  weaponthrowable, weaponthrowable)
 
 #ifdef SVQC
 BLASTER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
@@ -42,10 +47,10 @@ BLASTER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #else
 #ifdef SVQC
-void spawnfunc_weapon_blaster() { weapon_defaultspawnfunc(WEP_BLASTER); }
-void spawnfunc_weapon_laser() { spawnfunc_weapon_blaster(); }
+void spawnfunc_weapon_blaster(void) { weapon_defaultspawnfunc(WEP_BLASTER); }
+void spawnfunc_weapon_laser(void) { spawnfunc_weapon_blaster(); }
 
-void W_Blaster_Touch()
+void W_Blaster_Touch(void)
 {
        PROJECTILE_TOUCH;
 
@@ -67,7 +72,7 @@ void W_Blaster_Touch()
        remove(self);
 }
 
-void W_Blaster_Think()
+void W_Blaster_Think(void)
 {
        self.movetype = MOVETYPE_FLY;
        self.think = SUB_Remove;
@@ -76,6 +81,7 @@ void W_Blaster_Think()
 }
 
 void W_Blaster_Attack(
+       float atk_deathtype,
        float atk_shotangle,
        float atk_damage,
        float atk_edgedamage,
@@ -107,7 +113,7 @@ void W_Blaster_Attack(
        setorigin(missile, w_shotorg);
        setsize(missile, '0 0 0', '0 0 0');
        
-       W_SetupProjectileVelocityEx(
+       W_SetupProjVelocity_Explicit(
                missile,
                w_shotdir,
                v_up,
@@ -117,16 +123,16 @@ void W_Blaster_Attack(
                atk_spread,
                FALSE
        );
-       
+
        missile.angles = vectoangles(missile.velocity);
-       
+
        //missile.glow_color = 250; // 244, 250
        //missile.glow_size = 120;
 
        missile.touch = W_Blaster_Touch;
        missile.flags = FL_PROJECTILE;
        missile.missile_flags = MIF_SPLASH;
-       missile.projectiledeathtype = WEP_BLASTER
+       missile.projectiledeathtype = atk_deathtype
        missile.think = W_Blaster_Think;
        missile.nextthink = time + atk_delay;
 
@@ -162,16 +168,12 @@ float W_Blaster(float request)
                
                case WR_THINK:
                {
-                       if(WEP_CVAR(blaster, reload_ammo) && self.clip_load < 1) // forced reload
-                       {
-                               WEP_ACTION(self.weapon, WR_RELOAD);
-                       }
-                       else if(self.BUTTON_ATCK)
+                       if(self.BUTTON_ATCK)
                        {
                                if(weapon_prepareattack(0, WEP_CVAR_PRI(blaster, refire)))
                                {
-                                       W_DecreaseAmmo(ammo_none, 1, TRUE); // WEAPONTODO is this necessary?
                                        W_Blaster_Attack(
+                                               WEP_BLASTER,
                                                WEP_CVAR_PRI(blaster, shotangle),
                                                WEP_CVAR_PRI(blaster, damage),
                                                WEP_CVAR_PRI(blaster, edgedamage),
@@ -200,8 +202,8 @@ float W_Blaster(float request)
                                        {
                                                if(weapon_prepareattack(1, WEP_CVAR_SEC(blaster, refire)))
                                                {
-                                                       W_DecreaseAmmo(ammo_none, 1, TRUE);
                                                        W_Blaster_Attack(
+                                                               WEP_BLASTER | HITTYPE_SECONDARY,
                                                                WEP_CVAR_SEC(blaster, shotangle),
                                                                WEP_CVAR_SEC(blaster, damage),
                                                                WEP_CVAR_SEC(blaster, edgedamage),
@@ -228,13 +230,13 @@ float W_Blaster(float request)
                        precache_model("models/weapons/v_laser.md3");
                        precache_model("models/weapons/h_laser.iqm");
                        precache_sound("weapons/lasergun_fire.wav");
-                       BLASTER_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
+                       BLASTER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
                        return TRUE;
                }
                
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_none;
+                       self.ammo_field = ammo_none;
                        return TRUE;
                }
                
@@ -250,24 +252,17 @@ float W_Blaster(float request)
                        return TRUE;
                }
                
-               case WR_RELOAD:
-               {
-                       W_Reload(0, "weapons/reload.wav");
-                       return TRUE;
-               }
-               
                case WR_SUICIDEMESSAGE:
                {
-                       return WEAPON_LASER_SUICIDE;
+                       return WEAPON_BLASTER_SUICIDE;
                }
                
                case WR_KILLMESSAGE:
                {
-                       return WEAPON_LASER_MURDER;
+                       return WEAPON_BLASTER_MURDER;
                }
        }
-       
-       return TRUE;
+       return FALSE;
 }
 #endif
 #ifdef CSQC
@@ -279,7 +274,7 @@ float W_Blaster(float request)
                {
                        vector org2;
                        org2 = w_org + w_backoff * 6;
-                       pointparticles(particleeffectnum("new_laser_impact"), org2, w_backoff * 1000, 1);
+                       pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
                        if(!w_issilent) { sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); }
                        return TRUE;
                }
@@ -289,9 +284,13 @@ float W_Blaster(float request)
                        precache_sound("weapons/laserimpact.wav");
                        return TRUE;
                }
+               case WR_ZOOMRETICLE:
+               {
+                       // no weapon specific image for this weapon
+                       return FALSE;
+               }
        }
-       
-       return TRUE;
+       return FALSE;
 }
 #endif
 #endif