本文整理汇总了C++中skill_lookup函数的典型用法代码示例。如果您正苦于以下问题:C++ skill_lookup函数的具体用法?C++ skill_lookup怎么用?C++ skill_lookup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了skill_lookup函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ready_heal_room
/* returns false if mob needed to cast a room affect spell */
bool ready_heal_room( CHAR_DATA * ch )
{
bool ready = TRUE;
if ( ( !IS_SET( ch->in_room->affected_by, ROOM_BV_HEAL_REGEN ) ) && ( ch->hit < ch->max_hit * 75 / 100 ) )
{
if ( ch->mana >= mana_cost( ch, skill_lookup( "healing light" ) ) )
{
ready = FALSE;
do_cast( ch, "'healing light'" );
return ready;
}
}
if ( ( !IS_SET( ch->in_room->affected_by, ROOM_BV_MANA_REGEN ) ) && ( ch->mana < ch->max_mana * 75 / 100 ) )
{
if ( ch->mana >= mana_cost( ch, skill_lookup( "mana flare" ) ) )
{
ready = FALSE;
do_cast( ch, "'mana flare'" );
return ready;
}
}
return ready;
}
开发者ID:Catcheeto,项目名称:ackfuss,代码行数:27,代码来源:act_mob.c
示例2: spell_cure_blindness
void Character::spell_cure_blindness (int sn, int lvl, void *vo)
{
Character *victim = (Character *) vo;
if (!victim->has_affect(skill_lookup("blindness")))
return;
victim->affect_strip (skill_lookup("blindness"));
victim->send_to_char ("Your vision returns!\r\n");
if (this != victim)
send_to_char ("Ok.\r\n");
return;
}
开发者ID:MUDOmnibus,项目名称:Merc22-for-Cpp,代码行数:11,代码来源:spells.cpp
示例3: spell_remove_curse
void Character::spell_remove_curse (int sn, int lvl, void *vo)
{
Character *victim = (Character *) vo;
if (victim->has_affect(skill_lookup("curse"))) {
victim->affect_strip (skill_lookup("curse"));
victim->send_to_char ("You feel better.\r\n");
if (this != victim)
send_to_char ("Ok.\r\n");
}
return;
}
开发者ID:MUDOmnibus,项目名称:Merc22-for-Cpp,代码行数:12,代码来源:spells.cpp
示例4: dragon
/*
* Core procedure for dragons.
*/
bool dragon( CHAR_DATA *ch, char *spell_name )
{
CHAR_DATA *victim;
CHAR_DATA *v_next;
int sn;
if ( ch->position != POS_FIGHTING
&& ch->position != POS_EVASIVE
&& ch->position != POS_DEFENSIVE
&& ch->position != POS_AGGRESSIVE
&& ch->position != POS_BERSERK
)
return FALSE;
for ( victim = ch->in_room->first_person; victim; victim = v_next )
{
v_next = victim->next_in_room;
if ( who_fighting( victim ) == ch && number_bits( 2 ) == 0 )
break;
}
if ( !victim )
return FALSE;
if ( ( sn = skill_lookup( spell_name ) ) < 0 )
return FALSE;
(*skill_table[sn]->spell_fun) ( sn, ch->level, ch, victim );
return TRUE;
}
开发者ID:bkero,项目名称:Smaug,代码行数:32,代码来源:special.c
示例5: group_add
/* use for processing a skill or group for addition */
void group_add( CHAR_DATA *ch, const char *name, bool deduct)
{
int sn = skill_lookup(name);
int gn = group_lookup(name);
if (IS_NPC(ch)) /* NPCs do not have skills */
return;
if (sn != -1)
{
if (ch->pcdata->learned[sn] == 0) /* i.e. not known */
{
ch->pcdata->learned[sn] = 1;
if (deduct)
ch->pcdata->points += skill_table[sn].rating[ch->iclass];
}
return;
}
/* now check groups */
if (gn != -1)
{
if (ch->pcdata->group_known[gn] == FALSE)
{
ch->pcdata->group_known[gn] = TRUE;
if (deduct)
ch->pcdata->points += group_table[gn].rating[ch->iclass];
}
gn_add(ch,gn); /* make sure all skills in the group are known */
}
}
开发者ID:ptrayal,项目名称:dungeonworld,代码行数:32,代码来源:skills.c
示例6: can_see_help
int can_see_help(CHAR_DATA *ch, MYSQL_ROW row, bool fOnlyResult)
{
int sn = skill_lookup(row[2]);
if(!str_cmp(row[2],"olc"))
{
if(ch->pcdata->security > 0)
return TRUE;
else
return FALSE;
}
if(atoi(row[3]) > ch->level && ch->level > 0)
return FALSE;
if(atoi(row[3]) == 51 && (!str_cmp(row[2],"heroimm") && !IS_HEROIMM(ch)))
return FALSE;
if(sn > 1 && get_skill(ch,sn) < 1)
{
send_to_char("Viewing that helpfile requires a skill you do not have.\n\r",ch);
return FALSE;
}
return TRUE;
}
开发者ID:rezalas,项目名称:riftshadow,代码行数:25,代码来源:help.c
示例7: do_chaosblast
void do_chaosblast(CHAR_DATA *ch, char *argument) {
CHAR_DATA *victim;
char arg [MAX_INPUT_LENGTH];
int sn;
int level;
int spelltype;
argument = one_argument( argument, arg );
if (IS_NPC(ch)) return;
if (!IS_CLASS(ch, CLASS_DROW) || (!IS_SET(ch->special,
SPC_DROW_MAG) && ch->generation > 2)) {
return;}
if ( ( victim = get_char_room( ch, arg ) ) == NULL )
if ((victim = ch->fighting) == NULL)
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if (ch->mana < 750) {
send_to_char("You don't have enough mana.\n\r", ch);
return;}
if ( ( sn = skill_lookup( "chaos blast" ) ) < 0 ) return;
spelltype = skill_table[sn].target;
level = ch->spl[spelltype]/3;
act("You concentrate your power on $N.",ch,NULL,victim,TO_CHAR);
act("$n concentrates $s power on you.",ch,NULL,victim,TO_VICT);
(*skill_table[sn].spell_fun) ( sn, level, ch, victim );
WAIT_STATE( ch, 12 );
ch->mana = ch->mana - 750;
return;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:35,代码来源:drow.c
示例8: do_harmony
void do_harmony( CHAR_DATA *ch, char *argument )
{
CHAR_DATA *victim;
char arg[MAX_INPUT_LENGTH];
int sn, level;
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_HARMONY] < 5)
{
send_to_char("Your not in contact with your inner harmonies.\n\r",ch);
return;
}
if ((victim = get_char_room(ch, arg)) == NULL)
{
send_to_char("They are not here.\n\r", ch);
return;
}
level = number_range(100,200);
sn = skill_lookup("spirit kiss");
if (sn > 0) (*skill_table[sn].spell_fun) (sn,level,ch,victim);
WAIT_STATE(ch,12);
return;
}
开发者ID:smthbh,项目名称:dystopia-mud,代码行数:30,代码来源:angel.c
示例9: group_add
/* use for processing a skill or group for addition */
void group_add( CHAR_DATA *ch, const char *name, bool deduct)
{
int sn,gn;
if (IS_NPC(ch)) /* NPCs do not have skills */
return;
sn = skill_lookup(name);
if (sn != -1 && sn != gsn_gladiator_skill && sn != gsn_duelist_skill &&
sn != gsn_barbarian_skill && sn != gsn_dragoon_skill && sn != gsn_skirmisher_skill &&
sn != gsn_tactician_skill)
{
if (ch->pcdata->learned[sn] == 0)
{
ch->pcdata->learned[sn] = 1;
}
return;
}
/* now check groups */
gn = group_lookup(name);
if (gn != -1)
{
if (ch->pcdata->group_known[gn] == FALSE)
{
ch->pcdata->group_known[gn] = TRUE;
}
gn_add(ch,gn); /* make sure all skills in the group are known */
}
}
开发者ID:rezalas,项目名称:riftshadow,代码行数:33,代码来源:skills.c
示例10: do_new_prereq
void do_new_prereq (CHAR_DATA *ch, char *argy)
{
SPELL_DATA *spell;
int i;
DEFINE_COMMAND ("zprerequisite", do_new_prereq, POSITION_DEAD, 0, LOG_NORMAL, "Allows you to see prerequisites to the skill-big tree format.")
if (IS_MOB (ch))
return;
for (i = 0; i < 100; i ++)
vert_line[i] = FALSE;
for (i = 0; i < SKILL_COUNT; i++)
used_spell[i] = FALSE;
if (argy[0] == '\0' || (spell = skill_lookup (argy, -1)) == NULL)
{
send_to_char ("Syntax: Prereq <skill/spell/prof name>\n\r", ch);
return;
}
xprereq(ch, spell);
/* Now clean up our static bool */
return;
}
开发者ID:kalendae,项目名称:emlenmud-for-centos,代码行数:27,代码来源:skill.c
示例11: how_good
char *
how_good (CHAR_DATA *ch, int gsn)
{
static char bf[256];
int i;
int learned = 0;
SPELL_DATA *spl;
bf[0] = '\0';
if (IS_MOB(ch))
{
strcpy (bf, "No Mobs Plz");
return bf;
}
if ((spl = skill_lookup(NULL, gsn)) == NULL)
{
strcpy (bf, "No spell!");
return (bf);
}
else
{
if (learned != 100)
learned = ch->pcdata->learned[gsn];
for (i = 0; i < 20; i++)
{
if (pow.learned[i] != NULL && learned >= pow.low_range[i] && learned <= pow.high_range[i])
{
strcpy (bf, pow.learned[i]);
return (bf);
}
}
}
return bf;
}
开发者ID:kalendae,项目名称:emlenmud-for-centos,代码行数:34,代码来源:skill.c
示例12: power_up_mob
void power_up_mob( CHAR_DATA * ch )
{
int num_percent;
/*
* you can only have one cloak spell
*/
if ( !IS_AFFECTED( ch, AFF_CLOAK_ABSORPTION )
&& !IS_AFFECTED( ch, AFF_CLOAK_REFLECTION ) && !IS_AFFECTED( ch, AFF_CLOAK_FLAMING ) )
{
num_percent = number_percent( );
if ( num_percent > 75 )
{
if ( ch->mana >= mana_cost( ch, skill_lookup( "cloak:flaming" ) ) )
do_cast( ch, "'cloak:flaming'" );
return;
}
if ( num_percent > 50 )
{
if ( ch->mana >= mana_cost( ch, skill_lookup( "cloak:reflection" ) ) )
do_cast( ch, "cloak:reflection" );
return;
}
if ( num_percent > 25 )
{
if ( ch->mana >= mana_cost( ch, skill_lookup( "cloak:absorption" ) ) )
do_cast( ch, "cloak:absorption" );
return;
}
}
/*
* usually i only have mobs do one thing per round but what they hell
* * let the kids have their fun :)
*/
if ( !IS_AFFECTED( ch, AFF_SANCTUARY ) )
if ( ch->mana >= mana_cost( ch, skill_lookup( "sanctuary" ) ) )
do_cast( ch, "sanctuary" );
if ( !IS_AFFECTED( ch, AFF_PROTECT ) )
if ( ch->mana >= mana_cost( ch, skill_lookup( "protection" ) ) )
do_cast( ch, "protection" );
if ( !IS_AFFECTED( ch, skill_lookup( "bless" ) ) )
if ( ch->mana >= mana_cost( ch, skill_lookup( "bless" ) ) )
do_cast( ch, "bless" );
if ( !IS_AFFECTED( ch, skill_lookup( "stone skin" ) ) )
if ( ch->mana >= mana_cost( ch, skill_lookup( "stone skin" ) ) )
do_cast( ch, "stone" );
return;
}
开发者ID:Catcheeto,项目名称:ackfuss,代码行数:52,代码来源:act_mob.c
示例13: check_style_improve
/* check improve for styles */
void check_style_improve( CHAR_DATA *ch, int style, int multiplier )
{
int chance,sn,skill,gn,i;
char test[MSL];
if(style == 0 || style >= 100)
return;
sn = skill_lookup( style_table[style].name );
chance = 10 * int_app[get_curr_stat(ch,STAT_INT)].learn;
chance /= ( multiplier
* 4);
chance += ch->level * 2;
if(number_range(1,1000) > chance)
return;
ch->pcdata->learned[sn]++;
if(ch->pcdata->learned[sn] > 100)
ch->pcdata->learned[sn] = 100;
/* check for newly learned style skills */
for(i=0; i<MAX_STYLE_SKILL; i++)
{
skill = skill_lookup(style_percent[i].name);
if(skill > 0)
{
gn = gn_skill_lookup(skill);
if(gn > 1)
{
if(!str_prefix(group_table[gn].name,style_table[style].name))
{
if(ch->pcdata->learned[sn] == style_percent[i].percent)
{
sprintf(test,"%sYou make a breakthrough in your understanding of the %s style!%s",
get_char_color(ch, "lightyellow"), style_table[style].name, END_COLOR(ch));
act(test,ch,0,0,TO_CHAR);
sprintf(test,"You feel ready to learn the %s skill.",style_percent[i].name);
act(test,ch,0,0,TO_CHAR);
}
}
}
}
}
}
开发者ID:rezalas,项目名称:riftshadow,代码行数:48,代码来源:skills.c
示例14: handle_reaction
void handle_reaction(CHAR_DATA *ch, CHAR_DATA *victim)
{
if(skill_lookup("counter") == victim->reaction_num)
{
if(number_range(1,100) < 60)
f_multi_hit( victim, ch, TYPE_UNDEFINED );
}
}
开发者ID:bucketmouse,项目名称:fft-mud,代码行数:8,代码来源:fft_core.c
示例15: spec_cast_cleric
bool spec_cast_cleric( CHAR_DATA *ch )
{
CHAR_DATA *victim;
CHAR_DATA *v_next;
char *spell;
int sn;
summon_if_hating( ch );
if ( ch->position != POS_FIGHTING
&& ch->position != POS_EVASIVE
&& ch->position != POS_DEFENSIVE
&& ch->position != POS_AGGRESSIVE
&& ch->position != POS_BERSERK
)
return FALSE;
for ( victim = ch->in_room->first_person; victim; victim = v_next )
{
v_next = victim->next_in_room;
if ( who_fighting( victim ) == ch && number_bits( 2 ) == 0 )
break;
}
if ( !victim || victim == ch )
return FALSE;
for ( ;; )
{
int min_level;
switch ( number_bits( 4 ) )
{
case 0: min_level = 0; spell = "cause light"; break;
case 1: min_level = 3; spell = "cause serious"; break;
case 2: min_level = 6; spell = "earthquake"; break;
case 3: min_level = 7; spell = "blindness"; break;
case 4: min_level = 9; spell = "cause critical"; break;
case 5: min_level = 10; spell = "dispel evil"; break;
case 6: min_level = 12; spell = "curse"; break;
case 7: min_level = 13; spell = "flamestrike"; break;
case 8:
case 9:
case 10: min_level = 15; spell = "harm"; break;
default: min_level = 16; spell = "dispel magic"; break;
}
if ( ch->level >= min_level )
break;
}
if ( ( sn = skill_lookup( spell ) ) < 0 )
return FALSE;
(*skill_table[sn]->spell_fun) ( sn, ch->level, ch, victim );
return TRUE;
}
开发者ID:bkero,项目名称:Smaug,代码行数:56,代码来源:special.c
示例16: assemble_sequence
void assemble_sequence(struct list *sequence, char *description) {
int lskill = -1, rskill = -1;
string_to_lower_case(description);
char *tok = strtok(description, "/");
while (tok) {
if (!strcmp(tok, "switch")) {
action_t a = { switch_slot, 0 };
list_add(sequence, &a);
} else {
char *separator = strchr(tok, ':');
if (separator) {
*separator = '\0';
char *side = tok;
char *s_skill = ++separator;
int skill = skill_lookup(s_skill);
if (skill >= 0) {
if (!strcmp(side, "left") && skill >= 0) {
if (skill != lskill) {
action_t a = { swap_left, skill };
list_add(sequence, &a);
lskill = skill;
}
action_t a = { cast_left, 0 };
list_add(sequence, &a);
} else if (!strcmp(side, "right") && skill >= 0) {
if (skill != rskill) {
action_t a = { swap_right, skill };
list_add(sequence, &a);
rskill = skill;
}
action_t a = { cast_right, 0 };
list_add(sequence, &a);
} else if (!strcmp(side, "self") && skill >= 0) {
if (skill != rskill) {
action_t a = { swap_right, skill };
list_add(sequence, &a);
rskill = skill;
}
action_t a = { cast_self, 0 };
list_add(sequence, &a);
}
}
}
}
tok = strtok(NULL, "/");
}
}
开发者ID:Bigorneau,项目名称:motoko,代码行数:55,代码来源:d2gs_pes.c
示例17: spec_cast_mage
bool spec_cast_mage( CHAR_DATA *ch )
{
CHAR_DATA *victim;
CHAR_DATA *v_next;
char *spell;
int sn;
summon_if_hating( ch );
if ( ch->position != POS_FIGHTING
&& ch->position != POS_EVASIVE
&& ch->position != POS_DEFENSIVE
&& ch->position != POS_AGGRESSIVE
&& ch->position != POS_BERSERK
)
return FALSE;
for ( victim = ch->in_room->first_person; victim; victim = v_next )
{
v_next = victim->next_in_room;
if ( who_fighting( victim ) && number_bits( 2 ) == 0 )
break;
}
if ( !victim || victim == ch )
return FALSE;
for ( ;; )
{
int min_level;
switch ( number_bits( 4 ) )
{
case 0: min_level = 0; spell = "black hand"; break;
case 1: min_level = 3; spell = "chill touch"; break;
case 2: min_level = 7; spell = "weaken"; break;
case 3: min_level = 8; spell = "galvanic whip"; break;
case 4: min_level = 11; spell = "colour spray"; break;
case 5: min_level = 12; spell = "weaken"; break;
case 6: min_level = 13; spell = "energy drain"; break;
case 7: min_level = 14; spell = "spectral furor"; break;
case 8:
case 9: min_level = 15; spell = "fireball"; break;
default: min_level = 20; spell = "acid blast"; break;
}
if ( ch->level >= min_level )
break;
}
if ( ( sn = skill_lookup( spell ) ) < 0 )
return FALSE;
(*skill_table[sn]->spell_fun) ( sn, ch->level, ch, victim );
return TRUE;
}
开发者ID:bkero,项目名称:Smaug,代码行数:55,代码来源:special.c
示例18: objfun_cast_fight
void
objfun_cast_fight(OBJ_DATA *obj, CHAR_DATA *keeper)
{
int sn;
CHAR_DATA *victim;
int min_lev;
char *spell = "";
if (keeper == NULL || (keeper->fighting == NULL)
|| (obj->item_type != ITEM_WEAPON))
return;
if ((get_eq_char(keeper, WEAR_WIELD) != obj)
&& (get_eq_char(keeper, WEAR_WIELD_2) != obj))
return; /* Must be wielded to work */
for (victim = keeper->in_room->first_person; victim != NULL; victim = victim->next_in_room)
if (victim->fighting == keeper && number_bits(2) == 0)
break;
if ((victim == NULL)
|| (victim->is_free != FALSE))
return;
switch (number_range(0, 5)) {
case 0:
min_lev = 5;
spell = "magic missile";
break;
case 1:
min_lev = 7;
spell = "colour spray";
break;
case 2:
min_lev = 8;
spell = "chill touch";
break;
case 3:
min_lev = 30;
spell = "fireball";
break;
case 4:
min_lev = 55;
spell = "flamestrike";
break;
case 5:
min_lev = 30;
spell = "lightning bolt";
break;
}
if ((sn = skill_lookup(spell)) < 0)
return;
act("$p glows brightly at $n!", victim, obj, NULL, TO_ROOM);
act("$p glows brightly at you!", victim, obj, NULL, TO_CHAR);
obj_cast_spell(sn, obj->level, keeper, victim, obj);
return;
}
开发者ID:bramblevine,项目名称:adesa,代码行数:54,代码来源:obj_fun.c
示例19: do_mpcast
void do_mpcast( CHAR_DATA *ch, char *argument )
{
CHAR_DATA *vch;
OBJ_DATA *obj;
void *victim = NULL;
char spell[ MAX_INPUT_LENGTH ],
target[ MAX_INPUT_LENGTH ];
int sn;
argument = one_argument( argument, spell );
one_argument( argument, target );
if ( spell[0] == '\0' )
{
bug( "MpCast - Bad syntax from vnum %d.",
IS_NPC(ch) ? ch->pIndexData->vnum : 0 );
return;
}
if ( ( sn = skill_lookup( spell ) ) < 0 )
{
bug( "MpCast - No such spell from vnum %d.",
IS_NPC(ch) ? ch->pIndexData->vnum : 0 );
return;
}
vch = get_char_room( ch, target );
obj = get_obj_here( ch, target );
switch ( skill_table[sn].target )
{
default: return;
case TAR_IGNORE:
break;
case TAR_CHAR_OFFENSIVE:
if ( vch == NULL || vch == ch )
return;
victim = ( void * ) vch;
break;
case TAR_CHAR_DEFENSIVE:
victim = vch == NULL ? ( void *) ch : (void *) vch; break;
case TAR_CHAR_SELF:
victim = ( void *) ch; break;
case TAR_OBJ_CHAR_DEF:
case TAR_OBJ_CHAR_OFF:
case TAR_OBJ_INV:
if ( obj == NULL )
return;
victim = ( void * ) obj;
}
(*skill_table[sn].spell_fun)( sn, ch->level, ch, victim,
skill_table[sn].target );
return;
}
开发者ID:YourCyborg,项目名称:Sun-RPI,代码行数:52,代码来源:mob_cmds.c
示例20: spec_cast_undead
bool spec_cast_undead( CHAR_DATA *ch )
{
CHAR_DATA *victim;
CHAR_DATA *v_next;
char *spell;
int sn;
summon_if_hating( ch );
if ( ch->position != POS_FIGHTING
&& ch->position != POS_EVASIVE
&& ch->position != POS_DEFENSIVE
&& ch->position != POS_AGGRESSIVE
&& ch->position != POS_BERSERK
)
return FALSE;
for ( victim = ch->in_room->first_person; victim; victim = v_next )
{
v_next = victim->next_in_room;
if ( who_fighting( victim ) == ch && number_bits( 2 ) == 0 )
break;
}
if ( !victim || victim == ch )
return FALSE;
for ( ;; )
{
int min_level;
switch ( number_bits( 4 ) )
{
case 0: min_level = 0; spell = "chill touch"; break;
case 1: min_level = 11; spell = "weaken"; break;
case 2: min_level = 12; spell = "curse"; break;
case 3: min_level = 13; spell = "blindness"; break;
case 4: min_level = 14; spell = "poison"; break;
case 5: min_level = 15; spell = "energy drain"; break;
case 6: min_level = 18; spell = "harm"; break;
default: min_level = 40; spell = "gate"; break;
}
if ( ch->level >= min_level )
break;
}
if ( ( sn = skill_lookup( spell ) ) < 0 )
return FALSE;
(*skill_table[sn]->spell_fun) ( sn, ch->level, ch, victim );
return TRUE;
}
开发者ID:bkero,项目名称:Smaug,代码行数:52,代码来源:special.c
注:本文中的skill_lookup函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论