- [NEW] Módul "info"retocat

This commit is contained in:
2025-07-02 17:15:49 +02:00
parent d7c965ff0b
commit 83cf446c37
17 changed files with 134 additions and 136 deletions

View File

@@ -8,8 +8,7 @@
#include <stdlib.h>
#include <string>
ModuleSequence::ModuleSequence( Info* info ) {
this->info = info;
ModuleSequence::ModuleSequence() {
}
ModuleSequence::~ModuleSequence(void) {
@@ -17,9 +16,9 @@ ModuleSequence::~ModuleSequence(void) {
int ModuleSequence::Go() {
if( this->info->num_piramide == 6 && this->info->diners < 200 ) this->info->num_piramide = 7;
if( info::num_piramide == 6 && info::diners < 200 ) info::num_piramide = 7;
switch( this->info->num_piramide ) {
switch( info::num_piramide ) {
case 255: // Intro
doIntro();
break;
@@ -52,22 +51,22 @@ int ModuleSequence::Go() {
if( JG_Quitting() ) {
return -1;
} else {
if( this->info->num_piramide == 255 ) {
this->info->num_piramide = 0;
if( info::num_piramide == 255 ) {
info::num_piramide = 0;
return 1;
} else if( this->info->num_piramide == 0 ) {
this->info->num_piramide = 1;
//this->info->num_piramide = 6;
//this->info->diners = 200;
} else if( info::num_piramide == 0 ) {
info::num_piramide = 1;
//info::num_piramide = 6;
//info::diners = 200;
return 1;
} else if( this->info->num_piramide == 7 ) {
this->info->num_piramide = 8;
} else if( info::num_piramide == 7 ) {
info::num_piramide = 8;
return 1;
} else if( this->info->num_piramide == 8 ) {
this->info->num_piramide = 255;
} else if( info::num_piramide == 8 ) {
info::num_piramide = 255;
return 1;
} else if( this->info->num_piramide == 100 ) {
this->info->num_piramide = 0;
} else if( info::num_piramide == 100 ) {
info::num_piramide = 0;
return 1;
} else {
return 0;
@@ -620,7 +619,7 @@ void ModuleSequence::doMenu() {
JD8_BlitCK( 303, 193, gfx, 305, 143, 15, 5, 255 ); // versio
if( contador%100 > 30 ) JD8_BlitCK( 98, 130, gfx, 161, 92, 127, 9, 255 ); // pulsa tecla...
if ((contador % 100 > 30) && this->info->nou_personatge) JD8_BlitCK(68, 141, gfx, 128, 105, 189, 9, 255); // 'p' per a personatge nou...
if ((contador % 100 > 30) && info::nou_personatge) JD8_BlitCK(68, 141, gfx, 128, 105, 189, 9, 255); // 'p' per a personatge nou...
JD8_Flip();
@@ -632,7 +631,7 @@ void ModuleSequence::doMenu() {
JI_Update();
}
}
this->info->pepe_activat = JI_KeyPressed(SDL_SCANCODE_P);
info::pepe_activat = JI_KeyPressed(SDL_SCANCODE_P);
JI_DisableKeyboard(60);
JD8_FreeSurface( fondo );
JD8_FreeSurface( gfx );
@@ -644,9 +643,9 @@ void ModuleSequence::doSlides() {
const char* arxiu;
if( this->info->num_piramide == 7 ) {
if( info::num_piramide == 7 ) {
play_music("00000005.ogg", 1);
if (this->info->diners < 200) {
if (info::diners < 200) {
arxiu = "intro2.gif";
} else {
arxiu = "intro3.gif";
@@ -706,7 +705,7 @@ void ModuleSequence::doSlides() {
step++;
break;
case 8:
if (this->info->num_piramide != 7) JA_FadeOutMusic(250);
if (info::num_piramide != 7) JA_FadeOutMusic(250);
exit = true;
break;
}
@@ -730,7 +729,7 @@ void ModuleSequence::doBanner() {
JD8_Blit( 81, 24, gfx, 81, 155, 168, 21 );
JD8_Blit( 39, 150, gfx, 39, 175, 248, 20 );
switch( this->info->num_piramide ) {
switch( info::num_piramide ) {
case 2:
JD8_Blit( 82, 60, gfx, 0, 0, 160, 75 );
break;
@@ -885,7 +884,7 @@ void ModuleSequence::doCredits() {
JD8_BlitCK(100, 20, vaddr2, 85, 0, 120, 140, 0);
}
if (this->info->diamants == 16) {
if (info::diamants == 16) {
//scroll_final_joc(vaddr3, vaddr, contador_final);
JD8_BlitCKScroll(50, vaddr3, ((contador >> 3) % 320) + 1, 0, 50, 255);
JD8_BlitCKScroll(50, vaddr3, ((contador >> 2) % 320) + 1, 50, 50, 255);
@@ -909,7 +908,7 @@ void ModuleSequence::doCredits() {
FILE* ini = fopen("trick.ini", "wb");
fwrite("1", 1, 1, ini);
fclose(ini);
this->info->nou_personatge = true;
info::nou_personatge = true;
JD8_FreeSurface(vaddr3);
JD8_FreeSurface(vaddr2);
@@ -920,7 +919,7 @@ void ModuleSequence::doMort() {
JI_DisableKeyboard(60);
this->info->vida = 5;
info::vida = 5;
this->contador = 1000;
JD8_Surface gfx = JD8_LoadSurface( "gameover.gif" );