]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_blaster.qc
Merge remote-tracking branch 'origin/master into samual/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_blaster.qc
index cd4e7ee283f8da543cfe47ff415300e7907fbc8a..eae3ff0d4e95471711e24905f0758a24fb902998 100644 (file)
@@ -7,10 +7,12 @@ REGISTER_WEAPON(
 /* flags     */ WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
 /* rating    */ 0,
 /* color     */ '1 0.5 0.5',
-/* model     */ "laser",
+/* modelname */ "laser",
+/* simplemdl */ "foobar",
 /* crosshair */ "gfx/crosshairlaser 0.4",
-/* netname   */ "laser",
-/* fullname  */ _("Blaster")
+/* wepimg    */ "weaponlaser",
+/* refname   */ "blaster",
+/* wepname   */ _("Blaster")
 );
 
 #define BLASTER_SETTINGS(w_cvar,w_prop) BLASTER_SETTINGS_LIST(w_cvar, w_prop, BLASTER, blaster)
@@ -31,7 +33,8 @@ REGISTER_WEAPON(
        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,  weaponstartoverride, weaponstartoverride) \
+       w_prop(id, sn, float,  weaponthrowable, weaponthrowable)
 
 #ifdef SVQC
 BLASTER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
@@ -43,10 +46,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;
 
@@ -68,7 +71,7 @@ void W_Blaster_Touch()
        remove(self);
 }
 
-void W_Blaster_Think()
+void W_Blaster_Think(void)
 {
        self.movetype = MOVETYPE_FLY;
        self.think = SUB_Remove;
@@ -77,6 +80,7 @@ void W_Blaster_Think()
 }
 
 void W_Blaster_Attack(
+       float atk_deathtype,
        float atk_shotangle,
        float atk_damage,
        float atk_edgedamage,
@@ -118,16 +122,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;
 
@@ -168,6 +172,7 @@ float W_Blaster(float request)
                                if(weapon_prepareattack(0, WEP_CVAR_PRI(blaster, refire)))
                                {
                                        W_Blaster_Attack(
+                                               WEP_BLASTER,
                                                WEP_CVAR_PRI(blaster, shotangle),
                                                WEP_CVAR_PRI(blaster, damage),
                                                WEP_CVAR_PRI(blaster, edgedamage),
@@ -197,6 +202,7 @@ float W_Blaster(float request)
                                                if(weapon_prepareattack(1, WEP_CVAR_SEC(blaster, refire)))
                                                {
                                                        W_Blaster_Attack(
+                                                               WEP_BLASTER | HITTYPE_SECONDARY,
                                                                WEP_CVAR_SEC(blaster, shotangle),
                                                                WEP_CVAR_SEC(blaster, damage),
                                                                WEP_CVAR_SEC(blaster, edgedamage),
@@ -223,7 +229,7 @@ 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;
                }
                
@@ -247,16 +253,15 @@ float W_Blaster(float request)
                
                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
@@ -268,7 +273,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;
                }
@@ -284,8 +289,7 @@ float W_Blaster(float request)
                        return FALSE;
                }
        }
-       
-       return TRUE;
+       return FALSE;
 }
 #endif
 #endif