public class Player extends AbstractPerson
AbstractPerson.Direction, AbstractPerson.Personality, AbstractPerson.PersonPositionComparator, AbstractPerson.PersonState
Modifier and Type | Field and Description |
---|---|
java.util.List<Clue> |
collectedClues
This object stores the clues that the player has picked up
|
boolean |
inConversation
This stores whether the player is in the middle of a conversation or not
|
private int |
personalityLevel
The personality will be a percent score (0-100) 0 being angry, 50 being neutral, and 100 being happy/nice.
|
animTime, animTimer, canMove, coordinates, currentRegion, destinationTile, direction, jsonData, SPRITE_HEIGHT, SPRITE_WIDTH, spriteSheet, startTile, state, tileCoordinates
Constructor and Description |
---|
Player(java.lang.String name,
java.lang.String imgSrc,
int tileX,
int tileY)
This is the constructor for player, it creates a new playable person
|
Modifier and Type | Method and Description |
---|---|
void |
addToPersonality(int change)
This method will change the players personality by the given amount.
|
private void |
checkForClue(ScoreTracker scoreTracker)
This method checks to see if the tile the player is facing has a clue hidden in it or not
|
private NPC |
getFacingNPC()
This method tries to get an NPC if the player is facing one
|
AbstractPerson.Personality |
getPersonality()
Getter for personality, it uses the personalityLevel of the player and thus returns either AGGRESSIVE, NEUTRAL or NICE
|
int |
getPersonalityLevel()
This gets the players personality level; this similar to Personality but a integer representation
|
java.lang.String |
getSpeech(Clue clue,
AbstractPerson.Personality style)
This method gets the speech based on what clue it is and the selected personality
|
void |
importDialogue(java.lang.String fileName)
Reads in the JSON file of tha character and stores dialogue in the dialogue HashMap
|
void |
interact(ScoreTracker scoreTracker)
This method is called when the player interacts with the map
|
boolean |
isOnTriggerTile()
This method returns whether or not the player is standing on a tile that initiates a Transition to another room
|
void |
move(AbstractPerson.Direction dir)
This Moves the player to a new tile.
|
void |
moveRoom()
This takes the player at its current position, and automatically gets the transition data for the next room and applies it to the player and game
|
finishMove, getDirection, getName, getRoom, getSpeech, getSpeech, getState, getTileCoordinates, initialiseMove, pushCoordinatesToSprite, setAnimTime, setDirection, setRoom, setTileCoordinates, update, updateTextureRegion
draw, draw, flip, getBoundingRectangle, getColor, getHeight, getOriginX, getOriginY, getRotation, getScaleX, getScaleY, getVertices, getWidth, getX, getY, rotate, rotate90, scale, scroll, set, setAlpha, setBounds, setCenter, setCenterX, setCenterY, setColor, setColor, setColor, setFlip, setOrigin, setOriginCenter, setPosition, setRegion, setRotation, setScale, setScale, setSize, setU, setU2, setV, setV2, setX, setY, translate, translateX, translateY
getRegionHeight, getRegionWidth, getRegionX, getRegionY, getTexture, getU, getU2, getV, getV2, isFlipX, isFlipY, setRegion, setRegion, setRegion, setRegion, setRegionHeight, setRegionWidth, setRegionX, setRegionY, setTexture, split, split
public java.util.List<Clue> collectedClues
public boolean inConversation
private int personalityLevel
public Player(java.lang.String name, java.lang.String imgSrc, int tileX, int tileY)
name
- - The name for the new player.imgSrc
- - The image used to represent it.public void importDialogue(java.lang.String fileName)
importDialogue
in class AbstractPerson
fileName
- - The file to read frompublic void addToPersonality(int change)
If the change takes it out of these bounds, it will change it to the min or max.
change
- - The amount to change by, can be positive or negativepublic void move(AbstractPerson.Direction dir)
dir
- the direction that the player should move in.public void interact(ScoreTracker scoreTracker)
private NPC getFacingNPC()
private void checkForClue(ScoreTracker scoreTracker)
public boolean isOnTriggerTile()
public AbstractPerson.Personality getPersonality()
getPersonality
in class AbstractPerson
public int getPersonalityLevel()
public void moveRoom()
public java.lang.String getSpeech(Clue clue, AbstractPerson.Personality style)
getSpeech
in class AbstractPerson
clue
- the clue to be questioned aboutstyle
- the style of questioning