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
protected  java.util.LinkedList<CMath.CompiledOperation> armorAdjustmentFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> attackAdjustmentFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> attackerFudgeBonusFormula
           
 java.lang.String[][] hitWordIndex
           
 java.lang.String[][] hitWordsChanged
           
 long lastRes
           
 java.lang.String lastStr
           
protected  java.util.LinkedList<CMath.CompiledOperation> meleeFudgeDamageFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> rangedFudgeDamageFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> spellCritChanceFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> spellCritDmgFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> spellFudgeDamageFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> staticMeleeDamageFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> staticRangedDamageFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> targetedMeleeDamageFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> targetedRangedDamageFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> weaponCritChanceFormula
           
protected  java.util.LinkedList<CMath.CompiledOperation> weaponCritDmgFormula
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CombatLibrary
COMBAT_DEFAULT, COMBAT_MANUAL, COMBAT_QUEUE
 
Constructor Summary
MUDFight()
           
 
Method Summary
 boolean activate()
           
 int adjustedArmor(MOB mob)
           
 int adjustedAttackBonus(MOB mob, MOB target)
           
 int adjustedDamage(MOB mob, Weapon weapon, MOB target)
           
 java.util.Set<MOB> allCombatants(MOB mob)
           
 java.util.Set<MOB> allPossibleCombatants(MOB mob, boolean beRuthless)
           
 java.lang.String armorStr(MOB mob)
           
protected  boolean bleedableWeapon(Environmental E)
           
 void dispenseExperience(java.util.Set<MOB> killers, java.util.Set<MOB> 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(MOB mob)
           
 java.util.Vector getAllInProximity(MOB to, int distance)
           
 java.util.Set<MOB> getCombatBeneficiaries(MOB killer, MOB killed, CharClass combatCharClass)
           
protected  java.util.Set<MOB> getCombatBeneficiaries(MOB killer, MOB killed, Room deathRoom, java.util.Set<MOB> beneficiaries, CharClass combatCharClass)
           
 java.util.Set<MOB> getCombatDividers(MOB killer, MOB killed, CharClass combatCharClass)
           
protected  java.util.Set<MOB> getCombatDividers(MOB killer, MOB killed, Room deathRoom, java.util.Set<MOB> dividers, CharClass combatCharClass)
           
 CharClass getCombatDominantClass(MOB killer, MOB killed)
           
 MOB getFollowedLeader(MOB mob)
           
 java.util.List<MOB>[] getFormation(MOB mob)
           
 int getFormationAbsOrder(MOB mob)
           
 java.util.List<MOB> getFormationFollowed(MOB mob)
           
 void handleBeingAssaulted(CMMsg msg)
           
 void handleBeingDamaged(CMMsg msg)
           
 void handleBeingHealed(CMMsg msg)
           
 boolean handleConsequences(MOB mob, MOB fighting, java.lang.String[] commands, 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)
           
 int modifySpellDamage(MOB attacker, MOB target, int baseDamage)
           
 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.List<MOB>[] done, MOB leader, int level)
           
 java.util.Set<MOB> properTargets(Ability A, MOB caster, boolean beRuthless)
           
 void propertiesLoaded()
           
 java.lang.String replaceDamageTag(java.lang.String str, int damage, int damageType, char sourceTargetSTO)
           
 void resistanceMsgs(CMMsg msg, MOB source, MOB target)
           
 boolean rollToHit(int attack, int defence, int adjustment)
           
 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
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
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

attackAdjustmentFormula

protected java.util.LinkedList<CMath.CompiledOperation> attackAdjustmentFormula

armorAdjustmentFormula

protected java.util.LinkedList<CMath.CompiledOperation> armorAdjustmentFormula

attackerFudgeBonusFormula

protected java.util.LinkedList<CMath.CompiledOperation> attackerFudgeBonusFormula

spellFudgeDamageFormula

protected java.util.LinkedList<CMath.CompiledOperation> spellFudgeDamageFormula

spellCritChanceFormula

protected java.util.LinkedList<CMath.CompiledOperation> spellCritChanceFormula

spellCritDmgFormula

protected java.util.LinkedList<CMath.CompiledOperation> spellCritDmgFormula

targetedRangedDamageFormula

protected java.util.LinkedList<CMath.CompiledOperation> targetedRangedDamageFormula

rangedFudgeDamageFormula

protected java.util.LinkedList<CMath.CompiledOperation> rangedFudgeDamageFormula

targetedMeleeDamageFormula

protected java.util.LinkedList<CMath.CompiledOperation> targetedMeleeDamageFormula

meleeFudgeDamageFormula

protected java.util.LinkedList<CMath.CompiledOperation> meleeFudgeDamageFormula

staticRangedDamageFormula

protected java.util.LinkedList<CMath.CompiledOperation> staticRangedDamageFormula

staticMeleeDamageFormula

protected java.util.LinkedList<CMath.CompiledOperation> staticMeleeDamageFormula

weaponCritChanceFormula

protected java.util.LinkedList<CMath.CompiledOperation> weaponCritChanceFormula

weaponCritDmgFormula

protected java.util.LinkedList<CMath.CompiledOperation> weaponCritDmgFormula
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

activate

public boolean activate()
Specified by:
activate in interface CMLibrary
Overrides:
activate in class StdLibrary

propertiesLoaded

public void propertiesLoaded()
Specified by:
propertiesLoaded in interface CMLibrary
Overrides:
propertiesLoaded in class StdLibrary

allPossibleCombatants

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

properTargets

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

adjustedAttackBonus

public int adjustedAttackBonus(MOB mob,
                               MOB target)
Specified by:
adjustedAttackBonus in interface CombatLibrary

adjustedArmor

public int adjustedArmor(MOB mob)
Specified by:
adjustedArmor 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,
                         int adjustment)
Specified by:
rollToHit in interface CombatLibrary

allCombatants

public java.util.Set<MOB> 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,
                                         char sourceTargetSTO)
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

modifySpellDamage

public int modifySpellDamage(MOB attacker,
                             MOB target,
                             int baseDamage)

adjustedDamage

public int adjustedDamage(MOB mob,
                          Weapon weapon,
                          MOB target)
Specified by:
adjustedDamage 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.List<MOB>[] 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.List<MOB>[] getFormation(MOB mob)
Specified by:
getFormation in interface CombatLibrary

getFormationFollowed

public java.util.List<MOB> 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.Set<MOB> getCombatBeneficiaries(MOB killer,
                                                    MOB killed,
                                                    Room deathRoom,
                                                    java.util.Set<MOB> beneficiaries,
                                                    CharClass combatCharClass)

getCombatBeneficiaries

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

getCombatDividers

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

getCombatDividers

public java.util.Set<MOB> 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(MOB mob)
Specified by:
armorStr in interface CombatLibrary

fightingProwessStr

public java.lang.String fightingProwessStr(MOB mob)
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.Set<MOB> killers,
                               java.util.Set<MOB> 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[] commands,
                                  int[] lostExperience,
                                  java.lang.String message)
Specified by:
handleConsequences in interface CombatLibrary