|
Post by anton2012 on Mar 10, 2024 20:33:25 GMT
so ive been working on my own rpg where you battle different monsters,so here's the problem:i want every round to reset the fight but idk how to do that here is the code there is a "GameRound" variable and i want every round to reset the fight(like i mentioned) so here is the code:
' Player Variables
NumXP = 0
NumGold = 0
YourHealth = 20 + (NumXP - 1) * 4
PlayerWepaon$ = "Stick"
PlayerArmor$ = "Bandage"
PlayerATK = 2
PlayerDF = 1
' Dummy Variables
DummySpare = 1
DummyHealth = 20
DummyHappy = 1
DummyName$ = "Dummy"
DummyDialogue$ = "..."
' Item Variables
Item1 = 2
Item1Name$ = "Crab Apple"
Item2 = 3
Item2Name$ = "Sea Tea"
Item3 = 1
Item3Name$ = "Cinnamon-Buttersctotch Pie"
Item4 = 5
Item4Name$ = "Monster Candy"
Item5 = 3
Item5Name$ = "Spider Donut"
' Game Variables
RandomDamege = 0
GameRound = 0
PRINT DummyName$; " HAS APEARED!"
PRINT "1. FIGHT"
PRINT "2. ACT"
PRINT "3. ITEM"
PRINT "4. MERCY"
PRINT DummyName$; ": " ;DummyDialogue$
DO
INPUT "Action:" ;actionChoice
SELECT CASE actionChoice
CASE 1
GOSUB 300
CASE 2
GOSUB 310
CASE 3
GOSUB 320
CASE 4
GOSUB 330
CASE ELSE
PRINT "Invalid choice. Please enter a number from the menu."
END SELECT
if YourHealth <= 0 then
Print "You loose"
end
end if
if DummyHappy = 0 then
PRINT DummyName$; " is smiling"
DummySpare=DummySpare=-1
end if
if DummyHealth <= 0 then
NumXP=NumXP+int(rnd(1)*2)
NumGold=NumGold+int(rnd(1)*10)
PRINT "YOU WON!"
PRINT "you got " ;NumXP; " XP"
PRINT "and " ;NumGold; " GOLD"
GameRound = GameRound + 1
end if
LOOP UNTIL TRUE
END
300 REM
PRINT DummyName$
RandomDamege=int(rnd(1)*5)
RandomDamege=RandomDamege+PlayerATK
PRINT "took "; RandomDamege; " damege!"
DummyHealth=DummyHealth - RandomDamege
PRINT "DummyHealth "; DummyHealth
RandomDamege=int(rnd(1)*5)
RandomDamege=int(rnd(1)*5)
PRINT "You got "; RandomDamege; " damege!"
RandomDamege=RandomDamege-PlayerDF
YourHealth=YourHealth-RandomDamege-PlayerDF
PRINT "YourHealth "; YourHealth
RETURN
310 REM
PRINT "you complement " ;DummyName$
PRINT "It seems flattered"
RandomDamege=int(rnd(1)*5)
PRINT "You got "; RandomDamege ; " damege!"
RandomDamege=RandomDamege-PlayerDF
YourHealth=YourHealth-RandomDamege-PlayerDF
PRINT "YourHealth "; YourHealth
RETURN
320 REM
PRINT "CHOSE ITEM"
PRINT "1. " ; Item1; " " ;Item1Name$; "(s)"
PRINT "2. " ; Item2; " " ;Item2Name$; "(s)"
PRINT "3. " ; Item3; " " ;Item3Name$; "(s)"
PRINT "4. " ; Item4; " " ;Item4Name$; "(s)"
PRINT "5. " ; Item5; " " ;Item5Name$; "(s)"
INPUT "Item:" ;itemChoice
SELECT CASE itemChoice
CASE 1
GOSUB 100
CASE 2
GOSUB 110
CASE 3
GOSUB 120
CASE 4
GOSUB 130
CASE 5
GOSUB 140
CASE ELSE
PRINT "you dont have this item..."
END SELECT
RETURN
100 REM
IF Item1>0 THEN
YourHealth=YourHealth+5
PRINT "Your Health ";YourHealth
Item1=Item1-1
ELSE
PRINT "you ran out of this item"
end if
RETURN
110 REM
IF Item2>0 THEN
YourHealth=YourHealth+7
PRINT "Your Health ";YourHealth
Item2=Item2-1
ELSE
PRINT "you ran out of this item"
end if
RETURN
120 REM
IF Item3>0 THEN
YourHealth=YourHealth+20
PRINT "Your Health ";YourHealth
Item3=Item3-1
ELSE
PRINT "you ran out of this item"
end if
RETURN
130 REM
IF Item4>0 THEN
YourHealth=YourHealth+3
PRINT "Your Health ";YourHealth
Item4=Item4-1
ELSE
PRINT "you ran out of this item"
end if
RETURN
140 REM
IF Item5>0 THEN
YourHealth=YourHealth+10
PRINT "Your Health ";YourHealth
Item5=Item5-1
ELSE
PRINT "you ran out of this item"
end if
RETURN
RETURN
330 REM
IF DummySpare>0 THEN
PRINT DummyName$; " is too angry to be spared"
RandomDamege=int(rnd(1)*5)
PRINT "You got "; RandomDamege; " damege!"
RandomDamege=RandomDamege-PlayerDF
YourHealth=YourHealth-RandomDamege-PlayerDF
PRINT "YourHealth "; YourHealth
end if
IF DummySpare=0 THEN
NumXP=NumXP+int(rnd(1)*2)
NumGold=NumGold+int(rnd(1)*10)
PRINT "YOU WON!"
PRINT DummyName$
PRINT "you got " ;NumXP; " XP"
PRINT "and " ;NumGold; " GOLD"
GameRound = GameRound + 1
end if
RETURN
|
|
|
Post by plus on Mar 10, 2024 21:28:51 GMT
? Does this end a round: LOOP UNTIL TRUE
Don't you mean until done = TRUE, which BTW TRUE = 0 until you say something like TRUE = 1 (or -1)
So when the round loop is exited you want to goto [restart] where you reset all the variables for the next round and BTW before [restart] you set all the variables for the game that you don't want to reset each round.
repeat: 1 set the variables for the game that don't change each round 2 set a [restart] label 3 set the variabes that start a round 4 play the round in a loop 5 when exit round/loop see if game is over condition if so end it else goto [Restart]
To make your code much more readable:
1 Use descriptive labels like [Fight] instead of line number 100
SELECT CASE itemChoice
CASE 1
GOSUB 100
CASE 2
GOSUB 110
CASE 3
GOSUB 120
CASE 4
GOSUB 130
CASE 5
GOSUB 140
CASE ELSE
PRINT "you dont have this item..."
END SELECT
2 Just insert the GOSUB code between the cases! GOSUBs are better used when your code needs them from several different places.
3 when you start saying Item1, Item2, Item3 in variables it's time to setup an array DIM ItemName$(10) ' arrays in JB start at index 0 but you can ignore itemName$(0) if you want item number to match how many items. ItemName$(1) = "Crab apple" , ItemName$(2) = "Monster candy" or whatever...
b = b + ...
|
|
|
Post by plus on Mar 11, 2024 1:28:20 GMT
i got rid of all the gosubs because they were only used from one spot in program, then i fixed the game loop. Not knowing how the game is supposed to be played I did not know when to exit the round in a loop and possible trade off with other adversaries? TRUE was never set, so never used by loop to end so I changed: loop until done = 1 ' when player got gold or dummy had no health left.
' Player Variables NumXP = 0 NumGold = 0 YourHealth = 20 + (NumXP - 1) * 4 PlayerWepaon$ = "Stick" PlayerArmor$ = "Bandage" PlayerATK = 2 PlayerDF = 1 ' Dummy Variables DummySpare = 1 DummyHealth = 20 DummyHappy = 1 DummyName$ = "Dummy" DummyDialogue$ = "..." ' Item Variables Item1 = 2 Item1Name$ = "Crab Apple" Item2 = 3 Item2Name$ = "Sea Tea" Item3 = 1 Item3Name$ = "Cinnamon-Buttersctotch Pie" Item4 = 5 Item4Name$ = "Monster Candy" Item5 = 3 Item5Name$ = "Spider Donut" ' Game Variables RandomDamege = 0 GameRound = 0 Do Print Print DummyName$; " HAS APEARED!" Print "1. FIGHT" Print "2. ACT" Print "3. ITEM" Print "4. MERCY" Print DummyName$; ": "; DummyDialogue$ Input "Action:"; actionChoice Select Case actionChoice Case 1 'fight Print DummyName$ RandomDamege = Int(Rnd(1) * 5) RandomDamege = RandomDamege + PlayerATK Print "took "; RandomDamege; " damege!" DummyHealth = DummyHealth - RandomDamege Print "DummyHealth "; DummyHealth RandomDamege = Int(Rnd(1) * 5) RandomDamege = Int(Rnd(1) * 5) Print "You got "; RandomDamege; " damege!" RandomDamege = RandomDamege - PlayerDF YourHealth = YourHealth - RandomDamege - PlayerDF Print "YourHealth "; YourHealth Case 2 'act Print "you complement "; DummyName$ Print "It seems flattered" RandomDamege = Int(Rnd(1) * 5) Print "You got "; RandomDamege; " damege!" RandomDamege = RandomDamege - PlayerDF YourHealth = YourHealth - RandomDamege - PlayerDF Print "YourHealth "; YourHealth Case 3 ' item Print "CHOSE ITEM" Print "1. "; Item1; " "; Item1Name$; "(s)" Print "2. "; Item2; " "; Item2Name$; "(s)" Print "3. "; Item3; " "; Item3Name$; "(s)" Print "4. "; Item4; " "; Item4Name$; "(s)" Print "5. "; Item5; " "; Item5Name$; "(s)" Input "Item:"; itemChoice Select Case itemChoice Case 1 If Item1 > 0 Then YourHealth = YourHealth + 5 Print "Your Health "; YourHealth Item1 = Item1 - 1 Else Print "you ran out of this item" End If Case 2 If Item2 > 0 Then YourHealth = YourHealth + 7 Print "Your Health "; YourHealth Item2 = Item2 - 1 Else Print "you ran out of this item" End If Case 3 If Item3 > 0 Then YourHealth = YourHealth + 20 Print "Your Health "; YourHealth Item3 = Item3 - 1 Else Print "you ran out of this item" End If Case 4 If Item4 > 0 Then YourHealth = YourHealth + 3 Print "Your Health "; YourHealth Item4 = Item4 - 1 Else Print "you ran out of this item" End If
Case 5 If Item5 > 0 Then YourHealth = YourHealth + 10 Print "Your Health "; YourHealth Item5 = Item5 - 1 Else Print "you ran out of this item" End If
Case Else Print "you dont have this item..." End Select Case 4 'mercy If DummySpare > 0 Then Print DummyName$; " is too angry to be spared" RandomDamege = Int(Rnd(1) * 5) Print "You got "; RandomDamege; " damege!" RandomDamege = RandomDamege - PlayerDF YourHealth = YourHealth - RandomDamege - PlayerDF Print "YourHealth "; YourHealth End If If DummySpare = 0 Then NumXP = NumXP + Int(Rnd(1) * 2) NumGold = NumGold + Int(Rnd(1) * 10) Print "YOU WON!" Print DummyName$ Print "you got "; NumXP; " XP" Print "and "; NumGold; " GOLD" GameRound = GameRound + 1 End If Case Else Print "Invalid choice. Please enter a number from the menu." End Select If YourHealth <= 0 Then Print "You loose" done = 1 End If If DummyHappy = 0 Then Print DummyName$; " is smiling" DummySpare = DummySpare - 1 ' dummy spare ??? End If If DummyHealth <= 0 Then NumXP = NumXP + Int(Rnd(1) * 2) NumGold = NumGold + Int(Rnd(1) * 10) Print "YOU WON!" Print "you got "; NumXP; " XP" Print "and "; NumGold; " GOLD" done = 1 End If Loop Until done
b = b + ...
|
|
|
Post by tsh73 on Mar 11, 2024 14:36:50 GMT
Hello
I think all is needed is to generate new enemy after
GameRound = GameRound + 1 So I created a sub [newDummy] and call it there. I randomized DummyName$ and DummyDialogue$, also make enemy happy 30% chance (just wanted to see happy enemy). Probably I did something wrong. It said
Werewolf is smiling and that's really frightened me...
EDIIT
What is
DummySpare=DummySpare=-1 Some clever formula? Or just an error?
' Player Variables NumXP = 0 NumGold = 0 YourHealth = 20 + (NumXP - 1) * 4 PlayerWepaon$ = "Stick" PlayerArmor$ = "Bandage" PlayerATK = 2 PlayerDF = 1
' Dummy Variables DummySpare = 1 DummyHealth = 20 DummyHappy = 1 DummyName$ = "Dummy" DummyDialogue$ = "..."
' Item Variables Item1 = 2 Item1Name$ = "Crab Apple" Item2 = 3 Item2Name$ = "Sea Tea" Item3 = 1 Item3Name$ = "Cinnamon-Buttersctotch Pie" Item4 = 5 Item4Name$ = "Monster Candy" Item5 = 3 Item5Name$ = "Spider Donut"
' Game Variables RandomDamege = 0 GameRound = 0 PRINT DummyName$; " HAS APEARED!" PRINT "1. FIGHT" PRINT "2. ACT" PRINT "3. ITEM" PRINT "4. MERCY" PRINT DummyName$; ": " ;DummyDialogue$ DO INPUT "Action:" ;actionChoice SELECT CASE actionChoice CASE 1 GOSUB 300 CASE 2 GOSUB 310 CASE 3 GOSUB 320 CASE 4 GOSUB 330 CASE ELSE PRINT "Invalid choice. Please enter a number from the menu." PRINT "(1. FIGHT 2. ACT 3. ITEM 4. MERCY)" END SELECT if YourHealth <= 0 then Print "You loose" end end if if DummyHappy = 0 then PRINT DummyName$; " is smiling" DummySpare=DummySpare=-1 end if if DummyHealth <= 0 then NumXP=NumXP+int(rnd(1)*2) NumGold=NumGold+int(rnd(1)*10) PRINT "YOU WON!" PRINT "you got " ;NumXP; " XP" PRINT "and " ;NumGold; " GOLD" GameRound = GameRound + 1 gosub [newDummy] end if LOOP UNTIL TRUE END
300 REM PRINT DummyName$ RandomDamege=int(rnd(1)*5) RandomDamege=RandomDamege+PlayerATK PRINT "took "; RandomDamege; " damege!" DummyHealth=DummyHealth - RandomDamege PRINT "DummyHealth "; DummyHealth RandomDamege=int(rnd(1)*5) RandomDamege=int(rnd(1)*5) PRINT "You got "; RandomDamege; " damege!" RandomDamege=RandomDamege-PlayerDF YourHealth=YourHealth-RandomDamege-PlayerDF PRINT "YourHealth "; YourHealth RETURN 310 REM PRINT "you complement " ;DummyName$ PRINT "It seems flattered" RandomDamege=int(rnd(1)*5) PRINT "You got "; RandomDamege ; " damege!" RandomDamege=RandomDamege-PlayerDF YourHealth=YourHealth-RandomDamege-PlayerDF PRINT "YourHealth "; YourHealth RETURN 320 REM PRINT "CHOSE ITEM" PRINT "1. " ; Item1; " " ;Item1Name$; "(s)" PRINT "2. " ; Item2; " " ;Item2Name$; "(s)" PRINT "3. " ; Item3; " " ;Item3Name$; "(s)" PRINT "4. " ; Item4; " " ;Item4Name$; "(s)" PRINT "5. " ; Item5; " " ;Item5Name$; "(s)" INPUT "Item:" ;itemChoice SELECT CASE itemChoice CASE 1 GOSUB 100 CASE 2 GOSUB 110 CASE 3 GOSUB 120 CASE 4 GOSUB 130 CASE 5 GOSUB 140 CASE ELSE PRINT "you dont have this item..." END SELECT RETURN 100 REM IF Item1>0 THEN YourHealth=YourHealth+5 PRINT "Your Health ";YourHealth Item1=Item1-1 ELSE PRINT "you ran out of this item" end if RETURN 110 REM IF Item2>0 THEN YourHealth=YourHealth+7 PRINT "Your Health ";YourHealth Item2=Item2-1 ELSE PRINT "you ran out of this item" end if RETURN 120 REM IF Item3>0 THEN YourHealth=YourHealth+20 PRINT "Your Health ";YourHealth Item3=Item3-1 ELSE PRINT "you ran out of this item" end if RETURN 130 REM IF Item4>0 THEN YourHealth=YourHealth+3 PRINT "Your Health ";YourHealth Item4=Item4-1 ELSE PRINT "you ran out of this item" end if RETURN 140 REM IF Item5>0 THEN YourHealth=YourHealth+10 PRINT "Your Health ";YourHealth Item5=Item5-1 ELSE PRINT "you ran out of this item" end if RETURN RETURN 330 REM IF DummySpare>0 THEN PRINT DummyName$; " is too angry to be spared" RandomDamege=int(rnd(1)*5) PRINT "You got "; RandomDamege; " damege!" RandomDamege=RandomDamege-PlayerDF YourHealth=YourHealth-RandomDamege-PlayerDF PRINT "YourHealth "; YourHealth end if IF DummySpare=0 THEN NumXP=NumXP+int(rnd(1)*2) NumGold=NumGold+int(rnd(1)*10) PRINT "YOU WON!" PRINT DummyName$ PRINT "you got " ;NumXP; " XP" PRINT "and " ;NumGold; " GOLD" GameRound = GameRound + 1 gosub [newDummy] end if RETURN
[newDummy] 'reset enemy params. Could use RND ' Dummy Variables DummySpare = 1 DummyHealth = 20 DummyHappy = rnd(0)<0.3 '30% chance 'some user defined function to randomize text DummyName$ = randomWord$("Dummy,Werewolf,Goblin", ",") DummyDialogue$ = randomWord$("...,Grrrr!!,Awww-w!,I'll get ya!", ",") 'show someone new is coming PRINT "--------------------------------" PRINT "GameRound ";GameRound PRINT DummyName$; " HAS APEARED!" if DummyHappy then print " (UN-happy one)" 'seems to be 0 == evil one. Or happy for wrong reasons, looking from my side PRINT DummyName$; ": " ;DummyDialogue$ RETURN
function randomWord$(list$, delim$) 'get random word from a list$ 'first, count words token$ = "TOKEN" i = 0 while token$<>"" i=i+1 token$ = word$(list$, i, delim$) wend count = i-1 'then, take random word ind = int(rnd(0)*count)+1 randomWord$ = word$(list$, ind, delim$) end function
|
|
|
Post by anton2012 on Mar 11, 2024 19:01:27 GMT
thanks!and btw how to make custom commands like i want to make it so that every 5 rounds you visit the shop where you can buy healing items with gold!
|
|
|
Post by tsh73 on Mar 11, 2024 20:18:06 GMT
If GameRound mod 5=0 then
|
|
|
Post by anton2012 on Mar 11, 2024 20:26:46 GMT
thanks!
|
|
|
Post by anton2012 on Mar 13, 2024 21:07:16 GMT
how to make custom comands
|
|
|
Post by tsh73 on Mar 14, 2024 8:36:51 GMT
If you mean SUB and FUNCTION, then look at LB Help
•Language Syntax and Usage ••Logic and Structure •••Functions and Subroutines
Basically, it's just a piece of code designed to do something, firmatted so we can use it by name.
It is wrapped in special lines (sub nameOYourSub params / end sub, function nameOYourFunction(params)/ end function) which gives us ability to call it by name.
In this thay, it's about the same as GOSUB block - it has a label in front, it has RETURN in the end, and you call it by GOSUB label
But it has benefits 1) All variables you use inside sub/functions are local (new ones, existing in that block of code) So you cannot spoil value of "i" in mail program by having loop by "i" in a sub. 2) "params" allows to pass parameters into that piece of code. So it could do different things depending on values passed.
|
|
|
Post by Rod on Mar 14, 2024 15:38:06 GMT
Do you mean Take Fight Run Go to shop
So are these user choices or commands or are you trying to create new programming functions?
|
|
|
Post by anton2012 on Mar 31, 2024 20:49:09 GMT
hello again
how can i 'overwrite' text? i want to make a cool static effect where a word is constantly changing like a static screen and btw how can i genarate a random number and then use the "CHR$()" comand to turn it into a letter?
|
|
|
Post by plus on Apr 1, 2024 2:21:17 GMT
hello again how can i 'overwrite' text? i want to make a cool static effect where a word is constantly changing like a static screen and btw how can i genarate a random number and then use the "CHR$()" comand to turn it into a letter? a little demo while 1 scan locate 1, 1 Print "Hello "+ chr$(int(rnd(1)*26) + 65)+ chr$(int(rnd(1)*26) + 97)+ chr$(int(rnd(1)*26) + 97)+ chr$(int(rnd(1)*26) + 97) call pause 300 wend
sub pause mil 'tsh version has scan built-in t0 = time$("ms") while time$("ms") < t0 + mil : scan : wend end sub
b = b + ...
|
|
|
Post by tsh73 on Apr 1, 2024 8:56:35 GMT
Playing along - word is revealed
Name$="John Doe"
for i = 0 to len(Name$) for j = 1 to 10 scan locate 1, 1 'fixed part Print "Hello "+left$(Name$, i); 'increases with i 'random part for k = 1 to len(Name$)-i print chr$(rnd(0)*26+asc("a")); next call pause 50 next next print print "Welcome to the show!"
sub pause mil 'tsh version has scan built-in t0 = time$("ms") while time$("ms") < t0 + mil : scan : wend end sub
|
|
|
Post by anton2012 on May 27, 2024 20:16:02 GMT
so ive been programing a lot and i have this issue in my game - so when i chosee an item there is no way to get back from item selection so you're forced to use an item i really dont know what to do so heres the problematic part:
sub ITEM PRINT "CHOSE ITEM" for itemIndex = 1 to ItemsSize itemName$="" itemHP=0 itemPrice=0 call loadItem itemIndex, itemName$, itemHP, itemPrice IF (PlayerInventoryItemsQuantities(itemIndex)>0) and (itemHP>0) THEN PRINT itemIndex; ". "; PlayerInventoryItemsQuantities(itemIndex); " "; itemName$; " gives "; itemHP; " HP" end if next itemIndex do INPUT "Choose Item:" ;itemChoice itemName$="" itemHP=0 itemPrice=0 call loadItem itemChoice, itemName$, itemHP, itemPrice IF PlayerInventoryItemsQuantities(itemChoice)>0 THEN PlayerCurrentHealth = PlayerCurrentHealth + itemHP PRINT "Your Health ";PlayerCurrentHealth PlayerInventoryItemsQuantities(itemChoice)=PlayerInventoryItemsQuantities(itemChoice)-1 exit do ELSE PRINT "you ran out of this item" end if loop until true print end sub
and heres the full code:
' initialize randomizer, if dont use this function, rnd will always return the same sequence of numbers rndSeed = time$("seconds") / 86400 randomize rndSeed ' Item Variables global ItemsSize ItemsSize = 8 ' this variable should contain total number of all items global ArmorsSize ArmorsSize = 4 global WeaponsSize WeaponsSize = 4 ' Player Variables global PlayerCurrentHealth global PlayerMaxHealth global PlayerLevel global PlayerXP global PlayerGold global PlayerCurrentArmor ' an index of current player armor from armors array global PlayerCurrentWeapon ' an index of current player weapon from weapons array global PlayerVitality global PlayerStrength global PlayerAgility call initPlayerVariables ' this is an array of items quatities. it has the same size as ItemsSize, the items in this array is quantities of items in player inventory global PlayerInventoryItemsQuantities call initPlayerInventory ' Dummy Variables global DummySpare global DummyHappy global DummyName$ global DummyDialogue$ global DummyHealth global DummyGold global DummyLevel global DummyVitality global DummyStrength global DummyAgility global DummyXP ' Game Variables TestNum=-42692012 'test num is ONLY for testing use it anywhere the game is going to break GameRound=1 global strangerDiscovered strangerDiscovered=0 global castleDiscovered castleDiscovered=0 global gameFinish gameFinish=0 'round loop PRINT " __ __ __ __ __ " PRINT "|_ |\ | | \ | |_ (_ (_ " PRINT "|__ | \| |__/ |__ |__ __) __) " CALL waitMilliseconds 300 PRINT " " PRINT "CREDITS TO:" PRINT "David Vidal Garcia" PRINT "Play-Testing" PRINT " " CALL waitMilliseconds 300 PRINT "Danil Korotenko Pavlo" PRINT "Programing help" PRINT " " CALL waitMilliseconds 300 PRINT "Anton Korotenko Danilovich" PRINT "Lead Programer" CALL waitMilliseconds 1000 do print print "you are in a forest." seeDummy=0 seeBushes = 0 if (randInRange(0, 100) < 20) then randomDummy=randInRange(1,3) call generateDummy randomDummy print "You see "; DummyName$; " Is walking around." seeDummy=1 else if (randInRange(0, 100) < 20) then print "You are near some bushes." seeBushes = 1 else if (randInRange(0, 100) < 20) and (castleDiscovered =0) then print "You are near ancient castle." castleDiscovered = 1 else if (randInRange(0, 100) < 20) and (strangerDiscovered =0) then print "You meet the stranger." strangerDiscovered=1 end if end if end if end if print "Choose what to do:" print "1. walk around" print "2. Go to trader" print "3. Info about me" print "4. Save" print "5. Load(dosent work)" if (seeDummy=1) then print "6. Attack "; DummyName$ end if if (seeBushes = 1) then print "7. Search in bushes" end if if (castleDiscovered = 1) then print "8. Go to castle" end if if (strangerDiscovered = 1) then print "9. Go to stranger and talk to him" end if input "Action choice:"; actionChoice SELECT CASE actionChoice CASE 1 PRINT "You walked around a bit." CASE 2 call SHOP CASE 3 call MyInfo CASE 4 OPEN "C:\Users\Public\Documents\save_file.txt" FOR OUTPUT AS #1 PRINT #1, ItemsSize PRINT #1, ArmorsSize PRINT #1, WeaponsSize PRINT #1, PlayerCurrentHealth PRINT #1, PlayerMaxHealth PRINT #1, PlayerLevel PRINT #1, PlayerXP PRINT #1, PlayerGold PRINT #1, PlayerCurrentArmor PRINT #1, PlayerCurrentWeapon PRINT #1, PlayerVitality PRINT #1, PlayerStrength PRINT #1, PlayerAgility PRINT #1, PlayerInventoryItemsQuantities PRINT #1, DummySpare PRINT #1, DummyHappy PRINT #1, DummyName$ PRINT #1, DummyDialogue$ PRINT #1, DummyHealth PRINT #1, DummyGold PRINT #1, DummyLevel PRINT #1, DummyVitality PRINT #1, DummyStrength PRINT #1, ummyAgility PRINT #1, DummyXP PRINT #1, strangerDiscovered PRINT #1, castleDiscovered PRINT #1, gameFinish CLOSE #1 CASE 6 if (seeDummy=1) then call BATTLE end if CASE 5 OPEN "C:\Users\Public\Documents\save_file.txt" FOR INPUT AS #1 PRINT #1, ItemsSize PRINT #2, ArmorsSize PRINT #3, WeaponsSize PRINT #4, PlayerCurrentHealth PRINT #1, PlayerMaxHealth PRINT #1, PlayerLevel PRINT #1, PlayerXP PRINT #1, PlayerGold PRINT #1, PlayerCurrentArmor PRINT #1, PlayerCurrentWeapon PRINT #1, PlayerVitality PRINT #1, PlayerStrength PRINT #1, PlayerAgility PRINT #1, PlayerInventoryItemsQuantities PRINT #1, DummySpare PRINT #1, DummyHappy PRINT #1, DummyName$ PRINT #1, DummyDialogue$ PRINT #1, DummyHealth PRINT #1, DummyGold PRINT #1, DummyLevel PRINT #1, DummyVitality PRINT #1, DummyStrength PRINT #1, ummyAgility PRINT #1, DummyXP PRINT #1, strangerDiscovered PRINT #1, castleDiscovered PRINT #1, gameFinish CLOSE #1 case 7 if (seeBushes = 1) then call SEARCHINBUSHES end if case 8 if (castleDiscovered = 1) then call CASTLE end if case 9 if (strangerDiscovered = 1) then call STRANGER end if CASE ELSE PRINT "You walked around a bit." END SELECT if (gameFinish=1) then exit do end if if PlayerCurrentHealth <= 0 then exit do end if LOOP UNTIL TRUE END ' SUBROUTINES AREA ///////////////////////////////////////////// sub initPlayerVariables ' initial values of player variables PlayerVitality = 1 PlayerStrength = 2 PlayerAgility = 1 PlayerMaxHealth = calculateMaxHP(PlayerVitality, PlayerStrength) PlayerCurrentHealth = PlayerMaxHealth PlayerLevel=1 PlayerXP = 0 PlayerGold = 0 PlayerCurrentArmor = 1 'Bandage PlayerCurrentWeapon = 1 'Stick end sub sub generateDummy aDummyIndex DummyNames$(1) = "Froggit" DummySpares(1) = 1 DummyHappys(1) = 1 DummyDialogues$(1) = "Ribbit,Ribbit" DummyVitalities(1) = 1 DummyStrengths(1) = 1 DummyAgilities(1) = 0 DummyNames$(2) = "Vegetiod" DummySpares(2) = 2 DummyHappys(2) = 1 DummyDialogues$(2) = "Farmed Locally, Very Locally" DummyVitalities(2) = 1 DummyStrengths(2) = 1 DummyAgilities(2) = 0 DummyNames$(3) = "Moldsmal" DummySpares(3) = 2 DummyHappys(3) = 1 DummyDialogues$(3) = "blurp blop" DummyVitalities(3) = 1 DummyStrengths(3) = 1 DummyAgilities(3) = 0 DummyNames$(4) = "Anton2012" 'BOSS=) DummySpares(4) = 2 DummyHappys(4) = 1 DummyDialogues$(4) = "ok this is kinda tought but hey dont give up david :P" DummyVitalities(4) = 1 DummyStrengths(4) = 1 DummyAgilities(4) = 0 DummySpare = DummySpares(aDummyIndex) DummyHappy = DummyHappys(aDummyIndex) DummyName$ = DummyNames$(aDummyIndex) DummyDialogue$ = DummyDialogues$(aDummyIndex) levelDiff=1 minDummyLevel = PlayerLevel-levelDiff if (minDummyLevel<1) then minDummyLevel = 1 DummyLevel = randInRange(minDummyLevel, PlayerLevel+levelDiff) DummyVitality = DummyVitalities(aDummyIndex) DummyStrength = DummyStrengths(aDummyIndex) DummyAgility = DummyAgilities(aDummyIndex) if DummyLevel > 1 then for i = 1 to DummyLevel call levelDummyUp next i end if DummyGold = randInRange(0, DummyLevel) DummyXP = DummyVitality + DummyStrength + DummyAgility DummyHealth = calculateMaxHP(DummyVitality, DummyStrength) end sub ' INVENTORY, ITEMS, ARMOR, WEAPONS sub initPlayerInventory PlayerInventoryItemsQuantities(1) = int(rnd(1)*5) '"Crab Apple" PlayerInventoryItemsQuantities(2) = int(rnd(1)*4) '"Sea Tea" PlayerInventoryItemsQuantities(3) = 1 '"Cinnamon-Buttersctotch Pie" PlayerInventoryItemsQuantities(4) = int(rnd(1)*2) '"Monster Candy" PlayerInventoryItemsQuantities(5) = int(rnd(1)*7) '"Spider Donut" PlayerInventoryItemsQuantities(6) = 0 'some berries PlayerInventoryItemsQuantities(7) = 0 ' artefact PlayerInventoryItemsQuantities(8) = 0 ' key end sub sub loadItem anItemIndex, byref anItemName$, byref anItemHP, byref anItemPrice ItemsNames$(1) = "Crab Apple" ItemsPrices(1) = 5 ItemsHPs(1) = 5 ItemsNames$(2) = "Sea Tea" ItemsPrices(2) = 5 ItemsHPs(2) = 8 ItemsNames$(3) = "Cinnamon-Buttersctotch Pie" ItemsPrices(3) = 5 ItemsHPs(3) = 21 ItemsNames$(4) = "Monster Candy" ItemsPrices(4) = 5 ItemsHPs(4) = 5 ItemsNames$(5) = "Spider Donut" ItemsPrices(5) = 5 ItemsHPs(5) = 11 ItemsNames$(6) = "Some berries." ItemsPrices(6) = 0 ItemsHPs(6) = 5 ItemsNames$(7) = "A strange artefact. You don't know what it is, and what it is for." ItemsPrices(7) = 0 ItemsHPs(7) = 0 ItemsNames$(8) = "A key from ancient castle." ItemsPrices(8) = 0 ItemsHPs(8) = 0 ' fill output arguments anItemName$ = ItemsNames$(anItemIndex) anItemHP = ItemsHPs(anItemIndex) anItemPrice = ItemsPrices(anItemIndex) end sub sub loadArmor anArmorIndex, byref anArmorName$, byref anArmorDF, byref anArmorPrice ArmorNames$(1) = "Nothing"'"Bandage" ArmorPrices(1) = 0 '1 ArmorDFs(1) = 0 '1 ArmorNames$(2) = "Light shield" ArmorPrices(2) = 5 ArmorDFs(2) = 5 ArmorNames$(3) = "Medium shield" ArmorPrices(3) = 10 ArmorDFs(3) = 10 ArmorNames$(4) = "Hard Shield" ArmorPrices(4) = 15 ArmorDFs(4) = 15 ' fill output arguments anArmorName$ = ArmorNames$(anArmorIndex) anArmorDF = ArmorDFs(anArmorIndex) anArmorPrice = ArmorPrices(anArmorIndex) end sub sub loadWeapon aWeaponIndex, byref aWeaponName$, byref aWeaponATK, byref aWeaponPrice WeaponNames$(1) = "Nothing"'"Stick" WeaponPrices(1) = 0 '1 WeaponATKs(1) = 0 '2 WeaponNames$(2) = "Light Weapon" WeaponPrices(2) = 5 WeaponATKs(2) = 5 WeaponNames$(3) = "Medium Weapon" WeaponPrices(3) = 10 WeaponATKs(3) = 10 WeaponNames$(4) = "Heavy Weapon" WeaponPrices(4) = 15 WeaponATKs(4) = 15 ' fill output arguments aWeaponName$ = WeaponNames$(aWeaponIndex) aWeaponATK = WeaponATKs(aWeaponIndex) aWeaponPrice = WeaponPrices(aWeaponIndex) end sub ' service subs and funcs///////////////////////////////////////////////// sub waitMilliseconds aMillisecondsDelay ms = time$("milliseconds") msNow = ms msDiff = msNow - ms do msNow = time$("milliseconds") msDiff = msNow - ms loop until msDiff >= aMillisecondsDelay end sub function randInRange(aRangeMin, aRangeMax) randInRange = int(rnd(1)*((aRangeMax+1) - aRangeMin))+aRangeMin end function function calculateMaxHP(aVitality, aStrength) calculateMaxHP = 10 + (aVitality * 5) + aStrength end function function levelXP() '(aLevel) levelXP = 10 * PlayerLevel' aLevel end function function maxATK(aStrength) maxATK = aStrength end function function minATK(aStrength) atk=int(aStrength / 2) if (atk<1) then atk = 1 minATK = atk end function function maxDF(anAgility) maxDF = anAgility end function function minDF(anAgility) minDF = int(anAgility/2) end function function maxPlayerATK() weaponName$="" weaponATK=0 weaponPrice=0 call loadWeapon PlayerCurrentWeapon, weaponName$, weaponATK, weaponPrice maxPlayerATK = maxATK(PlayerStrength) + weaponATK end function function minPlayerATK() weaponName$="" weaponATK=0 weaponPrice=0 call loadWeapon PlayerCurrentWeapon, weaponName$, weaponATK, weaponPrice minPlayerATK = minATK(PlayerStrength) + weaponATK end function function maxPlayerDF() armorName$="" armorDF=0 armorPrice=0 call loadArmor PlayerCurrentArmor, armorName$, armorDF, armorPrice maxPlayerDF = maxDF(PlayerAgility) + armorDF end function function minPlayerDF() armorName$="" armorDF=0 armorPrice=0 call loadArmor PlayerCurrentArmor, armorName$, armorDF, armorPrice minPlayerDF = minDF(PlayerAgility) + armorDF end function function maxDummyATK() maxDummyATK = maxATK(DummyStrength) end function function minDummyATK() minDummyATK = minATK(DummyStrength) end function function maxDummyDF() maxDummyDF = maxDF(DummyAgility) end function function minDummyDF() minDummyDF = minDF(DummyAgility) end function sub printPlayerArmor armorName$="" armorDF=0 armorPrice=0 call loadArmor PlayerCurrentArmor, armorName$, armorDF, armorPrice PRINT "Your current armor: "; armorName$; ". It DF: "; armorDF end sub sub printPlayerWeapon weaponName$="" weaponATK=0 weaponPrice=0 call loadWeapon PlayerCurrentWeapon, weaponName$, weaponATK, weaponPrice end sub sub levelDummyUp skill = DummyVitality + DummyStrength + DummyAgility upgrade = randInRange(0, skill-1) if (upgrade < DummyStrength) then DummyStrength = DummyStrength + 1 else if upgrade < DummyStrength + DummyAgility then DummyAgility = DummyAgility + 1 else if upgrade < DummyStrength + DummyAgility + DummyVitality then DummyVitality = DummyVitality + 1 end if end if end if end sub sub levelPlayerUp skill = PlayerVitality + PlayerStrength + PlayerAgility upgrade = randInRange(0, skill) if (upgrade < PlayerStrength) then PlayerStrength = PlayerStrength + 1 print "Strength + 1" else if upgrade < PlayerStrength + PlayerAgility then DummyAgility = DummyAgility + 1 print "Agility + 1" else if upgrade < PlayerStrength + DummyAgility + PlayerVitality then PlayerVitality = PlayerVitality + 1 print "Vitality + 1" end if end if end if end sub '//////////////////////////////////////////////////////////////////////// ' SHOP sub SHOP PRINT " __ _ _ " PRINT "(_ |__| / \ |_) " PRINT "__) | | \_/ | " PRINT " " PRINT " " PRINT " " PRINT "HI! Welcome to my shop where you can buy ITEMS, ARMOR and WEAPONS" do PRINT "Your gold: "; PlayerGold PRINT PRINT "What would you like to buy?" PRINT "1. ITEMS" PRINT "2. ARMOR" PRINT "3. WEAPONS" PRINT "0. exit shop" INPUT "Your choise:" ;shopChoice SELECT CASE shopChoice CASE 1 call SHOPITEMS CASE 2 call SHOPARMOR CASE 3 call SHOPWEAPONS CASE 0 exit do CASE ELSE PRINT "Invalid choice. Please enter a number from the menu." END SELECT loop until true end sub sub SHOPITEMS do PRINT "Your gold: "; PlayerGold PRINT PRINT "ITEMS:" for itemIndex = 1 to ItemsSize itemName$="" itemHP=0 itemPrice=0 call loadItem itemIndex, itemName$, itemHP, itemPrice if (itemPrice > 0) then PRINT itemIndex; ". "; itemName$; PRINT ". You have: "; PlayerInventoryItemsQuantities(itemIndex); PRINT ". It gives "; itemHP; " HP. It costs: "; itemPrice end if next itemIndex PRINT "0. back" INPUT "Choose item to buy:" ;itemChoice if (itemChoice=0) then exit do else if (itemChoise > ItemsSize) then Print "Wrong choise" else itemName$="" itemHP=0 itemPrice=0 call loadItem itemChoice, itemName$, itemHP, itemPrice IF ( PlayerGold >= itemPrice ) THEN PlayerInventoryItemsQuantities(itemChoice)=PlayerInventoryItemsQuantities(itemChoice)+1 PlayerGold = PlayerGold - itemPrice ELSE PRINT "You don't have enough gold" end if end if end if loop until true end sub sub SHOPARMOR do PRINT "Your gold: "; PlayerGold PRINT call printPlayerArmor PRINT "Your current armor: "; armorName$; ". It DF: "; armorDF PRINT PRINT "ARMORS:" for armorIndex = 1 to ArmorsSize armorName$="" armorDF=0 armorPrice=0 call loadArmor armorIndex, armorName$, armorDF, armorPrice PRINT armorIndex; ". "; armorName$; PRINT ". DF: "; armorDF; PRINT ". Price "; armorPrice next armorIndex PRINT "0. back" INPUT "Choose armor to buy:" ;armorChoice if (armorChoice=0) then exit do else if (armorChoice=PlayerCurrentArmor) then PRINT "You already equipped this armor" else if (armorChoice > ArmorsSize) then PRINT "Wrong choise" else armorName$="" armorDF=0 armorPrice=0 call loadArmor armorChoice, armorName$, armorDF, armorPrice IF ( PlayerGold >= armorPrice ) THEN PlayerCurrentArmor = armorChoice PlayerGold = PlayerGold - armorPrice ELSE PRINT "You don't have enough gold" end if end if end if end if loop until true end sub sub SHOPWEAPONS do PRINT "Your gold: "; PlayerGold PRINT call printPlayerWeapon PRINT PRINT "WEAPONS:" for weaponIndex = 1 to WeaponsSize weaponName$="" weaponATK=0 weaponPrice=0 call loadWeapon weaponIndex, weaponName$, weaponATK, weaponPrice PRINT weaponIndex; ". "; weaponName$; PRINT ". ATK: "; weaponATK; PRINT ". Price "; weaponPrice next weaponIndex PRINT "0. back" INPUT "Choose weapon to buy:" ;weaponChoice if (weaponChoice=0) then exit do else if (weaponChoice=PlayerCurrentWeapon) then PRINT "You already equipped this weapon" else if (weaponChoice > WeaponsSize) then PRINT "Wrong choise" else weaponName$="" weaponATK=0 weaponPrice=0 call loadWeapon weaponChoice, weaponName$, weaponATK, weaponPrice IF ( PlayerGold >= weaponPrice ) THEN PlayerCurrentWeapon = weaponChoice PlayerGold = PlayerGold - weaponPrice ELSE PRINT "You don't have enough gold" end if end if end if end if loop until true end sub ' //////////////////////////////////////////////////////////////////////// sub SEARCHINBUSHES print "You searched in bushes." if (randInRange(0, 100) < 20) and (PlayerInventoryItemsQuantities(7)=0) then print "You found strange artefact." ' add artefac to to inventory PlayerInventoryItemsQuantities(7)=1 else if (randInRange(0, 100) < 50) then print "You found some berries." PlayerInventoryItemsQuantities(6)=PlayerInventoryItemsQuantities(6)+1 else print "You found nothing and went away." end if end if print end sub sub CASTLE print "You are near the ancient castle." print "You see a big door. The door is definitely requires a key." print "Choose waht to do:" print "1. Walk away" if (PlayerInventoryItemsQuantities(8)=1) then print "2. Use the key for the door of the castle" end if INPUT "You choise:" ;actionChoice SELECT CASE actionChoice CASE 1 PRINT "You walked away." CASE 2 call FINALINCASTLE CASE ELSE PRINT "You walked away." END SELECT print end sub sub FINALINCASTLE Print "Congratulations! You just finished this game, and found good ending!" Print "Thank you!" gameFinish=1 end sub sub STRANGER ' if player has artefact if (PlayerInventoryItemsQuantities(7)>0) then print "Stranger: Oh! I see you found my artefact! Thank you! For this, I give you a key. This key opens a door of ancient castle." print "You has a key from castle now." print "You know castle location now." print "You went away from stranger" PlayerInventoryItemsQuantities(8)=1 PlayerInventoryItemsQuantities(7)=0 castleDiscovered=1 else if (PlayerInventoryItemsQuantities(8)>0) then Print "I already gave you a key. Why did you come back?" print "You went away from stranger" else print "Stranger: I lost my artefact somewhere in bushes. Could you please find it for me?" print "You went away from stranger" end if end if print end sub sub BATTLE PRINT DummyName$; " HAS APEARED!" print DummyName$ ;"'s Health: "; DummyHealth print "your health: "; PlayerCurrentHealth; "/"; PlayerMaxHealth ' fighting loop DO 'each time we print menu PRINT "1. FIGHT" PRINT "2. ACT" PRINT "3. ITEM" PRINT "4. MERCY" print "5. Info about me" print "6. Info about "; DummyName$ PRINT DummyName$; ": " ;DummyDialogue$ INPUT "Action:" ;actionChoice SELECT CASE actionChoice CASE 1 call FIGHT CASE 2 call ACT CASE 3 call ITEM CASE 4 call MERCY CASE 5 call MyInfo CASE 6 call DummyInfo CASE ELSE PRINT "Invalid choice. Please enter a number from the menu." END SELECT if PlayerCurrentHealth <= 0 then Print "You loose" exit do end if if DummyHappy = 0 then PRINT DummyName$; " is smiling" DummySpare=DummySpare=-1 end if if DummyHealth <= 0 then PlayerXP=PlayerXP+DummyXP PlayerGold = PlayerGold + DummyGold PRINT "YOU WON!" PRINT "you got " ;DummyXP; " XP" PRINT "and " ;DummyGold; " GOLD" PRINT "your total XP: " ; PlayerXP; " / "; levelXP() PRINT "your total gold: " ; PlayerGold ' check for level up levelsToUp = int(PlayerXP / levelXP()) if (levelsToUp>0) then for i = 1 to levelsToUp print "Level up!" PlayerLevel = PlayerLevel + 1 call levelPlayerUp next i end if GameRound = GameRound + 1 ' go to the next round exit do end if IF DummySpare=0 THEN PlayerXP=PlayerXP+int(rnd(1)*2) obtainedGold = int(rnd(1)*10) PlayerGold = PlayerGold + obtainedGold PRINT "YOU WON!" PRINT DummyName$ PRINT "you got " ;PlayerXP; " XP" PRINT "and " ;obtainedGold; " GOLD" PRINT "your total gold " ; PlayerGold GameRound = GameRound + 1 exit do end if LOOP UNTIL TRUE end sub ' FIGHT ACT ITEM MERCY sub FIGHT dummyDF=randInRange(minDummyDF(), maxDummyDF()) RandomDamage=randInRange(minPlayerATK(), maxPlayerATK()) - dummyDF if RandomDamage<0 then RandomDamage=0 end if PRINT DummyName$;" took "; RandomDamage; " damege!" DummyHealth=DummyHealth - RandomDamage PRINT DummyName$;"'s Health:"; DummyHealth playerDF=randInRange(minPlayerDF(), maxPlayerDF()) RandomDamage=randInRange(minDummyATK(), maxDummyATK()) - playerDF RandomDamage=RandomDamage-armorDF if RandomDamage<0 then RandomDamage=0 end if PRINT "You got "; RandomDamage ; " damage!" PlayerCurrentHealth=PlayerCurrentHealth-RandomDamage PRINT "Your Health: "; PlayerCurrentHealth; "/"; PlayerMaxHealth print end sub sub ACT armorName$="" armorDF=0 armorPrice=0 call loadArmor PlayerCurrentArmor, armorName$, armorDF, armorPrice PRINT "you complement " ;DummyName$ PRINT "It seems flattered" DummyHappy = DummyHappy - 1 RandomDamage=int(rnd(1)*5) PRINT "You got "; RandomDamage ; " damage!" RandomDamage=RandomDamage-armorDF if RandomDamage<0 then RandomDamage=0 end if PlayerCurrentHealth=PlayerCurrentHealth-RandomDamage PRINT "Your Health: "; PlayerCurrentHealth print end sub sub ITEM PRINT "CHOSE ITEM" for itemIndex = 1 to ItemsSize itemName$="" itemHP=0 itemPrice=0 call loadItem itemIndex, itemName$, itemHP, itemPrice IF (PlayerInventoryItemsQuantities(itemIndex)>0) and (itemHP>0) THEN PRINT itemIndex; ". "; PlayerInventoryItemsQuantities(itemIndex); " "; itemName$; " gives "; itemHP; " HP" end if next itemIndex do INPUT "Choose Item:" ;itemChoice itemName$="" itemHP=0 itemPrice=0 call loadItem itemChoice, itemName$, itemHP, itemPrice IF PlayerInventoryItemsQuantities(itemChoice)>0 THEN PlayerCurrentHealth = PlayerCurrentHealth + itemHP PRINT "Your Health ";PlayerCurrentHealth PlayerInventoryItemsQuantities(itemChoice)=PlayerInventoryItemsQuantities(itemChoice)-1 exit do ELSE PRINT "you ran out of this item" end if loop until true print end sub sub MERCY IF DummySpare>0 THEN armorName$="" armorDF=0 armorPrice=0 call loadArmor PlayerCurrentArmor, armorName$, armorDF, armorPrice PRINT DummyName$; " is too angry to be spared" RandomDamage=int(rnd(1)*5) PRINT "You got "; RandomDamage; " damage!" RandomDamage=RandomDamage-armorDF if RandomDamage<0 then RandomDamage=0 end if PlayerCurrentHealth=PlayerCurrentHealth-RandomDamage PRINT "Your Health "; PlayerCurrentHealth print end if end sub sub MyInfo print "Your health: "; PlayerCurrentHealth; "/"; PlayerMaxHealth print "Level: "; PlayerLevel; " EXP: "; PlayerXP; "/"; levelXP() print "Vitality (affects max HP): "; PlayerVitality print "Strength (affects ATK and max HP): "; PlayerStrength print "Agility (affects DF): "; PlayerAgility print "ATK: "; minPlayerATK(); "-"; maxPlayerATK() print "DF: "; minPlayerDF(); "-"; maxPlayerDF() print "Gold: "; PlayerGold call printPlayerArmor call printPlayerWeapon print "Your items:" for itemIndex = 1 to ItemsSize itemName$="" itemHP=0 itemPrice=0 IF PlayerInventoryItemsQuantities(itemIndex)>0 THEN call loadItem itemIndex, itemName$, itemHP, itemPrice PRINT PlayerInventoryItemsQuantities(itemIndex); " "; itemName$; ". It gives "; itemHP; " HP." end if next itemIndex print end sub sub DummyInfo print DummyName$ print "HP: "; DummyHealth print "Level: "; DummyLevel; " XP: "; DummyXP print "ATK: "; minDummyATK(); "-"; maxDummyATK() print "DF: "; minDummyDF(); "-"; maxDummyDF() print "Gold: "; DummyGold print end sub
on a side note i should learn to search things up and learn to fix problems myself also thanks justbasic comunity for helping me becose i would never learned how to create a timer on my own also the loading dosent work and it gives me theese errors: 1st:
#1
these handles closed by justbasic please add the aproprieate commands 2nd: runtime error: attempted to write to a file opened input: #1 (see error.log for more information)
|
|