Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 public bool DidHit(Unit target, Weapon w)
 {
     return Game.Instance.RandomNumberGenerator.NextDouble() <= w.HitPct;
 }