当前位置: 首页>>代码示例>>C++>>正文


C++ WAIT_STATE函数代码示例

本文整理汇总了C++中WAIT_STATE函数的典型用法代码示例。如果您正苦于以下问题:C++ WAIT_STATE函数的具体用法?C++ WAIT_STATE怎么用?C++ WAIT_STATE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了WAIT_STATE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: lightning

void lightning( void )
{
 DESCRIPTOR_DATA *d;
  for ( d = descriptor_list; d != NULL; d = d->next )
        {
            if ( d->connected == CON_PLAYING
                && IS_OUTDOORS( d->character )
                && IS_AWAKE  ( d->character )
                && number_chance(10)
                && !IS_IMMORTAL(d->character)
                && d->character->level > 17
                && weather_info.sky == SKY_LIGHTNING ) {

 send_to_char("{x{RYou see a brilliant flash come down from the sky and then black out!{x\n\r",d->character);
 act( "$n has been struck by lightning!", d->character, NULL, NULL,TO_ROOM);
if(check_immune(d->character,DAM_LIGHTNING) != IS_IMMUNE) {
 if(d->character->fighting) {
stop_fighting(d->character,TRUE); }
if(check_immune(d->character,DAM_LIGHTNING) != IS_RESISTANT)
if (d->character->level < LI1);
d->character->hit -= d->character->hit/25;
if (d->character->level < LI2);
d->character->hit -= d->character->hit/20;
if (d->character->level < LI3);
d->character->hit -= d->character->hit/15;
WAIT_STATE(d->character,40); 
 } else {
if(check_immune(d->character,DAM_LIGHTNING) == IS_VULNERABLE) {
d->character->hit -= d->character->hit/10;
WAIT_STATE(d->character,40); } }
} }
}
开发者ID:Firehed,项目名称:RotK,代码行数:32,代码来源:weather.c

示例2: soul_sword

void soul_sword (CHAR_DATA *ch)
{
	//Soul Sword can rarely kill victims outright, and does 1 dmg, and is VERY unlikely to hit. UNGODLY Expensive
	CHAR_DATA *victim;
	OBJ_DATA *katana;
	char buf[MAX_STRING_LENGTH];
	int thebonus = 0;
	
	if (IS_NPC(ch))		return;

	katana = get_eq_char(ch, WEAR_WIELD);
	
	if ((victim = ch->fighting) == NULL)
	{
		send_to_char("You find no need for this now.\n\r",ch);
		return;
	}
	
	if (IS_NPC(victim))		thebonus = 45;
		else				thebonus = 7;
	if (ch->mana < 30000)
	{
		send_to_char("You have not the 30000 mana power to use this.\n\r",ch);
		return;
	}
	
	if ((katana == NULL) || (katana->pIndexData->vnum != 33176))
	{
		send_to_char("Without a proper katana the energy will destroy your weapon.\n\r",ch);
		return;
	}
	ch->mana -= 30000;
	send_to_char("You channel mystical energy into your katana.\n\r",ch);
	do_say(ch,"#0SOUL #nSWORD!");
	
	act("A bolt of light shoots out of your katana and into $N",ch, NULL, victim, TO_CHAR);
	act("A bolt of light shoots out of $n's katana and into you!", ch, NULL, victim, TO_VICT);
	act("A bolt of light shoots out of $n's katana and into $N!", ch, NULL, victim, TO_NOTVICT);

	if (number_range(0,250) > (4 + thebonus))  // Was .5% now it's 5%/20%
	{
		act("Your attack was ineffective.", ch, NULL, victim, TO_CHAR);
		act("$n looks confused as nothing happens.", ch, NULL, NULL, TO_ROOM);
		multi_hit( ch, victim, TYPE_UNDEFINED );
		WAIT_STATE(ch, (PULSE_VIOLENCE * 5));
		return;
	}
	
	xprintf(buf,"$N screams as $E is ripped apart by the dark energy. #R[#y#b MORTAL #n#R]#n");
	act(buf, ch, NULL, victim, TO_CHAR);
	xprintf(buf,"$n looks on as you start screaming while dark energy rips you apart from the inside out. #R[#y#b MORTAL #n#R]#n");
	act(buf, ch, NULL, victim, TO_VICT);
	send_to_char("You crumple to the ground.\n\r", victim);
	act("$n looks on as $N starts screaming.  Weakened $N crumples to the ground.", ch, NULL, victim, TO_NOTVICT);
	WAIT_STATE(ch, (PULSE_VIOLENCE * 5));
	victim->hit = -10;
	hurt_person(ch, victim, 1);
	return;
}
开发者ID:smthbh,项目名称:Mindcloud-2.5-MUD,代码行数:59,代码来源:samurai.c

