-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrtp.c
More file actions
131 lines (107 loc) · 3.32 KB
/
rtp.c
File metadata and controls
131 lines (107 loc) · 3.32 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#include "rtp.h"
typedef const struct {
const char* name;
const bool female;
} rtpEntry;
rtpEntry rtpNames[] = {
{"Angelo DiNardi", false},
{"Chris Lockfort", false},
{"Dan Willemsen", false},
{"Derek Gonyeo", false},
{"Ethan House", false},
{"Grant Cohoe", false},
{"Jordan Rodgers", false},
{"Kevin Thompson", false},
{"Liam Middlebrook", false},
{"McSaucy", false},
{"Rob Glossop", false},
{"Russ Harmon", false},
{"Stephanie Miller", true},
{"Steve Greene", false},
{"Will Orr", false},
{"William Dignazio", false},
};
struct monst *
name_rtp(struct monst *mtmp)
{
int rtp_id = rn2(sizeof(rtpNames) / sizeof(rtpEntry));
if (rtpNames[rtp_id].female) {
mtmp->female = TRUE;
}
return christen_monst(mtmp, msg_from_string(rtpNames[rtp_id].name));
}
struct obj *
create_rtp_corpse(struct level *lev, int x, int y, enum rng rng)
{
struct obj *obj = NULL;
struct obj *orig_obj = NULL;
// There should be a significant reward in order to tempt the player into
// trying to kill an RTP. Otherwise it's risk without reward.
// In the future this should be a random selection from a slew of different
// items ranging in usefulness.
obj = mksobj_at(MAGIC_MARKER, lev, x, y, TRUE, FALSE, rng);
orig_obj = obj;
// What else are RTPs good for :D
obj = oname(obj, "The Root Password");
return obj;
}
void
player_killed_rtp(struct level *lev)
{
pline("You hear a faint whisper in the air: \"I'll shred your world\"");
// get a large sample set
int random = rn2(100);
// Enumerate through all the possibilities when the player kills an
// RTP
//
if (!(random / 10)) {
change_luck(-3);
}
// 5% chance that the player hallucinates for a long while
if (!(random / 20)) {
make_hallucinated(rn2(420) + 50, TRUE);
}
// 1% chance the player gets sick and dies after 42 turns
if (random == 42) {
make_sick(42, "Right before you killed that RTP 42 turns ago they gave you Heartbleed </3", TRUE, SICK_VOMITABLE);
}
// 33% chance that alignment changes
if (!(random / 3)) {
aligntyp player_align = u.ualign.type;
aligntyp new_align = A_NEUTRAL;
// If we're not neutral switch to opposite or neutral
if (player_align) {
new_align = rn2(1) * -player_align;
} else {
new_align = rn2(1)? 1: -1;
}
if (uarmh && uarmh->otyp == HELM_OF_OPPOSITE_ALIGNMENT) {
u.ualignbase[A_CURRENT] = new_align;
} else {
u.ualign.type = u.ualignbase[A_CURRENT] = new_align;
}
}
// 25% chance that you anger your god
if(!(random / 4)) {
gods_upset(u.ualign.type);
}
// 16.67% chance that player loses a level (if > 1)
if (!(random / 6) && u.ulevel > 1) {
losexp(NULL, FALSE);
}
// 20% chance to spawn a random (suitable for the level) angry monster near
// the player
if (!(random / 5)) {
makemon(NULL, lev, u.ux, u.uy, MM_ANGRY);
}
if (!(random / 10)) {
// Neat that this function already exists for our usage!
rndcurse();
}
if (!(random / 10)) {
if(uarmg) erode_obj(uarmg, NULL, ERODE_CORRODE, TRUE, TRUE);
}
if (!(random / 15)) {
polyself(FALSE);
}
}