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(); } }
static void USL_XORICursor(uint16_t x, uint16_t y, char *s, uint16_t cursor) { //static bool status; // VGA doesn't XOR... static char cursorStr[2] = {0x80, 0}; char buf[128]; uint16_t w, h; strcpy(buf, s); buf[cursor] = '\0'; VH_MeasurePropString(buf, &w, &h, us_printFont); // TODO: More changes to do here? US_SetPrintX(x + w - 1); US_SetPrintY(y); VH_DrawPropString(cursorStr, US_GetPrintX(), US_GetPrintY(), US_GetPrintFont(), US_GetPrintColour()); #if 0 if (status^=true) VH_DrawPropString("\x80", US_GetPrintX(), US_GetPrintY(), US_GetPrintFont(), US_GetPrintColour()); else { temp = us_printColour; us_printColour = us_backColour; VH_DrawPropString("\x80", US_GetPrintX(), US_GetPrintY(), US_GetPrintFont(), US_GetPrintColour()); us_printColour = temp; } #endif }
void US_RestoreWindow(US_WindowRec *win) { US_SetWindowX(win->x); US_SetWindowY(win->y); US_SetWindowW(win->w); US_SetWindowH(win->h); US_SetPrintX(win->px); US_SetPrintY(win->py); }
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_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; }