static void _calc_weapon_bonuses(object_type *o_ptr, weapon_info_t *info_ptr) { if (_weapon_check()) { /* CL1: Mighty */ if (p_ptr->lev >= 1) { int w = o_ptr->weight; int h = (w - 150)/20; int d = (w - 150)/10; if (_get_toggle() != MAULER_TOGGLE_BLOCK) { info_ptr->to_h += h; info_ptr->dis_to_h += h; info_ptr->to_d += d; info_ptr->dis_to_d += d; } } /* CL25: Impact 20lb +1d0 25lb +1d1 30lb +2d1 40lb +2d2 50lb +3d2 60lb +3d3 Stagger in bonuses with level. Also, I'm debating > rather than >= for cutoffs. */ if (p_ptr->lev >= 25 ) { int w = o_ptr->weight; if (w >= 200) info_ptr->to_dd++; if (p_ptr->lev >= 30 && w >= 250) info_ptr->to_ds++; if (p_ptr->lev >= 35 && w >= 300) info_ptr->to_dd++; if (p_ptr->lev >= 40 && w >= 400) info_ptr->to_ds++; if (p_ptr->lev >= 45 && w >= 500) info_ptr->to_dd++; if (p_ptr->lev >= 50 && w >= 600) info_ptr->to_ds++; } /* Destroyer is handled as a hack in cmd1.c critical_norm() and now scales with level */ if (_get_toggle() == MAULER_TOGGLE_MAUL) { info_ptr->to_dd += 1; info_ptr->to_ds += 1; } } }
static void _calc_bonuses(void) { if (!heavy_armor()) { p_ptr->pspeed += p_ptr->lev/10; if (p_ptr->lev >= 25) p_ptr->free_act = TRUE; switch (_get_toggle()) { case MYSTIC_TOGGLE_STEALTH: p_ptr->skills.stl += 2 + 3 * p_ptr->lev/50; break; case MYSTIC_TOGGLE_FAST: p_ptr->quick_walk = TRUE; break; case MYSTIC_TOGGLE_DEFENSE: { int bonus = 10 + 40*p_ptr->lev/50; p_ptr->to_a += bonus; p_ptr->dis_to_a += bonus; break; } case MYSTIC_TOGGLE_OFFENSE: { int penalty = 10 + 40*p_ptr->lev/50; p_ptr->to_a -= penalty; p_ptr->dis_to_a -= penalty; break; } } } monk_ac_bonus(); }
int mystic_get_toggle(void) { int result = TOGGLE_NONE; if (p_ptr->pclass == CLASS_MYSTIC && !heavy_armor()) result = _get_toggle(); return result; }
/********************************************************************** * Public Interface **********************************************************************/ int leprechaun_get_toggle(void) { int result = TOGGLE_NONE; if (p_ptr->prace == RACE_MON_LEPRECHAUN) result = _get_toggle(); return result; }
static void _calc_bonuses(void) { int w = equip_weight(object_is_melee_weapon); if (_weapon_check()) { if (_get_toggle() == MAULER_TOGGLE_BLOCK) { int a = w/20 + (w/100)*(w/100); p_ptr->to_a += a; p_ptr->dis_to_a += a; } /* TODO: This should cost more energy too ... */ if (_get_toggle() == MAULER_TOGGLE_TUNNEL) p_ptr->kill_wall = TRUE; } }
int mauler_get_toggle(void) { /* exposed for prtstatus() in xtra1.c this is easier than rewriting the status code so that classes can maintain it! */ int result = TOGGLE_NONE; if (p_ptr->pclass == CLASS_MAULER && _weapon_check()) result = _get_toggle(); return result; }
/**************************************************************** * Spells ****************************************************************/ static void _toggle_spell(int which, int cmd, variant *res) { switch (cmd) { case SPELL_CAST: var_set_bool(res, FALSE); if (_get_toggle() == which) _set_toggle(TOGGLE_NONE); else _set_toggle(which); var_set_bool(res, TRUE); break; case SPELL_ENERGY: if (_get_toggle() != which) var_set_int(res, 0); /* no charge for dismissing a technique */ else var_set_int(res, 100); break; default: default_spell(cmd, res); break; } }
static void _player_action(int energy_use) { if (_get_toggle() == LEPRECHAUN_TOGGLE_BLINK) teleport_player(10, TELEPORT_LINE_OF_SIGHT); }