|
|
@ -28,12 +28,15 @@ public class ClaimMinePowerAction extends AbstractPowerAction { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) { |
|
|
|
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) { |
|
|
|
|
|
|
|
|
|
|
|
if (source == null || awo == null) |
|
|
|
if (source == null || awo == null) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if (!(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))) |
|
|
|
if (!(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PlayerCharacter playerCharacter = (PlayerCharacter) source; |
|
|
|
|
|
|
|
|
|
|
|
if (!(awo.getObjectType().equals(Enum.GameObjectType.Building))) |
|
|
|
if (!(awo.getObjectType().equals(Enum.GameObjectType.Building))) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
@ -47,7 +50,7 @@ public class ClaimMinePowerAction extends AbstractPowerAction { |
|
|
|
if (mine == null) |
|
|
|
if (mine == null) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if (mine.claimMine((PlayerCharacter) source) == true) |
|
|
|
if (mine.claimMine(playerCharacter) == true) |
|
|
|
ChatManager.sendSystemMessage( (PlayerCharacter) source, "You successfully claimed this mine.."); |
|
|
|
ChatManager.sendSystemMessage( (PlayerCharacter) source, "You successfully claimed this mine.."); |
|
|
|
else |
|
|
|
else |
|
|
|
ChatManager.sendSystemMessage( (PlayerCharacter) source, "Your attempt for to claim this mine failed."); |
|
|
|
ChatManager.sendSystemMessage( (PlayerCharacter) source, "Your attempt for to claim this mine failed."); |
|
|
|