这篇教程C++ GET_POS函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GET_POS函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_POS函数的具体用法?C++ GET_POS怎么用?C++ GET_POS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GET_POS函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: MakeSoundvoid MakeSound(int pulse){ struct char_data *ch;/* objects */ ForAllObjects(NULL,pulse,ObjNoise);/* mobiles */ for (ch = character_list; ch; ch = ch->next) { if (IS_NPC(ch) && (ch->player.sounds) && (number(0,5)==0)) { if (ch->specials.default_pos > POSITION_SLEEPING) { if (GET_POS(ch) > POSITION_SLEEPING) { /* Make the sound; */ MakeNoise(ch->in_room, ch->player.sounds, ch->player.distant_snds); } else if (GET_POS(ch) == POSITION_SLEEPING) { char buf[MAX_STRING_LENGTH]; /* snore */ sprintf(buf, "%s snores loudly./n", ch->player.short_descr); MakeNoise(ch->in_room, buf, "You hear a loud snore nearby./n"); } } else if (GET_POS(ch) == ch->specials.default_pos) { /* Make the sound */ MakeNoise(ch->in_room, ch->player.sounds, ch->player.distant_snds); } } }}
开发者ID:prealms1993,项目名称:PerilousRealms1993,代码行数:29,
示例2: cast_spellintcast_spell (struct char_data *ch, struct char_data *tch, struct obj_data *tobj, int spellnum){ if (spellnum < 0 || spellnum > TOP_SPELL_DEFINE) { log ("SYSERR: cast_spell trying to call spellnum %d/%d./n", spellnum, TOP_SPELL_DEFINE); return (0); } if (GET_POS (ch) < SINFO.min_position) { switch (GET_POS (ch)) { case POS_SLEEPING: send_to_char ("You dream about great magical powers./r/n", ch); break; case POS_RESTING: send_to_char ("You cannot concentrate while resting./r/n", ch); break; case POS_SITTING: send_to_char ("You can't do this sitting!/r/n", ch); break; case POS_FIGHTING: send_to_char ("Impossible! You can't concentrate enough!/r/n", ch); break; default: send_to_char ("You can't do much of anything like this!/r/n", ch); break; } return (0); } if (AFF_FLAGGED (ch, AFF_CHARM) && (ch->master == tch)) { send_to_char ("You are afraid you might hurt your master!/r/n", ch); return (0); } if ((tch != ch) && IS_SET (SINFO.targets, TAR_SELF_ONLY)) { send_to_char ("You can only cast this spell upon yourself!/r/n", ch); return (0); } if ((tch == ch) && IS_SET (SINFO.targets, TAR_NOT_SELF)) { send_to_char ("You cannot cast this spell upon yourself!/r/n", ch); return (0); } if (IS_SET (SINFO.routines, MAG_GROUPS) && !AFF_FLAGGED (ch, AFF_GROUP)) { send_to_char ("You can't cast this spell if you're not in a group!/r/n", ch); return (0); } send_to_char (OK, ch); say_spell (ch, spellnum, tch, tobj); return (call_magic (ch, tch, tobj, spellnum, GET_LEVEL (ch), CAST_SPELL));}
开发者ID:adept2tech,项目名称:Mclandia,代码行数:60,
示例3: pulse_heal/* nb, also mess up anyone affected by AFF_POISON */void pulse_heal(void){ CharData *ch; int gain = number(18,24); for (ch = character_list; ch; ch = ch->next) { if(ch->in_room == NOWHERE) continue; if(!(pvpFactor() > 1)) { if( GET_POS(ch) == POS_INCAP ) damage(ch, ch, 1, TYPE_SUFFERING); else if( GET_POS(ch) == POS_MORTALLYW ) damage(ch, ch, 2, TYPE_SUFFERING); else if( GET_POS(ch) == POS_DEAD) { if(IN_ARENA(ch) || IN_QUEST_FIELD(ch) || ZONE_FLAGGED(world[ch->in_room].zone, ZONE_ARENA) || ZONE_FLAGGED(world[ch->in_room].zone, ZONE_SLEEPTAG)) // If they're dying in the arena, they eventually get better (or killed by someone) { GET_HIT(ch) = number(GET_HIT(ch), 1); sendChar(ch, "You slowly recover./r/n"); update_pos(ch); } else { raw_kill(ch, NULL); continue; } } } if (IS_AFFECTED(ch, AFF_PULSE_HIT)) if (GET_HIT(ch) < GET_MAX_HIT(ch)) GET_HIT(ch) += gain; if (IS_AFFECTED(ch, AFF_PULSE_MANA)) if (GET_MANA(ch) < GET_MAX_MANA(ch)) GET_MANA(ch) += gain; if (IS_AFFECTED(ch, AFF_POISON)) doPoison(ch); if (IS_AFFECTED(ch, AFF_DISEASE)) doDisease(ch); if (affected_by_spell(ch, SKILL_INVIGORATE)) doInvigorate(ch); if (IS_BOUNTY_HUNTER(ch) && GET_ADVANCE_LEVEL(ch) >= 1 && IS_AFFECTED(ch, AFF_HIDE)) GET_MOVE(ch) = MIN(GET_MOVE(ch) + 3*gain, GET_MAX_MOVE(ch)); if (IS_PRESTIDIGITATOR(ch)) GET_MANA(ch) = MIN(GET_MANA(ch) + GET_ADVANCE_LEVEL(ch) * 2, GET_MAX_MANA(ch)); if (affected_by_spell(ch, SPELL_HIPPOCRATIC_OATH)) GET_MANA(ch) = MIN(GET_MANA(ch) + 25, GET_MAX_MANA(ch)); if (affected_by_spell(ch, SKILL_PET_MEND)) GET_HIT(ch) = MIN(GET_HIT(ch) * 115 / 100, GET_MAX_HIT(ch)); if (IS_HOLY_PRIEST(ch)) GET_MANA(ch) = MIN(GET_MANA(ch) + 10 + 2*GET_ADVANCE_LEVEL(ch), GET_MAX_MANA(ch)); /* The room might be poisoned! (Or later, otherwise dangerous) */ if (ch->in_room != NOWHERE) { if (ROOM_FLAGGED(ch->in_room, ROOM_POISONED)) { if (!mag_savingthrow(ch, SAVING_SPELL)) { act("$n chokes and gags!", TRUE, ch, 0, 0, TO_ROOM); act("You choke and gag!", TRUE, ch, 0, 0, TO_CHAR); add_affect( ch, ch, SPELL_POISON, 30, APPLY_NONE, 0, 5 TICKS, AFF_POISON, FALSE, FALSE, FALSE, FALSE); } } } if(IS_DEFENDER(ch) && !affected_by_spell(ch, SKILL_DEFENDER_HEALTH)) add_affect(ch, ch, SKILL_DEFENDER_HEALTH, GET_LEVEL(ch), APPLY_HIT, GET_ADVANCE_LEVEL(ch)*5, -1, FALSE, FALSE, FALSE, FALSE, FALSE); }}
开发者ID:Lundessa,项目名称:NewRavenVM,代码行数:60,
|