Пример #1
0
void do_trip( CHAR_DATA *ch, char *argument )
{
    char arg[MIL]={'\0'};
    CHAR_DATA *victim;
    int chance;

    one_argument(argument,arg);

    if ( (chance = get_skill(ch,gsn_trip)) == 0
    ||   (IS_NPC(ch) && !IS_SET(ch->off_flags,OFF_TRIP))
    ||   (!IS_NPC(ch) 
	  && !(ch->ability[BRAWL].value > 0)))
    {
	send_to_char("Tripping?  What's that?\n\r",ch);
	return;
    }


    if (IS_NULLSTR(arg))
    {
	victim = ch->fighting;
	if (victim == NULL)
	{
	    send_to_char("But you aren't fighting anyone!\n\r",ch);
	    return;
 	}
    }

    else if ((victim = get_char_room(ch,arg)) == NULL)
    {
	send_to_char("They aren't here.\n\r",ch);
	return;
    }
    
    if (IS_AFFECTED(victim,AFF_FLYING))
    {
	act("$S feet aren't on the ground.",ch,NULL,victim,TO_CHAR,1);
	return;
    }

    if (victim->position < P_FIGHT)
    {
	act("$N is already down.",ch,NULL,victim,TO_CHAR,1);
	return;
    }

    if (victim == ch)
    {
	send_to_char("You fall flat on your face!\n\r",ch);
	WAIT_STATE(ch,2 * skill_table[gsn_trip].beats);
	act("$n trips over $s own feet!",ch,NULL,NULL,TO_ROOM,0);
	return;
    }

    if (IS_AFFECTED(ch,AFF_CHARM) && ch->master == victim)
    {
	act("$N is so great though!",ch,NULL,victim,TO_CHAR,1);
	return;
    }

    /* size */
    if (ch->size < victim->size)
        chance += (ch->size - victim->size) * 10;  /* bigger = harder to trip */

    /* dex */
    chance += get_curr_stat(ch,STAT_DEX);
    chance -= get_curr_stat(victim,STAT_DEX) * 3 / 2;

    /* now the attack */
    if (number_percent() < chance)
    {
	act("$n trips you and you go down!",ch,NULL,victim,TO_VICT,1);
	act("You trip $N and $N goes down!",ch,NULL,victim,TO_CHAR,1);
	act("$n trips $N, sending $M to the ground.",
	    ch,NULL,victim,TO_NOTVICT,0);

	DAZE_STATE(victim,2 * PULSE_VIOLENCE);
        WAIT_STATE(ch,skill_table[gsn_trip].beats);
	victim->position = P_REST;
	damage(ch,victim,number_range(2, 2 +  2 * victim->size),gsn_trip,
	    DAM_BASH,TRUE,0,-1);
    }
    else
    {
	damage(ch,victim,0,gsn_trip,DAM_BASH,TRUE,0,1);
	WAIT_STATE(ch,skill_table[gsn_trip].beats*2/3);
    } 
}
Пример #2
0
void shock_effect(void *vo,int level, int dam, int target)
{
	if (target == TARGET_ROOM)
	{
		ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo;
		OBJ_DATA *obj, *obj_next;

		for (obj = room->contents; obj != NULL; obj = obj_next)
		{
			obj_next = obj->next_content;
			shock_effect(obj,level,dam,TARGET_OBJ);
		}
		return;
	}

	if (target == TARGET_CHAR)
	{
		CHAR_DATA *victim = (CHAR_DATA *) vo;
		OBJ_DATA *obj, *obj_next;

	/* daze and confused? */
		if (!saves_spell(level/4 + dam/20,victim,DAM_LIGHTNING))
		{
			send_to_char("Your muscles stop responding.\n\r",victim);
			DAZE_STATE(victim,UMAX(12,level/4 + dam/20));
		}

	/* toast some gear */
		for (obj = victim->carrying; obj != NULL; obj = obj_next)
		{
			obj_next = obj->next_content;
			shock_effect(obj,level,dam,TARGET_OBJ);
		}
		return;
	}

	if (target == TARGET_OBJ)
	{
		OBJ_DATA *obj = (OBJ_DATA *) vo;
		int chance = level / 4 + dam / 10;
		char *msg;

		if (IS_OBJ_STAT(obj,ITEM_BURN_PROOF)
			||  IS_OBJ_STAT(obj,ITEM_NOPURGE)
			||  number_range(0,4) == 0)
			return;

		if (chance > 25)
			chance = (chance - 25) / 2 + 25;
		if (chance > 50)
			chance = (chance - 50) /2 + 50;

		if (IS_OBJ_STAT(obj,ITEM_BLESS))
			chance -= 5;

		chance -= obj->level * 2;

		switch(obj->item_type)
		{
			default:
			return;
			case ITEM_WAND:
			case ITEM_STAFF:
			chance += 10;
			msg = "$p overloads and explodes!";
			break;
			case ITEM_JEWELRY:
			chance -= 10;
			msg = "$p is fused into a worthless lump.";
		}

		chance = URANGE(5,chance,95);

		if (number_percent() > chance)
			return;

		if (obj->carried_by != NULL)
			act(msg,obj->carried_by,obj,NULL,TO_ALL);
		else if (obj->in_room != NULL && obj->in_room->people != NULL)
			act(msg,obj->in_room->people,obj,NULL,TO_ALL);

		extract_obj(obj);
		return;
	}
}
Пример #3
0
void do_bash( CHAR_DATA *ch, char *argument )
{
    char arg[MIL]={'\0'};
    CHAR_DATA *victim;
    int chance = 0;

    one_argument(argument,arg);
 
    if (IS_NULLSTR(arg))
    {
	victim = ch->fighting;
	if (victim == NULL)
	{
	    send_to_char("But you aren't fighting anyone!\n\r",ch);
	    return;
	}
    }

    else if ((victim = get_char_room(ch,arg)) == NULL)
    {
	send_to_char("They aren't here.\n\r",ch);
	return;
    }

    if (victim->position < P_FIGHT)
    {
	act("You'll have to let $M get back up first.",
	    ch,NULL,victim,TO_CHAR,1);
	return;
    }

    if (victim == ch)
    {
	send_to_char("You try to bash your brains out, but fail.\n\r",ch);
	return;
    }

    if (IS_AFFECTED(ch,AFF_CHARM) && ch->master == victim)
    {
	act("But $N is your friend!",ch,NULL,victim,TO_CHAR,1);
	return;
    }

    /* size */
    if (ch->size < victim->size)
	chance += (ch->size - victim->size) * 15;
    else
	chance += (ch->size - victim->size) * 10; 

    /* stats */
    chance += get_curr_stat(ch,STAT_STR);
    chance -= get_curr_stat(victim,STAT_DEX);

    if (!IS_NPC(victim) 
	&& chance < get_skill(victim,gsn_dodge) )
    {	
	chance -= 3 * (get_skill(victim,gsn_dodge) - chance);
    }

    /* now the attack */
    if (number_percent() < chance )
    {
    
	act("$n sends you sprawling with a powerful bash!",
		ch,NULL,victim,TO_VICT,1);
	act("You slam into $N, and send $M flying!",ch,NULL,victim,TO_CHAR,0);
	act("$n sends $N sprawling with a powerful bash.",
		ch,NULL,victim,TO_NOTVICT,0);

	DAZE_STATE(victim, 3 * PULSE_VIOLENCE);
	WAIT_STATE(ch,skill_table[gsn_bash].beats);
	victim->position = P_REST;
	damage(ch,victim,number_range(2,2 + 2 * ch->size + chance/20),gsn_bash,
	    DAM_BASH,FALSE, 0, -1);
	
    }
    else
    {
	damage(ch,victim,0,gsn_bash,DAM_BASH,FALSE, 0, -1);
	act("You fall flat on your face!",
	    ch,NULL,victim,TO_CHAR,1);
	act("$n falls flat on $s face.",
	    ch,NULL,victim,TO_NOTVICT,0);
	act("You evade $n's bash, causing $m to fall flat on $s face.",
	    ch,NULL,victim,TO_VICT,1);
	ch->position = P_REST;
	damage(ch,ch,number_range(2,2 + 2 * ch->size + chance/20),gsn_bash,
	    DAM_BASH,FALSE, 0, -1);
	WAIT_STATE(ch,skill_table[gsn_bash].beats * 3/2); 
    }
}