Ejemplo n.º 1
0
 public void UnEquipWeapon(WeaponEquipPayload payload)
 {
     GD.Print("WeaponController - UnEquipWeapon");
     if (mainHand != null && mainHand.GetStats().weaponEquipType == WeaponEquipType.TWO_HANDS)
     {
         mainHand = null;
         offHand  = null;
     }
     else
     {
         if (payload.targetSlotType == WeaponSlotType.MAIN_HAND)
         {
             mainHand = null;
         }
         else if (payload.targetSlotType == WeaponSlotType.OFF_HAND)
         {
             offHand = null;
         }
     }
 }
Ejemplo n.º 2
0
        public void EquipWeapon(WeaponEquipPayload payload)
        {
            GD.Print("WeaponController - EquipWeapon");
            Weapon          weapon     = payload.equipable as Weapon;
            WeaponStats     weaponData = weapon.GetStats();
            WeaponEquipType equipType  = weaponData.weaponEquipType;

            if (equipType == WeaponEquipType.MAIN_HAND && payload.targetSlotType == WeaponSlotType.MAIN_HAND)
            {
                UnEquipWeapon(payload);
                mainHand = weapon;
            }
            else if (equipType == WeaponEquipType.OFF_HAND && payload.targetSlotType == WeaponSlotType.OFF_HAND)
            {
                UnEquipWeapon(payload);
                offHand = weapon;
            }
            else if (equipType == WeaponEquipType.TWO_HANDS)
            {
                UnEquipWeapon(payload);
                mainHand = weapon;
                offHand  = weapon;
            }
            else if (equipType == WeaponEquipType.EITHER_HAND)
            {
                UnEquipWeapon(payload);
                if (payload.targetSlotType == WeaponSlotType.MAIN_HAND)
                {
                    mainHand = weapon;
                }
                else if (payload.targetSlotType == WeaponSlotType.OFF_HAND)
                {
                    offHand = weapon;
                }
            }
        }