spellKnowledge is an array of booleans instead of a product of primes; scrolling through spell list handles empty slots in spellKnowledge
This commit is contained in:
parent
a2a4722f33
commit
5089841175
3 changed files with 14 additions and 4 deletions
14
Engine.c
14
Engine.c
|
@ -122,12 +122,22 @@ void interact()
|
||||||
case L_BUTTON:
|
case L_BUTTON:
|
||||||
bookMark--;
|
bookMark--;
|
||||||
if (bookMark == -1)
|
if (bookMark == -1)
|
||||||
bookMark = 1;
|
bookMark = 9;
|
||||||
|
while (!spellKnowledge[bookMark])
|
||||||
|
{
|
||||||
|
bookMark--;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case R_BUTTON:
|
case R_BUTTON:
|
||||||
bookMark++;
|
bookMark++;
|
||||||
if (bookMark == 2)
|
if (bookMark == 10)
|
||||||
bookMark = 0;
|
bookMark = 0;
|
||||||
|
while (!spellKnowledge[bookMark])
|
||||||
|
{
|
||||||
|
bookMark++;
|
||||||
|
if (bookMark == 10)
|
||||||
|
bookMark = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case PAUSE_BUTTON:
|
case PAUSE_BUTTON:
|
||||||
pausemenu();
|
pausemenu();
|
||||||
|
|
2
extern.h
2
extern.h
|
@ -18,7 +18,7 @@ extern int kaosFlag;
|
||||||
extern int spellFlag;
|
extern int spellFlag;
|
||||||
|
|
||||||
extern long long int savestate;
|
extern long long int savestate;
|
||||||
extern int spellKnowledge;
|
extern int spellKnowledge[10];
|
||||||
extern int bookMark;
|
extern int bookMark;
|
||||||
|
|
||||||
extern Room* menuBG;
|
extern Room* menuBG;
|
||||||
|
|
2
main.c
2
main.c
|
@ -50,7 +50,7 @@ Room* menuBG = NULL;
|
||||||
Mix_Music* menuBGM = NULL;
|
Mix_Music* menuBGM = NULL;
|
||||||
|
|
||||||
long long int savestate = 2;
|
long long int savestate = 2;
|
||||||
int spellKnowledge = 2;
|
int spellKnowledge[10] = {1,1,0,0,0,0,0,0,0,0};
|
||||||
int bookMark = 0;
|
int bookMark = 0;
|
||||||
|
|
||||||
Room** mapData = NULL;
|
Room** mapData = NULL;
|
||||||
|
|
Loading…
Reference in a new issue