RCRPG/uBasic-4tH: Difference between revisions
Content added Content deleted
(Added uBasic/4tH version) |
(Some minor cleanups in the code - spelling, long lines, etc.) |
||
Line 34: | Line 34: | ||
== The code == |
== The code == |
||
⚫ | |||
<lang> |
|||
⚫ | |||
i = Rnd(36) ' now place the person in a room, floor 0 |
i = Rnd(36) ' now place the person in a room, floor 0 |
||
Line 93: | Line 92: | ||
Print : Print |
Print : Print |
||
Print "Things of interest here:" |
Print "Things of interest here:" ' list anything of interest |
||
b@ = And(@r(a@)/65536, 255) |
b@ = And(@r(a@)/65536, 255) ' calculate pieces of gold |
||
c@ = And(@r(a@)/256, 255) |
c@ = And(@r(a@)/256, 255) ' calculate sledges |
||
If b@ Then Print "\t";b@;" piece(s) of gold" |
If b@ Then Print "\t";b@;" piece(s) of gold" |
||
Line 103: | Line 102: | ||
If @r(a@)/128 = 0 Then Print "\tNothing" |
If @r(a@)/128 = 0 Then Print "\tNothing" |
||
If And(@r(a@), 64) Then ' see if we are in the prize room |
If And(@r(a@), 64) Then ' see if we are in the prize room |
||
Print |
Print |
||
Print "You found the Prize Room!" |
Print "You found the Prize Room!" |
||
Line 118: | Line 117: | ||
While Len(c) ' any string left? |
While Len(c) ' any string left? |
||
While Peek(c, 0) = Ord(" ") ' is it a space? |
While Peek(c, 0) = Ord(" ") ' is it a space? |
||
c = Chop(c, 1) ' split off space |
c = Chop(c, 1) ' split off space |
||
Next |
Next |
||
Line 163: | Line 162: | ||
Proc _TakeAll ' be greedy |
Proc _TakeAll ' be greedy |
||
Else Print "Hey, just what you see, pal!\n" |
Else Print "Hey, just what you see, pal!\n" |
||
EndIf EndIf EndIf EndIf ' no |
EndIf EndIf EndIf EndIf ' no such thing |
||
Return |
Return |
||
Line 207: | Line 206: | ||
EndIf |
EndIf |
||
Push ((And(i/65536, 255) + And(@r(a@)/65526, 255)) * 65536) |
|||
Push ((And(i/256, 255) + And(@r(a@)/256, 255)) * 256) |
|||
i = ((i/16777216) * 16777216) + Pop() + Pop() + a@ |
|||
@r(a@) = And(@r(a@), 63) |
@r(a@) = And(@r(a@), 63) |
||
Else |
Else |
||
Line 222: | Line 223: | ||
If Comp(a@, "sledge") = 0 Then |
If Comp(a@, "sledge") = 0 Then |
||
Proc _EquipSledge |
Proc _EquipSledge ' equip the sledge |
||
Else If Comp(a@, "ladder") = 0 Then |
Else If Comp(a@, "ladder") = 0 Then |
||
Proc _EquipLadder |
Proc _EquipLadder ' equip the ladder |
||
Else Print "You can't equip that.\n" |
Else Print "You can't equip that.\n" |
||
EndIf EndIf |
EndIf EndIf ' no such thing |
||
Return |
Return |
||
Line 265: | Line 266: | ||
Proc _DropAll ' be greedy |
Proc _DropAll ' be greedy |
||
Else Print "You can't drop what you don't have.\n" |
Else Print "You can't drop what you don't have.\n" |
||
EndIf EndIf EndIf EndIf ' no |
EndIf EndIf EndIf EndIf ' no such thing |
||
Return |
Return |
||
Line 314: | Line 315: | ||
EndIf |
EndIf |
||
Push ((@r(a@)/65536 + And(i/65536, 255)) * 65536) |
|||
Push ((And(@r(a@)/256, 255) + And(i/256, 255)) * 256) |
|||
@r(a@) = Pop() + Pop() + And(@r(a@), 255) |
|||
i = And(i, 255) |
i = And(i, 255) |
||
Else |
Else |
||
Line 379: | Line 382: | ||
Print |
Print |
||
Print "take (all|item name)" |
Print "take (all|item name)" |
||
Print "\ |
Print "\tTake the item specified. Or take everything in the room." |
||
Print |
Print |
||
Print "inventory" |
Print "inventory" |
||
Line 505: | Line 508: | ||
Print "Equip the sledge first. If you got one..\n" |
Print "Equip the sledge first. If you got one..\n" |
||
EndIf |
EndIf |
||
Return |
Return</lang> |
||
</lang> |