本文整理汇总了C++中object::GetSkillLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ object::GetSkillLevel方法的具体用法?C++ object::GetSkillLevel怎么用?C++ object::GetSkillLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::GetSkillLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventCast
int eventCast(object who, int level, mixed limbs, object array targets) {
object target = targets[0];
int feedback,health,magic,stamina,tot;
if(!spell::eventCast(who,level,targets)) return 0;
if( target == who ) {
//who->eventPrint("You can't cast heal on yourself!");
//return 0;
}
else {
int hp = who->GetSkillLevel("healing");
int stam = who->GetSkillLevel("faith");
send_messages("", "$agent_possessive_noun spell partially heals "
"$target_name.",who,
target, environment(target));
health = target->GetMaxHealthPoints()-target->GetHealthPoints();
stamina = target->GetMaxStaminaPoints()-target->GetStaminaPoints();
if(health) target->AddHP(((hp > health) ? health : hp));
if(stamina)
target->AddStaminaPoints(((stam > stamina) ? stamina : stam));
tot = hp+stam;
if(tot)
who->eventTrainSkill("healing",0,0,1,tot);
magic = who->GetMagicPoints();
magic = magic - tot;
if(magic < 0) feedback = tot - magic;
who->AddMagicPoints(-tot);
if(feedback){
write("Your spell overreached your mana reserves! You suffer "+
"from a feedback overload!");
who->eventReceiveDamage(who, KARMA, tot, 1);
}
}
return 1;
}
示例2: eventCast
int eventCast(object who, int level, string race, object array targets) {
class MagicProtection protection;
object target = targets[0];
int prot_level, skill, wis;
wis = who->GetStatLevel("wisdom");
skill = who->GetSkillLevel("magic defense");
prot_level = level;
prot_level *= (random(skill/10) + 1);
prot_level += random(wis/2);
protection = new(class MagicProtection);
protection->bits = BLUNT | BLADE | KNIFE | MAGIC;
protection->caster = who;
protection->absorb = 2*prot_level;
protection->args = level;
protection->hit = (: hitCallback :);
protection->end = (: endCallback :);
target->AddMagicProtection(protection);
if( target == who ) {
send_messages("", "A %^BOLD%^CYAN%^translucent magical shield%^RESET%^ "
"suddenly appears around $agent_possessive_noun body.", who, 0,
environment(target), 0);
}
else {
send_messages("", "A %^BOLD%^CYAN%^translucent magical shield%^RESET%^ "
"suddenly appears around $target_possessive_noun body.", who,
target, environment(target), 0);
}
return 1;
}
示例3: eventBackstab
int eventBackstab(object backstabber, object target) {
object env;
float tmp;
int suprise;
object *weapons;
int numberOfWeapons;
int numberOfStabs;
int i;
if(!backstabber || !(env = environment(backstabber))) return 0;
if(!target || !present(target, env)) {
backstabber->eventPrint("Your hapless victim is no longer present.");
return 1;
}
tmp = backstabber->GetSkillLevel("stealth")*1.5;
tmp += backstabber->GetStatLevel("charisma")/2.0;
tmp += backstabber->GetStatLevel("luck")/3.0;
tmp += backstabber->GetMobility()/3.0;
tmp -= target->GetStatLevel("luck")/3.0;
tmp -= target->GetStatLevel("wisdom")/3.0;
tmp -= target->GetMobility()/5.0;
tmp *= 1.0;
if(tmp < 1.0) tmp = 1.0;
suprise = to_int(tmp);
backstabber->AddSkillPoints("stealth", to_int(suprise * 3.0));
backstabber->AddStaminaPoints(-(5 + random(5)));
moral_act(backstabber, target, -30);
if(suprise < random(100) || !present(target, environment(backstabber))) {
backstabber->eventPrint("%^RED%^" + target->GetName()
+ " evades your poorly executed backstab.%^RESET%^");
target->eventPrint("%^RED%^You easily dodge " + possessive_noun(backstabber)
+ " attempted backstab.%^RESET%^");
environment(backstabber)->eventPrint("%^RED%^" + target->GetName()
+ " dodges " + possessive_noun(backstabber) + " attempted backstab.%^RESET%^",
({backstabber, target}));