]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' of git://de.git.xonotic.org/xonotic/xonotic-data.pk3dir
authorMartin Taibr <taibr.martin@gmail.com>
Sun, 30 Sep 2018 16:13:18 +0000 (18:13 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Sun, 30 Sep 2018 16:13:18 +0000 (18:13 +0200)
19 files changed:
.gitlab-ci.yml
bal-wep-xdf.cfg
effectinfo.txt
qcsrc/client/csqcmodel_hooks.qc
qcsrc/common/effects/all.inc
qcsrc/common/effects/effectinfo.inc
qcsrc/common/mapobjects/func/button.qc
qcsrc/common/mutators/mutator/overkill/okhmg.qc
qcsrc/common/mutators/mutator/overkill/okmachinegun.qc
qcsrc/common/mutators/mutator/overkill/okshotgun.qc
qcsrc/common/turrets/turret/machinegun_weapon.qc
qcsrc/common/turrets/turret/walker_weapon.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/tracing.qh
qcsrc/server/weapons/weaponsystem.qc

index f960751ca51d8b790ce2efefcea7944912998478..0ad802d838e4d7603b3ff29a46eb202265ac9cd0 100644 (file)
@@ -29,7 +29,7 @@ test_sv_game:
     - wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
     - wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
     - make
-    - EXPECT=e62d1a2375f0976ab12e2d980add29bd
+    - EXPECT=14643a645a99b8f855a6af279569d2a1
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
index 2e0e74aa3d7a993b7a97f1ac1b43f9ead3bbc797..13bdc529a9f7364e36ce66ec85b596732e2b0f7b 100644 (file)
@@ -762,11 +762,11 @@ set g_balance_arc_bolt_ammo 1
 set g_balance_arc_bolt_damage 25
 set g_balance_arc_bolt_damageforcescale 0
 set g_balance_arc_bolt_edgedamage 12.5
-set g_balance_arc_bolt_force 120
+set g_balance_arc_bolt_force 200
 set g_balance_arc_bolt_health 15
 set g_balance_arc_bolt_lifetime 5
 set g_balance_arc_bolt_radius 65
-set g_balance_arc_bolt_refire 0.16667
+set g_balance_arc_bolt_refire 0.033333
 set g_balance_arc_bolt_speed 2300
 set g_balance_arc_bolt_spread 0
 set g_balance_arc_burst_ammo 15
index 128169c502911d760c7de4707850887c805f6284..c07774a05b99473c12eb20e5f9de754fc87f895c 100644 (file)
@@ -2751,14 +2751,36 @@ effect flac_explode
        velocityjitter 256 256 256
        velocityoffset 0 0 80
 effect tr_bullet
-       type spark
-       alpha 256 256 2560
-       color 0xff8960 0xff8533
-       size 4 4
-       stretchfactor 0.200000
-       tex 70 70
-       trailspacing 750
-       velocitymultiplier 3
+       type beam
+       alpha 500 600 10000
+       color 0xf03000 0xff6010
+       countabsolute 1
+       sizeincrease -3
+       size 0.6 0.8
+       tex 200 200
+effect tr_bullet
+       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
+effect tr_bullet
+       type bubble
+       alpha 256 256 128
+       bounce 1.500000
+       color 0x404040 0x808080
+       gravity -0.125000
+       liquidfriction 4
+       size 0.5 0.6
+       tex 62 62
+       trailspacing 16
+       underwater
+       velocityjitter 16 16 16
 effect smoking_smallemitter
        type alphastatic
        airfriction -1
@@ -8262,3 +8284,34 @@ effect arc_bolt_explode
        tex 40 40
        velocityjitter 224 224 224
        velocityoffset 0 0 80
+effect tr_bullet_weak
+       type beam
+       alpha 75 100 3000
+       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
+effect tr_bullet_weak
+       type bubble
+       alpha 256 256 128
+       bounce 1.500000
+       color 0x404040 0x808080
+       gravity -0.125000
+       liquidfriction 4
+       size 0.5 0.6
+       tex 62 62
+       trailspacing 32
+       underwater
+       velocityjitter 16 16 16
index 035ba2a1647c29a2445ca54d73022670536cfed3..522859c8b193ea1d4c4729b72ba50d6322aafc5c 100644 (file)
@@ -600,7 +600,7 @@ void CSQCModel_Hook_PreDraw(entity this, bool isplayer)
                return;
        this.csqcmodel_predraw_run = framecount;
 
-       if(!this.modelindex || this.model == "null")
+       if(!this.modelindex || this.model == "null" || this.alpha < 0)
        {
                this.drawmask = 0;
                return;
@@ -608,7 +608,7 @@ void CSQCModel_Hook_PreDraw(entity this, bool isplayer)
        else
                this.drawmask = MASK_NORMAL;
 
-       if(this.isplayermodel) // this checks if it's a player MODEL!
+       if(this.isplayermodel && this.drawmask) // this checks if it's a player MODEL!
        {
                CSQCPlayer_ModelAppearance_Apply(this, this.entnum == player_localnum + 1);
                CSQCPlayer_LOD_Apply(this);
index 3b534ab781d0f7d8a4614a4534fe4f208a28899d..882e715cde3bf3673045499e643547a01a2d44bf 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 b659e8a8517a83755718d93ea06c03c9a9989db8..d3c184fab743f78878f3c4d01fc5a42c34ea17a5 100644 (file)
@@ -1,3 +1,12 @@
+// docs: https://www.quakewiki.net/darkplaces-wiki/effectinfo-scripting-reference/
+// use `cl_particles_reloadeffects` to reload effects without restarting engine
+// use `chase_active 1` and `cl_lockview 1` to see effects from different perspectives
+// `dumpeffectinfo` currently doesn't work so edit effectinfo.txt manually, just try to keep the files in sync
+
+// `tex` are indices into particles/particlefont.tga (see particles/particlefont-template.tga for numbers)
+// the first index is inclusive, second exclusive (so `tex 0 8` will use images 0 though 7)
+// unless they're equal (`tex 69 69` is the same as `tex 69 70`)
+
 // item respawn effect
 DEF(TE_WIZSPIKE);
 // flare particle and light
@@ -4410,20 +4419,50 @@ SUB(flac_explode) {
 
 // bullet trail (somewhat like a tracer)
 DEF(tr_bullet);
+SUB(tr_bullet) {
+       MY(alpha) = '500 600 10000';
+       MY(color_min) = "0xf03000";
+       MY(color_max) = "0xff6010";
+       MY(countabsolute) = 1;
+       MY(sizeincrease) = -3;
+       MY(size_min) = 0.6;
+       MY(size_max) = 0.8;
+       my(tex_min) = 200;
+       my(tex_max) = 200;
+       MY(type) = "beam";
+}
+SUB(tr_bullet) {
+       MY(airfriction) = -4;
+       MY(alpha) = '256 256 350';
+       MY(color_min) = "0x202020";
+       MY(color_max) = "0x404040";
+       MY(notunderwater) = true;
+       MY(sizeincrease) = 0.4;
+       MY(size_min) = 1;
+       MY(size_max) = 2;
+       MY(tex_min) = 0;
+       MY(tex_max) = 8;
+       MY(trailspacing) = 16;
+       MY(type) = "smoke";
+       MY(velocityjitter) = '4 4 4';
+}
 SUB(tr_bullet) {
        MY(alpha_min) = 256;
        MY(alpha_max) = 256;
-       MY(alpha_fade) = 2560;
-       MY(color_min) = "0xff8960";
-       MY(color_max) = "0xff8533";
-       MY(size_min) = 4;
-       MY(size_max) = 4;
-       MY(stretchfactor) = 0.200000;
-       MY(tex_min) = 70;
-       MY(tex_max) = 70;
-       MY(trailspacing) = 750;
-       MY(type) = "spark";
-       MY(velocitymultiplier) = 3;
+       MY(alpha_fade) = 128;
+       MY(bounce) = 1.500000;
+       MY(color_min) = "0x404040";
+       MY(color_max) = "0x808080";
+       MY(gravity) = -0.125000;
+       MY(liquidfriction) = 4;
+       MY(size_min) = 0.5;
+       MY(size_max) = 0.6;
+       MY(tex_min) = 62;
+       MY(tex_max) = 62;
+       MY(trailspacing) = 16;
+       MY(type) = "bubble";
+       MY(underwater) = true;
+       MY(velocityjitter) = '16.0 16.0 16.0';
 }
 
 // smoke emitter for small pipes
@@ -8889,3 +8928,51 @@ SUB(arc_bolt_explode) {
        MY(velocityjitter) = '224.0 224.0 224.0';
        MY(velocityoffset) = '0.0 0.0 80.0';
 }
+
+// weak bullet trail (somewhat like a tracer)
+DEF(tr_bullet_weak);
+SUB(tr_bullet_weak) {
+       MY(alpha) = '75 100 3000';
+       MY(color_min) = "0xf03000";
+       MY(color_max) = "0xff6010";
+       MY(countabsolute) = 1;
+       MY(sizeincrease) = -3;
+       MY(size_min) = 0.6;
+       MY(size_max) = 0.8;
+       my(tex_min) = 200;
+       my(tex_max) = 200;
+       MY(type) = "beam";
+}
+SUB(tr_bullet_weak) {
+       MY(airfriction) = -4;
+       MY(alpha) = '256 256 350';
+       MY(color_min) = "0x202020";
+       MY(color_max) = "0x404040";
+       MY(notunderwater) = true;
+       MY(sizeincrease) = 0.4;
+       MY(size_min) = 1;
+       MY(size_max) = 2;
+       MY(tex_min) = 0;
+       MY(tex_max) = 8;
+       MY(trailspacing) = 16;
+       MY(type) = "smoke";
+       MY(velocityjitter) = '4 4 4';
+}
+SUB(tr_bullet_weak) {
+       MY(alpha_min) = 256;
+       MY(alpha_max) = 256;
+       MY(alpha_fade) = 128;
+       MY(bounce) = 1.500000;
+       MY(color_min) = "0x404040";
+       MY(color_max) = "0x808080";
+       MY(gravity) = -0.125000;
+       MY(liquidfriction) = 4;
+       MY(size_min) = 0.5;
+       MY(size_max) = 0.6;
+       MY(tex_min) = 62;
+       MY(tex_max) = 62;
+       MY(trailspacing) = 32;
+       MY(type) = "bubble";
+       MY(underwater) = true;
+       MY(velocityjitter) = '16.0 16.0 16.0';
+}
index a8537f172534225adce4855a8713e34fdaecbcfb..024d5cfd873cfb37d288785876d4e4c0684a681f 100644 (file)
@@ -5,6 +5,43 @@
 void button_wait(entity this);
 void button_return(entity this);
 
+// in case button is deactivated by a relay_deactivate while it pressed down
+// set both fields to -1 in button_return!!
+.float wait_remaining;
+.float activation_time;
+
+void button_setactive(entity this, int astate)
+{
+       int oldstate = this.active;
+       if (astate == ACTIVE_TOGGLE)
+       {
+               if (this.active == ACTIVE_ACTIVE)
+                       this.active = ACTIVE_NOT;
+               else
+                       this.active = ACTIVE_ACTIVE;
+       }
+       else
+               this.active = astate;
+
+       if (this.active == ACTIVE_ACTIVE && oldstate == ACTIVE_NOT)
+       {
+               // button was deactivated while it was pressed
+               if (this.wait_remaining >= 0)
+               {
+                       this.nextthink =  this.wait_remaining + this.ltime;
+                       setthink(this, button_return);
+               }
+       }
+       else if (this.active == ACTIVE_NOT && oldstate == ACTIVE_ACTIVE)
+       {
+               // check if button is in pressed state
+               if (this.activation_time >= 0)
+               {
+                       this.wait_remaining = this.wait - (time - this.activation_time);
+               }
+       }
+}
+
 void button_wait(entity this)
 {
        this.state = STATE_TOP;
@@ -24,11 +61,17 @@ void button_done(entity this)
 
 void button_return(entity this)
 {
+       if (this.active != ACTIVE_ACTIVE)
+       {
+               return;
+       }
        this.state = STATE_DOWN;
        SUB_CalcMove (this, this.pos1, TSPEED_LINEAR, this.speed, button_done);
        this.frame = 0;                 // use normal textures
        if (GetResourceAmount(this, RESOURCE_HEALTH))
                this.takedamage = DAMAGE_YES;   // can be shot again
+       this.wait_remaining = -1;
+       this.activation_time = -1;
 }
 
 
@@ -46,6 +89,8 @@ void button_fire(entity this)
        if (this.state == STATE_UP || this.state == STATE_TOP)
                return;
 
+       this.activation_time = time;
+
        if (this.noise != "")
                _sound (this, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
 
@@ -60,6 +105,9 @@ void button_reset(entity this)
        this.frame = 0;                 // use normal textures
        this.state = STATE_BOTTOM;
        this.velocity = '0 0 0';
+       this.wait_remaining = -1;
+       this.activation_time = -1;
+       this.active = ACTIVE_ACTIVE;
        setthink(this, func_null);
        this.nextthink = 0;
        if (GetResourceAmount(this, RESOURCE_HEALTH))
@@ -77,6 +125,8 @@ void button_use(entity this, entity actor, entity trigger)
 
 void button_touch(entity this, entity toucher)
 {
+       if (this.active != ACTIVE_ACTIVE)
+               return;
        if (!toucher)
                return;
        if (!toucher.iscreature)
@@ -91,6 +141,8 @@ void button_touch(entity this, entity toucher)
 
 void button_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
 {
+       if (this.active != ACTIVE_ACTIVE)
+               return;
        if(this.spawnflags & NOSPLASH)
                if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
                        return;
@@ -157,9 +209,10 @@ spawnfunc(func_button)
     if(this.noise != "")
         precache_sound(this.noise);
 
-       this.active = ACTIVE_ACTIVE;
        this.draggable = drag_undraggable;
 
+       this.setactive = button_setactive;
+
        this.pos1 = this.origin;
        this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
     this.flags |= FL_NOTARGET;
index d278ca9d444b052f4a2a9a3151321be48b78460f..003cd3abc6c258378eaf04be3eb2caa62cbf6b13 100644 (file)
@@ -36,7 +36,7 @@ void W_OverkillHeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity
        }
 
        float okhmg_spread = bound(WEP_CVAR_PRI(okhmg, spread_min), WEP_CVAR_PRI(okhmg, spread_min) + (WEP_CVAR_PRI(okhmg, spread_add) * actor.(weaponentity).misc_bulletcounter), WEP_CVAR_PRI(okhmg, spread_max));
-       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, okhmg_spread, WEP_CVAR_PRI(okhmg, solidpenetration), WEP_CVAR_PRI(okhmg, damage), WEP_CVAR_PRI(okhmg, force), WEP_OVERKILL_HMG.m_id, 0);
+       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, okhmg_spread, WEP_CVAR_PRI(okhmg, solidpenetration), WEP_CVAR_PRI(okhmg, damage), WEP_CVAR_PRI(okhmg, force), WEP_OVERKILL_HMG.m_id, EFFECT_RIFLE);
 
        actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1;
 
index 63c1e245b4ad1121cfbf593ac4e563da67c6b2b0..27502a75985dc28b90eb529ba3b787aec0fa3bdf 100644 (file)
@@ -30,7 +30,7 @@ void W_OverkillMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weap
        }
 
        okmachinegun_spread = bound(WEP_CVAR_PRI(okmachinegun, spread_min), WEP_CVAR_PRI(okmachinegun, spread_min) + (WEP_CVAR_PRI(okmachinegun, spread_add) * actor.(weaponentity).misc_bulletcounter), WEP_CVAR_PRI(okmachinegun, spread_max));
-       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, okmachinegun_spread, WEP_CVAR_PRI(okmachinegun, solidpenetration), WEP_CVAR_PRI(okmachinegun, damage), WEP_CVAR_PRI(okmachinegun, force), WEP_OVERKILL_MACHINEGUN.m_id, 0);
+       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, okmachinegun_spread, WEP_CVAR_PRI(okmachinegun, solidpenetration), WEP_CVAR_PRI(okmachinegun, damage), WEP_CVAR_PRI(okmachinegun, force), WEP_OVERKILL_MACHINEGUN.m_id, EFFECT_RIFLE);
 
        actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1;
 
@@ -153,4 +153,3 @@ METHOD(OverkillMachineGun, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-
index d8c79e3f2e1e20fae5f4048ca6d35e3b58b0b696..2461ba0cb09dd1098019bd1929a08fccbf6accbb 100644 (file)
@@ -55,7 +55,8 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea
                        WEP_CVAR_PRI(okshotgun, bullets),
                        WEP_CVAR_PRI(okshotgun, spread),
                        WEP_CVAR_PRI(okshotgun, solidpenetration),
-                       WEP_CVAR_PRI(okshotgun, force));
+                       WEP_CVAR_PRI(okshotgun, force),
+                       EFFECT_RIFLE_WEAK);
                weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(okshotgun, animtime), w_ready);
                return;
        }
