- [NEW] Módul "info"retocat
This commit is contained in:
29
mapa.cpp
29
mapa.cpp
@@ -4,10 +4,9 @@
|
||||
#include "jinput.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
Mapa::Mapa( JD8_Surface gfx, Info* info, Prota* sam ) {
|
||||
Mapa::Mapa( JD8_Surface gfx, Prota* sam ) {
|
||||
|
||||
this->gfx = gfx;
|
||||
this->info = info;
|
||||
this->sam = sam;
|
||||
|
||||
this->preparaFondoEstatic();
|
||||
@@ -31,7 +30,7 @@ Mapa::~Mapa(void) {
|
||||
|
||||
void Mapa::draw() {
|
||||
|
||||
if( this->info->num_piramide != 4 ) {
|
||||
if( info::num_piramide != 4 ) {
|
||||
switch( sam->o ) {
|
||||
case 0: // Down
|
||||
JD8_BlitCKToSurface( sam->x, sam->y, this->gfx, 15, 125 + sam->frame_pejades, 15, 1, this->fondo, 255 );
|
||||
@@ -97,7 +96,7 @@ void Mapa::preparaFondoEstatic() {
|
||||
|
||||
// Prepara el fondo est<73>tic de l'habitaci<63>
|
||||
this->fondo = JD8_NewSurface();
|
||||
if (info->num_piramide == 6) {
|
||||
if (info::num_piramide == 6) {
|
||||
JD8_BlitToSurface(9, 2, this->gfx, 227, 185, 92, 7, this->fondo); // Text "SECRETA"
|
||||
}
|
||||
else {
|
||||
@@ -106,12 +105,12 @@ void Mapa::preparaFondoEstatic() {
|
||||
}
|
||||
JD8_BlitToSurface(130, 2, this->gfx, 225, 192, 19, 8, this->fondo); // Montonet de monedes + signe '='
|
||||
JD8_BlitToSurface(220, 2, this->gfx, 160, 185, 48, 7, this->fondo); // Text "ENERGIA"
|
||||
if (this->info->diners >= 200) JD8_BlitToSurface(175, 3, this->gfx, 60, 193, 7, 6, this->fondo);
|
||||
if (info::diners >= 200) JD8_BlitToSurface(175, 3, this->gfx, 60, 193, 7, 6, this->fondo);
|
||||
|
||||
// Pinta taulells
|
||||
for( int y = 0; y < 11; y++ ) {
|
||||
for( int x = 0; x < 19; x++ ) {
|
||||
switch( info->num_piramide ) {
|
||||
switch( info::num_piramide ) {
|
||||
case 1:
|
||||
JD8_BlitToSurface( 20+(x*15), 30+(y*15), this->gfx, 0, 80, 15, 15, this->fondo );
|
||||
break;
|
||||
@@ -156,7 +155,7 @@ void Mapa::preparaFondoEstatic() {
|
||||
// Pinta la porta
|
||||
JD8_BlitCKToSurface( 150, 18, this->gfx, 0, 143, 15, 12, this->fondo, 255 );
|
||||
|
||||
if( info->num_piramide == 2 ) {
|
||||
if( info::num_piramide == 2 ) {
|
||||
JD8_BlitToSurface( 5, 100, this->gfx, 30, 140, 15, 15, this->fondo );
|
||||
}
|
||||
}
|
||||
@@ -168,9 +167,9 @@ void swap( Uint8& a, Uint8& b ) {
|
||||
}
|
||||
|
||||
void Mapa::preparaTombes() {
|
||||
const Uint8 contingut = this->info->num_piramide == 6 ? CONTE_DIAMANT : CONTE_RES;
|
||||
int cx = this->info->num_piramide == 6 ? 270 : 0;
|
||||
int cy = this->info->num_piramide == 6 ? 50 : 0;
|
||||
const Uint8 contingut = info::num_piramide == 6 ? CONTE_DIAMANT : CONTE_RES;
|
||||
int cx = info::num_piramide == 6 ? 270 : 0;
|
||||
int cy = info::num_piramide == 6 ? 50 : 0;
|
||||
|
||||
for( int i = 0; i < 16; i++ ) {
|
||||
this->tombes[i].contingut = contingut;
|
||||
@@ -182,7 +181,7 @@ void Mapa::preparaTombes() {
|
||||
this->tombes[i].x = cx;
|
||||
this->tombes[i].y = cy;
|
||||
}
|
||||
if (this->info->num_piramide == 6) return;
|
||||
if (info::num_piramide == 6) return;
|
||||
this->tombes[0].contingut = CONTE_FARAO;
|
||||
this->tombes[1].contingut = CONTE_CLAU;
|
||||
this->tombes[2].contingut = CONTE_PERGAMI;
|
||||
@@ -254,7 +253,7 @@ void Mapa::comprovaCaixa( Uint8 num )
|
||||
break;
|
||||
case CONTE_TRESOR:
|
||||
this->tombes[num].x = 100;
|
||||
info->diners++;
|
||||
info::diners++;
|
||||
break;
|
||||
case CONTE_FARAO:
|
||||
this->tombes[num].x = 150;
|
||||
@@ -274,9 +273,9 @@ void Mapa::comprovaCaixa( Uint8 num )
|
||||
break;
|
||||
case CONTE_DIAMANT:
|
||||
this->tombes[num].y = 70;
|
||||
info->diamants++;
|
||||
info->diners += VALOR_DIAMANT;
|
||||
if (info->diamants == 16) this->farao = this->clau = true;
|
||||
info::diamants++;
|
||||
info::diners += VALOR_DIAMANT;
|
||||
if (info::diamants == 16) this->farao = this->clau = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user