Project cleanup pre merge.

This commit is contained in:
2023-07-15 09:23:48 -04:00
parent 134b651df8
commit 9bbdef224d
747 changed files with 99704 additions and 101200 deletions
+53 -52
View File
@@ -20,72 +20,73 @@ import engine.objects.PlayerCharacter;
public class SetInvulCmd extends AbstractDevCmd {
public SetInvulCmd() {
public SetInvulCmd() {
super("setinvul");
}
@Override
protected void _doCmd(PlayerCharacter pcSender, String[] words,
AbstractGameObject target) {
if (pcSender == null) return;
@Override
protected void _doCmd(PlayerCharacter pcSender, String[] words,
AbstractGameObject target) {
if (pcSender == null)
return;
if (words.length != 1) {
this.sendUsage(pcSender);
return;
}
if (words.length != 1) {
this.sendUsage(pcSender);
return;
}
boolean invul;
switch (words[0].toLowerCase()) {
case "true":
invul = true;
break;
case "false":
invul = false;
break;
default:
this.sendUsage(pcSender);
return;
}
boolean invul;
switch (words[0].toLowerCase()) {
case "true":
invul = true;
break;
case "false":
invul = false;
break;
default:
this.sendUsage(pcSender);
return;
}
if (target == null || !(target instanceof Building)) {
throwbackError(pcSender, "No building targeted");
return;
}
if (target == null || !(target instanceof Building)) {
throwbackError(pcSender, "No building targeted");
return;
}
Building b = (Building) target;
Building b = (Building) target;
// if strucutre is a TOL then we're modifying the protection
// status of the entire city
// if strucutre is a TOL then we're modifying the protection
// status of the entire city
if ( (b.getBlueprint() != null) &&
(b.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL))) {
if ((b.getBlueprint() != null) &&
(b.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL))) {
City city;
City city;
city = b.getCity();
city.protectionEnforced = !city.protectionEnforced;
throwbackInfo(pcSender, "City protection contracts enforced: " + city.protectionEnforced);
return;
}
city = b.getCity();
city.protectionEnforced = !city.protectionEnforced;
throwbackInfo(pcSender, "City protection contracts enforced: " + city.protectionEnforced);
return;
}
if (invul) {
if (invul) {
b.setProtectionState(ProtectionState.PROTECTED);
throwbackInfo(pcSender, "The targetted building is now invulnerable.");
return;
}
b.setProtectionState(ProtectionState.NONE);
throwbackInfo(pcSender, "The targetted building is no longer invulernable.");
}
b.setProtectionState(ProtectionState.PROTECTED);
throwbackInfo(pcSender, "The targetted building is now invulnerable.");
return;
}
b.setProtectionState(ProtectionState.NONE);
throwbackInfo(pcSender, "The targetted building is no longer invulernable.");
}
@Override
protected String _getUsageString() {
return "'./setInvul true|false'";
}
@Override
protected String _getUsageString() {
return "'./setInvul true|false'";
}
@Override
protected String _getHelpString() {
return "Turns invulernability on or off for building";
}
@Override
protected String _getHelpString() {
return "Turns invulernability on or off for building";
}
}