import java.util.*; public class Weakness1 extends EvilEye { String target; String spellName= "Journey through Hell"; int manaCost= 5; int level= 1; String[] targets = {"dragon","city"}; String description= "This spell will give it targets a terrible experience, and lessening its power. You cast the spell carefully though it may strengthen your foe"; /** * 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(2); d.Looks[1] = 3; } o = game.cities.get(arg); if (o != null){ City c = (City)o; c.increasePopulation(-2); c.incDev(1); c.incDef(-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; } }