You can now move from room to room!
Walk around! Make a map! Tell me if anything doesn't line up, of course.
Right now, you can walk through walls, but that's intentional since there's nothing preventing you from getting trapped someplace.
There shouldn't be any one-way doors, but there might be.
@ECHO off
::Navigation Vars
SET return=NULL
::World Vars
SET wTime=0
SET Seed=9997
::1073791813
SET passageChance=75
::Room Vars
SET rAddress=0
SET rNorthPassible=1
SET rEastPassible=1
SET rSouthPassible=1
SET rWestPassible=1
SET rTypenumber=0
::Player Vars
SET pX=1785
SET pY=1785
::Player Attributes
SET pHealthMax=100
SET pHealthCur=100
SET pLevel=1
SET pXP=0
SET pMind=10
SET pBody=10
echo ----------------------------
echo Hello! Welcome to BATillion!
echo ----------------------------
::This function generates the curent room and should only be called on arrival
:ARRIVE
SET /a rAddress=%pX%*3571+%pY%+1
SET i=0
echo You've arrived at %pX%,%pY%.
SET /a rNorthPassible=1
SET /a rEastPassible=1
SET /a rSouthPassible=1
SET /a rWestPassible=1
::Now I can reuse "roll". Must set return to the right flag before each instace...
SET return=ArriveRoll1
GOTO ROLL
:ArriveRoll1
IF %roll% GTR %passageChance% SET /a rNorthPassible=0
SET return=ArriveRoll2
GOTO ROLL
:ArriveRoll2
IF %roll% GTR %passageChance% SET /a rEastPassible=0
::Technically, it looks at the rooms to the south and west and sees if they are passible to the north and west.
SET /a rAddress=%pX%*3571+%pY%+-3570
SET /a i=0
SET return=ArriveRoll3
GOTO ROLL
:ArriveRoll3
IF %roll% GTR %passageChance% SET /a rSouthPassible=0
SET /a rAddress=%pX%*3571+%pY%
SET return=ArriveRoll4
GOTO ROLL
:ArriveRoll4
IF %roll% GTR %passageChance% SET /a rWestPassible=0
::Returns to the current room
SET /a rAddress=%pX%*3571+%pY%+1
SET return=ArriveRoll5
GOTO ROLL
:ArriveRoll5
SET /a rTypenumber=%roll%
SET return=MENU
GoTO LOOK
::MAIN MENU
:MENU
SET menuinput=0
echo What would you like to do?
echo 1 Look Around
echo 2 Travel or Wait
echo 3 Fight\Interact
echo 4 Search
echo 5 Stats\Inventory
echo 7 Quit
SET /P menuinput=select one (1-7):
set from=MENU
IF %menuinput%==1 GOTO LOOK
IF %menuinput%==2 GOTO TRAVEL
IF %menuinput%==3 GOTO NULL
IF %menuinput%==4 GOTO NULL
IF %menuinput%==5 GOTO NULL
IF %menuinput%==6 GOTO NULL
IF %menuinput%==7 GOTO QUIT
echo select something else!
GOTO MENU
::Look Around menu. Basically, give an update on this location.
:LOOK
echo ----------------------------
echo You are at %pX%, %pY%.
echo This room is room type number %rTypenumber%.
echo ----------------------------
GOTO %return%
:TRAVEL
echo ----------------------------
echo Where would you like to go?
:TMenu
echo W Go North
echo ASD West, Stay Here, East
echo X Go South
echo C Cancel
echo %rNorthPassible%
IF %rNorthPassible%==1 echo You may go North.
IF %rEastPassible%==1 echo You may go East.
IF %rSouthPassible%==1 echo You may go South.
IF %rWestPassible%==1 echo You may go West.
echo ----------------------------
SET /P menuinput=select WASDX, or C...
IF %menuinput%==W GOTO North
IF %menuinput%==w GOTO North
IF %menuinput%==A GOTO West
IF %menuinput%==a GOTO West
IF %menuinput%==S GOTO Wait
IF %menuinput%==s GOTO Wait
IF %menuinput%==D GOTO East
IF %menuinput%==d GOTO East
IF %menuinput%==X GOTO South
IF %menuinput%==x GOTO South
IF %menuinput%==C GOTO MENU
IF %menuinput%==c GOTO MENU
echo You must enter W, A, S, D, X, or C.
GOTO TMenu
:North
::Is north passible?
SET /a pX+=1
SET /a wTime+=1
GOTO ARRIVE
:East
::Is east passible?
SET /a pY+=1
SET /a wTime+=1
GOTO ARRIVE
:West
::Is west passible?
SET /a pY-=1
SET /a wTime+=1
GOTO ARRIVE
:South
::Is south passible?
SET /a pX-=1
SET /a wTime+=1
GOTO ARRIVE
:Wait
echo You wait.
SET /a wTime+=1
GOTO MENU
:QUIT
SET quitchoice=n
SET /P quitchoice=Sure? Enter Y to quit, anything else to cancel:
IF %quitchoice%==Y GOTO END
IF %quitchoice%==y GOTO END
GOTO MENU
:ROLL
SET /a i+=1
::This is a crude psudorandom number generator.There will be artifacts, but it does return a number between 1-100
SET /a roll=(%Seed%+%rAddress%*i)%%100
GOTO %return%
:NULL
echo Arrived at NULL!
echo Function probably not yet implemented,
echo or else something has gone wrong.
pause
GOTO MENU
:END
echo ----------------------------
echo Quitting...
echo ----------------------------
pause
Some plans:
Rooms will have types, and that may be anything from climate to simply the pattern of the stonework. There will be three or four details for each room also procedurally generated.
There will be a thing in each room- a monster, treasure, shopkeeper, or artifact.
Monsters can be killed, treasure collected, the shopkeeper will sell you things, and artifacts will do strange things, like granting one levelup or teleporting you to a random room.
The seed number should be a prime number... but I think other numbers will work (if poorly).