nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::Player Struct Reference

#include <world.h>

Public Attributes

std::string name
std::optional< protocol::Looks > looks
uint32_t guild = 0
uint32_t faction = 0
float x = 0.0f
float z = 0.0f
float yaw = 0.0f
 In radians, around the vertical. Zero faces along z, towards the camera.
Motion motion = Motion::kIdle
uint32_t experience = 0
int health = 0
int land = 0
 Which of the world's lands, by its place in kLands.
Inventory inventory
 What the player carries and wears.
Stats stats
std::set< uint32_t > skills
 The skills the player knows, by their ids in the skills file.
std::map< uint32_t, uint32_t > quests
std::set< uint32_t > quests_done
 The quests they've turned in, which they can't take again.
uint32_t quests_revision = 0
uint32_t target = 0
uint32_t target_player = 0
std::chrono::nanoseconds behind {0}
uint32_t skill = 0
std::chrono::nanoseconds cast {0}
skills::Effect effect
const items::Weapon * cast_weapon = nullptr
float cast_x = 0.0f
 Where they stood as the skill started, which its strides go on from.
float cast_z = 0.0f
uint32_t casts = 0
uint32_t chain = 0
std::chrono::nanoseconds chain_left {0}
std::map< uint32_t, std::chrono::nanoseconds > cooldowns
 How long until each skill they've used is ready again, by its id.
std::map< uint32_t, std::chrono::nanoseconds > item_cooldowns
std::chrono::nanoseconds respawn {0}
 While they're dead, how long until they can come back.
std::deque< Place > way
bool steered = false
float input_x = 0.0f
float input_z = 0.0f
bool input_run = false
bool input_attack = false
uint32_t input_skill = 0
 A skill the player asked for, which waits until they're free.
uint32_t crafting = 0
std::chrono::nanoseconds crafted {0}

Detailed Description

Definition at line 48 of file world.h.

Member Data Documentation

◆ behind

std::chrono::nanoseconds nanommo::Player::behind {0}

How far in the past their client draws everyone else, which their blows on another player are checked at.

Definition at line 90 of file world.h.

◆ cast

std::chrono::nanoseconds nanommo::Player::cast {0}

Definition at line 94 of file world.h.

◆ cast_weapon

const items::Weapon* nanommo::Player::cast_weapon = nullptr

Definition at line 99 of file world.h.

◆ cast_x

float nanommo::Player::cast_x = 0.0f

Where they stood as the skill started, which its strides go on from.

Definition at line 101 of file world.h.

◆ cast_z

float nanommo::Player::cast_z = 0.0f

Definition at line 102 of file world.h.

◆ casts

uint32_t nanommo::Player::casts = 0

How many skills they've started, so that one straight after itself starts again on the clients.

Definition at line 105 of file world.h.

◆ chain

uint32_t nanommo::Player::chain = 0

The swing that Space goes on into next, by its id, for as long as there's left to use it, or 0 for the first.

Definition at line 108 of file world.h.

◆ chain_left

std::chrono::nanoseconds nanommo::Player::chain_left {0}

Definition at line 109 of file world.h.

◆ cooldowns

std::map<uint32_t, std::chrono::nanoseconds> nanommo::Player::cooldowns

How long until each skill they've used is ready again, by its id.

Definition at line 111 of file world.h.

◆ crafted

std::chrono::nanoseconds nanommo::Player::crafted {0}

Definition at line 132 of file world.h.

◆ crafting

uint32_t nanommo::Player::crafting = 0

What the player's making, by its recipe's id in the recipes file, or 0 for nothing, and how long they've been at it.

Definition at line 131 of file world.h.

◆ effect

skills::Effect nanommo::Player::effect

What the skill does, as it was when it started, with the weapon in hand then, so that changing the weapon doesn't change how long it takes. And that weapon, as a weapon skill's blows land only while it's in hand.

Definition at line 98 of file world.h.

◆ experience

uint32_t nanommo::Player::experience = 0

Definition at line 64 of file world.h.

◆ faction

uint32_t nanommo::Player::faction = 0

The faction they've sworn to, by its id in the factions file, or 0 for none. It's for good.

