void CK6_MapCliffCol(CK_object *a, CK_object *b) { if (b->type == CT_Player) { if (ck_gameState.ep.ck6.rope == 0) { CA_CacheGrChunk(0x23); US_CenterWindow(26, 8); VH_DrawBitmap(US_GetWindowX() + US_GetWindowW() - 0x30, US_GetWindowY(), 0x23); US_SetWindowW(US_GetWindowW() - 0x30); US_SetPrintY(US_GetPrintY() + 15); US_CPrint("What a tall cliff!\n" "Wish I had a rope\n" "and grappling hook.\n"); VL_Present(); SD_PlaySound(SOUND_NEEDKEYCARD); VL_DelayTics(30); // VW_WaitVBL(30); IN_ClearKeysDown(); IN_WaitButton(); RF_ForceRefresh(); ck_nextX = -b->deltaPosX; ck_nextY = -b->deltaPosY; b->xDirection = b->yDirection = IN_motion_None; CK_PhysUpdateNormalObj(b); } else if (ck_gameState.ep.ck6.rope == 1) { ck_gameState.ep.ck6.rope++; SD_PlaySound(SOUND_KEENTHROWROPE); CK_SetAction2(b, CK_GetActionByName("CK6_ACT_MapKeenThrowRope0")); b->type = CT_Friendly; } else if (ck_gameState.ep.ck6.rope == 2) { if (a->user1) { b->posY += 0x40; b->user4 = 6; b->yDirection = IN_motion_Down; } else { b->posY -= 0x40; b->user4 = 6; b->yDirection = IN_motion_Up; } CK_SetAction(b, CK_GetActionByName("CK6_ACT_MapKeenClimbRope0")); b->type = CT_Friendly; } } }
void CK6_GrabbiterCol(CK_object *a, CK_object *b) { if (!ck_gameState.ep.ck6.sandwich) { CA_CacheGrChunk(0x23); SD_PlaySound(SOUND_GRABBITER); US_CenterWindow(26, 8); VH_DrawBitmap(US_GetWindowX() + US_GetWindowW() - 0x30, US_GetWindowY(), 0x23); US_SetWindowW(US_GetWindowW() - 0x30); US_SetPrintY(US_GetPrintY() + 5); US_CPrint("Oh no!\n" "It's a slavering\n" "Grabbiter! He says,\n" "\"Get me lunch and\n" "I'll tell ya a secret!\""); VL_Present(); VL_DelayTics(30); // VW_WaitVBL(30); IN_ClearKeysDown(); IN_WaitButton(); RF_ForceRefresh(); ck_nextX = -b->deltaPosX; ck_nextY = -b->deltaPosY; b->xDirection = b->yDirection = IN_motion_None; CK_PhysUpdateNormalObj(b); } else { ck_gameState.ep.ck6.sandwich++; CA_CacheGrChunk(0x23); US_CenterWindow(26, 8); VH_DrawBitmap(US_GetWindowX() + US_GetWindowW() - 0x30, US_GetWindowY(), 0x23); US_SetWindowW(US_GetWindowW() - 0x30); US_SetPrintY(US_GetPrintY() + 2); US_CPrint("The Grabbiter grabs\n" "the gigantic sandwich,\n" "downs it in one bite,\n" "and says,\"Here's your\n" "secret. Big meals\n" "make me sleepy!\n"); VL_Present(); VL_DelayTics(30); // VW_WaitVBL(30); IN_ClearKeysDown(); IN_WaitButton(); CK_SetAction2(a, CK_GetActionByName("CK6_ACT_GrabbiterNapping0")); RF_ForceRefresh(); } }
// US_SaveWindow() - Saves the current window parms into a record for later restoration void US_SaveWindow(US_WindowRec *win) { win->x = US_GetWindowX(); win->y = US_GetWindowY(); win->w = US_GetWindowW(); win->h = US_GetWindowH(); win->px = US_GetPrintX(); win->py = US_GetPrintY(); }
void CK6_RocketCol(CK_object *a, CK_object *b) { if (ck_gameState.ep.ck6.passcard == 0) { CA_CacheGrChunk(0x23); US_CenterWindow(26, 8); VH_DrawBitmap(US_GetWindowX() + US_GetWindowW() - 0x30, US_GetWindowY(), 0x23); US_SetWindowW(US_GetWindowW() - 0x30); US_SetPrintY(US_GetPrintY() + 5); US_CPrint("The door makes a loud\n" "blooping noise.\n" "It says,\n" "\"Passcard required\n" "for entry.\""); VL_Present(); SD_PlaySound(SOUND_NEEDKEYCARD); VL_DelayTics(30); // VW_WaitVBL(30); IN_ClearKeysDown(); IN_WaitButton(); RF_ForceRefresh(); ck_nextX = -b->deltaPosX; ck_nextY = -b->deltaPosY; b->xDirection = b->yDirection = IN_motion_None; CK_PhysUpdateNormalObj(b); } else if (ck_gameState.ep.ck6.passcard == 1) { a->user1 = 0; a->user2 = 0x100; CK_SetAction2(a, CK_GetActionByName("CK6_ACT_RocketFly0")); b->posX = a->posX; b->posY = a->posY + 0x100; b->clipped = CLIP_not; CK_SetAction2(b, CK_GetActionByName("CK6_ACT_MapKeenRocketSit0")); SD_PlaySound(SOUND_ROCKETLAUNCH); SD_WaitSoundDone(); } }
void CK6_ShowGetRope() { SD_WaitSoundDone(); SD_PlaySound(SOUND_STORYITEM); CA_UpLevel(); CA_CacheGrChunk(0x23); US_CenterWindow(26, 8); VH_DrawBitmap(US_GetWindowX() + US_GetWindowW() - 0x30, US_GetWindowY(), 0x23); US_SetWindowW(US_GetWindowW() - 0x30); US_SetPrintY(US_GetPrintY() + 12); US_CPrint("Wow! A rope and\n" "grappling hook!\n" "They look useful!\n"); VL_Present(); VL_DelayTics(30); // VW_WaitVBL(30); IN_ClearKeysDown(); IN_WaitButton(); CA_DownLevel(); ck_gameState.ep.ck6.rope = true; }
void CK6_ShowGetSandwich() { SD_WaitSoundDone(); SD_PlaySound(SOUND_STORYITEM); CA_UpLevel(); CA_CacheGrChunk(0x23); US_CenterWindow(26, 8); VH_DrawBitmap(US_GetWindowX() + US_GetWindowW() - 0x30, US_GetWindowY(), 0x23); US_SetWindowW(US_GetWindowW() - 0x30); US_SetPrintY(US_GetPrintY() + 12); US_CPrint("This is the second\n" "biggest sandwich\n" "I ever saw!\n"); VL_Present(); VL_DelayTics(30); // VW_WaitVBL(30); IN_ClearKeysDown(); IN_WaitButton(); CA_DownLevel(); ck_gameState.ep.ck6.sandwich = true; }
void CK6_ShowGetPasscard() { SD_WaitSoundDone(); SD_PlaySound(SOUND_STORYITEM); CA_UpLevel(); CA_CacheGrChunk(0x23); US_CenterWindow(26, 8); VH_DrawBitmap(US_GetWindowX() + US_GetWindowW() - 0x30, US_GetWindowY(), 0x23); US_SetWindowW(US_GetWindowW() - 0x30); US_SetPrintY(US_GetPrintY() + 4); US_CPrint("What's this? Cool!\n" "A passcard for\n" "the Bloogstar Rocket!\n" "(It can fly though\n" "their force field.)"); VL_Present(); VL_DelayTics(30); // VW_WaitVBL(30); IN_ClearKeysDown(); IN_WaitButton(); CA_DownLevel(); ck_gameState.ep.ck6.passcard = true; }