static void project_player_handler_SHARD(project_player_handler_context_t *context)
{
    /* Cuts */
    if (!player_resists(player, ELEM_SHARD))
        (void)player_inc_timed(player, TMD_CUT, randint1(context->dam),
                               TRUE, FALSE);
}
Exemplo n.º 2
0
static void project_player_handler_NEXUS(project_player_handler_context_t *context)
{
	struct monster *mon = NULL;
	if (context->origin.what == SRC_MONSTER) {
		mon = cave_monster(cave, context->origin.which.monster);
	}

	if (player_resists(player, ELEM_NEXUS)) {
		msg("You resist the effect!");
		return;
	}

	/* Stat swap */
	if (randint0(100) < player->state.skills[SKILL_SAVE]) {
		msg("You avoid the effect!");
	} else {
		project_player_swap_stats();
	}

	if (one_in_(3) && mon) { /* Teleport to */
		effect_simple(EF_TELEPORT_TO, context->origin, "0", mon->fy, mon->fx, 0, NULL);
	} else if (one_in_(4)) { /* Teleport level */
		if (randint0(100) < player->state.skills[SKILL_SAVE]) {
			msg("You avoid the effect!");
			return;
		}
		effect_simple(EF_TELEPORT_LEVEL, context->origin, "0", 0, 0, 0, NULL);
	} else { /* Teleport */
		const char *miles = "200";
		effect_simple(EF_TELEPORT, context->origin, miles, 0, 1, 0, NULL);
	}
}
Exemplo n.º 3
0
static void project_player_handler_DARK_WEAK(project_player_handler_context_t *context)
{
	if (player_resists(player, ELEM_DARK)) {
		msg("You resist the effect!");
		return;
	}

	(void)player_inc_timed(player, TMD_BLIND, 3 + randint1(5), true, true);
}
static void project_player_handler_LIGHT(project_player_handler_context_t *context)
{
    if (player_resists(player, ELEM_LIGHT)) {
        msg("You resist the effect!");
        return;
    }

    (void)player_inc_timed(player, TMD_BLIND, 2 + randint1(5), TRUE, TRUE);
}
Exemplo n.º 5
0
static void project_player_handler_DISEN(project_player_handler_context_t *context)
{
	if (player_resists(player, ELEM_DISEN)) {
		msg("You resist the effect!");
		return;
	}

	/* Disenchant gear */
	effect_simple(EF_DISENCHANT, context->origin, "0", 0, 0, 0, NULL);
}
Exemplo n.º 6
0
static void project_player_handler_SHARD(project_player_handler_context_t *context)
{
	if (player_resists(player, ELEM_SHARD)) {
		msg("You resist the effect!");
		return;
	}

	/* Cuts */
	(void)player_inc_timed(player, TMD_CUT, randint1(context->dam), true,
						   false);
}
Exemplo n.º 7
0
/**
 * Melee effect handler: Disenchant the player.
 */
static void melee_effect_handler_DISENCHANT(melee_effect_handler_context_t *context)
{
	/* Take damage */
	take_hit(context->p, context->damage, context->ddesc);

	/* Apply disenchantmen if no resist */
	if (!player_resists(context->p, ELEM_DISEN))
		effect_simple(EF_DISENCHANT, "0", 0, 0, 0, &context->obvious);

	/* Learn about the player */
	update_smart_learn(context->m_ptr, context->p, 0, 0, ELEM_DISEN);
}
static void project_player_handler_NETHER(project_player_handler_context_t *context)
{
    if (player_resists(player, ELEM_NETHER) ||
            player_of_has(player, OF_HOLD_LIFE)) {
        msg("You resist the effect!");
        return;
    }

    /* Life draining */
    msg("You feel your life force draining away!");
    player_exp_lose(player, 200 + (player->exp / 100) * z_info->life_drain_percent, FALSE);
}
Exemplo n.º 9
0
static void project_player_handler_ICE(project_player_handler_context_t *context)
{
	if (!player_is_immune(player, ELEM_COLD))
		inven_damage(player, PROJ_COLD, MIN(context->dam * 5, 300));

	/* Cuts */
	if (!player_resists(player, ELEM_SHARD))
		(void)player_inc_timed(player, TMD_CUT, damroll(5, 8), true, false);
	else
		msg("You resist the effect!");

	/* Stun */
	(void)player_inc_timed(player, TMD_STUN, randint1(15), true, true);
}
Exemplo n.º 10
0
static void project_player_handler_SOUND(project_player_handler_context_t *context)
{
	if (player_resists(player, ELEM_SOUND)) {
		msg("You resist the effect!");
		return;
	}

	/* Stun */
	if (!player_of_has(player, OF_PROT_STUN)) {
		int duration = 5 + randint1(context->dam / 3);
		if (duration > 35) duration = 35;
		(void)player_inc_timed(player, TMD_STUN, duration, TRUE, TRUE);
	}
}
Exemplo n.º 11
0
static void project_player_handler_CHAOS(project_player_handler_context_t *context)
{
    if (player_resists(player, ELEM_CHAOS)) {
        msg("You resist the effect!");
        return;
    }

    /* Hallucination */
    (void)player_inc_timed(player, TMD_IMAGE, randint1(10), TRUE, FALSE);

    /* Confusion */
    (void)player_inc_timed(player, TMD_CONFUSED, 10 + randint0(20), TRUE, TRUE);

    /* Life draining */
    if (player_of_has(player, OF_HOLD_LIFE)) {
        msg("You feel your life force draining away!");
        player_exp_lose(player, 5000 + (player->exp / 100) * z_info->life_drain_percent, FALSE);
    }
}