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, Tickable, CMLibrary, CombatLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class MUDFight
extends StdLibrary
implements CombatLibrary


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CombatLibrary
CombatLibrary.CombatSystem
 
Field Summary
protected  CMath.CompiledFormula armorAdjustmentFormula
           
protected  CMath.CompiledFormula attackAdjustmentFormula
           
protected  CMath.CompiledFormula attackerFudgeBonusFormula
           
 java.lang.Object[][][] hitWordIndex
           
 java.lang.Object[][][] hitWordsChanged
           
protected  CMath.CompiledFormula individualCombatExpFormula
           
 long lastRes
           
 java.lang.String lastStr
           
protected  CMath.CompiledFormula meleeFudgeDamageFormula
           
protected  CMath.CompiledFormula pvpAttackerFudgeBonusFormula
           
protected  CMath.CompiledFormula pvpMeleeFudgeDamageFormula
           
protected  CMath.CompiledFormula pvpRangedFudgeDamageFormula
           
protected  CMath.CompiledFormula pvpSpellCritChanceFormula
           
protected  CMath.CompiledFormula pvpSpellCritDmgFormula
           
protected  CMath.CompiledFormula pvpSpellFudgeDamageFormula
           
protected  CMath.CompiledFormula pvpTargetedMeleeDamageFormula
           
protected  CMath.CompiledFormula pvpTargetedRangedDamageFormula
           
protected  CMath.CompiledFormula pvpWeaponCritChanceFormula
           
protected  CMath.CompiledFormula pvpWeaponCritDmgFormula
           
protected  CMath.CompiledFormula rangedFudgeDamageFormula
           
protected  CMath.CompiledFormula spellCritChanceFormula
           
protected  CMath.CompiledFormula spellCritDmgFormula
           
protected  CMath.CompiledFormula spellFudgeDamageFormula
           
protected  CMath.CompiledFormula stateHitPointRecoverFormula
           
protected  CMath.CompiledFormula stateManaRecoverFormula
           
protected  CMath.CompiledFormula stateMovesRecoverFormula
           
protected  CMath.CompiledFormula staticMeleeDamageFormula
           
protected  CMath.CompiledFormula staticRangedDamageFormula
           
protected  CMath.CompiledFormula targetedMeleeDamageFormula
           
protected  CMath.CompiledFormula targetedRangedDamageFormula
           
protected  CMath.CompiledFormula totalCombatExperienceFormula
           
protected  CMath.CompiledFormula weaponCritChanceFormula
           
protected  CMath.CompiledFormula weaponCritDmgFormula
           
 
Fields inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
isDebugging, name, serviceClient, tickStatus
 
Fields inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CombatLibrary
TICKS_PER_SHIP_COMBAT
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Constructor Summary
MUDFight()
           
 
Method Summary
 boolean activate()
          Activates the library.
 int adjustedArmor(int armorValue)
          Returns the given armor value, after adjusting for hunger, thirst, fatigue, position, and dexterity.
 int adjustedArmor(MOB mob)
          Returns the given mobs armor, after adjusting for hunger, thirst, fatigue, position, and dexterity.
 int adjustedAttackBonus(int baseAttack)
          Returns the given attack bonus, after adjusting for hunger, thirst, fatigue, position, and strength.
 int adjustedAttackBonus(MOB mob, MOB target)
          Returns the given mobs attack bonus, after adjusting for hunger, thirst, fatigue, position, and strength.
 int adjustedDamage(int baseDamage, int level, boolean biasHigh)
          Returns the given unarmed damage bonus, after adjusting for hunger, thirst, fatigue, position, and strength, from the proper damage formula, which assumes a standard unarmed mob with average stats.
 int adjustedDamage(MOB mob, Weapon weapon, MOB target, int bonusDamage, boolean allowCrits, boolean biasHigh)
          Returns the given mob (or weapons, if provided) damage bonus, after adjusting for hunger, thirst, fatigue, position, and strength, from the proper damage formula, which depends on the weapon and the target.
 java.util.Set<MOB> allCombatants(MOB mob)
          If the given mob is not in combat, this returns null.
 java.util.Set<MOB> allPossibleCombatants(MOB mob, boolean includePlayers)
          Returns all the mobs in the same room as the given mob, which that aren't in the mobs group.
 java.lang.String armorStr(MOB mob)
          Returns the friendly armor string for the given mob, describing how well armored they are.
protected  boolean bleedableWeapon(Environmental E)
           
 boolean checkDamageSaves(MOB mob, CMMsg msg)
          Checks to see if the given message gets a saving throw for the given mob damage and, if so, adjusts it
 boolean checkSavingThrows(MOB mob, CMMsg msg)
          Checks to see if the given message gets a saving throw for the given mob and, if so, applies it.
 java.lang.String damageProwessStr(MOB mob)
          Returns the friendly damage prowess string for the given mob, describing how well damagy they are.
 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 doDeathPostProcessing(CMMsg msg)
          When a death occurs, there are certain record keeping processes that need to happen.
 boolean doTurnBasedCombat(MOB mob, Room R, Area A)
          The heart of the alternative turn-based combat engine, this method is called every tick to determine if it is the given mobs turn to fight.
 void establishRange(MOB source, MOB target, Environmental tool)
          Given an attacking source and a defending target and the sources weapon or skill, this method will set the distance between the source and target from each other.
 void expendEnergy(MOB mob, boolean expendMovement)
          Every tick, THIS method is called to make the given mob a little more hungry and thirsty.
 java.lang.String fightingProwessStr(MOB mob)
          Returns the friendly attack string for the given mob, describing how well attacky they are.
 void forcePeaceAllFightingAgainst(MOB mob, java.util.Set<MOB> exceptionSet)
          Forces all the mobs in the same room to stop fighting the given mob, with possible exceptions.
 java.util.Set<MOB> getAllFightingAgainst(MOB mob, java.util.Set<MOB> set)
          Returns all the mobs in the same room as the given mob who are attacking the given mob, and puts them in the given set.
 java.util.List<MOB> getAllInProximity(MOB to, int distance)
           
 MOB getBreatheKiller(MOB victim)
          When a mob can't breathe, it actually takes some work to figure out if anyone is to blame.
 java.util.Set<MOB> getCombatBeneficiaries(MOB killer, MOB killed, CharClass combatCharClass)
          Returns all the mobs set to benefit from the death of the given killed mob by the given killer.
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)
          Returns all the mobs for whom experience awards must be divided before awarding.
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)
          Returns the character class of the given killer, or their leader if they are following someone who is not a mob.
 MOB getCombatDominentKiller(MOB killer, MOB killed)
           
