Exemplo n.º 1
0
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();
  }
}
Exemplo n.º 2
0
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;
    }
  }
}
Exemplo n.º 3
0
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();
  }
}
Exemplo n.º 4
0
// REFKEEN - Rename different versions of DemoLoop for multi-ver support
void
DemoLoop_Old (void)
{
	const id0_char_t            *s;
	//id0_word_t            move;
	//id0_longword_t        lasttime;
	WindowRec       mywin;

#if FRILLS
//
// check for launch from ted
//
	if (tedlevel)
	{
		NewGame();
		gamestate.mapon = tedlevelnum;
		GameLoop();
		TEDDeath();
	}
#endif

//
// demo loop
//
	// REFKEEN - Alternative controllers support
	BE_ST_AltControlScheme_Push();
	BE_ST_AltControlScheme_PrepareControllerMapping(&g_ingame_altcontrol_mapping_demoloop);

	US_SetLoadSaveHooks(LoadGame,SaveGame,ResetGame);
	restartgame = gd_Continue;
	while (true)
	{
		// Load the Title map
		gamestate.mapon = 20;           // title map number
		loadedgame = false;
		SetupGameLevel(true);

		while (!restartgame && !loadedgame)
		{
			VW_InitDoubleBuffer();
			IN_ClearKeysDown();

			while (true)
			{
				// Display the Title map
				RF_NewPosition((5 * TILEGLOBAL) + (TILEGLOBAL / 2),
								(TILEGLOBAL * 2) + (TILEGLOBAL / 2)
								+ (TILEGLOBAL / 4));
				RF_ForceRefresh();
				RF_Refresh();
				RF_Refresh();

				if (Wait(TickBase * 2))
					break;

				mywin.x = (16 * 13) + 4;
				mywin.y = 0;
				mywin.w = 16 * 7;
				mywin.h = 200;
				mywin.px = mywin.x + 0;
				mywin.py = mywin.y + 10;
				s =             "Game\n"
						"John Carmack\n"
						"\n"
						"Utilities\n"
						"John Romero\n"
						"\n"
						"Interface/Sound\n"
						"Jason Blochowiak\n"
						"\n"
						"Creative Director\n"
						"Tom Hall\n"
						"\n"
						"Art\n"
						"Adrian Carmack\n";
				if (ShowText((9 * TILEGLOBAL) - (PIXGLOBAL * 2),&mywin,s))
					break;

				mywin.x = 4;
				mywin.y = 0;
				mywin.w = 16 * 7;
				mywin.h = 200;
				mywin.px = mywin.x + 0;
				mywin.py = mywin.y + 10;
				if (refkeen_current_gamever == BE_GAMEVER_KDREAMSC105)
					s =             "\n"
							"\"Keen Dreams\"\n"
							"Copyright 1991-93\n"
							"Softdisk, Inc.\n"
							"\n"
							"\n"
							"\n"
							"\n"
							"Commander Keen\n"
							"Copyright 1990-91\n"
							"Id Software, Inc.\n"
							"\n"
							"Press F1 for Help\n"
							"SPACE to Start\n";
				else
					s =		"Gamer's Edge\n"
							"\"Keen Dreams\"\n"
							"Copyright 1991\n"
							"Softdisk, Inc.\n"
							"\n"
							"Subscriptions\n"
							"1-800-831-2694\n"
							"\n"
							"Commander Keen\n"
							"Copyright 1990-91\n"
							"Id Software, Inc.\n"
							"\n"
							"Press F1 for Help\n"
							"SPACE to Start\n";
				if (ShowText((2 * TILEGLOBAL) + (PIXGLOBAL * 2),&mywin,s))
					break;

				if (MoveTitleTo((5 * TILEGLOBAL) + (TILEGLOBAL / 2)))
					break;
				if (Wait(TickBase * 3))
					break;

				VWB_Bar(0,0,320,200,FIRSTCOLOR);
				US_DisplayHighScores(-1);

				if (IN_UserInput(TickBase * 8,false))
					break;
			}

			US_ControlPanel ();
		}

		if (!loadedgame)
			NewGame();
		GameLoop();
	}
	// REFKEEN - Alternative controllers support
	BE_ST_AltControlScheme_Pop();
}