diff --git a/data/altres.gif b/data/altres.gif index b4ca508..f58fb2f 100644 Binary files a/data/altres.gif and b/data/altres.gif differ diff --git a/data/draft.gif b/data/draft.gif new file mode 100644 index 0000000..b4ca508 Binary files /dev/null and b/data/draft.gif differ diff --git a/data/rooms/09.txt b/data/rooms/09.txt index aca52c0..f866e1b 100644 --- a/data/rooms/09.txt +++ b/data/rooms/09.txt @@ -22,7 +22,8 @@ actor{ pos: 32 24 28 size: 8 8 8 orient: ZP - flags: PUSHABLE MOVING DEADLY INERTIA + flags: PUSHABLE REACTIVE MOVING DEADLY INERTIA + react-mask: XP XN YP YN ZP ZN movement: Z } @@ -34,7 +35,8 @@ actor{ pos: 24 32 9 size: 8 8 8 orient: ZN - flags: PUSHABLE MOVING DEADLY INERTIA + flags: PUSHABLE REACTIVE MOVING DEADLY INERTIA + react-mask: XP XN YP YN ZP ZN movement: Z } @@ -46,7 +48,8 @@ actor{ pos: 32 32 21 size: 8 8 8 orient: ZN - flags: PUSHABLE MOVING DEADLY INERTIA + flags: PUSHABLE REACTIVE MOVING DEADLY INERTIA + react-mask: XP XN YP YN ZP ZN movement: Z } @@ -58,7 +61,8 @@ actor{ pos: 24 24 15 size: 8 8 8 orient: ZP - flags: PUSHABLE MOVING DEADLY INERTIA + flags: PUSHABLE REACTIVE MOVING DEADLY INERTIA + react-mask: XP XN YP YN ZP ZN movement: Z } diff --git a/data/rooms/10.txt b/data/rooms/10.txt index 4e9c441..6e306ab 100644 --- a/data/rooms/10.txt +++ b/data/rooms/10.txt @@ -138,6 +138,32 @@ actor{ movement: CW } +actor{ + name: ROOMBA-00 + bmp: caixes.gif + bmp-rect: 160 0 32 32 + bmp-offset: 0 34 + pos: 24 0 0 + size: 8 8 2 + orient: XN + flags: REACTIVE MOVING DEADLY + react-mask: XP XN YP YN ZP ZN + movement: RAND +} + +actor{ + name: ROOMBA-01 + bmp: caixes.gif + bmp-rect: 160 0 32 32 + bmp-offset: 0 34 + pos: 24 48 0 + size: 8 8 2 + orient: YP + flags: REACTIVE MOVING DEADLY + react-mask: XP XN YP YN ZP ZN + movement: RAND +} + actor{ name: TAULA-01 bmp: caixes.gif diff --git a/data/rooms/11.txt b/data/rooms/11.txt index dc20fee..9cdb22e 100644 --- a/data/rooms/11.txt +++ b/data/rooms/11.txt @@ -1,9 +1,273 @@ -width: 2 +width: 3 height: 2 door-height-yp: 0 color: YELLOW -floor-texture: 0 -wall-texture: 0 -door-texture: 0 +floor-texture: 4 +wall-texture: 3 +door-texture: 1 under-door-texture: 0 exit-yp: 10 + +actor{ + name: GAT-BATMAN + bmp: gat.gif + bmp-rect: 0 0 24 28 + bmp-offset: -4 32 + pos: 8 16 0 + size: 8 8 8 + orient: XP + anim-wait: 1 + flags: REACTIVE MOVING ANIMATED ORIENTABLE DEADLY + react-mask: XP XN YP YN ZP ZN + movement: X +} + +actor{ + name: GAT-ROBIN + bmp: gat2.gif + bmp-rect: 0 0 24 28 + bmp-offset: -4 32 + pos: 40 32 0 + size: 8 8 8 + orient: XN + anim-wait: 1 + flags: REACTIVE MOVING ANIMATED ORIENTABLE DEADLY + react-mask: XP XN YP YN ZP ZN + movement: X +} + +actor{ + name: ROOMBA + bmp: caixes.gif + bmp-rect: 160 0 32 32 + bmp-offset: 0 34 + pos: 56 24 0 + size: 8 8 2 + orient: YN + flags: REACTIVE MOVING DEADLY + react-mask: XP XN YP YN ZP ZN + movement: Y +} + +actor{ + name: S-PANTS + bmp: objectes.gif + bmp-rect: 167 22 18 23 + bmp-offset: -7 27 + pos: 0 16 0 + size: 4 4 4 + anim-cycle: SEQ + anim-wait: 2 + flags: SPECIAL + movement: CW +} + +actor{ + name: TRANSPA-00 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 0 8 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-01 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 16 8 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-02 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 24 8 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-03 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 40 8 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-04 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 48 8 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-05 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 48 24 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-06 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 40 24 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-07 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 32 24 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-08 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 24 24 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-09 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 16 24 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-10 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 0 24 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-11 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 8 24 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-12 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 0 8 6 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-13 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 8 40 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-14 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 16 40 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-15 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 0 8 12 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-16 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 32 40 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-17 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 40 40 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-18 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 40 48 0 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-19 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 0 24 6 + size: 8 8 6 + movement: CW +} + +actor{ + name: TRANSPA-20 + bmp: altres.gif + bmp-rect: 0 160 32 32 + bmp-offset: 0 32 + pos: 0 24 12 + size: 8 8 6 + movement: CW +} diff --git a/data/rooms/16.txt b/data/rooms/16.txt index 1763138..1e2bb38 100644 --- a/data/rooms/16.txt +++ b/data/rooms/16.txt @@ -1,5 +1,5 @@ -width: 2 -height: 2 +width: 3 +height: 1 door-height-yp: 0 color: PURPLE floor-texture: 0 @@ -7,3 +7,218 @@ wall-texture: 0 door-texture: 0 under-door-texture: 0 exit-yp: 15 + +actor{ + name: BOX-A + bmp: caixes.gif + bmp-rect: 0 0 32 32 + bmp-offset: 0 32 + pos: 25 24 0 + size: 8 8 8 + flags: PICKABLE PUSHABLE + movement: CW +} + +actor{ + name: BOX-B + bmp: caixes.gif + bmp-rect: 32 0 32 32 + bmp-offset: 0 32 + pos: 40 35 0 + size: 8 8 8 + flags: PICKABLE PUSHABLE + movement: CW +} + +actor{ + name: P-PIPE + bmp: objectes.gif + bmp-rect: 16 64 16 32 + bmp-offset: -8 36 + pos: 0 14 18 + size: 4 4 4 + anim-cycle: SEQ + anim-wait: 2 + flags: SPECIAL + movement: CW +} + +actor{ + name: TRANSPA-00 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 0 16 0 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-01 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 8 16 0 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-02 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 16 16 0 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-05 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 40 16 0 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-06 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 48 16 0 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-07 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 56 16 0 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-08 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 0 16 6 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-09 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 8 16 6 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-10 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 16 16 6 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-11 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 0 16 12 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-12 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 8 16 12 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-13 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 40 16 6 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-14 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 48 16 6 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-15 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 56 16 6 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-16 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 16 16 12 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-17 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 40 16 12 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-18 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 48 16 12 + size: 8 5 6 + movement: CW +} + +actor{ + name: TRANSPA-19 + bmp: altres.gif + bmp-rect: 21 101 26 24 + bmp-offset: -6 27 + pos: 56 16 12 + size: 8 5 6 + movement: CW +} diff --git a/source/actor.cpp b/source/actor.cpp index 8b086a2..66ad6f4 100644 --- a/source/actor.cpp +++ b/source/actor.cpp @@ -535,8 +535,12 @@ namespace actor hero::collectBooster(act->name[1]-48, (act->name[3]-48)*10+(act->name[4]-48)); } else if (act->name[0]=='S') { // Es un skill hero::giveSkill(&act->name[2]); - } else if ( (act->name[0]=='P') && (hero::getSkills()&SKILL_BAG) ) { // Es una part - hero::pickPart(&act->name[2]); + } else if (act->name[0]=='P') { + if (hero::getSkills()&SKILL_BAG) { // Es una part + hero::pickPart(&act->name[2]); + } else { + return result; + } } else { SDL_assert(false); } diff --git a/source/console.cpp b/source/console.cpp index 50ca7fb..d7275f3 100644 --- a/source/console.cpp +++ b/source/console.cpp @@ -134,9 +134,10 @@ namespace console #define CMD_EXIT 4 #define CMD_SHOW 5 #define CMD_HIDE 6 - #define NUM_CMDS 7 + #define CMD_HELP 7 + #define NUM_CMDS 8 - const char *command_text[NUM_CMDS] = { "GIVE", "DROP", "GOTO", "MOVE", "EXIT", "SHOW", "HIDE" }; + const char *command_text[NUM_CMDS] = { "GIVE", "DROP", "GOTO", "MOVE", "EXIT", "SHOW", "HIDE", "HELP" }; #define PARAM_UNKNOWN -1 #define PARAM_RUN 0 @@ -282,6 +283,40 @@ namespace console debug::disable(value); } break; + case CMD_HELP: + if (!tokens[1]) { + strcpy(msg, "GIVE DROP GOTO MOVE EXIT SHOW HIDE HELP"); + } else { + int command = getCommand(); + switch (command) + { + case CMD_UNKNOWN: + strcpy(msg, "Unknown command, cannot help."); + break; + case CMD_GIVE: + strcpy(msg, "RUN GOD JUMP LIVE SHOES GLOVES PANTS BAG FILTER PUMP TIMER SALT PIPE ELBOW"); + break; + case CMD_DROP: + strcpy(msg, "RUN GOD JUMP LIVE SHOES GLOVES PANTS BAG FILTER PUMP TIMER SALT PIPE ELBOW"); + break; + case CMD_GOTO: + strcpy(msg, "PARAM: Number of room to go."); + break; + case CMD_MOVE: + strcpy(msg, "PARAMS: Axis Number. Exemple: MOVE X 16, MOVE Z 4..."); + break; + case CMD_EXIT: + strcpy(msg, "Exits the game."); + break; + case CMD_SHOW: + strcpy(msg, "NOTHING ACTOR-POS"); + break; + case CMD_HIDE: + strcpy(msg, "NOTHING ACTOR-POS"); + break; + } + + } } cmd_size=0; cmd[cmd_size] = '\0';