本文整理汇总了C++中object::GetShort方法的典型用法代码示例。如果您正苦于以下问题:C++ object::GetShort方法的具体用法?C++ object::GetShort怎么用?C++ object::GetShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::GetShort方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CanReceive
/* NO_NPC's allowed in room except room inventory*/
int CanReceive(object ob) {
if(ob && (!inherits(LIB_NPC, ob) | !strcmp("a small stick", ob->GetShort()))){
return 1;
}
else
return 0;
}
示例2: CanReceive
/* NO_NPC's allowed in room except Mayor */
int CanReceive(object ob) {
if(ob && !inherits(LIB_NPC, ob) | !strcmp("the Mayor", ob->GetShort())){
return 1;
}
else
return 0;
}
示例3: CheckPoison
void CheckPoison(object ob){
int chance;
object env = environment(this_object());
if(this_object()->GetInCombat()){
ob = this_object()->GetCurrentEnemy();
chance = random(32)-this_object()->GetLevel();
if(chance == 0){
tell_room(env, "The Snake sinks its fangs into "+ob->GetShort()+"!", ({this_object(), ob}) );
示例4: do_dest_obj
mixed do_dest_obj(object ob){
string name;
if(base_name(ob) == LIB_DUMMY) {
write(capitalize(ob->GetShort())+" isn't a normal destable item. It remains in place.");
return 1;
}
if(archp(ob) && !archp(this_player())){
write("You can't dest an admin.");
tell_player(ob, this_player()->GetName()+" just tried to dest you.");
return 1;
}
if(!creatorp(this_player()) && strsrch(base_name(ob), homedir(this_player()))){
write("As a builder, you can only dest items that you created.");
return 1;
}
if(!living(ob)) name = ob->GetShort();
else name = ob->GetName();
write("You dest "+name+".");
say( this_player()->GetMessage( "dest", ob ) );
ob->eventDestruct();
if(ob) destruct(ob);
return 1;
}
示例5: do_throw_obj_word_obj
mixed do_throw_obj_word_obj(object what, string word, object where) {
object enemy;
if( where && living(where) && (int)what->GetClass() > 1 ) {
enemy = where;
}
else {
enemy = 0;
}
if( this_player()->GetInCombat() || enemy ) {
this_player()->eventPrint("You prepare to throw " +
(string)what->GetShort() + ".");
this_player()->SetAttack(enemy, (: eventThrow, this_player(), what,
where :), (enemy ? ROUND_WEAPON :
ROUND_OTHER));
return 1;
}
示例6: hitCallback
int hitCallback(object who, object agent, int x, class MagicProtection cl) {
string str;
object Caster = cl->caster;
if( (int)agent->GetUndead() ) return 0;
str = (string)agent->GetName() || (string)agent->GetShort();
if( who == Caster ) {
who->eventTrainSkill("magic defense",cl->args,x,1);
}
else if( Caster && playerp(who) && Caster != who ) {
Caster->eventTrainSkill("magic defense",cl->args,0,1);
}
send_messages("", "The %^YELLOW%^magical shield%^RESET%^ around "
"$agent_name wavers as $target_name strikes it.",
who, agent, environment(who), 0);
return x;
}
示例7: do_weigh_obj
mixed do_weigh_obj(object obj) {
string name, verb = "heft";
if(!obj) return "You must weigh something.";
/* Check for presence of objects */
name = obj->GetShort();
if( environment(obj) != this_player() ) {
this_player()->eventPrint("You do not have "+name+".");
return 1;
}
if(obj->GetWorn()) verb = "get a feel for";
this_player()->eventPrint("You stare intently at " + name + " and " +
verb + " it.");
environment(this_player())->eventPrint( this_player()->GetName() +
" looks at " + name + ".", this_player());
if( this_player()->GetInCombat() )
this_player()->SetAttack(0,
(: eventWeigh, this_player(), obj :),
ROUND_OTHER);
else eventWeigh(this_player(), obj);