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


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

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


在下文中一共展示了object::GetName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: eventManipulate

varargs mixed eventManipulate(object who, string component){
    mixed val;

    if( !component ){
        val = Manipulate["default"];
    }
    else {
        val = Manipulate[component];
    }
    if( arrayp(val) ){
        val = val[query_night()];
    }
    if( stringp(val) ){
        object env;

        env = environment(who);
        who->eventPrint(val);
        if( component ){
            env->eventPrint(who->GetName() + " moves the " + component +
                    " on " + GetDefiniteShort() + ".", who);
        }
        else {
            env->eventPrint(who->GetName() + " moves " +
                    GetDefiniteShort() + ".", who);
        }
        return 1;
    }
    else {
        if( functionp(val) & FP_OWNER_DESTED ){
            return "Error in evaluating functional.";
        }
        return evaluate(val, who, component);
    }
}
开发者ID:Elohim,项目名称:FGmud,代码行数:34,代码来源:manipulate.c

示例2: eventShootDude

int eventShootDude(object ob){
    int dam, numlimbs;
    string limbname, str;
    string *limbs;
    if(!environment()) return 0;
    str = ob->GetName();
    if(!ammo){
        tell_room(environment(),"The gun turret clicks.");
        active = 0;
        return 0;
    }
    tell_object(this_object(),"You fire at "+ob->GetName()+"!");
    tell_room(environment(),"The gun turret fires at "+ob->GetName()+"!",
            ({this_object(),ob}));
开发者ID:Elohim,项目名称:FGmud,代码行数:14,代码来源:turret.c

示例3: CanReceive

int CanReceive(object ob) {
    if(privacy) {
        if(!interactive(ob)) {
            message("info","\n\nPRIVACY WARNING: "+ob->GetName()+" has entered the room.\n\n",this_object() );
        }
        else if(!archp(ob)) {
            message("info","You bounce off the conference room privacy shield.", ob);
            message("info",ob->GetName()+" bounced off the privacy shield.",this_object());
            if(!environment(ob)) ob->eventMoveLiving(ROOM_START);
            return 0;
        }

    }
    return room::CanReceive();
}
开发者ID:RandolfShanksCarter,项目名称:DeadStars,代码行数:15,代码来源:confroom.c

示例4: CheckOrc

varargs int CheckOrc(object who, mixed where){
    object env = environment(who);
    if( who->GetRace() == "orc" ) {
        who->eventPrint("You can almost feel the power of the bear as "+
                "you wear its skull.");
        if(env) tell_room(env, who->GetName()+" wears "+GetShort()+
                ".", ({who}));
开发者ID:Elohim,项目名称:FGmud,代码行数:7,代码来源:orc_helmet.c

示例5: eventShowInterior

varargs mixed eventShowInterior(object who, object target){
    object here,me,imhere,dabei;
    string this,str;
    here=environment(this_object());
    me=this_object();
    this=me->GetKeyName();
    str=me->GetInternalDesc();
    imhere=present(this,environment(who));
    dabei=present(this,who);

    if( target ){
        return "A strange event has occurred, which you should report.";
    }

    if(!imhere && !dabei){
        who->eventPrint("That is not here.");
        return 0;
    }

    if( !str || str == "" ){
        return 0;
    }
    if(!inherits(LIB_SURFACE, this_object())){
        environment(who)->eventPrint(who->GetName() + " looks inside " +
                GetShort() + ".", who);
    }
    who->eventPrint(str);

}
开发者ID:Elohim,项目名称:FGmud,代码行数:29,代码来源:look_in.c

示例6: do_steal_wrd_from_liv

mixed do_steal_wrd_from_liv(string wrd, object liv) {
    this_player()->eventPrint("You eye " + (string)liv->GetName() +
      " with thoughts on " + possessive(liv) +
      " pockets.");
    if( (int)this_player()->GetInCombat() )
        this_player()->SetAttack(0, (: eventSteal,this_player(), "money", liv :),
          ROUND_OTHER);
    else eventSteal(this_player(), "money", liv);
开发者ID:arylwen,项目名称:terebi,代码行数:8,代码来源:steal.c

示例7: do_ask_liv_to_str

mixed do_ask_liv_to_str(object ob, string str) {
    string lang = this_player()->GetDefaultLanguage();
    //string pre = "In " + lang + ", ";
    string pre = "In ";
    int lvl;
    string msg = translate(str, lvl=(this_player()->GetLanguageLevel(lang)));
    if(lvl < 50) pre += "execrable "+lang+", ";
    else if(lvl < 60) pre += "very poor "+lang+", ";
    else if(lvl < 75) pre += "broken "+lang+", ";
    else if(lvl < 99) pre += "imperfect "+lang+", ";
    else pre += lang + ", ";
    msg = translate(msg, ob->GetLanguageLevel(lang));
    message("my_action", pre + "you ask "+ob->GetName()+" to "+str+".",
            this_player() );
    message("other_action", pre + this_player()->GetName()+" asks "
            "you to "+msg+".", ob);
    message("other_action", pre + this_player()->GetName()+" asks "+
            ob->GetName()+" to do something.",
            environment(ob), ({ ob, this_player() }) );
开发者ID:UmbrellaWizard,项目名称:rose-mud,代码行数:19,代码来源:ask.c

示例8: GetMissData

static mixed GetMissData(object targ, int type, string limb){
    string targ_name = targ->GetName(); 

    if(targ->GetDead() || this_object()->GetDead()) return 0;

    if( type == -2 ) switch( random(7) ){
        case 0:
            return ({ "%s completely %s %s.",
                    ({ "You", "miss", targ_name }),
                    ({ GetName(), "misses", "you" }),
                    ({ GetName(), "misses", targ_name }) });
开发者ID:RandolfShanksCarter,项目名称:DeadStars,代码行数:11,代码来源:combatmsg.c

示例9: eventBackstab

int eventBackstab(object backstabber, object target) {
    object env;
    float tmp;
    int suprise;
    object *weapons;
    int numberOfWeapons;
    int numberOfStabs;
    int i;

    if(!backstabber || !(env = environment(backstabber))) return 0;
    if(!target || !present(target, env)) {
        backstabber->eventPrint("Your hapless victim is no longer present.");
        return 1;
    }

    tmp = backstabber->GetSkillLevel("stealth")*1.5;
    tmp += backstabber->GetStatLevel("charisma")/2.0;
    tmp += backstabber->GetStatLevel("luck")/3.0;
    tmp += backstabber->GetMobility()/3.0;
    tmp -= target->GetStatLevel("luck")/3.0;
    tmp -= target->GetStatLevel("wisdom")/3.0;
    tmp -= target->GetMobility()/5.0;
    tmp *= 1.0;
    if(tmp < 1.0) tmp = 1.0;
    suprise = to_int(tmp);

    backstabber->AddSkillPoints("stealth", to_int(suprise * 3.0));
    backstabber->AddStaminaPoints(-(5 + random(5)));
    moral_act(backstabber, target, -30);

    if(suprise < random(100) || !present(target, environment(backstabber))) {
        backstabber->eventPrint("%^RED%^" + target->GetName()
          + " evades your poorly executed backstab.%^RESET%^");
        target->eventPrint("%^RED%^You easily dodge " + possessive_noun(backstabber)
          + " attempted backstab.%^RESET%^");
        environment(backstabber)->eventPrint("%^RED%^" + target->GetName()
          + " dodges " + possessive_noun(backstabber) + " attempted backstab.%^RESET%^",
          ({backstabber, target}));
开发者ID:arylwen,项目名称:terebi,代码行数:38,代码来源:backstab.c

示例10: do_backstab_liv

mixed do_backstab_liv(object ob) {
    object env;

    if(!(env = environment(this_player()))) return 0;
    if( (int)this_player()->GetPosition() != POSITION_STANDING )
        this_player()->eventStand();   
    if(!ob || !present(ob, env)) {
        this_player()->eventPrint("Your hapless victim is no longer present.");
        return 1;
    }
    this_player()->eventPrint("%^RED%^You sneak up behind " + ob->GetName() + "...%^RESET%^");
    this_player()->SetAttack(ob, (:eventBackstab, this_player(), ob:));
    return 1;
}
开发者ID:arylwen,项目名称:terebi,代码行数:14,代码来源:backstab.c

示例11: 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;
}
开发者ID:arylwen,项目名称:terebi,代码行数:18,代码来源:buffer.c

示例12: 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;
}
开发者ID:arylwen,项目名称:terebi,代码行数:23,代码来源:dest.c

示例13: can_say_to_liv

mixed can_say_to_liv(object ob) {
    if( !ob ) return 0;
    return "What is it you are trying to say to "+ ob->GetName() + "?";
}
开发者ID:Elohim,项目名称:FGmud,代码行数:4,代码来源:say.c

示例14: Dlg_Newton_1

func Dlg_Newton_1(object clonk)
{
	MessageBox(Format("$Newton1$", clonk->GetName()), clonk, dlg_target); // %s, good that you're here!
	return true;
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:5,代码来源:DlgNewton.c

示例15: InfectMess

int InfectMess(object ob){
    victim=ob;
    victimname=victim->GetName();
    tell_room(environment(victim), victimname+" looks suprised and grossed out.",({victim}) );
开发者ID:Elohim,项目名称:FGmud,代码行数:4,代码来源:lice.c


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