|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is shared by things that can be used as attacks.
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. |
Method Detail |
public java.util.List getWC(GameObject opponent)
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)
wc
- the new base wc for the weaponname
- the damage type, e.g. "cut", "smash", "fire".public void recomputeWCs()
public int getToHit()
public void setToHit(int tohit)
tohit
- the weapon's base chance to hitpublic void didDamage(DamageEvent event)
This method runs a method hook called "didDamage", and passes the event along as the data parameter.
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()
public boolean showAttackerMessage()
public void setShowAttackerMessage(boolean show)
show
- true to show the attacker message, false to
hide it.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |