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


C++ do_say函数代码示例

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


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

示例1: hunt_victim

void hunt_victim(struct char_data *ch)
{
	int dir;
	byte found;
	struct char_data *tmp;

	if (!ch || !HUNTING(ch) || FIGHTING(ch))
		return;

	/* make sure the char still exists */
	for (found = FALSE, tmp = character_list; tmp && !found; tmp = tmp->next)
		if (HUNTING(ch) == tmp)
			found = TRUE;

	if (!found) {
		do_say(ch, "Damn!  My prey is gone!", 0, 0);
		HUNTING(ch) = NULL;
		return;
	}
	if ((dir = find_first_step(IN_ROOM(ch), IN_ROOM(HUNTING(ch)))) < 0) {
		sprintf(buf, "Damn!  I lost %s!", HMHR(HUNTING(ch)));
		do_say(ch, buf, 0, 0);
		HUNTING(ch) = NULL;
	} else {
		perform_move(ch, dir, 1);
		if (IN_ROOM(ch) == IN_ROOM(HUNTING(ch)))
			hit(ch, HUNTING(ch), TYPE_UNDEFINED);
	}
}
开发者ID:tbjers,项目名称:arcanerealms,代码行数:29,代码来源:graph.c

示例2: puff

int puff(struct char_data *ch, int cmd, char *arg)
{
	void do_say(struct char_data *ch, char *argument, int cmd);

	if (cmd)
		return(0);

	switch (number(0, 60))
	{
		case 0:
			do_say(ch, "My god! It's full of stars!", 0);
		   return(1);
		case 1:
			do_say(ch, "How'd all those fish get up here?", 0);
			return(1);
		case 2:
			do_say(ch, "I'm a very female dragon.", 0);
			return(1);
		case 3:
			do_say(ch, "I've got a peaceful, easy feeling.", 0);
			return(1);
		default:
			return(0);
	}
}
开发者ID:MUDOmnibus,项目名称:DikuMUD-Alfa,代码行数:25,代码来源:spec_procs.c

示例3: is_ok

int is_ok(struct char_data *keeper, struct char_data *ch, int shop_nr)
{
        if (shop_index[shop_nr].open1>time_info.hours){
                do_say(keeper,
                "Come back later!",17);
                return(FALSE);
        } else if (shop_index[shop_nr].close1<time_info.hours) {
                if (shop_index[shop_nr].open2>time_info.hours){
                        do_say(keeper,
                        "Sorry, we have closed, but come back later.",17);
                        return(FALSE);
                } else if (shop_index[shop_nr].close2<time_info.hours){
                        do_say(keeper,
                        "Sorry, come back tomorrow.",17);
                        return(FALSE);
                };
        }

        if(!(CAN_SEE(keeper,ch)))        {
                do_say(keeper,
                "I don't trade with someone I can't see!",17);
                return(FALSE);
        };

        switch(shop_index[shop_nr].with_who){
                case 0 : return(TRUE);
                case 1 : return(TRUE);
                default : return(TRUE);
        };
}
开发者ID:frasten,项目名称:openleu,代码行数:30,代码来源:shop.c

示例4: Moribondo

int Moribondo( struct char_data *pChar, int nCmd, const char *szArg,
               struct char_data *pMob, int nType )
{
  if( pMob == NULL || pChar == NULL )
  {
    mudlog( LOG_SYSERR, 
            "pMob == NULL || pChar == NULL in Moribondo( carceri.h )" );
    return FALSE;
  }

  if( nType == EVENT_TICK )
  {
    switch( pMob->generic )
    {
    case 0:
      GET_HIT( pMob ) = -3;
      GET_POS( pMob ) = POSITION_INCAP;
      pMob->generic = 1;
      break;
    case 1:
      if( GET_HIT( pMob ) > 0 && !pMob->specials.fighting )
      {
        do_say( pMob, "Grazie! Grazie! Chiunque sia stato.", 0 );
        if( pMob->player.description )
          free( pMob->player.description );
        pMob->player.description = strdup( "Il piccolo nano e` contento e "
                                           "grato a chi lo ha aiutato.\n\r" );
        pMob->generic = 2;
      }
      else if( !pMob->specials.fighting )
      {
        MakeNoise( pMob->in_room, NULL, "Senti qualcuno lamentarsi.\n\r" );
      }
      break;
    case 2:
      if( !pMob->specials.fighting )
      {
        do_say( pMob, 
                "Guardate vicino al letto. C'e` un passaggio segreto!", 0 );
        pMob->generic = 3;
      }
      break;
    default:
      if( !number( 0, 5 ) && !pMob->specials.fighting )
      {
        do_say( pMob, 
                "Guardate vicino al letto. C'e` un passaggio segreto!", 0 );
      }
      break;
    }
  }
  return FALSE;
}
开发者ID:frasten,项目名称:openleu,代码行数:53,代码来源:carceri.c

