本文整理汇总了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);
}
}
示例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}));
示例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();
}
示例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}));
示例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);
}
示例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);
示例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() }) );
示例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 }) });
示例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}));
示例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;
}
示例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;
}
示例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;
}
示例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() + "?";
}
示例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;
}
示例15: InfectMess
int InfectMess(object ob){
victim=ob;
victimname=victim->GetName();
tell_room(environment(victim), victimname+" looks suprised and grossed out.",({victim}) );