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


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

本文整理汇总了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()}) );
开发者ID:RandolfShanksCarter,项目名称:DeadStars,代码行数:35,代码来源:resurrect.c

示例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);
    }
}
开发者ID:Elohim,项目名称:FGmud,代码行数:26,代码来源:marry.c

示例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);
    }
}
开发者ID:Elohim,项目名称:FGmud,代码行数:26,代码来源:clerk.c

示例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() }) );
开发者ID:Elohim,项目名称:FGmud,代码行数:16,代码来源:bump.c


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