import java.util.*; public class Control1 extends Mentalism { String target; String spellName= "Stir of the crowd"; int manaCost = 30; int level = 4; String[] targets = {"city"}; String description= "This spell will make the people of an city of your choice rebellious "+ "It will NOT work on a capital though"; /** * 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.cities.get(arg); if (o != null){ City c = (City)o; boolean safe = false; Enumeration drags = c.getArea(game.Map).getDragons(); if(drags.hasMoreElements()){ Dragon opponent = (Dragon)game.dragons.get((String)drags.nextElement()); if(opponent.Mission.equals("GUARD")) if(opponent.Wisdom > 40) safe = true; } if(c.isHomeCity(game.players)) safe = true; if(!safe){ c.Uprising += 50; c.increasePopulation(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; } }