protected  java.lang.String getExtremeValue(int extreme)
           
 MOB getFollowedLeader(MOB mob)
          Returns the front of the follower line for this mob.
 java.util.List<MOB>[] getFormation(MOB mob)
          Returns this mobs combat formation an an array of string lists, where each entry is a "row" in the formation, and the lists contain the mobs at that row.
 int getFormationAbsOrder(MOB mob)
          Returns the numeric position of the given mob in his or her combat formation.
 java.util.List<MOB> getFormationFollowed(MOB mob)
          Returns the list of mobs behind the given mob in their respective formation order.
 int getShipHullPoints(BoardableShip ship)
          Returns the number of base hull points that the given ship has.
protected  java.lang.String getStandardHitWordInternal(int type, int damnCode)
           
 int getTickStatus()
          A coded status for this object during the period where its tick method is being called.
protected  int getWeaponAttackIndex(int weaponDamageType, int weaponClassification)
           
 void handleBeingAssaulted(CMMsg msg)
          When an attack message targeting a given mob is received, this method is called to react to the attack.
 void handleBeingDamaged(CMMsg msg)
          When a damaging message targeting a given mob is received, this method is called to actually do the damaging.
 void handleBeingGravitied(MOB mob, CMMsg msg)
          Handles the effects of extreme gravity and other acceleration as from a ship.
 void handleBeingHealed(CMMsg msg)
          When a healing message targeting a given mob is received, this method is called to actually do the healing.
 boolean handleCombatLossConsequences(MOB deadM, MOB killerM, java.lang.String[] consequences, int[] lostExperience, java.lang.String message)
          When a player dies or flees, the system coffeemud.ini file defines the consequences of losing the fight.
 boolean handleDamageSpam(MOB observerM, Physical target, int amount)
          When a player has nobattlespam, this method is called when damage is observed to add to the totals.
 void handleDamageSpamSummary(MOB mob)
          When a player has nobattlespam, this method is called when damage is observed to report the totals from the last combat round.
 void handleDeath(CMMsg msg)
          When a death message is received by a mob and the message has the mob as a source, this method is called to kill the source of the message off.
 void handleObserveDeath(MOB observer, MOB fighting, CMMsg msg)
          When an observer observes a death, this method is called is called to have the observer react.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isAShipSiegeWeapon(Item I)
          Returns whether the given item is classified as a ammunition firing siege weapon, as used on a sailing ship.
 boolean isKnockedOutUponDeath(MOB deadM, MOB killerM)
          Returns whether the system properties specify that, when the given dead mob does by the hand of the given killer mob, that the dead mob won't actually die, but just be knocked out.
protected  DeadBody justDie(MOB source, MOB target)
           
 void makeFollowersFight(MOB observerM, MOB defenderM, MOB attackerM)
          When the given observerM witnesses the given attacker mob attacking the given defender mob, this method checks to see if the observer has a dog in the fight, and if they do, causes them to start fighting either the attacker or the defender.
 void makePeaceInGroup(MOB mob)
          This strange method makes sure that none of the mobs in the given mobs group are fighting each other.
 boolean mayIAttackThisVessel(MOB mob, PhysicalAgent defender)
          Returns whether the given attacking mob, on the given attacker ship, may attack the people and property of the given defending ship.
 int modifySpellDamage(MOB attacker, MOB target, int baseDamage)
           
protected static boolean ownerSecurityCheck(java.lang.String ownerName, MOB mob)
           
protected  void pickNextVictim(MOB observer, MOB deadmob, java.util.Set<MOB> deadGroupH)
           
 boolean postAttack(MOB attacker, MOB target, Item weapon)
          This method causes a mundane attack to occur by the given attack to the given target using the given weapon.
 void postDamage(MOB attacker, MOB target, Environmental weapon, int damage, int messageCode, int damageType, java.lang.String allDisplayMessage)
          The official way to post damage that is happening.
 void postDeath(MOB killerM, MOB deadM, CMMsg addHere)
          This method will create an official death message for the given deadM mob, by the given killerM mob.
 boolean postHealing(MOB healer, MOB target, Ability tool, int healing, int messageCode, java.lang.String allDisplayMessage)
          Posts a message of healing from the given healer to the given target using the given optional Ability tool.
 void postItemDamage(MOB mob, Item I, Environmental tool, int damageAmount, int messageType, java.lang.String message)
          This method handles an item taking damage.
 void postPanic(MOB mob, CMMsg addHere)
          When a mobs hit points fall below the wimp level, they panic, which often causes the mob to flee.
 boolean postRevengeAttack(MOB attacker, MOB defender)
          If an NPC attacker comes under the sudden effect of a spell, and knows who is responsible, but are not presently in combat, this method will start combat with them.
 boolean postShipAttack(MOB attacker, PhysicalAgent attackingShip, PhysicalAgent target, Weapon weapon, boolean wasAHit)
          This method causes a mundane attack by the given attacking mob (which may be a fake factory mob) on the given attacking ship against the given target ship with the given siege weapon.
 void postShipWeaponAttackResult(MOB source, PhysicalAgent attacker, PhysicalAgent defender, Weapon weapon, boolean success)
          This method handles both a hit or a miss with a weapon between two ships in combat.
 CMMsg postWeaponAttackResult(MOB source, MOB target, Item item, boolean success)
          This method handles both a hit or a miss with a weapon.
 CMMsg postWeaponDamage(MOB source, MOB target, Item item, int damageInt)
          An alternative to CombatLibrary.postWeaponAttackResult(MOB, MOB, Item, boolean).
protected  void processFormation(java.util.List<MOB>[] done, MOB leader, int level)
           
 java.util.Set<MOB> properTargets(Ability A, MOB caster, boolean includePlayers)
          Returns all the potential targets for the given ability, in the same room as the given mob.
 void propertiesLoaded()
          This method is called whenever system properties are altered by the user.
 void recoverTick(MOB mob)
          Every tick, this method is called.
 java.lang.String replaceDamageTag(java.lang.String str, int damage, int damageType, CMMsg.View sourceTargetSTO)
          Because damage messages are basically always modified in message preview (okMessage), there is no point in putting the amount of damage into the message string.
 void resistanceMsgs(MOB source, MOB target, CMMsg msg)
          When the source does something to the target that the target resists, and the given message has a targetminor containing the type of damage that's being resisted, this message will generate and tack on a new message with the resistance of the target, and flag the given message as having been resisted.
 boolean rollToHit(int attack, int defence, int adjustment)
          Given the exact attack score, against the given defense score, and the given percentage adjustment.
 boolean rollToHit(MOB attacker, MOB defender)
          Gathers the given attackers adjusted attack and the given defenders adjusted armor, applies a fudge factor, and makes a to-hit roll.
