Exemplo n.º 1
0
 public void Equip(AbsEquipment obj)
 {
     if (Gear[obj.Slot] != null)
     {
         throw new Exception("Weapon slot you are trying to use is full!");
     }
     Gear[obj.Slot] = obj;
     AttackStat    += obj.AttackStat;
     DefenseStat   += obj.DefenseStat;
 }
Exemplo n.º 2
0
 public void DeEquip(AbsEquipment obj)
 {
     if (Gear[obj.Slot] == null)
     {
         throw new Exception("Weapon slot you are trying to remove weapon from is empty!");
     }
     AttackStat    -= obj.AttackStat;
     DefenseStat   -= obj.DefenseStat;
     Gear[obj.Slot] = null;
 }
Exemplo n.º 3
0
        public Player(int posX, int posY)
        {
            idMutex.WaitOne();
            id++;
            Id = id;
            idMutex.ReleaseMutex();

            Hp        = MAX_PLAYER_HP;
            Gear      = new AbsEquipment[6];
            Inventory = new List <AbsItem>();

            PosX = posX;
            PosY = posY;

            EntityState = State.Alive;
        }
Exemplo n.º 4
0
 public AbsEquipmentDecorator(AbsEquipment Equipbase)
 {
     baseEquipment = Equipbase;
 }
 public EnchantedWeapon(AbsEquipment Equipbase) : base(Equipbase)
 {
     AttackStat = baseEquipment.AttackStat + 2;
 }