本文整理汇总了C++中IS_AFFECTED函数的典型用法代码示例。如果您正苦于以下问题:C++ IS_AFFECTED函数的具体用法?C++ IS_AFFECTED怎么用?C++ IS_AFFECTED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IS_AFFECTED函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: cast_detect_invisibility
void cast_detect_invisibility( byte level, struct char_data *ch, char *arg, int type,
struct char_data *tar_ch, struct obj_data *tar_obj )
{
switch (type) {
case SPELL_TYPE_SPELL:
if ( affected_by_spell(tar_ch, SPELL_DETECT_INVISIBLE) ){
send_to_char("Nothing seems to happen.\n\r", tar_ch);
return;
}
spell_detect_invisibility(level,ch,tar_ch,0);
break;
case SPELL_TYPE_POTION:
if ( affected_by_spell(ch, SPELL_DETECT_INVISIBLE) )
return;
spell_detect_invisibility(level,ch,ch,0);
break;
case SPELL_TYPE_STAFF:
for (tar_ch = world[ch->in_room].people ;
tar_ch ; tar_ch = tar_ch->next_in_room)
if (tar_ch != ch)
if(!(IS_AFFECTED(tar_ch, SPELL_DETECT_INVISIBLE)))
spell_detect_invisibility(level,ch,tar_ch,0);
break;
default :
log("Serious screw-up in detect invisibility!");
break;
}
}
示例3: do_mpechoat
void do_mpechoat( CHAR_DATA *ch, char *argument )
{
char arg[ MAX_INPUT_LENGTH ];
CHAR_DATA *victim;
if ( !IS_NPC( ch ) )
{
typo_message( ch );
return;
}
if ( IS_SET( ch->act , ACT_PET ) || IS_AFFECTED( ch, AFF_CHARM ) )
return;
argument = one_argument( argument, arg );
if ( arg[0] == '\0' || argument[0] == '\0' )
{
sprintf( log_buf, "Mpechoat - No argument: vnum %d name %s short %s.",
ch->pIndexData->vnum, ch->name, ch->short_descr );
bug( log_buf, -1 );
return;
}
if ( !( victim = get_char_room( ch, arg ) ) )
{
sprintf( log_buf, "Mpechoat - victim does not exist: vnum %d name %s short %s.",
ch->pIndexData->vnum, ch->name, ch->short_descr );
bug( log_buf, -1 );
return;
}
act(C_DEFAULT, argument, ch, NULL, victim, TO_VICT );
return;
}
示例4: do_mpmload
void do_mpmload( CHAR_DATA *ch, char *argument )
{
char arg[ MAX_INPUT_LENGTH ];
MOB_INDEX_DATA *pMobIndex;
CHAR_DATA *victim;
if ( !IS_NPC( ch ) )
{
send_to_char( C_DEFAULT, "Huh?\n\r", ch );
return;
}
if ( IS_AFFECTED( ch, AFF_CHARM ) )
{
return;
}
one_argument( argument, arg );
if ( arg[0] == '\0' || !is_number(arg) )
{
bug( "Mpmload - Bad vnum as arg: vnum %d.", ch->pIndexData->vnum );
return;
}
if ( ( pMobIndex = get_mob_index( atoi( arg ) ) ) == NULL )
{
bug( "Mpmload - Bad mob vnum: vnum %d.", ch->pIndexData->vnum );
return;
}
victim = create_mobile( pMobIndex );
char_to_room( victim, ch->in_room );
return;
}
示例5: do_mpastatus
/* changes area->status, for area theme quests --Manaux */
void do_mpastatus(CHAR_DATA * ch, char * args)
{
char arg1 [MAX_INPUT_LENGTH];
int value;
if (!IS_NPC(ch) || IS_AFFECTED(ch, AFF_CHARM))
return;
args = one_argument(args, arg1);
if (!strcmp("enable", arg1))
{
args = one_argument(args, arg1);
value = 1 << (atoi(arg1) -1);
if (atoi(arg1) > 31 || atoi(arg1) < 1)
return;
ch->pIndexData->area->status |= value;
}
else if (!strcmp("disable", arg1))
{
args = one_argument(args, arg1);
value = 1<< (atoi(arg1) -1);
if (atoi(arg1) > 31 || atoi(arg1) < 1)
return;
ch->pIndexData->area->status &= ~value;
}
return;
}
示例6: do_mpechoaround
void do_mpechoaround( CHAR_DATA *ch, char *argument )
{
char arg[ MAX_INPUT_LENGTH ];
CHAR_DATA *victim;
if ( !IS_NPC( ch ) )
{
send_to_char(C_DEFAULT, "Huh?\n\r", ch );
return;
}
if ( IS_AFFECTED( ch, AFF_CHARM ) )
{
return;
}
argument = one_argument( argument, arg );
if ( arg[0] == '\0' )
{
bug( "Mpechoaround - No argument: vnum %d.", ch->pIndexData->vnum );
return;
}
if ( !( victim=get_char_room( ch, arg ) ) )
{
bug( "Mpechoaround - victim does not exist: vnum %d.",
ch->pIndexData->vnum );
return;
}
act(C_DEFAULT, argument, ch, NULL, victim, TO_NOTVICT );
return;
}
示例7: spell_remove_faerie_fire
/*
* Spell to remove faerie fire outline from an individual
*/
void spell_remove_faerie_fire(int sn, int level, CHAR_DATA * ch, void *vo, int target)
{
CHAR_DATA *victim = (CHAR_DATA *)vo;
if (!IS_AFFECTED(victim, AFF_FAERIE_FIRE))
{
if (victim == ch)
{
send_to_char("You aren't afflicted by faerie fire.\r\n", ch);
}
else
{
act("$N doesn't appear to be afflicted by faerie fire.", ch, NULL, victim, TO_CHAR);
}
return;
}
if (check_dispel(level + 3, victim, gsn_faerie_fire))
{
act("The pink aura around $n fades away.", victim, NULL, NULL, TO_ROOM);
}
else
{
send_to_char("Spell failed.\r\n", ch);
}
} // end spell_remove_faerie_fire
示例8: alter_hit
/*
* subtracts amount of hitpoints from ch's current and starts points event
*/
void alter_hit(struct char_data *ch, int amount)
{
struct regen_event_obj *regen;
long time;
int gain;
GET_HIT(ch) = MIN(GET_HIT(ch) - amount, GET_MAX_HIT(ch));
if (GET_HIT(ch) <= HIT_INCAP||IS_AFFECTED(ch,AFF_TRAMORTITO))
return;
if (PLR_FLAGGED(ch, PLR_FANTASMA) && amount > 0)
return;
if (GET_HIT(ch) < GET_MAX_HIT(ch) && !GET_POINTS_EVENT(ch, REGEN_HIT)) {
CREATE(regen, struct regen_event_obj, 1);
regen->ch = ch;
regen->type = REGEN_HIT;
gain = hit_gain(ch);
time = PULSES_PER_MUD_HOUR / (gain ? gain : 1);
GET_POINTS_EVENT(ch, REGEN_HIT) = event_create(points_event, regen, time);
if (amount >= 0) {
/*
* if the character gained hp, update position and
* restart mana and move regeneration if needed.
*/
update_pos(ch);
alter_mana(ch, 0);
alter_move(ch, 0);
}
}
示例9: do_shadowshift
void do_shadowshift( CHAR_DATA *ch, char *argument )
{
OBJ_DATA *obj;
char arg [MAX_INPUT_LENGTH];
argument = one_argument( argument, arg );
if (IS_NPC(ch)) return;
if (!IS_CLASS(ch, CLASS_WIZARD))
{
send_to_char("Huh?\n\r",ch);
return;
}
if (IS_CLASS(ch, CLASS_WIZARD) && ch->pcdata->powers[WL_SKILLS] < 3)
{
send_to_char("You need Level 3 in Wizard Skills.\n\r",ch);
return;
}
if ( arg[0] == '\0' )
{
if (!IS_AFFECTED(ch, AFF_SHADOWPLANE))
{
if (has_timer(ch)) return;
send_to_char("You fade into the plane of shadows.\n\r",ch);
act("The shadows flicker and swallow up $n.",ch,NULL,NULL,TO_ROOM);
SET_BIT(ch->affected_by, AFF_SHADOWPLANE);
do_look(ch,"auto");
return;
}
REMOVE_BIT(ch->affected_by, AFF_SHADOWPLANE);
send_to_char("You fade back into the real world.\n\r",ch);
act("The shadows flicker and $n fades into existance.",ch,NULL,NULL,TO_ROOM);
do_look(ch,"auto");
return;
}
if ( ( obj = get_obj_here( ch, arg ) ) == NULL )
{
send_to_char( "What do you wish to toss into the shadow plane?\n\r", ch );
return;
}
if (IS_AFFECTED(ch, AFF_SHADOWPLANE))
send_to_char( "You toss it to the ground and it vanishes.\n\r", ch );
else
send_to_char( "You toss it into a shadow and it vanishes.\n\r", ch );
return;
}
示例10: do_sinsofthepast
void do_sinsofthepast( CHAR_DATA *ch, char *argument )
{
CHAR_DATA *victim;
char arg[MAX_INPUT_LENGTH];
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_JUSTICE] < 3)
{
send_to_char("Your not ready to punish the sinners.\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))
{
send_to_char("Not on mobiles.\n\r",ch);
return;
}*/
if (is_safe(ch,victim)) return;
if (victim == ch)
{
send_to_char("That doesn't seem like a good idea.\n\r",ch);
return;
}
send_to_char("#RYou burn them with the fires of hell!#n\n\r",ch);
if (!IS_AFFECTED(victim, AFF_FLAMING)) SET_BIT(victim->affected_by, AFF_FLAMING);
send_to_char("#LTheir body is wrecked by poison!#n\n\r",ch);
if (!IS_AFFECTED(victim, AFF_POISON)) SET_BIT(victim->affected_by, AFF_POISON);
send_to_char("#CGod's fury upon them for they have truly sinned!!!#n\n\r",ch);
one_hit(ch,victim, gsn_wrathofgod,1);
one_hit(ch,victim, gsn_wrathofgod,1);
one_hit(ch,victim, gsn_wrathofgod,1);
one_hit(ch,victim, gsn_wrathofgod,1);
WAIT_STATE(ch,12);
return;
}
示例11: calcManaMulti
int calcManaMulti(CharData *ch) {
int multi = 100;
if(ROOM_FLAGGED(ch->in_room, ROOM_MANA_REGEN))
multi += 50;
if(IS_AFFECTED(ch, AFF_WRAITHFORM))
multi += 25;
if((GET_CLASS(ch) == CLASS_SHADOW_DANCER) && (IS_DARK(ch->in_room) || IS_AFFECTED(ch, AFF_SHADOW_SPHERE)))
multi += 50;
if(IS_AFFECTED(ch, AFF_POISON))
multi -= 100;
if(!IS_NPC(ch)) {
if( !IS_NPC(ch) && ROOM_FLAGGED(ch->in_room, ROOM_SUFFER) && ( GET_LEVEL(ch) < LVL_IMMORT ))
multi -= 90;
else if (!GET_COND(ch, THIRST) && IS_AMARA(ch))
multi -= 90;
else if (IS_IZARTI(ch) && IS_EVIL(ch))
multi -= 90;
else if (IS_DEMON(ch) && IS_GOOD(ch))
multi -= 90;
}
if(GET_RACE(ch) == RACE_STROLL)
multi += 100;
/* Position calculations */
switch (GET_POS(ch)) {
case POS_MEDITATING:
case POS_SLEEPING:
multi += 120;
break;
case POS_RESTING:
multi += 60;
break;
}
multi += (int)GET_SKILL(ch, SKILL_DEVOTION);
// Don't let a player's regeneration completely stagnate...
multi = MAX(multi, 25);
return multi;
}
示例12: do_taste
void do_taste(struct char_data *ch, char *argument, int cmd)
{
struct affected_type af;
char arg[MAX_STRING_LENGTH];
char buf[MAX_STRING_LENGTH];
struct obj_data *temp;
one_argument(argument,arg);
if(!(temp = get_obj_in_list_vis(ch,arg,ch->carrying)))
{
act("You can't find it!",FALSE,ch,0,0,TO_CHAR);
return;
}
if(temp->obj_flags.type_flag==ITEM_DRINKCON)
{
do_sip(ch,argument,0);
return;
}
if(!(temp->obj_flags.type_flag==ITEM_FOOD))
{
act("Taste that?!? Your stomach refuses!",FALSE,ch,0,0,TO_CHAR);
return;
}
act("$n tastes the $o", FALSE, ch, temp, 0, TO_ROOM);
act("You taste the $o", FALSE, ch, temp, 0, TO_CHAR);
gain_condition(ch,FULL,1);
if(GET_COND(ch,FULL)>20)
act("You are full.",FALSE,ch,0,0,TO_CHAR);
if(temp->obj_flags.value[3]&&!IS_AFFECTED(ch,AFF_POISON)) /* The shit was poisoned ! */
{
act("Ooups, it did not taste good at all!",FALSE,ch,0,0,TO_CHAR);
af.type = SPELL_POISON;
af.duration = 2;
af.modifier = 0;
af.location = APPLY_NONE;
af.bitvector = AFF_POISON;
affect_to_char(ch,&af);
}
temp->obj_flags.value[0]--;
if(!temp->obj_flags.value[0]) /* Nothing left */
{
act("There is nothing left now.",FALSE,ch,0,0,TO_CHAR);
extract_obj(temp);
}
return;
}
示例13: do_krecall
void do_krecall(CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
CHAR_DATA *victim;
CHAR_DATA *mount;
ROOM_INDEX_DATA *location;
KINGDOM_DATA *kingdom;
if(IS_NPC(ch) || (kingdom = get_kingdom(ch->pcdata->kingdom)) == &kingdom_default)
{
send_to_char("You have no kingdom!\n\r", ch);
return;
}
act("$n's body flickers with green energy.", ch, 0, 0, TO_ROOM);
act("Your body flickers with green energy.", ch, 0, 0, TO_CHAR);
if((location = get_room_index(kingdom->recall)) == 0)
{
send_to_char("Your kingdom has no recall set.\n\r", ch);
return;
}
if(ch->in_room == location)
return;
if(IS_SET(ch->in_room->room_flags, ROOM_NO_RECALL) || IS_AFFECTED(ch, AFF_CURSE))
{
send_to_char("You are unable to recall.\n\r", ch);
return;
}
if((victim = ch->fighting) != 0)
{
if(number_bits(1) == 0)
{
WAIT_STATE(ch, 4);
sprintf(buf, "You failed!\n\r");
send_to_char(buf, ch);
return;
}
sprintf(buf, "You recall from combat!\n\r");
send_to_char(buf, ch);
stop_fighting(ch, TRUE);
}
act("$n disappears.", ch, 0, 0, TO_ROOM);
char_from_room(ch);
char_to_room(ch, location);
act("$n appears in the room.", ch, 0, 0, TO_ROOM);
do_look(ch, "auto");
if((mount = ch->mount) == 0)
return;
char_from_room(mount);
char_to_room(mount, ch->in_room);
return;
}
示例14: do_reveal
void do_reveal(CHAR_DATA *ch, char *argument)
{
CHAR_DATA *ich;
if (IS_NPC(ch)) return;
if (!IS_CLASS(ch, CLASS_MAGE))
{
send_to_char("Huh?!?.\n\r",ch);
return;
}
if (ch->mana < 5000)
{
send_to_char("You don't have the mystical energies to do this.\n\r",ch);
return;
}
act( "$n mumles a few words, and you are suddenly blinded by a flash.", ch, NULL, NULL, TO_ROOM );
send_to_char( "You reveal everything hidden in the room.\n\r", ch );
for ( ich = ch->in_room->people; ich != NULL; ich = ich->next_in_room )
{
if (ich==ch || ich->trust > 6) continue;
affect_strip ( ich, gsn_invis );
affect_strip ( ich, gsn_mass_invis );
affect_strip ( ich, gsn_sneak );
if (IS_SET(ich->affected_by, AFF_HIDE)) REMOVE_BIT(ich->affected_by, AFF_HIDE);
if (IS_SET(ich->affected_by, AFF_INVISIBLE)) REMOVE_BIT(ich->affected_by, AFF_INVISIBLE);
if (IS_SET(ich->affected_by, AFF_SNEAK)) REMOVE_BIT(ich->affected_by, AFF_SNEAK);
if (IS_SET(ich->act, PLR_WIZINVIS)) REMOVE_BIT(ich->act, PLR_WIZINVIS);
if (IS_SET(ich->act, AFF_HIDE)) REMOVE_BIT(ich->act, AFF_HIDE);
if (IS_SET(ich->affected_by, AFF_SHIFT)) REMOVE_BIT(ich->affected_by, AFF_SHIFT);
if (IS_SET(ich->extra, EXTRA_EARTHMELD)) REMOVE_BIT(ich->extra, EXTRA_EARTHMELD);
if (IS_AFFECTED(ch,AFF_SHADOWPLANE)) REMOVE_BIT(ch->affected_by, AFF_SHADOWPLANE);
if (IS_AFFECTED(ch, AFF_PEACE)) REMOVE_BIT(ch->affected_by, AFF_PEACE);
if (IS_AFFECTED(ch,AFF_ETHEREAL)) REMOVE_BIT(ch->affected_by, AFF_ETHEREAL);
if (IS_CLASS(ich, CLASS_DROW) && IS_SET(ich->newbits, NEW_DARKNESS))
{
REMOVE_BIT(ich->newbits, NEW_DARKNESS);
REMOVE_BIT(ich->in_room->room_flags, ROOM_TOTAL_DARKNESS);
}
send_to_char("You are suddenly very visible.\n\r",ich);
}
ch->mana -= 5000;
return;
}
示例15: move_gain
int move_gain( CHAR_DATA *ch )
{
int gain;
if (ch->in_room == NULL)
return 0;
if ( IS_NPC(ch) )
{
gain = ch->level;
}
else
{
gain = UMAX( 15, ch->level );
switch ( ch->position )
{
case POS_SLEEPING: gain += get_curr_stat(ch,STAT_DEX); break;
case POS_RESTING: gain += get_curr_stat(ch,STAT_DEX) / 2; break;
}
if ( ch->pcdata->condition[COND_HUNGER] == 0 )
gain /= 2;
if ( ch->pcdata->condition[COND_THIRST] == 0 )
gain /= 2;
}
gain = gain * ch->in_room->heal_rate/100;
if (ch->on != NULL && ch->on->item_type == ITEM_FURNITURE)
gain = gain * ch->on->value[3] / 100;
if ( IS_AFFECTED(ch, AFF_POISON) )
gain /= 4;
if (IS_AFFECTED(ch, AFF_PLAGUE))
gain /= 8;
if (IS_AFFECTED(ch,AFF_HASTE) || IS_AFFECTED(ch,AFF_SLOW))
gain /=2 ;
return UMIN(gain, ch->max_move - ch->move);
}