示例5: is_ok_char

int
is_ok_char(struct char_data * keeper, struct char_data * ch, int shop_nr)
{
  char buf[200];

  if (!(CAN_SEE(keeper, ch)))
    {
      do_say(keeper, MSG_NO_SEE_CHAR, cmd_say, 0);
      return (FALSE);
    }
  if (IS_GOD(ch))
    return (TRUE);

  if ((IS_GOOD(ch) && NOTRADE_GOOD(shop_nr)) ||
      (IS_EVIL(ch) && NOTRADE_EVIL(shop_nr)) ||
      (IS_NEUTRAL(ch) && NOTRADE_NEUTRAL(shop_nr)))
    {
      sprintf(buf, "%s %s", GET_NAME(ch), MSG_NO_SELL_ALIGN);
      do_tell(keeper, buf, cmd_tell, 0);
      return (FALSE);
    }
  if (IS_NPC(ch))
    return (TRUE);

  if ((IS_MAGIC_USER(ch) && NOTRADE_MAGIC_USER(shop_nr)) ||
      (IS_CLERIC(ch) && NOTRADE_CLERIC(shop_nr)) ||
      (IS_THIEF(ch) && NOTRADE_THIEF(shop_nr)) ||
      (IS_WARRIOR(ch) && NOTRADE_WARRIOR(shop_nr)))
    {
      sprintf(buf, "%s %s", GET_NAME(ch), MSG_NO_SELL_CLASS);
      do_tell(keeper, buf, cmd_tell, 0);
      return (FALSE);
    }
  return (TRUE);
}
开发者ID:rparet,项目名称:darkpawns,代码行数:35,代码来源:shop.c

示例6: 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

示例7: spec_police_attack

bool spec_police_attack(CHAR_DATA * ch)
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	int vip;
	char buf[MAX_STRING_LENGTH];

	if (!IS_AWAKE(ch) || ch->fighting)
		return FALSE;

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;
		if (IS_NPC(victim))
			continue;
		if (!can_see(ch, victim))
			continue;
		if (number_bits(1) == 0)
			continue;
		for (vip = 0; vip < 32; vip++)
			if (IS_SET(ch->vip_flags, 1 << vip)
			    && IS_SET(victim->pcdata->wanted_flags, 1 << vip)) {
				sprintf(buf, "Hey you're wanted on %s!",
					planet_flags[vip]);
				do_say(ch, buf);
				REMOVE_BIT(victim->pcdata->wanted_flags,
					   1 << vip);
				multi_hit(ch, victim, TYPE_UNDEFINED);
				return TRUE;
			}

	}

	return FALSE;

}
开发者ID:danielkrainas,项目名称:ganadia,代码行数:35,代码来源:special.c

示例8: say_full

static int say_full(struct ast_channel *chan, const char *string,
	const char *ints, const char *lang, const char *options,
	int audiofd, int ctrlfd)
{
	say_args_t a = { chan, ints, lang, audiofd, ctrlfd };
	return do_say(&a, string, options, 0);
}
开发者ID:adaptiman,项目名称:asterisk,代码行数:7,代码来源:app_playback.c

示例9: do_balance

void do_balance( CHAR_DATA * ch, char *argument )
{
   CHAR_DATA *banker;
   char buf[MAX_STRING_LENGTH];

   if( !( banker = find_banker( ch ) ) )
   {
      send_to_char( "&WYou're not in a bank!&w\r\n", ch );
      return;
   }

   if( IS_NPC( ch ) )
   {
      sprintf( buf, "Sorry, %s, we don't do business with mobs.", ch->short_descr );
      do_say( banker, buf );
      return;
   }

   set_char_color( AT_WHITE, ch );
   send_to_char( "Your account value is:\r\n", ch );
   sprintf( buf, "&YGold: %ld.\r\n&WSilver: %ld.\r\n&RCopper: %ld.\r\n\r\n", ch->pcdata->gbalance, ch->pcdata->sbalance,
            ch->pcdata->balance );
   send_to_char( buf, ch );
   return;
}
开发者ID:jmdjr,项目名称:sdf-mud,代码行数:25,代码来源:bank.c

