static int user_character_picked_lock (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Have you ever picked a lock? [yn] ")) return 0; cinema_print_line(1, "Really? Well, the police are being notified."); usleep(250000); cinema_print_line(1, "Really? Well, the police are being notified.."); usleep(250000); cinema_print_line(1, "Really? Well, the police are being notified..."); usleep(250000); cinema_print_line(1, "Really? Well, the police are being notified...."); usleep(250000); cinema_print_line(1, "Really? Well, the police are being notified.... done!"); morewait(); return 2; }
int cinema_interact_line (int line, char * choices, char * text) { int response; assert(0 == line || 1 == line); assert(choices && strlen(choices) > 0); while (1) { cinema_print_line(line, text); response = cinema_getch(); if (ABORT == response) break; if (strchr(choices, response)) break; cinema_print_line(2, "What? Try again!"); } return response; }
static int user_character_irish (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Are you Irish? [yn] ")) return 0; cinema_print_line(1, "Is that blarney or what?"); morewait(); return 2; }
static int user_character_ghosts (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Do you believe in ghosts? [yn] ")) return 0; cinema_print_line(1, "I do! I do! I do believe in ghosts!"); morewait(); return 2; }
static int user_character_pk (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Do you have PK? [yn] ")) return 0; cinema_print_line(1, "I can't tell you how much that moves me."); morewait(); return 6; }
static int user_character_esp (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Do you have ESP? [yn] ")) return 0; cinema_print_line(1, "Somehow, I knew you were going to say that."); morewait(); return 3; }
static int user_character_out_of_body (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Ever have an out-of-body experience? [yn] ")) return 0; cinema_print_line(1, "Wow, man! Fly the friendly skies..."); morewait(); return 3; }
static int user_character_auras (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Can you see auras? [yn] ")) return 0; cinema_print_line(1, "How strange."); morewait(); return 3; }
static int user_character_animals (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Do animals react oddly to your presence? [yn] ")) return 0; cinema_print_line(1, "How curious that must be."); morewait(); return 2; }
static int user_character_smoke (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Do you smoke? [yn] ")) return 0; cinema_print_line(1, "*cough*"); morewait(); return -3; }
static int user_character_dumb (void) { int num; cinema_blank(); if ('y' == cinema_ynq_line(0, "Pretty dumb, aren't you? [yn] ")) { num = 3 + random_range(3); cinema_print_line(1, "I thought so..."); } else { num = 6 + random_range(6); cinema_print_line(1, "Well, not *that* dumb."); } morewait(); return num; }
static int user_character_spell (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Did you ever cast a spell? [yn] ")) return 0; if ('y' != cinema_ynq_line(1, "Did it work? [yn] ")) return 3; cinema_print_line(2, "Sure it did..."); morewait(); return 7; }
int cinema_getnum_line (int line, char * prompt) { int num; assert(0 == line || 1 == line); cinema_blank_line(line); cinema_print_line(line, prompt); num = (int)input_number(Cinema); return num; }
static int user_character_typing_speed (void) { int num; cinema_blank(); num = (int)cinema_getnum_line(0, "What's your typing speed (words per minute)? "); if (num > 124) { num = 124; cinema_print_line(1, "Tell me another one..."); morewait(); } return num / 25; }
static int user_character_miles_run (void) { int num; cinema_blank(); num = (int)cinema_getnum_line(0, "How many miles can you run? "); if (num < 1) return -3; if (num < 5) return 2; if (num < 10) return 4; if (num < 26) return 8; cinema_print_line(1, "Right. Sure. Give me a break."); morewait(); return 8; }
static int user_character_graduate_exam (void) { int num = 0; char * prompt = "Took Graduate entrance exams? [yn] "; cinema_blank(); if ('y' == cinema_ynq_line(0, prompt)) { while (1) { num = (int)cinema_getnum_line(1, "So, what percentile? "); if (num < 100) break; cinema_scene("That's impossible!", 0, 0); cinema_print_line(0, prompt); } num = 9 * (num - 49) / 50 + 9; } return num; }