Skip to content

Instantly share code, notes, and snippets.

@codeimpossible
Created April 24, 2013 02:06
Show Gist options
  • Save codeimpossible/5449054 to your computer and use it in GitHub Desktop.
Save codeimpossible/5449054 to your computer and use it in GitHub Desktop.
var hitBy = WeaponManager.CheckIfHit( this );
if( hitBy != null )
{
Hud.KillStreak = 0;
var damageAfterShields = Shields.AbsorbDamage( hitBy.Damage );
// huh, this is a bug. Looks like you won't take damage if you have less shields than weapon damage
if( damageAfterShields == hitBy.Damage )
{
// shields didn't absorb damage
CurrentHealth -= damageAfterShields;
ParticleManager.Effects[ "LASER_HIT" ].Trigger( hitBy.Position );
if( hitBy.IsCritical )
{
ParticleManager.Effects[ "CRITICAL_HIT" ].Trigger( hitBy.Position );
}
_damageSinceLastUpdate += damageAfterShields;
}
else
{
ParticleManager.Effects[ "SHIELD_HIT" ].Trigger( Position );
ParticleManager.Effects[ "LASER_HIT" ].Trigger( hitBy.Position );
}
hitBy.Kill();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment