public static void RenderViewable(Weapon w) { GL.PushMatrix (); GL.Scale (.5f, .5f, .5f); GL.Translate (1, 1, 0); if (!Vbos.ContainsKey (w.Type)) { BaseRender.RenderViewable (w); } else { Vbos[w.Type].Draw(); } GL.PopMatrix(); }
public int GetReducedDamage(int input_damage, Weapon.DamageTypes type) { int output = MIN_DAMAGE; if (reductions.ContainsKey (type)) { output = (int)Math.Floor (reductions [type] * input_damage); } else { output = input_damage; } if (output < MIN_DAMAGE) { output = MIN_DAMAGE; } return output; }
public void TakeDamage(int damage, Weapon.DamageTypes type) { int reducedDamage = Armor.GetReducedDamage(damage,type); //TODO this should del in damage types and perhaps arm type aty some points this.health -= reducedDamage; }
public bool DidHit(Unit target, Weapon w) { return Game.Instance.RandomNumberGenerator.NextDouble() <= w.HitPct; }