#include <std.h>
#include <move.h>
#include "../../tecqumin.h"

inherit "/std/vacuum.c";
int vacuum;

string long_desc();

void create() {
  ::create();
  set_indoors(0);
  set_property("light", 0);
  set_terrain(STONE_BUILDING);
  set_travel(DECAYED_FLOOR);
  set_name("A dark chamber");
  set_short("%^BOLD%^%^BLACK%^An %^BOLD%^%^WHITE%^"
        +"i%^RESET%^n%^BOLD%^%^WHITE%^t%^BOLD%^%^BLACK%^e%^BOLD%^"
        +"%^WHITE%^r%^RESET%^%^BLUE%^d%^BOLD%^%^WHITE%^i%^RESET%^m"
        +"%^BOLD%^%^WHITE%^e%^RESET%^%^BLUE%^n%^BOLD%^%^WHITE%^s"
        +"%^RESET%^i%^BOLD%^%^BLACK%^o%^BOLD%^%^WHITE%^n%^RESET%^a"
        +"%^BOLD%^%^WHITE%^l %^RESET%^%^BLUE%^void%^RESET%^");
  set_long( (:TO, "long_desc" :) );
  set_smell("default","There is no %^BOLD%^%^CYAN%^a%^WHITE%^i"
    +"%^CYAN%^r%^RESET%^%^ORANGE%^. You can't smell anything.");
  set_listen("default","There is no %^BOLD%^%^CYAN%^a%^WHITE%^i"
    +"%^CYAN%^r%^RESET%^%^GREEN%^. You can't hear anything.");
  set_pre_exit_functions( ({"forward", "backward", "right", "left",
    "up", "down", "out"}), ({"move_around", "move_around", 
    "move_around", "move_around", "move_around", "move_around", 
    "move_around" }) );
  vacuum = 1;
  set_heart_beat(1);
}

int is_vacuum(){
  return vacuum;
}

void set_vacuum(int vac){
  vacuum = vac;
}

int move_around(){
  if (TP->query_true_invis()){
    return 1;
  }
  if (TP->query_property("flying")){
    tell_object(TP, "You float through the void.");
    tell_room(TO, TPQCN + " floats through the %^BOLD%^%^BLACK%^vo"
      +"%^RESET%^i%^BOLD%^%^BLACK%^d");
    return 1;
  }
  if (!present("unfettered", TO) || random(3)){
    tell_object(TP, "You can't find any leverage to move!");
    return 0;
  }
  tell_object(TP, "You manage to push off of a passing %^BOLD%^"
    +"%^BLACK%^t%^RESET%^e%^BOLD%^%^BLACK%^nt%^RESET%^%^MAGENTA%^a"
    +"%^BOLD%^%^BLACK%^cle%^RESET%^ and get leverage to move"
    +" through the %^BOLD%^%^BLACK%^vo%^RESET%^i%^BOLD%^%^BLACK%^d"
    +"%^RESET%^.");
  tell_room(TO, TPQCN + " manages to push off of a passing %^BOLD%^"
    +"%^BLACK%^t%^RESET%^e%^BOLD%^%^BLACK%^nt%^RESET%^%^MAGENTA%^a"
    +"%^BOLD%^%^BLACK%^cle%^RESET%^ and gets leverage to move"
    +" through the %^BOLD%^%^BLACK%^vo%^RESET%^i%^BOLD%^%^BLACK%^d"
    +"%^RESET%^.", TP);
  return 1;
}

string long_desc(){
  string desc;
  desc = "You are floating in the outer reaches of an %^BOLD%^%"
    +"^WHITE%^i%^RESET%^n%^BOLD%^%^WHITE%^t%^BOLD%^%^BLACK%^e"
    +"%^BOLD%^%^WHITE%^r%^RESET%^%^BLUE%^d%^BOLD%^%^WHITE%^i"
    +"%^RESET%^m%^BOLD%^%^WHITE%^e%^RESET%^%^BLUE%^n%^BOLD%^"
    +"%^WHITE%^s%^RESET%^i%^BOLD%^%^BLACK%^o%^BOLD%^%^WHITE%^n"
    +"%^RESET%^a%^BOLD%^%^WHITE%^l %^RESET%^%^BLUE%^void"
    +"%^RESET%^.";
  if (TP->query_property("flying")){
    desc += " You can move around by flying, but there does not"
      +" seem to be anywhere to go further out.";
  } else {
    desc += " There doesn't seem to be any way to move yourself"
      +" around.";
  }
}
  return desc;
}