Definition at line 58 of file world.h.

◆ guild

uint32_t nanommo::Player::guild = 0

The guild they're in, by its id, or 0 for none, which the server tells the world, as it's in MySQL.

Definition at line 55 of file world.h.

◆ health

int nanommo::Player::health = 0

Definition at line 65 of file world.h.

◆ input_attack

bool nanommo::Player::input_attack = false

Definition at line 126 of file world.h.

◆ input_run

bool nanommo::Player::input_run = false

Definition at line 125 of file world.h.

◆ input_skill

uint32_t nanommo::Player::input_skill = 0

A skill the player asked for, which waits until they're free.

Definition at line 128 of file world.h.

◆ input_x

float nanommo::Player::input_x = 0.0f

Definition at line 123 of file world.h.

◆ input_z

float nanommo::Player::input_z = 0.0f

Definition at line 124 of file world.h.

◆ inventory

Inventory nanommo::Player::inventory

What the player carries and wears.

Definition at line 69 of file world.h.

◆ item_cooldowns

std::map<uint32_t, std::chrono::nanoseconds> nanommo::Player::item_cooldowns

How long until they can use each item again, by its id in the items file.

Definition at line 114 of file world.h.

◆ land

int nanommo::Player::land = 0

Which of the world's lands, by its place in kLands.

Definition at line 67 of file world.h.

◆ looks

std::optional<protocol::Looks> nanommo::Player::looks

How they chose to look, which everyone's shown, or none for a character from before there were looks to choose, whose id picks theirs.

Definition at line 52 of file world.h.

◆ motion

Motion nanommo::Player::motion = Motion::kIdle

Definition at line 63 of file world.h.

◆ name

std::string nanommo::Player::name

Definition at line 49 of file world.h.

◆ quests

std::map<uint32_t, uint32_t> nanommo::Player::quests

The quests the player's on, by their ids in the quests file, with how many they've killed for each.

Definition at line 75 of file world.h.

◆ quests_done

std::set<uint32_t> nanommo::Player::quests_done

The quests they've turned in, which they can't take again.

Definition at line 77 of file world.h.

◆ quests_revision

uint32_t nanommo::Player::quests_revision = 0

Each change to their quests takes this to the next, as a bag's revision does, so the server can tell when to send them.

Definition at line 80 of file world.h.

◆ respawn

std::chrono::nanoseconds nanommo::Player::respawn {0}

While they're dead, how long until they can come back.

Definition at line 116 of file world.h.

◆ skill

uint32_t nanommo::Player::skill = 0

The skill the player's using, by its id in the skills file, and how far into it they are.

Definition at line 93 of file world.h.

◆ skills

std::set<uint32_t> nanommo::Player::skills

The skills the player knows, by their ids in the skills file.

Definition at line 72 of file world.h.

◆ stats

Stats nanommo::Player::stats

Definition at line 70 of file world.h.

◆ steered

bool nanommo::Player::steered = false

Whether the world moved them itself this tick, along their way, up to a monster or with a skill, or they're dead, so their keys didn't.

Definition at line 122 of file world.h.

◆ target

uint32_t nanommo::Player::target = 0

The monster the player picked, by its id, which their swings and skills go for, or 0 for none.

Definition at line 83 of file world.h.

◆ target_player

uint32_t nanommo::Player::target_player = 0

The player they picked, by their id, in place of a monster: their opponent in a duel, or an enemy at war, as nobody else can be. Players and monsters have ids of their own, so it goes beside the monster.

Definition at line 87 of file world.h.

◆ way

std::deque<Place> nanommo::Player::way

Where the player walks by themselves, as they asked to: each place in turn, straight, until they get there, or move, fight or die.

Definition at line 119 of file world.h.

◆ x

float nanommo::Player::x = 0.0f

Definition at line 59 of file world.h.

◆ yaw

float nanommo::Player::yaw = 0.0f

In radians, around the vertical. Zero faces along z, towards the camera.

Definition at line 62 of file world.h.

◆ z

float nanommo::Player::z = 0.0f

Definition at line 60 of file world.h.


The documentation for this struct was generated from the following file: