]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
wip bullet weak
authorMartin Taibr <taibr.martin@gmail.com>
Tue, 3 Jul 2018 10:03:39 +0000 (12:03 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Tue, 3 Jul 2018 10:03:39 +0000 (12:03 +0200)
effectinfo.txt
qcsrc/common/effects/all.inc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/server/weapons/tracing.qc

index 953526145a7ac787de69364c8ee039b579ffd15a..085f729ab1e6390b9868cfaca777068ed81da7ce 100644 (file)
@@ -8272,3 +8272,22 @@ effect arc_bolt_explode
        tex 40 40
        velocityjitter 224 224 224
        velocityoffset 0 0 80
+//effect tr_bullet_weak
+//     type beam
+//     alpha 150 200 1000
+//     color 0xf03000 0xff6010
+//     countabsolute 1
+//     sizeincrease -3
+//     size 0.6 0.8
+//     tex 200 200
+effect tr_bullet_weak
+       type smoke
+       airfriction -4
+       alpha 256 256 350
+       color 0x202020 0x404040
+       notunderwater
+       sizeincrease 0.400000
+       size 1 2
+       tex 0 8
+       trailspacing 16
+       velocityjitter 4 4 4
index 6439a49bb21ce32c6c64bbc8814f37dbb8f5520d..7a58757aee28a87a64fef1512c89f06ea595ed5a 100644 (file)
@@ -229,6 +229,7 @@ EFFECT(0, SMOKING,                  "smoking")
 EFFECT(0, SMOKE_RING,               "smoke_ring")
 EFFECT(0, JUMPPAD,                  "jumppad_activate")
 EFFECT(1, BULLET,                   "tr_bullet")
+EFFECT(1, BULLET_WEAK,              "tr_bullet_weak")
 EFFECT(0, EF_FLAME,                 "EF_FLAME")
 EFFECT(0, EF_STARDUST,              "EF_STARDUST")
 EFFECT(0, TE_EXPLOSION,             "TE_EXPLOSION")
index 8c37e7c60446704c3d3a60bb2baac4f5995a84b0..1ee969bb8b9438c4bf27f5205e6b1a2e4ecedd20 100644 (file)
@@ -160,7 +160,7 @@ void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, .entity weaponentity
                WEP_CVAR_PRI(shotgun, spread),
                WEP_CVAR_PRI(shotgun, solidpenetration),
                WEP_CVAR_PRI(shotgun, force),
-               EFFECT_BULLET); // actually is secondary, but we trick the last shot into playing full reload sound
+               EFFECT_BULLET_WEAK); // actually is secondary, but we trick the last shot into playing full reload sound
        weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), w_ready);
 }
 void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity, int fire)
@@ -180,7 +180,7 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity
                WEP_CVAR_PRI(shotgun, spread),
                WEP_CVAR_PRI(shotgun, solidpenetration),
                WEP_CVAR_PRI(shotgun, force),
-               EFFECT_BULLET);
+               EFFECT_BULLET_WEAK);
        weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), W_Shotgun_Attack3_Frame2);
 }
 
@@ -218,7 +218,7 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit
                                                WEP_CVAR_PRI(shotgun, spread),
                                                WEP_CVAR_PRI(shotgun, solidpenetration),
                                                WEP_CVAR_PRI(shotgun, force),
-                                               EFFECT_BULLET);
+                                               EFFECT_BULLET_WEAK);
                     actor.(weaponentity).shotgun_primarytime = time + WEP_CVAR_PRI(shotgun, refire) * W_WeaponRateFactor(actor);
                     weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(shotgun, animtime), w_ready);
                 }
@@ -237,7 +237,7 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit
                                                WEP_CVAR_PRI(shotgun, spread),
                                                WEP_CVAR_PRI(shotgun, solidpenetration),
                                                WEP_CVAR_PRI(shotgun, force),
-                                               EFFECT_BULLET);
+                                               EFFECT_BULLET_WEAK);
                     actor.(weaponentity).shotgun_primarytime = time + WEP_CVAR_SEC(shotgun, alt_refire) * W_WeaponRateFactor(actor);
                     weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), W_Shotgun_Attack3_Frame1);
                 }
index 5d35166aa6167d27e4af3bf0e519b52221f4a222..0216a76234c2a6e1ab60bbe1dc8e7a37cdaa235f 100644 (file)
@@ -336,6 +336,7 @@ void fireBullet_trace_callback(vector start, vector hit, vector end)
        fireBullet_last_hit = NULL;
 }
 
+int autocvar_eff;
 void fireBullet(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, entity tracer_effects)
 {
        vector  end;
@@ -344,6 +345,17 @@ void fireBullet(entity this, .entity weaponentity, vector start, vector dir, flo
        end = start + dir * max_shot_distance;
 
        fireBullet_last_hit = NULL;
+
+       if (autocvar_eff == 1) {
+               tracer_effects = EFFECT_RIFLE;
+       } else if (autocvar_eff == 2) {
+               tracer_effects = EFFECT_RIFLE_WEAK;
+       } else if (autocvar_eff == 3) {
+               tracer_effects = EFFECT_BULLET;
+       } else if (autocvar_eff == 4) {
+               tracer_effects = EFFECT_BULLET_WEAK;
+       }
+
        fireBullet_trace_callback_eff = tracer_effects;
 
        float solid_penetration_left = 1;