示例3: do_countermove

void do_countermove(CHAR_DATA *ch, char *argument)
{
  CHAR_DATA *victim;

  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_SAMURAI))
  {
    send_to_char("Huh?\n\r",ch);
    return;
  }
  if (!IS_SET(ch->pcdata->powers[SAMURAI_MARTIAL], SAM_COUNTERMOVE))
  {
    send_to_char("You need to learn that combo first.\n\r", ch);
    return;
  }
  if (ch->pcdata->powers[SAMURAI_FOCUS] > 40)
  {
    send_to_char("You are to exhausted.\n\r",ch);
    return;
  }
  if ((victim = ch->fighting) == NULL)
  {
    send_to_char( "You aren't fighting anyone.\n\r", ch );
    return;
  }
  ch->pcdata->powers[SAMURAI_FOCUS] += 8;
  act("$n strikes out at $N before $E can even get a weapon out to defend $Mself.",ch,NULL,victim,TO_NOTVICT);
  act("You cut $N with a lightning fast attack.",ch,NULL,victim,TO_CHAR);
  act("$n attacks with a flurry of lightning fast attacks, one of them scores a hit.",ch,NULL,victim,TO_VICT);
  one_hit(ch, victim, gsn_lightningslash, 1);
  check_samuraiattack(ch, victim);
  WAIT_STATE(ch, 12);
  return;
}
开发者ID:smthbh,项目名称:Mindcloud-2.5-MUD,代码行数:34,代码来源:samurai.c

示例4: do_block

void do_block(CHAR_DATA *ch, char *argument)
{
  CHAR_DATA *victim;

  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_SAMURAI))
  {
    send_to_char("Huh?\n\r",ch);
    return;
  }
  if (!IS_SET(ch->pcdata->powers[SAMURAI_MARTIAL], SAM_BLOCK))
  {
    send_to_char("You need to learn that combo first.\n\r", ch);
    return;
  }
  if (ch->pcdata->powers[SAMURAI_FOCUS] > 40)
  {
    send_to_char("You are to exhausted.\n\r",ch);
    return;
  }
  if ((victim = ch->fighting) == NULL)
  {
    send_to_char( "You aren't fighting anyone.\n\r", ch );
    return;
  }
  ch->pcdata->powers[SAMURAI_FOCUS] += 4;
  act("$n blocks $N's simpleminded attack and strikes back with a perfect attack.",ch,NULL,victim,TO_NOTVICT);
  act("You block $N's simple attack and return with one of your own design.",ch,NULL,victim,TO_CHAR);
  act("$n blocks your attack, and strikes back before you get a chance to react.",ch,NULL,victim,TO_VICT);
  one_hit(ch, victim, gsn_lightningslash, 1);
  check_samuraiattack(ch, victim);
  WAIT_STATE(ch, 12);
  return;
}
开发者ID:smthbh,项目名称:Mindcloud-2.5-MUD,代码行数:34,代码来源:samurai.c

示例5: do_sidestep

void do_sidestep(CHAR_DATA *ch, char *argument)
{
  CHAR_DATA *victim;

  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_SAMURAI))
  {
    send_to_char("Huh?\n\r",ch);
    return;
  }
  if (!IS_SET(ch->pcdata->powers[SAMURAI_MARTIAL], SAM_SIDESTEP))
  {
    send_to_char("You need to learn that combo first.\n\r", ch);
    return;
  }
  if (ch->pcdata->powers[SAMURAI_FOCUS] > 40)
  {
    send_to_char("You are to exhausted.\n\r",ch);
    return;
  }
  if ((victim = ch->fighting) == NULL)
  {
    send_to_char( "You aren't fighting anyone.\n\r", ch );
    return;
  }
  ch->pcdata->powers[SAMURAI_FOCUS] += 2;
  act("$n sidesteps $N's attack and scores a hit.",ch,NULL,victim,TO_NOTVICT);
  act("You sidestep $N's attack, and scores a counterattack before $E can react.",ch,NULL,victim,TO_CHAR);
  act("$n sidesteps your feeble attempt to get near $m and strikes back at you.",ch,NULL,victim,TO_VICT);
  one_hit(ch, victim, gsn_lightningslash, 1);
  check_samuraiattack(ch, victim);
  WAIT_STATE(ch, 12);
  return;
}
开发者ID:smthbh,项目名称:Mindcloud-2.5-MUD,代码行数:34,代码来源:samurai.c