protected  void runSpecialCombat()
           
 boolean shutdown()
          Shuts down the library.
 java.lang.String standardHitString(int weaponDamageType, int weaponClass, int damageAmount, java.lang.String weaponName)
          Given the weapon type and classification and name, this method returns either the fullly filled out weapon hit/damage string from the lists.ini file that matches.
 java.lang.String standardHitWord(int type, double pct)
          Given the weapon type and percent of damage 0 to 1, this method returns the hit/damage string from the lists.ini file that matches.
 java.lang.String standardHitWord(int type, int damage)
          Given the weapon type and amount of damage, this method returns the hit/damage string from the lists.ini file that matches.
 java.lang.String standardMissString(int weaponDamageType, int weaponClassification, java.lang.String weaponName, boolean useExtendedMissString)
          Given the weapon type and classification and name, this method returns either the fullly filled out weapon miss string, or generic non-extended non-weapon miss string from the lists.ini file that matches.
 java.lang.String standardMobCondition(MOB viewer, MOB mob)
          When a particular race does not provide its own override health condition message, this method provides the base message from the list.ini file.
protected  void subtickAfterAttack(MOB fighter)
           
protected  void subtickAttack(MOB fighter, Item weapon, int folrange)
           
protected  void subtickBeforeAttack(MOB fighter, CombatLibrary.CombatSystem combatSystem)
           
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
protected  void tickAllShips()
           
 void tickCombat(MOB fighter)
          This is the heart of the main combat engine.
 
Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
checkDatabase, compareTo, copyOf, getServiceClient, initializeClass, L, name, newInstance, setThreadStatus
 
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
getServiceClient, L
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, name, 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.Object[][][] hitWordIndex

hitWordsChanged

public java.lang.Object[][][] hitWordsChanged

attackAdjustmentFormula

protected CMath.CompiledFormula attackAdjustmentFormula

armorAdjustmentFormula

protected CMath.CompiledFormula armorAdjustmentFormula

attackerFudgeBonusFormula

protected CMath.CompiledFormula attackerFudgeBonusFormula

pvpAttackerFudgeBonusFormula

protected CMath.CompiledFormula pvpAttackerFudgeBonusFormula

spellFudgeDamageFormula

protected CMath.CompiledFormula spellFudgeDamageFormula

pvpSpellFudgeDamageFormula

protected CMath.CompiledFormula pvpSpellFudgeDamageFormula

spellCritChanceFormula

protected CMath.CompiledFormula spellCritChanceFormula

pvpSpellCritChanceFormula

protected CMath.CompiledFormula pvpSpellCritChanceFormula

spellCritDmgFormula

protected CMath.CompiledFormula spellCritDmgFormula

pvpSpellCritDmgFormula

protected CMath.CompiledFormula pvpSpellCritDmgFormula

targetedRangedDamageFormula

protected CMath.CompiledFormula targetedRangedDamageFormula

pvpTargetedRangedDamageFormula

protected CMath.CompiledFormula pvpTargetedRangedDamageFormula

rangedFudgeDamageFormula

protected CMath.CompiledFormula rangedFudgeDamageFormula

pvpRangedFudgeDamageFormula

protected CMath.CompiledFormula pvpRangedFudgeDamageFormula

targetedMeleeDamageFormula

protected CMath.CompiledFormula targetedMeleeDamageFormula

pvpTargetedMeleeDamageFormula

protected CMath.CompiledFormula pvpTargetedMeleeDamageFormula

meleeFudgeDamageFormula

protected CMath.CompiledFormula meleeFudgeDamageFormula

pvpMeleeFudgeDamageFormula

protected CMath.CompiledFormula pvpMeleeFudgeDamageFormula

staticRangedDamageFormula

protected CMath.CompiledFormula staticRangedDamageFormula

staticMeleeDamageFormula

protected CMath.CompiledFormula staticMeleeDamageFormula

weaponCritChanceFormula

protected CMath.CompiledFormula weaponCritChanceFormula

pvpWeaponCritChanceFormula

protected CMath.CompiledFormula pvpWeaponCritChanceFormula

weaponCritDmgFormula

protected CMath.CompiledFormula weaponCritDmgFormula

pvpWeaponCritDmgFormula

protected CMath.CompiledFormula pvpWeaponCritDmgFormula

stateHitPointRecoverFormula

protected CMath.CompiledFormula stateHitPointRecoverFormula

stateManaRecoverFormula

protected CMath.CompiledFormula stateManaRecoverFormula

stateMovesRecoverFormula

protected CMath.CompiledFormula stateMovesRecoverFormula

totalCombatExperienceFormula

protected CMath.CompiledFormula totalCombatExperienceFormula

individualCombatExpFormula

protected CMath.CompiledFormula individualCombatExpFormula
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, Tech. 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()
Description copied from interface: CMLibrary
Activates the library. This is called after the mud is booted, but before connections are accepted.

Specified by:
activate in interface CMLibrary
Overrides:
activate in class StdLibrary
Returns:
true if activation was successful, false if you're screwed
See Also:
CMLibrary.shutdown()

propertiesLoaded

public void propertiesLoaded()
Description copied from interface: CMLibrary
This method is called whenever system properties are altered by the user. This allows the library to react to any important properties they monitor.

Specified by:
propertiesLoaded in interface CMLibrary
Overrides:
propertiesLoaded in class StdLibrary

allPossibleCombatants

public java.util.Set<MOB> allPossibleCombatants(MOB mob,
                                                boolean includePlayers)
Description copied from interface: CombatLibrary
Returns all the mobs in the same room as the given mob, which that aren't in the mobs group. It doesn't check combatability, and as such, is pretty loose.

Specified by:
allPossibleCombatants in interface CombatLibrary
Parameters:
mob - the mob to check
includePlayers - true to include players, false not
Returns:
the set of mobs who might be a future combatant
See Also:
CombatLibrary.allCombatants(MOB), CombatLibrary.properTargets(Ability, MOB, boolean)

properTargets

public java.util.Set<MOB> properTargets(Ability A,
                                        MOB caster,
                                        boolean includePlayers)
Description copied from interface: CombatLibrary
Returns all the potential targets for the given ability, in the same room as the given mob. If the skill is non-malicious, it returns the mobs groups members, if the mob is in combat, it returns the mobs in combat with him/her, and if the skill is malicious, it returns all potential combatants.

Specified by:
properTargets in interface CombatLibrary
Parameters:
A - the skill you want targets for
caster - the user of the skill
includePlayers - true to include players, false otherwise
Returns:
the proper targets for the given skill
See Also:
CombatLibrary.allCombatants(MOB), CombatLibrary.allPossibleCombatants(MOB, boolean)

adjustedAttackBonus

public int adjustedAttackBonus(MOB mob,
                               MOB target)
Description copied from interface: CombatLibrary
Returns the given mobs attack bonus, after adjusting for hunger, thirst, fatigue, position, and strength.

