player/a/
player/b/
player/c/
player/d/
player/e/
player/f/
player/g/
player/i/
player/j/
player/k/
player/m/
player/n/
player/r/
player/s/
player/v/
player/w/
player/x/
player/z/
player_fst/e/
player_fst/f/
player_fst/h/
player_fst/i/
player_fst/j/
player_fst/n/
player_fst/o/
player_fst/p/
player_fst/player/a/
player_fst/player/b/
player_fst/player/c/
player_fst/player/d/
player_fst/player/e/
player_fst/player/f/
player_fst/player/g/
player_fst/player/j/
player_fst/player/k/
player_fst/player/m/
player_fst/player/n/
player_fst/player/r/
player_fst/player/s/
player_fst/player/v/
player_fst/player/w/
player_fst/player/x/
player_fst/player/z/
player_fst/u/
player_fst/v/
player_fst/w/
player_fst/x/
// Space module for Assault 4.0

#include "space.h"

PLANET_DATA planet_space[] =
    { //      Name                     zval               spacex  spacey  spacey,     sun (T/F)
    { "Earth",                       Z_SPACE_EARTH,        15,      7,       10,        FALSE  },
    // Add new planets here.
    { "INVALID",                        -1,                 0,      0,        0,        TRUE }
    };


void do_enterspace(CHAR_DATA *ch, char *argument)
{
  bool found = FALSE;
  int i =0;
  
  send_to_char("This feature not yet fully implemented\r\n", ch);
  for(i=0;!strcmp(planet_space[i].name, "INVALID");i++)
  {
	if(ch->z == planet_space[i].zval) {found = TRUE;}
  }
  
  if(!found) 
  {
    send_to_char("You are not in an orbit.\r\n", ch);
  } else {
    ch->z = Z_SUPER_SPACE;
    move_space(ch, planet_space[i].spacex, planet_space[i].spacey, planet_space[i].spacez);
  }

  return;
}

void move_space(CHAR_DATA *ch, int x, int y, int z)
{
// Set the coords on the player.
  if(ch == NULL)
    return;
  if(ch->z != Z_SUPER_SPACE)
  {
	send_to_char("You don't seem to be in \"Super Space\".", ch);
	return;
  }  
  ch->spacex = x;
  ch->spacey = y;
  ch->spacez = z;
  do_space_look(ch);
 
  return;
}

void do_space_look(CHAR_DATA *ch)
{
  int i = 0, j = 0, x, y, z;
  x = ch->spacex;
  y = ch->spacey;
  z = ch->spacez;
  
  send_to_char("*", ch);                     //Space header
  for(i=0;i < ch->pcdata->term_columns;i++)
    send_to_char("-", ch);
  send_to_char("*\r\n", ch);
  
  for(i=0;i < ch->pcdata->term_rows;i++)       // Actual map of space around them
  {
    send_to_char("|", ch);
    for(j=0;j < ch->pcdata->term_columns;j++)
    {
      send_to_char("@@d**@@n ", ch);//Display the space around them.
    }
    send_to_char("|\r\n", ch);
  }
  
  send_to_char("*", ch);                     //Space footer
  for(i=0;i < ch->pcdata->term_columns;i++)
    send_to_char("-", ch);
  send_to_char("*\r\n", ch);
  
}