]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Sounds: fix silent weapons
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 3 Nov 2015 10:19:10 +0000 (21:19 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 3 Nov 2015 10:19:10 +0000 (21:19 +1100)
13 files changed:
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/turrets/turret/ewheel_weapon.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/hk_weapon.qc
qcsrc/common/turrets/turret/machinegun_weapon.qc
qcsrc/common/turrets/turret/mlrs_weapon.qc
qcsrc/common/turrets/turret/phaser_weapon.qc
qcsrc/common/turrets/turret/plasma_weapon.qc
qcsrc/common/turrets/turret/tesla_weapon.qc
qcsrc/common/turrets/turret/walker_weapon.qc

index 72b8d158634e06c3c16834e951553154038369e5..38b34c425e6d4e254fe5fb1c3f2cabb819c06351 100644 (file)
@@ -39,6 +39,7 @@ REGISTER_WEAPON(MAGE_SPIKE, NEW(MageSpike));
 
 #ifdef SVQC
 
+SOUND(MageSpike_FIRE, W_Sound("electro_fire"));
 void M_Mage_Attack_Spike(vector dir);
 void M_Mage_Attack_Push();
 METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, .entity weaponentity, int fire)) {
@@ -46,7 +47,7 @@ METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, .entity weapon
     if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, weaponentity, false, 0.2)) {
         if (!actor.target_range) actor.target_range = autocvar_g_monsters_target_range;
         actor.enemy = Monster_FindTarget(actor);
-        W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+        W_SetupShot_Dir(actor, v_forward, false, 0, SND(MageSpike_FIRE), CH_WEAPON_B, 0);
        if (!IS_PLAYER(actor)) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin);
         M_Mage_Attack_Spike(w_shotdir);
         weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready);
index e1f063dbb64aded9ebe95fa9db2be39dbd2aade2..26c05d77904aae6fdf3ecefcce8b83a3ac7381c2 100644 (file)
@@ -50,6 +50,7 @@ float autocvar_g_monster_spider_attack_bite_delay;
 
 void M_Spider_Attack_Web();
 
+SOUND(SpiderAttack_FIRE, W_Sound("electro_fire"));
 METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
@@ -61,7 +62,7 @@ METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity
                        actor.anim_finished = time + 1;
                }
         if (isPlayer) actor.enemy = Monster_FindTarget(actor);
-        W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+        W_SetupShot_Dir(actor, v_forward, false, 0, SND(SpiderAttack_FIRE), CH_WEAPON_B, 0);
        if (!isPlayer) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin);
                M_Spider_Attack_Web();
         weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready);
index ebf178f40dae87455ec2e9c76e98fe3f47cf7f9c..b55c5a42d96eee4f0e3d8501f2369f7face4084e 100644 (file)
@@ -48,10 +48,11 @@ float autocvar_g_monster_wyvern_attack_fireball_speed;
 void M_Wyvern_Attack_Fireball_Explode();
 void M_Wyvern_Attack_Fireball_Touch();
 
