예제 #1
0
/* NO_NPC's allowed in room except room inventory*/
int CanReceive(object ob) {
    if(ob && (!inherits(LIB_NPC, ob) | !strcmp("a small stick", ob->GetShort()))){
    return 1;
    }
    else
    return 0;
}
예제 #2
0
/* NO_NPC's allowed in room except Mayor */
int CanReceive(object ob) {
    if(ob && !inherits(LIB_NPC, ob) | !strcmp("the Mayor", ob->GetShort())){
    return 1;
    }
    else
    return 0;
}
void CheckPoison(object ob){

    int chance; 
    object env = environment(this_object());

    if(this_object()->GetInCombat()){
        ob = this_object()->GetCurrentEnemy();     
        chance = random(32)-this_object()->GetLevel();
        
        if(chance == 0){
            tell_room(env, "The Snake sinks its fangs into "+ob->GetShort()+"!", ({this_object(), ob}) );
예제 #4
0
파일: dest.c 프로젝트: arylwen/terebi
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;
}
예제 #5
0
파일: throw.c 프로젝트: arylwen/terebi
mixed do_throw_obj_word_obj(object what, string word, object where) {
    object enemy;

    if( where && living(where) && (int)what->GetClass() > 1 ) {
        enemy = where;
    }
    else {
        enemy = 0;
    }
    if( this_player()->GetInCombat() || enemy ) {
        this_player()->eventPrint("You prepare to throw " +
          (string)what->GetShort() + ".");
        this_player()->SetAttack(enemy, (: eventThrow, this_player(), what,
            where :), (enemy ? ROUND_WEAPON :
            ROUND_OTHER));
        return 1;
    }
예제 #6
0
파일: buffer.c 프로젝트: arylwen/terebi
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;
}
예제 #7
0
파일: weigh.c 프로젝트: Elohim/FGmud
mixed do_weigh_obj(object obj) {
    string name, verb = "heft";
    if(!obj) return "You must weigh something.";

    /* Check for presence of objects */
    name = obj->GetShort();
    if( environment(obj) != this_player() ) {
        this_player()->eventPrint("You do not have "+name+".");
        return 1;
    }

    if(obj->GetWorn()) verb = "get a feel for";

    this_player()->eventPrint("You stare intently at " + name + " and " +
            verb + " it.");
    environment(this_player())->eventPrint( this_player()->GetName() +
            " looks at " + name + ".", this_player());
    if( this_player()->GetInCombat() )
        this_player()->SetAttack(0,
                (: eventWeigh, this_player(), obj :),
                ROUND_OTHER);
    else eventWeigh(this_player(), obj);