当前位置: 首页>>代码示例>>C++>>正文


C++ object::GetKeyName方法代码示例

本文整理汇总了C++中object::GetKeyName方法的典型用法代码示例。如果您正苦于以下问题:C++ object::GetKeyName方法的具体用法?C++ object::GetKeyName怎么用?C++ object::GetKeyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在object的用法示例。


在下文中一共展示了object::GetKeyName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()}) );
开发者ID:RandolfShanksCarter,项目名称:DeadStars,代码行数:35,代码来源:resurrect.c

示例2: CheckNPC

/*Do not attack other NPC's*/
void CheckNPC(object ob){
 
 object env=environment(this_object());
 if(ob && !inherits(LIB_NPC, ob)){
         eventForce("kill " +ob->GetKeyName());
 }
}
开发者ID:LashMUD,项目名称:DikuMud-to-Dead-Souls-Port,代码行数:8,代码来源:5005_worm.c

示例3: performDivorce

int performDivorce(object ob1){
    string spouse1, spouse2;
    object ring1, ring2, ob2;

    spouse1 = ob1->GetKeyName();
    if(!ob1->GetSpouse()){
        eventForce("say You don't appear to be married.");
        return 1;
    }
    spouse2 = lower_case(ob1->GetSpouse());
    ob2 = find_player(spouse2);

    if(!ob1->CanDivorce(ob1)){
        eventForce("say I cannot perform this divorce. Are you sure "+
                "you are still married?");
        return 1;
    }

    if(!find_player(spouse1) || !ob1 ){
        eventForce("say I'm sorry. Both spouses must be logged "+
                "on for a divorce to take place.");
        return 1;
    }

    ob1->eventDivorce(ob1);
    ob2->eventDivorce(ob2);

    ring1 = present("official wedding ring",ob1);
    ring2 = present("official wedding ring",ob2);

    if(ring1) ring1->eventDestruct();
    if(ring2) ring2->eventDestruct();

    eventForce("say The divorce is complete.");
    tell_player(spouse1,"%^RED%^You are now divorced from "+capitalize(spouse2)+"%^RESET%^!");
    tell_player(spouse2,"%^RED%^You are now divorced from "+capitalize(spouse1)+"%^RESET%^!");
    eventForce("shout this office duly records and announces that "+capitalize(spouse1) +" has divorced "+capitalize(spouse2)+"!");
    return 1;
}
开发者ID:Elohim,项目名称:FGmud,代码行数:39,代码来源:clerk.c


注:本文中的object::GetKeyName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。