-Removed Upgrade from Drone. Upgrades will be performed by approaching an upgrade shop.
Signed-off-by: Tony Grosinger <tony@grosinger.net>
This commit is contained in:
parent
dd89b54fc3
commit
7ee4f440e5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,6 @@
|
||||
package net.grosinger.nomads;
|
||||
|
||||
|
||||
/*
|
||||
* Anything that is on the theWorld that is not a drone of some sort is a building
|
||||
*
|
||||
|
@ -52,13 +52,5 @@ public interface Drone extends GameObject {
|
||||
* @return <code>Neighbor</code>
|
||||
*/
|
||||
public NeighborDrone attack();
|
||||
|
||||
/**
|
||||
* Asks what the drone would like to upgrade. Will be called whenever the Move
|
||||
* method returns Upgrade.
|
||||
*
|
||||
* @return <code>Upgrade</code>
|
||||
*/
|
||||
public Upgrade upgrade();
|
||||
|
||||
}
|
||||
|
@ -376,10 +376,6 @@ public class DroneListItem {
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
case Upgrade: {
|
||||
doUpgrade();
|
||||
return true;
|
||||
}
|
||||
case Attack: {
|
||||
doAttack();
|
||||
return true;
|
||||
@ -497,69 +493,6 @@ public class DroneListItem {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the upgrade that the drone would like to purchase. Determines if
|
||||
* upgrade is possible and performs action accordingly
|
||||
*/
|
||||
private void doUpgrade() {
|
||||
Upgrade newUpgrade = current.upgrade();
|
||||
Integer price = newUpgrade.getPrice();
|
||||
if (price == null) {
|
||||
// Invalid upgrade selection, turn lost.
|
||||
return;
|
||||
}
|
||||
|
||||
if (team.getBalance() >= price) {
|
||||
switch (newUpgrade.getUpgradeType()) {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
team.deductFromBalance(price);
|
||||
return;
|
||||
} else {
|
||||
// Not enough money, do nothing.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Move the drone in a specified direction
|
||||
*
|
||||
|
@ -2,6 +2,7 @@ package net.grosinger.nomads;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* Contains a pointer to the first and the last DroneListItem in a particular
|
||||
* team. When adding drones to Team A they should be added to the end of the
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.grosinger.nomads;
|
||||
|
||||
|
||||
/**
|
||||
* It is a house, just like it says. Basically a building that can be owned by a
|
||||
* team
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.grosinger.nomads;
|
||||
|
||||
|
||||
/**
|
||||
* An array of NeigborBuildings will be given to a drone that is searching for
|
||||
* the buildings it is near. This is typically done from the town center.
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.grosinger.nomads;
|
||||
|
||||
|
||||
/**
|
||||
* An array of NeighborDrones will be given to a drone that is using it's radar
|
||||
*/
|
||||
|
@ -3,6 +3,7 @@ package net.grosinger.nomads;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class Nomads {
|
||||
|
||||
public static World awesomeWorld;
|
||||
|
@ -78,13 +78,4 @@ public class Police implements Drone {
|
||||
// TODO - Implement Police Attack
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Upgrade upgrade() {
|
||||
// Police drones do not have upgrades. They will automatically upgrade
|
||||
// throughout the game based on time played.
|
||||
// TODO - Implement Police Upgrade
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package net.grosinger.nomads;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* A representation of a TownHall. Allows Drones to interact with this building.
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.grosinger.nomads;
|
||||
|
||||
|
||||
public class Upgrade {
|
||||
|
||||
public enum UpgradeType {
|
||||
|
@ -9,6 +9,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* Main class where information about the world is stored
|
||||
*
|
||||
|
Reference in New Issue
Block a user