示例10: spec_police_fine

bool spec_police_fine( CHAR_DATA * ch )
{
   CHAR_DATA *victim;
   CHAR_DATA *v_next;
   int vip;
   char buf[MAX_STRING_LENGTH];

   if( !IS_AWAKE( ch ) || ch->fighting )
      return FALSE;

   for( victim = ch->in_room->first_person; victim; victim = v_next )
   {
      v_next = victim->next_in_room;
      if( IS_NPC( victim ) )
         continue;
      if( !can_see( ch, victim ) )
         continue;
      if( number_bits( 1 ) == 0 )
         continue;
      for( vip = 0; vip <= 31; vip++ )
         if( IS_SET( ch->vip_flags, 1 << vip ) && IS_SET( victim->pcdata->wanted_flags, 1 << vip ) )
         {
            sprintf( buf, "Hey you're wanted on %s!", planet_flags[vip] );
            do_say( ch, buf );
            act( AT_ACTION, "$n fines $N an enormous amount of money.", ch, NULL, victim, TO_NOTVICT );
            act( AT_ACTION, "$n fines you an enourmous amount of money.", ch, NULL, victim, TO_VICT );
            victim->gold /= 2;
            REMOVE_BIT( victim->pcdata->wanted_flags, 1 << vip );
            return TRUE;
         }
   }
   return FALSE;
}
开发者ID:AndrewBudd,项目名称:swr-fuss-ace,代码行数:33,代码来源:special.c

示例11: 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

示例12: drain_sword