示例6: do_slide

void do_slide(CHAR_DATA *ch, char *argument)
{
  CHAR_DATA *victim;

  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_SAMURAI))
  { 
    send_to_char("Huh?\n\r",ch);
    return;
  }
  if (!IS_SET(ch->pcdata->powers[SAMURAI_MARTIAL], SAM_SLIDE))
  {
    send_to_char("You need to learn that combo first.\n\r", ch);
    return;
  }
  if (ch->pcdata->powers[SAMURAI_FOCUS] > 40)
  {
    send_to_char("You are to exhausted.\n\r",ch);
    return;
  }
  if ((victim = ch->fighting) == NULL)
  {
    send_to_char( "You aren't fighting anyone.\n\r", ch );
    return;
  }
  ch->pcdata->powers[SAMURAI_FOCUS] += 1;
  act("$n slides into a better fighting position, hitting $N while $e passes.",ch,NULL,victim,TO_NOTVICT);
  act("You slide into a better fighting position, hitting $N while you pass $E.",ch,NULL,victim,TO_CHAR);
  act("$n moves past you, lightning fast and strikes you before you can react.",ch,NULL,victim,TO_VICT);
  one_hit(ch, victim, gsn_lightningslash, 1);
  check_samuraiattack(ch, victim);
  WAIT_STATE(ch, 12);
  return;
}
开发者ID:smthbh,项目名称:Mindcloud-2.5-MUD,代码行数:34,代码来源:samurai.c

示例7: do_confuse

void do_confuse(CHAR_DATA *ch, char *argument) {

	CHAR_DATA *victim;

	if (IS_NPC(ch)) return;

	if (!IS_CLASS(ch, CLASS_DROW) || !IS_SET(ch->pcdata->powers[1], DPOWER_CONFUSE)) {
	send_to_char("Huh?\n\r",  ch);
	return;}

	if ((victim = ch->fighting) == NULL) {
	send_to_char("You are not fighting anyone.\n\r",  ch);
	return;}

	if (ch->move < 75) {
	send_to_char("You need 75 move to confuse your opponent.\n\r",ch);
	return;}

	act("$n attempts to confuse you.",ch,NULL,victim,TO_VICT);
	act("You attempt to confuse $N.",ch,NULL,victim,TO_CHAR);
	act("$n attempts to confuse $N.",ch,NULL,victim,TO_NOTVICT);

	ch->move -=75;

	if ( number_percent() > 25 ) {
	send_to_char("You failed.\n\r", ch );
	return;}

	else {
		do_flee(victim,"");	
	WAIT_STATE(ch, 16);
	return;	}

	return;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:35,代码来源:drow.c

示例8: do_pummel

void do_pummel( CHAR_DATA *ch, char *argument )
{
	CHAR_DATA *victim;

   if (IS_NPC(ch)) return;
   if (!IS_CLASS(ch, CLASS_SKYBLADE) )
   {
     send_to_char("Huh?\n\r",ch);
     return;
   }
   if (ch->pcdata->powers[SKYBLADE_SKILLS] < 2)
   {
     send_to_char("You haven't mastered the skills abilities enough.\n\r",ch);
     return;
   }
   if (!TIME_UP(ch, TIMER_PUMMEL))
   {
     send_to_char("You are too tired from the last time.\n\r",ch);
     return;
   }
   if ((victim = ch->fighting) == NULL)
   {
     send_to_char("You aren't fighting anyone though.\n\r",ch);
     return;
   }
   if (IS_NPC(victim))
   {
      send_to_char("They aren't stanced though.\n\r",ch);
      return;
   }
   SET_TIMER(ch, TIMER_PUMMEL, 5);
   do_stance(victim, "");
   WAIT_STATE(victim,12);
   return;
}
开发者ID:smthbh,项目名称:Mindcloud-2.5-MUD,代码行数:35,代码来源:skyblade.c

示例9: do_lavablast

void do_lavablast(CHAR_DATA *ch, char *argument)
{
  CHAR_DATA *victim;
      
  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_TANARRI))
  {
    send_to_char("Huh?\n\r",ch);
    return;
  }
  if (!IS_SET(ch->pcdata->powers[TANARRI_POWER], TANARRI_LAVA))
  {
    send_to_char("Perhaps you should learn that power first.\n\r",ch);
    return;
  }
  if (ch->mana < 1000 || ch->move < 1000)
  {
    send_to_char("Your not up to it, you ain't got the fire in ya.\n\r",ch);
    return;
  }
  if ((victim = ch->fighting) == NULL)
  {
    send_to_char( "You aren't fighting anyone.\n\r", ch );
    return;
  }
  ch->mana -= 1000;
  ch->move -= 1000;
  one_hit(ch,victim,gsn_magma,1);
  one_hit(ch,victim,gsn_magma,1);
  one_hit(ch,victim,gsn_magma,1);
  if (!IS_AFFECTED(victim, AFF_FLAMING))
    SET_BIT(victim->affected_by, AFF_FLAMING);
  WAIT_STATE(ch,18);
  return;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:35,代码来源:tanarri.c

