- [FIX] No es podia entrar al editor de bitmap_pos des de l'editor

- [FIX] Recreativa afegida
- [NEW] Prologo acabat
- [FIX] Quan s'acava el boost de invulnerabilitat se moria
This commit is contained in:
2024-10-10 09:33:56 +02:00
parent cabbb52cbb
commit ec7ac7114e
18 changed files with 187 additions and 7 deletions

View File

@@ -24,6 +24,8 @@ obrer.gif
piscina.gif
prologo1.gif
prologo2.gif
prologo3.gif
prologo4.gif
roomaux.gif
sam.gif
test.gif

BIN
data/prologo3.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
data/prologo4.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -37,6 +37,17 @@ actor{
movement: CW
}
actor{
name: ARCADE
bmp: altres.gif
bmp-rect: 160 0 30 48
bmp-offset: 0 49
pos: 56 8 0
size: 8 8 16
orient: YP
movement: CW
}
actor{
name: BATMAN
bmp: batman.gif
@@ -67,7 +78,7 @@ actor{
bmp: altres.gif
bmp-rect: 128 0 20 41
bmp-offset: -6 45
pos: 56 8 0
pos: 16 8 0
size: 6 6 16
movement: CW
}

View File

@@ -11,6 +11,19 @@ exit-xp: 17
exit-xn: 28
editor-done: 1
actor{
name: B-03-GOD
bmp: objectes.gif
bmp-rect: 114 78 15 18
bmp-offset: -8 22
pos: 48 -3 16
size: 4 4 4
anim-cycle: SEQ
anim-wait: 2
flags: ANIMATED SPECIAL
movement: CW
}
actor{
name: BOX-B
bmp: caixes.gif

View File

@@ -21,6 +21,18 @@ actor{
movement: CW
}
actor{
name: ARCADE
bmp: altres.gif
bmp-rect: 160 0 30 48
bmp-offset: 0 49
pos: 8 24 0
size: 8 8 16
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: CADIRA
bmp: caixes.gif

View File

@@ -25,6 +25,19 @@ actor{
movement: CCW
}
actor{
name: B-02-RUN
bmp: objectes.gif
bmp-rect: 114 78 15 18
bmp-offset: -8 22
pos: 24 56 0
size: 4 4 4
anim-cycle: SEQ
anim-wait: 2
flags: ANIMATED SPECIAL
movement: CW
}
actor{
name: BATMAN
bmp: batman.gif

View File

@@ -1,7 +1,7 @@
width: 2
height: 3
door-height-xn: 3
door-height-yp: 2
door-height-yp: 3
color: WHITE
floor-texture: 11
wall-texture: 2

View File

@@ -273,6 +273,18 @@ category{
movement: CCW
}
actor{
name: ARCADE
bmp: altres.gif
bmp-rect: 160 0 30 48
bmp-offset: 0 49
pos: 0 16 0
size: 8 8 16
orient: YP
flags: ORIENTABLE
movement: CW
}
}
category{

View File

@@ -1062,7 +1062,7 @@ namespace actor
vec3_t min = room::getMin();
vec3_t max = room::getMax();
if ((act->push & PUSH_KILL) && (act->flags & FLAG_HERO))
if ((act->push & PUSH_KILL) && (act->flags & FLAG_HERO) && (!hero::hasBoostGod()))
{
if (!editor::isDevMode())
{
@@ -1091,6 +1091,8 @@ namespace actor
return;
}
if ((act->flags & FLAG_HERO) && (hero::hasBoostGod())) act->push &= ~PUSH_KILL;
// [RZC 26/09/2024] Hack usant react_push en el moviment RAND per a contar la distancia abans de canviar de direcció
if (act->movement == MOV_RAND)
{
@@ -1979,6 +1981,7 @@ namespace actor
bool dead = false;
bool prologo = false;
int prologo_objects[4] = {PROLOGO_OBJECT_INITIAL, PROLOGO_OBJECT_INITIAL, PROLOGO_OBJECT_INITIAL, PROLOGO_OBJECT_INITIAL};
int num_prologo_objects=0;
void setPrologo(const bool value)
{
@@ -2014,6 +2017,7 @@ namespace actor
skills = SKILL_NONE;
if (prologo) skills &= SKILL_SHOES;
for (int i=0;i<4;++i) prologo_objects[i] = PROLOGO_OBJECT_INITIAL;
num_prologo_objects=0;
parts = PART_NONE;
for (int i = 0; i < 10; ++i)
anbernics[i] = false;
@@ -2052,8 +2056,8 @@ namespace actor
{
return dead;
}
const int getBoosterFromString(const char *booster)
{
static const char *boostset_name[4] = {"RUN", "GOD", "JUMP", "LIVE"};
for (int i = 0; i < 4; ++i)
@@ -2160,6 +2164,11 @@ namespace actor
boost_jumps--;
}
const bool hasBoostGod()
{
return boost_god > 0;
}
const int getSkillFromString(char *skill)
{
static const char *skillset_name[4] = {"SHOES", "GLOVES", "PANTS", "BAG"};
@@ -2309,6 +2318,7 @@ namespace actor
void leavePrologoObject(int which)
{
prologo_objects[which] = PROLOGO_OBJECT_LEFT;
num_prologo_objects++;
}
const bool isCarryingPrologoObject()
@@ -2322,6 +2332,11 @@ namespace actor
return prologo_objects[which];
}
const int getNumPrologoObjectsDone()
{
return num_prologo_objects;
}
void move(int *x, int *y, int *z)
{
actor_t *hero = actor::find("HERO");

View File

@@ -232,6 +232,7 @@ namespace actor
void useBoostGod();
void useBoostRun();
void useBoostJump();
const bool hasBoostGod();
const int getSkillFromString(char *skill);
const char *getSkillName(int skill);
@@ -257,6 +258,7 @@ namespace actor
void leavePrologoObject(int which);
const bool isCarryingPrologoObject();
const int getPrologoObjectState(int which);
const int getNumPrologoObjectsDone();
void move(int *x, int *y, int *z);
void setFirstPos();

View File

@@ -0,0 +1,72 @@
#include "m_intro.h"
#include "jgame.h"
#include "jdraw.h"
#include "jinput.h"
#include "jaudio.h"
#include "controller.h"
#include "config.h"
#include <SDL2/SDL.h>
#include "actor.h"
namespace modules
{
namespace end_prologo_sequence
{
int stage = 0;
uint32_t time = 0;
void init()
{
time = SDL_GetTicks();
stage = 0;
draw::restorecol(2);
draw::cls(2);
draw::swapcol(1, 7);
draw::setSource(draw::getSurface("prologo3.gif"));
draw::draw(96, 28, 128, 96, 0, 0);
draw::print2("ALE! QUE BON", 13, 17, WHITE, FONT_ZOOM_NONE);
draw::print2("TRABAJ HE HECH!", 11, 19, WHITE, FONT_ZOOM_NONE);
draw::render();
if (audio::getCurrentMusic() != "mus_menu.ogg") audio::playMusic("mus_menu.ogg");
actor::templates::load();
}
const bool shouldGoToNext()
{
if (SDL_GetTicks()-time < 1000) return false;
return (SDL_GetTicks()-time > (stage==15||stage==16?10000:5000)) ||
(controller::pressed(KEY_JUMP)) || (controller::pressed(KEY_PICK)) ||
(input::keyPressed(SDL_SCANCODE_SPACE)) || (input::keyPressed(SDL_SCANCODE_RETURN));
}
bool loop()
{
if (controller::pressed(KEY_MENU)) return false;
if (shouldGoToNext())
{
time = SDL_GetTicks();
stage++;
if (stage==2) return false;
switch (stage)
{
case 1:
draw::cls(2);
draw::swapcol(1, 8);
draw::setSource(draw::getSurface("prologo4.gif"));
draw::draw(96, 28, 128, 96, 0, 0);
draw::print2("PERO QUE...?", 12, 17, WHITE, FONT_ZOOM_NONE);
//draw::render();
break;
}
}
draw::render();
return true;
}
}
}

View File

@@ -0,0 +1,10 @@
#pragma once
namespace modules
{
namespace end_prologo_sequence
{
void init();
bool loop();
}
}

View File

@@ -18,9 +18,12 @@ namespace modules
const char *actor_names[] = {"JAILDESIGNER", "BATMAN", "ROBIN", "EL ALTRE BATMAN", "EL ABAD", "LA ROOMBA", "EL OBRER", "BAMBOLLA DE CAFE", "EL YONKI", "LA PILOTA", "SAM", "LORD ABAD"};
const char *actor_ids[] = {"JAILDES", "GAT-BATMAN", "GAT-ROBIN", "BATMAN", "ABAD", "ROOMBA2", "OBRER", "COFFEE", "YONKI", "PILOTA", "SAM", "LORD-ABAD"};
void init()
void init(bool go_direct_to_credits)
{
stage = go_direct_to_credits ? 2 : 0;
time = SDL_GetTicks();
if (go_direct_to_credits) time += 5000;
draw::restorecol(2);
draw::cls(2);
@@ -37,6 +40,7 @@ namespace modules
const bool shouldGoToNext()
{
if (SDL_GetTicks()-time < 1000) return false;
return (SDL_GetTicks()-time > (stage==15||stage==16?10000:5000)) ||
(controller::pressed(KEY_JUMP)) || (controller::pressed(KEY_PICK)) ||
(input::keyPressed(SDL_SCANCODE_SPACE)) || (input::keyPressed(SDL_SCANCODE_RETURN));

View File

@@ -4,7 +4,7 @@ namespace modules
{
namespace end_sequence
{
void init();
void init(bool go_direct_to_credits=false);
bool loop();
}
}

View File

@@ -325,6 +325,7 @@ namespace modules
actor::update(actor::getFirst());
actor::hero::useBoostGod();
if ( (actor::hero::getParts()==0x3f) && (room::getCurrent()==45) ) return GAME_END;
if ( (actor::hero::getNumPrologoObjectsDone()==4) && (room::getCurrent()==64) ) return GAME_PROLOGO_END;
}
}
@@ -843,6 +844,9 @@ namespace modules
changed = true;
}
*/
mx = draw::getLocalX(input::mouseX());
my = draw::getLocalY(input::mouseY());
line+=10;
ui::label("POS", 2, line, 48, 11);
if (input::mouseClk(1) && mx>=2 && mx <=48 && my>=line && my<=line+10) return_value = GAME_EDITOR_BITMAP_POS;

View File

@@ -16,6 +16,7 @@ namespace modules
#define GAME_EDITOR_BITMAP_POS 6
#define GAME_EDITOR_BITMAP_SIZE 7
#define GAME_END 8
#define GAME_PROLOGO_END 9
enum sections { SECTION_GENERAL, SECTION_ROOM, SECTION_ACTOR };

View File

@@ -29,6 +29,7 @@
#include "m_editor_bitmap.h"
#include "m_end_sequence.h"
#include "m_prologo_intro.h"
#include "m_end_prologo_sequence.h"
#define M_LOGO 0
#define M_INTRO 1
@@ -47,6 +48,7 @@
#define M_EDITOR_BITMAP 14
#define M_END 15
#define M_PROLOGO_INTRO 16
#define M_PROLOGO_END 17
int current_module = M_LOGO;
@@ -157,6 +159,9 @@ bool game::loop()
case M_END:
if (!modules::end_sequence::loop()) { modules::menu::init(); current_module = M_MENU; }
break;
case M_PROLOGO_END:
if (!modules::end_prologo_sequence::loop()) { modules::end_sequence::init(true); current_module = M_END; }
break;
case M_MENU:
option = modules::menu::loop();
if (option != OPTION_NONE) {
@@ -195,7 +200,11 @@ bool game::loop()
modules::editor_bitmap::init(EDITING_BITMAP_POS); current_module = M_EDITOR_BITMAP;
} else if (option==GAME_EDITOR_BITMAP_SIZE) {
modules::editor_bitmap::init(EDITING_BITMAP_SIZE); current_module = M_EDITOR_BITMAP;
} else if (option==GAME_END) { modules::end_sequence::init(); current_module = M_END; }
} else if (option==GAME_END) {
modules::end_sequence::init(); current_module = M_END;
} else if (option==GAME_PROLOGO_END) {
modules::end_prologo_sequence::init(); current_module = M_PROLOGO_END;
}
}
break;