CMObject, Tickable, CMLibrary, CombatLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>public class MUDFight extends StdLibrary implements CombatLibrary
CombatLibrary.CombatSystemidConverterTICKS_PER_SHIP_COMBATisDebugging, name, serviceClient, tickStatusSTATUS_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_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, 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_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET| Constructor | Description |
|---|---|
MUDFight() |
| Modifier and Type | Method | Description |
|---|---|---|
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) |
|
int |
calculateRangeToTarget(MOB source,
MOB target,
Environmental tool) |
Given an attacking source and a defending target and the sources weapon
or skill, this method will calculate the distance between the source and target
from each other.
|
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 |
fixDependentRanges(MOB mob) |
If a mobs range to target changes, then any ridden
mobs, or mobs riding the given mob, should also change.
|
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.
|
protected MUDFight |
getSessionMUDFight(Session sess) |
|
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 |
isASiegeWeapon(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 killerM,
MOB deadM) |
|
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 |
postSiegeAttack(MOB attacker,
SiegableItem siegeAttacker,
SiegableItem siegeTarget,
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 |
postSiegeDamage(MOB source,
PhysicalAgent attacker,
PhysicalAgent defender,
Environmental weapon,
java.lang.String oldHitString,
int damageType,
int damageInt) |
Posts damage to a boardable from a siege weapon (usually).
|
void |
postSiegeWeaponAttackResult(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 sourceM,
MOB targetM,
Item item,
int bonusDmg,
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, int, 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 boolean |
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.
|
getServiceClient, LcopyOf, initializeClass, name, newInstanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckDatabase, compareTo, copyOf, getServiceClient, initializeClass, L, name, newInstance, setThreadStatuspublic java.lang.String lastStr
public long lastRes
public java.lang.Object[][][] hitWordIndex
public java.lang.Object[][][] hitWordsChanged
protected CMath.CompiledFormula attackAdjustmentFormula
protected CMath.CompiledFormula armorAdjustmentFormula
protected CMath.CompiledFormula attackerFudgeBonusFormula
protected CMath.CompiledFormula pvpAttackerFudgeBonusFormula
protected CMath.CompiledFormula spellFudgeDamageFormula
protected CMath.CompiledFormula pvpSpellFudgeDamageFormula
protected CMath.CompiledFormula spellCritChanceFormula
protected CMath.CompiledFormula pvpSpellCritChanceFormula
protected CMath.CompiledFormula spellCritDmgFormula
protected CMath.CompiledFormula pvpSpellCritDmgFormula
protected CMath.CompiledFormula targetedRangedDamageFormula
protected CMath.CompiledFormula pvpTargetedRangedDamageFormula
protected CMath.CompiledFormula rangedFudgeDamageFormula
protected CMath.CompiledFormula pvpRangedFudgeDamageFormula
protected CMath.CompiledFormula targetedMeleeDamageFormula
protected CMath.CompiledFormula pvpTargetedMeleeDamageFormula
protected CMath.CompiledFormula meleeFudgeDamageFormula
protected CMath.CompiledFormula pvpMeleeFudgeDamageFormula
protected CMath.CompiledFormula staticRangedDamageFormula
protected CMath.CompiledFormula staticMeleeDamageFormula
protected CMath.CompiledFormula weaponCritChanceFormula
protected CMath.CompiledFormula pvpWeaponCritChanceFormula
protected CMath.CompiledFormula weaponCritDmgFormula
protected CMath.CompiledFormula pvpWeaponCritDmgFormula
protected CMath.CompiledFormula stateHitPointRecoverFormula
protected CMath.CompiledFormula stateManaRecoverFormula
protected CMath.CompiledFormula stateMovesRecoverFormula
protected CMath.CompiledFormula totalCombatExperienceFormula
protected CMath.CompiledFormula individualCombatExpFormula
public java.lang.String ID()
CMObjectID in interface CMObjectID in class StdLibrarypublic boolean activate()
CMLibraryactivate in interface CMLibraryactivate in class StdLibraryCMLibrary.shutdown()public void propertiesLoaded()
CMLibrarypropertiesLoaded in interface CMLibrarypropertiesLoaded in class StdLibrarypublic java.util.Set<MOB> allPossibleCombatants(MOB mob, boolean includePlayers)
CombatLibraryallPossibleCombatants in interface CombatLibrarymob - the mob to checkincludePlayers - true to include players, false notCombatLibrary.allCombatants(MOB),
CombatLibrary.properTargets(Ability, MOB, boolean)public java.util.Set<MOB> properTargets(Ability A, MOB caster, boolean includePlayers)
CombatLibraryproperTargets in interface CombatLibraryA - the skill you want targets forcaster - the user of the skillincludePlayers - true to include players, false otherwiseCombatLibrary.allCombatants(MOB),
CombatLibrary.allPossibleCombatants(MOB, boolean)public int adjustedAttackBonus(MOB mob, MOB target)
CombatLibraryadjustedAttackBonus in interface CombatLibrarymob - the mob whose attack bonus needs adjustingtarget - i guess this is who they are fightingPhyStats.armor()public int adjustedAttackBonus(int baseAttack)
CombatLibraryadjustedAttackBonus in interface CombatLibrarybaseAttack - the base attack bonus to work from.PhyStats.armor()public void postItemDamage(MOB mob, Item I, Environmental tool, int damageAmount, int messageType, java.lang.String message)
CombatLibrarypostItemDamage in interface CombatLibrarymob - the mob doing damage to an itemI - the item being damagedtool - the weapon or skill used to do the damagedamageAmount - the amount of damage done (0-100)messageType - the CMMsg message code for source and othersmessage - the message stringpublic boolean doTurnBasedCombat(MOB mob, Room R, Area A)
CombatLibrarydoTurnBasedCombat in interface CombatLibrarymob - the mob who wants to fightR - the room the mob is inA - the area the room is inpublic int adjustedArmor(MOB mob)
CombatLibraryadjustedArmor in interface CombatLibrarymob - the mob whose armor needs adjustingPhyStats.armor()public int adjustedArmor(int armorValue)
CombatLibraryadjustedArmor in interface CombatLibraryarmorValue - the base armor value to start fromPhyStats.armor()public boolean rollToHit(MOB attacker, MOB defender)
CombatLibraryrollToHit in interface CombatLibraryattacker - the attacking mobdefender - the mob being attackedCombatLibrary.rollToHit(int, int, int)public boolean rollToHit(int attack,
int defence,
int adjustment)
CombatLibraryrollToHit in interface CombatLibraryattack - the attack scoredefence - the armor scoreadjustment - the percentage adjustmentCombatLibrary.rollToHit(MOB, MOB)public java.util.Set<MOB> allCombatants(MOB mob)
CombatLibraryallCombatants in interface CombatLibrarymob - the fighting mobCombatLibrary.allPossibleCombatants(MOB, boolean),
CombatLibrary.properTargets(Ability, MOB, boolean)public void makePeaceInGroup(MOB mob)
CombatLibrarymakePeaceInGroup in interface CombatLibrarymob - the mob whose group needs peace.public void postPanic(MOB mob, CMMsg addHere)
CombatLibrarypostPanic in interface CombatLibrarymob - the mob who is panicingaddHere - null, or the message to add the panic toCombatLibrary.postDeath(MOB, MOB, CMMsg)public void postDeath(MOB killerM, MOB deadM, CMMsg addHere)
CombatLibrarypostDeath in interface CombatLibrarykillerM - the killer mobdeadM - the dead mobaddHere - null, or the message to add this one to.CombatLibrary.postPanic(MOB, CMMsg)public boolean postAttack(MOB attacker, MOB target, Item weapon)
CombatLibrarypostAttack in interface CombatLibraryattacker - the attacker mobtarget - the target mobweapon - the weapon used by the attacker, or nullprotected static boolean ownerSecurityCheck(java.lang.String ownerName,
MOB mob)
public boolean mayIAttackThisVessel(MOB mob, PhysicalAgent defender)
CombatLibrarymayIAttackThisVessel in interface CombatLibrarymob - the agent attackerdefender - the attacked shippublic final boolean isASiegeWeapon(Item I)
CombatLibraryisASiegeWeapon in interface CombatLibraryI - the item to checkpublic boolean postSiegeAttack(MOB attacker, SiegableItem siegeAttacker, SiegableItem siegeTarget, Weapon weapon, boolean wasAHit)
CombatLibrarypostSiegeAttack in interface CombatLibraryattacker - the attacking agent mobsiegeAttacker - the ship the attacker is onsiegeTarget - the target shipweapon - the siege weapon usedwasAHit - true to register a hit, false to register an attackpublic boolean postHealing(MOB healer, MOB target, Ability tool, int healing, int messageCode, java.lang.String allDisplayMessage)
CombatLibrarypostHealing in interface CombatLibraryhealer - the healer mobtarget - the target mob being healedtool - the skill doing the healing, or nullhealing - the amount of healing to domessageCode - msg code for the source and others codeallDisplayMessage - the string to show everyonepublic java.lang.String replaceDamageTag(java.lang.String str,
int damage,
int damageType,
CMMsg.View sourceTargetSTO)
CombatLibraryreplaceDamageTag in interface CombatLibrarystr - the original string with the appropriate tagdamage - the final amount of damagedamageType - the weapon type code Weapon.TYPE_BASHINGsourceTargetSTO - the view of the messageCMMsg.View,
CombatLibrary.postDamage(MOB, MOB, Environmental, int, int, int, String)public void forcePeaceAllFightingAgainst(MOB mob, java.util.Set<MOB> exceptionSet)
CombatLibraryforcePeaceAllFightingAgainst in interface CombatLibrarymob - the mob who needs peaceexceptionSet - null, or a set of mobs not to apply this to.public java.util.Set<MOB> getAllFightingAgainst(MOB mob, java.util.Set<MOB> set)
CombatLibrarygetAllFightingAgainst in interface CombatLibrarymob - the mob who is in combatset - the set to put combatants in, or null to make onepublic void postDamage(MOB attacker, MOB target, Environmental weapon, int damage, int messageCode, int damageType, java.lang.String allDisplayMessage)
CombatLibrarypostDamage in interface CombatLibraryattacker - the attacking mobtarget - the target mob being healedweapon - the item weapon, ability skill, or null tool used to damagedamage - the initial amount of damagemessageCode - msg code for the source and others codedamageType - the weapon type code Weapon.TYPE_BASHINGallDisplayMessage - the message to sendCombatLibrary.replaceDamageTag(String, int, int, CMMsg.View)public int adjustedDamage(MOB mob, Weapon weapon, MOB target, int bonusDamage, boolean allowCrits, boolean biasHigh)
CombatLibraryadjustedDamage in interface CombatLibrarymob - the mob who wants adjusted damageweapon - the weapon used by the mob against target, or nulltarget - the target being hit, or nullbonusDamage - any bonus to base damageallowCrits - true to apply crit if crit damage occursbiasHigh - random numbers are always biased highpublic int adjustedDamage(int baseDamage,
int level,
boolean biasHigh)
CombatLibraryadjustedDamage in interface CombatLibrarybaseDamage - base damagelevel - the level of the mobbiasHigh - random numbers are always biased highpublic void recoverTick(MOB mob)
CombatLibraryrecoverTick in interface CombatLibrarymob - the mob who is recoveringpublic CMMsg postWeaponDamage(MOB source, MOB target, Item item, int damageInt)
CombatLibraryCombatLibrary.postWeaponAttackResult(MOB, MOB, Item, int, 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.postWeaponDamage in interface CombatLibrarysource - the attackertarget - the targetitem - the weapon useddamageInt - the amount of damage done by the weaponCombatLibrary.replaceDamageTag(String, int, int, CMMsg.View)public CMMsg postWeaponAttackResult(MOB sourceM, MOB targetM, Item item, int bonusDmg, boolean success)
CombatLibrarypostWeaponAttackResult in interface CombatLibrarysourceM - the attackertargetM - the targetitem - the weapon usedbonusDmg - some amount of bonus damage to applysuccess - true if it was a hit with damage, false if it was a missCombatLibrary.replaceDamageTag(String, int, int, CMMsg.View)public void postSiegeDamage(MOB source, PhysicalAgent attacker, PhysicalAgent defender, Environmental weapon, java.lang.String oldHitString, int damageType, int damageInt)
CombatLibrarypostSiegeDamage in interface CombatLibrarysource - the agent of the attackattacker - the attackerdefender - the targetweapon - the weapon usedoldHitString - the <DAMAGE> messagedamageType - the type of damagedamageInt - the amount of damage (pct?!)CombatLibrary.replaceDamageTag(String, int, int, CMMsg.View),
CombatLibrary.postSiegeWeaponAttackResult(MOB, PhysicalAgent, PhysicalAgent, Weapon, boolean)public void postSiegeWeaponAttackResult(MOB source, PhysicalAgent attacker, PhysicalAgent defender, Weapon weapon, boolean success)
CombatLibrarypostSiegeWeaponAttackResult in interface CombatLibrarysource - the agent of the attackattacker - the attackerdefender - the targetweapon - the weapon usedsuccess - true if it was a hit with damage, false if it was a missCombatLibrary.replaceDamageTag(String, int, int, CMMsg.View),
CombatLibrary.postSiegeDamage(MOB, PhysicalAgent, PhysicalAgent, Environmental, String, int, int)protected void processFormation(java.util.List<MOB>[] done, MOB leader, int level)
public MOB getFollowedLeader(MOB mob)
CombatLibrarygetFollowedLeader in interface CombatLibrarymob - the mob who might be following someonepublic java.util.List<MOB>[] getFormation(MOB mob)
CombatLibrarygetFormation in interface CombatLibrarymob - a member of a group with a formation.CombatLibrary.getFormationFollowed(MOB),
CombatLibrary.getFormationAbsOrder(MOB)public java.util.List<MOB> getFormationFollowed(MOB mob)
CombatLibrarygetFormationFollowed in interface CombatLibrarymob - the mob in the formationCombatLibrary.getFormation(MOB),
CombatLibrary.getFormationAbsOrder(MOB)public int getFormationAbsOrder(MOB mob)
CombatLibrarygetFormationAbsOrder in interface CombatLibrarymob - the mob in formationCombatLibrary.getFormationFollowed(MOB),
CombatLibrary.getFormation(MOB)public CharClass getCombatDominantClass(MOB killer, MOB killed)
CombatLibrarygetCombatDominantClass in interface CombatLibrarykiller - the killerkilled - the killedCombatLibrary.getCombatDividers(MOB, MOB, CharClass),
CombatLibrary.getCombatBeneficiaries(MOB, MOB, CharClass)protected java.util.Set<MOB> getCombatBeneficiaries(MOB killer, MOB killed, Room deathRoom, java.util.Set<MOB> beneficiaries, CharClass combatCharClass)
public java.util.Set<MOB> getCombatBeneficiaries(MOB killer, MOB killed, CharClass combatCharClass)
CombatLibrarygetCombatBeneficiaries in interface CombatLibrarykiller - the killer of the killedkilled - the killed onecombatCharClass - the charclass of the killerCombatLibrary.getCombatDividers(MOB, MOB, CharClass),
CombatLibrary.getCombatDominantClass(MOB, MOB)protected java.util.Set<MOB> getCombatDividers(MOB killer, MOB killed, Room deathRoom, java.util.Set<MOB> dividers, CharClass combatCharClass)
public java.util.Set<MOB> getCombatDividers(MOB killer, MOB killed, CharClass combatCharClass)
CombatLibrarygetCombatDividers in interface CombatLibrarykiller - the killerkilled - the killed the killer killedcombatCharClass - the charclass of the leader (usually)CombatLibrary.getCombatBeneficiaries(MOB, MOB, CharClass),
CombatLibrary.getCombatDominantClass(MOB, MOB)public java.lang.String standardHitWord(int type,
double pct)
CombatLibrarystandardHitWord in interface CombatLibrarytype - the weapon typepct - the percent of damage from 0.0 to 1.0Weapon.TYPE_BASHINGprotected java.lang.String getStandardHitWordInternal(int type,
int damnCode)
public java.lang.String standardHitWord(int type,
int damage)
CombatLibrarystandardHitWord in interface CombatLibrarytype - the weapon typedamage - the amount of damageWeapon.TYPE_BASHINGprotected java.lang.String getExtremeValue(int extreme)
public java.lang.String armorStr(MOB mob)
CombatLibraryarmorStr in interface CombatLibrarymob - the mob who has armorCombatLibrary.fightingProwessStr(MOB)public java.lang.String fightingProwessStr(MOB mob)
CombatLibraryfightingProwessStr in interface CombatLibrarymob - the mob who has attackCombatLibrary.armorStr(MOB)public java.lang.String damageProwessStr(MOB mob)
CombatLibrarydamageProwessStr in interface CombatLibrarymob - the mob who damagesprotected int getWeaponAttackIndex(int weaponDamageType,
int weaponClassification)
public java.lang.String standardMissString(int weaponDamageType,
int weaponClassification,
java.lang.String weaponName,
boolean useExtendedMissString)
CombatLibrarystandardMissString in interface CombatLibraryweaponDamageType - the weapon typeweaponClassification - the weapon classificationweaponName - the name of the weaponuseExtendedMissString - true to include the weapon name, false for a shorter messageWeapon.TYPE_DESCS,
Weapon.CLASS_DESCSpublic java.lang.String standardHitString(int weaponDamageType,
int weaponClass,
int damageAmount,
java.lang.String weaponName)
CombatLibrarystandardHitString in interface CombatLibraryweaponDamageType - the weapon typeweaponClass - the weapon classificationdamageAmount - the amount of damage doneweaponName - the name of the weaponWeapon.TYPE_DESCS,
Weapon.CLASS_DESCSpublic java.lang.String standardMobCondition(MOB viewer, MOB mob)
CombatLibrarystandardMobCondition in interface CombatLibraryviewer - the viewer of the mobmob - the mob who has a health conditionpublic void resistanceMsgs(MOB source, MOB target, CMMsg msg)
CombatLibraryresistanceMsgs in interface CombatLibrarysource - the attackertarget - the defender who is resistingmsg - the message to flag as being resisted and tack on resistance msgCMMsg.addTrailerMsg(CMMsg)public boolean checkDamageSaves(MOB mob, CMMsg msg)
CombatLibrarycheckDamageSaves in interface CombatLibrarymob - the mob to savemsg - the message that might applypublic void fixDependentRanges(MOB mob)
CombatLibraryfixDependentRanges in interface CombatLibrarymob - the mob whose range matterspublic boolean checkSavingThrows(MOB mob, CMMsg msg)
CombatLibrarycheckSavingThrows in interface CombatLibrarymob - the mob to savemsg - the message that might applypublic void handleBeingGravitied(MOB mob, CMMsg msg)
CombatLibraryhandleBeingGravitied in interface CombatLibrarymob - the mob feeling the effectmsg - the message doing the effectpublic void handleBeingHealed(CMMsg msg)
CombatLibraryhandleBeingHealed in interface CombatLibrarymsg - the healing messageprotected boolean bleedableWeapon(Environmental E)
public void handleBeingDamaged(CMMsg msg)
CombatLibraryhandleBeingDamaged in interface CombatLibrarymsg - the damaging messagepublic void handleDeath(CMMsg msg)
CombatLibraryhandleDeath in interface CombatLibrarymsg - the death messagepublic boolean handleDamageSpam(MOB observerM, Physical target, int amount)
CombatLibraryhandleDamageSpam in interface CombatLibraryobserverM - the observer of the combattarget - the damaged thing.amount - the amount of damage.public void doDeathPostProcessing(CMMsg msg)
CombatLibrarydoDeathPostProcessing in interface CombatLibrarymsg - the death messageprotected void pickNextVictim(MOB observer, MOB deadmob, java.util.Set<MOB> deadGroupH)
public void handleObserveDeath(MOB observer, MOB fighting, CMMsg msg)
CombatLibraryhandleObserveDeath in interface CombatLibraryobserver - the one observing the deathfighting - the dead mobmsg - the death messagepublic void handleDamageSpamSummary(MOB mob)
CombatLibraryhandleDamageSpamSummary in interface CombatLibrarymob - the no spam observer.public void handleBeingAssaulted(CMMsg msg)
CombatLibraryhandleBeingAssaulted in interface CombatLibrarymsg - the attack messagepublic void makeFollowersFight(MOB observerM, MOB defenderM, MOB attackerM)
CombatLibrarymakeFollowersFight in interface CombatLibraryobserverM - the observer mob who might be a followerdefenderM - the defender mob who is being attackedattackerM - the attacker mob who is attacking the defenderpublic int calculateRangeToTarget(MOB source, MOB target, Environmental tool)
CombatLibrarycalculateRangeToTarget in interface CombatLibrarysource - the attackertarget - the targettool - the sources weaponCombatant.setRangeToTarget(int),
CombatLibrary.establishRange(MOB, MOB, Environmental)public void establishRange(MOB source, MOB target, Environmental tool)
CombatLibraryestablishRange in interface CombatLibrarysource - the attackertarget - the targettool - the sources weaponCombatant.setRangeToTarget(int),
CombatLibrary.calculateRangeToTarget(MOB, MOB, Environmental)protected void subtickBeforeAttack(MOB fighter, CombatLibrary.CombatSystem combatSystem)
protected void subtickAfterAttack(MOB fighter)
public void dispenseExperience(java.util.Set<MOB> killers, java.util.Set<MOB> dividers, MOB killed)
CombatLibrarydispenseExperience in interface CombatLibrarykillers - a set of mobs to benefit from the killdividers - a set of mobs who must divide the xp.. usually subset of killerskilled - the mob killedExpLevelLibrary.postExperience(MOB, String, MOB, String, int, boolean)public void tickCombat(MOB fighter)
CombatLibrarytickCombat in interface CombatLibraryfighter - the attackerpublic boolean isKnockedOutUponDeath(MOB deadM, MOB killerM)
CombatLibraryisKnockedOutUponDeath in interface CombatLibrarydeadM - the dead mobkillerM - the killer mobpublic void expendEnergy(MOB mob, boolean expendMovement)
CombatLibraryexpendEnergy in interface CombatLibrarymob - the mob who needs to get hungryexpendMovement - true to also expend the rooms movement amt, false otherwisepublic boolean handleCombatLossConsequences(MOB deadM, MOB killerM, java.lang.String[] consequences, int[] lostExperience, java.lang.String message)
CombatLibraryhandleCombatLossConsequences in interface CombatLibrarydeadM - the mob who died or is fleeingkillerM - the killer or attacker of the given mobconsequences - the list of consequence strings from the ini filelostExperience - a one dimensional array containing the base experience to losemessage - the xp loss message, sometimes localized, sometimes not.. you got me!public boolean postRevengeAttack(MOB attacker, MOB defender)
CombatLibrarypostRevengeAttack in interface CombatLibraryattacker - the wronged npc partydefender - the defender who wronged the attackerpublic int getTickStatus()
TickablegetTickStatus in interface TickablegetTickStatus in class StdLibraryTickable.tick(Tickable, int)protected void tickAllShips()
protected void runSpecialCombat()
public boolean tick(Tickable ticking, int tickID)
Tickabletick in interface Tickabletick in class StdLibraryticking - a reference to this Tickable objecttickID - the TICKID_ constant describing this periodic call, as defined in TickableTickable,
ServiceEngine,
TickableGrouppublic MOB getBreatheKiller(MOB victim)
CombatLibrarygetBreatheKiller in interface CombatLibraryvictim - the one who can't breathepublic boolean shutdown()
CMLibraryshutdown in interface CMLibraryshutdown in class StdLibraryCMLibrary.activate()