import java.util.*; public class Enhance1 extends Mentalism { String target; String spellName= "Force of will"; int manaCost = 5; int level = 1; String[] targets = {"dragon","city"}; String description= "You will give a new hope to the target of the spell"+ " and it will be a more loyal and quicker to obey your commands"; /** * 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(-2); d.Looks[1] = 2; } o = game.cities.get(arg); if (o != null){ City c = (City)o; c.increasePopulation(-3); 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; } }