static void _birth(void) { p_ptr->current_r_idx = MON_CHEERFUL_LEPRECHAUN; skills_innate_init("Greedy Hands", WEAPON_EXP_BEGINNER, WEAPON_EXP_MASTER); msg_print("You feel the luck of the Irish!"); mut_gain(MUT_GOOD_LUCK); mut_lock(MUT_GOOD_LUCK); }
bool mut_gain_random(mut_pred pred) { int which = mut_gain_random_aux(pred); if (which >= 0 && !mut_present(which)) { chg_virtue(V_CHANCE, 1); return mut_gain(which); } msg_print("You feel normal."); return FALSE; }
/**************************************************************** * Demigod ****************************************************************/ static void _gain_power(int which) { if (p_ptr->demigod_power[which] < 0) { int idx = mut_gain_choice(mut_demigod_pred); mut_lock(idx); p_ptr->demigod_power[which] = idx; } else if (!mut_present(p_ptr->demigod_power[which])) { mut_gain(p_ptr->demigod_power[which]); mut_lock(p_ptr->demigod_power[which]); } }
/**************************************************************** * Human ****************************************************************/ static void _human_gain_level(int new_level) { if (new_level >= 30) { if (p_ptr->demigod_power[0] < 0) { int idx = mut_gain_choice(mut_demigod_pred/*mut_human_pred*/); mut_lock(idx); p_ptr->demigod_power[0] = idx; } else if (!mut_present(p_ptr->demigod_power[0])) { mut_gain(p_ptr->demigod_power[0]); mut_lock(p_ptr->demigod_power[0]); } } }
int mut_gain_choice(mut_pred pred) { int choices[MAX_MUTATIONS]; int i; int ct = 0; menu_list_t list = { "Gain which mutation?", "Browse which mutation?", NULL, _mut_name, NULL, NULL, choices, 0}; for (i = 0; i < MAX_MUTATIONS; i++) { if (!mut_present(i)) { if (pred == NULL || (pred(i))) choices[ct++] = i; } } if (ct == 0) return -1; list.count = ct; for (;;) { i = menu_choose(&list); if (i >= 0) { char buf[1024]; char buf2[1024]; int idx = choices[i]; mut_name(idx, buf2); sprintf(buf, "You will gain %s. Are you sure?", buf2); if (get_check(buf)) { mut_gain(idx); return idx; } } msg_print("Please make a choice!"); } return -1; }
void living_trump_spell(int cmd, variant *res) { switch (cmd) { case SPELL_NAME: var_set_string(res, "Living Trump"); break; case SPELL_DESC: var_set_string(res, "Gives mutation which makes you teleport randomly or makes you able to teleport at will."); break; case SPELL_CAST: { int mutation = one_in_(7) ? MUT_TELEPORT : MUT_TELEPORT_RND; if (mut_gain(mutation)) msg_print("You have turned into a Living Trump."); var_set_bool(res, TRUE); break; } default: default_spell(cmd, res); break; } }
/**************************************************************** * Lucky ****************************************************************/ static void _lucky_birth(void) { mut_gain(MUT_GOOD_LUCK); mut_lock(MUT_GOOD_LUCK); }