-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImplant.cpp
52 lines (47 loc) · 1.36 KB
/
Implant.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "Global.h"
#include "Util.h"
#include "Hero.h"
#include "Object.h"
#include "Interface.h"
static int
useHealthMonitor (shObject *monitor)
{
if (monitor->isBuggy ()) {
I->p ("Firmware malfunction. Unable to gauge radiation level.");
monitor->setBugginessKnown ();
} else {
I->p ("Reported radiation dosage absorbed by your body is %s.",
Hero.radLevels ());
}
return 0;
}
static int
useGloryDevice (shObject *device)
{
if (I->yn ("Activate the glory device and die a martyr's death?")) {
Hero.shCreature::die (kSuicide); /* Death routine handles everything. */
}
return 0;
}
void
initializeImplants ()
{
AllIlks[kObjHealthMonitor].mUseFunc = useHealthMonitor;
AllIlks[kObjGloryDevice].mUseFunc = useGloryDevice;
}
const char *
describeImplantSite (shObjectIlk::Site site)
{
switch (site) {
case shObjectIlk::kFrontalLobe: return "frontal lobe";
case shObjectIlk::kTemporalLobe: return "temporal lobe";
case shObjectIlk::kParietalLobe: return "parietal lobe";
case shObjectIlk::kOccipitalLobe: return "occipital lobe";
case shObjectIlk::kCerebellum: return "cerebellum";
case shObjectIlk::kLeftEar: return "left ear";
case shObjectIlk::kRightEyeball: return "right eyeball";
case shObjectIlk::kNeck: return "neck";
default:
return "brain";
}
}