summaryrefslogtreecommitdiff
path: root/src/game/unit_scientist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/unit_scientist.cpp')
-rw-r--r--src/game/unit_scientist.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/unit_scientist.cpp b/src/game/unit_scientist.cpp
index bac2a23..129d7fa 100644
--- a/src/game/unit_scientist.cpp
+++ b/src/game/unit_scientist.cpp
@@ -57,6 +57,7 @@ void unit_scientist_t::gather_crystals(void)
world::trace_t trace;
bool found = true;
deco_t *deco;
+ size_t crystals;
if (!move.moving)
start_moving(gathering_at);
@@ -76,6 +77,11 @@ void unit_scientist_t::gather_crystals(void)
goto out;
}
+ crystals = game->prng.next() % 100 + 1;
+ game->crystals += crystals;
+ game->interface.print(name + " collected " + std::to_string(crystals) + " " +
+ (crystals == 1 ? "crystal" : "crystals"));
+
deco->type = DECO_CRYSTAL_BROKEN;
assets::scientist.gather.play_3d(x);