+SOUND(WyvernAttack_FIRE, W_Sound("electro_fire"));
 METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity weaponentity, int fire)) {
     if (fire & 1)
     if (time > actor.attack_finished_single[0] || weapon_prepareattack(thiswep, actor, weaponentity, false, 1.2)) {
-        if (IS_PLAYER(actor)) W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+        if (IS_PLAYER(actor)) W_SetupShot_Dir(actor, v_forward, false, 0, SND(WyvernAttack_FIRE), CH_WEAPON_B, 0);
                if (IS_MONSTER(actor)) {
                        actor.attack_finished_single[0] = time + 1.2;
                        actor.anim_finished = time + 1.2;
index dd1bbb363527829ff0b30e270cefea8a59c6cd71..e7ce7050021ac175bac93a5e8f25bacc4a5cedb2 100644 (file)
@@ -16,13 +16,14 @@ REGISTER_WEAPON(EWHEEL, NEW(EWheelAttack));
 #ifdef SVQC
 
 void turret_initparams(entity);
+SOUND(EWheelAttack_FIRE, W_Sound("electro_fire"));
 METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
         if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND(EWheelAttack_FIRE), CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
index 1a30e254cf53bc0ad09ac3575711834baff97f8d..d1b560bfb2ffbaa58b1274b5a796406cff52a9e0 100644 (file)
@@ -16,13 +16,14 @@ REGISTER_WEAPON(FLAC, NEW(FlacAttack));
 #ifdef SVQC
 
 void turret_flac_projectile_think_explode();
+SOUND(FlacAttack_FIRE, W_Sound("electro_fire"));
 METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
         if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND(FlacAttack_FIRE), CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
index 20eee23587f7f40f88371941739d4433f6ab291f..77aeb7c7e1d670297dc0ebf2ed2b591fc99c698d 100644 (file)
@@ -19,13 +19,14 @@ float autocvar_g_turrets_unit_hellion_shot_speed_gain;
 float autocvar_g_turrets_unit_hellion_shot_speed_max;
 
 void turret_hellion_missile_think();
+SOUND(HellionAttack_FIRE, W_Sound("electro_fire"));
 METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
         if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND(HellionAttack_FIRE), CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
index 12589f15e3e4a229410b4cf7765f863b63ba9a81..b083c6830eda791bcaa7de0f43cd3a44c4cfa08c 100644 (file)
@@ -23,6 +23,7 @@ float autocvar_g_turrets_unit_hk_shot_speed_max;
 float autocvar_g_turrets_unit_hk_shot_speed_turnrate;
 
 void turret_hk_missile_think();
+SOUND(HunterKillerAttack_FIRE, W_Sound("electro_fire"));
 METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
        bool isPlayer = IS_PLAYER(actor);
@@ -30,7 +31,7 @@ METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, .entity
        if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
                if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND(HunterKillerAttack_FIRE), CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
index 4c7b5b752b79f52fbd81ea73ad96268e384850ea..7bd8b4086890ac2c65433cfe17358afb5f3a8db1 100644 (file)
@@ -16,7 +16,7 @@ REGISTER_WEAPON(TUR_MACHINEGUN, NEW(MachineGunTurretAttack));
 #ifdef SVQC
 
 void W_MachineGun_MuzzleFlash();
-
+SOUND(MachineGunTurretAttack_FIRE, W_Sound("electro_fire"));
 METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
     bool isPlayer = IS_PLAYER(actor);
@@ -24,7 +24,7 @@ METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, .ent
     if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(machinegun, sustained_refire))) {
         if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND(MachineGunTurretAttack_FIRE), CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
index dde35f2780a4415c70290ff57837dd9ccc86f3eb..abd7b0fc4e77ba60598b903f77744ec6da3050b4 100644 (file)
@@ -14,7 +14,7 @@ REGISTER_WEAPON(TUR_MLRS, NEW(MLRSTurretAttack));
 #ifdef IMPLEMENTATION
 
 #ifdef SVQC
-
+SOUND(MLRSTurretAttack_FIRE, W_Sound("electro_fire"));
 METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
     bool isPlayer = IS_PLAYER(actor);
@@ -22,7 +22,7 @@ METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, .entity we
     if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(machinegun, sustained_refire))) {
         if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND(MLRSTurretAttack_FIRE), CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
index 69717ed3e3b422c96df780ed321bf305bd024c65..087ade8d47b2c1e7e23ac18b1e647433eab2a4b9 100644 (file)
@@ -17,7 +17,7 @@ REGISTER_WEAPON(PHASER, NEW(PhaserTurretAttack));
 void beam_think();
 
 .int fireflag;
-
+SOUND(PhaserTurretAttack_FIRE, W_Sound("electro_fire"));
 METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
     bool isPlayer = IS_PLAYER(actor);
@@ -25,7 +25,7 @@ METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, .entity
     if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
         if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND(PhaserTurretAttack_FIRE), CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
index caaae6fe96296738131ad654c7afe359f7acef65..65e182be387b25781eef23f05f1a166f70ab67d2 100644 (file)
@@ -14,14 +14,14 @@ REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
 #ifdef IMPLEMENTATION
 
 #ifdef SVQC
-
+SOUND(PlasmaAttack_FIRE, W_Sound("electro_fire"));
 METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
        bool isPlayer = IS_PLAYER(actor);
        if (fire & 1)
        if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
                if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND(PlasmaAttack_FIRE), CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
index 772fced69a964e68b9ae787a57050aadb53e7f84..7e9108cb423750d3e9fb2a76e4be50c94531e7e5 100644 (file)
@@ -16,13 +16,14 @@ REGISTER_WEAPON(TESLA, NEW(TeslaCoilTurretAttack));
 #ifdef SVQC
 
 entity toast(entity from, float range, float damage);
+SOUND(TeslaCoilTurretAttack_FIRE, W_Sound("electro_fire"));
 METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
         if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND(TeslaCoilTurretAttack_FIRE), CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
index 192cbfc6d399e9c13b232e2603471db5e8a07653..a3150d820d5ab6aaea18c829fabb9ea42ddee072 100644 (file)
@@ -15,13 +15,14 @@ REGISTER_WEAPON(WALKER, NEW(WalkerTurretAttack));
 
 #ifdef SVQC
 
+SOUND(WalkerTurretAttack_FIRE, W_Sound("electro_fire"));
 METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
         if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND(WalkerTurretAttack_FIRE), CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;