import java.util.*; public class Grow1 extends GaiasLore { String target= "Gondor"; String spellName; int manaCost; int level; String[] targets = {"dragon","city"}; String description; Grow1(){ spellName = "Natures blessing"; manaCost = 5; level = 1; description = "The nature will bless the target of the spell and give it enhanced strength"+ " and the target will become closer to nature"; } /** * Should as the string argument take city#cityname or dragon#dragonname */ public void cast(Fod game, int playerNr, String arg) { System.out.println("Player "+playerNr+" casts grow on "+arg); Object o = game.dragons.get(arg); if(o!=null){ Dragon d = (Dragon)o; d.incStr(1); d.incSpd(-2); d.Looks[1] = 1; } o = game.cities.get(arg); if (o != null){ City c = (City)o; c.increasePopulation(1); c.incDev(-1); } } ////Primitves public String getSpellName(){ return spellName; } public String getDescription(){ return description; } public int getManaCost(){ return manaCost; } public int getLevel(){ return level; } public String[] getTargetProfile(){ return targets; } public String getTarget(){ return target; } public String setTarget(String t){ target = t; return target; } }