Specified by:
adjustedAttackBonus in interface CombatLibrary
Parameters:
mob - the mob whose attack bonus needs adjusting
target - i guess this is who they are fighting
Returns:
the given mobs adjusted attack bonus
See Also:
PhyStats.armor()

adjustedAttackBonus

public int adjustedAttackBonus(int baseAttack)
Description copied from interface: CombatLibrary
Returns the given attack bonus, after adjusting for hunger, thirst, fatigue, position, and strength. Assumes an average mob otherwise.

Specified by:
adjustedAttackBonus in interface CombatLibrary
Parameters:
baseAttack - the base attack bonus to work from.
Returns:
the given adjusted attack bonus
See Also:
PhyStats.armor()

postItemDamage

public void postItemDamage(MOB mob,
                           Item I,
                           Environmental tool,
                           int damageAmount,
                           int messageType,
                           java.lang.String message)
Description copied from interface: CombatLibrary
This method handles an item taking damage. If the item is subject to wear and tear, it will take the amount of specific damage given until it gets below 0, after which it is destroyed. If the item is not subject to wear and tear, any positive damage destroys the item.

Specified by:
postItemDamage in interface CombatLibrary
Parameters:
mob - the mob doing damage to an item
I - the item being damaged
tool - the weapon or skill used to do the damage
damageAmount - the amount of damage done (0-100)
messageType - the CMMsg message code for source and others
message - the message string

doTurnBasedCombat

public boolean doTurnBasedCombat(MOB mob,
                                 Room R,
                                 Area A)
Description copied from interface: CombatLibrary
The heart of the alternative turn-based combat engine, this method is called every tick to determine if it is the given mobs turn to fight. If it is not the method returns false, and if it is, true

Specified by:
doTurnBasedCombat in interface CombatLibrary
Parameters:
mob - the mob who wants to fight
R - the room the mob is in
A - the area the room is in
Returns:
true if its time to fight, false otherwise

adjustedArmor

public int adjustedArmor(MOB mob)
Description copied from interface: CombatLibrary
Returns the given mobs armor, after adjusting for hunger, thirst, fatigue, position, and dexterity.

Specified by:
adjustedArmor in interface CombatLibrary
Parameters:
mob - the mob whose armor needs adjusting
Returns:
the given mobs adjusted armor value
See Also:
PhyStats.armor()

adjustedArmor

public int adjustedArmor(int armorValue)
Description copied from interface: CombatLibrary
Returns the given armor value, after adjusting for hunger, thirst, fatigue, position, and dexterity. Assumes an average random mob.

Specified by:
adjustedArmor in interface CombatLibrary
Parameters:
armorValue - the base armor value to start from
Returns:
the given adjusted armor value
See Also:
PhyStats.armor()

rollToHit

public boolean rollToHit(MOB attacker,
                         MOB defender)
Description copied from interface: CombatLibrary
Gathers the given attackers adjusted attack and the given defenders adjusted armor, applies a fudge factor, and makes a to-hit roll.

Specified by:
rollToHit in interface CombatLibrary
Parameters:
attacker - the attacking mob
defender - the mob being attacked
Returns:
true if the hit roll succeeded, false if it failed
See Also:
CombatLibrary.rollToHit(int, int, int)

rollToHit

public boolean rollToHit(int attack,
                         int defence,
                         int adjustment)
Description copied from interface: CombatLibrary
Given the exact attack score, against the given defense score, and the given percentage adjustment.

Specified by:
rollToHit in interface CombatLibrary
Parameters:
attack - the attack score
defence - the armor score
adjustment - the percentage adjustment
Returns:
true if the attack roll succeeds, false if it fails.
See Also:
CombatLibrary.rollToHit(MOB, MOB)

allCombatants

public java.util.Set<MOB> allCombatants(MOB mob)
Description copied from interface: CombatLibrary
If the given mob is not in combat, this returns null. Otherwise, it returns all the mobs in the same room that are fighting the mob, or a follower.

Specified by:
allCombatants in interface CombatLibrary
Parameters:
mob - the fighting mob
Returns:
the set of combatants.
See Also:
CombatLibrary.allPossibleCombatants(MOB, boolean), CombatLibrary.properTargets(Ability, MOB, boolean)

makePeaceInGroup

public void makePeaceInGroup(MOB mob)
Description copied from interface: CombatLibrary
This strange method makes sure that none of the mobs in the given mobs group are fighting each other.

Specified by:
makePeaceInGroup in interface CombatLibrary
Parameters:
mob - the mob whose group needs peace.

postPanic

public void postPanic(MOB mob,
                      CMMsg addHere)
Description copied from interface: CombatLibrary
When a mobs hit points fall below the wimp level, they panic, which often causes the mob to flee. This method will initiate that process by causing a combat panic, and either posting it to the room, or adding it as a trailer to the given msg. Generates a CMMsg message and sends it to the mobs room.

Specified by:
postPanic in interface CombatLibrary
Parameters:
mob - the mob who is panicing
addHere - null, or the message to add the panic to
See Also:
CombatLibrary.postDeath(MOB, MOB, CMMsg)

postDeath

public void postDeath(MOB killerM,
                      MOB deadM,
                      CMMsg addHere)
Description copied from interface: CombatLibrary
This method will create an official death message for the given deadM mob, by the given killerM mob. It will then either post it, or add it as a trailer to the given msg Generates a CMMsg message and sends it to the target room.

Specified by:
postDeath in interface CombatLibrary
Parameters:
killerM - the killer mob
deadM - the dead mob
addHere - null, or the message to add this one to.
See Also:
CombatLibrary.postPanic(MOB, CMMsg)

postAttack

public boolean postAttack(MOB attacker,
                          MOB target,
                          Item weapon)
Description copied from interface: CombatLibrary
This method causes a mundane attack to occur by the given attack to the given target using the given weapon. If no weapon is given, it might attempt a draw first. Generates a CMMsg message and sends it to the target room.

Specified by:
postAttack in interface CombatLibrary
Parameters:
attacker - the attacker mob
target - the target mob
weapon - the weapon used by the attacker, or null
Returns:
true if the attack succeeded, false if it failed.

ownerSecurityCheck

protected static boolean ownerSecurityCheck(java.lang.String ownerName,
                                            MOB mob)

mayIAttackThisVessel

public boolean mayIAttackThisVessel(MOB mob,
                                    PhysicalAgent defender)
Description copied from interface: CombatLibrary
Returns whether the given attacking mob, on the given attacker ship, may attack the people and property of the given defending ship.

Specified by:
mayIAttackThisVessel in interface CombatLibrary
Parameters:
mob - the agent attacker
defender - the attacked ship
Returns:
true if an attack is authorized, false otherwise

getShipHullPoints

