The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
Functions
biased_rng Namespace Reference

Functions

bool enabled ()
 Returns true if the current game uses the biased random mode with a local RNG.
 
int roll_credit (randomness::rng &rng)
 Rolls the credit a combatant starts a fight with.
 
bool roll_hit (randomness::rng &rng, int strikes_left, int chance_to_hit, int &credit)
 Rolls one strike.
 

Function Documentation

◆ enabled()

bool biased_rng::enabled ( )

Returns true if the current game uses the biased random mode with a local RNG.

Definition at line 78 of file attack.cpp.

References resources::classification, randomness::generator, randomness::rng::is_networked(), and game_classification::random_mode.

Referenced by events::mouse_handler::fill_weapon_choices().

◆ roll_credit()

int biased_rng::roll_credit ( randomness::rng &  rng)

Rolls the credit a combatant starts a fight with.

Definition at line 83 of file attack.cpp.

References randomness::rng::get_random_int().

◆ roll_hit()

bool biased_rng::roll_hit ( randomness::rng &  rng,
int  strikes_left,
int  chance_to_hit,
int &  credit 
)

Rolls one strike.

strikes_left includes this strike.

Definition at line 88 of file attack.cpp.

References randomness::rng::get_random_int().