void add_aura(int who, int aura) { p_magic(who)->cur_aura += aura; if (char_max_aura(who) && char_cur_aura(who) > 5 * max_eff_aura(who)) p_magic(who)->cur_aura = 5 * max_eff_aura(who); };
int d_adv_med(struct command *c) { struct char_magic *p; int chance; int m_a; if (subkind(subloc(c->who)) != sub_tower || !alone_here(c->who)) { wout(c->who, "You must be alone in a tower to use Advanced Meditation."); return FALSE; }; if (c->wait != 0) return TRUE; chance = hinder_med_chance(c->who); p = p_magic(c->who); p->hinder_meditation = 0; m_a = max_eff_aura(c->who); if (rnd(1, 100) <= chance) { wout(c->who, "Disturbing images and unquiet thoughts " "hamper the meditative trance!"); return FALSE; }; p->max_aura++; wout(c->who, "Maximum aura is now %d.", p->max_aura); return TRUE; }
int d_adv_med(struct command *c) { struct char_magic *p; int chance; int m_a; int bonus; chance = hinder_med_chance(c->who); p = p_magic(c->who); p->hinder_meditation = 0; m_a = max_eff_aura(c->who); bonus = max(2, max_eff_aura(c->who) / 10); if (rnd(1, 100) <= chance) { wout(c->who, "Disturbing images and unquiet thoughts " "hamper the meditative trance."); bonus = 1; } p->cur_aura += bonus; if (p->cur_aura >= max_eff_aura(c->who) + 2) p->cur_aura = max_eff_aura(c->who) + 2; wout(c->who, "Current aura is now %d.", p->cur_aura); return TRUE; }
int d_meditate(struct command *c) { struct char_magic *p; int chance; int bonus; chance = hinder_med_chance(c->who); p = p_magic(c->who); p->hinder_meditation = 0; if (rnd(1, 100) <= chance) { wout(c->who, "Disturbing images and unquiet thoughts " "ruin the meditative trance. Meditation fails."); return FALSE; } bonus = max(1, max_eff_aura(c->who) / 20); p->cur_aura += bonus; if (p->cur_aura >= max_eff_aura(c->who) + 1) p->cur_aura = max_eff_aura(c->who) + 1; wout(c->who, "Current aura is now %d.", p->cur_aura); return TRUE; }
int cast_check_char_here(int who, int target) { int where; int basic; int pl; basic = char_proj_cast(who); if (is_loc_or_ship(basic)) where = basic; else where = subloc(who); #if 1 p_magic(who)->project_cast = 0; #endif if (crosses_ocean(where, who)) { wout(who, "Something seems to block your magic."); return FALSE; }; if (kind(target) != T_char || where != subloc(target)) { wout(who, "%s is not a character in range of this cast.", box_code(target)); return FALSE; } if (char_really_hidden(target)) { pl = player(who); if (pl == player(target)) return TRUE; if (contacted(target, who)) return TRUE; return FALSE; } #if 0 if (basic == where) p_magic(who)->project_cast = 0; #endif return TRUE; }
int d_meditate(struct command *c) { struct char_magic *p; int chance; if (!char_alone(c->who)) { wout(c->who, "You cannot meditate unless completely alone."); return FALSE; }; if (char_cur_aura(c->who) >= max_eff_aura(c->who)) { wout(c->who, "Current aura is already %d. It may not " "be increased further via meditation.", char_cur_aura(c->who)); return FALSE; } if (c->wait != 0) return TRUE; chance = hinder_med_chance(c->who); p = p_magic(c->who); p->hinder_meditation = 0; if (rnd(1, 100) <= chance) { wout(c->who, "Disturbing images and unquiet thoughts " "ruin the meditative trance. Meditation fails."); return FALSE; } /* * How much should we add? 2, 4 if alone in a tower, * and 2 additional if has an auraculum. * */ add_aura(c->who,2); if (subkind(subloc(c->who)) == sub_tower && alone_here(c->who)) add_aura(c->who,2); if (has_auraculum(c->who)) add_aura(c->who,2); wout(c->who, "Current aura is now %d.", p->cur_aura); return TRUE; }
int reset_cast_where(int who) { int where; where = char_proj_cast(who); if (is_loc_or_ship(where)) { p_magic(who)->project_cast = 0; return where; } return subloc(who); }
int d_quick_cast(struct command *c) { int aura = c->a; struct char_magic *p; if (!charge_aura(c->who, aura)) return FALSE; p = p_magic(c->who); p->quick_cast += aura; wout(c->who, "Spell cast speedup now %d.", p->quick_cast); return TRUE; }
int d_shroud_abil(struct command *c) { int aura = c->a; struct char_magic *p; if (!charge_aura(c->who, aura)) return FALSE; p = p_magic(c->who); p->ability_shroud += aura; wout(c->who, "Now cloaked in an aura %s ability shroud.", nice_num(p->ability_shroud)); return TRUE; }
int d_hinder_med(struct command *c) { int target = c->a; int aura = c->b; struct char_magic *p; if (!charge_aura(c->who, aura)) return FALSE; wout(c->who, "Successfully cast %s on %s.", box_name(sk_hinder_med), box_name(target)); p = p_magic(target); p->hinder_meditation += aura; if (p->hinder_meditation > 3) p->hinder_meditation = 3; hinder_med_omen(target, c->who); return TRUE; }