|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwyvern.kernel.combat.BodyPart
wyvern.kernel.combat.AttackingBodyPart
Subclass of BodyPart that implements the Attack interface.
| Field Summary | |
protected java.util.ArrayList |
dtypes_
|
protected int |
tohit_
|
| Fields inherited from class wyvern.kernel.combat.BodyPart |
hitWeight_, name_, pluralName_, slots_, uniqueName_ |
| Constructor Summary | |
AttackingBodyPart()
|
|
| Method Summary | |
void |
addDamageType(DamageType dtype)
Adds a DamageType object to the list of damage types this attack does. |
void |
addMethodHook(MethodHookCallback callback,
java.lang.String methodName)
Registers for the specified method-hook. |
abstract void |
addWCs()
Instructs the subclass to add one DamageType object for each damage type the body-part does when it strikes. |
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 weapon-class(es) of this weapon, versus the passed opponent. |
java.lang.String |
getWeaponSkill()
Returns the weapon skill for this attack type. |
BodyPart |
makeClone()
Clones this body part. |
void |
recomputeWCs()
Recomputes cached WC(s) for this attack. |
void |
removeMethodHook(MethodHookCallback callback,
java.lang.String methodName)
Unregisters for the specified method-hook. |
void |
runMethodHook(java.lang.String hookName,
java.lang.Object data)
Runs the specified method hook on this object. |
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(int wc)
Sets the (primary) WC value for this attacking body part. |
void |
setWC(java.lang.String name,
int wc)
Adds a new wc for this attack. |
boolean |
showAttackerMessage()
Returns true if we show the attacker message. |
java.lang.String |
toString()
Prints String rep. |
| Methods inherited from class wyvern.kernel.combat.BodyPart |
equals, getName, getPluralName, getProbability, getSlots, getTotalAC, getUniqueName, makeSingleSlot, setName, setPluralName, setProbability, setUniqueName |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int tohit_
protected java.util.ArrayList dtypes_
| Constructor Detail |
public AttackingBodyPart()
| Method Detail |
public abstract void addWCs()
public java.util.List getWC(GameObject opponent)
getWC in interface Attackopponent - 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 java.lang.String getWeaponSkill()
getWeaponSkill in interface Attackpublic void setShowAttackerMessage(boolean show)
Attack
setShowAttackerMessage in interface Attackshow - true to show the attacker message, false to
hide it.public boolean showAttackerMessage()
Attack
showAttackerMessage in interface Attackpublic int getToHit()
Attack
getToHit in interface Attackpublic void setToHit(int tohit)
Attack
setToHit in interface Attacktohit - the weapon's base chance to hit
public void setWC(java.lang.String name,
int wc)
setWC in interface Attackname - the name of the damage type, e.g. "fire", "cut", "smash"wc - the new wc for this damage typepublic void setWC(int wc)
public void addDamageType(DamageType dtype)
public void recomputeWCs()
recomputeWCs in interface Attackpublic void didDamage(DamageEvent event)
AttackThis method runs a method hook called "didDamage", and passes the event along as the data parameter.
didDamage in interface Attackevent - 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 void runMethodHook(java.lang.String hookName,
java.lang.Object data)
runMethodHook in interface MethodHookablehookName - the hook to run, e.g. "add", "remove"data - any data for the method hook
public void addMethodHook(MethodHookCallback callback,
java.lang.String methodName)
MethodHookable
addMethodHook in interface MethodHookablemethodName - the name of the method to hook intocallback - the MethodHookCallback object to notify on the hook
public void removeMethodHook(MethodHookCallback callback,
java.lang.String methodName)
MethodHookable
removeMethodHook in interface MethodHookablemethodName - the name of the methodcallback - the MethodHookCallback object to notify on the hook
public BodyPart makeClone()
throws java.lang.Exception
BodyPart
makeClone in class BodyPartjava.lang.Exceptionpublic java.lang.String toString()
BodyPart
toString in class BodyPart
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||