import java.util.*; public class Enhance2 extends Mentalism { String target; String spellName= "Mind Power"; int manaCost = 10; int level = 2; String[] targets = {"dragon","city"}; String description= "The targets attributs will rise"; /** * 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 "+spellName+" on "+arg); Object o = game.dragons.get(arg); if(o!=null){ Dragon d = (Dragon)o; d.incSpd(1); d.incStr(1); d.incPcp(1); d.Looks[1] = 2; } o = game.cities.get(arg); if (o != null){ City c = (City)o; c.increasePopulation(-2); c.incDev(1); c.incDef(1); c.Uprising *=0.95; } } ////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; } }