Exemplo n.º 1
0
 public void TakeDamage(float amount, eDamageType damageType, WeaponModifiers wpnMods)
 {
     amount          *= Utils.GetDmgModifier(damageType, Armor);
     HP.CurrentHP    -= amount;
     HPBar.Percentage = HP.LifeLeftPercentage;
     if (HP.CurrentHP <= 0)
     {
         Die();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Melee constructor
 /// </summary>
 /// <param name="range"></param>
 /// <param name="attackDelay"></param>
 /// <param name="damage"></param>
 /// <param name="projectileType"></param>
 /// <param name="splash"></param>
 /// <param name="splashDmgPerc"></param>
 public WeaponStruct(int range, int attackDelay, float damage, int splash, int splashDmgPerc, eAttackableTargets attackableTargets)
 {
     Range                 = range;
     AttackDelay           = attackDelay;
     CritChance            = 0;
     CritMultiplier        = 2;
     Damage                = damage;
     ProjectileType        = eProjectile.None;
     Splash                = splash;
     SplashDmgPerc         = splashDmgPerc;
     IsMelee               = true;
     AttackableTargets     = attackableTargets;
     ProjectileSpawnOffset = Common.InvalidVector2;
     DamageType            = eDamageType.Normal;
     ShootFX               = ImpactFX = -1;
     WeaponModifiers       = new WeaponModifiers();
 }