本文整理汇总了C++中IS_AFFECTED函数的典型用法代码示例。如果您正苦于以下问题:C++ IS_AFFECTED函数的具体用法?C++ IS_AFFECTED怎么用?C++ IS_AFFECTED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IS_AFFECTED函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:smthbh,项目名称:Mindcloud-2.5-MUD,代码行数:35,代码来源:tanarri.c
示例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;
}
}
开发者ID:MUDOmnibus,项目名称:DikuMUD-Alfa,代码行数:28,代码来源:spells2.c
示例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;
}
开发者ID:SwiftAusterity,项目名称:NetMud,代码行数:35,代码来源:mob_commands.c
示例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;
}
开发者ID:rayhe,项目名称:stormgate,代码行数:35,代码来源:mob_commands.c
示例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;
}
开发者ID:rayhe,项目名称:stormgate,代码行数:26,代码来源:mob_commands.c
示例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;
}
开发者ID:rayhe,项目名称:stormgate,代码行数:34,代码来源:mob_commands.c
示例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
开发者ID:blakepell,项目名称:CrimsonSkies,代码行数:30,代码来源:class_healer.c
示例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);
}
}
开发者ID:DalilaMud,项目名称:Dalila-Mud,代码行数:35,代码来源:regen.c
示例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;
}
开发者ID:pfchrono,项目名称:Anotherland_Mud,代码行数:47,代码来源:wizard.c
示例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;
}
开发者ID:pfchrono,项目名称:Anotherland_Mud,代码行数:46,代码来源:angel.c
示例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;
}
开发者ID:Lundessa,项目名称:NewRavenVM,代码行数:46,代码来源:mudlimits.c
示例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;
}
开发者ID:MUDOmnibus,项目名称:DikuMUD-Alfa,代码行数:58,代码来源:act.obj2.c
示例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;
}
开发者ID:borlak,项目名称:umgw,代码行数:58,代码来源:kingdom.c
示例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;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:44,代码来源:mage.c
示例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);
}
开发者ID:MUDOmnibus,项目名称:Rom24b6-for-Cpp,代码行数:44,代码来源:update.c
示例16: do_teach
// Added by SinaC 2001 so, people can teach skills/spells to other
void do_teach( CHAR_DATA *ch, const char *argument ) {
CHAR_DATA *victim;
char arg[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
int sn;
argument = one_argument( argument, arg );
argument = one_argument( argument, arg2 );
if ( IS_NPC(ch)
&& ( IS_AFFECTED( ch, AFF_CHARM )
|| ch->master != NULL
|| ch->leader != NULL ) ) {
send_to_char("You can't teach anything.\n\r", ch );
return;
}
if ( ( victim = get_char_room( ch, arg2 ) ) == NULL ) {
send_to_char( "They aren't here.\n\r", ch );
return;
}
if ( IS_NPC( victim ) ) {
send_to_char("NPC's are dumb, they can't learn anything.\n\r", ch );
return;
}
if ( ( sn = ability_lookup( arg ) ) <= 0 ) {
send_to_char("That skill/spell doesn't exist!\n\r", ch );
return;
}
if ( get_ability( ch, sn ) < 95 ) {
send_to_charf( ch,
"You haven't practiced '%s' enough to teach it.\n\r",
ability_table[sn].name );
return;
}
// get_ability_simple cos' we don't want to take care of victim's level
if ( get_ability_simple( victim, sn ) > 0 ) {
act("$N already knows '$t'.", ch, ability_table[sn].name, victim, TO_CHAR );
return;
}
victim->pcdata->ability_info[sn].learned = 1;
victim->pcdata->ability_info[sn].casting_level = ability_table[sn].nb_casting_level > 0 ? 1 : 0;
victim->pcdata->ability_info[sn].level = URANGE( 1, victim->level, 100 );
act( "$n teachs '$t' to $N.",
ch, ability_table[sn].name, victim, TO_NOTVICT );
act( "You teach '$t' to $N.",
ch, ability_table[sn].name, victim, TO_CHAR );
act( "$N teachs you '$t'.",
victim, ability_table[sn].name, ch, TO_CHAR );
}
开发者ID:SinaC,项目名称:OldMud,代码行数:57,代码来源:ability.C
示例17: spell_farsight
void spell_farsight( int sn, int level, Character *ch, void *vo,int target)
{
if (IS_AFFECTED(ch,AFF_BLIND))
{
send_to_char("Maybe it would help if you could see?\n\r",ch);
return;
}
do_scan(ch,target_name);
}
开发者ID:Swiftam,项目名称:ForgottenLegends,代码行数:10,代码来源:magic2.cpp
示例18: removeBadSpells
/*
* Attempt to remove bad spells (e.g. blind, poison etc.) from 'affected'. Returns TRUE if a
* spell was cast (even if it failed), other wise FALSE.
* @param mob the mobile
*/
static bool removeBadSpells(struct char_data *mob, struct char_data *affected) {
bool doneCasting = FALSE;
int i;
for(i = 0; i < NUM_CURATIVE_SPELLS; i++)
if(!doneCasting && IS_AFFECTED(affected, curative_spell_list[i].affect) && mob_cast(mob, affected, curative_spell_list[i].spell))
doneCasting = TRUE;
return doneCasting;
}
开发者ID:Lundessa,项目名称:raven3,代码行数:15,代码来源:spec_procs.c
示例19: group_gain
void group_gain(struct char_data *ch, struct char_data *victim)
{
char buf[256];
int no_members, share;
struct char_data *k;
struct follow_type *f;
if (!(k=ch->master))
k = ch;
if (IS_AFFECTED(k, AFF_GROUP) &&
(k->in_room == ch->in_room))
no_members = 1;
else
no_members = 0;
for (f=k->followers; f; f=f->next)
if (IS_AFFECTED(f->follower, AFF_GROUP) &&
(f->follower->in_room == ch->in_room))
no_members++;
if (no_members >= 1)
share = MIN(450000/no_members, (GET_EXP(victim)/3)/no_members);
else
share = 0;
if (IS_AFFECTED(k, AFF_GROUP) &&
(k->in_room == ch->in_room)) {
act("You receive your share of experience.", FALSE, k, 0, 0, TO_CHAR);
gain_exp(k, share);
change_alignment(k, victim);
}
for (f=k->followers; f; f=f->next) {
if (IS_AFFECTED(f->follower, AFF_GROUP) &&
(f->follower->in_room == ch->in_room)) {
act("You receive your share of experience.", FALSE, f->follower,0,0,TO_CHAR);
gain_exp(f->follower, share);
change_alignment(f->follower, victim);
}
}
}
开发者ID:MUDOmnibus,项目名称:DikuMUD-Alfa,代码行数:43,代码来源:fight.c
示例20: cast_blindness
void cast_blindness( byte level, struct char_data *ch, char *arg, int type,
struct char_data *tar_ch, struct obj_data *tar_obj )
{
struct affected_type af;
switch (type) {
case SPELL_TYPE_SPELL:
if ( IS_AFFECTED(tar_ch, AFF_BLIND) ){
send_to_char("Nothing seems to happen.\r\n", ch);
return;
}
spell_blindness(level,ch,tar_ch,0);
break;
case SPELL_TYPE_POTION:
if ( IS_AFFECTED(ch, AFF_BLIND) )
return;
spell_blindness(level,ch,ch,0);
break;
case SPELL_TYPE_SCROLL:
if (tar_obj) return;
if (!tar_ch) tar_ch = ch;
if ( IS_AFFECTED(ch, AFF_BLIND) )
return;
spell_blindness(level,ch,ch,0);
break;
case SPELL_TYPE_WAND:
if (tar_obj) return;
if ( IS_AFFECTED(ch, AFF_BLIND) )
return;
spell_blindness(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, AFF_BLIND)))
spell_blindness(level,ch,tar_ch,0);
break;
default :
log("Serious screw-up in blindness!");
break;
}
}
开发者ID:Goldbishop,项目名称:MUD_Source,代码行数:43,代码来源:spells2.c
注:本文中的IS_AFFECTED函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论