TODO: modify other races constructors
did some reworking
This commit is contained in:
19
src/gold.h
19
src/gold.h
@ -2,7 +2,9 @@
|
||||
#define __GOLD_H__
|
||||
|
||||
#include <vector>
|
||||
#include "constants.h"
|
||||
#include "position.h"
|
||||
#include "rng.h"
|
||||
|
||||
struct gold {
|
||||
int amount;
|
||||
@ -11,4 +13,21 @@ struct gold {
|
||||
|
||||
typedef std::vector<gold> gold_list;
|
||||
|
||||
int rand_gold_pile(RNG *rng) {
|
||||
const int denominator = 8;
|
||||
const int normal = 5;
|
||||
const int dragon = 6;
|
||||
|
||||
int tmp = rng->rand_under(denominator);
|
||||
|
||||
if (tmp < normal)
|
||||
return GOLD_NORMAL;
|
||||
else if (tmp < dragon)
|
||||
return GOLD_DRAGON;
|
||||
else
|
||||
return GOLD_SMALL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user