Created
April 24, 2013 02:06
-
-
Save codeimpossible/5449054 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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