Esempio n. 1
0
/*!
 * @brief スナイパー技能の発動 /
 * do_cmd_cast calls this function if the player's class is 'snipe'.
 * @param spell 発動する特殊技能のID
 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
 */
static bool cast_sniper_spell(int spell)
{
	object_type *o_ptr = &inventory[INVEN_BOW];

	if (o_ptr->tval != TV_BOW)
	{
		msg_print(_("弓を装備していない!", "You wield no bow!"));
		return (FALSE);
	}

	/* spell code */
	switch (spell)
	{
	case 0: /* Concentration */
		if (!snipe_concentrate()) return (FALSE);
		energy_use = 100;
		return (TRUE);
	case 1: snipe_type = SP_LITE; break;
	case 2: snipe_type = SP_AWAY; break;
	case 3: snipe_type = SP_KILL_TRAP; break;
	case 4: snipe_type = SP_FIRE; break;
	case 5: snipe_type = SP_KILL_WALL; break;
	case 6: snipe_type = SP_COLD; break;
	case 7: snipe_type = SP_RUSH; break;
	case 8: snipe_type = SP_PIERCE; break;
	case 9: snipe_type = SP_EVILNESS; break;
	case 10: snipe_type = SP_HOLYNESS; break;
	case 11: snipe_type = SP_EXPLODE; break;
	case 12: snipe_type = SP_DOUBLE; break;
	case 13: snipe_type = SP_ELEC; break;
	case 14: snipe_type = SP_NEEDLE; break;
	case 15: snipe_type = SP_FINAL; break;
	default:
		msg_print(_("なに?", "Zap?"));
	}

	command_cmd = 'f';
	do_cmd_fire();
	snipe_type = 0;

	return (is_fired);
}
Esempio n. 2
0
static bool cast_sniper_spell(int spell)
{
    if (!equip_find_object(TV_BOW, SV_ANY))
    {
        msg_print("You wield no bow!");
        return (FALSE);
    }

    /* spell code */
    switch (spell)
    {
    case 0: /* Concentration */
        if (!snipe_concentrate()) return (FALSE);
        energy_use = 100;
        return (TRUE);
    case 1: snipe_type = SP_LITE; break;
    case 2: snipe_type = SP_AWAY; break;
    case 3: snipe_type = SP_KILL_TRAP; break;
    case 4: snipe_type = SP_FIRE; break;
    case 5: snipe_type = SP_KILL_WALL; break;
    case 6: snipe_type = SP_COLD; break;
    case 7: snipe_type = SP_RUSH; break;
    case 8: snipe_type = SP_PIERCE; break;
    case 9: snipe_type = SP_EVILNESS; break;
    case 10: snipe_type = SP_HOLYNESS; break;
    case 11: snipe_type = SP_EXPLODE; break;
    case 12: snipe_type = SP_DOUBLE; break;
    case 13: snipe_type = SP_ELEC; break;
    case 14: snipe_type = SP_NEEDLE; break;
    case 15: snipe_type = SP_FINAL; break;
    default:
        msg_print("Zap?");
    }

    command_cmd = 'f';
    do_cmd_fire();
    snipe_type = 0;
    return is_fired;
}