本文整理汇总了C++中IS_AWAKE函数的典型用法代码示例。如果您正苦于以下问题:C++ IS_AWAKE函数的具体用法?C++ IS_AWAKE怎么用?C++ IS_AWAKE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IS_AWAKE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: spec_new_republic_trooper
bool spec_new_republic_trooper(CHAR_DATA * ch)
{
CHAR_DATA *victim;
CHAR_DATA *v_next;
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 (!can_see(ch, victim))
continue;
if (get_timer(victim, TIMER_RECENTFIGHT) > 0)
continue;
if ((IS_NPC(victim) && nifty_is_name("imperial", victim->name)
&& victim->fighting && who_fighting(victim) != ch) ||
(!IS_NPC(victim) && victim->pcdata && victim->pcdata->clan
&& IS_AWAKE(victim)
&& nifty_is_name("empire", victim->pcdata->clan->name))) {
do_yell(ch, "Long live the New Republic!");
multi_hit(ch, victim, TYPE_UNDEFINED);
return TRUE;
}
}
return FALSE;
}
示例2: spec_clan_guard
bool spec_clan_guard(CHAR_DATA * ch)
{
CHAR_DATA *victim;
CHAR_DATA *v_next;
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 (!can_see(ch, victim))
continue;
if (get_timer(victim, TIMER_RECENTFIGHT) > 0)
continue;
if (!IS_NPC(victim) && victim->pcdata && victim->pcdata->clan
&& IS_AWAKE(victim)
&& str_cmp(ch->name, victim->pcdata->clan->name)) {
do_yell(ch, "Hey your not allowed in here!");
multi_hit(ch, victim, TYPE_UNDEFINED);
return TRUE;
}
}
return FALSE;
}
示例3: do_wake
void do_wake (CHAR_DATA * ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
one_argument (argument, arg);
if (arg[0] == '\0')
{
do_function (ch, &do_stand, "");
return;
}
if (!IS_AWAKE (ch))
{
send_to_char ("You are asleep yourself!\n\r", ch);
return;
}
if ((victim = get_char_room (ch, arg)) == NULL)
{
send_to_char ("They aren't here.\n\r", ch);
return;
}
if (IS_AWAKE (victim))
{
act ("$N is already awake.", ch, NULL, victim, TO_CHAR);
return;
}
act_new ("$n wakes you.", ch, NULL, victim, TO_VICT, POS_SLEEPING);
do_function (ch, &do_stand, "");
return;
}
示例4: spec_clan_guard
bool spec_clan_guard( CHAR_DATA * ch )
{
CHAR_DATA *victim = NULL;
CHAR_DATA *v_next = NULL;
if( !IS_AWAKE( ch ) || ch->fighting || !ch->mob_clan )
return FALSE;
for( victim = ch->in_room->first_person; victim; victim = v_next )
{
v_next = victim->next_in_room;
if( !can_see( ch, victim ) )
continue;
if( get_timer( victim, TIMER_RECENTFIGHT ) > 0 )
continue;
if( !IS_NPC( victim ) && victim->pcdata && victim->pcdata->clan
&& IS_AWAKE( victim ) && victim->pcdata->clan != ch->mob_clan
&& nifty_is_name( victim->pcdata->clan->name,
ch->mob_clan->atwar ) )
{
char buf[MAX_STRING_LENGTH];
snprintf( buf, MAX_STRING_LENGTH, "%s",
"Hey you're not allowed in here!" );
do_yell( ch, buf );
multi_hit( ch, victim, TYPE_UNDEFINED );
return TRUE;
}
}
return FALSE;
}
示例5: spec_janitor
bool spec_janitor(CHAR_DATA * ch)
{
OBJ_DATA *trash;
OBJ_DATA *trash_next;
if (!IS_AWAKE(ch))
return FALSE;
for (trash = ch->in_room->first_content; trash; trash = trash_next) {
trash_next = trash->next_content;
if (!IS_SET(trash->wear_flags, ITEM_TAKE)
|| IS_OBJ_STAT(trash, ITEM_BURRIED))
continue;
if (trash->item_type == ITEM_DRINK_CON
|| trash->item_type == ITEM_TRASH
|| trash->cost < 10
|| (trash->pIndexData->vnum == OBJ_VNUM_SHOPPING_BAG
&& !trash->first_content)) {
act(AT_ACTION, "$n picks up some trash.", ch, NULL,
NULL, TO_ROOM);
obj_from_room(trash);
obj_to_char(trash, ch);
return TRUE;
}
}
return FALSE;
}
示例6: 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;
}
示例7: check_parry
/*
* Check for parry.
*/
bool check_parry( CHAR_DATA *ch, CHAR_DATA *victim )
{
int chance;
if ( !IS_AWAKE(victim) )
return FALSE;
chance = get_skill(victim,gsn_parry) / 2;
if ( get_eq_char( victim, WEAR_WIELD ) == NULL )
{
if (IS_NPC(victim))
chance /= 2;
else
return FALSE;
}
if (!can_see(ch,victim))
return FALSE;
if ( dice_rolls(ch, chance,8) >= 1 )
return FALSE;
act( "You parry $n's attack.", ch, NULL, victim, TO_VICT, 1 );
act( "$N parries your attack.", ch, NULL, victim, TO_CHAR, 1 );
return TRUE;
}
示例8: spec_executioner
bool spec_executioner( CHAR_DATA *ch )
{
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
CHAR_DATA *v_next;
char *crime;
if ( !IS_AWAKE(ch) || ch->fighting != NULL )
return FALSE;
crime = "";
for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
{
v_next = victim->next_in_room;
if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_KILLER) )
{ crime = "KILLER"; break; }
if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_THIEF) )
{ crime = "THIEF"; break; }
}
if ( victim == NULL )
return FALSE;
sprintf( buf, "%s is a %s! PROTECT THE INNOCENT! MORE BLOOOOD!!!",
victim->name, crime );
do_shout( ch, buf );
multi_hit( ch, victim, TYPE_UNDEFINED );
char_to_room( create_mobile( get_mob_index(MOB_VNUM_CITYGUARD) ),
ch->in_room );
char_to_room( create_mobile( get_mob_index(MOB_VNUM_CITYGUARD) ),
ch->in_room );
return TRUE;
}
示例9: 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); } }
} }
}
示例10: do_tell
void do_tell( CHAR_DATA *ch, const char *argument )
{
CHAR_DATA *victim;
char arg [ MAX_INPUT_LENGTH ];
int position;
if ( IS_AFFECTED( ch, AFF_MUTE )
|| IS_SET( ch->in_room->room_flags, ROOM_CONE_OF_SILENCE ) )
{
send_to_char( "You can't seem to break the silence.\n\r", ch );
return;
}
one_argument( argument, arg );
/*
* Can tell to PC's anywhere, but NPC's only in same room.
* -- Furey
*/
if ( !( victim = get_char_world( ch, arg ) )
|| ( IS_NPC( victim ) && victim->in_room != ch->in_room ) )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if ( ( !IS_NPC( ch ) && ( IS_SET( ch->act, PLR_SILENCE )
|| IS_SET( ch->act, PLR_NO_TELL ) ) )
|| IS_SET( victim->in_room->room_flags, ROOM_CONE_OF_SILENCE ) )
{
send_to_char( "Your message didn't get through.\n\r", ch );
return;
}
argument = one_argument( argument, arg );
if ( arg[0] == '\0' || argument[0] == '\0' )
{
send_to_char( "Tell whom what?\n\r", ch );
return;
}
if ( !IS_IMMORTAL( ch ) && !IS_AWAKE( victim ) )
{
act( "$E can't hear you.", ch, 0, victim, TO_CHAR );
return;
}
act( "You tell $N '$t'", ch, argument, victim, TO_CHAR );
position = victim->position;
victim->position = POS_STANDING;
act( "$n tells you '$t'", ch, argument, victim, TO_VICT );
victim->position = position;
victim->reply = ch;
if ( IS_SET( victim->act, PLR_AFK ) )
act( "Just so you know, $E is AFK.", ch, NULL, victim, TO_CHAR );
return;
}
示例11: 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;
}
示例12: do_reply
void do_reply( CHAR_DATA *ch, char *argument )
{
CHAR_DATA *victim;
int position;
if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_SILENCE) )
{
send_to_char( "Your message didn't get through.\n\r", ch );
return;
}
if ( ( victim = ch->reply ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if ( !IS_IMMORTAL(ch) && !IS_AWAKE(victim) )
{
act( "$E can't hear you.", ch, 0, victim, TO_CHAR );
return;
}
act( "You tell $N '$t'.", ch, argument, victim, TO_CHAR );
position = victim->position;
victim->position = POS_STANDING;
act( "$n tells you '$t'.", ch, argument, victim, TO_VICT );
victim->position = position;
victim->reply = ch;
return;
}
示例13: spec_cast_adept
bool spec_cast_adept( CHAR_DATA *ch )
{
CHAR_DATA *victim;
CHAR_DATA *v_next;
if ( !IS_AWAKE(ch) )
return FALSE;
for ( victim = ch->in_room->people; victim != NULL; victim = v_next )
{
v_next = victim->next_in_room;
if ( victim != ch && can_see( ch, victim ) && number_bits( 1 ) == 0 )
break;
}
if ( victim == NULL )
return FALSE;
switch ( number_bits( 3 ) )
{
case 0:
act( "$n utters the word 'tehctah'.", ch, NULL, NULL, TO_ROOM );
spell_armor( skill_lookup( "armor" ), ch->level, ch, victim );
return TRUE;
case 1:
act( "$n utters the word 'nhak'.", ch, NULL, NULL, TO_ROOM );
spell_bless( skill_lookup( "bless" ), ch->level, ch, victim );
return TRUE;
case 2:
act( "$n utters the word 'yeruf'.", ch, NULL, NULL, TO_ROOM );
spell_cure_blindness( skill_lookup( "cure blindness" ),
ch->level, ch, victim );
return TRUE;
case 3:
act( "$n utters the word 'garf'.", ch, NULL, NULL, TO_ROOM );
spell_cure_light( skill_lookup( "cure light" ),
ch->level, ch, victim );
return TRUE;
case 4:
act( "$n utters the words 'rozar'.", ch, NULL, NULL, TO_ROOM );
spell_cure_poison( skill_lookup( "cure poison" ),
ch->level, ch, victim );
return TRUE;
case 5:
act( "$n utters the words 'nadroj'.", ch, NULL, NULL, TO_ROOM );
spell_refresh( skill_lookup( "refresh" ), ch->level, ch, victim );
return TRUE;
}
return FALSE;
}
示例14: spec_executioner
bool spec_executioner( CHAR_DATA *ch )
{
char buf[MAX_STRING_LENGTH];
MOB_INDEX_DATA *cityguard;
CHAR_DATA *victim;
CHAR_DATA *v_next;
char *crime;
if ( !IS_AWAKE(ch) || ch->fighting )
return FALSE;
crime = "";
for ( victim = ch->in_room->first_person; victim; victim = v_next )
{
v_next = victim->next_in_room;
if ( !IS_NPC(victim) && xIS_SET(victim->act, PLR_KILLER) )
{ crime = "KILLER"; break; }
if ( !IS_NPC(victim) && xIS_SET(victim->act, PLR_THIEF) )
{ crime = "THIEF"; break; }
}
if ( !victim )
return FALSE;
if ( xIS_SET( ch->in_room->room_flags, ROOM_SAFE ) )
{
sprintf( buf, "%s is a %s! As well as a COWARD!",
victim->name, crime );
do_yell( ch, buf );
return TRUE;
}
sprintf( buf, "%s is a %s! PROTECT THE INNOCENT! MORE BLOOOOD!!!",
victim->name, crime );
do_yell( ch, buf );
multi_hit( ch, victim, TYPE_UNDEFINED );
if ( char_died(ch) )
return TRUE;
/* Added log in case of missing cityguard -- Tri */
cityguard = get_mob_index( MOB_VNUM_CITYGUARD );
if ( !cityguard )
{
sprintf( buf, "Missing Cityguard - Vnum:[%d]", MOB_VNUM_CITYGUARD );
bug( buf, 0 );
return TRUE;
}
char_to_room( create_mobile( cityguard ), ch->in_room );
char_to_room( create_mobile( cityguard ), ch->in_room );
return TRUE;
}
示例15: spec_ogre_member
bool spec_ogre_member( CHAR_DATA *ch )
{
CHAR_DATA * vch, *victim = NULL;
int count = 0;
char *message;
if ( !IS_AWAKE( ch ) || IS_AFFECTED( ch, AFF_CALM ) || ch->in_room == NULL
|| IS_AFFECTED( ch, AFF_CHARM ) || ch->fighting != NULL )
return FALSE;
/* find an troll to beat up */
for ( vch = ch->in_room->people; vch != NULL; vch = vch->next_in_room )
{
if ( !IS_NPC( vch ) || ch == vch )
continue;
if ( !str_cmp( race_table[ GET_RACE(vch) ].name, "troll" )
&& ch->level > vch->level - 2 && !is_safe( ch, vch, TRUE ) )
{
if ( number_range( 0, count ) == 0 )
victim = vch;
count++;
}
}
if ( victim == NULL )
return FALSE;
/* say something, then raise hell */
switch ( number_range( 0, 6 ) )
{
default: message = NULL; break;
case 0: message = "$n wrzeszczy 'Szuka³em ciê, ¶mieciu!'";
break;
case 1: message = "$n atakuje $C z szaleñczym wrzaskiem.";
break;
case 2: message =
"$n mówi 'Co taki ¶mierdz±cy, trollowaty pomiot jak ty tu w ogóle robi?'";
break;
case 3: message = "$n wy³amuje palce a¿ trzeszcz± i mówi 'My¶lisz, ¿e masz szczê¶cie?'";
break;
case 4: message = "$n mówi 'Nie widzê tu stra¿ników którzy mogliby ciê ochroniæ tym razem!'";
break;
case 5: message = "$n mówi 'Czas do³±czyæ do swoich durnych braci w za¶wiatach.'";
break;
case 6: message = "$n mówi 'I niech gra muzyka...'";
break;
}
if ( message != NULL )
act( message, ch, NULL, victim, TO_ALL );
multi_hit( ch, victim, TYPE_UNDEFINED );
return TRUE;
}