void drain_sword (CHAR_DATA *ch)
{
	//Drain Sword sucks health from a victim, and is moderately likely to hit. Avg Expense, Low Dmg
	CHAR_DATA *victim;
	OBJ_DATA *katana;
	char buf[MAX_STRING_LENGTH];
	int dmg;
	int heal;
	
	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 (ch->mana < 4000)
	{
		send_to_char("You have not the 4000 mystical 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 -= 4000;
	send_to_char("You channel mystical energy into your katana.\n\r",ch);
	do_say(ch,"#nD#0R#yA#0I#nN #nSWORD!");
	send_to_char("A wave of energy launches itself from your katana.\n\r",ch);
	act("A wave of energy launches itself from $n's katana!", ch, NULL, NULL, TO_ROOM);

	if (number_range(0,100) < 20)
	{
		act("Your wave of energy goes through $N, continues on a bit then fades.", ch, NULL, victim, TO_CHAR);
		act("The wave of energy goes through you, continues on a bit then fades.", ch, NULL, victim, TO_VICT);
		act("The wave of energy goes through $N, continues on a bit then fades.", ch, NULL, victim, TO_NOTVICT);
		return;
	}

	dmg = number_range(ch->wpn[1], ch->wpn[1] * 2);
	heal = number_range(dmg / 3, dmg / 2);
	
	xprintf(buf,"Your wave of energy enters $N's body and drains %d health painfully from $N. #R[#R#b %d #n#R]#n", heal, dmg);
	act(buf, ch, NULL, victim, TO_CHAR);
	xprintf(buf,"$n's wave of energy enters your body and drains you painfully. #R[#R#b %d #n#R]#n", dmg);
	act(buf, ch, NULL, victim, TO_VICT);
	act("$n's wave of energy enters $N's body causing $N to look weak.", ch, NULL, victim, TO_NOTVICT);
	hurt_person(ch, victim, dmg);
	ch->hit += heal;
	if (ch->hit > ch->max_hit)	ch->hit = ch->max_hit;	
	WAIT_STATE(ch, (PULSE_VIOLENCE * 3));
	return;
}
开发者ID:smthbh,项目名称:Mindcloud-2.5-MUD,代码行数:58,代码来源:samurai.c

示例13: say_enumeration_full

static int say_enumeration_full(struct ast_channel *chan, int num,
	const char *ints, const char *lang, const char *options,
	int audiofd, int ctrlfd)
{
	char buf[64];
	say_args_t a = { chan, ints, lang, audiofd, ctrlfd };
	snprintf(buf, sizeof(buf), "enum:%d", num);
	return do_say(&a, buf, options, 0);
}
开发者ID:adaptiman,项目名称:asterisk,代码行数:9,代码来源:app_playback.c

示例14: fire_sword

void fire_sword (CHAR_DATA *ch)
{
	//Flame Cone Sword sets victim aflame, and is VERY likely to hit. More Expense, Low Dmg
	CHAR_DATA *victim;
	OBJ_DATA *katana;
	char buf[MAX_STRING_LENGTH];
	int dmg;
	
	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 (ch->mana < 3500)
	{
		send_to_char("You have not the 3500 mystical 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 -= 3500;
	send_to_char("You channel mystical energy into your katana.\n\r",ch);
	do_say(ch,"#rF#RIR#rE #nSWORD!");
	send_to_char("A tremendous cone of flame shoots from your katana.\n\r",ch);
	act("A tremendous cone of flame shoots from $n's katana!", ch, NULL, NULL, TO_ROOM);

	if (number_range(0,100) < 5)
	{
		act("Your cone of flame flashes past $N and scorches the ground.", ch, NULL, victim, TO_CHAR);
		act("The cone of flame flashes past you and scorches the ground.", ch, NULL, victim, TO_VICT);
		act("The cone of flame flashes past $N and scorches the ground.", ch, NULL, victim, TO_NOTVICT);
		return;
	}

	dmg = number_range(ch->wpn[1], ch->wpn[1] * 2);
	
	xprintf(buf,"Your cone of flame engulfs $N's in a sheet of flame. #R[#R#b %d #n#R]#n", dmg);
	act(buf, ch, NULL, victim, TO_CHAR);
	xprintf(buf,"$n's cone of flame engulfs you in a sheet of flame. #R[#R#b %d #n#R]#n", dmg);
	act(buf, ch, NULL, victim, TO_VICT);
	act("$n's engulfs $N's in a sheet of flame.", ch, NULL, victim, TO_NOTVICT);
	hurt_person(ch, victim, dmg);	
	WAIT_STATE(ch, (PULSE_VIOLENCE * 3));
	if (!IS_SET(victim->affected_by, AFF_FLAMING))
		SET_BIT(victim->affected_by, AFF_FLAMING);
	return;
}
开发者ID:smthbh,项目名称:Mindcloud-2.5-MUD,代码行数:56,代码来源:samurai.c

示例15: lightning_sword

void lightning_sword (CHAR_DATA *ch)
{
	//Lightning Stuns Victim and is fairly likely to hit, Avg Expense, Avg Damage

	CHAR_DATA *victim;
	OBJ_DATA *katana;
	char buf[MAX_STRING_LENGTH];
	int dmg;
	
	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 (ch->mana < 2500)
	{
		send_to_char("You have not the 2500 mana 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 -= 2500;
	send_to_char("You channel mystical energy into your katana.\n\r",ch);
	do_say(ch,"#b#cL#CI#cG#CH#cT#CN#cI#CN#cG #nSWORD!");
	send_to_char("A humongous bolt of lightning blasts from your katana.\n\r",ch);
	act("A humongous bolt of lightning blasts from $n's katana!", ch, NULL, NULL, TO_ROOM);

	if (number_range(0,100) < 16)
	{
		act("Your lightning blast flies past $N and is absorbed by the ground.", ch, NULL, victim, TO_CHAR);
		act("The lightning blast slams into the ground and is absorbed.", ch, NULL, NULL, TO_ROOM);
		return;
	}

	dmg = number_range(ch->wpn[1], ch->wpn[1] * 3);
	
	xprintf(buf,"Your lightning blast slams into $N's and crackles around $S body sending them sprawling. #R[#C#b %d #n#R]#n", dmg);
		act(buf, ch, NULL, victim, TO_CHAR);
	xprintf(buf,"$n's lightning blast slams into you and crackles around your body sending you sprawling. #R[#C#b %d #n#R]#n", dmg);
		act(buf, ch, NULL, victim, TO_VICT);
		act("$n's lightning blast slams into $N's and crackles around $S body sending $N sprawling.", ch, NULL, victim, TO_NOTVICT);
	hurt_person(ch, victim, dmg);	
	WAIT_STATE(ch, (PULSE_VIOLENCE * 3));
	if (victim->position > POS_STUNNED)
		victim->position = POS_STUNNED;
	return;
}
开发者ID:smthbh,项目名称:Mindcloud-2.5-MUD,代码行数:56,代码来源:samurai.c


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