'we are @ Fantasy\
'----------------------------------------------------------------------------------------------------------Û SETUP Û--------------------------------------------------------------------------------------------------------------
SCREEN _NEWIMAGE(640, 480, 32) ' enter in graphics mode 640x480 32 bith color depth _MOUSEHIDE ' dont show OS cursor, we will use our own 'x = 20 cells
'y = 15 cells(14 in fact for gameplay, the upper one holds the HUD)
'----------------------------------------------------------------------------------------------------------Û VARAIABLES Û--------------------------------------------------------------------------------------------------------------
'Û PROGRAM GLOBALS Û- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'im gonna use this?
'Û COLORS Û- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'Û IMAGES Û- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'Û MECHS Û- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'Û POINTER/MOUSE Û- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'Û HERO Û- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class
AS _BYTE ' 0=Barbarian, 1=Clerig, 2=Assasin or 3=Wizard lvl
AS _BYTE ' current character level nextXp
AS INTEGER ' the next target for lvlUp
'Û ITEMS Û- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
special
AS STRING '<--------------------------¿ map
AS _BYTE 'MAP number OR -1 for POCKET ³' ITEMS SPECIAL VARIABLE:-------------------------¾
's=adds strength; a=adds agility; p=adds power; v=adds vigor;¿ CAN BE
'd=adds defense; b=adds to base damage;m=adds to max damage; ³ FROM 1 eg:a1,v3,d2,etc...
'c=adds to chance TO HIT%,will be multiplied by 7; ¾ TO 3
't= teaches some spell, for books (0 to 5) ;
'r= cast a spell, for wands and scrolls (0 to 5);
'u=unidentified (has no number?)
'Û WORLD Û- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'Û ENEMIES Û- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
map
AS _BYTE ' in wich map enemy is lvl
AS _BYTE ' enemies level goes from 0 to 31, same as the image array
'Û SPELLS Û- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DIM SHARED SpellsIknow%%
(5) ' array contains the level that the player knows from each one of the spells 0 to 5. Never will be greater than 10 DIM SHARED turnsRemainingSpell%%
(5) ' array contains how many more turns the spell will be ON,when reaches 0 spell is OFF DIM SHARED lastSpellSelected%%
(1) ' array contain: 0=the number of the last spell use; 1= the level of the last spell used
'----------------------------------------------------------------------------------------------------------Û PRE-PROGRAM Û--------------------------------------------------------------------------------------------------------------
checkForAssets
loadImages
loadProgramInitialVariables
CHDIR ".\tmp" 'we are @ Fantasy\tmp\ '----------------------------------------------------------------------------------------------------------Û PROGRAM Û--------------------------------------------------------------------------------------------------------------
HUDpromt$ = "" ' ¿ reinitialize this variables
drawFingerAs%% = 1 ' ¾
'What happened to the MUSIC????? XD
getMouseData
thingsYouCanDoWithFinger
keyboardInputs
IF Hero.life
> calculateMaxLife%
THEN Hero.life
= calculateMaxLife%
IF Hero.mana
> calculateMaxMana%
THEN Hero.mana
= calculateMaxMana%
actualizeMoneyAspect
IF actualMapWorking%%
> -1 THEN drawMyFantasy
IF menuStats`
= TRUE
THEN showTheStats
IF menuPocket`
= TRUE
THEN lookInPocket
IF menuSpells
= TRUE
THEN selectSomeSpell
IF menuMain`
= TRUE
THEN mainMenu
IF actualMapWorking%%
> -1 THEN drawHUD
printHUDpromt HUDpromt$
drawFinger
TESTER
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB thingsYouCanDoWithFinger
() '°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Û ACTION PERFORMING Û°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
drawFingerAs%% = 1
itemManipulation ' if you are looking at pocket you are allowed to manipulate items there
IF NOT inHand.lvl
= -1 THEN drawFingerAs%%
= 3 ' if lvl of inhand isn't -1 means you are holding something IF menuMain`
= FALSE
AND menuPocket`
= FALSE
AND menuSpells`
= FALSE
AND menuStats`
= FALSE
THEN tmp% = checkFingerSector%
drawFingerAs%% = 6
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IF fingerIsOnSurface%
(Hero.x
- 32, Hero.y
+ 32, 32, 32) THEN ' sector 1 checkFingerSector% = 1
ELSEIF fingerIsOnSurface%
(Hero.x
, Hero.y
+ 32, 32, 32) THEN ' sector 2 checkFingerSector% = 2
ELSEIF fingerIsOnSurface%
(Hero.x
+ 32, Hero.y
+ 32, 32, 32) THEN ' sector 3 checkFingerSector% = 3
ELSEIF fingerIsOnSurface%
(Hero.x
- 32, Hero.y
, 32, 32) THEN ' sector 4 checkFingerSector% = 4
ELSEIF fingerIsOnSurface%
(Hero.x
, Hero.y
, 32, 32) THEN ' sector 5 checkFingerSector% = 5
ELSEIF fingerIsOnSurface%
(Hero.x
+ 32, Hero.y
, 32, 32) THEN ' sector 6 checkFingerSector% = 6
ELSEIF fingerIsOnSurface%
(Hero.x
- 32, Hero.y
- 32, 32, 32) THEN ' sector 7 checkFingerSector% = 7
ELSEIF fingerIsOnSurface%
(Hero.x
, Hero.y
- 32, 32, 32) THEN ' sector 8 checkFingerSector% = 8
ELSEIF fingerIsOnSurface%
(Hero.x
+ 32, Hero.y
- 32, 32, 32) THEN ' sector 9 checkFingerSector% = 9
ELSE ' nothing to do, further away from playable sectors checkFingerSector% = 0
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION checkEnemyPresenceInSector%
(sect%
, orgX%
, orgY%
) IF Enemy
(i%
).map
= actualMapWorking%%
THEN checkEnemyPresenceInSector% = FALSE
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION checkItemPresenceInSector%
(sect%
, orgX%
, orgY%
) IF Items
(i%
).map
= actualMapWorking%%
THEN checkItemPresenceInSector% = FALSE
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION checkWorldAtSector%
(sect%
, orgX%
, orgY%
) '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION checkMechPresenceInSector%
(sect%
, orgX%
, orgY%
) '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CASE 0:
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), FingerImg&
(0) 'cross CASE 1:
_PUTIMAGE (Finger.x
- 1, Finger.y
- 1), FingerImg&
(1) 'finger CASE 2:
_PUTIMAGE (Finger.x
- 1, Finger.y
- 1), FingerImg&
(2) 'attack sword CASE 3:
_PUTIMAGE (Finger.x
- 1, Finger.y
- 1), FingerImg&
(3) 'grabbing hand CASE 4:
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), FingerImg&
(4) 'wait clock CASE 5:
_PUTIMAGE (Finger.x
- 1, Finger.y
- 1), FingerImg&
(5) 'GO CASE 6:
_PUTIMAGE (Finger.x
- 1, Finger.y
- 1), FingerImg&
(6) 'sand clock '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB allowedMotions
(where%
)
printHUDpromt "Move down & left" ' ¿
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), DirArrowImg&
(9) ' ³ Hero.y = Hero.y + 32 ' ³
Hero.x = Hero.x - 32 '
gameTurn% = 0
printHUDpromt "Move down" ' ¿
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), DirArrowImg&
(10) ' ³ Hero.y = Hero.y + 32 '
gameTurn% = 0
printHUDpromt "Move down & right" ' ¿
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), DirArrowImg&
(2) ' ³ Hero.y = Hero.y + 32 ' ³
Hero.x = Hero.x + 32 '
gameTurn% = 0
printHUDpromt "Move left" ' ¿
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), DirArrowImg&
(7) ' ³ Hero.x = Hero.x - 32 '
gameTurn% = 0
printHUDpromt "Rest one turn" ' ¿
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), FingerImg&
(4) ' ¾
'!!!!!!!!!!!!!!!!!!!!
gameTurn% = 0
'!!!!!!!!!!!!!!!!!!!!
printHUDpromt "Move right" ' ¿
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), DirArrowImg&
(1) ' ³ Hero.x = Hero.x + 32 '
gameTurn% = 0
printHUDpromt "Move up & left" ' ¿
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), DirArrowImg&
(8) ' ³ Hero.y = Hero.y - 32 ' ³
Hero.x = Hero.x - 32 '
gameTurn% = 0
printHUDpromt "Move up" ' ¿
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), DirArrowImg&
(4) ' ³ Hero.y = Hero.y - 32 '
gameTurn% = 0
printHUDpromt "Move up & right" ' ¿
_PUTIMAGE (Finger.x
- 8, Finger.y
- 8), DirArrowImg&
(3) ' ³ Hero.y = Hero.y - 32 ' ³
Hero.x = Hero.x + 32 '
gameTurn% = 0
_PUTIMAGE (Finger.x
- 1, Finger.y
- 1), FingerImg&
(0) ' normal finger
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB mainMenu
() '°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Û MENUS Û°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° ' TO DO: allow acces to SAVE GAME & LOAD GAME
drawMenuBack 240, 99, 391, 306
PRINT "FANTASY";
' ¾ TITLE
_PUTIMAGE (259, 103), SpellImg&
(0) '¿ demoniac
IF actualMapWorking%%
> -1 THEN ' are we already playing? _PUTIMAGE (369, 108), HUDImg&
(3) ' then this menu has to show this image IF fingerIsOnSurface%
(369, 108, 16, 16) THEN ' HUDpromt$ = "Back to game"
IF Finger.clickL
THEN menuMain`
= FALSE
IF fingerIsOnSurface%
(280, 144, 72, 16) THEN COLOR GREEN1
, GREEN4
' so no wrong printing in newGame menuMain` = FALSE
menuPocket = FALSE
menuSpells` = FALSE
menuStats` = FALSE
newGame
IF fingerIsOnSurface%
(280, 176, 72, 16) THEN IF Finger.clickL
THEN loadGame
IF actualMapWorking%%
> -1 THEN ' we only allowed to save if we are playing IF fingerIsOnSurface%
(280, 208, 72, 16) THEN 'IF Finger.clickL THEN actualMenuWorking% = -7 '<----------------WRONG! assign a variable for this
COLOR GREEN3
, GREEN4
' if NOT in game
IF fingerIsOnSurface%
(296, 240, 32, 16) THEN menuMain` = FALSE
menuHelp` = TRUE
IF fingerIsOnSurface%
(296, 272, 32, 16) THEN exitProgram
IF actualMapWorking%%
> -1 THEN IF fingerIsOnSurface%
(280, 144, 72, 16) THEN HUDpromt$
= "Start a new game" IF fingerIsOnSurface%
(280, 176, 72, 16) THEN HUDpromt$
= "Load a saved game" IF fingerIsOnSurface%
(280, 208, 72, 16) THEN HUDpromt$
= "Save current game" IF fingerIsOnSurface%
(296, 240, 32, 16) THEN HUDpromt$
= "Learn how to play" IF fingerIsOnSurface%
(296, 272, 32, 16) THEN HUDpromt$
= "Close and leave"
COLOR GREEN1
, GREEN4
' don't conlictuate with other stuff
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
unloadImages
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB newGame
() '!!!!!!! set me to 0 after testing
actualMapWorking%% = -1 'leave actual game
Hero.lvl = 1 ' start with a fresh character
Hero.class = -1
Hero.id = ""
Hero.xp = 0 ' ¿
Hero.nextXp = 100 ' ³ with no xp
Hero.prevNextXp = 0 ' ³
Hero.attributePoints = 2 ' ¾<------!!!!!!! set me to 0 after testing
SpellsIknow%%(i%) = 1 ' you don't know any spells 'CHANGE ME TO 0 AFTER TESTING
chooseClass '¿ don't switch
enterName ' Ù the order!
'Û LOAD CHARACTER INITIAL VARIABLES Û
Hero.strength = 20 '³
Hero.agility = 10 ' ³ BARBARIAN
Hero.power = 5 ' ³ SKILLS
Hero.vigor = 15 ' Ù
Hero.strength = 15 '³
Hero.agility = 5 ' ³ CLERIG
Hero.power = 10 ' ³ SKILLS
Hero.vigor = 20 ' Ù
Hero.strength = 10 '³
Hero.agility = 20 ' ³ ASSASIN
Hero.power = 5 ' ³ SKILLS
Hero.vigor = 15 ' Ù
Hero.strength = 5 ' ³
Hero.agility = 10 ' ³ WIZARD
Hero.power = 20 ' ³ SKILLS
Hero.vigor = 15 ' ³
Hero.life = calculateMaxLife%
Hero.mana = calculateMaxMana%
cleanOnePocketSlot i% ' clearPocket
equipOurHero
loadEnemiesInitialVariables
loadMechsInitialVariables
'showHistory 0
actualMapWorking%% = 0 ' ¿ we start
Hero.x = 32 ' ³ at this
Hero.y = 64 ' Ù place
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB loadGame
() 'INCOMPLETE
leaving% = 0
CHDIR ".\saved" 'into saved getMouseData
drawMenuBack 240, 99, 391, 306
drawItemSlots 252, 142 + (i% * 48) '
tmpString$
= "s" + _TRIM$(STR$(i%
+ 1)) + "Game.txt" INPUT #slot&
(i%
), heroName$
INPUT #slot&
(i%
), inputNumber%
INPUT #slot&
(i%
), inputNumber2%
tmpString$ = calculateNameOfHeroClass$(inputNumber%) '
tmpString$
= tmpString$
+ "(" + _TRIM$(STR$(inputNumber2%
)) + ")" ' IF fingerIsOnSurface%
(252, 142 + (i%
* 48), 123, 32) THEN ' 'IF Finger.clickL THEN acceptedLoadGame(1): EXIT DO? or EXIT SUB?
_PUTIMAGE (252, 142 + (i%
* 48)), calculateHeroImg&
(inputNumber%
, inputNumber2%
) '
_PUTIMAGE (Finger.x
, Finger.y
), FingerImg&
(1) CHDIR ".\.." ' back to data CHDIR ".\tmp" 'and then to tmp '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB saveGame
() 'INCOMPLETE drawMenuBack 247, 99, 391, 274
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB helpMenu
() ' INCOMPLETE
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
getMouseData
CLS , GREEN3
'all screen clear on green3 drawMenuBack 240, 99, 398, 280
PRINT "CHOOSE CLASS";
' Barbarian, Clerig, Assasin or Wizard Ù FOR i%
= 0 TO 3: drawItemSlots
252 + i%
* 34, 139:
NEXT i%
' slots for hero images _PUTIMAGE (252, 139), HeroImg&
(0) ' Barbarian ¿ _PUTIMAGE (286, 139), HeroImg&
(2) ' Clerig ³ characters _PUTIMAGE (320, 139), HeroImg&
(4) ' Assasin ³ images _PUTIMAGE (327, i%
* 16 + 212), BarImg&
(0) ' open ³ _PUTIMAGE (367, i%
* 16 + 212), BarImg&
(6) ' close ³ static FOR ii%
= 0 TO 3 ' ³ BARS _PUTIMAGE (ii%
* 8 + 335, i%
* 16 + 212), BarImg&
(5) '³ IF fingerIsOnSurface%
(252, 139, 32, 32) THEN ' ¿ barShowingPercentage 327, 212, 100 'STRENGTH ³
barShowingPercentage 327, 228, 50 'AGILITY ³ BARBARIAN
barShowingPercentage 327, 244, 25 'POWER ³
barShowingPercentage 327, 260, 75 ' VIGOR ³
IF Finger.clickL
THEN Hero.class
= 0 ' ¾ ELSEIF fingerIsOnSurface%
(286, 139, 32, 32) THEN '¿ barShowingPercentage 327, 212, 75 'STRENGTH ³
barShowingPercentage 327, 228, 25 'AGILITY ³ CLERIG
barShowingPercentage 327, 244, 50 'POWER ³
barShowingPercentage 327, 260, 100 ' VIGOR ³
IF Finger.clickL
THEN Hero.class
= 1 ' ¾ ELSEIF fingerIsOnSurface%
(320, 139, 32, 32) THEN '¿ barShowingPercentage 327, 212, 50 'STRENGTH ³
barShowingPercentage 327, 228, 100 'AGILITY ³ ASSASIN
barShowingPercentage 327, 244, 25 'POWER ³
barShowingPercentage 327, 260, 75 ' VIGOR ³
IF Finger.clickL
THEN Hero.class
= 2 ' ¾ ELSEIF fingerIsOnSurface%
(354, 139, 32, 32) THEN '¿ barShowingPercentage 327, 212, 25 'STRENGTH ³
barShowingPercentage 327, 228, 50 'AGILITY ³ WIZARD
barShowingPercentage 327, 244, 100 'POWER ³
barShowingPercentage 327, 260, 75 ' VIGOR ³
IF Finger.clickL
THEN Hero.class
= 3 ' ³ _PUTIMAGE (Finger.x
- 1, Finger.y
- 1), FingerImg&
(1) ' show finger LOOP UNTIL Hero.class
<> -1 ' leave when we have a class '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - -
DIM playerChoosingName$
'¿ Hero.id = "" ' ¿ get ready for recive
playerChoosingName$ = "" ' Ù something
suffixForName$ = "the "
CASE 0: suffixForName$
= suffixForName$
+ "Barbarian" ' ³ CASE 1: suffixForName$
= suffixForName$
+ "Clerig" ' ³ CASE 2: suffixForName$
= suffixForName$
+ "Assasin" ' ³ we already have CASE 3: suffixForName$
= suffixForName$
+ "Wizard" ' ³ an rpg class ;) ii%
= 40 - (LEN(suffixForName$
) \
2) ' center it Ù getMouseData
CLS , GREEN3
'all screen clear on green3 drawMenuBack 240, 99, 398, 274
PRINT "ENTER YOUR NAME";
' Ù drawItemSlots 303, 139 ' slot for hero image
SELECT CASE Hero.class
' images of possible hero chosen PRINT "This story begins";
' ³ text pre PRINT "with a hero called";
' Ù ' write ³
IF LEN(playerChoosingName$
) < 11 THEN ' ³ keyboard IF LEN(playerChoosingName$
) > 0 THEN ' if the name has at least one character ³ particular IF LEN(playerChoosingName$
) = 1 THEN playerChoosingName$
= UCASE$(playerChoosingName$
) 'capitalize the first one ³ IF ASC(key$
) = 8 THEN playerChoosingName$
= LEFT$(playerChoosingName$
, LEN(playerChoosingName$
) - 1) ' if backspace erease one letter ³ menu IF ASC(key$
) = 13 THEN Hero.id
= playerChoosingName$
' confirm name ³ i%
= 40 - (LEN(playerChoosingName$
) \
2) '¿ print the name LOCATE 14, i%
' ³ the player is PRINT playerChoosingName$;
"_";
' Ù actually writing PRINT suffixForName$;
'Ù "the " + Hero.class as words _PUTIMAGE (287, 245), FingerImg&
(5) ' GO ¿ print _PUTIMAGE (335, 245), FingerImg&
(0) ' X Ù "buttons" IF Finger.clickL
THEN ' when u click ¿ IF LEN(playerChoosingName$
) > 0 THEN ' and some name has been written ³ ' if finger position ok, then confirm name ³ mouse click
IF fingerIsOnSurface%
(287, 245, 16, 16) THEN Hero.id
= playerChoosingName$
'³ inputs in END IF ' ³ this particular ' if u click on the cross erease the pre-name ³ menu
IF fingerIsOnSurface
(335, 245, 16, 16) THEN playerChoosingName$
= "" ' ³ _PUTIMAGE (Finger.x
- 1, Finger.y
- 1), FingerImg&
(1) ' show finger LOOP UNTIL Hero.id
<> "" ' leave here when we have a name '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB lookInPocket
() 'what about in case of commerce or chest, bag, bones, etc....????
drawMenuBack 320, 32, 639, 383 ' POCKET & EQUIPED
drawMenuBack 0, 384, 639, 479 ' ITEM INFO
IF fingerIsOnSurface%
(328, 40, 16, 16) AND inHand.lvl
= -1 THEN HUDpromt$ = "Back to game"
IF Finger.clickL
THEN menuPocket`
= FALSE
drawItemSlots Pocket(i%).x, Pocket(i%).y ' POCKET & EQUIPPED slots draw
LINE (480, 64)-(480, 351), GREEN1
' divisory line
IF fingerIsOnSurface
(Pocket
(i%
).x
, Pocket
(i%
).y
, 32, 32) THEN itemInformation i%
' if mouse over an item inform
drawItemsInPocket
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB selectSomeSpell
() ' INCOMPLETE
drawMenuBack 320, 32, 639, 383
drawMenuBack 0, 384, 639, 479 ' spell info board
x% = 409
y% = 120
drawItemSlots x% + (j% * 54), y% + (i% * 54)
drawItemSlots 447, 286
IF fingerIsOnSurface%
(328, 40, 16, 16) AND inHand.lvl
= -1 AND NOT menuMain`
THEN HUDpromt$ = "Back to game"
IF Finger.clickL
THEN menuSpells`
= FALSE
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateNameOfHeroClass$
(heroClass%
) CASE 0: calculateNameOfHeroClass$
= "Barbarian" CASE 1: calculateNameOfHeroClass$
= "Clerig" CASE 2: calculateNameOfHeroClass$
= "Assasin" CASE 3: calculateNameOfHeroClass$
= "Wizard" '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB showTheStats
() ' STILL HAVE TO: !!!ARROW FOR UPGRADING CAN'T APPEAR IF WE REACHED TOP OF SKILL FOR CLASS!!!!
drawMenuBack 0, 32, 319, 383 '
'drawMenuBack 0, 384, 639, 479 ' ITEM
IF fingerIsOnSurface%
(297, 40, 16, 16) AND inHand.lvl
= -1 THEN HUDpromt$ = "Back to game"
IF Finger.clickL
THEN menuStats`
= FALSE
drawItemSlots
64, 96:
_PUTIMAGE (64, 96), calculateHeroImg&
(Hero.class
, Hero.lvl
) drawItemSlots
144, 96:
_PUTIMAGE (144, 104), LvlImg&
(0):
_PUTIMAGE (160, 104), LvlImg&
(Hero.lvl
)
LOCATE 8, 28:
PRINT calculateNameOfHeroClass$
(Hero.class
)
'BASE
LOCATE 17, 25:
PRINT "TO HIT %"; calculateHeroChanceToHit%;
LOCATE 22, 14:
PRINT "POINTS TO ADD"; Hero.attributePoints;
IF Hero.attributePoints
> 0 THEN ' if you have points
_PUTIMAGE (184, 160), DirArrowImg&
(4) ' strength ¿ IF fingerIsOnSurface%
(184, 160, 16, 16) THEN ' ³ printHUDpromt "Increase your strength" ' ³
Hero.strength = Hero.strength + 1 ' ³
Hero.attributePoints = Hero.attributePoints - 1 '³
_PUTIMAGE (184, 176), DirArrowImg&
(4) ' agility ³ IF fingerIsOnSurface%
(184, 176, 16, 16) THEN ' ³ printHUDpromt "Increase your agility" ' ³
Hero.agility = Hero.agility + 1 ' ³ ARROWS
Hero.attributePoints = Hero.attributePoints - 1 '³ FOR
END IF ' ³ UPGRADING <---------------Need to make functions for checking topStrength, topPower, etc... calculateHeroTopVigor _PUTIMAGE (184, 192), DirArrowImg&
(4) ' power ³ IF fingerIsOnSurface%
(184, 192, 16, 16) THEN ' ³ printHUDpromt "Increase your power" ' ³
Hero.power = Hero.power + 1 ' ³
Hero.attributePoints = Hero.attributePoints - 1 '³
_PUTIMAGE (184, 208), DirArrowImg&
(4) ' vigor ³ IF fingerIsOnSurface%
(184, 208, 16, 16) THEN ' ³ printHUDpromt "Increase your vigor" ' ³
Hero.vigor = Hero.vigor + 1 ' ³
Hero.attributePoints = Hero.attributePoints - 1 '³
'NOW
LINE (179, 146)-(179, 219), GREEN1
' separation line between BASE & NOW
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB lookAtMap
() ' INCOMPLETE drawMenuBack 16, 48, 624, 464
'closeWindowButton 608, 52
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB cleanYourHand
() '°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Û ITEMS Û°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° inHand.kind = -1
inHand.lvl = -1
inHand.ammount = 0
inHand.special = ""
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
lookForSpaceInPocket% = FALSE
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Pocket(i%).kind = -1
Pocket(i%).lvl = -1
Pocket(i%).ammount = 0
Pocket(i%).special = ""
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB createItemInPocket
(kind%
, lvl%
, ammount%
, slot%
, special$
) Pocket(slot%).kind = kind%
Pocket(slot%).lvl = lvl%
Pocket(slot%).ammount = ammount%
Pocket(slot%).special = special$
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB cleanOnePocketSlot
(indexOfSlot%
) Pocket(indexOfSlot%).kind = -1
Pocket(indexOfSlot%).lvl = -1
Pocket(indexOfSlot%).ammount = 0
Pocket(indexOfSlot%).special = ""
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IF Items
(i%
).map
= actualmapworking%
THEN _PUTIMAGE (Items
(i%
).x
+ 8, Items
(i%
).y
+ 8), calculateItemOnGroundImage&
(Items
(i%
).kind
) '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_PUTIMAGE (Pocket
(i%
).x
, Pocket
(i%
).y
), calculateItemImage&
(Pocket
(i%
).kind
, Pocket
(i%
).lvl
) _PUTIMAGE (inHand.x
- 16, inHand.y
- 16), calculateItemImage&
(inHand.kind
, inHand.lvl
) '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateItemOnGroundImage&
(k%
) calculateItemOnGroundImage& = GndItemsImg&(k%)
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateItemImage&
(kind%
, lvl%
) 'TO DO:case 18= history or special related items CASE -1: calculateItemImage&
= BlankImg&
CASE 0: calculateItemImage&
= KeyImg&
(lvl%
) CASE 1: calculateItemImage&
= PotionImg&
(lvl%
) CASE 2: calculateItemImage&
= PaperImg&
(lvl%
) CASE 3: calculateItemImage&
= BookImg&
(lvl%
) CASE 4: calculateItemImage&
= SwordImg&
(lvl%
) CASE 5: calculateItemImage&
= AxeImg&
(lvl%
) CASE 6: calculateItemImage&
= ThrowImg&
(lvl%
) CASE 7: calculateItemImage&
= BowImg&
(lvl%
) CASE 8: calculateItemImage&
= CrossbowImg&
(lvl%
) CASE 9: calculateItemImage&
= BombImg&
(lvl%
) CASE 10: calculateItemImage&
= ArrowImg&
(lvl%
) CASE 11: calculateItemImage&
= BoltImg&
(lvl%
) CASE 12: calculateItemImage&
= ArmorImg&
(lvl%
) CASE 13: calculateItemImage&
= HelmImg&
(lvl%
) CASE 14: calculateItemImage&
= ShieldImg&
(lvl%
) CASE 15: calculateItemImage&
= WandImg&
(lvl%
) CASE 16: calculateItemImage&
= MoneyImg&
(lvl%
) CASE 17: calculateItemImage&
= BijouImg&
(lvl%
) 'CASE 18: calculateItemImage& = WonderImg&(lvl%)
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.
SUB actualizeMoneyAspect
() IF Pocket
(i%
).kind
= 16 AND Pocket
(i%
).lvl
< 2 THEN ' IF Pocket
(i%
).ammount
> 249 THEN ' Pocket(i%).lvl = 1 '
Pocket(i%).lvl = 0 '
IF inHand.kind
= 16 AND inHand.lvl
< 2 THEN ' IF inHand.ammount
> 249 THEN ' inHand.lvl = 1 '
inHand.lvl = 0 '
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateWandMaxCharges%
(lvl%
) calculateWandMaxCharges% = 20 + (lvl% * 5)
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateItemDefense%
(kind%
, lvl%
, special$
) 'TO DO:balance the game tmp% = 0
CASE 12: tmp%
= 3 + 3 * lvl%
' ARMORS CASE 13: tmp%
= 1 + 1 * lvl%
' HELMS CASE 14: tmp%
= 2 + 2 * lvl%
' SHIELDS calculateItemDefense% = tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateItemBaseDmg%
(kind%
, lvl%
, special$
) 'TO DO:balance the game tmp% = 0
CASE 4: tmp%
= (lvl%
+ 1) * 2 ' SWORDS CASE 5: tmp%
= (lvl%
+ 1) * 3 ' AXES CASE 6: tmp%
= (lvl%
+ 1) ' THROWS CASE 7: tmp%
= (lvl%
+ 1) * 2 ' BOWS CASE 8: tmp%
= (lvl%
+ 1) * 3 ' CROSSBOWS CASE 9: tmp%
= (lvl%
+ 1) * 15 ' BOMBS CASE 10: tmp%
= (lvl%
+ 1) * 2 ' ARROWS CASE 11: tmp%
= (lvl%
+ 1) * 3 ' BOLTS CASE 15: tmp%
= (lvl%
+ 1) ' WANDS calculateItemBaseDmg% = tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateItemMaxDmg%
(kind%
, lvl%
, special$
) 'TO DO: balance the game k% = kind%
l% = lvl%
s$ = special$
CASE 4: tmp%
= calculateItemBaseDmg%
(k%
, l%
, s$
) + 3 ' SWORDS CASE 5: tmp%
= calculateItemBaseDmg%
(k%
, l%
, s$
) + 4 ' AXES CASE 6: tmp%
= calculateItemBaseDmg%
(k%
, l%
, s$
) + 1 ' THROWS CASE 7: tmp%
= calculateItemBaseDmg%
(k%
, l%
, s$
) + 2 ' BOWS CASE 8: tmp%
= calculateItemBaseDmg%
(k%
, l%
, s$
) + 3 ' CROSSBOWS CASE 9: tmp%
= calculateItemBaseDmg%
(k%
, l%
, s$
) + (l%
+ 1) * 5 ' BOMBS CASE 10: tmp%
= calculateItemBaseDmg%
(k%
, l%
, s$
) + 1 ' ARROWS CASE 11: tmp%
= calculateItemBaseDmg%
(k%
, l%
, s$
) + 2 ' BOLTS CASE 15: tmp%
= calculateItemBaseDmg%
(k%
, l%
, s$
) + 1 ' WANDS calculateItemMaxDmg% = tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION nameAnItem$
(kind%
, lvl%
, special$
) 'TO DO:case 18=history related items, scroll names?
tmp$ = ""
tmp$ = tmp$ + " key"
tmp$ = tmp$ + " potion"
CASE 0: tmp$
= "Ancient book" CASE 1: tmp$
= "Old book" CASE 3: tmp$
= "Enciclopedy" CASE 5: tmp$
= "Sharpened" CASE 6: tmp$
= "Celestial" CASE 7: tmp$
= "Demoniac" tmp$ = tmp$ + " sword"
CASE 0: tmp$
= "Bushcraft" CASE 5: tmp$
= "Sharp double" CASE 7: tmp$
= "Demoniac" tmp$ = tmp$ + " axe"
tmp$ = tmp$ + " shurikens"
CASE 1: tmp$
= "Composite" tmp$ = tmp$ + " bow"
tmp$ = tmp$ + " crossbow"
tmp$ = tmp$ + " bombs"
tmp$ = tmp$ + " arrows"
tmp$ = tmp$ + " bolts"
CASE 0: nameAnItem$
= "Leather vest" + itemSpecialSuffix$
(special$
):
EXIT FUNCTION CASE 1: nameAnItem$
= "Leather armor" + itemSpecialSuffix$
(special$
):
EXIT FUNCTION tmp$ = tmp$ + " plate"
CASE 5: nameAnItem$
= "Small Helmet" + itemSpecialSuffix$
(special$
):
EXIT FUNCTION CASE 6: nameAnItem$
= "Great healmet" + itemSpecialSuffix$
(special$
):
EXIT FUNCTION CASE 7: nameAnItem$
= "Hellking Crown" + itemSpecialSuffix$
(special$
):
EXIT FUNCTION tmp$ = tmp$ + " cap"
tmp$ = tmp$ + " shield"
CASE 0: tmp$
= "Apprentice" CASE 1: tmp$
= "Initiate" CASE 3: tmp$
= "Academic" CASE 6: tmp$
= "Egiptian" tmp$ = tmp$ + " wand"
CASE 1: tmp$
= "Many coins" CASE 2: tmp$
= "Crude gemstones" CASE 3: tmp$
= "Gemstone" CASE 3: tmp$
= "Necklace" 'CASE 18 '
' SELECT CASE lvl%
' CASE 0: tmp$ = "Dyran crystals"
' CASE 1: tmp$ = "The Orb"
' END SELECT
nameAnItem$ = tmp$ + itemSpecialSuffix$(special$)
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CASE 2: tmp$
= "warriors" CASE 2: tmp$
= "swiftness" CASE 3: tmp$
= "martiality" CASE 1: tmp$
= "ilusionism" CASE 2: tmp$
= "invocation" CASE 3: tmp$
= "necromancy" CASE 1: tmp$
= "youthness" CASE 2: tmp$
= "longevity" CASE 3: tmp$
= "eternity" CASE 1: tmp$
= "protection" CASE 2: tmp$
= "guardian" CASE 1: tmp$
= "fatality" CASE 2: tmp$
= "brutality" CASE 3: tmp$
= "animality" CASE 1: tmp$
= "craftmanship" CASE 2: tmp$
= "technicism" CASE 3: tmp$
= "engineering" CASE 2: tmp$
= "exactitud" CASE 3: tmp$
= "precision" CASE 0: tmp$
= "firebolt" CASE 1: tmp$
= "blessing" CASE 2: tmp$
= "infravision" CASE 3: tmp$
= "teleport" CASE 5: tmp$
= "mana shield" itemSpecialSuffix$ = " of " + tmp$
itemSpecialSuffix$ = ""
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB fromPocketToHand
(slotIndex%
) inHand.kind = Pocket(slotIndex%).kind
inHand.lvl = Pocket(slotIndex%).lvl
inHand.ammount = Pocket(slotIndex%).ammount
inHand.special = Pocket(slotIndex%).special
cleanOnePocketSlot slotIndex%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB fromHandToPocket
(slotIndex%
) Pocket(slotIndex%).kind = inHand.kind
Pocket(slotIndex%).lvl = inHand.lvl
Pocket(slotIndex%).ammount = inHand.ammount
Pocket(slotIndex%).special = inHand.special
cleanYourHand
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Items
(UBOUND(Items
)).x
= Hero.x
' Items
(UBOUND(Items
)).y
= Hero.y
' Items
(UBOUND(Items
)).kind
= inHand.kind
' Items
(UBOUND(Items
)).lvl
= inHand.lvl
' Items
(UBOUND(Items
)).ammount
= inHand.ammount
' Items
(UBOUND(Items
)).special
= inHand.special
' Items
(UBOUND(Items
)).map
= actualMapWorking%%
' cleanYourHand
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB pickItemFromGround
(indexOfItem%
) IF lookForSpaceInPocket%
THEN ' if theres place in your pocket IF indexOfItem%
= UBOUND(Items
) THEN ' and that item is the last one of the array Pocket(lookForSpaceInPocket%).kind = Items(idexOfItem%).kind ' ¿
Pocket(lookForSpaceInPocket%).lvl = Items(idexOfItem%).lvl ' ³ Transfer the data of the item to
Pocket(lookForSpaceInPocket%).ammount = Items(idexOfItem%).ammount '³ the free place on Pocket
Pocket(lookForSpaceInPocket%).special = Items(idexOfItem%).special '¾
ELSE ' but if the item is not the last one of the array Pocket(lookForSpaceInPocket%).kind = Items(idexOfItem%).kind ' ¿
Pocket(lookForSpaceInPocket%).lvl = Items(idexOfItem%).lvl ' ³ Transfer the data of the item to
Pocket(lookForSpaceInPocket%).ammount = Items(idexOfItem%).ammount '³ the free place on Pocket
Pocket(lookForSpaceInPocket%).special = Items(idexOfItem%).special '¾
Items
(indexOfItem%
).x
= Items
(UBOUND(Items
)).x
' ¿ Items
(indexOfItem%
).y
= Items
(UBOUND(Items
)).y
' ³ Items
(indexOfItem%
).kind
= Items
(UBOUND(Items
)).kind
' ³ copy all the data of the last item Items
(indexOfItem%
).lvl
= Items
(UBOUND(Items
)).lvl
' ³ in the array to this index of the array, Items
(indexOfItem%
).ammount
= Items
(UBOUND(Items
)).ammount
' ³ overwriting the item we just picked Items
(indexOfItem%
).special
= Items
(UBOUND(Items
)).special
' ³ Items
(indexOfItem%
).map
= Items
(UBOUND(Items
)).map
' ¾ REDIM _PRESERVE Items
(UBOUND(Items
) - 1) AS OBJECT
' now we can eliminate the last item of the array (it has been copied to the picked item index) ELSE ' if you have no room in pocket HUDpromt$ = "You have no room on your pocket" ' you should be aware of it
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB itemManipulation
() 'TO DO: reading scrolls
FOR i%
= 7 TO 22 ' INVENTORY IF fingerIsOnSurface%
(Pocket
(i%
).x
, Pocket
(i%
).y
, 32, 32) THEN IF NOT itemRequirementsMet%
(i%
) THEN HUDpromt$
= "Requirements don't met" IF Finger.clickL
AND (Pocket
(i%
).lvl
<> -1 AND inHand.lvl
= -1) THEN 'grabbing an item from a slot fromPocketToHand i%
ELSEIF Finger.clickL
AND (Pocket
(i%
).lvl
= -1 AND inHand.lvl
<> -1) THEN 'droping an item into an empty slot fromHandToPocket i%
ELSEIF Finger.clickL
AND inHand.lvl
<> -1 AND Pocket
(i%
).kind
= inHand.kind
THEN 'trying to add multiple instances of the same thing checkForAddingAmmounts i%
IF Finger.clickR
THEN ' if RIGHT click Hero.life = Hero.life + (Pocket(i%).lvl + 1) * 5 ' increase helth ¿ DRINKING A POTION
cleanOnePocketSlot i% ' and destroy the item ¾
menuPocket` = FALSE ' ³ READING THE MAP
menuSpells` = FALSE ' ³
menuStats` = FALSE ' ³
menuMap` = TRUE ' ¾
' ³ TO DO: reading a scroll
IF itemRequirementsMet%
(i%
) THEN specialNum%
= VAL(RIGHT$(Pocket
(i%
).special
, 1)) 'convert the second digit of special into a value and the CASE SELECT it for adding 1 to the corrresponding spell, if is't less than 10 CASE 0:
IF SpellsIknow%%
(0) < 10 THEN SpellsIknow%%
(0) = spellsiknow%%
+ 1 CASE 1:
IF SpellsIknow%%
(1) < 10 THEN SpellsIknow%%
(1) = spellsiknow%%
+ 1 CASE 2:
IF SpellsIknow%%
(2) < 10 THEN SpellsIknow%%
(2) = spellsiknow%%
+ 1 CASE 3:
IF SpellsIknow%%
(3) < 10 THEN SpellsIknow%%
(3) = spellsiknow%%
+ 1 CASE 4:
IF SpellsIknow%%
(4) < 10 THEN SpellsIknow%%
(4) = spellsiknow%%
+ 1 CASE 5:
IF SpellsIknow%%
(5) < 10 THEN SpellsIknow%%
(5) = spellsiknow%%
+ 1 cleanOnePocketSlot i% ' and destroy the item
ELSE ' if requirements aren't met or spell is lvl 10 already SOUND 220, 1 ' play "booooooo" sound
FOR i%
= 0 TO 6 ' EQUIPPED IF fingerIsOnSurface%
(Pocket
(i%
).x
, Pocket
(i%
).y
, 32, 32) THEN IF Finger.clickL
AND (Pocket
(i%
).lvl
<> -1 AND inHand.lvl
= -1) THEN fromPocketToHand i% ' if LEFT click grab an item from a slot. No big deal on this
ELSEIF Finger.clickL
AND inHand.lvl
<> -1 AND Pocket
(i%
).kind
= inHand.kind
AND Pocket
(i%
).lvl
= inHand.lvl
THEN 'trying to add multiple instances of the same thing checkForAddingAmmounts i%
ELSEIF Pocket
(i%
).lvl
= -1 AND inHand.lvl
<> -1 THEN 'droping an item into a slot needs to check and inform some things IF itemFitsEquipmentSlot%
(i%
) THEN IF itemRequirementsMet%
(0) THEN IF Finger.clickL
THEN fromHandToPocket i%
HUDpromt$ = "Requirements not met"
IF Finger.clickL
AND inHand.kind
<> -1 AND fingerIsOnSurface%
(0, 32, 319, 384) THEN dropItemToGround
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB checkForAddingAmmounts
(indexOfSlot%
) ' in a single slot you can fir: 500 coins; 100 throws; 75 arrows, 50 bolts or 6 bombs IF Pocket
(indexOfSlot%
).lvl
= inHand.lvl
THEN IF inHand.ammount
+ Pocket
(indexOfSlot%
).ammount
> 100 THEN tmp1% = 100 - Pocket(indexOfSlot%).ammount
Pocket(indexOfSlot%).ammount = Pocket(indexOfSlot%).ammount + tmp1%
inHand.ammount = inHand.ammount - tmp1%
Pocket(indexOfSlot%).ammount = Pocket(indexOfSlot%).ammount + inHand.ammount
cleanYourHand
IF inHand.ammount
+ Pocket
(indexOfSlot%
).ammount
> 6 THEN tmp1% = 6 - Pocket(indexOfSlot%).ammount
Pocket(indexOfSlot%).ammount = Pocket(indexOfSlot%).ammount + tmp1%
inHand.ammount = inHand.ammount - tmp1%
Pocket(indexOfSlot%).ammount = Pocket(indexOfSlot%).ammount + inHand.ammount
cleanYourHand
IF inHand.ammount
+ Pocket
(indexOfSlot%
).ammount
> 75 THEN tmp1% = 75 - Pocket(indexOfSlot%).ammount
Pocket(indexOfSlot%).ammount = Pocket(indexOfSlot%).ammount + tmp1%
inHand.ammount = inHand.ammount - tmp1%
Pocket(indexOfSlot%).ammount = Pocket(indexOfSlot%).ammount + inHand.ammount
cleanYourHand
IF inHand.ammount
+ Pocket
(indexOfSlot%
).ammount
> 50 THEN tmp1% = 50 - Pocket(indexOfSlot%).ammount
Pocket(indexOfSlot%).ammount = Pocket(indexOfSlot%).ammount + tmp1%
inHand.ammount = inHand.ammount - tmp1%
Pocket(indexOfSlot%).ammount = Pocket(indexOfSlot%).ammount + inHand.ammount
cleanYourHand
IF inHand.kind
= 16 AND inHand.lvl
< 2 AND Pocket
(indexOfSlot%
).lvl
< 2 THEN ' money IF inHand.ammount
+ Pocket
(indexOfSlot%
).ammount
> 500 THEN tmp1% = 500 - Pocket(indexOfSlot%).ammount
Pocket(indexOfSlot%).ammount = Pocket(indexOfSlot%).ammount + tmp1%
inHand.ammount = inHand.ammount - tmp1%
Pocket(indexOfSlot%).ammount = Pocket(indexOfSlot%).ammount + inHand.ammount
cleanYourHand
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IF P%
> 0 THEN ' 0= HAND, other number=index of POCKET IF calculateHeroActualStrength%
>= calculateItemReqStrength%
(Pocket
(P%
).kind
, Pocket
(P%
).lvl
) _
AND calculateHeroActualAgility%
>= calculateItemReqAgility%
(Pocket
(P%
).kind
, Pocket
(P%
).lvl
) _
AND calculateHeroActualPower%
>= calculateItemReqPower%
(Pocket
(P%
).kind
, Pocket
(P%
).lvl
, Pocket
(P%
).special
) THEN IF calculateHeroActualStrength%
>= calculateItemReqStrength%
(inHand.kind
, inHand.lvl
) _
AND calculateHeroActualAgility%
>= calculateItemReqAgility%
(inHand.kind
, inHand.lvl
) _
AND calculateHeroActualPower%
>= calculateItemReqPower%
(inHand.kind
, inHand.lvl
, inHand.special
) THEN itemRequirementsMet% = FALSE
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateItemReqStrength%
(k%
, l%
) calculateItemReqStrength% = 0
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateItemReqAgility%
(k%
, l%
) calculateItemReqAgility% = 0
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateItemReqPower%
(k%
, l%
, s$
) CASE 2 ' scrolls only, lvl0 CASE 3 ' books, need to check spellsIkonw calculateItemReqPower%
= SpellsIknow%%
(0) * 4 + 17:
EXIT FUNCTION calculateItemReqPower%
= SpellsIknow%%
(1) * 4 + 17:
EXIT FUNCTION calculateItemReqPower%
= SpellsIknow%%
(2) * 4 + 17:
EXIT FUNCTION calculateItemReqPower%
= SpellsIknow%%
(3) * 4 + 17:
EXIT FUNCTION calculateItemReqPower%
= SpellsIknow%%
(4) * 4 + 17:
EXIT FUNCTION calculateItemReqPower%
= SpellsIknow%%
(5) * 4 + 17:
EXIT FUNCTION calculateItemReqPower% = 0
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION itemFitsEquipmentSlot%
(indexOfSlot%
) SELECT CASE indexOfSlot%
' we are checking where you wanna put the item IF inHand.kind
= 13 THEN itemFitsEquipmentSlot%
= TRUE:
EXIT FUNCTION ' if you holding a helm CASE 4, 5, 6, 9, 15: itemFitsEquipmentSlot%
= TRUE:
EXIT FUNCTION 'if in hand you have: swords,axes,throws,bombs or wands CASE 7, 8 ' if a bow or crossbow in hand IF Pocket
(4).kind
<> -1 THEN '& left hand is occupied HUDpromt$ = "Left hand is occupied"
IF inHand.kind
= 12 THEN itemFitsEquipmentSlot%
= TRUE:
EXIT FUNCTION ' if you holding an armor CASE 14 ' if you have a shield in hand IF (Pocket
(2).kind
= 7 OR Pocket
(2).kind
= 8) THEN ' & on right hand you have a two handed weapon HUDpromt$ = "Can't use it with a two handed weapon"
CASE 10 'and you have arrows in hand IF Pocket
(2).kind
= 7 THEN ' & a bow equiped HUDpromt$ = "You need to equip a bow"
CASE 11 ' if you have bolts in hand IF Pocket
(2).kind
= 8 THEN ' and a crossbow equiped HUDpromt$ = "You need to equip a crossbow"
itemFitsEquipmentSlot% = FALSE
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB itemInformation
(whichOfTheSlots%
) ' TO DO: show requirements of items, organize how the info is seen acording to kind of item, add info for r special variable on items ' i can use lines 26, 27, 28, 29
kindOfItem% = Pocket(whichOfTheSlots%).kind
lvlOfItem% = Pocket(whichOfTheSlots%).lvl
specialOfItem$ = Pocket(whichOfTheSlots%).special
'1rst LINE = NAME OF ITEM OR BODY SLOT
IF whichOfTheSlots%
< 7 AND kindOfItem%
= -1 THEN CASE 2: tmp$
= "Right hand" CASE 4: tmp$
= "Left hand" CASE 5: tmp$
= "Right finger" CASE 6: tmp$
= "Left finger" tmp$ = nameAnItem$(kindOfItem%, lvlOfItem%, specialOfItem$)
'2nd LINE
tmp$ = "" ' kill me after testing!!!!!!!
CASE 0: tmp$
= "Opens some door" 'keys CASE 1: tmp$
= "Heals" + STR$((lvlOfItem%
+ 1) * 5) + " points" ' potions CASE 2: tmp$
= "Right click for read" ' papers CASE 3: tmp$
= "Learn about this spell" 'books CASE 4, 5, 7, 8, 15: tmp$
= "Damage: " + _TRIM$(STR$(calculateItemBaseDmg%
(kindOfItem%
, lvlOfItem%
, specialOfItem$
))) + " - " + _TRIM$(STR$(calculateItemMaxDmg%
(kindOfItem%
, lvlOfItem%
, specialOfItem$
))) ' weapons CASE 6, 9, 10, 11: tmp$
= "Damage: " + _TRIM$(STR$(calculateItemBaseDmg%
(kindOfItem%
, lvlOfItem%
, specialOfItem$
))) + " - " + _TRIM$(STR$(calculateItemMaxDmg%
(kindOfItem%
, lvlOfItem%
, specialOfItem$
))) 'ammunitions + throws CASE 12, 13, 14: tmp$
= "Defense:" + STR$(calculateItemDefense%
(kindOfItem%
, lvlOfItem%
, specialOfItem$
)) ' armors, helms & shields CASE 16: tmp$
= "Ammount:" + STR$(Pocket
(whichOfTheSlots%
).ammount
) ' money tmp$ = "You can wear it on your finger"
tmp$ = "You can wear it on your neck"
'3rd LINE
tmp$ = "" ' kill me after testing!!!!!!!
tmp$
= "+" + RIGHT$(specialOfItem$
, 1) + " to " tmp$ = tmp$ + "strenght"
tmp$ = tmp$ + "agility"
tmp$ = tmp$ + "power"
tmp$ = tmp$ + "vigor"
tmp$ = tmp$ + "defense"
tmp$ = ""
tmp$ = ""
CASE 1: tmp$
= "Right click for drink" ' potions CASE 3: tmp$
= "Right click for read" ' books CASE 6, 9, 10, 11: tmp$
= "Ammount:" + STR$(Pocket
(whichOfTheSlots%
).ammount
) ' ammo
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB equipOurHero
() ' remove test items CASE 0 ' "Barbarian" ' you get an axe, a shield, a potion and 100$ createItemInPocket 5, 0, 1, 2, "" ' axe
createItemInPocket 14, 0, 1, 4, "" ' shield
'°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°TESTING
createItemInPocket 12, 2, 1, 7, "a2" ' armor
createItemInPocket 13, 3, 1, 8, "v3" ' helm
createItemInPocket 7, 0, 1, 9, "" ' bow
createItemInPocket 2, 1, 1, 10, "" ' map
createItemInPocket 17, 0, 1, 11, "p2" ' ring
createItemInPocket 10, 0, 50, 12, "" ' 50 arrows
createItemInPocket 17, 2, 1, 13, "d2" ' SAID for test!!!!!!!!!!
createItemInPocket 16, 0, 100, 14, "" ' 100 coins
createItemInPocket 16, 0, 100, 15, "" ' 100 coins
createItemInPocket 16, 0, 100, 16, "" ' 100 coins
createItemInPocket 10, 0, 50, 17, "" ' 50 arrows
createItemInPocket 16, 0, 123, 18, "" ' 100 coins
'°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
CASE 1 ' "Clerig" 'you get a sword, a shield, a potion and 100$ createItemInPocket 4, 0, 1, 2, "" ' sword
createItemInPocket 14, 0, 1, 4, "" ' shield
CASE 2 ' "Assasin" ' you get a bow, 50 arrows, a potion and 100$ createItemInPocket 7, 0, 1, 2, "" ' bow
createItemInPocket 10, 0, 50, 4, "" ' 50 arrows
'°°°°°°°°°°°°°°°
createItemInPocket 10, 0, 50, 17, "" ' 50 arrows
createItemInPocket 16, 3, 1, 18, "" ' gem
createItemInPocket 11, 0, 27, 19, "" ' bolts
createItemInPocket 11, 0, 43, 20, "" ' bolts
createItemInPocket 9, 0, 4, 8, "" ' bombs
createItemInPocket 9, 0, 4, 7, "" ' bombs
'°°°°°°°°°°
CASE 3 '"Wizard" ' you get a wand, a book, a potion and 100$ createItemInPocket 15, 0, 21, 2, "r0" ' wand
createItemInPocket 3, 0, 1, 20, "t0" ' book
createItemInPocket 1, 0, 1, 21, "" ' potion
createItemInPocket 16, 0, 100, 22, "" ' 100 coins
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateHeroActualAgility%
() '°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Û HERO Û°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° tmp% = 0
tmp%
= tmp%
+ VAL(RIGHT$(Pocket
(i%
).special
, 1)) calculateHeroActualAgility% = Hero.agility + tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateHeroActualStrength%
() tmp% = 0
tmp%
= tmp%
+ VAL(RIGHT$(Pocket
(i%
).special
, 1)) calculateHeroActualStrength% = Hero.strength + tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
tmp% = 0
tmp%
= tmp%
+ VAL(RIGHT$(Pocket
(i%
).special
, 1)) calculateHeroActualPower% = Hero.power + tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
tmp% = 0
tmp%
= tmp%
+ VAL(RIGHT$(Pocket
(i%
).special
, 1)) calculateHeroActualVigor% = Hero.vigor + tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
tmp% = 0
tmp%
= tmp%
+ (VAL(RIGHT$(Pocket
(i%
).special
, 1)) * 7) calculateHeroChanceToHit%
= INT(calculateHeroActualAgility
* 1.15) + 20 + tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
tmp% = 0
tmp% = tmp% + calculateItemDefense%(Pocket(i%).kind, Pocket(i%).lvl, Pocket(i%).special)
calculateHeroDefense% = tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateHeroBaseDmg%
() 'i should watch the case of no ammo, returning 0 IN PROCCES. Also should be affected by Strength, except if throw tmp% = 0
IF Pocket
(2).kind
= -1 THEN ' if empty right hand IF Pocket
(2).kind
= 7 AND Pocket
(4).kind
<> 10 THEN ' if in right hand a bow and in left hand something different than arrows ELSEIF Pocket
(2).kind
= 8 AND Pocket
(4).kind
<> 11 THEN ' if in right hand a crossbow and in left hand something different than bolts tmp% = tmp% + calculateItemBaseDmg%(Pocket(i%).kind, Pocket(i%).lvl, Pocket(i%).special)
calculateHeroBaseDmg% = tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateHeroMaxDmg%
() ' i should watch the case of no ammo, returning 0. Also should be affected by Strength, except if throw tmp% = 0
IF Pocket
(2).kind
= -1 THEN ' if empty right hand IF Pocket
(2).kind
= 7 AND Pocket
(4).kind
<> 10 THEN ' if in right hand a bow and in left hand something different than arrows ELSEIF Pocket
(2).kind
= 8 AND Pocket
(4).kind
<> 11 THEN ' if in right hand a crossbow and in left hand something different than bolts tmp% = tmp% + calculateItemMaxDmg%(Pocket(i%).kind, Pocket(i%).lvl, Pocket(i%).special)
calculateHeroMaxDmg% = tmp%
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
calculateMaxLife%
= INT(calculateHeroActualVigor%
* 2.75)'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
calculateMaxMana%
= INT(calculateHeroActualPower%
* 3.25)'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_PUTIMAGE (Hero.x
, Hero.y
), calculateHeroImg&
(Hero.class
, Hero.lvl
) '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateHeroImg&
(classOfHero%
, lvlOfHero%
) CASE 0: calculateHeroImg&
= HeroImg&
(0) CASE 1: calculateHeroImg&
= HeroImg&
(2) CASE 2: calculateHeroImg&
= HeroImg&
(4) CASE 3: calculateHeroImg&
= HeroImg&
(6) CASE 0: calculateHeroImg&
= HeroImg&
(1) CASE 1: calculateHeroImg&
= HeroImg&
(3) CASE 2: calculateHeroImg&
= HeroImg&
(5) CASE 3: calculateHeroImg&
= HeroImg&
(7) '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB drawEnemies
() '°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Û ENEMIES Û°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° IF Enemy
(i%
).map
= actualMapWorking%%
THEN _PUTIMAGE (Enemy
(i%
).x
, Enemy
(i%
).y
), EnemyImg&
(Enemy
(i%
).lvl
) '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateEnemyBaseDmg%
(lvl%
) ' INCOMPLETE calculateEnemyBaseDmg% = (lvl% + 1) * 5
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION calculateEnemyScore%
(lvl%
) ' UNDONE '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB loadEnemiesInitialVariables
() ' <---- I SHOULD RANDOM CREATE THEM AND THEIR ARRAY SHOULD ONLY BE FOR THE ONES ON actualMapWorking% , the rest should be on file .txt Enemy(3).map = 0
Enemy(3).x = 8 * 32
Enemy(3).y = 2 * 32 + 32
Enemy(3).lvl = 0
Enemy(3).life = 8
Enemy(1).map = 0
Enemy(1).x = 5 * 32
Enemy(1).y = 2 * 32 + 32
Enemy(1).lvl = 0
Enemy(1).life = 8
Enemy(2).map = 1
Enemy(2).x = 7 * 32
Enemy(2).y = 8 * 32 + 32
Enemy(2).lvl = 0
Enemy(2).life = 8
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CASE 0: nameAnEnemy$
= "rat" CASE 1: nameAnEnemy$
= "spiders" CASE 2: nameAnEnemy$
= "lizard" CASE 3: nameAnEnemy$
= "tarantula" CASE 4: nameAnEnemy$
= "frog" CASE 5: nameAnEnemy$
= "beatle" CASE 6: nameAnEnemy$
= "bug" CASE 7: nameAnEnemy$
= "dragon" CASE 8: nameAnEnemy$
= "living mushrooms" CASE 9: nameAnEnemy$
= "rabbit" CASE 10: nameAnEnemy$
= "small bat" CASE 11: nameAnEnemy$
= "big bat" CASE 12: nameAnEnemy$
= "snake" CASE 13: nameAnEnemy$
= "wolf" CASE 14: nameAnEnemy$
= "jabali" CASE 15: nameAnEnemy$
= "bear" CASE 16: nameAnEnemy$
= "stuffs" CASE 17: nameAnEnemy$
= "big stuff" CASE 18: nameAnEnemy$
= "scorpion" CASE 19: nameAnEnemy$
= "octopus" CASE 20: nameAnEnemy$
= "vampire" CASE 21: nameAnEnemy$
= "mummy" CASE 22: nameAnEnemy$
= "ghost" CASE 23: nameAnEnemy$
= "hidra" CASE 24: nameAnEnemy$
= "goblin" CASE 25: nameAnEnemy$
= "zombie" CASE 26: nameAnEnemy$
= "skeleton" CASE 27: nameAnEnemy$
= "orc" CASE 28: nameAnEnemy$
= "ciclope" CASE 29: nameAnEnemy$
= "baron of hell" CASE 30: nameAnEnemy$
= "stone golem" CASE 31: nameAnEnemy$
= "Lord of the Dark" '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB enemyAI
(enemyFromArray%
) '<------------- I must build the AI for enemies' cosider particular cases later
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IF Enemy
(indexFromArray%
).x
<> Hero.x
THEN IF Enemy
(i%
).x
> Hero.x
THEN Enemy
(i%
).x
= Enemy
(i%
).x
- 32 IF Enemy
(i%
).x
< Hero.x
THEN Enemy
(i%
).x
= Enemy
(i%
).x
+ 32
IF Enemy
(indexFromArray%
).y
<> Hero.y
THEN
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB drawMechs
() '°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Û WORLD & MECHS Û°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° _PUTIMAGE (Mechs
(0).x
, Mechs
(0).y
), UtileryImg&
(5) ' PROVISORY
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB drawWorld
() ' <- if i could came up with a random generator... geez
IF NOT _FILEEXISTS("tmpWorlds.txt") THEN ' if this file dosn't exists means that we started a new game. We must create the first map of the game, wich is a pre-arranged map of the Town CHDIR ".\.." ' we are @ Fantasy\data\ CHDIR ".\worlds" ' we are @ Fantasy\data\wolrds\ orgFile&
= FREEFILE ' we need two filehandles: one for origin file, destFile&
= FREEFILE ' and another for destination file OPEN "town.txt" FOR INPUT AS #orgFile&
' we will extract info from this file WHILE NOT EOF(orgFile&
) ' we make sure we read the full file INPUT #orgFile&
, tmp%%
' ¿ <---------------- DATA TRANSFER PRINT #destFile&
, tmp%%
' ¾ WEND ' done with that thing CLOSE #orgFile&
' ¿ <----------------------------- close files CHDIR ".\.." ' we are @ Fantasy\data\ NAME ".\worlds\tmp.txt" AS ".\tmp\tmpWorlds.txt" ' now we extract the file from worlds folder and put it on tmp folder with the right name CHDIR ".\tmp" ' we are @ Fantasy\data\tmp\
IF lastMapWorking%%
<> actualMapWorking%%
THEN ' if map has changed we need to actualize the WolrdTiles%% array OPEN "tmpWorlds.txt" FOR INPUT AS #tmpWorlds&
' we will extract data from this file INPUT #tmpWorlds&
, tmp%%
' we check the first number of the file WHILE tmp%%
<> actualMapWorking%%
' if it isn't the number of the level we need to know INPUT #tmpWorlds&
, tmp%%
' ³ <------------ walk over the info of this map (which is not what we need to know, but we skip that data) INPUT #tmpWorlds&
, tmp%%
' and get the next number for evaluate again (that should be the number of next map) WEND ' keep doing this untill the right map number has been found INPUT #tmpWorlds&
, tmp%%
' ³ <---------- then extract the data we need WorldTiles%%(i%, j%) = tmp%% '³ and load it into WorldTiles%% array !
CLOSE #tmpWorlds&
' close the file lastMapWorking%% = actualMapWorking%% ' and actualize map situation, so no need for reload until the map changes
_PUTIMAGE (i%
* 32, j%
* 32 + 32), WorldImg&
(WorldTiles%%
(i%
, j%
)) '³ actual drawing
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB loadMechsInitialVariables
() ' PROVISORY, load them from a CSV as maps later
Mechs(0).x = 128
Mechs(0).y = 128
Mechs(0).kind = 0
Mechs(0).map = 0
Mechs(0).state = 0
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB getMouseData
() ''°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Û PLAYER INPUTS Û°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
Finger.clickL = TRUE ' ³ DEBOUNCE
Finger.clickL = FALSE ' ³ CLICK
Finger.oldClickL = Finger.tmpClickL ' Ù
Finger.clickR = TRUE ' ³ DEBOUNCE
Finger.clickR = FALSE ' ³ CLICK
Finger.oldClickR = Finger.tmpClickR ' Ù
inHand.x = Finger.x
inHand.y = Finger.y
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
getMouseData
keyboardInputs
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB keyboardInputs
() ' <-------------------------------------------------------No more keyboard inputs of any kind? Think in playability
'hold CTRL for throw an attack (long distance) YOU NEED TO HAVE A THROW WEAPON ON Pocket(2)!!!! AND AMMO IN Pocket(4)!!!! else should draw the cross, and if i can display "No ammo"... great. Also have to check the case of BOMBS & THROWS
'hold SHIFT for launching same spell as before, if no spell "?" sign and HUDpromt, if no mana then cross and HUDpromt too
'hold ALT to force a movement over an item instead of picking..... or maybe for the Rest One TURN ?
'SPACEBAR could accelerate the action... maybe
'°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
'° what's the best way for motion? ° numpad? QWEASDZXC? some way with
'°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
'F1 for help
'F2 for new game
'F3 for save game
'F4 for load game
IF keyPress$
<> "" AND playerTurn`
= TRUE
THEN
menuMain` = FALSE ' ³
menuPocket` = FALSE ' ³ ESC key
menuStats` = FALSE ' ³
menuSpells` = FALSE ' ³
menuMain` = TRUE ' ³
IF menuPocket`
= FALSE
THEN ' ³ menuSpells` = FALSE ' ³
menuPocket` = TRUE ' ³
menuPocket` = FALSE ' ³
IF menuSpells`
= FALSE
THEN ' ³ menuPocket` = FALSE ' ³
menuSpells` = TRUE ' ³
menuSpells` = FALSE ' ³
IF menuStats`
= FALSE
THEN ' ³ menuStats` = TRUE ' ³
menuStats` = FALSE ' ³
IF Pocket
(i%
).kind
= 2 AND Pocket
(i%
).lvl
= 1 THEN '³ mapOnPocket% = TRUE ' ³
ELSE ' ³check if map is on inventory mapOnPocket% = FALSE ' ³
menuPocket` = FALSE ' ³
menuSpells` = FALSE ' ³ TAB for map
menuStats` = FALSE ' ³
menuMap` = TRUE ' ³
menuMap` = FALSE ' ³
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°Û GENERAL PROGRAM Û°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LINE (0, 0)-(639, 31), GREEN4
, BF
'background line/box ¿ LINE (0, 15)-(639, 15), GREEN1
' ³
_PUTIMAGE (8, 0), HUDImg&
(0) ' big heart image ¿ lifeAsPercent%
= CINT((Hero.life
* 100) / calculateMaxLife%
) ' ³ drawFourHeartAsPercentage 32, 3, lifeAsPercent% ' ³ HEALTH
LOCATE 1, 10 ' written values on screen ³
_PUTIMAGE (144, 0), HUDImg&
(1) ' big star image ¿ manaAsPercent%
= CINT((Hero.mana
* 100) / calculateMaxMana%
) ' ³ barShowingPercentage 160, 4, manaAsPercent% ' ³ MANA
_PUTIMAGE (280, 0), HUDImg&
(2) ' little flag image ¿ xpAsPercent%
= CINT(((Hero.xp
- Hero.prevNextXp
) * 100) / (Hero.nextXp
- Hero.prevNextXp
)) ' ³ barShowingPercentage 296, 4, xpAsPercent% ' ³ EXPERIENCE
IF inHand.lvl
= -1 AND playerTurn`
= TRUE
AND menuMain`
= FALSE
THEN ' no items in hand, and it has to be your turn. Also can't work if Main Menu open IF fingerIsOnSurface%
(440, 0, 48, 16) THEN ' HUDpromt$ = "Look at you inventory" '
menuSpells` = FALSE
menuPocket` = TRUE
IF Finger.clickL
THEN menuPocket`
= FALSE
IF fingerIsOnSurface%
(496, 0, 48, 16) THEN ' HUDpromt$ = "Select a spell to perform" '
menuPocket` = FALSE
menuSpells` = TRUE
IF Finger.clickL
THEN menuSpells`
= FALSE
IF fingerIsOnSurface%
(552, 0, 40, 16) THEN ' HUDpromt$ = "Character statistics" '
IF Finger.clickL
THEN menuStats`
= TRUE
IF Finger.clickL
THEN menuStats`
= FALSE
IF fingerIsOnSurface%
(600, 0, 32, 16) THEN ' HUDpromt$ = "Game main menu" '
IF Finger.clickL
THEN menuMain`
= TRUE
COLOR GREEN1
, GREEN4
' ³ not players turn or LOCATE 1, 56 ' ³ he's grabbing something, PRINT "POCKET SPELLS STATS MENU";
'³ decive him LINE (0, 15)-(639, 15), GREEN1
' divisory line between upper half and lower half of HUD
IF Hero.attributePoints
> 0 THEN lvlUpHUDButton
600, 17
COLOR GREEN1
, GREEN4
' leave normal printing color before leaving, so we don't conflictuate with other stuff
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB printHUDpromt
(whatDoIPrint$
) LOCATE 2, 1 ' promt line position COLOR GREEN1
, GREEN4
' always normal color for writing '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB lvlUpHUDButton
(x%
, y%
) _PUTIMAGE (x%
, y%
), LvlImg&
(0) ' draw Lvl image _PUTIMAGE (x%
+ 16, y%
), DirArrowImg&
(4) ' draw DirArrow upside IF fingerIsOnSurface%
(x%
, y%
, 32, 16) AND inHand.lvl
= -1 AND NOT menuMain`
THEN ' if the mouse is over this images, no items held on hand and not main menu open HUDpromt$ = "Increase your attributes" ' inform user
IF Finger.clickL
THEN menuStats`
= TRUE
' and if you click in it, then open the stats menu '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB showHistory
(momentOfHistory%
) 'dude, use your fantasy drawItemSlots 16, 24
_PUTIMAGE (16, 24), calculateHeroImg&
(Hero.class
, Hero.lvl
) PRINTslowly 2, 8, Hero.id + "'s history starts here:"
PRINTslowly 3, 8, "During the year 634 a.k. the crisis of the water increased and the"
PRINTslowly 4, 8, "habitants of Natrium were in the need to find new places to extract"
PRINTslowly 5, 2, "the precius liquid, and bring it to the city to overome the problem."
PRINTslowly 6, 2, "Our hero was one of these scouts, who reached a land called:"
PRINTslowly 8, 36, "FANTASYLAND"
PRINTslowly 10, 2, "a strange place indeed, poorly explored by the habitants of Natrium."
PRINTslowly 11, 2, "And something strange is happening there: after renting a room in the"
PRINTslowly 12, 2, "town central plaza, and in his first night trying to sleep there"
PRINTslowly 13, 2, Hero.id + " heard some very strange noises. And as a good scout"
PRINTslowly 14, 2, "he went to investigate..."
PRINTslowly 14, 20, "What he found was disturbing..."
' this history sucks XD
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB loadProgramInitialVariables
()
actualMapWorking%% = -1 ' with no map yet
lastMapWorking%% = actualMapWorking%% ' for drawMap check
menuMain` = TRUE ' program starts leading to the main menu
playerTurn` = TRUE ' Of course, the player starts
menuPocket` = FALSE '¿
menuSpells` = FALSE '³ <--------------- all menus at start must be closed
menuStats` = FALSE ' ¾
'initialize mouse variables
Finger.x = 319
Finger.y = 239
Finger.image = FingerImg&(0)
' EQUIPPED positions
Pocket(0).x = 542: Pocket(0).y = 136 ' head
Pocket(1).x = 582: Pocket(1).y = 147 ' neck
Pocket(2).x = 498: Pocket(2).y = 191 ' right hand
Pocket(3).x = 542: Pocket(3).y = 191 ' torso
Pocket(4).x = 586: Pocket(4).y = 191 ' right hand
Pocket(5).x = 514: Pocket(5).y = 244 ' right finger
Pocket(6).x = 569: Pocket(6).y = 244 ' left finger
' POCKET positions
x% = 332
y% = 136
Pocket(i%).x = x% + (i% - 7) * 36
Pocket(i%).y = y%
Pocket(i% + 4).x = x% + (i% - 7) * 36
Pocket(i% + 4).y = y% + 36
Pocket(i% + 8).x = x% + (i% - 7) * 36
Pocket(i% + 8).y = y% + 72
Pocket(i% + 12).x = x% + (i% - 7) * 36
Pocket(i% + 12).y = y% + 108
'let's also set some variables of the hand
inHand.x = Finger.x
inHand.y = Finger.y
cleanYourHand
Pocket(i%).map = -1 ' ³ during all game .map for
NEXT i%
' ³ pocket and inHand is always -1 inHand.map = -1 ' ¾
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB drawFourHeartAsPercentage
(x%
, y%
, percent%
) _PUTIMAGE (x%
+ 8, y%
), HeartImg&
(0) ' ³ health _PUTIMAGE (x%
+ 16, y%
), HeartImg&
(0) ' ³ 99 to 75 %
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB barShowingPercentage
(x%
, y%
, percent%
)
_PUTIMAGE (x%
+ 40, y%
), BarImg&
(6) ' closing bar '
_PUTIMAGE (x%
+ 32, y%
), BarImg&
(5) ' ³ 74 to 50 %
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB drawMenuBack
(strX%
, strY%
, endX%
, endY%
) LINE (strX%
, strY%
)-(endX%
, endY%
), GREEN4
, B
LINE (strX%
+ 1, strY%
+ 1)-(endX%
- 1, endY%
- 1), GREEN3
, B
LINE (strX%
+ 2, strY%
+ 2)-(endX%
- 2, endY%
- 2), GREEN2
, B
LINE (strX%
+ 3, strY%
+ 3)-(endX%
- 3, endY%
- 3), GREEN1
, B
LINE (strX%
+ 4, strY%
+ 4)-(endX%
- 4, endY%
- 4), GREEN2
, B
LINE (strX%
+ 5, strY%
+ 5)-(endX%
- 5, endY%
- 5), GREEN3
, B
LINE (strX%
+ 6, strY%
+ 6)-(endX%
- 6, endY%
- 6), GREEN4
, BF
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB drawItemSlots
(begX
, begY
) LINE (begX
, begY
)-(begX
+ 32, begY
+ 32), GREEN1
, B
LINE (begX
+ 1, begY
+ 1)-(begX
+ 31, begY
+ 31), GREEN2
, BF
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FUNCTION fingerIsOnSurface%
(begX%
, begY%
, imagePixelsX%
, imagePixelsY%
) IF ((Finger.x
>= begX%
AND Finger.x
<= begX%
+ (imagePixelsX%
- 1)) AND (Finger.y
>= begY%
AND Finger.y
<= begY%
+ (imagePixelsY%
- 1))) THEN fingerIsOnSurface% = TRUE
fingerIsOnSurface% = FALSE
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB PRINTslowly
(originY%
, originX%
, message$
) i% = 0 ' Ä¿
i% = i% + 1 ' ³ print message$
buildingMessage$
= LEFT$(message$
, i%
) + CHR$(219) ' ³ character by character LOCATE originY%
, originX%
' ³ and erease the cursor PRINT buildingMessage$;
' ³ '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
drawWorld
'drawPortals
drawItemsOnGround
'drawMechs
drawHero
drawEnemies
'drawFlyingObjectOrExplosion
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB TESTER
() ' <KILL ME AFTER TESTINGS> PRINT (Finger.y \
16) + 1;
",";
(Finger.x \
8) + 1 '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CHDIR ".\data" 'we are @ Fantasy\data\ 'if no more directories for check then check the images
CHDIR ".\images" 'we are @ Fantasy\data\images\ CHDIR ".\.." 'we are @ Fantasy\data\
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUB fatalError
(thingNotFound$
) PRINT "Fatal error: " + thingNotFound$
+ " not found" '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'we are @ Fantasy\data\images\
EnemyImg&
(i%
) = _NEWIMAGE(32, 32, 32):
_PUTIMAGE (0, 0), tmpImg&
, EnemyImg&
(i%
), (i%
* 32, 0)-(i%
* 32 + 31, 31) EnemyImg&
(i%
+ 8) = _NEWIMAGE(32, 32, 32):
_PUTIMAGE (0, 0), tmpImg&
, EnemyImg&
(i%
+ 8), (i%
* 32, 32)-(i%
* 32 + 31, 63) EnemyImg&
(i%
+ 16) = _NEWIMAGE(32, 32, 32):
_PUTIMAGE (0, 0), tmpImg&
, EnemyImg&
(i%
+ 16), (i%
* 32, 64)-(i%
* 32 + 31, 95) EnemyImg&
(i%
+ 24) = _NEWIMAGE(32, 32, 32):
_PUTIMAGE (0, 0), tmpImg&
, EnemyImg&
(i%
+ 24), (i%
* 32, 96)-(i%
* 32 + 31, 127) WorldImg&
(i%
) = _NEWIMAGE(32, 32, 32):
_PUTIMAGE (0, 0), tmpImg&
, WorldImg&
(i%
), (i%
* 32, 0)-(i%
* 32 + 31, 31) WorldImg&
(i%
+ 8) = _NEWIMAGE(32, 32, 32):
_PUTIMAGE (0, 0), tmpImg&
, WorldImg&
(i%
+ 8), (i%
* 32, 32)-(i%
* 32 + 31, 63) WorldImg&
(i%
+ 16) = _NEWIMAGE(32, 32, 32):
_PUTIMAGE (0, 0), tmpImg&
, WorldImg&
(i%
+ 16), (i%
* 32, 64)-(i%
* 32 + 31, 95) CHDIR ".\.." ' back to data 'we are @ Fantasy\data\
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -