Пример #1
0
        public Character(Vector2 pos, int width, int height, int startingStatValue = 5, int maxStatValue = 25, int startingMaxHealth = 100, int maxHealthLimit = 500,
            int startingElementPoints = 0, int maxElementPoints = 100)
        {
            this.pos = pos;
            this.attack = this.defense = this.stamina = this.speed = startingStatValue;
            this.maxStatValue = maxStatValue;
            this.currentHealth = maxHealth = startingMaxHealth;
            this.maxHealthLimit = maxHealthLimit;

            this.normalForm = new NormalForm("Forms/normalForm", width, height);
            this.fireForm = new FireForm("Forms/fireForm", width, height);
            this.earthForm = new EarthForm("Forms/earthForm", width, height);
            this.waterForm = new WaterForm("Forms/waterForm", width, height);
            this.windForm = new WindForm("Forms/windForm", width, height);
            this.form = normalForm;

            this.damageTimeElapsed = damageInterval;
            this.damageStacked = 0;
            this.damageDigitWidth = width / 4;
            this.damageDigitHeight = this.damageDigitWidth * 3 / 2;
            this.score = 0;
        }
Пример #2
0
 private void ChangeForm(Form newForm)
 {
     if (newForm.Equals(normalForm))
     {
         form.DropElementalPoints();
     }
     else
     {
         // Restore health on elemental form change
         RecoverHealth(maxHealth / 4, currentHealth / 2);
     }
     form = newForm;
 }