rle.simple.charm
Class CharmEngine
java.lang.Object
rle.core.vm.PlugInBase
rle.simple.charm.CharmEngine
- All Implemented Interfaces:
- PlugIn
public class CharmEngine
- extends PlugInBase
Applies charms. A charm is any affect, magical or non-magical that affects
a Creature. Examples include the food value of a ration, the damage that
a Magic Missile spell does, or the speed boost from a Potion of Speed.
At a later time, we may add support for charms that affect Terrain.
Method Summary |
void |
applyCharms(java.util.Map<java.lang.String,java.lang.Object> charmMap,
Creature target,
Cause cause)
Analyze the given Map and apply the appropriate "Charms" to the target
creature. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CharmEngine
public CharmEngine()
applyCharms
public void applyCharms(java.util.Map<java.lang.String,java.lang.Object> charmMap,
Creature target,
Cause cause)
- Analyze the given Map and apply the appropriate "Charms" to the target
creature. Where appropriate, events will be posted allowing interested
classes to respond. Such events will include the given cause.
Each type of charm has a key, and only one charm for a particular key
can be active at a time. Attempts to activate a new charm when one is
active will be handled as follows:
Existing New Result
Good Good Fizzle(existing charm unchanged)
Good Bad Cancel(existing charm cancelled, no further action)
Bad Bad Fizzle
Bad Good Cancel
- Parameters:
charmMap
- - key/value pairs indicating 0 or more affects to invoketarget
- - the creature to be affectedcause
- - the cause of the application of charms