public final int getShipHullPoints(BoardableShip ship)
Description copied from interface: CombatLibrary
Returns the number of base hull points that the given ship has.

Specified by:
getShipHullPoints in interface CombatLibrary
Parameters:
ship - the ship to get points for
Returns:
the base hull points of the ship

isAShipSiegeWeapon

public final boolean isAShipSiegeWeapon(Item I)
Description copied from interface: CombatLibrary
Returns whether the given item is classified as a ammunition firing siege weapon, as used on a sailing ship.

Specified by:
isAShipSiegeWeapon in interface CombatLibrary
Parameters:
I - the item to check
Returns:
true if its a siege weapon, false otherwise

postShipAttack

public boolean postShipAttack(MOB attacker,
                              PhysicalAgent attackingShip,
                              PhysicalAgent target,
                              Weapon weapon,
                              boolean wasAHit)
Description copied from interface: CombatLibrary
This method causes a mundane attack by the given attacking mob (which may be a fake factory mob) on the given attacking ship against the given target ship with the given siege weapon.

Specified by:
postShipAttack in interface CombatLibrary
Parameters:
attacker - the attacking agent mob
attackingShip - the ship the attacker is on
target - the target ship
weapon - the siege weapon used
wasAHit - true to register a hit, false to register an attack
Returns:
true if the attack succeeded, false if it failed

postHealing

public boolean postHealing(MOB healer,
                           MOB target,
                           Ability tool,
                           int healing,
                           int messageCode,
                           java.lang.String allDisplayMessage)
Description copied from interface: CombatLibrary
Posts a message of healing from the given healer to the given target using the given optional Ability tool. There are no optional parameters here, except the msg of course Generates a CMMsg message and sends it to the target room.

Specified by:
postHealing in interface CombatLibrary
Parameters:
healer - the healer mob
target - the target mob being healed
tool - the skill doing the healing, or null
healing - the amount of healing to do
messageCode - msg code for the source and others code
allDisplayMessage - the string to show everyone
Returns:
true if the healing post worked, false otherwise

replaceDamageTag

public java.lang.String replaceDamageTag(java.lang.String str,
                                         int damage,
                                         int damageType,
                                         CMMsg.View sourceTargetSTO)
Description copied from interface: CombatLibrary
Because damage messages are basically always modified in message preview (okMessage), there is no point in putting the amount of damage into the message string. Because of this the string <DAMAGE> or <DAMAGES> is put as a placeholder, and then this method is called to replace those tags with actual damage words based on the given final amount and the given weapon type, and a clue as to who would see the message

Specified by:
replaceDamageTag in interface CombatLibrary
Parameters:
str - the original string with the appropriate tag
damage - the final amount of damage
damageType - the weapon type code Weapon.TYPE_BASHING
sourceTargetSTO - the view of the message
Returns:
the final modified string
See Also:
CMMsg.View, CombatLibrary.postDamage(MOB, MOB, Environmental, int, int, int, String)

forcePeaceAllFightingAgainst

public void forcePeaceAllFightingAgainst(MOB mob,
                                         java.util.Set<MOB> exceptionSet)
Description copied from interface: CombatLibrary
Forces all the mobs in the same room to stop fighting the given mob, with possible exceptions.

Specified by:
forcePeaceAllFightingAgainst in interface CombatLibrary
Parameters:
mob - the mob who needs peace
exceptionSet - null, or a set of mobs not to apply this to.

getAllFightingAgainst

public java.util.Set<MOB> getAllFightingAgainst(MOB mob,
                                                java.util.Set<MOB> set)
Description copied from interface: CombatLibrary
Returns all the mobs in the same room as the given mob who are attacking the given mob, and puts them in the given set.

Specified by:
getAllFightingAgainst in interface CombatLibrary
Parameters:
mob - the mob who is in combat
set - the set to put combatants in, or null to make one
Returns:
the same set sent in

postDamage

public void postDamage(MOB attacker,
                       MOB target,
                       Environmental weapon,
                       int damage,
                       int messageCode,
                       int damageType,
                       java.lang.String allDisplayMessage)
Description copied from interface: CombatLibrary
The official way to post damage that is happening. It generates a message and sends it to the target room. Handles MXP tagging, fight coloring, and other details on the string message. replaceDataTag is called to ensure a proper damage word.

Specified by:
postDamage in interface CombatLibrary
Parameters:
attacker - the attacking mob
target - the target mob being healed
weapon - the item weapon, ability skill, or null tool used to damage
damage - the initial amount of damage
messageCode - msg code for the source and others code
damageType - the weapon type code Weapon.TYPE_BASHING
allDisplayMessage - the message to send
See Also:
CombatLibrary.replaceDamageTag(String, int, int, CMMsg.View)

modifySpellDamage

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

adjustedDamage

public int adjustedDamage(MOB mob,
                          Weapon weapon,
                          MOB target,
                          int bonusDamage,
                          boolean allowCrits,
                          boolean biasHigh)
Description copied from interface: CombatLibrary
Returns the given mob (or weapons, if provided) damage bonus, after adjusting for hunger, thirst, fatigue, position, and strength, from the proper damage formula, which depends on the weapon and the target.

Specified by:
adjustedDamage in interface CombatLibrary
Parameters:
mob - the mob who wants adjusted damage
weapon - the weapon used by the mob against target, or null
target - the target being hit, or null
bonusDamage - any bonus to base damage
allowCrits - true to apply crit if crit damage occurs
biasHigh - random numbers are always biased high
Returns:
the total adjusted damage

adjustedDamage

public int adjustedDamage(int baseDamage,
                          int level,
                          boolean biasHigh)
Description copied from interface: CombatLibrary
Returns the given unarmed damage bonus, after adjusting for hunger, thirst, fatigue, position, and strength, from the proper damage formula, which assumes a standard unarmed mob with average stats.

Specified by:
adjustedDamage in interface CombatLibrary
Parameters:
baseDamage - base damage
level - the level of the mob
biasHigh - random numbers are always biased high
Returns:
the total adjusted damage

recoverTick

public void recoverTick(MOB mob)
Description copied from interface: CombatLibrary
Every tick, this method is called. If the given mob is not in combat, it will help the mob recover some of their hit points, mana, movement, etc.

Specified by:
recoverTick in interface CombatLibrary
Parameters:
mob - the mob who is recovering

postWeaponDamage

public CMMsg postWeaponDamage(MOB source,
                              MOB target,
                              Item item,
                              int damageInt)
Description copied from interface: CombatLibrary
An alternative to CombatLibrary.postWeaponAttackResult(MOB, MOB, Item, boolean). This method handles only a hit with a weapon, which will post damage. Generates a CMMsg message and sends it to the SOURCE room. Call this instead of postAttackResult when the amount of damage done is custom instead of random.

Specified by:
postWeaponDamage in interface CombatLibrary
Parameters:
source - the attacker
target - the target
item - the weapon used
damageInt - the amount of damage done by the weapon
Returns:
the message sent to the source room, or null
See Also:
CombatLibrary.replaceDamageTag(String, int, int, CMMsg.View)

postWeaponAttackResult

public CMMsg postWeaponAttackResult(MOB source,
                                    MOB target,
                                    Item item,
                                    boolean success)
Description copied from interface: CombatLibrary
This method handles both a hit or a miss with a weapon. The hit, obviously, posts damage, while the miss, posts a miss. replaceDataTag is called to ensure a proper damage word. Generates a CMMsg message and sends it to the SOURCE room.

Specified by:
postWeaponAttackResult in interface CombatLibrary
Parameters:
source - the attacker
target - the target
item - the weapon used
success - true if it was a hit with damage, false if it was a miss
Returns:
the message sent to the source room, or null
See Also:
CombatLibrary.replaceDamageTag(String, int, int, CMMsg.View)

postShipWeaponAttackResult

public void postShipWeaponAttackResult(MOB source,
                                       PhysicalAgent attacker,
                                       PhysicalAgent defender,
                                       Weapon weapon,
                                       boolean success)
Description copied from interface: CombatLibrary
This method handles both a hit or a miss with a weapon between two ships in combat. The hit, obviously, posts damage, while the miss, posts a miss. replaceDataTag is called to ensure a proper damage word. Generates a CMMsg message and sends it to the common room.

Specified by:
postShipWeaponAttackResult in interface CombatLibrary
Parameters:
source - the agent of the attack
attacker - the attacker
defender - the target
weapon - the weapon used
success - true if it was a hit with damage, false if it was a miss
See Also:
CombatLibrary.replaceDamageTag(String, int, int, CMMsg.View)

processFormation

protected void processFormation(java.util.List<MOB>[] done,
                                MOB leader,
                                int level)

getFollowedLeader

public MOB getFollowedLeader(MOB mob)
Description copied from interface: CombatLibrary
Returns the front of the follower line for this mob. If this mob is following someone, it returns the MOB being ultimately followed, otherwise it just returns the mob

Specified by:
getFollowedLeader in interface CombatLibrary
Parameters:
mob - the mob who might be following someone
Returns:
the leader mob

getFormation

public java.util.List<MOB>[] getFormation(MOB mob)
Description copied from interface: CombatLibrary
Returns this mobs combat formation an an array of string lists, where each entry is a "row" in the formation, and the lists contain the mobs at that row. Only the leaders formation settings matter, so any mob can be sent, because the leader will be teased out and used.

Specified by:
getFormation in interface CombatLibrary
Parameters:
mob - a member of a group with a formation.
Returns:
the formation.
See Also:
CombatLibrary.getFormationFollowed(MOB), CombatLibrary.getFormationAbsOrder(MOB)

getFormationFollowed

public java.util.List<MOB> getFormationFollowed(MOB mob)
Description copied from interface: CombatLibrary
Returns the list of mobs behind the given mob in their respective formation order.

Specified by:
getFormationFollowed in interface CombatLibrary
Parameters:
mob - the mob in the formation
Returns:
the list of mobs behind the given one
See Also:
CombatLibrary.getFormation(MOB), CombatLibrary.getFormationAbsOrder(MOB)

getFormationAbsOrder

public int getFormationAbsOrder(MOB mob)
Description copied from interface: CombatLibrary
Returns the numeric position of the given mob in his or her combat formation.

Specified by:
getFormationAbsOrder in interface CombatLibrary
Parameters:
mob - the mob in formation
Returns:
the numeric order, with 0 being front.
See Also:
CombatLibrary.getFormationFollowed(MOB), CombatLibrary.getFormation(MOB)

getCombatDominentKiller

public MOB getCombatDominentKiller(MOB killer,
                                   MOB killed)

getCombatDominantClass

public CharClass getCombatDominantClass(MOB killer,
                                        MOB killed)
Description copied from interface: CombatLibrary
Returns the character class of the given killer, or their leader if they are following someone who is not a mob.

Specified by:
getCombatDominantClass in interface CombatLibrary
Parameters:
killer - the killer
killed - the killed
Returns:
the leaders char class
See Also:
CombatLibrary.getCombatDividers(MOB, MOB, CharClass), CombatLibrary.getCombatBeneficiaries(MOB, MOB, CharClass)

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)
Description copied from interface: CombatLibrary
Returns all the mobs set to benefit from the death of the given killed mob by the given killer. This means going through the followers, and asking the classes if they are allowed to benefit from xp.\

Specified by:
getCombatBeneficiaries in interface CombatLibrary
Parameters:
killer - the killer of the killed
killed - the killed one
combatCharClass - the charclass of the killer
Returns:
the set of mobs who get xp from the kill
See Also:
CombatLibrary.getCombatDividers(MOB, MOB, CharClass), CombatLibrary.getCombatDominantClass(MOB, MOB)

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)
Description copied from interface: CombatLibrary
Returns all the mobs for whom experience awards must be divided before awarding. This does not mean the others do not get experience, just that they aren't counted for the purposes of decreasing the experience each member wil get. This is usually used to exclude the mob followers of certain classes.

Specified by:
getCombatDividers in interface CombatLibrary
Parameters:
killer - the killer
killed - the killed the killer killed
combatCharClass - the charclass of the leader (usually)
Returns:
the set of mobs who must decrease experience through division.
See Also:
CombatLibrary.getCombatBeneficiaries(MOB, MOB, CharClass), CombatLibrary.getCombatDominantClass(MOB, MOB)

justDie

protected DeadBody justDie(MOB source,
                           MOB target)

standardHitWord

public java.lang.String standardHitWord(int type,
                                        double pct)
Description copied from interface: CombatLibrary
Given the weapon type and percent of damage 0 to 1, this method returns the hit/damage string from the lists.ini file that matches.

Specified by:
standardHitWord in interface CombatLibrary
Parameters:
type - the weapon type
pct - the percent of damage from 0.0 to 1.0
Returns:
the hit/damage word
See Also:
Weapon.TYPE_BASHING

getStandardHitWordInternal

protected java.lang.String getStandardHitWordInternal(int type,
                                                      int damnCode)

standardHitWord

public java.lang.String standardHitWord(int type,
                                        int damage)
Description copied from interface: CombatLibrary
Given the weapon type and amount of damage, this method returns the hit/damage string from the lists.ini file that matches.

Specified by:
standardHitWord in interface CombatLibrary
Parameters:
type - the weapon type
damage - the amount of damage
Returns:
the hit/damage word
See Also:
Weapon.TYPE_BASHING

getExtremeValue

protected java.lang.String getExtremeValue(int extreme)

armorStr

public java.lang.String armorStr(MOB mob)
Description copied from interface: CombatLibrary
Returns the friendly armor string for the given mob, describing how well armored they are.

Specified by:
armorStr in interface CombatLibrary
Parameters:
mob - the mob who has armor
Returns:
the displayable armor string
See Also:
CombatLibrary.fightingProwessStr(MOB)

fightingProwessStr

public java.lang.String fightingProwessStr(MOB mob)
Description copied from interface: CombatLibrary
Returns the friendly attack string for the given mob, describing how well attacky they are.

Specified by:
fightingProwessStr in interface CombatLibrary
Parameters:
mob - the mob who has attack
Returns:
the displayable attack string
See Also:
CombatLibrary.armorStr(MOB)

damageProwessStr

public java.lang.String damageProwessStr(MOB mob)
Description copied from interface: CombatLibrary
Returns the friendly damage prowess string for the given mob, describing how well damagy they are.

Specified by:
damageProwessStr in interface CombatLibrary
Parameters:
mob - the mob who damages
Returns:
the displayable damage string

getWeaponAttackIndex

protected int getWeaponAttackIndex(int weaponDamageType,
                                   int weaponClassification)

standardMissString

public java.lang.String standardMissString(int weaponDamageType,
                                           int weaponClassification,
                                           java.lang.String weaponName,
                                           boolean useExtendedMissString)
Description copied from interface: CombatLibrary
Given the weapon type and classification and name, this method returns either the fullly filled out weapon miss string, or generic non-extended non-weapon miss string from the lists.ini file that matches.

Specified by:
standardMissString in interface CombatLibrary
Parameters:
weaponDamageType - the weapon type
weaponClassification - the weapon classification
weaponName - the name of the weapon
useExtendedMissString - true to include the weapon name, false for a shorter message
Returns:
the fully formed swing and miss string
See Also:
Weapon.TYPE_DESCS, Weapon.CLASS_DESCS

standardHitString

public java.lang.String standardHitString(int weaponDamageType,
                                          int weaponClass,
                                          int damageAmount,
                                          java.lang.String weaponName)
Description copied from interface: CombatLibrary
Given the weapon type and classification and name, this method returns either the fullly filled out weapon hit/damage string from the lists.ini file that matches.

Specified by:
standardHitString in interface CombatLibrary
Parameters:
weaponDamageType - the weapon type
weaponClass - the weapon classification
damageAmount - the amount of damage done
weaponName - the name of the weapon
Returns:
the fully formed hit and damage string
See Also:
Weapon.TYPE_DESCS, Weapon.CLASS_DESCS

standardMobCondition

public java.lang.String standardMobCondition(MOB viewer,
                                             MOB mob)
Description copied from interface: CombatLibrary
When a particular race does not provide its own override health condition message, this method provides the base message from the list.ini file. It returns the condition of the given mob as seen by the given viewer.

Specified by:
standardMobCondition in interface CombatLibrary
Parameters:
viewer - the viewer of the mob
mob - the mob who has a health condition
Returns:
the condition of the health of the mob

resistanceMsgs

public void resistanceMsgs(MOB source,
                           MOB target,
                           CMMsg msg)
Description copied from interface: CombatLibrary
When the source does something to the target that the target resists, and the given message has a targetminor containing the type of damage that's being resisted, this message will generate and tack on a new message with the resistance of the target, and flag the given message as having been resisted.

Specified by:
resistanceMsgs in interface CombatLibrary
Parameters:
source - the attacker
target - the defender who is resisting
msg - the message to flag as being resisted and tack on resistance msg
See Also:
CMMsg.addTrailerMsg(CMMsg)

checkDamageSaves

public boolean checkDamageSaves(MOB mob,
                                CMMsg msg)
Description copied from interface: CombatLibrary
Checks to see if the given message gets a saving throw for the given mob damage and, if so, adjusts it

Specified by:
checkDamageSaves in interface CombatLibrary
Parameters:
mob - the mob to save
msg - the message that might apply
Returns:
true if the message na or save only, false to cancel

checkSavingThrows

public boolean checkSavingThrows(MOB mob,
                                 CMMsg msg)
Description copied from interface: CombatLibrary
Checks to see if the given message gets a saving throw for the given mob and, if so, applies it.

Specified by:
checkSavingThrows in interface CombatLibrary
Parameters:
mob - the mob to save
msg - the message that might apply
Returns:
true if the message na or save only, false to cancel

handleBeingGravitied

public void handleBeingGravitied(MOB mob,
                                 CMMsg msg)
Description copied from interface: CombatLibrary
Handles the effects of extreme gravity and other acceleration as from a ship.

Specified by:
handleBeingGravitied in interface CombatLibrary
Parameters:
mob - the mob feeling the effect
msg - the message doing the effect

handleBeingHealed

public void handleBeingHealed(CMMsg msg)
Description copied from interface: CombatLibrary
When a healing message targeting a given mob is received, this method is called to actually do the healing.

Specified by:
handleBeingHealed in interface CombatLibrary
Parameters:
msg - the healing message

bleedableWeapon

protected boolean bleedableWeapon(Environmental E)

handleBeingDamaged

public void handleBeingDamaged(CMMsg msg)
Description copied from interface: CombatLibrary
When a damaging message targeting a given mob is received, this method is called to actually do the damaging.

Specified by:
handleBeingDamaged in interface CombatLibrary
Parameters:
msg - the damaging message

handleDeath

public void handleDeath(CMMsg msg)
Description copied from interface: CombatLibrary
When a death message is received by a mob and the message has the mob as a source, this method is called to kill the source of the message off. The message has a source as dead person, the target is null, and the tool is the killer.

Specified by:
handleDeath in interface CombatLibrary
Parameters:
msg - the death message

handleDamageSpam

public boolean handleDamageSpam(MOB observerM,
                                Physical target,
                                int amount)
Description copied from interface: CombatLibrary
When a player has nobattlespam, this method is called when damage is observed to add to the totals.

Specified by:
handleDamageSpam in interface CombatLibrary
Parameters:
observerM - the observer of the combat
target - the damaged thing.
amount - the amount of damage.
Returns:
true if it was counted

doDeathPostProcessing

public void doDeathPostProcessing(CMMsg msg)
Description copied from interface: CombatLibrary
When a death occurs, there are certain record keeping processes that need to happen. This method does nothing but make sure those records are kept. The message has a source as dead person, the target is null, and the tool is the killer.

Specified by:
doDeathPostProcessing in interface CombatLibrary
Parameters:
msg - the death message

pickNextVictim

protected void pickNextVictim(MOB observer,
                              MOB deadmob,
                              java.util.Set<MOB> deadGroupH)

