Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
random.qh
Go to the documentation of this file.
1#pragma once
2
9
13void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority);
14#define RandomSelection_AddEnt(e, weight, priority) RandomSelection_Add(e, 0, string_null, '0 0 0', weight, priority)
15#define RandomSelection_AddFloat(f, weight, priority) RandomSelection_Add(NULL, f, string_null, '0 0 0', weight, priority)
16#define RandomSelection_AddString(s, weight, priority) RandomSelection_Add(NULL, 0, s, '0 0 0', weight, priority)
17#define RandomSelection_AddVec(v, weight, priority) RandomSelection_Add(NULL, 0, string_null, v, weight, priority)
18
20void DistributeEvenly_Init(float amount, float totalweight);
22float DistributeEvenly_Get(float weight);
24float DistributeEvenly_GetRounded(float weight);
26float DistributeEvenly_GetRandomized(float weight);
27
29float gsl_ran_ugaussian();
30
32#define crandom() (2 * (random() - 0.5))
33
34#define USE_PRANDOM
35
36#ifdef USE_PRANDOM
37 float prandom();
39
40 void psrandom(float seed);
41 #ifdef USE_PRANDOM_DEBUG
42 void prandom_debug();
43 #else
44 #define prandom_debug()
45 #endif
46#else
47 #define prandom random
48 #define prandomvec randomvec
49 #define psrandom(x)
50 #define prandom_debug()
51#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define ERASEABLE
Definition _all.inc:37
float RandomSelection_best_priority
Definition random.qh:4
ERASEABLE void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority)
Definition random.qc:14
float RandomSelection_chosen_float
Definition random.qh:6
ERASEABLE void RandomSelection_Init()
Definition random.qc:4
ERASEABLE void DistributeEvenly_Init(float amount, float totalweight)
Definition random.qc:42
string RandomSelection_chosen_string
Definition random.qh:7
float RandomSelection_totalweight
Definition random.qh:3
void psrandom(float seed)
Definition random.qc:136
ERASEABLE float DistributeEvenly_GetRounded(float weight)
Definition random.qc:63
entity RandomSelection_chosen_ent
Definition random.qh:5
ERASEABLE float DistributeEvenly_Get(float weight)
Definition random.qc:52
vector RandomSelection_chosen_vec
Definition random.qh:8
float prandom()
Predictable random number generator (not seeded yet)
Definition random.qc:108
vector prandomvec()
Definition random.qc:121
ERASEABLE float DistributeEvenly_GetRandomized(float weight)
Definition random.qc:74
#define prandom_debug()
Definition random.qh:44
ERASEABLE float gsl_ran_ugaussian()
Returns a Gaussian random variate, with mean zero and standard deviation sigma 1 From the GNU Scienti...
Definition random.qc:87
vector
Definition self.qh:92