-Finished upgrades
Signed-off-by: Tony Grosinger <tony@grosinger.net>
This commit is contained in:
parent
e323a0064d
commit
47ddadc865
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2,6 +2,7 @@ package net.grosinger.nomads;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.grosinger.nomads.Upgrade.UpgradeType;
|
||||
import net.grosinger.nomads.exceptions.FullInventoryException;
|
||||
|
||||
/**
|
||||
@ -56,8 +57,6 @@ public class DroneListItem {
|
||||
private Inventory inventory;
|
||||
private ArrayList<Objective> currentObjectives;
|
||||
|
||||
// TODO - Implement max number of objectives
|
||||
|
||||
/*
|
||||
* Default constructor, includes all references
|
||||
*/
|
||||
@ -366,6 +365,56 @@ public class DroneListItem {
|
||||
visibleDistance += amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Increments the level specified by the type.
|
||||
*
|
||||
* @param type
|
||||
* Level to be increased
|
||||
*/
|
||||
public void incrementLevel(UpgradeType type) {
|
||||
switch (type) {
|
||||
case visibleDistance: {
|
||||
visibleDistance++;
|
||||
break;
|
||||
}
|
||||
case lumaLocatorDistance: {
|
||||
lumaLocatorDistance++;
|
||||
break;
|
||||
}
|
||||
case objectLocatorDistance: {
|
||||
objectLocatorDistance++;
|
||||
break;
|
||||
}
|
||||
case reliability: {
|
||||
reliability++;
|
||||
break;
|
||||
}
|
||||
case attack: {
|
||||
attack++;
|
||||
break;
|
||||
}
|
||||
case defenses: {
|
||||
defenses++;
|
||||
break;
|
||||
}
|
||||
case speed: {
|
||||
speed++;
|
||||
break;
|
||||
}
|
||||
case cargoSpace: {
|
||||
cargoSpace++;
|
||||
break;
|
||||
}
|
||||
case theft: {
|
||||
theft++;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
// Must specify an Upgrade Type
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Increases the age of the drone by 1 turn
|
||||
*/
|
||||
|
@ -82,7 +82,6 @@ public class Upgrade {
|
||||
break;
|
||||
}
|
||||
case lumaLocatorDistance: {
|
||||
|
||||
allInfo.put("multiplier", (double) 2.5);
|
||||
allInfo.put("currentLevel", (double) oldBrokenDrone.getLumaLocatorDistance());
|
||||
allInfo.put("originalLevel", (double) Nomads.BASE_LUMALOCATORDISTANCE);
|
||||
|
@ -33,7 +33,8 @@ public class UpgradeShop extends NeighborBuilding {
|
||||
} else if (toPerform.isMaxLevel()) {
|
||||
throw new InvalidUpgradeException("Maximum level already achieved");
|
||||
} else {
|
||||
// TODO - Implement Perform Upgrade
|
||||
drone.incrementLevel(toPerform.getUpgradeType());
|
||||
drone.getTeam().deductFromBalance(upgradeCost);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user