import java.util.*; public class Weakness2 extends EvilEye { String target; String spellName= "Withering of the flesh"; int manaCost= 15; int level= 2; String[] targets = {"dragon","city"}; String description= "When cast the spell will literally tear the flesh of the targets bone "+ "an extremely untasty piece of witchcraft"; /** * 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(-Dice.rand(10)); d.incStr(-Dice.rand(10)); d.incPcp(3); d.incWis(3); d.Looks[1] = 3; } o = game.cities.get(arg); if (o != null){ City c = (City)o; c.increasePopulation(-10); c.incDev(1); c.incDef(-3); } } ////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; } }