CMObject
, Tickable
, CMLibrary
, CombatLibrary
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class MUDFight extends StdLibrary implements CombatLibrary
CombatLibrary.CombatSystem
idConverter
TICKS_PER_SHIP_COMBAT
isDebugging, name, serviceClient, tickStatus
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_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, L
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkDatabase, compareTo, copyOf, getServiceClient, initializeClass, L, name, newInstance, setThreadStatus
public 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()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public boolean activate()
CMLibrary
activate
in interface CMLibrary
activate
in class StdLibrary
CMLibrary.shutdown()
public void propertiesLoaded()
CMLibrary
propertiesLoaded
in interface CMLibrary
propertiesLoaded
in class StdLibrary
public java.util.Set<MOB> allPossibleCombatants(MOB mob, boolean includePlayers)
CombatLibrary
allPossibleCombatants
in interface CombatLibrary
mob
- 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)
CombatLibrary
properTargets
in interface CombatLibrary
A
- 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)
CombatLibrary
adjustedAttackBonus
in interface CombatLibrary
mob
- the mob whose attack bonus needs adjustingtarget
- i guess this is who they are fightingPhyStats.armor()
public int adjustedAttackBonus(int baseAttack)
CombatLibrary
adjustedAttackBonus
in interface CombatLibrary
baseAttack
- 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)
CombatLibrary
postItemDamage
in interface CombatLibrary
mob
- 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)
CombatLibrary
doTurnBasedCombat
in interface CombatLibrary
mob
- the mob who wants to fightR
- the room the mob is inA
- the area the room is inpublic int adjustedArmor(MOB mob)
CombatLibrary
adjustedArmor
in interface CombatLibrary
mob
- the mob whose armor needs adjustingPhyStats.armor()
public int adjustedArmor(int armorValue)
CombatLibrary
adjustedArmor
in interface CombatLibrary
armorValue
- the base armor value to start fromPhyStats.armor()
public boolean rollToHit(MOB attacker, MOB defender)
CombatLibrary
rollToHit
in interface CombatLibrary
attacker
- the attacking mobdefender
- the mob being attackedCombatLibrary.rollToHit(int, int, int)
public boolean rollToHit(int attack, int defence, int adjustment)
CombatLibrary
rollToHit
in interface CombatLibrary
attack
- the attack scoredefence
- the armor scoreadjustment
- the percentage adjustmentCombatLibrary.rollToHit(MOB, MOB)
public java.util.Set<MOB> allCombatants(MOB mob)
CombatLibrary
allCombatants
in interface CombatLibrary
mob
- the fighting mobCombatLibrary.allPossibleCombatants(MOB, boolean)
,
CombatLibrary.properTargets(Ability, MOB, boolean)
public void makePeaceInGroup(MOB mob)
CombatLibrary
makePeaceInGroup
in interface CombatLibrary
mob
- the mob whose group needs peace.public void postPanic(MOB mob, CMMsg addHere)
CombatLibrary
postPanic
in interface CombatLibrary
mob
- 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)
CombatLibrary
postDeath
in interface CombatLibrary
killerM
- 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)
CombatLibrary
postAttack
in interface CombatLibrary
attacker
- 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)
CombatLibrary
mayIAttackThisVessel
in interface CombatLibrary
mob
- the agent attackerdefender
- the attacked shippublic final boolean isASiegeWeapon(Item I)
CombatLibrary
isASiegeWeapon
in interface CombatLibrary
I
- the item to checkpublic boolean postSiegeAttack(MOB attacker, SiegableItem siegeAttacker, SiegableItem siegeTarget, Weapon weapon, boolean wasAHit)
CombatLibrary
postSiegeAttack
in interface CombatLibrary
attacker
- 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)
CombatLibrary
postHealing
in interface CombatLibrary
healer
- 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)
CombatLibrary
replaceDamageTag
in interface CombatLibrary
str
- the original string with the appropriate tagdamage
- the final amount of damagedamageType
- the weapon type code Weapon.TYPE_BASHING
sourceTargetSTO
- 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)
CombatLibrary
forcePeaceAllFightingAgainst
in interface CombatLibrary
mob
- 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)
CombatLibrary
getAllFightingAgainst
in interface CombatLibrary
mob
- 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)
CombatLibrary
postDamage
in interface CombatLibrary
attacker
- 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_BASHING
allDisplayMessage
- 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)
CombatLibrary
adjustedDamage
in interface CombatLibrary
mob
- 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)
CombatLibrary
adjustedDamage
in interface CombatLibrary
baseDamage
- base damagelevel
- the level of the mobbiasHigh
- random numbers are always biased highpublic void recoverTick(MOB mob)
CombatLibrary
recoverTick
in interface CombatLibrary
mob
- the mob who is recoveringpublic CMMsg postWeaponDamage(MOB source, MOB target, Item item, int damageInt)
CombatLibrary
CombatLibrary.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 CombatLibrary
source
- 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)
CombatLibrary
postWeaponAttackResult
in interface CombatLibrary
sourceM
- 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)
CombatLibrary
postSiegeDamage
in interface CombatLibrary
source
- 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)
CombatLibrary
postSiegeWeaponAttackResult
in interface CombatLibrary
source
- 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)
CombatLibrary
getFollowedLeader
in interface CombatLibrary
mob
- the mob who might be following someonepublic java.util.List<MOB>[] getFormation(MOB mob)
CombatLibrary
getFormation
in interface CombatLibrary
mob
- a member of a group with a formation.CombatLibrary.getFormationFollowed(MOB)
,
CombatLibrary.getFormationAbsOrder(MOB)
public java.util.List<MOB> getFormationFollowed(MOB mob)
CombatLibrary
getFormationFollowed
in interface CombatLibrary
mob
- the mob in the formationCombatLibrary.getFormation(MOB)
,
CombatLibrary.getFormationAbsOrder(MOB)
public int getFormationAbsOrder(MOB mob)
CombatLibrary
getFormationAbsOrder
in interface CombatLibrary
mob
- the mob in formationCombatLibrary.getFormationFollowed(MOB)
,
CombatLibrary.getFormation(MOB)
public CharClass getCombatDominantClass(MOB killer, MOB killed)
CombatLibrary
getCombatDominantClass
in interface CombatLibrary
killer
- 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)
CombatLibrary
getCombatBeneficiaries
in interface CombatLibrary
killer
- 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)
CombatLibrary
getCombatDividers
in interface CombatLibrary
killer
- 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)
CombatLibrary
standardHitWord
in interface CombatLibrary
type
- the weapon typepct
- the percent of damage from 0.0 to 1.0Weapon.TYPE_BASHING
protected java.lang.String getStandardHitWordInternal(int type, int damnCode)
public java.lang.String standardHitWord(int type, int damage)
CombatLibrary
standardHitWord
in interface CombatLibrary
type
- the weapon typedamage
- the amount of damageWeapon.TYPE_BASHING
protected java.lang.String getExtremeValue(int extreme)
public java.lang.String armorStr(MOB mob)
CombatLibrary
armorStr
in interface CombatLibrary
mob
- the mob who has armorCombatLibrary.fightingProwessStr(MOB)
public java.lang.String fightingProwessStr(MOB mob)
CombatLibrary
fightingProwessStr
in interface CombatLibrary
mob
- the mob who has attackCombatLibrary.armorStr(MOB)
public java.lang.String damageProwessStr(MOB mob)
CombatLibrary
damageProwessStr
in interface CombatLibrary
mob
- 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)
CombatLibrary
standardMissString
in interface CombatLibrary
weaponDamageType
- 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_DESCS
public java.lang.String standardHitString(int weaponDamageType, int weaponClass, int damageAmount, java.lang.String weaponName)
CombatLibrary
standardHitString
in interface CombatLibrary
weaponDamageType
- the weapon typeweaponClass
- the weapon classificationdamageAmount
- the amount of damage doneweaponName
- the name of the weaponWeapon.TYPE_DESCS
,
Weapon.CLASS_DESCS
public java.lang.String standardMobCondition(MOB viewer, MOB mob)
CombatLibrary
standardMobCondition
in interface CombatLibrary
viewer
- the viewer of the mobmob
- the mob who has a health conditionpublic void resistanceMsgs(MOB source, MOB target, CMMsg msg)
CombatLibrary
resistanceMsgs
in interface CombatLibrary
source
- 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)
CombatLibrary
checkDamageSaves
in interface CombatLibrary
mob
- the mob to savemsg
- the message that might applypublic void fixDependentRanges(MOB mob)
CombatLibrary
fixDependentRanges
in interface CombatLibrary
mob
- the mob whose range matterspublic boolean checkSavingThrows(MOB mob, CMMsg msg)
CombatLibrary
checkSavingThrows
in interface CombatLibrary
mob
- the mob to savemsg
- the message that might applypublic void handleBeingGravitied(MOB mob, CMMsg msg)
CombatLibrary
handleBeingGravitied
in interface CombatLibrary
mob
- the mob feeling the effectmsg
- the message doing the effectpublic void handleBeingHealed(CMMsg msg)
CombatLibrary
handleBeingHealed
in interface CombatLibrary
msg
- the healing messageprotected boolean bleedableWeapon(Environmental E)
public void handleBeingDamaged(CMMsg msg)
CombatLibrary
handleBeingDamaged
in interface CombatLibrary
msg
- the damaging messagepublic void handleDeath(CMMsg msg)
CombatLibrary
handleDeath
in interface CombatLibrary
msg
- the death messagepublic boolean handleDamageSpam(MOB observerM, Physical target, int amount)
CombatLibrary
handleDamageSpam
in interface CombatLibrary
observerM
- the observer of the combattarget
- the damaged thing.amount
- the amount of damage.public void doDeathPostProcessing(CMMsg msg)
CombatLibrary
doDeathPostProcessing
in interface CombatLibrary
msg
- the death messageprotected void pickNextVictim(MOB observer, MOB deadmob, java.util.Set<MOB> deadGroupH)
public void handleObserveDeath(MOB observer, MOB fighting, CMMsg msg)
CombatLibrary
handleObserveDeath
in interface CombatLibrary
observer
- the one observing the deathfighting
- the dead mobmsg
- the death messagepublic void handleDamageSpamSummary(MOB mob)
CombatLibrary
handleDamageSpamSummary
in interface CombatLibrary
mob
- the no spam observer.public void handleBeingAssaulted(CMMsg msg)
CombatLibrary
handleBeingAssaulted
in interface CombatLibrary
msg
- the attack messagepublic void makeFollowersFight(MOB observerM, MOB defenderM, MOB attackerM)
CombatLibrary
makeFollowersFight
in interface CombatLibrary
observerM
- 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)
CombatLibrary
calculateRangeToTarget
in interface CombatLibrary
source
- the attackertarget
- the targettool
- the sources weaponCombatant.setRangeToTarget(int)
,
CombatLibrary.establishRange(MOB, MOB, Environmental)
public void establishRange(MOB source, MOB target, Environmental tool)
CombatLibrary
establishRange
in interface CombatLibrary
source
- 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)
CombatLibrary
dispenseExperience
in interface CombatLibrary
killers
- 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)
CombatLibrary
tickCombat
in interface CombatLibrary
fighter
- the attackerpublic boolean isKnockedOutUponDeath(MOB deadM, MOB killerM)
CombatLibrary
isKnockedOutUponDeath
in interface CombatLibrary
deadM
- the dead mobkillerM
- the killer mobpublic void expendEnergy(MOB mob, boolean expendMovement)
CombatLibrary
expendEnergy
in interface CombatLibrary
mob
- 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)
CombatLibrary
handleCombatLossConsequences
in interface CombatLibrary
deadM
- 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)
CombatLibrary
postRevengeAttack
in interface CombatLibrary
attacker
- the wronged npc partydefender
- the defender who wronged the attackerpublic int getTickStatus()
Tickable
getTickStatus
in interface Tickable
getTickStatus
in class StdLibrary
Tickable.tick(Tickable, int)
protected void tickAllShips()
protected void runSpecialCombat()
public boolean tick(Tickable ticking, int tickID)
Tickable
tick
in interface Tickable
tick
in class StdLibrary
ticking
- a reference to this Tickable objecttickID
- the TICKID_ constant describing this periodic call, as defined in TickableTickable
,
ServiceEngine
,
TickableGroup
public MOB getBreatheKiller(MOB victim)
CombatLibrary
getBreatheKiller
in interface CombatLibrary
victim
- the one who can't breathepublic boolean shutdown()
CMLibrary
shutdown
in interface CMLibrary
shutdown
in class StdLibrary
CMLibrary.activate()