rle.core.event
Interface Cause

All Known Implementing Classes:
InitializationCause, MonsterDeathListener, PlayerHealer, SystemCause, TextMessageCause, TimeoutCause

public interface Cause

Specification for the "cause" of a particular action. Causes need to be traced in several situations for different reasons.

 1.  When a melee, spell or projectile attack occurs, the cause may be either the
 attacking creature or, if appropriate, some object representing the particular
 attack the attacking creature used.  This is important for tracing which monster
 killed the player (and possibly how) and for whether a monster was killed by
 the player (and should therefore receive experience.

 2.  When a magical item is used and invokes a charm and/or projected affect,
 and the player observes this, an event may be posted that ties the item to
 the outcome.  This is the faculty by which flavored items can become known
 to the player through usage.  Of course, if the player observes nothing, an
 event could be posted to mark the item as "tried".

 3.  Any changes to Runtime Data should be able to supply an optional Cause.  This
 could become important if, for example, the player is killed by poison.


 


Method Summary
 java.lang.String getCauseDescription()
          The internationalized description of this Cause.
 java.lang.Object getSource()
          The underlying Object that the Cause description refers to.
 

Method Detail

getCauseDescription

java.lang.String getCauseDescription()
The internationalized description of this Cause. This should be able to fit the basic sentence structure "Player Timmy, killed by [cause] on level 25."


getSource

java.lang.Object getSource()
The underlying Object that the Cause description refers to.