index 619d7a9072d9a1e127e8e4698caa0c99bd8fc6f2..a56e7de3833a6fe4d997cda5fa4081de332c95c8 100644 (file)
@@ -17,7 +17,7 @@ METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, .ent
             actor.tur_head = actor;
             weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready);
         }
-        fireBullet (actor, weaponentity, actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_MACHINEGUN.m_id, 0);
+        fireBullet(actor, weaponentity, actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_MACHINEGUN.m_id, EFFECT_BULLET);
         W_MachineGun_MuzzleFlash(actor, weaponentity);
         setattachment(actor.(weaponentity).muzzle_flash, actor.tur_head, "tag_fire");
     }
index d81b738ed4510b8565584752f76c50c785765471..bbe59aeac90aeca4980be687fb8257eb60ae545e 100644 (file)
@@ -16,7 +16,7 @@ METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, .entity
             weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
         }
         sound (actor, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
-        fireBullet (actor, weaponentity, actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_WALK_GUN.m_id, 0);
+        fireBullet(actor, weaponentity, actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_WALK_GUN.m_id, EFFECT_BULLET);
         Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1);
     }
 }
index 7352e1dbb4ec89674d4fd45c43534adf36e5fe28..323b025e0ebb5769d434004073a1fb04598176c5 100644 (file)
@@ -264,7 +264,7 @@ bool spiderbot_frame(entity this, float dt)
 
                        .entity weaponentity = weaponentities[0]; // TODO: unhardcode
                        fireBullet(this, weaponentity, v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
-                               autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0);
+                               autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, EFFECT_BULLET);
 
                        sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
                        //trailparticles(this, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
