本文整理汇总了C++中object::add_exp方法的典型用法代码示例。如果您正苦于以下问题:C++ object::add_exp方法的具体用法?C++ object::add_exp怎么用?C++ object::add_exp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::add_exp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add_limb
void add_limb(object ob, string limb, object tp, int healing) {
object body;
string *all, *wieldin, minor;
int i;
body = new(MONSTER);
body->move("/d/nopk/standard/void.c");
body->set_race(ob->query_race());
body->set_body_type(ob->query_race());
all = body->query_limbs();
wieldin = body->query_wielding_limbs();
if(member_array(limb, all) == -1) { write("Not a valid limb!"); body->remove(); return; }
i = sizeof(all);
while(i--) {
if(body->query_reference(all[i]) == limb) {
if(member_array(all[i], ob->query_limbs()) == -1) {
write("You'll need to replace the "+all[i]+" first!");
body->remove();
return;
}
minor = "YES";
}
}
if(!minor) {
if(body->query_reference(limb) != "")
minor = body->query_reference(limb);
else
minor = "NO";
}
if(minor == "NO")
ob->add_limb(limb, "", ob->query_max_hp()/3, 0, 0);
else if(minor == "YES")
ob->add_limb(limb, "", ob->query_max_hp()/4, 0, 0);
else
ob->add_limb(limb, minor, ob->query_max_hp()/3, 0, 0);
if(member_array(limb, wieldin) != -1)
ob->add_wielding_limb(limb);
if(tp==ob) {
write("Your "+limb+" regenerates through prayer!");
say(tp->query_cap_name()+"'s "+limb+" regenerates through prayer!", tp);
tp->add_skill_points("healing", random(healing/2)*2);
tp->add_exp(random(healing/2)*2);
}
else {
write("You regenerate "+ob->query_cap_name()+"'s "+limb+" through prayer!\n");
tell_object(ob, tp->query_cap_name()+" regenerates your "+limb+" through prayer!\n");
tell_room(environment(tp), tp->query_cap_name()+" says a prayer that regenerates "+ob->query_cap_name()+"'s "+limb+".\n", ({ tp, ob }) );
tp->add_skill_points("healing", healing);
tp->add_exp(healing);
tp->add_alignment(healing);
}