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