本文整理汇总了C++中object::GetCapName方法的典型用法代码示例。如果您正苦于以下问题:C++ object::GetCapName方法的具体用法?C++ object::GetCapName怎么用?C++ object::GetCapName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::GetCapName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_resurrect_obj
mixed do_resurrect_obj(object ob) {
int corpse;
object playerob;
if(ob->isCorpse()) corpse = 1;
if(interactive(ob)) playerob = ob;
if( ob->isPlayer() ) playerob = ob->GetPlayerob();
if( ob->isPlayer() && !playerob ){
write("You cannot resurrect a player that isn't logged on.");
return 1;
}
if((playerob && !playerob->GetGhost()) || living(ob)) {
write("You can't resurrect the living.");
return 1;
}
if(base_name(ob) != LIB_CORPSE){
write("You can only resurrect flesh-based creatures.");
return 1;
}
if(environment(ob) != environment(this_player())) {
write(capitalize(ob->GetKeyName())+" isn't here.");
return 1;
}
tell_player(this_player(),"You wave your hand, and with a flash "+
"of light, "+ob->GetCapName()+" comes back to life!");
tell_player(ob,capitalize(this_player()->GetKeyName())+" waves "+
possessive(this_player())+
" hand, and with a flash of light, you come back from the dead!");
tell_room(environment(this_player()),this_player()->GetCapName()+" waves "+
possessive(this_player())+
" hand, and with a flash of light, "+ob->GetCapName()+
" comes back to life!",
({ob, this_player()}) );
示例2: do_marry_liv_to_liv
mixed do_marry_liv_to_liv(object spouse1, object spouse2) {
mixed tmp;
if( this_player() == spouse1 || this_player() == spouse2 )
return "You may not perform a marriage on yourself.";
tmp = environment(this_player())->CanMarry(this_player(),
spouse1, spouse2);
if( !tmp ) {
this_player()->eventPrint("This place is not holy to you.");
return 1;
}
else if( stringp(tmp) ) {
this_player()->eventPrint(tmp);
return 1;
}
tmp = environment(this_player())->eventMarry(this_player(),
spouse1, spouse2);
if( tmp == 1 ) {
object ring;
ring = new(OBJ_WED_RING);
ring->SetSpouse(spouse2->GetCapName());
ring->eventMove(spouse1);
ring = new(OBJ_WED_RING);
ring->SetSpouse(spouse1->GetCapName());
ring->eventMove(spouse2);
}
}
示例3: performMarriage
mixed performMarriage(object spouse1, object spouse2){
mixed tmp;
eventForce("say hmmm...");
tmp = environment(this_player())->CanMarry(this_player(),
spouse1, spouse2);
if( !tmp ){
this_player()->eventPrint("This place is not holy to you.");
return 1;
}
else if( stringp(tmp) ){
this_player()->eventPrint(tmp);
return 1;
}
tmp = environment(this_player())->eventMarry(this_player(),
spouse1, spouse2);
if( tmp == 1 ){
object ring;
ring = new(OBJ_WED_RING);
ring->SetSpouse(spouse2->GetCapName());
ring->eventMove(spouse1);
ring = new(OBJ_WED_RING);
ring->SetSpouse(spouse1->GetCapName());
ring->eventMove(spouse2);
}
}
示例4: do_bump_liv
mixed do_bump_liv(object ob) {
int Strength, TargetStrength;
string *Exits;
string NewLocation, OldLocation;
mixed var;
object env;
if( !ob ) return 0;
if( !(env = environment(ob)) ) return 0;
if( ob->GetProperty("no bump") ) {
message("my_action", "You try to bump "+
ob->GetCapName()+".",
this_player() );
message("other_action", this_player()->GetCapName()+" tries "
"to bump "+ob->GetCapName()+".",
environment(ob), ({ ob, this_player() }) );