Start mobequip refactor

This commit is contained in:
2024-03-18 10:01:29 -04:00
parent 0590ae64e7
commit 61c4cb1361
56 changed files with 198 additions and 377 deletions
@@ -47,7 +47,7 @@ public class SetItemFlagPowerAction extends AbstractPowerAction {
item.setIsID(false); //update failed, reset
//update inventory
CharacterItemManager cim = source.getCharItemManager();
CharacterItemManager cim = source.charItemManager;
if (cim != null)
cim.updateInventory();
}
@@ -124,7 +124,7 @@ public class StealPowerAction extends AbstractPowerAction {
return;
//dupe check, validate player has item
if (!tar.validForInventory(ownerPC.getClientConnection(), ownerPC, ownerPC.getCharItemManager()))//pc.getCharItemManager()))
if (!tar.validForInventory(ownerPC.getClientConnection(), ownerPC, ownerPC.charItemManager))//pc.getCharItemManager()))
return;
//mark thief and target as player aggressive
@@ -154,8 +154,8 @@ public class StealPowerAction extends AbstractPowerAction {
}
//attempt transfer item
CharacterItemManager myCIM = sourcePlayer.getCharItemManager();
CharacterItemManager ownerCIM = ((AbstractCharacter) owner).getCharItemManager();
CharacterItemManager myCIM = sourcePlayer.charItemManager;
CharacterItemManager ownerCIM = ((AbstractCharacter) owner).charItemManager;
if (myCIM == null || ownerCIM == null)
return;
@@ -175,15 +175,15 @@ public class StealPowerAction extends AbstractPowerAction {
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
//update thief's inventory
if (sourcePlayer.getCharItemManager() != null)
sourcePlayer.getCharItemManager().updateInventory();
if (sourcePlayer.charItemManager != null)
sourcePlayer.charItemManager.updateInventory();
//update victims inventory
if (owner.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
PlayerCharacter ownerPC = (PlayerCharacter) owner;
if (ownerPC.getCharItemManager() != null)
ownerPC.getCharItemManager().updateInventory();
if (ownerPC.charItemManager != null)
ownerPC.charItemManager.updateInventory();
}
//TODO if victim is trading, cancel trade window for both people involved in trade