X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fdevastator.qc;h=2337e6273370acf237605d172c0433d7ee965a8f;hb=bb4ef7788ddb76a945d9b100593c3c008d0b1711;hp=1569ba59cefea82d3ecb51aee9997ced564822ed;hpb=5d929ee0b1dc587e3154a4fa4b56e83b9ba9100b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 1569ba59ce..2337e62733 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -47,7 +47,7 @@ void W_Devastator_Explode(entity this, entity directhitentity) if(this.realowner.(weaponentity).m_weapon == thiswep) { if(GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(devastator, ammo)) - if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO)) + if(!(this.realowner.items & IT_UNLIMITED_AMMO)) { this.realowner.cnt = thiswep.m_id; ATTACK_FINISHED(this.realowner, weaponentity) = time; @@ -71,8 +71,11 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity) bool handled_as_rocketjump = false; entity head = NULL; + bool allow_rocketjump = WEP_CVAR(devastator, remote_jump); + MUTATOR_CALLHOOK(AllowRocketJumping, allow_rocketjump); + allow_rocketjump = M_ARGV(0, bool); - if(WEP_CVAR(devastator, remote_jump_radius)) + if(allow_rocketjump && WEP_CVAR(devastator, remote_jump_radius)) { head = WarpZone_FindRadius( this.origin, @@ -140,7 +143,7 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity) if(this.realowner.(weaponentity).m_weapon == thiswep) { if(GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(devastator, ammo)) - if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO)) + if(!(this.realowner.items & IT_UNLIMITED_AMMO)) { this.realowner.cnt = thiswep.m_id; ATTACK_FINISHED(this.realowner, weaponentity) = time; @@ -305,7 +308,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int W_DecreaseAmmo(thiswep, actor, WEP_CVAR(devastator, ammo), weaponentity); W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage), thiswep.m_id); - Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); entity missile = WarpZone_RefSys_SpawnSameRefSys(actor); missile.weaponentity_fld = weaponentity; @@ -314,7 +317,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int if(WEP_CVAR(devastator, detonatedelay) >= 0) missile.spawnshieldtime = time + WEP_CVAR(devastator, detonatedelay); else - missile.spawnshieldtime = -1; + missile.spawnshieldtime = -1; // NOTE: proximity based when rocket jumping missile.pushltime = time + WEP_CVAR(devastator, guidedelay); missile.classname = "rocket"; missile.bot_dodge = true; @@ -322,7 +325,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int missile.takedamage = DAMAGE_YES; missile.damageforcescale = WEP_CVAR(devastator, damageforcescale); - SetResource(missile, RES_HEALTH, WEP_CVAR(devastator, health)); + SetResourceExplicit(missile, RES_HEALTH, WEP_CVAR(devastator, health)); missile.event_damage = W_Devastator_Damage; missile.damagedbycontents = true; IL_PUSH(g_damagedbycontents, missile); @@ -348,13 +351,6 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound - // muzzle flash for 1st person view - entity flash = spawn(); - setmodel(flash, MDL_DEVASTATOR_MUZZLEFLASH); // precision set below - SUB_SetFade(flash, time, 0.1); - flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION; - W_AttachToShotorg(actor, weaponentity, flash, '5 0 0'); - // common properties MUTATOR_CALLHOOK(EditProjectile, actor, missile); @@ -398,7 +394,7 @@ METHOD(Devastator, wr_aim, void(entity thiswep, entity actor, .entity weaponenti }); float desirabledamage; desirabledamage = enemydamage; - if(time > actor.invincible_finished && time > actor.spawnshieldtime) + if(StatusEffects_active(STATUSEFFECT_Shield, actor) && !StatusEffects_active(STATUSEFFECT_SpawnShield, actor)) desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent; if(teamplay && actor.team) desirabledamage = desirabledamage - teamdamage;