rope.scr

lima-1.0b5/lib/domains/std/2.4.5/obj/rope.scr · 935 B

From the archive lima-1.0b5+driver.tar.gz

Download the archive   « Back to the archive contents

# Do not remove the headers from this file! see /USAGE for more info.

is=object,gettable, valuable
primary_id=rope
in_room_desc=A rope
value=15
weight=1
variables=tied_to,tied_to_ob
---
string short()
{
  if(_tied_to)
    return ::short() + " tied to " + _tied_to;
  return ::short();
}

mixed direct_tie_obj_to_obj()
{
  if (_tied_to)
  {
//    write("It is already tied to " + tied_to + ".\n");
    return "It is already tied to " + _tied_to + ".\n";
  }
  return 1;
}

void do_tie(object ob)
{
  ob->tie(this_object());
  set_getmsg("You can't - it's tied.");
  _tied_to_ob = ob;
  _tied_to = ob->short();
  this_body()->targetted_action("$N $vtie the rope to $t.", ob);
  this_object()->move(environment(ob));
}

void do_untie()
{
  if(_tied_to_ob)
  {
    _tied_to_ob->untie(this_object());
    this_body()->targetted_action("$N $vuntie the rope from $t.", _tied_to_ob);
  }
  set_gettable(1);
  _tied_to_ob=0;
  _tied_to=0;  
}

Site Stats

Snippets: 1791
Codebases: 571