Skip to content

Commit

Permalink
Possible to reach labyrinth
Browse files Browse the repository at this point in the history
  • Loading branch information
andwn committed Jul 1, 2016
1 parent 8fbc6b4 commit 99e3455
Show file tree
Hide file tree
Showing 22 changed files with 96 additions and 37 deletions.
9 changes: 9 additions & 0 deletions inc/ai.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ void ai_malco_onState(Entity *e);
void ai_malcoBroken_onCreate(Entity *e);
void ai_malcoBroken_onState(Entity *e);

void ai_powerc_onCreate(Entity *e);

/* Sand Zone - sand.c */

void ai_omega_onCreate(Entity *e);
Expand All @@ -244,4 +246,11 @@ void ai_sunstone_onCreate(Entity *e);
void ai_sunstone_onUpdate(Entity *e);
void ai_sunstone_onState(Entity *e);

void ai_puppy_onCreate(Entity *e);
void ai_puppy_onUpdate(Entity *e);

void ai_torokoBoss_onCreate(Entity *e);
void ai_torokoBoss_onUpdate(Entity *e);
void ai_torokoBoss_onState(Entity *e);

#endif /* INC_AI_H_ */
Binary file modified res/back/bkGard.bmp
Binary file not shown.
Binary file modified res/back/bkMaze.bmp
Binary file not shown.
Binary file added res/face/face13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/face/face15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/face/face16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/face/face26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion res/resources.res
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PALETTE PAL_Gunsmith "sprite/gunsmith.png" 3
PALETTE PAL_Plant "sprite/flower.png" 3
PALETTE PAL_Frog "sprite/balfrog1.png" 3
PALETTE PAL_Chaco "sprite/chaco.png" 3
PALETTE PAL_Jenka "sprite/jenka.png" 3

# ----------------------------------------------------------------------------------------------
# Sprites
Expand Down Expand Up @@ -98,6 +99,8 @@ SPRITE SPR_TeleLight "sprite/telelight.png" 2 2 0 0 NONE
SPRITE SPR_Puppy "sprite/puppy.png" 2 2 0 8 NONE
SPRITE SPR_Table "sprite/table.png" 3 2 0 0 NONE
SPRITE SPR_ManShot "sprite/manshot.png" 2 3 0 4 NONE
SPRITE SPR_Skullhead "sprite/skullstep.png" 4 3 0 0 NONE


# Use Same Palette as Stage
SPRITE SPR_CritHB "sprite/critcave.png" 2 2 0 0 NONE
Expand Down Expand Up @@ -130,6 +133,11 @@ SPRITE SPR_Crow "sprite/crow.png" 4 4 0 12 NONE
SPRITE SPR_Armadl "sprite/armadillo.png" 4 2 0 10 NONE
SPRITE SPR_Omega "sprite/omega.png" 10 8 0 0 NONE
SPRITE SPR_OmegaLeg "sprite/omegaleg.png" 4 4 0 0 NONE
SPRITE SPR_Booster "sprite/booster.png" 2 2 0 10 NONE
SPRITE SPR_Jenka "sprite/jenka.png" 2 2 0 0 NONE
SPRITE SPR_Doctor "sprite/doctor.png" 3 4 0 12 NONE
SPRITE SPR_ToroBoss "sprite/torokoboss.png" 4 4 0 12 NONE
SPRITE SPR_ToroFlower "sprite/toroflower.png" 2 2 0 8 NONE

# Use PAL_Gunsmith
SPRITE SPR_Gunsmith "sprite/gunsmith.png" 2 2 0 0 NONE
Expand Down Expand Up @@ -184,7 +192,7 @@ TILESET TS_Face09 "face/face09.png" 2
TILESET TS_Face10 "face/face10.png" 2
TILESET TS_Face11 "face/face11.png" 2
TILESET TS_Face12 "face/face12.png" 2

TILESET TS_Face13 "face/face13.png" 2
TILESET TS_Face14 "face/face14.png" 2
TILESET TS_Face15 "face/face15.png" 2
TILESET TS_Face16 "face/face16.png" 2
Expand Down
Binary file added res/sprite/booster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprite/doctor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprite/jenka.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprite/skullstep.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprite/toroflower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprite/torokoboss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions src/ai/door.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
#include "tables.h"
#include "tsc.h"

// When the door's direction is changed to be facing right it becomes
// transparent. The CNP command does this when Balrog barges into Barr
void ai_door_onCreate(Entity *e) {
// When the door's direction is changed to be facing right it becomes transparent
if(e->direction) e->spriteAnim = SPRITE_DISABLE;
u16 x = sub_to_block(e->x), y = sub_to_block(e->y);
if(stage_get_block_type(x, y + 1) != 0x41) { // Push down if too high
e->y += block_to_sub(1);
} else if(stage_get_block_type(x, y) == 0x41) { // Push up if too low
e->y -= block_to_sub(1);
}
}

void ai_door_onUpdate(Entity *e) {
Expand Down
24 changes: 17 additions & 7 deletions src/ai/item.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,32 @@ void ai_energy_onUpdate(Entity *e) {
}
e->state = STATE_DELETE;
} else {
// Bounce when hitting the ground
if(e->grounded) {
e->y_speed = pixel_to_sub(-2);
e->grounded = false;
sound_play(SOUND_EXPBOUNCE, 0);
if(++e->state_time > 15 * 60) {
e->state = STATE_DELETE;
return;
} else if(e->state_time > 12 * 60) {
SPR_SAFEVISIBILITY(e->sprite, (e->state_time & 3) > 1 ? VISIBLE : HIDDEN);
}
e->y_speed += GRAVITY;
e->x_next = e->x + e->x_speed;
e->y_next = e->y + e->y_speed;
s16 xsp = e->x_speed;
entity_update_collision(e);
// Reverse direction when hitting a wall
s16 xsp = e->x_speed;
if(e->x_speed < 0) {
collide_stage_leftwall(e);
} else {
collide_stage_rightwall(e);
}
if(e->x_speed == 0) {
e->direction = !e->direction;
e->x_speed = -xsp;
}
// Bounce when hitting the ground
if(collide_stage_floor(e)) {
e->y_speed = pixel_to_sub(-2);
e->grounded = false;
sound_play(SOUND_EXPBOUNCE, 0);
}
e->x = e->x_next;
e->y = e->y_next;
}
Expand Down
23 changes: 23 additions & 0 deletions src/ai/sand.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,26 @@ void ai_sunstone_onUpdate(Entity *e) {
void ai_sunstone_onState(Entity *e) {

}

void ai_puppy_onCreate(Entity *e) {
e->eflags |= NPC_INTERACTIVE; // Yeah..
}

void ai_puppy_onUpdate(Entity *e) {

}

void ai_torokoBoss_onCreate(Entity *e) {
e->eflags |= NPC_SHOOTABLE;
}

void ai_torokoBoss_onUpdate(Entity *e) {

}

void ai_torokoBoss_onState(Entity *e) {
if(e->state == STATE_DEFEATED) {
tsc_call_event(e->event);
e->state = STATE_DELETE;
}
}
4 changes: 4 additions & 0 deletions src/ai/weed.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,7 @@ void ai_malcoBroken_onState(Entity *e) {
break;
}
}

void ai_powerc_onCreate(Entity *e) {
e->y += pixel_to_sub(8);
}
6 changes: 3 additions & 3 deletions src/db/back.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const background_info_def background_info[BACKGROUND_COUNT] = {
{ &BG_Blue, PAL2, 0, 8, 8 },
{ &BG_Blue, PAL2, 0, 8, 8 },
{ &BG_Fog, PAL2, 1, 16, 4 },
{ &BG_Gard, PAL2, 0, 6, 8 },
{ &BG_Gard, PAL3, 0, 6, 8 },
{ &BG_Gray, PAL2, 0, 8, 8 },
{ &BG_Green, PAL3, 0, 8, 8 },
{ &BG_Maze, PAL2, 0, 8, 8 },
{ &BG_Maze, PAL2, 0, 8, 8 },
{ &BG_Maze, PAL3, 0, 8, 8 },
{ &BG_Maze, PAL3, 0, 8, 8 },
{ &BG_Red, PAL2, 0, 4, 4 },
{ &BG_Red, PAL2, 0, 4, 4 },
{ &BG_Green, PAL3, 0, 8, 8 },
Expand Down
2 changes: 1 addition & 1 deletion src/db/face.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const face_info_def face_info[FACE_COUNT] = {
{ &TS_Face10, PAL3 },
{ &TS_Face11, PAL3 },
{ &TS_Face12, PAL3 },
{ &TS_Face01, PAL3 },
{ &TS_Face13, PAL3 },
{ &TS_Face14, PAL3 },
{ &TS_Face15, PAL0 },
{ &TS_Face16, PAL0 },
Expand Down
42 changes: 21 additions & 21 deletions src/db/npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,23 @@ const npc_info_def npc_info[NPC_COUNT + 8] = {
/* 0x030 (48) */
{ NULL, PAL0, "Omega Projectile", // TODO
NULL, NULL, NULL, NULL },
{ NULL, PAL0, "Skullhead", // TODO
{ &SPR_Skullhead, PAL1, "Skullhead", // TODO
NULL, NULL, &ai_default_onState, NULL },
{ NULL, PAL0, "Skeleton", // TODO
{ &SPR_Skullhead, PAL1, "Skeleton", // TODO
NULL, NULL, &ai_default_onState, NULL },
{ NULL, PAL0, "Crow & Skullhead", // TODO
{ &SPR_Crow, PAL3, "Crow & Skullhead", // TODO
NULL, NULL, &ai_default_onState, NULL },
{ &SPR_Robot, PAL3, "Blue Robot (Sitting)",
NULL, NULL, NULL, NULL },
{ NULL, PAL0, "???",
NULL, NULL, NULL, NULL },
{ NULL, PAL0, "Skullstep",
{ &SPR_Skullhead, PAL1, "Skullstep",
NULL, NULL, &ai_default_onState, NULL },
{ &SPR_Kazuma, PAL3, "Kazuma",
NULL, NULL, NULL, NULL },
{ &SPR_BtlHB, PAL3, "Brown Beetle",
{ &SPR_BtlHB, PAL3, "Brown Beetle",
NULL, &ai_beetle_onUpdate, &ai_default_onState, NULL },
{ NULL, PAL0, "Crow",
{ &SPR_Crow, PAL3, "Crow",
NULL, NULL, &ai_default_onState, NULL },
{ &SPR_Basu, PAL3, "Basu",
NULL, NULL, &ai_default_onState, NULL },
Expand Down Expand Up @@ -211,10 +211,10 @@ const npc_info_def npc_info[NPC_COUNT + 8] = {
&ai_fan_onCreate, &ai_fan_onUpdate, NULL, NULL },
{ NULL, PAL0, "Grate",
NULL, NULL, NULL, NULL },
{ NULL, PAL0, "Power Controls (Screen)",
{ NULL, PAL1, "Power Controls (Screen)",
NULL, NULL, NULL, NULL },
{ &SPR_Wave, PAL1, "Power Controls (Flow)",
&ai_pushdn_onCreate, NULL, NULL, NULL },
&ai_powerc_onCreate, NULL, NULL, NULL },
{ &SPR_ManShot, PAL0, "Mannan Projectile",
NULL, &ai_mannanShot_onUpdate, NULL, NULL },
{ NULL, PAL0, "Frog",
Expand All @@ -236,7 +236,7 @@ const npc_info_def npc_info[NPC_COUNT + 8] = {
/* 0x070 (112) */
{ &SPR_Quotele, PAL0, "Quote Teleporting In",
&ai_teleIn_onCreate, &ai_teleIn_onUpdate, NULL, NULL },
{ NULL, PAL0, "Prof. Booster",
{ &SPR_Booster, PAL3, "Prof. Booster",
NULL, NULL, NULL, NULL },
{ &SPR_Press, PAL1, "Press",
NULL, NULL, &ai_default_onState, NULL },
Expand All @@ -263,7 +263,7 @@ const npc_info_def npc_info[NPC_COUNT + 8] = {
{ NULL, PAL0, "Hidden Heart/Missile",
NULL, &ai_heart_onUpdate, NULL, NULL },
{ &SPR_Puppy, PAL1, "Puppy (Runs Away)",
NULL, NULL, NULL, NULL },
&ai_puppy_onCreate, NULL, NULL, NULL },
{ NULL, PAL0, "???",
NULL, NULL, NULL, NULL },
/* 0x080 (128) */
Expand All @@ -272,27 +272,27 @@ const npc_info_def npc_info[NPC_COUNT + 8] = {
{ NULL, PAL0, "???",
NULL, NULL, NULL, NULL },
{ &SPR_Puppy, PAL1, "Puppy (Tail Wag)",
NULL, NULL, NULL, NULL },
&ai_puppy_onCreate, NULL, NULL, NULL },
{ &SPR_Puppy, PAL1, "Puppy (Sleeping)",
NULL, NULL, NULL, NULL },
&ai_puppy_onCreate, NULL, NULL, NULL },
{ &SPR_Puppy, PAL1, "Puppy (Bark)",
&ai_puppy_onCreate, NULL, NULL, NULL },
{ &SPR_Jenka, PAL3, "Jenka",
NULL, NULL, NULL, NULL },
{ NULL, PAL0, "Jenka",
NULL, NULL, NULL, NULL },
{ NULL, PAL0, "Armadillo",
{ &SPR_Armadl, PAL3, "Armadillo",
NULL, NULL, &ai_default_onState, NULL },
{ NULL, PAL0, "Skeleton",
NULL, NULL, &ai_default_onState, NULL },
{ &SPR_Puppy, PAL1, "Puppy (Carried)",
NULL, NULL, NULL, NULL },
&ai_puppy_onCreate, NULL, NULL, NULL },
{ NULL, PAL0, "Large Doorway (Frame)",
NULL, NULL, NULL, NULL },
{ NULL, PAL0, "Large Doorway (Doors)",
NULL, NULL, NULL, NULL },
{ NULL, PAL0, "Doctor (Crowned)",
{ &SPR_Doctor, PAL3, "Doctor (Crowned)",
NULL, NULL, NULL, NULL },
{ NULL, PAL0, "Frenzied Toroko",
NULL, NULL, &ai_default_onState, NULL },
{ &SPR_ToroBoss, PAL3, "Frenzied Toroko",
&ai_torokoBoss_onCreate, &ai_torokoBoss_onUpdate, &ai_torokoBoss_onState, NULL },
{ NULL, PAL0, "???",
NULL, NULL, NULL, NULL },
{ NULL, PAL0, "Flowercub",
Expand Down Expand Up @@ -570,8 +570,8 @@ const npc_info_def npc_info[NPC_COUNT + 8] = {
NULL, NULL, &ai_default_onState, NULL },
{ NULL, PAL0, "Droll",
NULL, NULL, &ai_default_onState, NULL },
{ NULL, PAL0, "Puppy (With Item)",
NULL, NULL, &ai_default_onState, NULL },
{ &SPR_Puppy, PAL1, "Puppy (With Item)",
&ai_puppy_onCreate, NULL, &ai_default_onState, NULL },
{ NULL, PAL0, "Red Demon",
NULL, NULL, &ai_default_onState, NULL },
{ NULL, PAL0, "Red Demon Projectile",
Expand Down
4 changes: 2 additions & 2 deletions src/db/stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ const stage_info_def stage_info[STAGE_COUNT] = {
{ PXM_Stream, PXE_Stream, TSC_Stream, &PAL_Regu, 17, 2, "Main Artery" },
/* 0x20 (32) */
{ PXM_CurlyS, PXE_CurlyS, TSC_CurlyS, &PAL_Regu, 16, 0, "Small Room" },
{ PXM_Jenka1, PXE_Jenka1, TSC_Jenka1, &PAL_Regu, 2, 0, "Jenka's House" },
{ PXM_Jenka1, PXE_Jenka1, TSC_Jenka1, &PAL_Jenka, 2, 0, "Jenka's House" },
{ PXM_Dark, PXE_Dark, TSC_Dark, &PAL_Regu, 18, 0, "Deserted House" },
{ PXM_Gard, PXE_Gard, TSC_Gard, &PAL_Regu, 9, 5, "Sand Zone Storehouse" },
{ PXM_Jenka2, PXE_Jenka2, TSC_Jenka2, &PAL_Regu, 2, 0, "Jenka's House" },
{ PXM_Jenka2, PXE_Jenka2, TSC_Jenka2, &PAL_Jenka, 2, 0, "Jenka's House" },
{ PXM_SandE, PXE_SandE, TSC_SandE, &PAL_Regu, 18, 7, "Sand Zone" },
{ PXM_MazeH, PXE_MazeH, TSC_MazeH, &PAL_Regu, 13, 8, "Labyrinth H" },
{ PXM_MazeW, PXE_MazeW, TSC_MazeW, &PAL_Regu, 13, 8, "Labyrinth W" },
Expand Down

0 comments on commit 99e3455

Please sign in to comment.