Advertisement
Audiation

Two-Edged Sword RPG-Idler

Jul 29th, 2013
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Basic4GL 32.38 KB | None | 0 0
  1. ' Two-Edged Sword RPG-Idler
  2. ' By Logan G. / "TheBaykun"
  3.  
  4. ' For instructions, gameplay information, and installation, go to:
  5. ' http://www.bit.ly/13ix4WI
  6.  
  7. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  8. ' SETTINGS:
  9. ''''''''''''''''''''''''''''''''
  10. RETINA on
  11. CheatMode = 0          'Advanced users only!
  12. Difficulty = 2              'Enemy difficulty, 1-3.
  13.  
  14. ResetHighScore = 0 'Resets highscore data
  15. '                                      when the program
  16. '                                      is executed.
  17. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  18.  
  19. BCOLOR 75,75,75
  20. COLOR 255,0,0
  21. LOADSPRITE 1, "manIDLE2" ' Character
  22. LOADSPRITE 2, "leftarrow"
  23. LOADSPRITE 3, "rightarrow"
  24. LOADSPRITE 4, "hat1" 'Hat
  25. LOADSPRITE 5, "hat2" 'Cowbot
  26. LOADSPRITE 6, "hat3" 'Crown
  27. LOADSPRITE 7, "shirt1" 'Blue
  28. LOADSPRITE 8, "shirt2" 'Red
  29. LOADSPRITE 9, "shirt3" 'Yellow
  30. LOADSPRITE 10 , "pants1" 'Red
  31. LOADSPRITE 11, "pants2" 'Yellow
  32. LOADSPRITE 12, "pants3" 'Green
  33. LOADSPRITE 13, "shoes1" 'Shoes
  34. LOADSPRITE 14, "shoes2" 'Boots
  35. LOADSPRITE 15, "checkButton"
  36. LOADSPRITE 16, "dice"
  37. LOADSPRITE 17, "blankButton"
  38. LOADSPRITE 19, "save" 'Save icon
  39. LOADSPRITE 20, "speak1"
  40. LOADSPRITE 21, "blankButton3" 'Tall
  41. LOADSPRITE 24, "speak2"
  42. LOADSPRITE 25, "paused"
  43. LOADSPRITE 26, "resume"
  44. LOADSPRITE 27, "tesrpgi"
  45. LOADSPRITE 28, "medic"
  46. LOADSPRITE 29, "lvlBar"
  47. LOADSPRITE 30, "corner1"
  48. LOADSPRITE 31, "cashS"
  49. LOADSPRITE 32, "expBar"
  50. LOADSPRITE 33, "mpIcon"
  51. LOADSPRITE 34, "usePotion"
  52. LOADSPRITE 35, "buyPotion"
  53. LOADSPRITE 38, "buyMp"
  54. LOADSPRITE 39, "useMp"
  55. LOADSPRITE 40, "slime"
  56. LOADSPRITE 41, "zombie"
  57. LOADSPRITE 42, "skeleton"
  58. LOADSPRITE 43, "clown"
  59. LOADSPRITE 44, "goblin"
  60. LOADSPRITE 45, "knight"
  61. LOADSPRITE 46, "worm"
  62. LOADSPRITE 47, "giant"
  63. LOADSPRITE 48, "demon"
  64. LOADSPRITE 49, "dragon"
  65. LOADSPRITE 50, "bgRect" 'Enemy backg.
  66.  
  67. IF resethighscore=1 THEN
  68.     hiScore=0
  69.     OPEN "tesrpgidata" FOR OUTPUT AS #1
  70.     PRINT #1, hiScore
  71.     CLOSE #1
  72. ENDIF
  73.  
  74. cheatCash=1
  75. cheatInv=0
  76. cheatInfP=0
  77. cheatXP=1
  78. CheatModeA:
  79. IF cheatmode=1 THEN
  80.     CLS tty
  81.     PRINT "Welcome to TESRPG-I Cheat Mode."
  82.     PRINT "What do you want to change this session?"
  83.     PRINT "1: Cash per tick. (Default: $1/tick, Current: ",cheatCash,")"
  84.     PRINT "2: Enable invincibility. (Default: 0, Current: ",cheatInv,")"
  85.     PRINT "3: Toggle infinite potions. (Default: 0, Current: ",cheatInfP,")"
  86.     PRINT "4: XP per tick. (Default: 1 XP/tick, Current: ",cheatXP,")"
  87.     PRINT "5: Exit Cheat Mode, start game."
  88.     INPUT "? : ", gotoCheat
  89.     IF gotoCheat<1 OR gotoCheat>5 THEN
  90.         GOTO CheatModeA
  91.     ENDIF
  92.     IF gotoCheat=1 THEN
  93.         INPUT "CASH PER TICK? : ",cheatCash
  94.         IF cheatCash>9999999 THEN
  95.             cheatCash=9999999
  96.         ENDIF
  97.         GOTO CheatModeA
  98.     ENDIF
  99.     IF gotoCheat=4 THEN
  100.         INPUT "XP PER TICK? : ",cheatXP
  101.         IF cheatXP>9999999 THEN
  102.             cheatXP=9999999
  103.         ENDIF
  104.         GOTO CheatModeA
  105.     ENDIF
  106.     IF gotoCheat=2 THEN
  107.         PRINT "INVINCIBILITY TOGGLED."
  108.         IF cheatInv=0 THEN
  109.             cheatInv=1
  110.         ELSE
  111.             cheatInv=0
  112.         ENDIF
  113.         SLEEP 1
  114.         GOTO CheatModeA
  115.     ENDIF
  116.     IF gotoCheat=3 THEN
  117.         PRINT "INFINITE POTIONS TOGGLED."
  118.         IF cheatInfP=0 THEN
  119.             cheatInfP=1
  120.         ELSE
  121.             cheatInfP=0
  122.         ENDIF
  123.         SLEEP 1
  124.         GOTO CheatModeA
  125.     ENDIF
  126. ENDIF
  127. CLS
  128.  
  129. DIM sts$(5),monHP(10),monSTR(10),monDEF(10),monXP(10),monGOLD(10),monNAME$(10)
  130. sts$(1)="Wandering" 'Default. May be attacked & find treasure.
  131. sts$(2)="Fighting" 'In battle.
  132. sts$(3)="Resting" '+1 HP & MP/tick.
  133. sts$(4)="Hunting" 'Monsters common, more rewards and treasures. Dungeons can be found.
  134. sts$(5)="In Dungeon" 'Many monsters, good treasure, and a boss fight. Bosses drop a lot of gold and xp.
  135.  
  136. monHP(1)=25 'Slime
  137. monHP(2)=50 'Zombie
  138. monHP(3)=100 'Skeleton
  139. monHP(4)=150 'Clown
  140. monHP(5)=250 'Goblin
  141. monHP(6)=350 'Knight
  142. monHP(7)=450 'Worm
  143. monHP(8)=550 'Giant
  144. monHP(9)=666 'Demon
  145. monHP(10)=750 'Dragon
  146. monSTR(1)=10
  147. monSTR(2)=15
  148. monSTR(3)=20
  149. monSTR(4)=25
  150. monSTR(5)=35
  151. monSTR(6)=45
  152. monSTR(7)=50
  153. monSTR(8)=60
  154. monSTR(9)=75
  155. monSTR(10)=100
  156. monDEF(1)=5
  157. monDEF(2)=10
  158. monDEF(3)=15
  159. monDEF(4)=25
  160. monDEF(5)=35
  161. monDEF(6)=45
  162. monDEF(7)=55
  163. monDEF(8)=65
  164. monDEF(9)=75
  165. monDEF(10)=100
  166. monXP(1)=25
  167. monXP(2)=50
  168. monXP(3)=100
  169. monXP(4)=200
  170. monXP(5)=300
  171. monXP(6)=400
  172. monXP(7)=500
  173. monXP(8)=750
  174. monXP(9)=1000
  175. monXP(10)=1500
  176. monGOLD(1)=25
  177. monGOLD(2)=50
  178. monGOLD(3)=75
  179. monGOLD(4)=100
  180. monGOLD(5)=200
  181. monGOLD(6)=250
  182. monGOLD(7)=500
  183. monGOLD(8)=750
  184. monGOLD(9)=1000
  185. monGOLD(10)=1500
  186. monNAME$(1)="Slime" 'Unlocked at lvl 1
  187. monNAME$(2)="Zombie" '5
  188. monNAME$(3)="Skeleton" '10
  189. monNAME$(4)="Clown" '20
  190. monNAME$(5)="Goblin" '25
  191. monNAME$(6)="Knight" '35
  192. monNAME$(7)="Worm" '45
  193. monNAME$(8)="Giant" '55
  194. monNAME$(9)="Demon" '65
  195. monNAME$(10)="Dragon" '75
  196.  
  197. loadnewDone=0
  198. TEXTFONT "American Typewriter", "Bold", 32
  199. DRAWSPRITE 17,40,25,5
  200. DRAWSPRITE 17,40,225,5
  201. DRAWTEXT "Load Game", 73, 65
  202. DRAWTEXT "New Game", 73, 268
  203. TEXTFONT "Arial Rounded", 22
  204. DRAWTEXT "Two-Edged Sword RPG Idler", 8,(ScreenHeight/2)-30
  205. loopB: 'Load Game / New Game
  206. TEXTFONT "Arial Rounded", 18
  207. DRAWTEXT "By TheBaykun • bit.ly/13ix4WI",31,185
  208. IF Touch=1 THEN
  209.     IF TouchX>40 AND TouchX<300 AND TouchY>25 AND TouchY<160 THEN
  210.         loadnewDone=1
  211.     END IF
  212.     IF TouchX>40 AND TouchX<300 AND TouchY>225 AND TouchY<360 THEN
  213.         loadnewDone=2
  214.     END IF
  215. END IF
  216. IF loadnewDone=0 THEN
  217.     GOTO loopB
  218. END IF
  219. CLS
  220. IF loadnewDone=1 THEN 'Load
  221.     OPEN "RPGDATA" FOR INPUT AS #1
  222.     INPUT #1, hat
  223.     INPUT #1, shirt
  224.     INPUT #1, pants
  225.     INPUT #1, shoes
  226.     INPUT #1, hp
  227.     INPUT #1, mhp
  228.     INPUT #1, lvl
  229.     INPUT #1, xp
  230.     INPUT #1, mxp
  231.     INPUT #1, str
  232.     INPUT #1, def
  233.     INPUT #1, cash
  234.     INPUT #1, mp
  235.     INPUT #1, mmp
  236.     INPUT #1, wins
  237.     INPUT #1, losses
  238.     INPUT #1, potions
  239.     INPUT #1, mppotions
  240.     INPUT #1, status
  241.     INPUT #1, pstatus
  242.     INPUT #1, cenemy
  243.     INPUT #1, isBoss
  244.     INPUT #1, eHp
  245.     CLOSE #1
  246. END IF
  247. IF loadnewDone=2 THEN 'New
  248.     hat=0 '0-Bald, 1-Hat, 2-Cowboy, 3-Crown
  249.     shirt=0 '0-Green, 1-Blue, 2-Red, 3-Yellow
  250.     pants=1 'Same colors as above
  251.     shoes=0 '0-None, 1-Shoes, 2-Boots
  252.    
  253.     hp=100 'HP
  254.     mhp=100 'Max HP
  255.     lvl=1 'Level
  256.     xp=0 'Experience
  257.     mxp=50 'Max. Exp.
  258.     cash=0
  259.     mp=30 'Magic Points / Mana
  260.     mmp=30 'Max. Mana
  261.     wins=0
  262.     losses=0
  263.     potions=0 'HP potions
  264.     mppotions=0    
  265.     status=1 'Wandering
  266.     pstatus=1 'Where to go after a fight
  267.     cenemy=0 'No current enemy
  268.     isBoss=1 'No boss (1 is off)
  269.    
  270.     touchable=1
  271.     touchcount=0
  272.     customDone=0
  273.     reloadA:
  274.     CLS
  275.     TEXTFONT "American Typewriter", "Bold", 32
  276.     DRAWTEXT "HAT", 177, 35
  277.     TEXTFONT "American Typewriter", "Bold", 22
  278.     DRAWTEXT "SHIRT", 177, 110
  279.     TEXTFONT "American Typewriter", "Bold", 21
  280.     DRAWTEXT "PANTS", 177, 182
  281.     TEXTFONT "American Typewriter", "Bold", 22
  282.     DRAWTEXT "SHOES", 177, 251
  283.     DRAWSPRITE 1, -15, 35, 10
  284.     DRAWSPRITE 2, 120,30, 2
  285.     DRAWSPRITE 3, 260,30, 2
  286.     DRAWSPRITE 2, 120,100, 2
  287.     DRAWSPRITE 3, 260,100, 2
  288.     DRAWSPRITE 2, 120,170, 2
  289.     DRAWSPRITE 3, 260,170, 2
  290.     DRAWSPRITE 2, 120,240, 2
  291.     DRAWSPRITE 3, 260,240, 2
  292.     DRAWSPRITE 15, 165,310,2
  293.     DRAWSPRITE 16, 10,290,5
  294.     IF hat>0 THEN
  295.         DRAWSPRITE hat+3, 5,-125,10
  296.     END IF
  297.     IF shirt>0 THEN
  298.         DRAWSPRITE shirt+6, -15,35,10
  299.     END IF
  300.     IF pants>1 THEN
  301.         DRAWSPRITE pants+8, -15,35,10
  302.     END IF
  303.     IF pants=0 THEN
  304.         DRAWSPRITE 12, -15,35,10
  305.     END IF
  306.     IF shoes>0 THEN
  307.         DRAWSPRITE shoes+12,-15,35,10
  308.     END IF
  309.     loopA:
  310.     SLEEP(0.01)
  311.     IF Touch>=1 AND touchable=1 THEN
  312.         IF TouchX>120 AND TouchX<170 AND TouchY>30 AND TouchY<80 THEN
  313.             hat=hat-1
  314.             IF hat<0 THEN
  315.                 hat=3
  316.             END IF
  317.             touchable=0
  318.             touchcount=0
  319.             GOTO reloadA
  320.         END IF
  321.         IF TouchX>260 AND TouchX<310 AND TouchY>30 AND TouchY<80 THEN
  322.             hat=hat+1
  323.             IF hat>3 THEN
  324.                 hat=0
  325.             END IF
  326.             touchable=0
  327.             touchcount=0
  328.             GOTO reloadA
  329.         END IF
  330.        
  331.         IF TouchX>120 AND TouchX<170 AND TouchY>100 AND TouchY<150 THEN
  332.             shirt=shirt-1
  333.             IF shirt<0 THEN
  334.                 shirt=3
  335.             END IF
  336.             touchable=0
  337.             touchcount=0
  338.             GOTO reloadA
  339.         END IF
  340.         IF TouchX>260 AND TouchX<310 AND TouchY>100 AND TouchY<150 THEN
  341.             shirt=shirt+1
  342.             IF shirt>3 THEN
  343.                 shirt=0
  344.             END IF
  345.             touchable=0
  346.             touchcount=0
  347.             GOTO reloadA
  348.         END IF
  349.        
  350.         IF TouchX>120 AND TouchX<170 AND TouchY>170 AND TouchY<220 THEN
  351.             pants=pants-1
  352.             IF pants<0 THEN
  353.                 pants=3
  354.             END IF
  355.             touchable=0
  356.             touchcount=0
  357.             GOTO reloadA
  358.         END IF
  359.         IF TouchX>260 AND TouchX<310 AND TouchY>170 AND TouchY<220 THEN
  360.             pants=pants+1
  361.             IF pants>3 THEN
  362.                 pants=0
  363.             END IF
  364.             touchable=0
  365.             touchcount=0
  366.             GOTO reloadA
  367.         END IF
  368.        
  369.         IF TouchX>120 AND TouchX<170 AND TouchY>240 AND TouchY<290 THEN
  370.             shoes=shoes-1
  371.             IF shoes<0 THEN
  372.                 shoes=2
  373.             END IF
  374.             touchable=0
  375.             touchcount=0
  376.             GOTO reloadA
  377.         END IF
  378.         IF TouchX>260 AND TouchX<310 AND TouchY>240 AND TouchY<290 THEN
  379.             shoes=shoes+1
  380.             IF shoes>2 THEN
  381.                 shoes=0
  382.             END IF
  383.             touchable=0
  384.             touchcount=0
  385.             GOTO reloadA
  386.         END IF
  387.        
  388.         IF TouchX>10 AND TouchX<65 AND TouchY>290 AND TouchY<345 THEN
  389.             ranHat=RND
  390.             IF ranHat<=0.25 THEN
  391.                 hat=0
  392.             END IF
  393.             IF ranHat>0.25 AND ranHat<=0.5 THEN
  394.                 hat=1
  395.             END IF
  396.             IF ranHat>0.5 AND ranHat<=0.75 THEN
  397.                 hat=2
  398.             END IF
  399.             IF ranHat>0.75 THEN
  400.                 hat=3
  401.             END IF
  402.             ranShirt=RND
  403.             IF ranShirt<=0.25 THEN
  404.                 shirt=0
  405.             END IF
  406.             IF ranShirt>0.25 AND ranShirt<=0.5 THEN
  407.                 shirt=1
  408.             END IF
  409.             IF ranShirt>0.5 AND ranShirt<=0.75 THEN
  410.                 shirt=2
  411.             END IF
  412.             IF ranShirt>0.75 THEN
  413.                 shirt=3
  414.             END IF
  415.             ranPants=RND
  416.             IF ranPants<=0.25 THEN
  417.                 pants=0
  418.             END IF
  419.             IF ranPants>0.25 AND ranPants<=0.5 THEN
  420.                 pants=1
  421.             END IF
  422.             IF ranPants>0.5 AND ranPants<=0.75 THEN
  423.                 pants=2      
  424.             END IF
  425.             IF ranPants>0.75 THEN
  426.                 Pants=3
  427.             END IF
  428.             ranShoes=RND
  429.             IF ranShoes<=0.33 THEN
  430.                 shoes=0
  431.             END IF
  432.             IF ranShoes>0.33 AND ranShoes<=0.67 THEN
  433.                 shoes=1
  434.             END IF
  435.             IF ranShoes>0.67 THEN
  436.                 shoes=2
  437.             END IF
  438.             touchable=0
  439.             touchcount=0
  440.             GOTO reloadA
  441.         END IF
  442.        
  443.         IF TouchX>165 AND TouchX<265 AND TouchY>310 AND TouchY<380 THEN
  444.             customDone=1
  445.         END IF
  446.     END IF
  447.     IF touchable=0 THEN
  448.         touchcount=touchcount+1
  449.     END IF
  450.     IF touchcount>=15 THEN
  451.         touchcount=0
  452.         touchable=1
  453.     END IF
  454.    
  455.     IF customDone=0 THEN
  456.         GOTO loopA
  457.     END IF
  458.    
  459.     str=INT(RND*10)+1
  460.     def=INT(RND*10)+1
  461.    
  462.    
  463.     ' Save your new character.
  464.     OPEN "RPGDATA" FOR OUTPUT AS #1
  465.     PRINT #1, hat
  466.     PRINT #1, shirt
  467.     PRINT #1, pants
  468.     PRINT #1, shoes
  469.     PRINT #1, hp
  470.     PRINT #1, mhp
  471.     PRINT #1, lvl
  472.     PRINT #1, xp
  473.     PRINT #1, mxp
  474.     PRINT #1, str
  475.     PRINT #1, def
  476.     PRINT #1, cash
  477.     PRINT #1, mp
  478.     PRINT #1, mmp
  479.     PRINT #1, wins
  480.     PRINT #1, losses
  481.     PRINT #1, potions
  482.     PRINT #1, mppotions
  483.     PRINT #1, status
  484.     PRINT #1, pstatus
  485.     PRINT #1, cenemy
  486.     PRINT #1, isBoss
  487.     PRINT #1, eHp
  488.     CLOSE #1
  489.    
  490. END IF
  491. CLS
  492. BCOLOR 75,75,75
  493.  
  494. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  495.  
  496. GOSUB stsChange
  497. IF cheatInfP=1 THEN
  498.     potions=5
  499.     mppotions=5
  500. ENDIF    
  501. touchable=1
  502. touchcount=0
  503. pauseA=0
  504. gamePaused=0
  505. DRAWSPRITE 19,ScreenWidth-52,5,2
  506. DRAWSPRITE 21,5,90,5.7
  507. DRAWSPRITE 1,-21,153,12.5
  508. DRAWSPRITE 25,215,5,2
  509. DRAWSPRITE 28,20,99,1
  510. DRAWSPRITE 31,145,155,1.5
  511. DRAWSPRITE 35,110,5,2
  512. DRAWSPRITE 38, 162,5,2
  513. DRAWSPRITE 27,-2,1,2.4
  514. COLOR 255,0,0
  515. TEXTFONT "Marker Felt",10
  516. DRAWTEXT "Two-Edged Sword",37,12
  517. DRAWTEXT "RPG - Idler",37,35
  518.  
  519. COLOR 255,250,250
  520. TEXTFONT "American Typewriter", "Bold", 16
  521. DRAWTEXT "Status:",250,195
  522. 'Update status
  523. COLOR 75,75,75
  524. RECT 249,214,350,230
  525. COLOR 255,0,0
  526. TEXTFONT "American Typewriter", 12
  527. DRAWTEXT sts$(status),249,215
  528.  
  529. 'Update use-mp-potion button
  530. COLOR 0,0,255
  531. TEXTFONT "American Typewriter", "Bold", 24
  532. DRAWSPRITE 39,198,192,2
  533. DRAWTEXT STR$(mppotions),214,205
  534.  
  535. 'Update use-potion button
  536. COLOR 255,0,0
  537. TEXTFONT "American Typewriter", "Bold", 24
  538. DRAWSPRITE 34,148,192,2
  539. DRAWTEXT STR$(potions),164,205
  540.  
  541. COLOR 0,0,255
  542. TEXTFONT "American Typewriter", "Bold", 12
  543. DRAWTEXT "MP:",162,175
  544. DRAWSPRITE 33,148,176,1
  545. 'Update MP bar
  546. COLOR 75,75,75
  547. RECT 189,163,350,187
  548. TEXTFONT "American Typewriter", 12
  549. COLOR 125,0,200
  550. RECT 190,176,280,187
  551. COLOR 0,0,255
  552. mpDraw=((mp/mmp)*100)*0.9
  553. RECT 190,176,190+mpDraw,187
  554. DRAWTEXT STR$(mp),285,175.5
  555. COLOR 255,0,0
  556.  
  557. 'Update cash
  558. COLOR 75,75,75
  559. RECT 161,155,350,172
  560. TEXTFONT "American Typewriter", "Bold",  18
  561. COLOR 0,255,0
  562. DRAWTEXT STR$(cash),161,153
  563. TEXTFONT "American Typewriter", 12
  564. COLOR 255,0,0
  565.  
  566. 'Update lvl, xp, str, and def.
  567. DRAWSPRITE 29,145,90,2.9
  568. TEXTFONT "American Typewriter", "Bold", 32
  569. COLOR 255,0,0
  570. DRAWTEXT STR$(lvl),150,110
  571. TEXTFONT "American Typewriter", 20
  572. DRAWTEXT STR$(str),213,121
  573. DRAWTEXT STR$(def),260,121
  574. COLOR 0,0,255
  575. xpDraw=((xp/mxp)*100)*1.3
  576. RECT 182.5,98.5,182.5+xpDraw,104
  577. DRAWSPRITE 30,145,90,2.9
  578. TEXTFONT "American Typewriter", 12
  579. COLOR 255,0,0
  580.  
  581. TEXTFONT "American Typewriter", "Bold", 12
  582. COLOR 255,0,0
  583. DRAWTEXT "HP:",35,98
  584. ' Display / Update health bar:
  585. hpDraw=((hp/mhp)*100)*0.3
  586. COLOR 0,0,255
  587. RECT 59,98,120,112
  588. COLOR 255,0,0
  589. RECT 59,100,89,110
  590. COLOR 0,255,0
  591. RECT 59,100,59+hpDraw,110
  592. TEXTFONT "American Typewriter", 12
  593. COLOR 255,0,0
  594. DRAWTEXT STR$(hp),92,99
  595.  
  596. 'Enemy area
  597. DRAWSPRITE 50,215,243,5
  598. IF cenemy>0 THEN
  599.     eStr=monSTR(cenemy)*isBoss 'Set strength
  600.     eDef=monDEF(cenemy)*isBoss 'Set defense
  601.     etXP=monXP(cenemy)*isBoss 'Treasure XP
  602.     etGOLD=monGOLD(cenemy)*isBoss 'Treasure $
  603.     'Update/Draw enemy HP:
  604.     COLOR 0,0,255
  605.     RECT 225,249,285,269
  606.     TEXTFONT "American Typewriter", 12
  607.     COLOR 255,0,0
  608.     DRAWTEXT STR$(eHp)+" HP",226,248
  609.     'Update/Draw monster:
  610.     DRAWSPRITE 39+cenemy,218,261,3
  611.     IF isBoss=2 THEN
  612.         TEXTFONT "American Typewriter", "Bold", 14
  613.         COLOR 255,255,0
  614.         DRAWTEXT "• BOSS •",226,261
  615.     ENDIF
  616. ENDIF
  617. DIM triAx(3),triAy(3),triBx(3),triBy(3)
  618. triAx(1)=146
  619. triAy(1)=270
  620. triAx(2)=150
  621. triAy(2)=265
  622. triAx(3)=150
  623. triAy(3)=275
  624. triBx(1)=206
  625. triBy(1)=338
  626. triBx(2)=206
  627. triBy(2)=328
  628. triBx(3)=210
  629. triBy(3)=333
  630. 'Action display:
  631. COLOR 200,200,200
  632. SHAPE 3,triAx,triAy
  633. SHAPE 3,triBx,triBy
  634. RRECT 150,243,210,300,5
  635. RRECT 146,305,206,362,5
  636.  
  637. TEXTFONT "American Typewriter", 12
  638. COLOR 255,0,0
  639. IF hat>0 THEN
  640.     DRAWSPRITE hat+3, 4,-47,12.5
  641. END IF
  642. IF shirt>0 THEN
  643.     DRAWSPRITE shirt+6, -21,153,12.5
  644. END IF
  645. IF pants>1 THEN
  646.     DRAWSPRITE pants+8, -21,153,12.5
  647. END IF
  648. IF pants=0 THEN
  649.     DRAWSPRITE 12, -21,153,12.5
  650. END IF
  651. IF shoes>0 THEN
  652.     DRAWSPRITE shoes+12,-21,153,12.5
  653. END IF
  654.  
  655. loopC:
  656. IF Touch>=1 AND touchable=1 THEN
  657.     IF TouchX>=ScreenWidth-52 AND TouchX<=ScreenWidth-5 AND TouchY>=5 AND TouchY<=52 THEN
  658.         OPEN "RPGDATA" FOR OUTPUT AS #1
  659.         PRINT #1, hat
  660.         PRINT #1, shirt
  661.         PRINT #1, pants
  662.         PRINT #1, shoes
  663.         PRINT #1, hp
  664.         PRINT #1, mhp
  665.         PRINT #1, lvl
  666.         PRINT #1, xp
  667.         PRINT #1, mxp
  668.         PRINT #1, str
  669.         PRINT #1, def
  670.         PRINT #1, cash
  671.         PRINT #1, mp
  672.         PRINT #1, mmp
  673.         PRINT #1, wins
  674.         PRINT #1, losses
  675.         PRINT #1, potions
  676.         PRINT #1, mppotions
  677.         PRINT #1, status
  678.         PRINT #1, pstatus
  679.         PRINT #1, cenemy  
  680.         PRINT #1, isBoss
  681.         PRINT #1, eHp
  682.         CLOSE #1
  683.         COLOR 75,75,75
  684.         RECT 2,55,ScreenWidth-2,87
  685.         COLOR 255,0,0
  686.         DRAWSPRITE 20, 190,55,2
  687.         TEXTFONT "American Typewriter", 18
  688.         DRAWTEXT "Game saved.",195,65
  689.         touchable=0
  690.         touchcount=0
  691.     END IF
  692.     IF TouchX>=215 AND TouchX<=270 AND TouchY>=5 AND TouchY<=52 THEN
  693.         COLOR 75,75,75
  694.         RECT 2,55,ScreenWidth-2,87
  695.         COLOR 255,0,0
  696.         DRAWSPRITE 24, 136,55,2
  697.         TEXTFONT "American Typewriter", 18
  698.         IF gamePaused=0 THEN
  699.             gamePaused=1
  700.             DRAWSPRITE 26,215,5,2
  701.             DRAWTEXT "Game paused.",148,65
  702.             pauseA=1
  703.         END IF
  704.         IF gamePaused=1 AND pauseA=0 THEN
  705.             gamePaused=0
  706.             DRAWSPRITE 25,215,5,2
  707.             DRAWTEXT "Game resumed.",142,65
  708.         END IF
  709.         pauseA=0
  710.         touchable=0
  711.         touchcount=0
  712.     END IF
  713.     IF TouchX>=110 AND TouchX<=158 AND TouchY>=5 AND TouchY<=52 AND cash>=500 AND potions<5 THEN
  714.         cash=cash-500
  715.         potions=potions+1
  716.         touchable=0
  717.         touchcount=0
  718.         COLOR 75,75,75
  719.         RECT 2,55,ScreenWidth-2,87
  720.         COLOR 255,0,0
  721.         DRAWSPRITE 24, 31,55,2
  722.         TEXTFONT "American Typewriter", 18
  723.         DRAWTEXT "+1 HP potion.",46,65
  724.         COLOR 255,0,0
  725.         TEXTFONT "American Typewriter", "Bold", 24
  726.         DRAWSPRITE 34,148,192,2
  727.         DRAWTEXT STR$(potions),164,205
  728.     ENDIF
  729.     IF TouchX>=162 AND TouchX<=210 AND TouchY>=5 AND TouchY<=52 AND cash>=250 AND mppotions<5 THEN
  730.         cash=cash-250
  731.         mppotions=mppotions+1
  732.         touchable=0
  733.         touchcount=0
  734.         COLOR 75,75,75
  735.         RECT 2,55,ScreenWidth-2,87
  736.         COLOR 255,0,0
  737.         DRAWSPRITE 24, 83,55,2
  738.         TEXTFONT "American Typewriter", 18
  739.         DRAWTEXT "+1 MP potion.",98,65
  740.         COLOR 0,0,255
  741.         TEXTFONT "American Typewriter", "Bold", 24
  742.         DRAWSPRITE 39,198,192,2
  743.         DRAWTEXT STR$(mppotions),214,205
  744.     ENDIF
  745.     IF TouchX>=148 AND TouchX<=196 AND TouchY>=192 AND TouchY<=239 AND hp<mhp AND potions>0 THEN
  746.         hp=hp+25
  747.         IF hp>mhp THEN
  748.             hp=mhp
  749.         ENDIF
  750.         IF cheatInfP=0 THEN
  751.             potions=potions-1
  752.         ENDIF            
  753.         touchable=0
  754.         touchcount=0
  755.         hpDraw=((hp/mhp)*100)*0.3
  756.         COLOR 0,0,255
  757.         RECT 59,98,120,112
  758.         COLOR 255,0,0
  759.         RECT 59,100,89,110
  760.         COLOR 0,255,0
  761.         RECT 59,100,59+hpDraw,110
  762.         TEXTFONT "American Typewriter", 12
  763.         COLOR 255,0,0
  764.         DRAWTEXT STR$(hp),92,99
  765.         COLOR 255,0,0
  766.         TEXTFONT "American Typewriter", "Bold", 24
  767.         DRAWSPRITE 34,148,192,2
  768.         DRAWTEXT STR$(potions),164,205
  769.     ENDIF
  770.     IF TouchX>=198 AND TouchX<=246 AND TouchY>=192 AND TouchY<=239 AND mp<mmp AND mppotions>0 THEN
  771.         mp=mp+25
  772.         IF mp>mmp THEN
  773.             mp=mmp
  774.         ENDIF
  775.         IF cheatInfP=0 THEN
  776.             mppotions=mppotions-1
  777.         ENDIF            
  778.         touchable=0
  779.         touchcount=0
  780.         COLOR 0,0,255
  781.         DRAWSPRITE 33,148,176,1
  782.         'Update MP bar
  783.         COLOR 75,75,75
  784.         RECT 189,163,350,187
  785.         TEXTFONT "American Typewriter", 12
  786.         COLOR 125,0,200
  787.         RECT 190,176,280,187
  788.         COLOR 0,0,255
  789.         mpDraw=((mp/mmp)*100)*0.9
  790.         RECT 190,176,190+mpDraw,187
  791.         DRAWTEXT STR$(mp),285,175.5
  792.         COLOR 0,0,255
  793.         TEXTFONT "American Typewriter", "Bold", 24
  794.         DRAWSPRITE 39,198,192,2
  795.         DRAWTEXT STR$(mppotions),214,205
  796.     ENDIF
  797. END IF
  798. IF Touch>=1 AND TouchX>=215 AND TouchY>=243 AND cenemy>0 AND mp>0 THEN 'Attack enemy
  799.     mp=mp-1
  800.     randDmg=1+(INT(RND*(INT(str/2))))
  801.     randDmg=randDmg-(INT(eDef/3))
  802.     IF randDmg<1 THEN
  803.         randDmg=1
  804.     ENDIF
  805.     eHp=INT(eHp-randDmg)
  806.     COLOR 0,0,255
  807.     RECT 225,249,285,263
  808.     TEXTFONT "American Typewriter", 12
  809.     COLOR 255,0,0
  810.     DRAWTEXT STR$(eHp)+" HP",226,248
  811.    
  812.     COLOR 200,200,200
  813.     SHAPE 3,triAx,triAy
  814.     RRECT 150,243,210,300,5
  815.     COLOR 255,0,0
  816.     DRAWTEXT "You hurt",152,245
  817.     DRAWTEXT monNAME$(cenemy),153,258
  818.     DRAWTEXT "for "+STR$(randDmg),153,271
  819.     DRAWTEXT "health.",153,284
  820.     COLOR 75,75,75
  821.     RECT 189,163,350,187
  822.     TEXTFONT "American Typewriter", 12
  823.     COLOR 125,0,200
  824.     RECT 190,176,280,187
  825.     COLOR 0,0,255
  826.     mpDraw=((mp/mmp)*100)*0.9
  827.     RECT 190,176,190+mpDraw,187
  828.     DRAWTEXT STR$(mp),285,175.5
  829.     IF eHp<=0 THEN
  830.         cash=cash+(etGOLD*treas)
  831.         xp=xp+(etXP*treas)
  832.         status=pstatus
  833.         DRAWSPRITE 50,215,243,5
  834.         GOSUB stsChange
  835.         cenemy=0
  836.         COLOR 200,200,200
  837.         SHAPE 3,triAx,triAy
  838.         SHAPE 3,triBx,triBy
  839.         RRECT 150,243,210,300,5
  840.         RRECT 146,305,206,362,5
  841.         IF isBoss=2 THEN
  842.             isBoss=1
  843.             status=1
  844.             GOSUB stsChange
  845.         ENDIF
  846.     ENDIF
  847. ENDIF
  848. IF touchable=0 THEN
  849.     touchcount=touchcount+1
  850. END IF
  851. IF touchcount>=15 AND gamePaused=1 THEN
  852.     touchable=1
  853.     touchcount=0
  854. END IF
  855. IF touchcount>=5 AND gamePaused=0 THEN
  856.     touchable=1
  857.     touchcount=0
  858. END IF
  859.  
  860. IF gamePaused=0 THEN
  861.     IF status=2 OR status=3 THEN
  862.         IF status=3 AND mp<mmp THEN
  863.             mp=mp+1
  864.             COLOR 75,75,75
  865.             RECT 189,163,350,187
  866.             TEXTFONT "American Typewriter", 12
  867.             COLOR 125,0,200
  868.             RECT 190,176,280,187
  869.             COLOR 0,0,255
  870.             mpDraw=((mp/mmp)*100)*0.9
  871.             RECT 190,176,190+mpDraw,187
  872.             DRAWTEXT STR$(mp),285,175.5
  873.         ENDIF
  874.         IF status=3 AND hp<mhp THEN
  875.             hp=hp+1
  876.             IF hp>mhp THEN
  877.                 hp=mhp
  878.             ENDIF
  879.             hpDraw=((hp/mhp)*100)*0.3
  880.             COLOR 0,0,255
  881.             RECT 59,98,120,112
  882.             COLOR 255,0,0
  883.             RECT 59,100,89,110
  884.             COLOR 0,255,0
  885.             RECT 59,100,59+hpDraw,110
  886.             TEXTFONT "American Typewriter", 12
  887.             COLOR 255,0,0
  888.             DRAWTEXT STR$(hp),92,99
  889.            
  890.         ELSE
  891.             IF status=3 AND hp>=mhp THEN
  892.                 status=pstatus
  893.                 GOSUB stsChange
  894.             ENDIF            
  895.         ENDIF
  896.         IF status=2 THEN
  897.             randEvt=RND
  898.             IF randEvt<=0.03 THEN 'Attack enemy
  899.                 randDmg=1+(INT(RND*str))
  900.                 randDmg=randDmg-(INT(eDef/3))
  901.                 IF randDmg<1 THEN
  902.                     randDmg=1
  903.                 ENDIF
  904.                 eHp=INT(eHp-randDmg)
  905.                 'Update/Draw enemy HP:
  906.                 COLOR 0,0,255
  907.                 RECT 225,249,285,263
  908.                 TEXTFONT "American Typewriter", 12
  909.                 COLOR 255,0,0
  910.                 DRAWTEXT STR$(eHp)+" HP",226,248
  911.                
  912.                 COLOR 200,200,200
  913.                 SHAPE 3,triAx,triAy
  914.                 RRECT 150,243,210,300,5
  915.                 COLOR 255,0,0
  916.                 DRAWTEXT "You hurt",152,245
  917.                 DRAWTEXT monNAME$(cenemy),153,258
  918.                 DRAWTEXT "for "+STR$(randDmg),153,271
  919.                 DRAWTEXT "health.",153,284
  920.                
  921.                 IF eHp<=0 THEN
  922.                     cash=cash+(etGOLD*treas)
  923.                     xp=xp+(etXP*treas)
  924.                     status=pstatus
  925.                     DRAWSPRITE 50,215,243,5
  926.                     GOSUB stsChange
  927.                     cenemy=0
  928.                     COLOR 200,200,200
  929.                     SHAPE 3,triAx,triAy
  930.                     SHAPE 3,triBx,triBy
  931.                     RRECT 150,243,210,300,5
  932.                     RRECT 146,305,206,362,5
  933.                     IF isBoss=2 THEN
  934.                         isBoss=1
  935.                         status=1
  936.                         GOSUB stsChange
  937.                     ENDIF
  938.                 ENDIF
  939.             ENDIF
  940.             IF randEvt<=0.06 AND randEvt>0.03 THEN 'Attack you
  941.                 randDmg=1+((INT(difficulty/2))*(INT(RND*eStr)))
  942.                 randDmg=randDmg-(INT(def/3))
  943.                 IF randDmg<1 THEN
  944.                     randDmg=1
  945.                 ENDIF
  946.                 IF cheatInv=0 THEN
  947.                     hp=INT(hp-randDmg)
  948.                 ENDIF
  949.                 hpDraw=((hp/mhp)*100)*0.3
  950.                 COLOR 0,0,255
  951.                 RECT 59,98,120,112
  952.                 COLOR 255,0,0
  953.                 RECT 59,100,89,110
  954.                 COLOR 0,255,0
  955.                 RECT 59,100,59+hpDraw,110
  956.                 TEXTFONT "American Typewriter", 12
  957.                 COLOR 255,0,0
  958.                 DRAWTEXT STR$(hp),92,99
  959.                
  960.                 COLOR 200,200,200
  961.                 SHAPE 3,triBx,triBy
  962.                 RRECT 146,305,206,362,5
  963.                 COLOR 255,0,0
  964.                 DRAWTEXT monNAME$(cenemy),148,307
  965.                 DRAWTEXT "hurts you",148,320
  966.                 DRAWTEXT "for "+STR$(randDmg),148,333
  967.                 DRAWTEXT "health.",148,346
  968.                
  969.             ENDIF
  970.             IF randEvt<=0.07 AND randEvt>0.06 AND hp<=(mhp-25) AND potions>0 THEN 'Use potion
  971.                 IF cheatInfP=0 THEN
  972.                     potions=potions-1                
  973.                 ENDIF
  974.                 hp=hp+25
  975.                 IF hp>mhp THEN
  976.                     hp=mhp
  977.                 ENDIF
  978.                 hpDraw=((hp/mhp)*100)*0.3
  979.                 COLOR 0,0,255
  980.                 RECT 59,98,120,112
  981.                 COLOR 255,0,0
  982.                 RECT 59,100,89,110
  983.                 COLOR 0,255,0
  984.                 RECT 59,100,59+hpDraw,110
  985.                 TEXTFONT "American Typewriter", 12
  986.                 COLOR 255,0,0
  987.                 DRAWTEXT STR$(hp),92,99
  988.                 TEXTFONT "American Typewriter", "Bold", 24
  989.                 DRAWSPRITE 34,148,192,2
  990.                 DRAWTEXT STR$(potions),164,205
  991.             ENDIF
  992.         ENDIF
  993.     ELSE  
  994.         IF RND<(mChance/100) THEN
  995.             GOSUB monster
  996.         ENDIF
  997.         IF RND<(tChance/100) THEN
  998.             GOSUB treasure
  999.         ENDIF    
  1000.     ENDIF    
  1001.     IF cash>9999999 THEN
  1002.         cash=9999999-cheatCash
  1003.     ENDIF        
  1004.     IF cash<9999999 THEN
  1005.         cash=cash+cheatCash
  1006.         COLOR 75,75,75
  1007.         RECT 161,155,350,172
  1008.         TEXTFONT "American Typewriter", "Bold",  18
  1009.         COLOR 0,255,0
  1010.         DRAWTEXT STR$(cash),161,153
  1011.         TEXTFONT "American Typewriter", 12
  1012.         COLOR 255,0,0
  1013.     END IF
  1014.     IF RND<=0.01 AND cash>=500 AND potions<5 AND hp<mhp THEN 'buy potion
  1015.         potions=potions+1
  1016.         cash=cash-500
  1017.         COLOR 255,0,0
  1018.         TEXTFONT "American Typewriter", "Bold", 24
  1019.         DRAWSPRITE 34,148,192,2
  1020.         DRAWTEXT STR$(potions),164,205
  1021.     ENDIF
  1022.     IF status=1 OR status=4 OR status=5 THEN
  1023.         IF RND<=0.01 AND hp<=(INT(mhp/2)) THEN
  1024.             status=3
  1025.             GOSUB stsChange
  1026.         ENDIF
  1027.     ENDIF
  1028.     IF status=1 AND RND<=0.01 THEN
  1029.         status=4
  1030.         GOSUB stsChange
  1031.     ENDIF
  1032.     IF status=4 AND RND<=0.01 THEN
  1033.         status=1
  1034.         GOSUB stsChange
  1035.     ENDIF
  1036.     IF status=4 AND RND<=0.01 THEN
  1037.         status=5
  1038.         GOSUB stsChange
  1039.     ENDIF
  1040.     IF status=5 AND bossDef=1 THEN
  1041.         status=1
  1042.         bossDef=0
  1043.         GOSUB stsChange
  1044.     ENDIF
  1045.     xp=xp+cheatXP
  1046.     DRAWSPRITE 32,145,90,2.9
  1047.     COLOR 0,0,255
  1048.     xpDraw=((xp/mxp)*100)*1.3
  1049.     RECT 182.5,98.5,182.5+xpDraw,104
  1050.     DRAWSPRITE 30,145,90,2.9
  1051.     IF xp>=mxp THEN
  1052.         IF lvl<99 THEN
  1053.             lvl=lvl+1
  1054.         ENDIF        
  1055.         xp=0
  1056.         mxp=INT(mxp*1.1)
  1057.         strRand=RND
  1058.         IF strRand<=0.5 THEN
  1059.             str=str+1
  1060.         ELSE
  1061.             str=str+2
  1062.         END IF
  1063.         defRand=RND
  1064.         IF defRand<=0.5 THEN
  1065.             def=def+1
  1066.         ELSE
  1067.             def=def+2
  1068.         END IF
  1069.         mhpRand=RND
  1070.         IF mhpRand<=0.5 THEN
  1071.             mhp=mhp+1
  1072.             hp=hp+1
  1073.         ELSE
  1074.             mhp=mhp+3
  1075.             hp=hp+3
  1076.         END IF
  1077.         IF mmpRand<=0.5 THEN
  1078.             mmp=mmp+1
  1079.             mp=mp+1
  1080.         ELSE
  1081.             mmp=mmp+2
  1082.             mp=mp+2
  1083.         END IF
  1084.         COLOR 75,75,75
  1085.         RECT 189,163,350,187
  1086.         TEXTFONT "American Typewriter", 12
  1087.         COLOR 125,0,200
  1088.         RECT 190,176,280,187
  1089.         COLOR 0,0,255
  1090.         mpDraw=((mp/mmp)*100)*0.9
  1091.         RECT 190,176,190+mpDraw,187
  1092.         DRAWTEXT STR$(mp),285,175.5
  1093.         COLOR 255,0,0
  1094.         hpDraw=((hp/mhp)*100)*0.3
  1095.         COLOR 0,0,255
  1096.         RECT 59,98,120,112
  1097.         COLOR 255,0,0
  1098.         RECT 59,100,89,110
  1099.         COLOR 0,255,0
  1100.         RECT 59,100,59+hpDraw,110
  1101.         TEXTFONT "American Typewriter", 12
  1102.         COLOR 255,0,0
  1103.         DRAWTEXT STR$(hp),92,99
  1104.         DRAWSPRITE 29,145,90,2.9
  1105.         TEXTFONT "American Typewriter", "Bold", 32
  1106.         COLOR 255,0,0
  1107.         DRAWTEXT STR$(lvl),150,110
  1108.         TEXTFONT "American Typewriter", 20
  1109.         DRAWTEXT STR$(str),213,121
  1110.         DRAWTEXT STR$(def),260,121
  1111.         COLOR 0,0,255
  1112.         xpDraw=((xp/mxp)*100)*1.3
  1113.         RECT 182.5,98.5,182.5+xpDraw,104
  1114.         DRAWSPRITE 30,145,90,2.9
  1115.         TEXTFONT "American Typewriter", 12
  1116.         COLOR 75,75,75
  1117.         RECT 310,90,320,115
  1118.     END IF
  1119. END IF
  1120.  
  1121. SLEEP(0.01)
  1122. IF hp>0 THEN
  1123.     GOTO loopC
  1124. ENDIF    
  1125. CLS
  1126. PRINT "GAME OVER!"
  1127. PRINT "Level:",lvl
  1128. PRINT "$",cash
  1129. PRINT ""
  1130. OPEN "tesrpgidata" FOR INPUT AS #1
  1131. INPUT #1, hiScore
  1132. CLOSE #1
  1133. IF lvl>hiScore THEN
  1134.     hiScore=lvl
  1135. ENDIF
  1136. OPEN "tesrpgidata" FOR OUTPUT AS #1
  1137. PRINT #1, hiScore
  1138. CLOSE #1
  1139. PRINT "Highest Score: Level",hiScore
  1140. END
  1141.  
  1142. stsChange:
  1143. IF status=1 OR status=4 OR status=5 THEN
  1144.     pstatus=status
  1145. ENDIF
  1146. IF status=1 THEN 'Set chance of monsters attacking %, treasure, and difficulty.
  1147.     mChance=1
  1148.     tChance=0.33    
  1149.     treas=1    
  1150. ENDIF
  1151. IF status=2 OR status=3 THEN 'Fighting/Resting
  1152.     mChance=0
  1153.     tChance=0
  1154. ENDIF
  1155. IF status=4 THEN 'Hunting
  1156.     mChance=2
  1157.     tChance=1
  1158.     treas=2    '2x treasure
  1159. ENDIF
  1160. IF status=5 THEN 'Dungeon
  1161.     mChance=3
  1162.     tChance=2
  1163.     treas=3    '3x more treasure(xp/gold/...)
  1164. ENDIF
  1165. COLOR 75,75,75
  1166. RECT 249,214,350,230
  1167. COLOR 255,0,0
  1168. TEXTFONT "American Typewriter", 12
  1169. DRAWTEXT sts$(status),249,215
  1170. RETURN
  1171.  
  1172. monster:
  1173. pstatus=status
  1174. status=2
  1175. GOSUB stsChange
  1176. randMon=1+(INT(RND*10))
  1177. IF randMon>=2 AND lvl<=5 THEN
  1178.     randMon=1
  1179. ENDIF
  1180. IF randMon>=3 AND lvl<=10 THEN
  1181.     randMon=1+(INT(RND*2))
  1182. ENDIF
  1183. IF randMon>=4 AND lvl<=20 THEN
  1184.     randMon=1+(INT(RND*3))
  1185. ENDIF
  1186. IF randMon>=5 AND lvl<=25 THEN
  1187.     randMon=1+(INT(RND*4))
  1188. ENDIF
  1189. IF randMon>=6 AND lvl<=35 THEN
  1190.     randMon=1+(INT(RND*5))
  1191. ENDIF
  1192. IF randMon>=7 AND lvl<=45 THEN
  1193.     randMon=1+(INT(RND*6))
  1194. ENDIF
  1195. IF randMon>=8 AND lvl<=55 THEN
  1196.     randMon=1+(INT(RND*7))
  1197. ENDIF
  1198. IF randMon>=9 AND lvl<=65 THEN
  1199.     randMon=1+(INT(RND*8))
  1200. ENDIF
  1201. IF randMon>=10 AND lvl<=75 THEN
  1202.     randMon=1+(INT(rand*9))
  1203. ENDIF
  1204. cenemy=randMon
  1205. IF pstatus=5 AND RND<=0.2 THEN
  1206.     isBoss=2 'on
  1207. ELSE
  1208.     isBoss=1 'off
  1209. ENDIF
  1210. eHp=monHP(randMon)*isBoss 'Set health
  1211. eStr=monSTR(randMon)*isBoss 'Set strength
  1212. eDef=monDEF(randMon)*isBoss 'Set defense
  1213. etXP=monXP(randMon)*isBoss 'Treasure XP
  1214. etGOLD=monGOLD(randMon)*isBoss 'Treasure $
  1215. 'Update/Draw enemy HP:
  1216. COLOR 0,0,255
  1217. RECT 225,249,285,263
  1218. TEXTFONT "American Typewriter", 12
  1219. COLOR 255,0,0
  1220. DRAWTEXT STR$(eHp)+" HP",226,248
  1221. 'Update/Draw monster:
  1222. DRAWSPRITE 39+randMon,218,261,3
  1223. IF isBoss=2 THEN
  1224.     TEXTFONT "American Typewriter", "Bold", 14
  1225.     COLOR 255,255,0
  1226.     DRAWTEXT "• BOSS •",226,261
  1227. ENDIF
  1228. RETURN
  1229.  
  1230. treasure:
  1231. cash=cash+(50*treas)
  1232. xp=xp+(50*treas)
  1233. COLOR 200,200,200
  1234. SHAPE 3,triAx,triAy
  1235. RRECT 150,243,210,300,5
  1236. TEXTFONT "American Typewriter",12
  1237. COLOR 255,0,0
  1238. DRAWTEXT "You found",152,245
  1239. DRAWTEXT "$"+STR$(50*treas)+" and",152,258
  1240. DRAWTEXT STR$(50*treas)+" XP.",152,271
  1241. RETURN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement