Package games.stendhal.server.entity
Class CombatEntity
- All Implemented Interfaces:
Killer,Cloneable,Iterable<String>,Serializable
- Direct Known Subclasses:
RPEntity
An entity that can engage in combat.
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<CombatEntity,Integer> Maps each enemy which has recently damaged this entity to the turn when the last damage has occurred.static final StringFields inherited from class games.stendhal.server.entity.GuidedEntity
baseSpeed, pathnotifierFields inherited from class marauroa.common.game.RPObject
INVALID_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidGenerates the RPClass & specifies attributes.booleangetsAtkXpFrom(CombatEntity defender) Checks if this entity should get ATK XP.booleangetsDefXpFrom(CombatEntity attacker, boolean damaged) Checks if this entity should get DEF XP.booleanrecentlyDamagedBy(CombatEntity opponent) Checks if entity qualifies to receive combat XP.Methods inherited from class games.stendhal.server.entity.GuidedEntity
addSuspend, addSuspend, applyMovement, atMovementRadius, clearPath, followPath, getBaseSpeed, getCollisionAction, getDirectionFromOrigin, getDistanceFromOrigin, getGuide, getPath, getPathPosition, handleObjectCollision, hasPath, isPathLoop, onFinishedPath, onMoved, onNodeReached, onOutsideMovementRadius, removeSuspend, reroute, retracePath, setBaseSpeed, setCollisionAction, setPath, setPath, setPathAndPosition, setPathPosition, setRandomMovementRadius, setRandomMovementRadius, setRetracePath, setUsesRandomPath, stop, updateModifiedAttributes, usesRandomPathMethods inherited from class games.stendhal.server.entity.ActiveEntity
canMoveTo, canMoveTo, faceto, faceToward, getDirection, getDirectionToward, getDirectionToward, getResistance, getSpeed, getStepsTaken, handleLeaveZone, handlePortal, handleSimpleCollision, ignoresCollision, isFacingToward, isGhost, isMoveCompleted, isZoneChangeAllowed, move, onAdded, onRemoved, setDirection, setIgnoresCollision, setSpeed, stopped, updateMethods inherited from class games.stendhal.server.entity.Entity
describe, getAdjacentNodes, getArea, getArea, getCursor, getDescription, getDescriptionName, getEntitySlot, getHeight, getName, getOrigin, getResistance, getTitle, getWidth, getX, getY, getZone, hasDescription, isInSight, isObstacle, nextTo, nextTo, notifyWorldAboutChanges, setCursor, setDescription, setEntityClass, setEntitySubclass, setMenu, setPosition, setResistance, setSize, setVisibility, slotIterator, slots, squaredDistance, squaredDistanceMethods inherited from class marauroa.common.game.RPObject
addEvent, addLink, addLink, addMap, addSlot, addSlot, applyDifferences, clearEvents, clearVisible, clone, containsKey, equals, events, eventsIterator, fill, get, getBaseContainer, getBoolean, getContainer, getContainerBaseOwner, getContainerOwner, getContainerSlot, getDifferences, getDouble, getFromSlots, getID, getInt, getLink, getLinkedObject, getMap, getSlot, has, hashCode, hasLink, hasMap, hasSlot, hide, isContained, isEmpty, isHidden, isStorable, maps, put, put, put, put, readObject, remove, removeLink, removeMap, removeSlot, resetAddedAndDeleted, resetAddedAndDeletedMaps, resetAddedAndDeletedRPLink, resetAddedAndDeletedRPSlot, setAddedMaps, setAddedRPSlot, setContainer, setDeletedMaps, setDeletedRPSlot, setID, size, slots, slotsIterator, store, toString, unhide, unstore, writeObject, writeObject, writeToJsonMethods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlotsMethods inherited from class marauroa.common.game.Attributes
add, applyDifferences, get, getBool, getDouble, getInt, getList, getLong, getRPClass, has, instanceOf, iterator, put, put, put, put, put, readFromMap, remove, resetAddedAndDeletedAttributes, setAddedAttributes, setDeletedAttributes, setRPClass, setRPClass, toAttributeStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
RPCLASS_NAME
- See Also:
-
enemiesThatGiveFightXP
Maps each enemy which has recently damaged this entity to the turn when the last damage has occurred.
-
-
Constructor Details
-
CombatEntity
public CombatEntity()Default constructor. -
CombatEntity
Copy constructor.- Parameters:
object- The entity to be copied.
-
-
Method Details
-
generateRPClass
public static void generateRPClass()Generates the RPClass & specifies attributes. -
getsAtkXpFrom
Checks if this entity should get ATK XP.- Parameters:
defender- The target of this entity.
-
getsDefXpFrom
Checks if this entity should get DEF XP.- Parameters:
attacker- The entity targeting this one.damaged- Whether or not damage was inflicted.
-
recentlyDamagedBy
Checks if entity qualifies to receive combat XP.- Parameters:
opponent- Opposing entity.- Returns:
trueif damage occurred within a specified number of turns.
-