]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into drjaska/spread-pattern drjaska/spread-pattern 1169/head
authordrjaska <drjaska83@gmail.com>
Wed, 22 May 2024 09:14:10 +0000 (12:14 +0300)
committerdrjaska <drjaska83@gmail.com>
Wed, 22 May 2024 09:14:10 +0000 (12:14 +0300)
1  2 
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
qcsrc/common/mutators/mutator/overkill/okshotgun.qc
qcsrc/common/mutators/mutator/overkill/okshotgun.qh
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/shotgun.qh

Simple merge
Simple merge
Simple merge
diff --cc bal-wep-xdf.cfg
Simple merge
Simple merge
index 87f508724b6503e1d6e6430bec627fc8d5701c12,7fae9ad30b1c7e11fdb9a77e198e88c23a73897c..301ed4d9ea969621af3c578c8a7b69256bb2acb1
@@@ -50,12 -50,14 +50,16 @@@ METHOD(OverkillShotgun, wr_think, void(
                W_Shotgun_Attack(thiswep, actor, weaponentity, true,
                        WEP_CVAR_PRI(okshotgun, ammo),
                        WEP_CVAR_PRI(okshotgun, damage),
+                       WEP_CVAR_PRI(okshotgun, damagefalloff_halflife),
+                       WEP_CVAR_PRI(okshotgun, damagefalloff_mindist),
+                       WEP_CVAR_PRI(okshotgun, damagefalloff_maxdist),
                        WEP_CVAR_PRI(okshotgun, bullets),
                        WEP_CVAR_PRI(okshotgun, spread),
 +                      WEP_CVAR_PRI(okshotgun, spread_pattern),
 +                      WEP_CVAR_PRI(okshotgun, spread_pattern_scale),
                        WEP_CVAR_PRI(okshotgun, solidpenetration),
                        WEP_CVAR_PRI(okshotgun, force),
+                       WEP_CVAR_PRI(okshotgun, damagefalloff_forcehalflife),
                        EFFECT_RIFLE_WEAK);
                weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(okshotgun, animtime), w_ready);
                return;
index e17660849e1c86fe08a910f9a7d78beface94d80,89bdf2a36fc1f7f720d9ac15a8cb5de0b860087e..b28e3c96a090806cac04a8c5aa8f610298a480d0
@@@ -5,7 -5,11 +5,14 @@@
  // enable to debug melee range
  //#define SHOTGUN_MELEEDEBUG
  
- void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float isprimary, float ammocount, float damage, float bullets, float spread, float spread_pattern, float spread_pattern_scale, float solidpenetration, float force, entity bullet_trail_effect)
+ void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity,
+                       float isprimary, float ammocount, float damage,
+                       float falloff_halflife, float falloff_mindist, float falloff_maxdist,
 -                      float bullets, float spread, float solidpenetration,
 -                      float force, float falloff_forcehalflife, entity bullet_trail_effect)
