Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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;
        }
Beispiel #4
0
 public AbsEquipmentDecorator(AbsEquipment Equipbase)
 {
     baseEquipment = Equipbase;
 }
 public EnchantedWeapon(AbsEquipment Equipbase) : base(Equipbase)
 {
     AttackStat = baseEquipment.AttackStat + 2;
 }