village stages
parent
f2793b1a97
commit
989c76ced9
|
@ -77,9 +77,7 @@ public class GameEngine implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map generateInitialMap(){
|
private Map generateInitialMap(){
|
||||||
VillageStage villageHallInitialStage = new VillageStage(100, 0, 2, new Time(), 0,
|
return new Map(new CasaDeNarino(1, VillageHallStages.villageStages[0]), 30);
|
||||||
0, 1000, 2500, 5000);
|
|
||||||
return new Map(new CasaDeNarino(1, villageHallInitialStage), 30);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map generateMap() {
|
public Map generateMap() {
|
||||||
|
@ -112,6 +110,9 @@ public class GameEngine implements Runnable {
|
||||||
case 'p':
|
case 'p':
|
||||||
printState();
|
printState();
|
||||||
break;
|
break;
|
||||||
|
case 'q':
|
||||||
|
System.exit(0);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,12 @@ public class CasaDeNarino extends Building {
|
||||||
return currentGold;
|
return currentGold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getCurrentIron() {
|
||||||
|
return currentIron;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCurrentWood() {return currentWood;}
|
||||||
|
|
||||||
public boolean addGold(int amount) {
|
public boolean addGold(int amount) {
|
||||||
int newGold = this.currentGold + amount;
|
int newGold = this.currentGold + amount;
|
||||||
if (newGold <= goldCapacity && this.currentGold + amount >= 0){
|
if (newGold <= goldCapacity && this.currentGold + amount >= 0){
|
||||||
|
@ -48,10 +54,6 @@ public class CasaDeNarino extends Building {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCurrentIron() {
|
|
||||||
return currentIron;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean addIron(int amount) {
|
public boolean addIron(int amount) {
|
||||||
int newIron = this.currentIron + amount;
|
int newIron = this.currentIron + amount;
|
||||||
if (newIron <= ironCapacity && newIron >= 0) {
|
if (newIron <= ironCapacity && newIron >= 0) {
|
||||||
|
@ -61,10 +63,6 @@ public class CasaDeNarino extends Building {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCurrentWood() {
|
|
||||||
return currentWood;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean addWood(int amount) {
|
public boolean addWood(int amount) {
|
||||||
int newWood = this.currentWood + amount;
|
int newWood = this.currentWood + amount;
|
||||||
if (newWood <= woodCapacity && newWood >= 0) {
|
if (newWood <= woodCapacity && newWood >= 0) {
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
package ca.cosc3p91.a2.gameobjects;
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
|
import ca.cosc3p91.a2.util.Time;
|
||||||
|
|
||||||
class DefenseStage extends Stage {
|
class DefenseStage extends Stage {
|
||||||
|
|
||||||
protected int dDamage;
|
protected int dDamage;
|
||||||
|
|
||||||
protected int dRange;
|
protected int dRange;
|
||||||
|
|
||||||
public DefenseStage(int dHealth, int goldCost, int requiredVillageLevel, int upgradeTime, int ironCost, int woodCost,
|
public DefenseStage(int dHealth, int goldCost, int requiredVillageLevel, Time upgradeTime, int ironCost, int woodCost,
|
||||||
int damageIncrease, int rangeIncrease) {
|
int damageIncrease, int rangeIncrease) {
|
||||||
super(dHealth, goldCost, requiredVillageLevel, upgradeTime, ironCost, woodCost);
|
super(dHealth, goldCost, requiredVillageLevel, upgradeTime, ironCost, woodCost);
|
||||||
this.dDamage = damageIncrease;
|
this.dDamage = damageIncrease;
|
||||||
|
|
|
@ -1,4 +1,30 @@
|
||||||
package ca.cosc3p91.a2.gameobjects;
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
|
import ca.cosc3p91.a2.util.Time;
|
||||||
|
|
||||||
public class VillageHallStages {
|
public class VillageHallStages {
|
||||||
|
|
||||||
|
public static class VillageStage1 extends VillageStage {
|
||||||
|
public VillageStage1() {
|
||||||
|
super(100, 0, 0, new Time(), 0,
|
||||||
|
0, 1000, 2500, 5000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class VillageStage2 extends VillageStage {
|
||||||
|
public VillageStage2() {
|
||||||
|
super(550, 1000, 0, new Time().offsetHours(2), 2500,
|
||||||
|
5000, 2500, 5000, 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class VillageStage3 extends VillageStage {
|
||||||
|
public VillageStage3() {
|
||||||
|
super(550, 2500, 0, new Time().offsetHours(2), 5000,
|
||||||
|
10000, 5000, 7500, 15000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static VillageStage[] villageStages = {new VillageStage1(), new VillageStage2(), new VillageStage3()};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue