示例#1
0
文件: door.cpp 项目: gtozzi/polserver
void UDoor::toggle()
{
  const Items::DoorDesc* dd = static_cast<const Items::DoorDesc*>( &itemdesc( ) );

  unsigned short oldx = x, oldy = y;

  set_dirty();
  if ( is_open() )
  {
    if ( dd->graphic )
      graphic = dd->graphic;
    else
      graphic = static_cast<u16>( objtype_ );
    x -= dd->xmod;
    y -= dd->ymod;
  }
  else
  {
    graphic = dd->open_graphic;
    x += dd->xmod;
    y += dd->ymod;
  }

  MoveItemWorldPosition( oldx, oldy, this, NULL );

  send_item_to_inrange( this );
}
示例#2
0
文件: door.cpp 项目: gtozzi/polserver
bool UDoor::is_open() const
{
  const Items::DoorDesc* dd = static_cast<const Items::DoorDesc*>( &itemdesc( ) );
  if ( graphic == dd->open_graphic )
    return true;
  else
    return false;
}
示例#3
0
void UArmor::set_onhitscript( const std::string& scriptname )
{
  if ( scriptname.empty() )
  {
    onhitscript_.clear();
  }
  else
  {
    onhitscript_.config( scriptname, itemdesc().pkg, "scripts/items/", true );
  }
}