import Player from 'WTF-Adventure/WTF-Adventure/client/entity/character/player/player.js'
Constructor Summary
Public Constructor | ||
public |
Default constructor |
Member Summary
Public Members | ||
public |
The player's armor |
|
public |
avatar: [type] Player's avatar |
|
public |
The player's boots |
|
public |
Direction they are facing |
|
public |
Are their actions disabled |
|
public |
Player's email |
|
public |
How many experience the player has |
|
public |
Current health points |
|
public |
The player's ID number |
|
public |
The player's last login |
|
public |
Level of the player |
|
public |
Current magic points |
|
public |
Maximum health points |
|
public |
Maximum magic points |
|
public |
Keyboard moving down |
|
public |
Keyboard moving left |
|
public |
Keyboard moving right |
|
public |
Keyboard moving up |
|
public |
name: [type] The player's name??? not sure |
|
public |
Player's password |
|
public |
The player's pendant |
|
public |
Previous grid X position |
|
public |
Previous grid Y position |
|
public |
Player that is currently attacking them |
|
public |
How many PVP death's they've had |
|
public |
How many PVP kills they've had |
|
public |
Player = 0, moderator = 1, or admin >= 2 |
|
public |
The player's ring |
|
public |
Timeout for temporary blinking |
|
public |
The type of entity this is |
|
public |
Callback for armor updates |
|
public |
Player's username |
|
public |
Not sure what this is.... |
|
public |
The player's weapon |
Method Summary
Public Methods | ||
public |
Gets the name of the sprite depending on their equipped armor
defaults to |
|
public |
Get the player's grid X position |
|
public |
Get the player's grid Y position |
|
public |
Returns true if there was keyboard movememnt |
|
public |
Returns true if the player has a weapon |
|
public |
Returns true if the has a ranged weapon |
|
public |
Loads the player's default (empty) equipment |
|
public |
loadHandler(game: Game) This is for other player characters |
|
public |
loadPlayer(data: Object) Load equipment for this player given the data response from the server |
|
public |
onUpdateArmour(callback: Function) Set the callback for updating armour |
|
public |
setEquipment(type: Modules, info: Array) Set the player's equipment from the server |
|
public |
Sets the ID of the player |
|
public |
Set the player's current mana |
|
public |
setMaxMana(maxMana: [type]) Set the player's maximum mana amount |
|
public |
Sets the name and username of the player |
|
public |
setPointsData(hitPointsData: Array, manaData: Array) Set the player's health and mana from the server data |
|
public |
Temporary blink the entity |
|
public |
Unequip an item |
Inherited Summary
From class Entity | ||
public |
Angle of the entity |
|
public |
[angled description] |
|
public |
Animations for the sprite |
|
public |
Timeout function for blinking |
|
public |
Count down time |
|
public |
Current counter |
|
public |
Critical health |
|
public |
Current animation the sprite should be playing |
|
public |
Set if the entity is dirty |
|
public |
Callback for when the entity is dirty |
|
public |
Whether or not this is fading |
|
public |
Fading time |
|
public |
Grid X position |
|
public |
Grid Y position |
|
public |
Handler for the entity |
|
public |
Has a counter |
|
public |
Hurt sprite name |
|
public |
Entity id |
|
public |
Label for the entity |
|
public |
Name of the entity |
|
public |
Non pathable |
|
public |
Normal sprite name |
|
public |
Path |
|
public |
CAllback function when the entity is ready |
|
public |
Rendering data |
|
public |
Has a shadow |
|
public |
Offset for the shadow on the Y axis |
|
public |
Sprite |
|
public |
Whether or not to flip the sprite on the X axis |
|
public |
Whether or not to flip the sprite on the Y axis |
|
public |
Whether or not the sprite has been loaded |
|
public |
Stunned status |
|
public |
Terror status |
|
public |
Wehther or not this entity is visible |
|
public |
X coordinate |
|
public |
Y coordinate |
|
public |
Tell this entity to start blinking |
|
public |
Tell this to fade in given the duration |
|
public |
getAnimationByName(name: String): Animation | null Look for an animtions list for this specific animation given it's name |
|
public |
getCoordDistance(toX: Number, toY: Number): Number Get the distance from this entity to the given x,y coordinates |
|
public |
getDistance(entity: Entity): Number Get the distance from this entity to another entity |
|
public |
Returns the name of the sprite |
|
public |
Check if this entity currently has a path |
|
public |
Check whether or not this entity has a shadow |
|
public |
hasWeapon(): Item | Projectile Returns the instance of the weapon this entity has |
|
public |
inAttackRadius(entity: Entity): Boolean Figure out if this entity is within the attack radius of the given entity |
|
public |
inExtraAttackRadius(entity: Entity): Boolean Figure out if this entity is within the extended attack radius of the given entity |
|
public |
isPositionAdjacent(x: Number, y: Number, ignoreDiagonals: Boolean): Boolean Checks to see if the x,y coordinate is adjacent to the entity's current position |
|
public |
Check whether or not this entity is visible |
|
public |
This is important for when the client is on a mobile screen. |
|
public |
When this entity's is dirty (mobile) use this callback |
|
public |
When this entity's sprite is loaded trigger this callback |
|
public |
setAnimation(name: String, speed: Number, count: Number, onEndCount: Number) Set the animation on this entity |
|
public |
setCountdown(count: Number) Set the count for the count down time |
|
public |
setGridPosition(x: Number, y: Number) Set the x,y position of the entity on the tile grid |
|
public |
Set the entity's name |
|
public |
setPosition(x: Number, y: [type]) Set the x,y position for the entity |
|
public |
Set the sprite for this entity |
|
public |
setVisible(visible: Boolean) Set the visibility on this entity |
|
public |
Tell the entity to stop blinking and force it to be visible |
|
public |
Toggle the current visibility of this entity |
From class Character | ||
public |
Object of adjacent tiles while pathing |
|
public |
Attack animation speed |
|
public |
What is their attack range |
|
public |
An array of things trying to attack them |
|
public |
Are they attacking something |
|
public |
Before step callback |
|
public |
Did they get a critical hit |
|
public |
Global critical animation |
|
public |
Are they dead |
|
public |
destination: {gridX: Number, gridY: Number} The X and Y locations of the destination |
|
public |
Did they explode |
|
public |
Global explosion animation |
|
public |
Are they following something |
|
public |
If this character's pathing is being forced |
|
public |
Are they frozen |
|
public |
Does their health reset after time is up |
|
public |
Is there health bar visible or not |
|
public |
How many hit points they have left |
|
public |
Hit points callback |
|
public |
Idle animation speed |
|
public |
Should their action be interrupted |
|
public |
How much magic they have left |
|
public |
How many hit points they have total |
|
public |
How much magic they have total |
|
public |
Move callback |
|
public |
Movement transitions |
|
public |
Movement animation speed |
|
public |
Location of a new destination during pathing |
|
public |
Next grid X position |
|
public |
Next grid Y position |
|
public |
orientation: Orientation The direction they are pointing |
|
public |
path: Astar What is their current path |
|
public |
Previous gridX position |
|
public |
Previous gridY position |
|
public |
Request path callback |
|
public |
Second step callback |
|
public |
Do they have a shadow |
|
public |
Flip the sprite along the X axis |
|
public |
Flip the sprite along the Y axis |
|
public |
Start pathing callback |
|
public |
Default step number |
|
public |
Step callback |
|
public |
Stop pathing callback |
|
public |
Global stun animation |
|
public |
Are they stunned |
|
public |
What is their current target |
|
public |
If this character is in terror |
|
public |
Global terror animation |
|
public |
Walk animation speed |
|
public |
Do they have a weapon |
|
public |
addAttacker(character: Character): Boolean Add an attacker to a character |
|
public |
Animate the character depending on their current orientation |
|
public |
Attack a specific character |
|
public |
backOff() Stop following or attacking another character |
|
public |
changedPath(): [type] Returns true if they've changed paths |
|
public |
Clear the health bar from the screen |
|
public |
Follow a specific character |
|
public |
followPath(path: Array): Boolean Taken from TTA - this is to ensure the player does not click on himself or somehow into another dimension |
|
public |
forEachAttacker(callback: Function) Apply a callback to each attacker |
|
public |
forget() Removes all attakers |
|
public |
Return the active effect on the character |
|
public |
Get the correct effect animation |
|
public |
Go to a specific x,y value |
|
public |
hasAttacker(character: Character): Boolean Check if they are already being attacked by this character |
|
public |
Returns true if they have a next path step |
|
public |
Returns true if they have a path |
|
public |
Returns true if they have a shadow |
|
public |
Returns true if they are targeting someone |
|
public |
Returns true if they have a weapon |
|
public |
Set the idle animation and optional orientation direction |
|
public |
Check if they are being attacked |
|
public |
Check if the character is currently moving |
|
public |
Load all global character animations |
|
public |
Look at a specific character |
|
public |
Move the character to a new location |
|
public |
moved() The character has moved, trigger the move callback if there is one |
|
public |
We can have the movement remain client side because the server side will be responsible for determining whether or not the player should have reached the location and ban all hackers. |
|
public |
onBeforeStep(callback: Function) Before a pathing step callback |
|
public |
onHitPoints(callback: Function) On hit points callback |
|
public |
On move callback |
|
public |
onRequestPath(callback: Function) Callback for path requested |
|
public |
onSecondStep(callback: Function) Second step callback |
|
public |
onStartPathing(callback: Function) Start pathing callback |
|
public |
Pathing step callback |
|
public |
onStopPathing(callback: Function) Stop pathing callback |
|
public |
performAction(orientation: Number, action: Number) Set a specific animation action |
|
public |
Set a new destination during movement somewhere |
|
public |
removeAttacker(character: Character): Boolean Removes an attacker from a character |
|
public |
Returns true if the target was removed |
|
public |
requestPathfinding(x: Number, y: Number): Array Request path finding from current position to this position |
|
public |
setHitPoints(hitPoints: Number) Set the character's hit points then triggers hitPointsCallback |
|
public |
setMaxHitPoints(maxHitPoints: Number) Set the character's maximum hit points |
|
public |
setOrientation(orientation: String) Set the character's orientation |
|
public |
Sets a target for this character |
|
public |
Stop the character movement |
|
public |
The triggered health bar (currently fighting) |
|
public |
Update the character's position on the grid |
|
public |
Update movement on the path |
Public Constructors
Public Members
Public Methods
public getSpriteName(): String source
Gets the name of the sprite depending on their equipped armor
defaults to clotharmor
if they don't have anything equipped
public hasWeapon(): Boolean source
Returns true if the player has a weapon
Override:
Character#hasWeaponpublic loadHandler(game: Game) source
This is for other player characters
Params:
Name | Type | Attribute | Description |
game | Game | an instance of the game |
public loadPlayer(data: Object) source
Load equipment for this player given the data response from the server
Params:
Name | Type | Attribute | Description |
data | Object | player equipment and info from the server |
|
data.instance | Number | ID of the player |
|
data.x | Number | grid X position |
|
data.y | Number | grid Y position |
|
data.hitPoints | Number | current hit points |
|
data.mana | Number | current mana points |
|
data.username | String | the name of the player |
|
data.experience | Number | the player experience points |
|
data.level | Number | the player's level |
|
data.lastLogin | String | the last login date |
|
data.pvpKills | Number | the total pvp kills |
|
data.pvpDeaths | Number | the total pvp deaths |
public onUpdateArmour(callback: Function) source
Set the callback for updating armour
Params:
Name | Type | Attribute | Description |
callback | Function | function to reset armor |
public setId(id: Number) source
Sets the ID of the player
Params:
Name | Type | Attribute | Description |
id | Number | player ID |
public setMana(mana: Number) source
Set the player's current mana
Params:
Name | Type | Attribute | Description |
mana | Number | amount |
public setMaxMana(maxMana: [type]) source
Set the player's maximum mana amount
Params:
Name | Type | Attribute | Description |
maxMana | [type] | amount |
public setName(name: String) source
Sets the name and username of the player
Override:
Entity#setNameParams:
Name | Type | Attribute | Description |
name | String | username of the player |