index a73f2416122c0ac170188766152d9750fa9a91eb..190dddd394f0c2fb19df422b633c08d258bd2e63 100644 (file)
@@ -61,9 +61,9 @@ void W_MachineGun_Attack(Weapon thiswep, int deathtype, entity actor, .entity we
        ATTACK_FINISHED(actor, slot) = time + WEP_CVAR(machinegun, first_refire) * W_WeaponRateFactor(actor);
 
        if(actor.(weaponentity).misc_bulletcounter == 1)
-               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, first_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, first_damage), WEP_CVAR(machinegun, first_force), deathtype, 0);
+               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, first_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, first_damage), WEP_CVAR(machinegun, first_force), deathtype, EFFECT_BULLET);
        else
-               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), deathtype, 0);
+               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), deathtype, EFFECT_BULLET);
 
        Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
@@ -137,7 +137,7 @@ void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity
        }
 
        machinegun_spread = bound(WEP_CVAR(machinegun, spread_min), WEP_CVAR(machinegun, spread_min) + (WEP_CVAR(machinegun, spread_add) * actor.(weaponentity).misc_bulletcounter), WEP_CVAR(machinegun, spread_max));
-       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, machinegun_spread, WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), thiswep.m_id, 0);
+       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, machinegun_spread, WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), thiswep.m_id, EFFECT_BULLET);
 
        actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1;
 
@@ -166,7 +166,7 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, .entity weaponentit
                actor.punchangle_y = random() - 0.5;
        }
 
-       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_speed), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), thiswep.m_id, 0);
+       fireBullet(actor, weaponentity, w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_speed), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), thiswep.m_id, EFFECT_BULLET);
 
        Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
index 3230b4e12e0a38ba758606d2d853622f2b2b9652..bf9900b97257f1a5846db7d82ed20a2feecff66a 100644 (file)
@@ -19,7 +19,7 @@ void W_Rifle_FireBullet(Weapon thiswep, .entity weaponentity, float pSpread, flo
        }
 
        for(i = 0; i < pShots; ++i)
-               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE));
+               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EFFECT_RIFLE : EFFECT_RIFLE_WEAK));
 
        if(autocvar_g_casings >= 2)
     {
index b5881cad13e64fbadc92f3225ce16ab9892d8afc..4a3ab170343eb5cb233b30e92803a93c2e934904 100644 (file)
@@ -2,14 +2,13 @@
 
 #ifdef SVQC
 
-void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float isprimary, float ammocount, float damage, float bullets, float spread, float solidpenetration, float force)
+void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float isprimary, float ammocount, float damage, float bullets, float spread, float solidpenetration, float force, entity bullet_trail_effect)
 {
        W_DecreaseAmmo(thiswep, actor, ammocount, weaponentity);
 
        W_SetupShot(actor, weaponentity, true, 5, SND_SHOTGUN_FIRE, ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), damage * bullets, thiswep.m_id);
        for(int sc = 0;sc < bullets;sc = sc + 1)
