本文整理汇总了C++中object::GetLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ object::GetLevel方法的具体用法?C++ object::GetLevel怎么用?C++ object::GetLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::GetLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SpellCombat
int SpellCombat(object ob){
object env = environment(ob);
object array *targets;
int chance1, chance2, level;
chance1 = random(2);
level = ob->GetLevel();
if(ob && (!ob->GetInCombat() || !ob->GetCurrentEnemy())) return 0;
targets = filter(get_livings(env), (: !$1->GetInCombat() && !$1->GetSleeping() :));
tell_room(env, "\nsizeof(targets) is "+sizeof(targets)+"\n", ({ ob }));
示例2: CanReceive
int CanReceive(object ob){
int ret, level;
level = ob->GetLevel();
if((creatorp(ob) && !archp(ob)) || (userp(ob) && level > 20)){
write("Sorry. This area is for normal players.");
return 0;
}
ret = room::CanReceive(ob);
if(ret){
object *inv = deep_inventory(ob);
foreach(object element in inv){
string name = base_name(element);
level = element->GetLevel();
if(creatorp(element) && !archp(element)
|| (userp(element) && level > 20)){
write("Sorry. This is a player-only area.");
return 0;
}
if(!strsrch(name,"/realms/") || !strsrch(name,"/open/")){
element->eventMove(ROOM_FURNACE);
}
}
}
示例3: ChangeLevel
if(!(i % mod)) ret++;
}
if(neg){
ret = ret - (ret*2);
}
return ret;
}
varargs int ChangeLevel(int i){
mapping skills, stats, moduli = ([]);
int current_level, desired_level;
object subject = this_object();
current_level = subject->GetLevel();
if(!i || i < 1)
desired_level = current_level + 1;
else desired_level = i;
for(i = 1; i < 5; i++){
moduli[i] = collect_moduli(i, ({ current_level, desired_level }) );
}
skills = subject->GetSkillsMap();
stats = subject->GetStatsMap();
foreach(mixed key, mixed val in skills){
if(skills[key]["class"] > 3) skills[key]["class"] = 4;
subject->SetSkill(key,