finished the bulk of game
This commit is contained in:
22
src/gold.cc
22
src/gold.cc
@ -1,5 +1,7 @@
|
||||
#include "gold.h"
|
||||
|
||||
#include "constants.h"
|
||||
|
||||
int rand_gold_pile(RNG *rng) {
|
||||
const int denominator = 8;
|
||||
const int normal = 5;
|
||||
@ -16,3 +18,23 @@ int rand_gold_pile(RNG *rng) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
gold get_gold_at(const position &pos, gold_list &glist) {
|
||||
gold ret = {0, {0, 0}};
|
||||
|
||||
for (size_t i = 0; i < glist.size(); ++i)
|
||||
if (glist[i].pos == pos) {
|
||||
ret = glist[i];
|
||||
glist.erase(i + glist.begin());
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rand_gold_drop(RNG *rng) {
|
||||
if (rng->coin_flip())
|
||||
return GOLD_NORMAL;
|
||||
|
||||
return GOLD_SMALL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user