示例10: do_houseofgod

void do_houseofgod( CHAR_DATA *ch, char *argument )
{
    if (IS_NPC(ch)) return;
    if (!IS_CLASS(ch, CLASS_ANGEL))
    {
        send_to_char("Huh?\n\r",ch);
        return;
    }
    if (ch->pcdata->powers[ANGEL_PEACE] < 5)
    {
        send_to_char("Your not peaceful enough.\n\r",ch);
        return;
    }
    if (has_timer(ch)) return;
    if (ch->pcdata->powers[ANGEL_PEACE_COUNTER] > 0)
    {
        send_to_char("It is not the time for peace yet, God wants you to fight.\n\r",ch);
        return;
    }
    ch->pcdata->powers[ANGEL_PEACE_COUNTER] = 50;
    ch->level = 12;
    do_peace(ch,"");
    ch->level = 3;
    act("You call for God to transfer the pain of these mortals to yourself.", ch, NULL, NULL, TO_CHAR);
    act("$n says '#yLet not these followers of God suffer, let their pain be mine instead#n'.", ch, NULL, NULL, TO_ROOM);
    WAIT_STATE(ch, 24);
    return;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:28,代码来源:angel.c

示例11: do_harmony

void do_harmony( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    char arg[MAX_INPUT_LENGTH];
    int sn, level;

    argument = one_argument( argument, arg );

    if (IS_NPC(ch)) return;
    if (!IS_CLASS(ch, CLASS_ANGEL))
    {
        send_to_char("Huh?\n\r",ch);
        return;
    }
    if (ch->pcdata->powers[ANGEL_HARMONY] < 5)
    {
        send_to_char("Your not in contact with your inner harmonies.\n\r",ch);
        return;
    }
    if ((victim = get_char_room(ch, arg)) == NULL)
    {
        send_to_char("They are not here.\n\r", ch);
        return;
    }
    level = number_range(100,200);
    sn = skill_lookup("spirit kiss");
    if (sn  > 0) (*skill_table[sn].spell_fun) (sn,level,ch,victim);
    WAIT_STATE(ch,12);
    return;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:30,代码来源:angel.c

示例12: do_enrage

void do_enrage(CHAR_DATA *ch, char *argument) 
{
  char arg[MAX_INPUT_LENGTH];
  CHAR_DATA *victim;

  argument = one_argument( argument, arg );

  if (IS_NPC(ch)) return;
  if (!IS_CLASS(ch, CLASS_TANARRI))
  {
    send_to_char("Huh?\n\r",ch);
    return;
  }
  if (!IS_SET(ch->pcdata->powers[TANARRI_POWER], TANARRI_ENRAGE))
  {
    send_to_char("you don't have that power yet.\n\r",ch);
    return;
  }
  if ((victim = get_char_room(ch, arg)) == NULL)
  {
    send_to_char("They are not here.\n\r", ch);
    return;
  }
  if (IS_NPC(victim) || victim->level < 3)
  {
    send_to_char("Not on them\n\r",ch);
    return;
  }
  do_say(ch, "Kara, Kara, Xenos!");
  if (number_percent() > 40) do_berserk2(victim,"");
  else send_to_char("#RSomeone is trying to control your actions!!!#n\n\r",victim);
  WAIT_STATE(ch,18);
  return;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:34,代码来源:tanarri.c

示例13: do_chaosblast

void do_chaosblast(CHAR_DATA *ch, char *argument) {

    CHAR_DATA *victim;
    char arg [MAX_INPUT_LENGTH];
    int sn;
    int level;
    int spelltype;

    argument = one_argument( argument, arg );
    if (IS_NPC(ch)) return;

	if (!IS_CLASS(ch, CLASS_DROW) || (!IS_SET(ch->special,
	SPC_DROW_MAG) && ch->generation > 2)) {
		return;}

    if ( ( victim = get_char_room( ch, arg ) ) == NULL )
        if ((victim = ch->fighting) == NULL)
    {
        send_to_char( "They aren't here.\n\r", ch );
        return;
    }
        if (ch->mana < 750) {
                send_to_char("You don't have enough mana.\n\r", ch);
                return;}

    if ( ( sn = skill_lookup( "chaos blast" ) ) < 0 ) return;
    spelltype = skill_table[sn].target;
    level = ch->spl[spelltype]/3;
        act("You concentrate your power on $N.",ch,NULL,victim,TO_CHAR);
        act("$n concentrates $s power on you.",ch,NULL,victim,TO_VICT);
    (*skill_table[sn].spell_fun) ( sn, level, ch, victim );
    WAIT_STATE( ch, 12 );
        ch->mana = ch->mana - 750;
    return;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:35,代码来源:drow.c

示例14: do_martyr

void do_martyr( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *ich;

    if (IS_NPC(ch)) return;
    if (!IS_CLASS(ch, CLASS_ANGEL))
    {
        send_to_char("Huh?\n\r",ch);
        return;
    }
    if (ch->pcdata->powers[ANGEL_LOVE] < 5)
    {
        send_to_char("Your love for mortals are not strong enough.\n\r",ch);
        return;
    }
    if (ch->hit < ch->max_hit)
    {
        send_to_char("Your body cannot take the strain.\n\r",ch);
        return;
    }
    if (has_timer(ch)) return;
    ch->level = 12;
    act("You call for God to transfer the pain of these mortals to yourself.", ch, NULL, NULL, TO_CHAR);
    act("$n says '#yLet not these followers of God suffer, let their pain be mine instead#n'.", ch, NULL, NULL, TO_ROOM);
    for (ich = ch->in_room->people; ich != NULL; ich = ich->next_in_room)
        if (!IS_NPC(ich)) do_restore(ch,ich->pcdata->switchname);
    ch->level = 3;
    ch->hit = 1;
    ch->move = 1;
    ch->mana = 1;
    WAIT_STATE(ch,6);
    return;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:33,代码来源:angel.c

示例15: do_innerpeace

void do_innerpeace( CHAR_DATA *ch, char *argument )
{
    if (IS_NPC(ch)) return;
    if (!IS_CLASS(ch, CLASS_ANGEL))
    {
        send_to_char("Huh?\n\r",ch);
        return;
    }
    if (ch->pcdata->powers[ANGEL_PEACE] < 3)
    {
        send_to_char("Your not peaceful enough.\n\r",ch);
        return;
    }
    if (ch->mana < 1500)
    {
        send_to_char("You don't have enough mana.\n\r",ch);
        return;
    }
    ch->mana -= 1500;
    ch->hit += ch->pcdata->powers[ANGEL_PEACE]*500;
    if (ch->hit > ch->max_hit) ch->hit = ch->max_hit;
    act("You feel the cleansing love of God run through your veins, filling you with an inner peace.", ch, NULL, NULL, TO_CHAR);
    act("$n is struck by a ray of pure light, and a blissful smile crosses $s lips.", ch, NULL, NULL, TO_ROOM);
    WAIT_STATE(ch,18);
    return;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:26,代码来源:angel.c


注:本文中的WAIT_STATE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。