handleObserveDeath

public void handleObserveDeath(MOB observer,
                               MOB fighting,
                               CMMsg msg)
Description copied from interface: CombatLibrary
When an observer observes a death, this method is called is called to have the observer react.

Specified by:
handleObserveDeath in interface CombatLibrary
Parameters:
observer - the one observing the death
fighting - the dead mob
msg - the death message

handleDamageSpamSummary

public void handleDamageSpamSummary(MOB mob)
Description copied from interface: CombatLibrary
When a player has nobattlespam, this method is called when damage is observed to report the totals from the last combat round.

Specified by:
handleDamageSpamSummary in interface CombatLibrary
Parameters:
mob - the no spam observer.

handleBeingAssaulted

public void handleBeingAssaulted(CMMsg msg)
Description copied from interface: CombatLibrary
When an attack message targeting a given mob is received, this method is called to react to the attack. If the target is not in combat, range is established and the target is pissed off (has their victim set). An attack roll is then made for the source and the results used to alter the message. The target will also be made to stand. The message has a source attacker, target, and the tool is a weapon.

Specified by:
handleBeingAssaulted in interface CombatLibrary
Parameters:
msg - the attack message

makeFollowersFight

public void makeFollowersFight(MOB observerM,
                               MOB defenderM,
                               MOB attackerM)
Description copied from interface: CombatLibrary
When the given observerM witnesses the given attacker mob attacking the given defender mob, this method checks to see if the observer has a dog in the fight, and if they do, causes them to start fighting either the attacker or the defender.

Specified by:
makeFollowersFight in interface CombatLibrary
Parameters:
observerM - the observer mob who might be a follower
defenderM - the defender mob who is being attacked
attackerM - the attacker mob who is attacking the defender

getAllInProximity

public java.util.List<MOB> getAllInProximity(MOB to,
                                             int distance)

establishRange

public void establishRange(MOB source,
                           MOB target,
                           Environmental tool)
Description copied from interface: CombatLibrary
Given an attacking source and a defending target and the sources weapon or skill, this method will set the distance between the source and target from each other.

Specified by:
establishRange in interface CombatLibrary
Parameters:
source - the attacker
target - the target
tool - the sources weapon
See Also:
Combatant.setRangeToTarget(int)

subtickAttack

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

subtickBeforeAttack

protected void subtickBeforeAttack(MOB fighter,
                                   CombatLibrary.CombatSystem combatSystem)

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)
Description copied from interface: CombatLibrary
This is the heart of the main combat engine. Every tick that a mob is in combat, and is permitted to use auto attacks, this method is called. It figures out how many weapon attacks to dish out, and dishes them.

Specified by:
tickCombat in interface CombatLibrary
Parameters:
fighter - the attacker

isKnockedOutUponDeath

public boolean isKnockedOutUponDeath(MOB deadM,
                                     MOB killerM)
Description copied from interface: CombatLibrary
Returns whether the system properties specify that, when the given dead mob does by the hand of the given killer mob, that the dead mob won't actually die, but just be knocked out.

Specified by:
isKnockedOutUponDeath in interface CombatLibrary
Parameters:
deadM - the dead mob
killerM - the killer mob
Returns:
true if there's no death, but only being knocked out

expendEnergy

public void expendEnergy(MOB mob,
                         boolean expendMovement)
Description copied from interface: CombatLibrary
Every tick, THIS method is called to make the given mob a little more hungry and thirsty. It might even expend movement if they are walking around.

Specified by:
expendEnergy in interface CombatLibrary
Parameters:
mob - the mob who needs to get hungry
expendMovement - true to also expend the rooms movement amt, false otherwise

handleCombatLossConsequences

public boolean handleCombatLossConsequences(MOB deadM,
                                            MOB killerM,
                                            java.lang.String[] consequences,
                                            int[] lostExperience,
                                            java.lang.String message)
Description copied from interface: CombatLibrary
When a player dies or flees, the system coffeemud.ini file defines the consequences of losing the fight.

Specified by:
handleCombatLossConsequences in interface CombatLibrary
Parameters:
deadM - the mob who died or is fleeing
killerM - the killer or attacker of the given mob
consequences - the list of consequence strings from the ini file
lostExperience - a one dimensional array containing the base experience to lose
message - the xp loss message, sometimes localized, sometimes not.. you got me!
Returns:
false if the mob is obliterated, true otherwise

postRevengeAttack

public boolean postRevengeAttack(MOB attacker,
                                 MOB defender)
Description copied from interface: CombatLibrary
If an NPC attacker comes under the sudden effect of a spell, and knows who is responsible, but are not presently in combat, this method will start combat with them.

Specified by:
postRevengeAttack in interface CombatLibrary
Parameters:
attacker - the wronged npc party
defender - the defender who wronged the attacker
Returns:
true if an attack was tried, false if not.

getTickStatus

public int getTickStatus()
Description copied from interface: Tickable
A coded status for this object during the period where its tick method is being called. The statis is defined, at least in part, by constants in this interface STATUS_*. STATUS_NOT should be returned when the objects tick method is not currently in execution. It should never return STATUS_NOT when the objects tick method is in execution.

Specified by:
getTickStatus in interface Tickable
Overrides:
getTickStatus in class StdLibrary
Returns:
the numeric status of this object
See Also:
Tickable.tick(Tickable, int)

tickAllShips

protected void tickAllShips()

runSpecialCombat

protected void runSpecialCombat()

tick

public boolean tick(Tickable ticking,
                    int tickID)
Description copied from interface: Tickable
this is the method which is called periodically by the threading engine. How often it is called depends on the parameters passed to the threadding engine when it is submitted for thread access. Typically the period is once per TIME_TICK period, but that is determined when the object is submitted to the thread engine.

Specified by:
tick in interface Tickable
Overrides:
tick in class StdLibrary
Parameters:
ticking - a reference to this Tickable object
tickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Returns:
true always, unless this object no longer wishes to ever tick again, in which case false
See Also:
Tickable, ServiceEngine, TickableGroup

getBreatheKiller

public MOB getBreatheKiller(MOB victim)
Description copied from interface: CombatLibrary
When a mob can't breathe, it actually takes some work to figure out if anyone is to blame. This method attempts to place the blame anywhere but on the victim him or herself.

Specified by:
getBreatheKiller in interface CombatLibrary
Parameters:
victim - the one who can't breathe
Returns:
the mob to blame

shutdown

public boolean shutdown()
Description copied from interface: CMLibrary
Shuts down the library. Called at system shutdown time obviously, but is sometimes called just to reset the library.

Specified by:
shutdown in interface CMLibrary
Overrides:
shutdown in class StdLibrary
Returns:
true if shutdown was successful, false if there's nothing you can do about it
See Also:
CMLibrary.activate()