Beispiel #1
0
        public static Defence CreateUsualDefence(int playerLevel)
        {
            Defence defence = new Defence();

            defence.defence = random.Next(defence.defence * playerLevel / 2 + 2, defence.defence * playerLevel + 2);
            float i = (float)random.NextDouble();

            if (i < 0.33f)
            {
                defence.currentType = Defence.type.legs;
                defence.name        = defence.name + " legs " + random.Next(999);
                //defence.texture = new Texture(legsTextures[random.Next(legsTextures.Count)]);
            }
            else if (i > 0.33f && i < 0.66f)
            {
                defence.currentType = Defence.type.body;
                defence.name        = defence.name + " body " + random.Next(999);
                defence.texture     = new Texture(bodyTextures[random.Next(bodyTextures.Count)]);
            }
            else if (i > 0.66f)
            {
                defence.currentType = Defence.type.head;
                defence.name        = defence.name + " head " + random.Next(999);
                defence.texture     = new Texture(headTextures[random.Next(headTextures.Count)]);
            }
            return(defence);
        }
Beispiel #2
0
        public void TakeOn(Defence def)
        {
            switch (def.currentType)
            {
            case Defence.type.body:
                if (body != null)
                {
                    defences.Add(body);
                }
                body = def;
                break;

            case Defence.type.head:
                if (head != null)
                {
                    defences.Add(head);
                }
                head = def;
                break;

            case Defence.type.legs:
                if (legs != null)
                {
                    defences.Add(legs);
                }
                legs = def;
                break;

            default:
                break;
            }
            defences.Remove(def);
            UpdateDefenceStats();
        }
Beispiel #3
0
        public void TakeOff(Defence.type def)
        {
            switch (def)
            {
            case Defence.type.body:
                defences.Add(body);
                body = null;
                break;

            case Defence.type.head:
                defences.Add(head);
                head = null;
                break;

            case Defence.type.legs:
                defences.Add(legs);
                legs = null;
                break;

            default:
                break;
            }
            UpdateDefenceStats();
        }
Beispiel #4
0
 private void AddPropertiesDefence(Defence def)
 {
     level.currentMaxDefence += def.defence;
     level.currenMaxHp       += def.addictiveHp;
 }
Beispiel #5
0
 public void Take(Defence def)
 {
     defences.Add(def);
 }