|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.monsters.DefaultCustomAttack
Abstract base class for CustomAttack implementations that don't want to implement all the methods of the Attack interface.
Field Summary | |
static int |
DEFAULT_HIT_CHANCE
|
Constructor Summary | |
DefaultCustomAttack()
|
Method Summary | |
void |
didDamage(DamageEvent event)
Notification that the weapon just did some damage. |
int |
getToHit()
Returns the base chance to hit for the weapon, against all attackers. |
java.util.List |
getWC(GameObject opponent)
Returns the damage(s) to use against the specified opponent. |
java.lang.String |
getWeaponSkill()
Returns the weapon skill that gives the user proficiency in this weapon, e.g. |
void |
recomputeWCs()
If you set any "wc-*" property on the weapon directly, bypassing the setWC() function, you need to call this or the WC won't be recomputed. |
void |
setShowAttackerMessage(boolean show)
Toggles showing the attacker message for the damage event. |
void |
setToHit(int tohit)
Sets the base chance to hit for the weapon, against all attackers. |
void |
setWC(java.lang.String name,
int wc)
Sets the base weapon-class of this weapon. |
boolean |
showAttackerMessage()
Returns true if we show the attacker message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface wyvern.kernel.combat.CustomAttack |
performDamage |
Field Detail |
public static final int DEFAULT_HIT_CHANCE
Constructor Detail |
public DefaultCustomAttack()
Method Detail |
public java.util.List getWC(GameObject opponent)
Attack
getWC
in interface Attack
opponent
- the thing being attacked. Can be null! The
weapon should check for this case. The weapon is free to
ignore the opponent and return the same wc for every opponent.
public void setWC(java.lang.String name, int wc)
Attack
setWC
in interface Attack
wc
- the new base wc for the weaponname
- the damage type, e.g. "cut", "smash", "fire".public void recomputeWCs()
Attack
recomputeWCs
in interface Attack
public int getToHit()
Attack
getToHit
in interface Attack
public void setToHit(int tohit)
Attack
setToHit
in interface Attack
tohit
- the weapon's base chance to hitpublic void didDamage(DamageEvent event)
Attack
This method runs a method hook called "didDamage", and passes the event along as the data parameter.
didDamage
in interface Attack
event
- the damage-event associated with the damage.
The event will have parameters set by the combat system
(by the DamageCommand, in particular), including the hit
location, attacker, defender, total damage, and others.public java.lang.String getWeaponSkill()
Attack
getWeaponSkill
in interface Attack
public void setShowAttackerMessage(boolean show)
Attack
setShowAttackerMessage
in interface Attack
show
- true to show the attacker message, false to
hide it.public boolean showAttackerMessage()
Attack
showAttackerMessage
in interface Attack
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |