Rushon2 - for the TI-83/+/SE - by Alex Cho Snyder - axchos@yahoo.com

The original game was called Dragon, for no apparent reason, other
than that it sounds cool so people will want to download it.  

I first decided to make it when I could not find any war games for my
TI-83 plus.  None of them had both graphics and a computer player.

This is the optimized version of dragon.  See, Rush versus Drag on.  
It uses list L1 instead of variables.  It also uses X,Y,Z, and 0 as 
temporary variables.  Rushon is not compatible with Dragon or the 
Dragon Editor.  Rushon2 is not compatible with Rushon.

This is a strategy game like Age of Empires with 4 units
The point of the game is to kill the computer player's units

The screen looks like this -

        Title                   
             \                  
        -----DRAGON-----        
        O^ ^^ *^   +-Cursor       
Your   /*^    ** * ^^*         
   base ^A*  * ^*^ *         
        ^^**  *   A * Enemy  
Random  ****^ *     ^ */   base
    map- *    **  *^ O        
        ----------------        
                  \             
             Info bar           

Units - (from least to most powerful)

. - Peasant - Makes Shelters - Costs 10 Food           - Gathers
+ - Warrior - Makes Outposts - Costs 10 Food + 10 Rock - Fights
O - Shelter - Makes Peasants - Costs 25 Wood
A - Outpost - Makes Warriors - Costs 25 Wood + 10 Rock

Terrain - (blocks units)

* - Tree - Provides Wood
 - Food - Provides Food
^ - Rock - Provides Rock

Controls - (no assigning actions to multiple units at the same time)

Arrows - Move cursor (plus sign) around map - Change values
2nd - Select your own unit under the cursor -
      deselect on non-unit space - Confirm selection
Alpha - Perform action with selected unit - 
        press on empty space to move,
        use with Peasant on terrain to gather resources from it -
        use with your units onto enemy units to attack them
Mode - Build unit with selected unit if available empty square
XT0n - Shows help
Del - Delete the selected unit to get it out of the way
Stat - Press multiple times to show Wood, Food, and Rock in that order
Clear - Clears, deletes [A] and L1, and quits
On - Pauses the game

There are not really any bugs, but I found that sometimes
when I build a unit it switches places and looks weird

The computer AI is mainly random and probabilistic

You can email me at axchos@yahoo.com with questions or comments

-----------------------------------------------------------------------
For programming...

Vars -

L1(1) - Used to check whether there is a saved game
L1(2) - Wood - starts at 10
L1(3) - Food - starts at 10
L1(4) - Rock - starts at 10
L1(5) - Difficulty level
L1(6) - Counter used with displaying resources - starts at zero
L1(7) - Calc focus - cursor X
L1(8) - Calc focus - cursor Y
L1(9) - Attempted unit move - action X
L1(10) - Attempted unit move - action Y
L1(11) - Selected unit - coord X
L1(12) - Selected unit - coord Y
L1(13) - Action coord X
L1(14) - Action coord Y
L1(15) - Player focus - cursor X
L1(16) - Player focus - cursor Y

X - Temporary var
Y - Temporary var
Z - Temporary var
0 - Temporary var

[A] - Matrix of map (6 x 16)

(negative=enemy)
0 - _
1 - *
2 - 
3 - ^
4 - O
5 - A
6 - .
7 - +

Screen -

  1 2 3 4 5 6 7 8 9 10111213141516
x x x x x x x x x x x x x x x x x <-- Title bar
1 4                               
2                                 
3     5                           
4                          -5     
5                                 
6                              -4 
x x x x x x x x x x x x x x x x x <-- Info bar

When using coords L1(5),L1(6) and L1(9),L1(10) thru L1(15),L1(16)
make sure to subtract from the x value for matrices

Coords are recorded with values for Output, not [A]

Here is an example -

PROGRAM:RUSHON
:0->[A](X-1,Y
:Output(X,Y,"_
:
:
:
:
:

-----------------------------------------------------------------------
Rushed - for the TI-83 (plus)

The original was called Editor, so I made it rush ed(itor).

The editor is for making maps to play with dragon.  You cannot save
maps unless you create a scenario program by pressing STAT, entering
values for all the variables, and pressing ON after it displays READY?.
Then make a new program, recall [A](6,16) and L1(16) and store them
to their variables before calling prgmDRAGON.  You can also display
text in a scenario with Disp or Output( for the scenario instructions.

Now the rushon engine recognizes saved games and scenarios only if the
first element of L1 is a multiple of the constant "e". This means that
it won't recognize old scenarios from an earlier version of Rushon!
When you recall L1 into a scenario program, the first element will
probably be a decimal, so to save space you should change it to "e".

For multiple-scenario campaigns, the rushon engine stores L1's first
element to Ans if the player won, and uses "Return" instead of "Stop"
so it goes back to the calling scenario program. This means that a
scenario program can check:

:If Ans and not(fPart(Ans/e
(if Ans is a multiple of e and not 0)

and then run the next scenario in the campaign if true, meaning that
the player beat the earlier scenario. The only problem is that if the
player breaks out of rushon with [ON], and then presses enter to run
the program again, it will restart the whole scenario (and campaign!).
You could solve this by putting:

:16->dim(L1:L1(1:If Ans and not(fPart(Ans/e
(etc.)

in the beginning of the program to see if there is a saved game. Then
you can run the rushon engine pick up the paused game. Then when the
game returns you need to know which level to go to, so if you change
the first element in L1 (a multiple of e, remember?) so that for the
first level it's e, for the second, 2e, for the third, 3e, etc.,
then you can just put: 

:L1(1)/e:If Ans=1:Goto 2:If Ans=2:Goto 3
(etc.)

where Lbl 2 leads to the second level, if that's how you want to do it.
(yes, it would be a lot easier if you could go "Goto Ans+1", but it's
illegal and makes a syntax error) If you don't understand all this but
you want to make a campaign, use the template program as a skeleton to
add your data. But don't forget to add the e, 2e, etc. in the lists.

You may also edit the current game or continue a map where you left off
This means if you are playing a rushon game, you can press [ON] to
break out of the program, then run the editor, edit the map a bit, 
press [ON] to break out of that, and then run the rushon engine again
to continue on your newly tweaked map. It's easy to cheat this way.

An example scenario is shown later

Controls -

Arrows - Move the cursor just like in Dragon - Change values
2nd - Place selected unit at cursor location - Confirm selection
Alpha - Change selected unit type
Mode - Toggle between player and enemy units
XT0n - Help
Del - Delete unit at cursor
Stat - Choose selected unit, unit action, 
       enemy focus, and start playing

If you want to make a scenario program, press ON to break once the map
loads, and create a new program with the required variables.  

I included a few example scenario programs that I made with the editor.
Here is the Genghis Khan scenario -

PROGRAM:INVADE

Show text for scenario
:Output(1,1,"
-----INVADE-----	
YOU ARE GENGHIS 
KHAN, LEADER OF 
THE MONGOL ARMY 
TO INVADE CHINA 
YOU MUST DEFEAT 
THE GREAT WALL  
----------------

Store the map in matrix [A]
:[[4,0,3,1,1,1,0,0,0,-4,0,0,0,0,2,2]
[0,0,7,0,0,1,0,0,-4,-5,0,-7,0,-6,2,2]
[0,7,6,7,0,0,0,0,-4,0,0,0,0,0,0,-4]
[0,0,7,0,0,1,3,-4,-5,0,-7,0,0,2,2,0]
[1,0,0,0,1,0,0,-4,0,0,0,0,-6,2,2,0]
[1,1,3,0,0,3,1,-4,-5,0,-7,0,0,0,-4,0->[A]

Store the variables in List L1
:{e,0,0,0,.045,0,5,12,4,3,4,3,4,3,4,3->L1
   \
   Don't forget to add "e"!

Wait to finish reading text
:Pause

Start scenario
:prgmRUSHON2

-----------------------------------------------------------------------