Class PasswordPortal
java.lang.Object
marauroa.common.game.Attributes
marauroa.common.game.SlotOwner
marauroa.common.game.RPObject
games.stendhal.server.entity.Entity
games.stendhal.server.entity.mapstuff.portal.Portal
games.stendhal.server.entity.mapstuff.portal.PasswordPortal
- All Implemented Interfaces:
UseListener,Killer,Cloneable,Iterable<String>,Serializable
a portal which requires a password to pass through
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID -
Field Summary
Fields inherited from class games.stendhal.server.entity.mapstuff.portal.Portal
ATTR_FACE, ATTR_HIDDEN, ATTR_OFFSET, ATTR_USEFields inherited from class marauroa.common.game.RPObject
INVALID_ID -
Constructor Summary
ConstructorsConstructorDescriptionCreates a default PasswordPortalPasswordPortal(String password) creates a portal which requires a password to be said by the player -
Method Summary
Modifier and TypeMethodDescriptiongets the passwordgets the reject messagevoidlogic()booleanOverride so portal does not get "used"voidsetAcceptedMessage(String message) Optional message to be sent to player when portal is successfully usedvoidsetListeningRadius(int radius) voidsetPassword(String password) sets the required passwordvoidsetRejectedMessage(String message) sets the reject messageMethods inherited from class games.stendhal.server.entity.mapstuff.portal.Portal
generateRPClass, getDestinationReference, getDestinationZone, getFaceDirection, getIdentifier, getOffset, hasFaceDirection, hasOffset, isHidden, loaded, onPushedOntoFrom, onUsedBackwards, setDestination, setFaceDirection, setFaceDirection, setHidden, setIdentifier, setIgnoreNoDestination, toString, usePortalMethods inherited from class games.stendhal.server.entity.Entity
describe, getAdjacentNodes, getArea, getArea, getCursor, getDescription, getDescriptionName, getEntitySlot, getHeight, getName, getOrigin, getResistance, getResistance, getTitle, getWidth, getX, getY, getZone, hasDescription, isInSight, isObstacle, nextTo, nextTo, notifyWorldAboutChanges, onAdded, onMoved, onRemoved, setCursor, setDescription, setEntityClass, setEntitySubclass, setMenu, setPosition, setResistance, setSize, setVisibility, slotIterator, slots, squaredDistance, squaredDistance, stopped, updateMethods 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, 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, 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
-
Constructor Details
-
PasswordPortal
public PasswordPortal()Creates a default PasswordPortal -
PasswordPortal
creates a portal which requires a password to be said by the player- Parameters:
password- password to say
-
-
Method Details
-
getPassword
gets the password- Returns:
- password
-
getRejectedMessage
gets the reject message- Returns:
- reject message
-
logic
public void logic() -
onUsed
Override so portal does not get "used"- Specified by:
onUsedin interfaceUseListener- Overrides:
onUsedin classPortal- Parameters:
user- the RPEntity who uses the object- Returns:
- true if successful
-
setAcceptedMessage
Optional message to be sent to player when portal is successfully used- Parameters:
message- Message to be sent
-
setListeningRadius
public void setListeningRadius(int radius) - Parameters:
radius- Radius at which portal will listen for player's speech
-
setPassword
sets the required password- Parameters:
password- new password
-
setRejectedMessage
sets the reject message- Parameters:
message- message informing the player about the failed condition
-