X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fvortex.qc;h=b8963229710e23266cba03cb023c2a443773d6b1;hb=bc3f297ed082b23fb33dd0d8f5dcd33bb0198507;hp=60557cbf8d42211602f985a6ba32da1c22551fa1;hpb=20b1203291c8a0592aee1bf4ada82cfe05305c4a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 60557cbf8..b89632297 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -38,21 +38,16 @@ void SendCSQCVortexBeamParticle(float charge) { vector v; v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); WriteHeader(MSG_BROADCAST, TE_CSQC_VORTEXBEAMPARTICLE); - WriteCoord(MSG_BROADCAST, w_shotorg.x); - WriteCoord(MSG_BROADCAST, w_shotorg.y); - WriteCoord(MSG_BROADCAST, w_shotorg.z); - WriteCoord(MSG_BROADCAST, v.x); - WriteCoord(MSG_BROADCAST, v.y); - WriteCoord(MSG_BROADCAST, v.z); + WriteVector(MSG_BROADCAST, w_shotorg); + WriteVector(MSG_BROADCAST, v); WriteByte(MSG_BROADCAST, bound(0, 255 * charge, 255)); } #elif defined(CSQC) NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew) { - vector shotorg, endpos; float charge; - shotorg.x = ReadCoord(); shotorg.y = ReadCoord(); shotorg.z = ReadCoord(); - endpos.x = ReadCoord(); endpos.y = ReadCoord(); endpos.z = ReadCoord(); + vector shotorg = ReadVector(); + vector endpos = ReadVector(); charge = ReadByte() / 255.0; pointparticles(EFFECT_VORTEX_MUZZLEFLASH, shotorg, normalize(endpos - shotorg) * 1000, 1); @@ -110,6 +105,10 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i myforcehalflife = WEP_CVAR_BOTH(vortex, !issecondary, damagefalloff_forcehalflife); myammo = WEP_CVAR_BOTH(vortex, !issecondary, ammo); + float dtype = WEP_VORTEX.m_id; + if(WEP_CVAR_BOTH(vortex, !issecondary, armorpierce)) + dtype |= HITTYPE_ARMORPIERCE; + float flying; flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last @@ -125,7 +124,7 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i mydmg *= charge; myforce *= charge; - W_SetupShot(actor, weaponentity, true, 5, SND_NEXFIRE, CH_WEAPON_A, mydmg); + W_SetupShot(actor, weaponentity, true, 5, SND_NEXFIRE, CH_WEAPON_A, mydmg, dtype); if(charge > WEP_CVAR(vortex, charge_animlimit) && WEP_CVAR(vortex, charge_animlimit)) // if the Vortex is overcharged, we play an extra sound { sound(actor, CH_WEAPON_B, SND_NEXCHARGE, VOL_BASE * (charge - 0.5 * WEP_CVAR(vortex, charge_animlimit)) / (1 - 0.5 * WEP_CVAR(vortex, charge_animlimit)), ATTN_NORM); @@ -133,7 +132,7 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i yoda = 0; damage_goodhits = 0; - FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX.m_id); + FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, dtype); if(yoda && flying) Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); @@ -168,9 +167,6 @@ METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity if(WEP_CVAR(vortex, charge) && actor.(weaponentity).vortex_charge < WEP_CVAR(vortex, charge_limit)) actor.(weaponentity).vortex_charge = min(1, actor.(weaponentity).vortex_charge + WEP_CVAR(vortex, charge_rate) * frametime / W_TICSPERFRAME); - if(weaponslot(weaponentity) == 0) - actor.vortex_charge = actor.(weaponentity).vortex_charge; - if(WEP_CVAR_SEC(vortex, chargepool)) if(actor.(weaponentity).vortex_chargepool_ammo < 1) { @@ -179,9 +175,6 @@ METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity actor.pauseregen_finished = max(actor.pauseregen_finished, time + WEP_CVAR_SEC(vortex, chargepool_pause_regen)); } - if(weaponslot(weaponentity) == 0) - actor.vortex_chargepool_ammo = actor.(weaponentity).vortex_chargepool_ammo; - if(autocvar_g_balance_vortex_reload_ammo && actor.(weaponentity).clip_load < min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo))) { // forced reload thiswep.wr_reload(thiswep, actor, weaponentity); } else @@ -208,11 +201,11 @@ METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity if(WEP_CVAR_SEC(vortex, ammo)) { // always deplete if secondary is held - actor.vortex_chargepool_ammo = max(0, actor.vortex_chargepool_ammo - WEP_CVAR_SEC(vortex, ammo) * dt); + actor.(weaponentity).vortex_chargepool_ammo = max(0, actor.(weaponentity).vortex_chargepool_ammo - WEP_CVAR_SEC(vortex, ammo) * dt); dt = min(dt, (1 - actor.(weaponentity).vortex_charge) / WEP_CVAR(vortex, charge_rate)); actor.vortex_chargepool_pauseregen_finished = time + WEP_CVAR_SEC(vortex, chargepool_pause_regen); - dt = min(dt, actor.vortex_chargepool_ammo); + dt = min(dt, actor.(weaponentity).vortex_chargepool_ammo); dt = max(0, dt); actor.(weaponentity).vortex_charge += dt * WEP_CVAR(vortex, charge_rate); @@ -296,10 +289,6 @@ METHOD(Vortex, wr_checkammo2, bool(entity thiswep, entity actor, .entity weapone METHOD(Vortex, wr_resetplayer, void(entity thiswep, entity actor)) { if (WEP_CVAR(vortex, charge)) { - if (WEP_CVAR_SEC(vortex, chargepool)) { - actor.vortex_chargepool_ammo = 1; - } - actor.vortex_charge = WEP_CVAR(vortex, charge_start); for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { .entity weaponentity = weaponentities[slot]; @@ -358,5 +347,9 @@ METHOD(Vortex, wr_zoom, bool(entity thiswep, entity actor)) return false; } } +METHOD(Vortex, wr_zoomdir, bool(entity thiswep)) +{ + return button_attack2 && !WEP_CVAR(vortex, secondary); +} #endif