++                      float bullets, float spread,
++                      float spread_pattern, float spread_pattern_scale,
++                      float solidpenetration,
++                      float force, float falloff_forcehalflife,
++                      entity bullet_trail_effect)
  {
        W_DecreaseAmmo(thiswep, actor, ammocount, weaponentity);
  
        if(lag && bullets > 0)
                antilag_takeback_all(actor, lag);
  
 -      for(int sc = 0;sc < bullets;sc = sc + 1)
 -              fireBullet_falloff(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration,
 -                      damage, falloff_halflife, falloff_mindist, falloff_maxdist, 0, force,
 -                      falloff_forcehalflife, thiswep.m_id, bullet_trail_effect, false);
 +      if (spread_pattern && spread_pattern_scale > 0)
 +      {
 +              vector right, up;
 +              right = v_right;
 +              up = v_up;
 +
 +              float fixed_spread_factor = (spread * autocvar_g_weaponspreadfactor) / spread_pattern_scale;
 +
 +              for(int sc = 0; sc < bullets; ++sc)
 +              {
 +                      vector s = W_CalculateSpreadPattern(spread_pattern, sc, bullets);
 +                      s = s * fixed_spread_factor;
-                       fireBullet_antilag(actor, weaponentity, w_shotorg, w_shotdir + right * s.y + up * s.z, 0, solidpenetration, damage, 0, force, thiswep.m_id, bullet_trail_effect, false);
++                      fireBullet_falloff(actor, weaponentity,
++                                         w_shotorg, w_shotdir + right * s.y + up * s.z,
++                                         0, solidpenetration, damage,
++                                         falloff_halflife, falloff_mindist, falloff_maxdist,
++                                         0, force, falloff_forcehalflife,
++                                         thiswep.m_id, bullet_trail_effect, false);
 +              }
 +      }
 +      else
 +              for(int sc = 0; sc < bullets; ++sc)
-                       fireBullet_antilag(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration, damage, 0, force, thiswep.m_id, bullet_trail_effect, false);
++                      fireBullet_falloff(actor, weaponentity,
++                              w_shotorg, w_shotdir,
++                              spread, solidpenetration, damage,
++                              falloff_halflife, falloff_mindist, falloff_maxdist,
++                              0, force, falloff_forcehalflife,
++                              thiswep.m_id, bullet_trail_effect, false);
  
        if(lag && bullets > 0)
                antilag_restore_all(actor);
@@@ -179,12 -171,14 +198,16 @@@ void W_Shotgun_Attack3_Frame2(Weapon th
        W_Shotgun_Attack(thiswep, actor, weaponentity, true,
                WEP_CVAR_PRI(shotgun, ammo),
                WEP_CVAR_PRI(shotgun, damage),
+               WEP_CVAR_PRI(shotgun, damagefalloff_halflife),
+               WEP_CVAR_PRI(shotgun, damagefalloff_mindist),
+               WEP_CVAR_PRI(shotgun, damagefalloff_maxdist),
                WEP_CVAR_PRI(shotgun, bullets),
                WEP_CVAR_PRI(shotgun, spread),
 +              WEP_CVAR_PRI(shotgun, spread_pattern),
 +              WEP_CVAR_PRI(shotgun, spread_pattern_scale),
                WEP_CVAR_PRI(shotgun, solidpenetration),
                WEP_CVAR_PRI(shotgun, force),
+               WEP_CVAR_PRI(shotgun, damagefalloff_forcehalflife),
                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);
  }
@@@ -201,12 -195,14 +224,16 @@@ void W_Shotgun_Attack3_Frame1(Weapon th
        W_Shotgun_Attack(thiswep, actor, weaponentity, false,
                WEP_CVAR_PRI(shotgun, ammo),
                WEP_CVAR_PRI(shotgun, damage),
+               WEP_CVAR_PRI(shotgun, damagefalloff_halflife),
+               WEP_CVAR_PRI(shotgun, damagefalloff_mindist),
+               WEP_CVAR_PRI(shotgun, damagefalloff_maxdist),
                WEP_CVAR_PRI(shotgun, bullets),
                WEP_CVAR_PRI(shotgun, spread),
 +              WEP_CVAR_PRI(shotgun, spread_pattern),
 +              WEP_CVAR_PRI(shotgun, spread_pattern_scale),
                WEP_CVAR_PRI(shotgun, solidpenetration),
                WEP_CVAR_PRI(shotgun, force),
+               WEP_CVAR_PRI(shotgun, damagefalloff_forcehalflife),
                EFFECT_BULLET_WEAK);
        weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), W_Shotgun_Attack3_Frame2);
  }
@@@ -244,12 -240,14 +271,16 @@@ METHOD(Shotgun, wr_think, void(entity t
                      W_Shotgun_Attack(thiswep, actor, weaponentity, true,
                                                WEP_CVAR_PRI(shotgun, ammo),
                                                WEP_CVAR_PRI(shotgun, damage),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_halflife),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_mindist),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_maxdist),
                                                WEP_CVAR_PRI(shotgun, bullets),
                                                WEP_CVAR_PRI(shotgun, spread),
 +                                              WEP_CVAR_PRI(shotgun, spread_pattern),
 +                                              WEP_CVAR_PRI(shotgun, spread_pattern_scale),
                                                WEP_CVAR_PRI(shotgun, solidpenetration),
                                                WEP_CVAR_PRI(shotgun, force),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_forcehalflife),
                                                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);
                      W_Shotgun_Attack(thiswep, actor, weaponentity, false,
                                                WEP_CVAR_PRI(shotgun, ammo),
                                                WEP_CVAR_PRI(shotgun, damage),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_halflife),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_mindist),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_maxdist),
                                                WEP_CVAR_PRI(shotgun, bullets),
                                                WEP_CVAR_PRI(shotgun, spread),
 +                                              WEP_CVAR_PRI(shotgun, spread_pattern),
 +                                              WEP_CVAR_PRI(shotgun, spread_pattern_scale),
                                                WEP_CVAR_PRI(shotgun, solidpenetration),
                                                WEP_CVAR_PRI(shotgun, force),
+                                               WEP_CVAR_PRI(shotgun, damagefalloff_forcehalflife),
                                                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);