Game-Design / Sprint3_actual / Everything_NPC / OldWomanPhases / BossHealthHandler.cs
BossHealthHandler.cs
Raw
using System;
using System.Collections.Generic;
using System.Text;
using Sprint3_actual.BorderElements;

namespace Sprint3_actual.Everything_NPC.OldWomanPhases
{
    public class BossHealthHandler
    {
        private room room;
        private Game1 game;
        private int roomXMod, roomYMod;
        private int health;
        public BossHealthHandler(room room, Game1 game, int roomXMod, int roomYMod)
        {
            this.room = room;
            this.game = game;
            this.roomXMod = roomXMod;
            this.roomYMod = roomYMod;
            this.health = 6;
            room.Addons[1] = BorderElementsFactory.Instance.CreateHealthbar(216 + roomXMod, roomYMod, health);
        }

        public void TakeDamage()
        {
            if (health > 0)
            {
                this.health--;
            }
            room.Addons[1] = BorderElementsFactory.Instance.CreateHealthbar(216 + roomXMod, roomYMod, health);

        }

        public int CurrentHealth()
        {
            return health;
        }

        public bool ZeroHealth()
        {
            return health == 0;
        }
    }
}