- [FIX] Nomes l'heroi pot fer que els blocs que desapareixen desapareguen

- [NEW] Flag en l'editor de habitació completada, per a no tornar-me loco
- Més habitacions
This commit is contained in:
2024-10-01 10:44:58 +02:00
parent 093cd5916b
commit 231a81a9e5
54 changed files with 213 additions and 19 deletions

View File

@@ -7,6 +7,7 @@ wall-texture: 2
door-texture: 0
under-door-texture: 0
exit-xp: 1
editor-done: 1
actor{
name: BOX-01

View File

@@ -11,6 +11,7 @@ under-door-texture: 0
exit-xp: 2
exit-xn: 0
exit-yp: 6
editor-done: 1
actor{
name: CUADRO-01

View File

@@ -9,6 +9,7 @@ door-texture: 0
under-door-texture: 0
exit-xn: 1
exit-yn: 3
editor-done: 1
actor{
name: ARMARI-A1

View File

@@ -9,6 +9,7 @@ door-texture: 0
under-door-texture: 0
exit-xn: 4
exit-yp: 2
editor-done: 1
actor{
name: ARMARI-01

View File

@@ -9,6 +9,7 @@ door-texture: 6
under-door-texture: 6
exit-xp: 3
exit-xn: 5
editor-done: 1
actor{
name: BOX

View File

@@ -7,6 +7,7 @@ wall-texture: 0
door-texture: 0
under-door-texture: 0
exit-xp: 4
editor-done: 1
actor{
name: FINESTRA-01

View File

@@ -9,6 +9,7 @@ door-texture: 0
under-door-texture: 2
exit-xp: 7
exit-yn: 1
editor-done: 1
actor{
name: BOX-01

View File

@@ -9,6 +9,7 @@ door-texture: 0
under-door-texture: 2
exit-xn: 6
exit-yp: 8
editor-done: 1
actor{
name: GAT-BATMAN

View File

@@ -9,6 +9,7 @@ door-texture: 0
under-door-texture: 0
exit-yp: 9
exit-yn: 7
editor-done: 1
actor{
name: ESCALO-001

View File

@@ -13,6 +13,7 @@ exit-xp: 12
exit-xn: 10
exit-yp: 17
exit-yn: 8
editor-done: 1
actor{
name: BUBBLE-00

View File

@@ -9,6 +9,7 @@ door-texture: 2
under-door-texture: 0
exit-xp: 9
exit-yn: 11
editor-done: 1
actor{
name: BANCADA-01

View File

@@ -7,6 +7,7 @@ wall-texture: 3
door-texture: 1
under-door-texture: 0
exit-yp: 10
editor-done: 1
actor{
name: FINESTRA-00

View File

@@ -11,6 +11,7 @@ under-door-texture: 3
exit-xp: 13
exit-xn: 9
exit-yn: 15
editor-done: 1
actor{
name: ABAD
@@ -26,6 +27,17 @@ actor{
movement: X
}
actor{
name: ANBERNIC
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 56 16 0
size: 6 4 2
flags: PUSHABLE GRAVITY
movement: CW
}
actor{
name: BATMAN
bmp: batman.gif

View File

@@ -10,6 +10,7 @@ under-door-texture: 0
exit-xn: 12
exit-yn: 14
exit-zn: 18
editor-done: 1
actor{
name: LIFT

View File

@@ -9,6 +9,7 @@ door-texture: 0
under-door-texture: 0
exit-xn: 15
exit-yp: 13
editor-done: 1
actor{
name: BLOCK-00

View File

@@ -11,6 +11,7 @@ under-door-texture: 3
exit-xp: 14
exit-yp: 12
exit-yn: 16
editor-done: 1
actor{
name: PILOTA

View File

@@ -7,6 +7,7 @@ wall-texture: 1
door-texture: 2
under-door-texture: 0
exit-yp: 15
editor-done: 1
actor{
name: BOX-A-00

View File

@@ -9,6 +9,7 @@ door-texture: 0
under-door-texture: 0
exit-xn: 27
exit-yn: 9
editor-done: 1
actor{
name: FINESTRA-00

View File

@@ -10,6 +10,7 @@ under-door-texture: 0
exit-xn: 21
exit-yn: 19
exit-zp: 13
editor-done: 1
actor{
name: BOX-A

View File

@@ -9,6 +9,7 @@ door-texture: 7
under-door-texture: 0
exit-yp: 18
exit-yn: 20
editor-done: 1
actor{
name: BUBBLE-00

View File

@@ -7,6 +7,7 @@ wall-texture: 6
door-texture: 6
under-door-texture: 0
exit-yp: 19
editor-done: 1
actor{
name: CONV-XP-01

View File

@@ -12,6 +12,7 @@ exit-xp: 18
exit-xn: 22
exit-yp: 24
exit-zn: 25
editor-done: 1
actor{
name: PLATH-00

View File

@@ -9,6 +9,7 @@ door-texture: 7
under-door-texture: 13
exit-xp: 21
exit-yp: 23
editor-done: 1
actor{
name: PLATF-00

View File

@@ -7,6 +7,7 @@ wall-texture: 13
door-texture: 7
under-door-texture: 0
exit-yn: 22
editor-done: 1
actor{
name: ABAD

View File

@@ -8,6 +8,7 @@ door-texture: 7
under-door-texture: 13
exit-xn: 24
exit-zp: 21
editor-done: 1
actor{
name: ANBERNIC

View File

@@ -9,6 +9,7 @@ door-texture: 3
under-door-texture: 9
exit-xp: 17
exit-xn: 28
editor-done: 1
actor{
name: BOX-B

View File

@@ -11,6 +11,7 @@ under-door-texture: 3
exit-xp: 27
exit-yp: 35
exit-yn: 29
editor-done: 1
actor{
name: BLOCMATA-00

View File

@@ -11,3 +11,4 @@ under-door-texture: 0
exit-xn: 31
exit-yp: 28
exit-yn: 30
editor-done: 1

View File

@@ -7,6 +7,7 @@ wall-texture: 0
door-texture: 0
under-door-texture: 0
exit-yp: 29
editor-done: 1
actor{
name: PLATF-02

View File

@@ -9,6 +9,7 @@ door-texture: 3
under-door-texture: 2
exit-xp: 29
exit-yp: 32
editor-done: 1
actor{
name: BOX-A

View File

@@ -9,6 +9,7 @@ door-texture: 1
under-door-texture: 3
exit-yp: 33
exit-yn: 31
editor-done: 1
actor{
name: BOX-C

View File

@@ -11,6 +11,7 @@ under-door-texture: 0
exit-xp: 35
exit-yp: 34
exit-yn: 32
editor-done: 1
actor{
name: ANBERNIC

View File

@@ -9,6 +9,18 @@ door-texture: 6
under-door-texture: 0
exit-yp: 36
exit-yn: 33
editor-done: 1
actor{
name: ANBERNIC
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 40 16 0
size: 6 4 2
flags: PUSHABLE GRAVITY
movement: CW
}
actor{
name: ARBUST

View File

@@ -9,6 +9,7 @@ door-texture: 3
under-door-texture: 9
exit-xn: 33
exit-yn: 28
editor-done: 1
actor{
name: PLATH-00

View File

@@ -9,6 +9,7 @@ door-texture: 4
under-door-texture: 0
exit-xp: 37
exit-yn: 34
editor-done: 1
actor{
name: GAT-ROBIN

View File

@@ -11,6 +11,7 @@ under-door-texture: 0
exit-xn: 36
exit-yp: 38
exit-yn: 39
editor-done: 1
actor{
name: COFFEE-00

View File

@@ -7,6 +7,7 @@ wall-texture: 5
door-texture: 4
under-door-texture: 0
exit-yn: 37
editor-done: 1
actor{
name: BOX-A

View File

@@ -9,6 +9,7 @@ door-texture: 4
under-door-texture: 0
exit-xp: 40
exit-yp: 37
editor-done: 1
actor{
name: ANBERNIC

View File

@@ -11,6 +11,7 @@ under-door-texture: 0
exit-xn: 39
exit-yp: 44
exit-yn: 41
editor-done: 1
actor{
name: PLATH-00

View File

@@ -9,6 +9,7 @@ door-texture: 5
under-door-texture: 0
exit-xp: 42
exit-yp: 40
editor-done: 1
actor{
name: PLATH-00

View File

@@ -9,6 +9,7 @@ door-texture: 4
under-door-texture: 0
exit-xn: 41
exit-yp: 43
editor-done: 1
actor{
name: ARBUST-00

View File

@@ -8,6 +8,7 @@ door-texture: 8
under-door-texture: 0
exit-yn: 42
exit-zn: 47
editor-done: 1
actor{
name: ABAD

View File

@@ -10,6 +10,7 @@ under-door-texture: 0
exit-xp: 45
exit-yn: 40
exit-zn: 46
editor-done: 1
actor{
name: BOX-A

View File

@@ -7,6 +7,7 @@ wall-texture: 13
door-texture: 5
under-door-texture: 13
exit-xn: 44
editor-done: 1
actor{
name: BARANA-00

View File

@@ -13,6 +13,7 @@ exit-yp: 49
exit-yn: 48
exit-zp: 43
exit-zn: 51
editor-done: 1
actor{
name: BATMAN

View File

@@ -1,11 +1,40 @@
width: 2
height: 2
width: 0
height: 3
door-height-xn: 0
door-height-yn: 0
color: CYAN
floor-texture: 0
wall-texture: 0
door-texture: 0
under-door-texture: 0
color: YELLOW
floor-texture: 1
wall-texture: 8
door-texture: 5
under-door-texture: 4
exit-xn: 58
exit-yn: 56
editor-done: 1
actor{
name: ABAD
bmp: abad.gif
bmp-rect: 0 0 20 33
bmp-offset: -6 38
pos: 32 56 0
size: 8 8 8
orient: YP
anim-wait: 1
flags: REACTIVE MOVING ANIMATED ORIENTABLE DEADLY
react-mask: XP XN YP YN ZP ZN
movement: CCW
}
actor{
name: BATMAN
bmp: batman.gif
bmp-rect: 0 0 21 32
bmp-offset: -5 35
pos: 24 16 0
size: 8 8 8
orient: YN
anim-wait: 1
flags: REACTIVE MOVING ANIMATED ORIENTABLE DEADLY
react-mask: XP XN YP YN ZP ZN
movement: CCW
}

View File

@@ -1,11 +1,80 @@
width: 2
width: 3
height: 2
door-height-xp: 0
door-height-xn: 0
color: CYAN
floor-texture: 0
wall-texture: 0
door-texture: 0
under-door-texture: 0
door-height-xp: 4
door-height-xn: 4
color: PURPLE
floor-texture: 11
wall-texture: 8
door-texture: 5
under-door-texture: 8
exit-xp: 57
exit-xn: 59
editor-done: 1
actor{
name: PLATH-00
bmp: caixes.gif
bmp-rect: 160 128 32 32
bmp-offset: 0 32
pos: 56 32 12
size: 8 8 4
orient: ZP
movement: Z
}
actor{
name: PLATH-01
bmp: caixes.gif
bmp-rect: 160 128 32 32
bmp-offset: 0 32
pos: 56 24 12
size: 8 8 4
orient: ZP
movement: Z
}
actor{
name: PLATH-02
bmp: caixes.gif
bmp-rect: 160 128 32 32
bmp-offset: 0 32
pos: 0 24 12
size: 8 8 4
orient: ZP
movement: Z
}
actor{
name: PLATH-03
bmp: caixes.gif
bmp-rect: 160 128 32 32
bmp-offset: 0 32
pos: 0 32 12
size: 8 8 4
orient: ZP
movement: Z
}
actor{
name: PLATH-04
bmp: caixes.gif
bmp-rect: 160 128 32 32
bmp-offset: 0 32
pos: 16 28 12
size: 8 8 4
orient: ZP
flags: DISAPPEAR
movement: Z
}
actor{
name: PLATH-05
bmp: caixes.gif
bmp-rect: 160 128 32 32
bmp-offset: 0 32
pos: 32 27 12
size: 8 8 4
orient: ZP
flags: DISAPPEAR
movement: Z
}

View File

@@ -13,6 +13,7 @@ exit-xp: 58
exit-xn: 61
exit-yp: 60
exit-yn: 62
editor-done: 1
actor{
name: BLOCMATA-00

View File

@@ -569,7 +569,7 @@ category{
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 24 40 8
pos: 24 40 0
size: 6 4 2
flags: PUSHABLE GRAVITY
movement: CW

View File

@@ -527,7 +527,7 @@ namespace actor
else
result = act->react_push;
}
if (act->flags & FLAG_DISAPPEAR)
if ( (source->flags & FLAG_HERO) && (act->flags & FLAG_DISAPPEAR) )
{
act = actor::replaceWithTemplate(act, "EXPLOSION");
act->name[0]='_';

View File

@@ -23,6 +23,7 @@ namespace modules
uint8_t color;
uint8_t exits[6];
uint32_t specials;
uint8_t editor_done;
};
miniroom_t minirooms[64];
@@ -55,7 +56,7 @@ namespace modules
if ( (x>=-32) && (x<520) && (y>=-16) && (y<240) )
{
draw::stencil::set(room);
draw::swapcol(1, !shadow ? minirooms[room].color : 2);
draw::swapcol(1, !shadow ? minirooms[room].color : minirooms[room].editor_done==1 ? 2 : RED);
draw::draw(x-16, y-8, 32, 16, minirooms[room].w*32, minirooms[room].h*16);
if (!shadow)
@@ -86,6 +87,7 @@ namespace modules
minirooms[room].w = (room::getSize().x >> 1)-1;
minirooms[room].h = (room::getSize().y >> 1)-1;
minirooms[room].specials = 0;
minirooms[room].editor_done = room::editor::refEditorDone();
// Recolectem els especials de l'habitació per a mostrar-los
actor::actor_t *act = actor::getFirst();

View File

@@ -458,6 +458,15 @@ namespace modules
// ...i l'habitació actual
draw::print2(room::getCurrent(), -2, 4, 3, WHITE, FONT_ZOOM_BOTH);
// ...i la marca de habitació completada
draw::color(WHITE);
draw::rect(250, 24, 20, 20);
if (room::editor::refEditorDone())
{
draw::color(RED);
draw::fillrect(252, 26, 16, 16);
}
// ...i fent click en els numerets de les eixides anem a l'habitació corresponent
// Es més. Si no hi ha habitació enllaçada en una eixida i li fem ctrl+click, se crea una nova habitació per eixa eixida
if (input::mouseClk(1)) {
@@ -489,6 +498,12 @@ namespace modules
int room = room::editor::refExit(ZN);
if (room>=0 || input::keyDown(SDL_SCANCODE_LCTRL)) room::load(room, ZP);
}
if (mx>=250 && mx<270 && my>=24 && my<44) {
room::editor::refEditorDone() = room::editor::refEditorDone() ? 0 : 1;
room::editor::modify(); room::update();
}
}
}

View File

@@ -30,6 +30,8 @@ namespace room
static int doors_type = 0; // Textura per a les portes
static int walldoors_type = 0; // Textura per a baix de les portes
static int editor_done = 0; // Nomes per al editor, per a marcar les habitacions completades i no tornarme loco
static bool modified = false;
// Surface on se guarden els gràfics de cada cosa
@@ -175,7 +177,7 @@ namespace room
for (int i=0;i<4;++i) door_height[i] = -1;
color = original_color = 2;
num_color_cycles = 0;
floor_type = walls_type = doors_type = walldoors_type = 0;
floor_type = walls_type = doors_type = walldoors_type = editor_done = 0;
for (int i=0;i<6;++i) exits[i] = -1;
// Després intentem carregar els valors segons el arxiu que toca, si existeix
@@ -242,6 +244,9 @@ namespace room
} else if (util::strcomp(key, "exit-zn:")) {
const int val = file::readInt(&buffer);
exits[5] = SDL_clamp(val, 0, 64);
} else if (util::strcomp(key, "editor-done:")) {
const int val = file::readInt(&buffer);
editor_done = SDL_clamp(val, 0, 1);
} else if (util::strcomp(key, "actor{")) {
actor::actor_t *act = actor::createFromFile(&buffer);
@@ -579,6 +584,8 @@ namespace room
int &refExit(const int which) { return exits[which]; }
int &refEditorDone() { return editor_done; }
bool roomExists(const int which) { return room_exists[which]; }
void updateRoomList()
@@ -636,6 +643,8 @@ namespace room
if (exits[ZP]!=-1) fprintf(f, "exit-zp: %i\n", exits[ZP]);
if (exits[ZN]!=-1) fprintf(f, "exit-zn: %i\n", exits[ZN]);
if (editor_done!=0) fprintf(f, "editor-done: %i\n", editor_done);
actor::actor_t *act = actor::alphaOrder(actor::getFirst());
while (act)
{

View File

@@ -59,6 +59,8 @@ namespace room
int &refExit(const int which);
int &refEditorDone();
bool roomExists(const int which);
void updateRoomList();