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

#include <reactions.h>

Public Member Functions

void Hit (uint32_t monster, uint32_t player)
 The player hit the monster, both by their ids.
void Update (float seconds)
 Moves each blow's reaction on.
void Apply (std::vector< Figure > &figures)
 Lights up, rocks and tips the monsters, as their blows have them now.

Static Public Attributes

static constexpr float kFlashTime = 0.15f
 How long a flash takes to fade, in seconds.
static constexpr float kRock = 0.3f
static constexpr float kRockIn = 0.03f
static constexpr float kRockOut = 0.12f
static constexpr float kTumble = 0.6f
 How far over a monster in the air tips, in radians, for each metre up.
static constexpr float kHeld = 2.0f

Detailed Description

How the monsters take the blows that land on them: each lights up, and rocks back away from whoever hit it, and one thrown up tumbles as it goes.

Definition at line 14 of file reactions.h.

Member Function Documentation

◆ Apply()

void nanommo::Reactions::Apply ( std::vector< Figure > & figures)

Lights up, rocks and tips the monsters, as their blows have them now.

Definition at line 23 of file reactions.cc.

◆ Hit()

void nanommo::Reactions::Hit ( uint32_t monster,
uint32_t player )

The player hit the monster, both by their ids.

Definition at line 10 of file reactions.cc.

◆ Update()

void nanommo::Reactions::Update ( float seconds)

Moves each blow's reaction on.

Definition at line 14 of file reactions.cc.

Member Data Documentation

◆ kFlashTime

float nanommo::Reactions::kFlashTime = 0.15f
staticconstexpr

How long a flash takes to fade, in seconds.

Definition at line 17 of file reactions.h.

◆ kHeld

float nanommo::Reactions::kHeld = 2.0f
staticconstexpr

How long a blow's kept, in seconds: long enough for a monster it threw up to come down again, tipped the way it sent it.

Definition at line 27 of file reactions.h.

◆ kRock

float nanommo::Reactions::kRock = 0.3f
staticconstexpr

How far a blow rocks a monster back at most, in radians, and how fast it gets there and comes back.

Definition at line 20 of file reactions.h.

◆ kRockIn

float nanommo::Reactions::kRockIn = 0.03f
staticconstexpr

Definition at line 21 of file reactions.h.

◆ kRockOut

float nanommo::Reactions::kRockOut = 0.12f
staticconstexpr

Definition at line 22 of file reactions.h.

◆ kTumble

float nanommo::Reactions::kTumble = 0.6f
staticconstexpr

How far over a monster in the air tips, in radians, for each metre up.

Definition at line 24 of file reactions.h.


The documentation for this class was generated from the following files: