com.planet_ink.coffee_mud.Libraries
Class MUDFight

java.lang.Object
  extended by com.planet_ink.coffee_mud.Libraries.StdLibrary
      extended by com.planet_ink.coffee_mud.Libraries.MUDFight
All Implemented Interfaces:
CMObject, CMLibrary, CombatLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class MUDFight
extends StdLibrary
implements CombatLibrary


Field Summary
 java.lang.String[][] hitWordIndex
           
 java.lang.String[][] hitWordsChanged
           
 long lastRes
           
 java.lang.String lastStr
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CombatLibrary
COMBAT_DEFAULT, COMBAT_MANUAL, COMBAT_QUEUE
 
Constructor Summary
MUDFight()
           
 
Method Summary
 java.util.HashSet allCombatants(MOB mob)
           
 java.util.HashSet allPossibleCombatants(MOB mob, boolean beRuthless)
           
 java.lang.String armorStr(int armor)
           
protected  boolean bleedableWeapon(Environmental E)
           
 void dispenseExperience(java.util.HashSet killers, java.util.HashSet dividers, MOB killed)
          For a valid set of killers who are benefitting from having killed the given killed mob, this method will make repeated postExperience calls after having calculated their exp bounty for the kill.
 void establishRange(MOB source, MOB target, Environmental tool)
           
 java.lang.String fightingProwessStr(int prowess)
           
 java.util.Vector getAllInProximity(MOB to, int distance)
           
 java.util.HashSet getCombatBeneficiaries(MOB killer, MOB killed, CharClass combatCharClass)
           
protected  java.util.HashSet getCombatBeneficiaries(MOB killer, MOB killed, Room deathRoom, java.util.HashSet beneficiaries, CharClass combatCharClass)
           
 java.util.HashSet getCombatDividers(MOB killer, MOB killed, CharClass combatCharClass)
           
protected  java.util.HashSet getCombatDividers(MOB killer, MOB killed, Room deathRoom, java.util.HashSet dividers, CharClass combatCharClass)
           
 CharClass getCombatDominantClass(MOB killer, MOB killed)
           
 MOB getFollowedLeader(MOB mob)
           
 java.util.Vector[] getFormation(MOB mob)
           
 int getFormationAbsOrder(MOB mob)
           
 java.util.Vector getFormationFollowed(MOB mob)
           
 void handleBeingAssaulted(CMMsg msg)
           
 void handleBeingDamaged(CMMsg msg)
           
 void handleBeingHealed(CMMsg msg)
           
 boolean handleConsequences(MOB mob, MOB fighting, java.lang.String whatToDo, int[] lostExperience, java.lang.String message)
           
 void handleDeath(CMMsg msg)
           
 void handleObserveDeath(MOB observer, MOB fighting, CMMsg msg)
           
 java.lang.String[] healthDescs()
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isKnockedOutUponDeath(MOB mob, MOB fighting)
           
 DeadBody justDie(MOB source, MOB target)
           
 void makeFollowersFight(MOB observer, MOB target, MOB source)
           
 void makePeaceInGroup(MOB mob)
           
 boolean postAttack(MOB attacker, MOB target, Item weapon)
           
 void postDamage(MOB attacker, MOB target, Environmental weapon, int damage, int messageCode, int damageType, java.lang.String allDisplayMessage)
           
 void postDeath(MOB killerM, MOB deadM, CMMsg addHere)
           
 boolean postHealing(MOB healer, MOB target, Environmental tool, int messageCode, int healing, java.lang.String allDisplayMessage)
           
 void postPanic(MOB mob, CMMsg addHere)
           
 void postWeaponDamage(MOB source, MOB target, Item item, boolean success)
           
 void processFormation(java.util.Vector[] done, MOB leader, int level)
           
 java.util.HashSet properTargets(Ability A, MOB caster, boolean beRuthless)
           
 java.lang.String replaceDamageTag(java.lang.String str, int damage, int damageType)
           
 void resistanceMsgs(CMMsg msg, MOB source, MOB target)
           
 boolean rollToHit(int attack, int defence)
           
 boolean rollToHit(MOB attacker, MOB defender)
           
 java.lang.String standardHitString(int weaponClass, int damageAmount, java.lang.String weaponName)
           
 java.lang.String standardHitWord(int type, int damage)
           
 java.lang.String standardMissString(int weaponType, int weaponClassification, java.lang.String weaponName, boolean useExtendedMissString)
           
 java.lang.String standardMobCondition(MOB viewer, MOB mob)
           
protected  void subtickAfterAttack(MOB fighter)
           
protected  void subtickAttack(MOB fighter, Item weapon, int folrange)
           
protected  void subtickBeforeAttack(MOB fighter)
           
 void tickCombat(MOB fighter)
           
 
Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
activate, compareTo, copyOf, getSupportThread, initializeClass, newInstance, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary
activate, getSupportThread, shutdown
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

lastStr

public java.lang.String lastStr

lastRes

public long lastRes

hitWordIndex

public java.lang.String[][] hitWordIndex

hitWordsChanged

public java.lang.String[][] hitWordsChanged
Constructor Detail

MUDFight

public MUDFight()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, MiscTech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Overrides:
ID in class StdLibrary
Returns:
the name of this class

allPossibleCombatants

public java.util.HashSet allPossibleCombatants(MOB mob,
                                               boolean beRuthless)
Specified by:
allPossibleCombatants in interface CombatLibrary

properTargets

public java.util.HashSet properTargets(Ability A,
                                       MOB caster,
                                       boolean beRuthless)
Specified by:
properTargets in interface CombatLibrary

rollToHit

public boolean rollToHit(MOB attacker,
                         MOB defender)
Specified by:
rollToHit in interface CombatLibrary

rollToHit

public boolean rollToHit(int attack,
                         int defence)
Specified by:
rollToHit in interface CombatLibrary

allCombatants

public java.util.HashSet allCombatants(MOB mob)
Specified by:
allCombatants in interface CombatLibrary

makePeaceInGroup

public void makePeaceInGroup(MOB mob)
Specified by:
makePeaceInGroup in interface CombatLibrary

postPanic

public void postPanic(MOB mob,
                      CMMsg addHere)
Specified by:
postPanic in interface CombatLibrary

postDeath

public void postDeath(MOB killerM,
                      MOB deadM,
                      CMMsg addHere)
Specified by:
postDeath in interface CombatLibrary

postAttack

public boolean postAttack(MOB attacker,
                          MOB target,
                          Item weapon)
Specified by:
postAttack in interface CombatLibrary

postHealing

public boolean postHealing(MOB healer,
                           MOB target,
                           Environmental tool,
                           int messageCode,
                           int healing,
                           java.lang.String allDisplayMessage)
Specified by:
postHealing in interface CombatLibrary

replaceDamageTag

public java.lang.String replaceDamageTag(java.lang.String str,
                                         int damage,
                                         int damageType)
Specified by:
replaceDamageTag in interface CombatLibrary

postDamage

public void postDamage(MOB attacker,
                       MOB target,
                       Environmental weapon,
                       int damage,
                       int messageCode,
                       int damageType,
                       java.lang.String allDisplayMessage)
Specified by:
postDamage in interface CombatLibrary

postWeaponDamage

public void postWeaponDamage(MOB source,
                             MOB target,
                             Item item,
                             boolean success)
Specified by:
postWeaponDamage in interface CombatLibrary

processFormation

public void processFormation(java.util.Vector[] done,
                             MOB leader,
                             int level)
Specified by:
processFormation in interface CombatLibrary

getFollowedLeader

public MOB getFollowedLeader(MOB mob)
Specified by:
getFollowedLeader in interface CombatLibrary

getFormation

public java.util.Vector[] getFormation(MOB mob)
Specified by:
getFormation in interface CombatLibrary

getFormationFollowed

public java.util.Vector getFormationFollowed(MOB mob)
Specified by:
getFormationFollowed in interface CombatLibrary

getFormationAbsOrder

public int getFormationAbsOrder(MOB mob)
Specified by:
getFormationAbsOrder in interface CombatLibrary

getCombatDominantClass

public CharClass getCombatDominantClass(MOB killer,
                                        MOB killed)
Specified by:
getCombatDominantClass in interface CombatLibrary

getCombatBeneficiaries

protected java.util.HashSet getCombatBeneficiaries(MOB killer,
                                                   MOB killed,
                                                   Room deathRoom,
                                                   java.util.HashSet beneficiaries,
                                                   CharClass combatCharClass)

getCombatBeneficiaries

public java.util.HashSet getCombatBeneficiaries(MOB killer,
                                                MOB killed,
                                                CharClass combatCharClass)
Specified by:
getCombatBeneficiaries in interface CombatLibrary

getCombatDividers

protected java.util.HashSet getCombatDividers(MOB killer,
                                              MOB killed,
                                              Room deathRoom,
                                              java.util.HashSet dividers,
                                              CharClass combatCharClass)

getCombatDividers

public java.util.HashSet getCombatDividers(MOB killer,
                                           MOB killed,
                                           CharClass combatCharClass)
Specified by:
getCombatDividers in interface CombatLibrary

justDie

public DeadBody justDie(MOB source,
                        MOB target)
Specified by:
justDie in interface CombatLibrary

standardHitWord

public java.lang.String standardHitWord(int type,
                                        int damage)
Specified by:
standardHitWord in interface CombatLibrary

armorStr

public java.lang.String armorStr(int armor)
Specified by:
armorStr in interface CombatLibrary

fightingProwessStr

public java.lang.String fightingProwessStr(int prowess)
Specified by:
fightingProwessStr in interface CombatLibrary

standardMissString

public java.lang.String standardMissString(int weaponType,
                                           int weaponClassification,
                                           java.lang.String weaponName,
                                           boolean useExtendedMissString)
Specified by:
standardMissString in interface CombatLibrary

standardHitString

public java.lang.String standardHitString(int weaponClass,
                                          int damageAmount,
                                          java.lang.String weaponName)
Specified by:
standardHitString in interface CombatLibrary

healthDescs

public java.lang.String[] healthDescs()

standardMobCondition

public java.lang.String standardMobCondition(MOB viewer,
                                             MOB mob)
Specified by:
standardMobCondition in interface CombatLibrary

resistanceMsgs

public void resistanceMsgs(CMMsg msg,
                           MOB source,
                           MOB target)
Specified by:
resistanceMsgs in interface CombatLibrary

handleBeingHealed

public void handleBeingHealed(CMMsg msg)
Specified by:
handleBeingHealed in interface CombatLibrary

bleedableWeapon

protected boolean bleedableWeapon(Environmental E)

handleBeingDamaged

public void handleBeingDamaged(CMMsg msg)
Specified by:
handleBeingDamaged in interface CombatLibrary

handleDeath

public void handleDeath(CMMsg msg)
Specified by:
handleDeath in interface CombatLibrary

handleObserveDeath

public void handleObserveDeath(MOB observer,
                               MOB fighting,
                               CMMsg msg)
Specified by:
handleObserveDeath in interface CombatLibrary

handleBeingAssaulted

public void handleBeingAssaulted(CMMsg msg)
Specified by:
handleBeingAssaulted in interface CombatLibrary

makeFollowersFight

public void makeFollowersFight(MOB observer,
                               MOB target,
                               MOB source)
Specified by:
makeFollowersFight in interface CombatLibrary

getAllInProximity

public java.util.Vector getAllInProximity(MOB to,
                                          int distance)

establishRange

public void establishRange(MOB source,
                           MOB target,
                           Environmental tool)
Specified by:
establishRange in interface CombatLibrary

subtickAttack

protected void subtickAttack(MOB fighter,
                             Item weapon,
                             int folrange)

subtickBeforeAttack

protected void subtickBeforeAttack(MOB fighter)

subtickAfterAttack

protected void subtickAfterAttack(MOB fighter)

dispenseExperience

public void dispenseExperience(java.util.HashSet killers,
                               java.util.HashSet dividers,
                               MOB killed)
Description copied from interface: CombatLibrary
For a valid set of killers who are benefitting from having killed the given killed mob, this method will make repeated postExperience calls after having calculated their exp bounty for the kill.

Specified by:
dispenseExperience in interface CombatLibrary
Parameters:
killers - a set of mobs to benefit from the kill
dividers - a set of mobs who must divide the xp.. usually subset of killers
killed - the mob killed
See Also:
ExpLevelLibrary.postExperience(MOB, MOB, String, int, boolean)

tickCombat

public void tickCombat(MOB fighter)
Specified by:
tickCombat in interface CombatLibrary

isKnockedOutUponDeath

public boolean isKnockedOutUponDeath(MOB mob,
                                     MOB fighting)
Specified by:
isKnockedOutUponDeath in interface CombatLibrary

handleConsequences

public boolean handleConsequences(MOB mob,
                                  MOB fighting,
                                  java.lang.String whatToDo,
                                  int[] lostExperience,
                                  java.lang.String message)
Specified by:
handleConsequences in interface CombatLibrary