-               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration, damage, force, thiswep.m_id, 0);
-
+               fireBullet(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration, damage, force, thiswep.m_id, bullet_trail_effect);
 
        Send_Effect(EFFECT_SHOTGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, ammocount);
 
@@ -159,7 +158,8 @@ void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, .entity weaponentity
                WEP_CVAR_PRI(shotgun, bullets),
                WEP_CVAR_PRI(shotgun, spread),
                WEP_CVAR_PRI(shotgun, solidpenetration),
-               WEP_CVAR_PRI(shotgun, force)); // actually is secondary, but we trick the last shot into playing full reload sound
+               WEP_CVAR_PRI(shotgun, force),
+               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)
@@ -178,7 +178,8 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity
                WEP_CVAR_PRI(shotgun, bullets),
                WEP_CVAR_PRI(shotgun, spread),
                WEP_CVAR_PRI(shotgun, solidpenetration),
-               WEP_CVAR_PRI(shotgun, force));
+               WEP_CVAR_PRI(shotgun, force),
+               EFFECT_BULLET_WEAK);
        weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), W_Shotgun_Attack3_Frame2);
 }
 
@@ -215,7 +216,8 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit
                                                WEP_CVAR_PRI(shotgun, bullets),
                                                WEP_CVAR_PRI(shotgun, spread),
                                                WEP_CVAR_PRI(shotgun, solidpenetration),
-                                               WEP_CVAR_PRI(shotgun, force));
+                                               WEP_CVAR_PRI(shotgun, force),
+                                               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);
                 }
@@ -233,7 +235,8 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit
                                                WEP_CVAR_PRI(shotgun, bullets),
                                                WEP_CVAR_PRI(shotgun, spread),
                                                WEP_CVAR_PRI(shotgun, solidpenetration),
-                                               WEP_CVAR_PRI(shotgun, force));
+                                               WEP_CVAR_PRI(shotgun, force),
+                                               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 b023180a138b1a9cca08235f950e8e81d633b17b..570d976db1d664505d01f6484fdaab7db7fa518d 100644 (file)
@@ -336,7 +336,7 @@ void fireBullet_trace_callback(vector start, vector hit, vector end)
        fireBullet_last_hit = NULL;
 }
 
-void fireBullet(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects)
+void fireBullet(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, entity tracer_effect)
 {
        vector  end;
 
@@ -344,16 +344,11 @@ void fireBullet(entity this, .entity weaponentity, vector start, vector dir, flo
        end = start + dir * max_shot_distance;
 
        fireBullet_last_hit = NULL;
+       fireBullet_trace_callback_eff = tracer_effect;
+
        float solid_penetration_left = 1;
        float total_damage = 0;
 
-       if(tracereffects & EF_RED)
-               fireBullet_trace_callback_eff = EFFECT_RIFLE;
-       else if(tracereffects & EF_BLUE)
-               fireBullet_trace_callback_eff = EFFECT_RIFLE_WEAK;
-       else
-               fireBullet_trace_callback_eff = EFFECT_BULLET;
-
        float lag = ((IS_REAL_CLIENT(this)) ? ANTILAG_LATENCY(this) : 0);
        if(lag < 0.001)
                lag = 0;
index 9224a970cf7b8cdfacf25edb582eb5b8adb75d54..9e39ecc350aef29a8fe369baaba53ff513aa4a49 100644 (file)
@@ -57,4 +57,4 @@ void FireRailgunBullet (entity this, .entity weaponentity, vector start, vector
 entity fireBullet_trace_callback_eff;
 entity fireBullet_last_hit;
 void fireBullet_trace_callback(vector start, vector hit, vector end);
-void fireBullet(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects);
+void fireBullet(entity this, .entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, entity tracer_effect);
index d9155c2237b5b8f2e8d5582c6dc88e7834e906ce..2156c89b4a3e1ad21e4ab201c2f16345b44d4268 100644 (file)
@@ -5,6 +5,7 @@
 #include "../command/common.qh"
 #include <server/mutators/_mod.qh>
 #include "../round_handler.qh"
+#include <server/cheats.qh>
 #include <server/resources.qh>
 #include <common/t_items.qh>
 #include <common/animdecide.qh>