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