]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Lyberta/StandaloneOverkillWeapons
authorLyberta <lyberta@lyberta.net>
Fri, 16 Feb 2018 08:39:22 +0000 (11:39 +0300)
committerLyberta <lyberta@lyberta.net>
Fri, 16 Feb 2018 08:39:22 +0000 (11:39 +0300)
1  2 
qcsrc/client/view.qc
qcsrc/common/mutators/mutator/overkill/rpc.qc
qcsrc/common/wepent.qc
qcsrc/common/wepent.qh
qcsrc/server/client.qc
qcsrc/server/defs.qh

index b022ce2d45d42bef1a1b251b4209d75bb24630ef,7dcbd83d2b3c661db795119e6698424a5f4baa40..0bde0788d303b6ec276559a8777cb6bd9be9d540
@@@ -1193,34 -1191,27 +1193,29 @@@ void HUD_Crosshair(entity this
  
                                ring_scale = autocvar_crosshair_ring_size;
  
-                               float weapon_clipload, weapon_clipsize;
-                               weapon_clipload = STAT(WEAPON_CLIPLOAD);
-                               weapon_clipsize = STAT(WEAPON_CLIPSIZE);
-                               float vortex_charge, vortex_chargepool;
-                               vortex_charge = STAT(VORTEX_CHARGE);
-                               vortex_chargepool = STAT(VORTEX_CHARGEPOOL);
+                               entity wepent = viewmodels[0]; // TODO: unhardcode
  
-                               float oknex_charge, oknex_chargepool;
-                               oknex_charge = STAT(OVERKILL_NEX_CHARGE);
-                               oknex_chargepool = STAT(OVERKILL_NEX_CHARGEPOOL);
+                               int weapon_clipload = wepent.clip_load;
+                               int weapon_clipsize = wepent.clip_size;
  
-                               float arc_heat = STAT(ARC_HEAT);
+                               float arc_heat = wepent.arc_heat_percent;
+                               float vcharge = wepent.vortex_charge;
+                               float vchargepool = wepent.vortex_chargepool_ammo;
++                              float oknex_charge_ = wepent.oknex_charge;
++                              float oknex_chargepool_ = wepent.oknex_chargepool_ammo;
  
                                if(vortex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
-                                       vortex_charge_movingavg = vortex_charge;
-                               entity wepent = viewmodels[0]; // TODO: unhardcode
+                                       vortex_charge_movingavg = vcharge;
  
                                // handle the values
-                               if (autocvar_crosshair_ring && wepent.activeweapon == WEP_VORTEX && vortex_charge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex
+                               if (autocvar_crosshair_ring && wepent.activeweapon == WEP_VORTEX && vcharge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex
                                {
-                                       if (vortex_chargepool || use_vortex_chargepool) {
+                                       if (vchargepool || use_vortex_chargepool) {
                                                use_vortex_chargepool = 1;
-                                               ring_inner_value = vortex_chargepool;
+                                               ring_inner_value = vchargepool;
                                        } else {
-                                               vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * vortex_charge;
-                                               ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (vortex_charge - vortex_charge_movingavg), 1);
+                                               vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * vcharge;
+                                               ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (vcharge - vortex_charge_movingavg), 1);
                                        }
  
                                        ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha;
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring_nexgun.tga";
                                }
 +                              else if (autocvar_crosshair_ring && (wepent.activeweapon == WEP_OVERKILL_NEX) && oknex_charge && autocvar_crosshair_ring_vortex)
 +                              {
 +                                      if (oknex_chargepool || use_vortex_chargepool) {
 +                                              use_vortex_chargepool = 1;
 +                                              ring_inner_value = oknex_chargepool;
 +                                      } else {
 +                                              vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * oknex_charge;
 +                                              ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (oknex_charge - vortex_charge_movingavg), 1);
 +                                      }
 +
 +                                      ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha;
 +                                      ring_inner_rgb = eX * autocvar_crosshair_ring_vortex_inner_color_red + eY * autocvar_crosshair_ring_vortex_inner_color_green + eZ * autocvar_crosshair_ring_vortex_inner_color_blue;
 +                                      ring_inner_image = "gfx/crosshair_ring_inner.tga";
 +
 +                                      // draw the outer ring to show the current charge of the weapon
 +                                      ring_value = oknex_charge;
 +                                      ring_alpha = autocvar_crosshair_ring_vortex_alpha;
 +                                      ring_rgb = wcross_color;
 +                                      ring_image = "gfx/crosshair_ring_nexgun.tga";
 +                              }
                                else if (autocvar_crosshair_ring && wepent.activeweapon == WEP_MINE_LAYER && WEP_CVAR(minelayer, limit) && autocvar_crosshair_ring_minelayer)
                                {
-                                       ring_value = bound(0, STAT(LAYED_MINES) / WEP_CVAR(minelayer, limit), 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
+                                       ring_value = bound(0, wepent.minelayer_mines / WEP_CVAR(minelayer, limit), 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
                                        ring_alpha = autocvar_crosshair_ring_minelayer_alpha;
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring.tga";
index 545a6b4f6abe4ba6808a915833a62b966f2db4db,fc83febf1e02cd89fc53d7c127ced2b8b7f9c0b6..7f80268d8d7ddd9c4e49a1854262b24cace48cbd
@@@ -48,15 -48,15 +48,15 @@@ void W_RocketPropelledChainsaw_Think(en
                return;
        }
  
-       this.cnt = vlen(this.velocity);
-       this.wait = this.cnt * sys_frametime;
-       this.pos1 = normalize(this.velocity);
+       float myspeed = vlen(this.velocity);
+       float myspeed_accel = myspeed * sys_frametime;
+       vector mydir = normalize(this.velocity);
  
-       tracebox(this.origin, this.mins, this.maxs, this.origin + this.pos1 * (2 * this.wait), MOVE_NORMAL, this);
+       tracebox(this.origin, this.mins, this.maxs, this.origin + mydir * (2 * myspeed_accel), MOVE_NORMAL, this);
        if(IS_PLAYER(trace_ent))
 -              Damage (trace_ent, this, this.realowner, WEP_CVAR(rpc, damage2), this.projectiledeathtype, this.origin, normalize(this.origin - trace_ent.origin) * WEP_CVAR(rpc, force));
 +              Damage (trace_ent, this, this.realowner, WEP_CVAR_PRI(rpc, damage2), this.projectiledeathtype, this.origin, normalize(this.origin - other.origin) * WEP_CVAR_PRI(rpc, force));
  
-       this.velocity = this.pos1 * (this.cnt + (WEP_CVAR_PRI(rpc, speedaccel) * sys_frametime));
 -      this.velocity = mydir * (myspeed + (WEP_CVAR(rpc, speedaccel) * sys_frametime));
++      this.velocity = mydir * (myspeed + (WEP_CVAR_PRI(rpc, speedaccel) * sys_frametime));
  
        UpdateCSQCProjectile(this);
        this.nextthink = time;
Simple merge
index dcd08d45f099678706f70e2c71a8bd99819c5d0a,dbd38fc10f8916510d0ef3c37c624c0c4ef533c4..d6db7745b9fe1cc5e1ebc8f0f0edcfca78382214
@@@ -4,8 -4,13 +4,15 @@@ REGISTER_NET_LINKED(ENT_CLIENT_WEPENT
  REGISTER_NET_TEMP(CLIENT_WEPENT)
  
  .float vortex_charge;
+ .float vortex_chargepool_ammo;
 +.float oknex_charge;
++.float oknex_chargepool_ammo;
  .int tuba_instrument;
+ .int minelayer_mines;
+ .float arc_heat_percent;
+ .int hagar_load;
+ .int clip_load;
+ .int clip_size;
  
  #ifdef SVQC
  
Simple merge
index d52713c7c46aa7d677e518970321bde17f9d1f44,577753a509a9369ffbce77fb7ae751c6651cd8d6..7a71ff1e7bda3c0d997e9bbb20fd5dfcc6643492
@@@ -324,18 -324,15 +324,18 @@@ float client_cefc_accumulatortime
  
  .float weapon_load[Weapons_MAX];
  .int ammo_none; // used by the reloading system, must always be 0
- .float clip_load = _STAT(WEAPON_CLIPLOAD);
+ .float clip_load;
  .float old_clip_load;
- .float clip_size = _STAT(WEAPON_CLIPSIZE);
+ .float clip_size;
  
- .float minelayer_mines = _STAT(LAYED_MINES);
- .float vortex_charge = _STAT(VORTEX_CHARGE);
+ .int minelayer_mines;
+ .float vortex_charge;
  .float vortex_charge_rottime;
- .float vortex_chargepool_ammo = _STAT(VORTEX_CHARGEPOOL);
- .float oknex_charge = _STAT(OVERKILL_NEX_CHARGE);
+ .float vortex_chargepool_ammo;
++.float oknex_charge;
 +.float oknex_charge_rottime;
- .float oknex_chargepool_ammo = _STAT(OVERKILL_NEX_CHARGEPOOL);
- .float hagar_load = _STAT(HAGAR_LOAD);
++.float oknex_chargepool_ammo;
+ .int hagar_load;
  
  .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab