From: MadMetzger <mad...@us...> - 2010-04-15 18:35:19
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/spell In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv32520/src/games/stendhal/server/entity/spell Modified Files: HealingSpell.java Log Message: removed possibly unnecessary code, as an interface for spells is not fixed yet Index: HealingSpell.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/spell/HealingSpell.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** HealingSpell.java 15 Apr 2010 18:26:16 -0000 1.15 --- HealingSpell.java 15 Apr 2010 18:35:11 -0000 1.16 *************** *** 19,91 **** package games.stendhal.server.entity.spell; - import games.stendhal.server.core.events.UseListener; - import games.stendhal.server.entity.RPEntity; - import games.stendhal.server.entity.player.Player; /** ! * @author timothyb89 A healing spell. It restores the user to full HP (for * now). */ ! public class HealingSpell extends Spell implements UseListener { ! public HealingSpell(String name, int amount, int atk, int cooldown, ! int def, double lifesteal, int mana, int minimumlevel, int range, ! int rate, int regen) { super(name, amount, atk, cooldown, def, lifesteal, mana, minimumlevel, range, rate, regen); } ! ! private int healAmount; ! ! @Override ! public String describe() { ! return "You see a healing spell."; ! } ! ! // ! // HealingSpell ! // ! ! /** ! * Gets the amount the healing spell will heal you. ! * @param player ! * @return amount of health healed ! * ! * ! */ ! public int getHealingAmount(final Player player) { ! return player.getBaseHP() - healAmount; ! } ! ! // ! // UseListener ! // ! ! public boolean onUsed(final RPEntity user) { ! final Player player = (Player) user; ! ! if (player.getMana() >= 25) { ! player.heal(getHealingAmount(player), true); ! ! // takes away the mana ! final int mana = player.getMana(); ! final int newmana = mana - 25; ! ! // sets the new mana amount ! player.setMana(newmana); ! ! // now that everything has been set, notify the player. ! player.sendPrivateText("You have been healed. You now have #" ! + player.getMana() + " mana left."); ! ! // saves changes (last because the stats are refreshed by default on ! // zone change) ! player.update(); ! player.notifyWorldAboutChanges(); ! return true; ! } else { ! player.sendPrivateText("You do not have enough mana to cast this spell."); ! } ! return false; ! } } --- 19,35 ---- package games.stendhal.server.entity.spell; /** ! * @author timothyb89, madmetzger A healing spell. It restores the user to full HP (for * now). */ ! public class HealingSpell extends Spell { ! public HealingSpell(final String name, final int amount, final int atk, final int cooldown, ! final int def, final double lifesteal, final int mana, final int minimumlevel, final int range, ! final int rate, final int regen) { super(name, amount, atk, cooldown, def, lifesteal, mana, minimumlevel, range, rate, regen); } ! } |