예제 #1
0
bool MusicDescriptor::Play()
{
    if(!AUDIO_ENABLE)
        return true;

    if(AudioManager->_active_music == this) {
        if(_state != AUDIO_STATE_PLAYING && _state != AUDIO_STATE_FADE_IN) {
            if (AudioDescriptor::Play())
                FadeIn(500);
            else
                return false;
        }
    } else {
        if(AudioManager->_active_music)
            AudioManager->_active_music->FadeOut(500);
        AudioManager->_active_music = this;
        if (AudioDescriptor::Play())
            FadeIn(500);
        else
            return false;
    }
    return true;
}
예제 #2
0
//------------------------------------------------------------------------------
// Purpose : Input handlers
//------------------------------------------------------------------------------
void CColorCorrection::InputEnable( inputdata_t &inputdata )
{
	m_bEnabled = true;

	if ( m_flFadeInDuration > 0.0f )
	{
		FadeIn();
	}
	else
	{
		m_flCurWeight = m_flMaxWeight;
	}
	
}
예제 #3
0
void LevelIntro(){
#ifdef FASTDEBUG
FadeIn(2,true);
return;
#endif
	FadeIn(2,false);
	ResetSprites();
	uint8_t xpos = 48-16;
	uint8_t soff;
	for(uint8_t i=0;i<8;i++){//"LEVEL XX"
		xpos += 16;
		if(i == 5)//space between level and numbers
			continue;
		soff = 0;
		while(soff < sizeof(sine_table)){
			WaitVsync(1);
			sprite_count = 4*i;
			if(i > 5)
				sprite_count -= 4;//don't lose sprite indices because of space

			uint8_t t0 = pgm_read_byte(&sine_table[soff++]);
			uint8_t t1;
			if(i < 5)
				t1 = pgm_read_byte(&lvl_sprite_string[i]);
			else if(i == 6)//tens
				t1 = FIRST_NUMERAL_SPRITE_FRAME+(p.level/10);
			else//ones
				t1 = FIRST_NUMERAL_SPRITE_FRAME+(p.level%10);

			DrawMetaSprite(xpos,t0,t1);
			WaitVsync(1);
		}
	}
	WaitVsync(80);

}
예제 #4
0
// init the state
void InitState_MainMenu()
{
	// initialize the text
	InitText();
	
	// draw the menu
	PrintStr(9, 9, "Pentago!");
	PrintStr(11, 11, "New Game");
	PrintStr(11, 13, "How To Play");
	PrintStr(11, 15, "Credits");
	
	// draw the selector
	SetTile(10, 11 + (2 * currentOpt), 127);
	
	// fade in
	FadeIn(1, true);
}
예제 #5
0
PRIVATE void Intro1(const char *name, int w, int h) {
    BM_PBitmap bl;
    byte pal[768];
    char buf[200];

    sprintf(buf, "%s.pal", name);
    JCLIB_Load(buf, pal, 768);
    sprintf(buf, "%s.pix", name);
    bl = BM_Make(w, h, 0, buf);
    REQUIRE(bl != NULL);

//    FadeOut(0, 0, 0, 6);
    VGA_ClearPage(0, 65536);
    BM_Draw((LLS_SizeX-bl->Header.Width)/2-10, (LLS_SizeY-bl->Header.Height)/2, bl);
    DISPOSE(bl);
    FadeIn(pal, 3);
}
예제 #6
0
void AI_Begin(char plr)
{
    int i;
    FILE *fin;
    int32_t len[2];


    for (i = 0; i < 768; i++) {
        pal[i] = 0;
    }

    fin = sOpen("TURN.BUT", "rb", 0);
    fread(&pal, 768, 1, fin);
    len[0] = fread(screen, 1, MAX_X * MAX_Y, fin);
    fclose(fin);
    RLED_img((char *)screen, vhptr.vptr, (unsigned int)len[0],
             vhptr.w, vhptr.h);

    gxClearDisplay(0, 0);
    ShBox(0, 60, 319, 80);
    grSetColor(6 + plr * 3);

    if (plr == 0) {
        DispBig(15, 64, "DIRECTOR OF THE UNITED STATES", 0, -1);
    } else {
        DispBig(30, 64, "CHIEF DESIGNER OF THE USSR", 0, -1);
    }

    grSetColor(11);
    grMoveTo(175, 122);

    if (Data->Season == 0) {
        PrintAt(0, 0, "SPRING 19");
    } else {
        PrintAt(0, 0, "FALL 19");
    }

    DispNum(0, 0, Data->Year);
    gxVirtualDisplay(&vhptr, 1 + 110 * plr, 1, 30, 85, 30 + 107, 85 + 93, 0);
    grSetColor(11);
    PrintAt(60, 58, "COMPUTER TURN:  THINKING...");
    music_start(M_SOVTYP);
    FadeIn(2, pal, 10, 0, 0);
    colss = 0;
}
예제 #7
0
//-------------------------------------------------------------------
// 実行中
//-------------------------------------------------------------------
void cTitleScene::Idle()
{
	if( !FadeIn() ) return;

	if( InputButton(Up) == 1 ){
		Device->Sound.PlaySE(0);
		pTitleCursor->Up();
	}
	if( InputButton(Down) == 1 ){
		Device->Sound.PlaySE(0);
		pTitleCursor->Down();
	}

	if( InputButton(Button1) == 1 ){
		switch( pTitleCursor->GetSelectID() ){
			case Select_GoSelect:
				Device->Sound.PlaySE(2);
				select_ = Select_GoSelect;
				stateFunc_.setFunc( &cTitleScene::End );
				MyOutputDebugString( _T("タイトルシーン:アイドル終了\nセレクトシーンへ移行します\n") );
				break;

			case Select_Config:
				pTitleKeyConfigString->SetIsDraw(TRUE);
				select_ = Select_Config;
				stateFunc_.setFunc( &cTitleScene::KeyConfig );
				MyOutputDebugString( _T("タイトルシーン:キーコンフィグを起動します。\n") );
				break;

			case Select_Exit:
				select_ = Select_Exit;
				stateFunc_.setFunc( &cTitleScene::End );
				MyOutputDebugString( _T("タイトルシーン:アイドル終了\nアプリケーションを終了します\n") );
				break;
		}
	}

	pTitleCursor->Updata();

	if( DxLib::GetWindowUserCloseFlag( TRUE ) && (MessageBox( DxLib::GetMainWindowHandle(),WindowText, WindowTitleText, MB_YESNO|MB_ICONQUESTION ) == IDYES) ){
		select_ = Select_Exit;
		stateFunc_.setFunc( &cTitleScene::End );
	}
}
예제 #8
0
// init the state
void InitState_GameOver()
{
	// initialize the text
	InitText();
	
	// draw it out
	PrintStr(10, 1, "Game Over!");
	
	if(wonPlayer == 0)
		PrintStr(10, 13, "Tie Game!");
	else if(wonPlayer == 1)
		PrintStr(8, 13, "Player 1 Won!");
	else if(wonPlayer == 2)
		PrintStr(8, 13, "Player 2 Won!");
	
	PrintStr(1, 26, "Press B to return to menu");
	
	// fade in
	FadeIn(1, true);
}
예제 #9
0
int SettingsMain(){
Pass.SettingsInfo=SETTINGS_NOTHING;
Pass.ProgramFlow=PF_SETTINGS;
MSG Msg;
LRESULT Result;

ScreenHighlighted=  DDLoadBitmap(Pass.DDObject,BMP_SETTINGSH, 0, 0);
ScreenUnhighlighted=DDLoadBitmap(Pass.DDObject,BMP_SETTINGS, 0, 0);

cbOptions.Initialize(&ScreenHighlighted, &ScreenUnhighlighted, &Pass.DDBack, GetRect(   340,236,557,309), cbOptionsProc);
cbHighScores.Initialize(&ScreenHighlighted, &ScreenUnhighlighted, &Pass.DDBack, GetRect(129,134,431,215), cbHighScoresProc);
cbPlay.Initialize(&ScreenHighlighted, &ScreenUnhighlighted, &Pass.DDBack, GetRect(      465,343,600,422), cbPlayProc);
cbExit.Initialize(&ScreenHighlighted, &ScreenUnhighlighted, &Pass.DDBack, GetRect(        6, 72,129,142), cbExitProc);
cbCredits.Initialize(&ScreenHighlighted, &ScreenUnhighlighted, &Pass.DDBack, GetRect(     6,341,215,422), cbCreditsProc);



Result=FadeIn(Pass.DDObject, &Pass.DDFront,  &ScreenUnhighlighted, 0);
settingsRedrawScreen();

Result=Blit(Pass.DDBack, ScreenUnhighlighted, 0,0,640,480,0,0);
//message loop now.
while(Pass.SettingsInfo==SETTINGS_NOTHING){
if(!GetMessage(&Msg, NULL, 0, 0)){
		Pass.SettingsInfo=SETTINGS_EXIT;
		Pass.ProgramFlow=PF_EXIT;
   }
   TranslateMessage(&Msg);
   DispatchMessage(&Msg);
}

//destroy the surfaces
if(ScreenHighlighted!=NULL){
	ScreenHighlighted->Release();
	ScreenHighlighted=NULL;
	ScreenUnhighlighted->Release();
	ScreenUnhighlighted=NULL;
}

return 0;
}
예제 #10
0
void CMessageBox::Render (const char* pszTitle, const char* pszSubTitle, CCanvas* gameCanvasP)
{
	static	int t0 = 0;

if (!MenuRenderTimeout (t0, -1))
	return;

CCanvas::SetCurrent (&gameStates.render.vr.buffers.screenPages [gameStates.render.vr.nCurrentPage]);
#if 0
if (!gameStates.app.bGameRunning)
	ogl.SetDrawBuffer (GL_FRONT, 0);
#endif
CCanvas::SetCurrent (backgroundManager.Canvas (1));
FadeIn ();
backgroundManager.Redraw ();
fontManager.SetColorRGBi (DKGRAY_RGBA, 1, 0, 0);
fontManager.SetCurrent (MEDIUM1_FONT);
GrPrintF (NULL, 0x8000, BOX_BORDER / 2, m_pszMsg); //(h / 2 + BOX_BORDER) / 2
GrUpdate (0);
if (!gameStates.app.bGameRunning)
	ogl.SetDrawBuffer (m_nDrawBuffer, 0);
gameStates.render.grAlpha = 1.0f;
}
예제 #11
0
void CreditsMain(){
	CreditsInfo=CREDITS_NORMAL;
	ddsCredits=DDLoadBitmap(Pass.DDObject, BMP_CREDITS, 0, 0);
	ddsCreditsh=DDLoadBitmap(Pass.DDObject, BMP_CREDITSH, 0, 0);
	RECT rect;
	SetRect(&rect, 237, 336, 385, 417);
	ccbOK.Initialize(&ddsCreditsh, &ddsCredits, &Pass.DDBack, rect, ccbOKProc);
	int OldPF=Pass.ProgramFlow;
	Pass.ProgramFlow=PF_CREDITS;
	FadeIn(Pass.DDObject, &Pass.DDFront, &ddsCredits, 0);
	Blit(Pass.DDBack, ddsCredits, 0, 0, 640, 480, 0, 0);
MSG Msg;
	//messageloop
	while(CreditsInfo != CREDITS_EXIT){
		if(!GetMessage(&Msg, NULL, 0, 0)){
			//trying to quit
   			Pass.ProgramFlow=PF_EXIT;
	   		CreditsInfo=CREDITS_EXIT;
		}
		else{
			TranslateMessage(&Msg);
			DispatchMessage(&Msg);
		}
	}

	FadeOut(Pass.DDObject, &Pass.DDFront, &ddsCredits, 0);
	if(Pass.ProgramFlow != PF_EXIT) Pass.ProgramFlow=OldPF;

	//destroy the surfaces
	if(ddsCredits != NULL){
		ddsCredits->Release();
		ddsCredits=NULL;
		ddsCreditsh->Release();
		ddsCreditsh=NULL;
	}
	return;
}
예제 #12
0
void F_GanhouJogo()
{
	bool SairLoop = false; // Flag que condicionará nosso looping

	FadeIn("Menu/ImagensMenu/gameover.bmp", 1);
	DesenhaMenu("Menu/ImagensMenu/gameover.bmp", "Parabens", cameraPosition[0],cameraPosition[1]);

	/* Toca os Efeitos Musicas */
	ALLEGRO_SAMPLE *sample = al_load_sample("Audio/AudioMenu/EfeitoET.wav");
	al_play_sample(sample, 1.0, 0.0, 1.0, ALLEGRO_PLAYMODE_ONCE, NULL );

	while (!SairLoop)
	{
		ALLEGRO_EVENT evento;
		al_wait_for_event(Fila_Eventos, &evento);
		if (evento.type == ALLEGRO_EVENT_KEY_DOWN)
		{
			SairLoop = true;
		}
	}

	FadeOut(1, 255);
	al_destroy_sample(sample);
}
예제 #13
0
// 遷移処理
void CSceneManager::Transition(){
	m_scene = m_factory->GetScene(m_now_scene);
	m_old_scene = m_now_scene;
	FadeIn();
}
예제 #14
0
/** \brief Edited version of ShowDexEntry. */
void ShowNewlyCaught(u16 index)
{
	signed int omgdutch;
	char data[64];
	int dexnum = GetDexNumber(index);
	BUP buh;
	u8 flasher = 0, flashtimer = 0;
	AGBPrintf("ShowNewlyCaught: showing species #%d...\n", index);

	CleanUpCrap();

	//DmaArrayCopy(dexinfo1Tiles, MEM_VRAM + 0x0000);
	//DmaArrayCopy(dexinfo1Pal, MEM_PAL_BG + 0x0000);
	//DmaCopy(dexinfo1Map, MEM_VRAM + 0xE800, 1280 );

	buh.src_len = 32;
	buh.src_len = 1;
	buh.dst_bpp = 4;
	buh.dst_ofs = 0;

	OamBak[1].HPos = 208;
	OamBak[1].VPos = 16;
	OamBak[1].Size = 1;
	OamBak[1].CharNo = 64;
	OamBak[1].Pltt = 1;

	OamBak[2].HPos = 208;
	OamBak[2].VPos = 48;
	OamBak[2].Size = 1;
	OamBak[2].CharNo = 128;
	OamBak[2].Pltt = 4;
	OamBak[3].HPos = 208;
	OamBak[3].VPos = 32;
	OamBak[3].Size = 1;
	OamBak[3].CharNo = 132;
	OamBak[3].Pltt = 5;
	*(u16*)0x05000222 = 0x318C;

	SetupPokemonSprite(0);
	OamBak[0].HPos = 8;
	OamBak[0].VPos = 8;
	OamBak[0].HFlip = 1;

	REG_BG1HOFS= 8;	REG_BG1VOFS= 0;
	REG_BG2HOFS= 0;	REG_BG2VOFS= 0;
	REG_BG3HOFS= 0;	REG_BG3VOFS= 0;

	vwSetLine(11,20,2,96,15);
	vwSetLine(11,20,4,160,15);
	vwSetLine(11,20,6,224,15);
	vwSetLine(1,30,11,288,15);
	vwSetLine(1,30,13,352,15);
	vwSetLine(1,30,15,416,15);

	vwBlackTransparentLUT();

	vwClear(0);
	sprintf(data, "No.%d - %s", dexnum, (char*)GetPokemonName(index));
	vwWrite(0,0,data);
	sprintf(data, "%s "POKEMON"\nHt: %ddm, Wt: %dhg", (char*)GetPokemonSpecies(dexnum), DexEntries[dexnum].height, DexEntries[dexnum].weight);
	vw_SetSmall(); vwWrite(0,18,data); vw_SetBig();
	vwWrite(1,6<<3,(char*)GetPokemonDescription(dexnum));

	LoadPokemonPic(index,0,MEM_VRAM_OBJ,pal_obj_bank[0],0);
	BitUnPack((void*)PokePrints[index], (void*)MEM_VRAM_OBJ + 0x800, &buh);
	PokeDex_LoadType(BaseStats[index].Type1, 0);
	if(BaseStats[index].Type2 != BaseStats[index].Type1)
		PokeDex_LoadType(BaseStats[index].Type2, 1);
	else
		PokeDex_LoadType(tpNormal, 1);

	for(omgdutch=24; omgdutch >= 0; omgdutch--)
	{
		BG1MAP[omgdutch+0x241] = BG1MAP[omgdutch+0x242];
		BG1MAP[omgdutch+0x261] = BG1MAP[omgdutch+0x262];
	}
	*(u16*)0x05000016 = regflash[flasher];

	FadeIn();

	while(1)
	{
		DoVBlank();
		KeyRead();

		flashtimer++;
		if(flashtimer == 7)
		{
			flashtimer=0;
			flasher++;
			if(flasher == 6)
				flasher = 0;
			*(u16*)0x05000016 = regflash[flasher];
		}

		if(Trg & B_BUTTON)
		{
			FadeOut();
			vwNormalLUT();
			ClearOamBak();
			return;
		}
	}
}
예제 #15
0
/** \brief Displays the Pokedex entry for the given species.

		Assumes it's at least seen, and allows switching to the other page and browsing to the other seen species.
*/
void ShowDexEntry(int index)
{
	BUP buh;
	int blendnow = 0, blendi = 0, page = 0, flavorpage = 0;
	int upidx, dnidx;
	int dexnum = GetDexNumber(index);

	ClearOamBak();
	CleanUpCrap();

	REG_BG1CNT |= BG_SIZE1;

	//DmaArrayCopy(dexinfo1Tiles, MEM_VRAM + 0x0000);
	//DmaArrayCopy(dexinfo1Pal, MEM_PAL_BG + 0x0000);
	//DmaArrayCopy(dexinfo1Map, MEM_VRAM + 0xE800);

	//*(u16*)0x05000016 = dexinfo1Pal[3];
	//DmaClear(0x318C318C, MEM_PAL_OBJ + 0xE0, 32);
	//*(u16*)0x050002E0 = 0x7FFF;

	buh.src_len = 32;
	buh.src_bpp = 1;
	buh.dst_bpp = 4;
	buh.dst_ofs = 0;

	OamBak[1].HPos = 208;
	OamBak[1].VPos = 16;
	OamBak[1].Size = 1;
	OamBak[1].CharNo = 64;
	OamBak[1].Pltt = 1;

	OamBak[2].HPos = 208;
	OamBak[2].VPos = 48;
	OamBak[2].Size = 1;
	OamBak[2].CharNo = 128;
	OamBak[2].Pltt = 4;
	OamBak[3].HPos = 208;
	OamBak[3].VPos = 32;
	OamBak[3].Size = 1;
	OamBak[3].CharNo = 132;
	OamBak[3].Pltt = 5;
	*(u16*)(MEM_PAL+0x222) = 0x318C;

	OamBak[4].Pltt = 7;
	OamBak[4].CharNo = 0;
	OamBak[4].Size = 3;
	OamBak[4].HPos = -80;
	OamBak[4].VPos = 8;
	OamBak[4].AffineMode = 1;
	OamBak[4].AffineParamNo_L = 1;
	OamBak[5].Pltt = 7;
	OamBak[5].CharNo = 160;
	OamBak[5].Size = 3;
	OamBak[5].HPos = -80;
	OamBak[5].VPos = 8;
	OamBak[5].AffineMode = 1;
	OamBak[5].AffineParamNo_L = 2;

	SetupPokemonSprite(0);
	OamBak[0].HPos = 8;
	OamBak[0].VPos = 8;
	OamBak[0].HFlip = 1;

	REG_BG1HOFS= 8;	REG_BG1VOFS= 0;
	REG_BG2HOFS= 0;	REG_BG2VOFS= 0;
	REG_BG3HOFS= 0;	REG_BG3VOFS= 0;

	vwSetLine(11,20,2,96,15);
	vwSetLine(11,20,4,160,15);
	vwSetLine(11,20,6,224,15);
	vwSetLine(1,30,11,288,15);
	vwSetLine(1,30,13,352,15);
	vwSetLine(1,30,15,416,15);

	//DmaCopy((u8*)TrainerPics[CardPics[MyPlayer.gender]<<1], MEM_VRAM_OBJ + 0x1400, 0x800);
	if(MyPlayer.gender)
		LZ77UnCompVram((u8*)TrainerPics[tpDani<<1], (u16*)MEM_VRAM_OBJ + 0xA00);
	else
		LZ77UnCompVram((u8*)TrainerPics[tpDanny<<1], (u16*)MEM_VRAM_OBJ + 0xA00);

	vwBlackTransparentLUT();

RedrawMonData:
	if(GETBIT(MyDex.caught,index))
		AGBPrint("Seen this one.\n");

	vwSetLine(0,20,18, 608, 15);
	PokeDex_ShowData(index,page,flavorpage);

	LoadPokemonPic(index,0,MEM_VRAM_OBJ,pal_obj_bank[0],0);
	AGBPrintf("Print at 0x%x.\n",PokePrints[index]);
	BitUnPack((void*)PokePrints[index], (void*)MEM_VRAM_OBJ + 0x800, &buh);

	PokeDex_LoadType(BaseStats[index].Type1, 0);
	if(BaseStats[index].Type2 != BaseStats[index].Type1)
		PokeDex_LoadType(BaseStats[index].Type2, 1);
	else
		PokeDex_LoadType(tpNormal, 1);

	OamBak[4].AffineParam = 0x14+ DexEntries[dexnum].mscale;
	OamBak[5].AffineParam = 0x0;
	OamBak[6].AffineParam = 0x0;
	OamBak[7].AffineParam = 0x14+DexEntries[dexnum].mscale;
	OamBak[8].AffineParam = 0x14+DexEntries[dexnum].tscale;
	OamBak[9].AffineParam = 0x0;
	OamBak[10].AffineParam = 0x0;
	OamBak[11].AffineParam = 0x28+DexEntries[dexnum].tscale;
	OamBak[4].VPos = 8 + DexEntries[dexnum].toffset;
	OamBak[5].VPos = 4 + 32 - (32*0x10000/(DexEntries[dexnum].tscale+0x14)>>8);

	if(blendnow==1)
	{
		REG_BLDCNT = BLD_BOT(BLD_BG1) | BLD_STD | BLD_OBJ | BLD_BG0;
		for(blendi = 0; blendi < 0x11; blendi += DEXFADESPEED)
		{
			REG_BLDALPHA = ((0x10 - blendi) << 8) + blendi;
			DoVBlank();
		}
	} else
	{
		FadeIn();
	}

	upidx = wrap(dexnum-1, 1, DexList[0]+1);
	while(!GETBIT(MyDex.seen, DexList[upidx]))
		upidx = wrap(upidx-1, 1, DexList[0]+1);
	dnidx = wrap(dexnum+1, 1, DexList[0]+1);
	while(!GETBIT(MyDex.seen, DexList[dnidx]))
		dnidx = wrap(dnidx+1, 1, DexList[0]+1);

	sndPlayCry(index,60);

	while(1)
	{
		DoVBlank();
		KeyRead();
		if(Trg & A_BUTTON) sndPlayCry(index,60);
		if(Cont & U_KEY)
		{
			index = DexList[upidx];
			dexnum = GetDexNumber(index);
			blendnow = 1;
			goto FadeMon;
		}
		if(Cont & D_KEY)
		{
			index = DexList[dnidx];
			dexnum = GetDexNumber(index);
			blendnow = 1;
			goto FadeMon;
		}
		if(Trg & B_BUTTON)
		{
			FadeOut();
			vwNormalLUT();
			ClearOamBak();
			REG_DISPCNT |= DCNT_BG0;
			REG_BG1HOFS = 8;
			return;
		}
		if((Trg & R_KEY) && (page == 0))
		{
			OamBak[0].HPos = -80;
			OamBak[1].HPos = -80;
			OamBak[2].HPos = -80;
			OamBak[3].HPos = -80;
			REG_DISPCNT &= ~DCNT_BG0;
			for(blendi = 1; blendi < 9; blendi++)
			{
				DoVBlank();
				REG_BG1HOFS = 8 + (blendi*32);
			}
			PokeDex_ShowData(index,1,flavorpage);
			REG_DISPCNT |= DCNT_BG0;
			OamBak[4].HPos = 136;
			OamBak[5].HPos = 176;
			page = 1;
		}
		if((Trg & L_KEY) && (page == 1))
		{
			OamBak[4].HPos = -80;
			OamBak[5].HPos = -80;
			REG_DISPCNT &= ~DCNT_BG0;
			for(blendi = 8; blendi > 0; blendi--)
			{
				DoVBlank();
				REG_BG1HOFS = 8 + ((blendi-1)*32);
			}
			OamBak[0].HPos = 8;
			OamBak[1].HPos = 208;
			OamBak[2].HPos = 208;
			OamBak[3].HPos = 208;
			PokeDex_ShowData(index, 0, flavorpage);
			REG_DISPCNT |= DCNT_BG0;
			page = 0;
		}
		if(Trg & KEY_SELECT && page == 0 && *DexEntries[dexnum].text2)
		{
			flavorpage ^= 1;
			PokeDex_ShowData(index, 0, flavorpage);
		}
	}

FadeMon:
	REG_BLDCNT = BLD_BOT(BLD_BG2) | BLD_STD | BLD_OBJ | BLD_BG0;
	for(blendi = 0; blendi < 0x10; blendi+=DEXFADESPEED)
	{
		REG_BLDALPHA = (blendi << 8) + (0x10 - blendi);
		DoVBlank();
	}
	flavorpage = 0;
	//DmaArrayCopy(dexinfo1Map, MEM_VRAM + 0xE800);
	goto RedrawMonData;
}
예제 #16
0
/** \brief Displays the list of all known species.

		Calls ShowDexEntry when the user wants to.
*/
void openPokeDex()
{
	int cX = 0;
	int cY = 0;
	int cursor = (cX * 5) + cY;
	int scroll = 0;
	int species = 0;
	char daah[32];

Redraw:
	vwBlackTransparentLUT();
	CleanUpCrap();
	ClearOamBak();
	DmaArrayCopy(dexlist_gsPal, MEM_PAL_BG + 0x0000);
	DmaArrayCopy(dexlist_gsTiles, MEM_VRAM + 0x0000);
	DmaArrayCopy(dexlist_gsMap, MEM_VRAM + 0xE000);
	REG_BG0CNT = BG_4BPP | BG_SIZE0 | BG_PRIO(0) | 31 << BG_SBB_SHIFT | 2 << BG_CBB_SHIFT;
	REG_BG1CNT = BG_4BPP | BG_SIZE0 | BG_PRIO(1) | 28 << BG_SBB_SHIFT | 0 << BG_CBB_SHIFT;
	REG_BG2CNT = BG_4BPP | BG_SIZE2 | BG_PRIO(2) | 29 << BG_SBB_SHIFT | 0 << BG_CBB_SHIFT;
	REG_DISPCNT =  DCNT_MODE0 | DCNT_OBJ | DCNT_BG0 | DCNT_BG1 | DCNT_BG2 | DCNT_OBJ_1D;
	pal_bg_mem[0] = 0x7FFF;
	REG_BG2VOFS = 23;
	REG_BG2HOFS = 21;

	vwWhiteTransparentLUT();
	vw_SetSmall();
	vwWrite(4,129,"¥PICK ¢OK £CANCEL °±²OPTIONS");
	vwSetLine(0,20,0, 608, 15);
	vw_SetBig();
	vwSetLine(8,20,17, 96, 15);
	vwSetLine(8,20,18,128, 15);
	vwBlackTransparentLUT();

	PokeDex_WriteList(scroll, cursor, 1);

	FadeIn();
	REG_BLDCNT = BLD_BUILD(BLD_OBJ, BLD_BG2 | BLD_BD, 0);
	REG_BLDALPHA = BLDA_BUILD(8, 8);

	while(1)
	{
		species = DexList[cursor + scroll + 1];

		DoVBlank();
		KeyRead();

		if(Trg & A_BUTTON)
		{
			if(GETBIT(MyDex.seen, DexList[cursor+scroll]) == 0)
			{
				//error buzz?
			} else
			{
				FadeOut();
				ShowDexEntry(DexList[cursor+scroll]);
				goto Redraw;
			}
		}
		if(Trg & B_BUTTON)
		{
			break;
		}
		if(Trg & U_KEY)
		{
			if (cX == 0)
			{
				if(scroll > 0)
				{
					scroll--;
				}
			} else
				cX--;
			cursor = (cX * 5) + cY;
			PokeDex_WriteList(scroll, cursor, 0);
		} else if(Trg & D_KEY)
		{
			if (cX == 2)
			{
				if(scroll < 42)
				{
					scroll++;
				}
			} else
				cX++;
			cursor = (cX * 5) + cY;
			PokeDex_WriteList(scroll, cursor, 0);
		} else if(Trg & L_KEY)
		{
			cY--;
			if(cY == -1)
			{
				cY = 4;
				cX--;
				if(cX == -1)
				{
					scroll--;
					cX = 0;
					if(scroll == -1)
					{
						scroll = 0;
						cY = 0;
					}
				}
			}
			cursor = (cX * 5) + cY;
			PokeDex_WriteList(scroll, cursor, 0);
		} else if(Trg & R_KEY)
		{
			cY++;
			if(cY == 5)
			{
				cY = 0;
				cX++;
				if (cX == 3)
				{
					scroll++;
					cX = 2;
				}
			}
			cursor = (cX * 5) + cY;
			PokeDex_WriteList(scroll, cursor, 0);
		} else if(Trg & KEY_SELECT)
		{
			PokeSearch();
			goto Redraw;
		}
	}
	FadeOut();
	vwNormalLUT();
	ClearOamBak();
	ResetBackgrounds();
}
예제 #17
0
void Limbo(char plr)
{
    int i, AstroList[100], BarA, count, now2, tag = 0;
    memset(AstroList, -1, sizeof AstroList);
    DrawLimbo(plr);
    music_start((plr == 0) ? M_ASTTRNG : M_ASSEMBLY);

    now2 = BarA = count = 0;
    ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);

    for (i = 0; i < Data->P[plr].AstroCount; i++)
        if (Data->P[plr].Pool[i].Status == AST_ST_ACTIVE && Data->P[plr].Pool[i].Assign == 0) {
            AstroList[count++] = i;
        };

    DispLeft(plr, BarA, count, now2, &AstroList[0]);

    if (count > 0) {
        LimboText(plr, AstroList[now2]);
    }

    FadeIn(2, 10, 0, 0);

    while (1) {
        key = 0;
        WaitForMouseUp();
        key = 0;
        GetMouse();

        //Mouse ManSelect from being Clicked on
        for (i = 0; i < 8; i++) {
            if (x >= 27 && y >= (131 + i * 8) && x <= 151 && y <= (137 + i * 8) && mousebuttons > 0 && (now2 - BarA + i) <= (count - 1)) {
                now2 -= BarA;
                now2 += i;
                BarA = i;
                fill_rectangle(26, 129, 153, 195, 0);
                ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);
                DispLeft(plr, BarA, count, now2, &AstroList[0]);
                LimboText(plr, AstroList[now2]);
                WaitForMouseUp();

            }
        }

        // Left Arrow Up
        if ((mousebuttons > 0 && x >= 6 && y >= 130 && x <= 18 && y <= 161 && count > 0) || key == UP_ARROW) {
            InBox(6, 130, 18, 161);

            for (i = 0; i < 50; i++) {
                key = 0;
                GetMouse();
                delay(10);

                if (mousebuttons == 0) {

                    if (BarA == 0 && now2 > 0) {
                        now2--;
                        fill_rectangle(26, 129, 153, 195, 0);
                        ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);
                        DispLeft(plr, BarA, count, now2, &AstroList[0]);
                        LimboText(plr, AstroList[now2]);
                    };

                    if (BarA > 0) {
                        fill_rectangle(26, 129, 153, 195, 0);
                        BarA--;
                        now2--;
                        ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);
                        DispLeft(plr, BarA, count, now2, &AstroList[0]);
                        LimboText(plr, AstroList[now2]);
                    };

                    i = 51;
                }
            }

            while (mousebuttons == 1 || key == UP_ARROW) {
                delay(100);

                if (BarA == 0 && now2 > 0) {
                    now2--;
                    fill_rectangle(26, 129, 153, 195, 0);
                    ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);
                    DispLeft(plr, BarA, count, now2, &AstroList[0]);
                    LimboText(plr, AstroList[now2]);
                };

                if (BarA > 0) {
                    fill_rectangle(26, 129, 153, 195, 0);
                    BarA--;
                    now2--;
                    ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);
                    DispLeft(plr, BarA, count, now2, &AstroList[0]);
                    LimboText(plr, AstroList[now2]);
                };

                key = 0;

                GetMouse();
            }

            //WaitForMouseUp();key=0;
            OutBox(6, 130, 18, 161);
            delay(10);
        };

        // Left Arrow Down
        if ((mousebuttons > 0 && x >= 6 && y >= 163 && x <= 18 && y <= 194 && count > 0) || key == DN_ARROW) {
            InBox(6, 163, 18, 194);

            for (i = 0; i < 50; i++) {
                key = 0;
                GetMouse();
                delay(10);

                if (mousebuttons == 0) {

                    if (BarA == 7 && (now2 < count - 1)) {
                        now2++;
                        fill_rectangle(26, 129, 153, 195, 0);
                        ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);
                        DispLeft(plr, BarA, count, now2, &AstroList[0]);
                        LimboText(plr, AstroList[now2]);
                    };

                    if (BarA < 7 && now2 < count - 1) {
                        fill_rectangle(26, 129, 153, 195, 0);
                        BarA++;
                        now2++;
                        ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);
                        DispLeft(plr, BarA, count, now2, &AstroList[0]);
                        LimboText(plr, AstroList[now2]);
                    };

                    i = 51;
                }
            }

            while (mousebuttons == 1 || key == DN_ARROW) {
                delay(100);

                if (BarA == 7 && (now2 < count - 1)) {
                    now2++;
                    fill_rectangle(26, 129, 153, 195, 0);
                    ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);
                    DispLeft(plr, BarA, count, now2, &AstroList[0]);
                    LimboText(plr, AstroList[now2]);
                };

                if (BarA < 7 && now2 < count - 1) {
                    fill_rectangle(26, 129, 153, 195, 0);
                    BarA++;
                    now2++;
                    ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);
                    DispLeft(plr, BarA, count, now2, &AstroList[0]);
                    LimboText(plr, AstroList[now2]);
                };

                key = 0;

                GetMouse();
            }

            //key=0;WaitForMouseUp();key=0;
            OutBox(6, 163, 18, 194);
            delay(10);
        };

        // Continue
        if ((mousebuttons > 0 && x >= 245 && y >= 5 && x <= 314 && y <= 17) || key == K_ENTER) {
            InBox(245, 5, 314, 17);
            WaitForMouseUp();

            if (key > 0) {
                delay(150);
            }

            OutBox(245, 5, 314, 17);
            music_stop();
            return;
        }

        // Select Transfer Button
        if ((mousebuttons > 0 && x >= 167 && y >= 48 && x <= 239 && y <= 65) || key == LT_ARROW) {
            tag = 0;
            InBox(167, 48, 239, 65);
            OutBox(241, 48, 313, 65);
            fill_rectangle(166, 78, 314, 88, 10);
            display::graphics.setForegroundColor(11);
            draw_string(185, 85, "TRANSFER TO LOCATION");

        }

        // Select Visit To Button
        if ((mousebuttons > 0 && x >= 241 && y >= 48 && x <= 313 && y <= 65) || key == RT_ARROW) {
            tag = 1;
            InBox(241, 48, 313, 65);
            OutBox(167, 48, 239, 65);
            fill_rectangle(166, 78, 314, 88, 10);
            display::graphics.setForegroundColor(11);
            draw_string(203, 85, "VISIT LOCATION");

        }

        // Selection Loops
        for (i = 0; i < 5; i++) {
            // Program Transfer
            if ((tag == 0 && Data->P[plr].Manned[i].Num >= 0) &&
                ((mousebuttons > 0 && x >= 167 && y >= (95 + 21 * i) && x <= 236 && y <= (109 + 21 * i))
                 || key == 0x0030 + i)) {
                InBox(167, 95 + 21 * i, 236, 109 + 21 * i);

                if (key > 0) {
                    delay(140);
                }

                WaitForMouseUp();
                key = 0;
                OutBox(167, 95 + 21 * i, 236, 109 + 21 * i);
                Data->P[plr].Pool[AstroList[now2]].Assign = i + 1;
                Data->P[plr].Pool[AstroList[now2]].Unassigned = 0;
                Data->P[plr].Pool[AstroList[now2]].Moved = 0;

                for (i = now2; i < count; i++) {
                    AstroList[i] = AstroList[i + 1];
                }

                AstroList[i] = -1;
                count--;

                if (count == 0) {
                    fill_rectangle(10, 52, 89, 101, 7 + plr * 3);
                    Clear();
                }

                if (now2 == count) {
                    if (now2 > 0) {
                        now2--;
                    }

                    if (BarA > 0) {
                        BarA--;
                    }
                };

                fill_rectangle(26, 129, 153, 195, 0);

                ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);

                DispLeft(plr, BarA, count, now2, &AstroList[0]);

                if (count > 0) {
                    LimboText(plr, AstroList[now2]);
                }

            }

            // Program Visit
            if ((tag == 1 && Data->P[plr].Manned[i].Num >= 0) &&
                ((mousebuttons > 0 && x >= 167 && y >= (95 + 21 * i) && x <= 236 && y <= (109 + 21 * i))
                 || key == 0x0030 + i)) {
                InBox(167, 95 + 21 * i, 236, 109 + 21 * i);

                if (key > 0) {
                    delay(140);
                }

                WaitForMouseUp();
                key = 0;
                OutBox(167, 95 + 21 * i, 236, 109 + 21 * i);
                music_stop();
                Programs(plr, i + 1);
                DrawLimbo(plr);
                music_start((plr == 0) ? M_ASTTRNG : M_ASSEMBLY);

                InBox(241, 48, 313, 65);
                OutBox(167, 48, 239, 65);
                fill_rectangle(166, 78, 314, 88, 10);
                display::graphics.setForegroundColor(11);
                draw_string(203, 85, "VISIT LOCATION");
                fill_rectangle(26, 129, 153, 195, 0);
                now2 = BarA = count = 0;
                ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);

                for (i = 0; i < Data->P[plr].AstroCount; i++)
                    if (Data->P[plr].Pool[i].Status == AST_ST_ACTIVE && Data->P[plr].Pool[i].Assign == 0) {
                        AstroList[count++] = i;
                    }

                DispLeft(plr, BarA, count, now2, &AstroList[0]);

                if (count > 0) {
                    LimboText(plr, AstroList[now2]);
                }

                //   ShBox(26,130+BarA*8,152,138+BarA*8);
                //   DispLeft(plr,BarA,count,now2,&AstroList[0]);
                //   LimboText(plr,AstroList[now2]);
                FadeIn(2, 10, 0, 0);

            }


            // Training Transfer
            if ((tag == 0 && count > 0) && ((mousebuttons > 0 && x >= 244 && y >= (95 + 21 * i) && x <= 313 && y <= (109 + 21 * i)) || key == 0x0035 + i)) {
                InBox(244, 95 + 21 * i, 313, 109 + 21 * i);

                if (key > 0) {
                    delay(140);
                }

                WaitForMouseUp();
                key = 0;
                OutBox(244, 95 + 21 * i, 313, 109 + 21 * i);

                skilLev = 0; // Figure out relevant skill level bfr sending to Adv Training -Leon

                if (i == 0) {
                    skilLev = Data->P[plr].Pool[AstroList[now2]].Cap;
                }

                if (i == 1) {
                    skilLev = Data->P[plr].Pool[AstroList[now2]].LM;
                }

                if (i == 2) {
                    skilLev = Data->P[plr].Pool[AstroList[now2]].EVA;
                }

                if (i == 3) {
                    skilLev = Data->P[plr].Pool[AstroList[now2]].Docking;
                }

                if (i == 4) {
                    skilLev = Data->P[plr].Pool[AstroList[now2]].Endurance;
                }

                display::graphics.setForegroundColor(2);

                if (Data->P[plr].Pool[AstroList[now2]].TrainingLevel > 6) {
                    Help("i120");
                } else if (skilLev > 3) {
                    OutBox(244, 95 + 21 * i, 313, 109 + 21 * i); // If they have a 4 in that skill, don't send to Adv Training for it
                } else if (Data->P[plr].Cash < 3) {
                    Help("i121");
                } else {
                    if (skilLev > 2) { // If they have a 3 in that skill, send them directly to Adv III and charge just 2MB
                        Data->P[plr].Pool[AstroList[now2]].Status = AST_ST_TRAIN_ADV_3;
                        Data->P[plr].Cash -= 2;
                    } else {
                        Data->P[plr].Pool[AstroList[now2]].Status = AST_ST_TRAIN_ADV_1;
                        Data->P[plr].Cash -= 3;
                    }

                    Data->P[plr].Pool[AstroList[now2]].Focus = i + 1;
                    Data->P[plr].Pool[AstroList[now2]].Assign = 0;
                    Data->P[plr].Pool[AstroList[now2]].Unassigned = 0;
                    Data->P[plr].Pool[AstroList[now2]].Moved = 0;

                    for (i = now2; i < count; i++) {
                        AstroList[i] = AstroList[i + 1];
                    }

                    AstroList[i] = -1;
                    count--;

                    if (count == 0) {
                        fill_rectangle(10, 52, 89, 101, 7 + plr * 3);
                        Clear();
                    }

                    if (now2 == count) {
                        if (now2 > 0) {
                            now2--;
                        }

                        if (BarA > 0) {
                            BarA--;
                        }
                    };

                    fill_rectangle(26, 129, 153, 195, 0);

                    ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);

                    DispLeft(plr, BarA, count, now2, &AstroList[0]);

                    if (count > 0) {
                        LimboText(plr, AstroList[now2]);
                    }
                } // else
            }  // if adv training

            // Training Visit
            if (tag == 1 &&
                ((mousebuttons > 0 && x >= 244 && y >= (95 + 21 * i) && x <= 313 && y <= (109 + 21 * i)) || key == 0x0035 + i)) {
                InBox(244, 95 + 21 * i, 313, 109 + 21 * i);

                if (key > 0) {
                    delay(140);
                }

                WaitForMouseUp();
                key = 0;
                OutBox(244, 95 + 21 * i, 313, 109 + 21 * i);
                music_stop();
                Train(plr, i + 1);
                DrawLimbo(plr);
                music_start((plr == 0) ? M_ASTTRNG : M_ASSEMBLY);

                fill_rectangle(166, 78, 314, 88, 10);
                display::graphics.setForegroundColor(11);
                draw_string(203, 85, "VISIT LOCATION");
                InBox(241, 48, 313, 65);
                OutBox(167, 48, 239, 65);
                fill_rectangle(26, 129, 153, 195, 0);
                now2 = BarA = count = 0;
                ShBox(26, 130 + BarA * 8, 152, 138 + BarA * 8);

                for (i = 0; i < Data->P[plr].AstroCount; i++)
                    if (Data->P[plr].Pool[i].Status == AST_ST_ACTIVE && Data->P[plr].Pool[i].Assign == 0) {
                        AstroList[count++] = i;
                    }

                DispLeft(plr, BarA, count, now2, &AstroList[0]);

                if (count > 0) {
                    LimboText(plr, AstroList[now2]);
                }

                FadeIn(2, 10, 0, 0);

            }
        }

    };  /* end while */
} /* end Limbo */
void DrawFuture(char plr,int mis,char pad)
{
  int i,j;
  FILE *fin;
  unsigned sz;
  strcpy(IKEY,"k011");strcpy(IDT,"i011");
  
  JointFlag=0; // initialize joint flag
  F1=F2=F3=F4=FMen=F5=0;
  for (i=0;i<5;i++) lck[i]=status[i]=0;
  FadeOut(2,pal,10,0,0);
  Load_FUT_BUT();
  fin=sOpen("FMIN.IMG","rb",0);
  fread(&pal[0],768,1,fin);
  sz=fread(screen,1,MAX_X*MAX_Y,fin);
  fclose(fin);
  RLED_img((char *)screen,(char *)vhptr.vptr,sz,vhptr.w,vhptr.h);
  gxClearDisplay(0,0);

  gr_sync ();

    if (pad==2) JointFlag=0; // third pad automatic no joint mission
    else
      if (Data->P[plr].LaunchFacility[pad+1] == 1)
      {
       if (Data->P[plr].Future[pad+1].MissionCode==0) JointFlag=1; // if no mission then set joint flag
	  else if (Data->P[plr].Future[pad+1].part==1) // check if the part of that second mission is set
		 {
		  JointFlag=1;
		  Data->P[plr].Future[pad+1].MissionCode=0; // clear mission
		  Data->P[plr].Future[pad+1].part=0;
		 };
      };

  if (pad==1 || pad==0) {
    if (Data->P[plr].LaunchFacility[pad+1]==1) JointFlag=1;
  }

  i=Data->Year;j=Data->Season;
  TRACE3("--- Setting i=Year (%d), j=Season (%d)", i, j);
  if ((i==60 && j==0) || (i==62 && j==0) || (i==64 && j==0) ||
      (i==66 && j==0) || (i==69 && j==1) || (i==71 && j==1) ||
      (i==73 && j==1)) {

     gxVirtualVirtual(&vhptr,1,2,12,11,&vhptr,198,153,gxSET); /* Mars */
     MarFlag=1; } else MarFlag=0;
  if ((i==60 || i==64 || i==68 || i==72 || i==73 || i==77)) {
    gxVirtualVirtual(&vhptr,14,2,64,54,&vhptr,214,130,gxSET); /* Jup */
    JupFlag=1; } else JupFlag=0;
  if (i==61 || i==66 || i==72) {
    gxVirtualVirtual(&vhptr,66,2,114,53,&vhptr,266,135,gxSET); /* Sat */
    SatFlag=1; } else SatFlag=0;

  RectFill(1,1,318,21,3);RectFill(317,22,318,198,3);RectFill(1,197,316,198,3);
  RectFill(1,22,2,196,3);OutBox(0,0,319,199);InBox(3,3,30,19);
  InBox(3,22,316,196);
  IOBox(242,3,315,19);
  ShBox(5,24,183,47);
  ShBox(5,24,201,47); //name box
  ShBox(5,74,41,82); // RESET
  ShBox(5,49,53,72); //dur/man
  ShBox(43,74,53,82); // lock
  ShBox(80,74,90,82);
  ShBox(117,74,127,82);
  ShBox(154,74,164,82);
  ShBox(191,74,201,82);
  ShBox(5,84,16,130);   //arrows up
  ShBox(5,132,16,146); //middle box
  ShBox(5,148,16,194);   //    down
  ShBox(203,24,238,31);  // new right boxes
  RectFill(206,36,235,44,7);
  ShBox(203,33,238,47);
  InBox(205,35,236,45);
  UPArrow(8,95);DNArrow(8,157);
  
  gxVirtualDisplay(&vh,140,5,5,132,15,146,0);
  Toggle(5,1);draw_Pie(0);OutBox(5,49,53,72);
  Toggle(1,1);TogBox(55,49,0);
  Toggle(2,1);TogBox(92,49,0);
  Toggle(3,1);TogBox(129,49,0);

  FMen=F1=F2=F3=F4=F5=0;
  for (i=1;i<4;i++){
    if (status[i]!=0) {
      Toggle(i,1);
    }
  };
	 if (JointFlag==0) {
      F4=2;lck[4]=1;
      Toggle(4,1);
      InBox(191,74,201,82);
      PlaceRX(5);
      TogBox(166,49,1);
    }
	 else {
      F4=0; lck[4]=0;
      status[4]=0;
      Toggle(4,1);
      OutBox(191,74,201,82);
      ClearRX(5);
      TogBox(166,49,0);
    };

  gr_sync ();
  Missions(plr,8,37,mis,1);
  GetMinus(plr);
  grSetColor(5);
  /* lines of text are 1:8,30  2:8,37   3:8,44    */
  switch(pad) { // These used to say Pad 1, 2, 3  -Leon
    case 0: PrintAt(8,30,"PAD A:");break;
    case 1: PrintAt(8,30,"PAD B:");break;
    case 2: PrintAt(8,30,"PAD C:");break;
    default:break;
  };
  grSetColor(1);
  PrintAt(9,80,"RESET");
  PrintAt(256,13,"CONTINUE");
  grSetColor(11);
   if (Data->Season==0) PrintAt(200,9,"SPRING");
   else PrintAt(205,9,"FALL");
   PrintAt(206,16,"19");
   DispNum(0,0,Data->Year);
  grSetColor(1);
  FlagSm(plr,4,4);
  DispBig(40,5,"FUTURE MISSIONS",0,-1);
  FadeIn(2,pal,10,0,0);
  
  return;
}
예제 #19
0
void PadDraw(char plr, char pad)
{
    int i, j, k, l;
    int missions;     // Variable for how many missions each 'naut has flown

    FadeOut(2, 10, 0, 0);
    display::graphics.screen()->clear();
    ShBox(0, 0, 319, 22);
    ShBox(0, 24, 319, 198);
    InBox(3, 3, 30, 19);
    IOBox(243, 3, 316, 19);
    InBox(167, 27, 316, 176);
    fill_rectangle(168, 28, 315, 175, 0);
    IOBox(167, 179, 316, 195);
    ShBox(4, 28, 162, 43);
    InBox(6, 30, 160, 41);
    ShBox(4, 46, 162, 61);
    InBox(6, 48, 160, 59);
    ShBox(4, 68, 162, 97);
    InBox(6, 70, 160, 95);
    ShBox(56, 64, 110, 74);
    InBox(57, 65, 109, 73);
    ShBox(4, 180, 162, 195);
    InBox(6, 182, 160, 193); //sched. duration
    InBox(6, 99, 160, 178);
    display::graphics.setForegroundColor(9);
    draw_string(18, 190, "SCHEDULED DURATION: ");
    display::graphics.setForegroundColor(7);
    int MisCod;
    MisCod = Data->P[plr].Mission[pad].MissionCode;

    if ((MisCod > 24 && MisCod < 37) || MisCod == 40 || MisCod == 41 || MisCod == 43 || MisCod == 44 || MisCod > 45)
        // Show Duration level for manned missions with Duration steps (this keeps the Mission[pad].Duration
        // variable from continuing to show Duration level if mission is scrubbed or downgraded) - Leon
    {
        switch (Data->P[plr].Mission[pad].Duration) {
        case 1:
            draw_string(0, 0, "A");
            break;

        case 2:
            draw_string(0, 0, "B");
            break;

        case 3:
            draw_string(0, 0, "C");
            break;

        case 4:
            draw_string(0, 0, "D");
            break;

        case 5:
            draw_string(0, 0, "E");
            break;

        case 6:
            draw_string(0, 0, "F");
            break;

        default:
            draw_string(0, 0, "NONE");
            break;
        }
    } else {
        if (Data->P[plr].Mission[pad].PCrew - 1 >= 0 || Data->P[plr].Mission[pad].BCrew - 1 >= 0) {
            draw_string(0, 0, "A");
        } else {
            draw_string(0, 0, "NONE");
        }
    }

    display::graphics.setForegroundColor(7);
    draw_string(65, 71, "MISSION");
    draw_small_flag(plr, 4, 4);

    if (Data->P[plr].LaunchFacility[pad] == 1 && Data->P[plr].Mission[pad].MissionCode) {
        PadPict(2 + plr);
    } else if (Data->P[plr].LaunchFacility[pad] == 1 && Data->P[plr].Mission[pad].MissionCode == Mission_None) {
        PadPict(4 + plr);
    } else if (Data->P[plr].LaunchFacility[pad] > 1) {
        PadPict(0 + plr);
    }

    display::graphics.setForegroundColor(1);
    draw_string(15, 37, "STATUS: ");
    display::graphics.setForegroundColor(9);

    if (Data->P[plr].LaunchFacility[pad] == 1) {
        draw_string(0, 0, "OPERATIONAL");
    } else {
        draw_string(0, 0, "DESTROYED");
    }

    display::graphics.setForegroundColor(1);

    if (Data->P[plr].LaunchFacility[pad] > 1) {
        draw_string(15, 56, "REPAIR COST: ");
        display::graphics.setForegroundColor(9);
        draw_number(0, 0, Data->P[plr].LaunchFacility[pad]);
        draw_string(0, 0, "MB");

        if (Data->P[plr].Cash < Data->P[plr].LaunchFacility[pad]) {
            InBox(169, 181, 314, 193);
        }
    } else {
        display::graphics.setForegroundColor(9);

        if (Data->P[plr].Mission[pad].MissionCode == Mission_None) {
            draw_string(15, 56, "NO LAUNCH SCHEDULED");
            InBox(169, 181, 314, 193);
        } else {
            draw_string(15, 56, "PRE-MISSION CHECK");
        }
    }

    display::graphics.setForegroundColor(1);
    draw_string(258, 13, "CONTINUE");

    if (Data->P[plr].LaunchFacility[pad] == 1) {
        display::graphics.setForegroundColor(9);
        draw_string(210, 189, "S");
        display::graphics.setForegroundColor(1);
        draw_string(0, 0, "CRUB MISSION");
    } else {
        display::graphics.setForegroundColor(9);
        draw_string(205, 189, "F");
        display::graphics.setForegroundColor(1);
        draw_string(0, 0, "IX LAUNCH PAD");
    }

    draw_heading(37, 5, "LAUNCH FACILITY", 0, -1);

    switch (pad) {
    case 0:
        draw_heading(201, 5, "A", 0, -1);
        break;

    case 1:
        draw_heading(201, 5, "B", 0, -1);
        break;

    case 2:
        draw_heading(201, 5, "C", 0, -1);
        break;
    }

    display::graphics.setForegroundColor(6);
    MissionName(Data->P[plr].Mission[pad].MissionCode, 11, 81, 20);
    display::graphics.setForegroundColor(1);

    // joint mission part
    if (Data->P[plr].Mission[pad].Joint == 1) {
        ShBox(38, 91, 131, 101);
        InBox(39, 92, 130, 100);
        display::graphics.setForegroundColor(1);

        if (Data->P[plr].Mission[pad].part == 0) {
            draw_string(53, 98, "PRIMARY PART");
        } else {
            draw_string(44, 98, "SECONDARY PART");
        }
    }

    // Hardware to Use

    i = Data->P[plr].Mission[pad].Prog;
    j = Data->P[plr].Mission[pad].PCrew - 1;
    l = Data->P[plr].Mission[pad].BCrew - 1;

    // Crews
    display::graphics.setForegroundColor(7);
    draw_string(13, 107, "PRIMARY CREW  ");

    if (j >= 0) {
        display::graphics.setForegroundColor(11); // Now display the crew number, for player's easy reference - Leon

        if (j == 0) {
            draw_string(0, 0, "(CREW I)");
        }

        if (j == 1) {
            draw_string(0, 0, "(CREW II)");
        }

        if (j == 2) {
            draw_string(0, 0, "(CREW III)");
        }

        if (j == 3) {
            draw_string(0, 0, "(CREW IV)");
        }

        if (j == 4) {
            draw_string(0, 0, "(CREW V)");
        }

        if (j == 5) {
            draw_string(0, 0, "(CREW VI)");
        }

        if (j == 6) {
            draw_string(0, 0, "(CREW VII)");
        }

        if (j == 7) {
            draw_string(0, 0, "(CREW VIII)");
        }

        for (k = 0; k < Data->P[plr].CrewCount[i][j]; k++) {
            // Draw a morale box for each crew member - Leon
            display::graphics.setForegroundColor(1);
            fill_rectangle(13, 110 + 7 * k, 20, 110 + 7 * k, 2); // Top
            fill_rectangle(13, 110 + 7 * k, 13, 116 + 7 * k, 2); // Left
            fill_rectangle(13, 116 + 7 * k, 20, 116 + 7 * k, 4); // Bottom
            fill_rectangle(21, 110 + 7 * k, 21, 116 + 7 * k, 4); // Right

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood >= 65) {
                fill_rectangle(14, 111 + 7 * k, 20, 115 + 7 * k, 16);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood < 65 && Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood >= 40) {
                fill_rectangle(14, 111 + 7 * k, 20, 115 + 7 * k, 11);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood < 40 && Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood >= 20) {
                fill_rectangle(14, 111 + 7 * k, 20, 115 + 7 * k, 8);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood < 20) {
                fill_rectangle(14, 111 + 7 * k, 20, 115 + 7 * k, 0);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Mood == 0) {
                fill_rectangle(14, 111 + 7 * k, 20, 115 + 7 * k, 3);
            }

            display::graphics.setForegroundColor(1);

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Sex == 1) {
                display::graphics.setForegroundColor(5);    // Show female 'nauts in blue
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].RetirementDelay > 0) {
                display::graphics.setForegroundColor(0);    // Show anyone who's announced retirement in black
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Sex == 1 && Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].RetirementDelay > 0) {
                display::graphics.setForegroundColor(7);
            }

            // Show name in purple if 'naut is female AND has announced retirement
            draw_string(25, 115 + 7 * k, &Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Name[0]);
            missions = Data->P[plr].Pool[Data->P[plr].Crew[i][j][k] - 1].Missions;

            if (missions > 0) {
                draw_string(0, 0, " (");
                draw_number(0, 0, missions);
                draw_string(0, 0, ")");
            }
        }

        if (l == -1) {
            draw_string(25, 174, "UNAVAILABLE");
        }
    }

    display::graphics.setForegroundColor(7);
    draw_string(13, 145, "BACKUP CREW  ");

    if (l >= 0) {
        display::graphics.setForegroundColor(11); // Now display the crew number, for player's easy reference - Leon

        if (l == 0) {
            draw_string(0, 0, "(CREW I)");
        }

        if (l == 1) {
            draw_string(0, 0, "(CREW II)");
        }

        if (l == 2) {
            draw_string(0, 0, "(CREW III)");
        }

        if (l == 3) {
            draw_string(0, 0, "(CREW IV)");
        }

        if (l == 4) {
            draw_string(0, 0, "(CREW V)");
        }

        if (l == 5) {
            draw_string(0, 0, "(CREW VI)");
        }

        if (l == 6) {
            draw_string(0, 0, "(CREW VII)");
        }

        if (l == 7) {
            draw_string(0, 0, "(CREW VIII)");
        }

        for (k = 0; k < Data->P[plr].CrewCount[i][l]; k++) {
            // Draw a morale box for each crew member - Leon
            display::graphics.setForegroundColor(1);
            fill_rectangle(13, 148 + 7 * k, 20, 148 + 7 * k, 2); // Top
            fill_rectangle(13, 148 + 7 * k, 13, 154 + 7 * k, 2); // Left
            fill_rectangle(13, 154 + 7 * k, 20, 154 + 7 * k, 4); // Bottom
            fill_rectangle(21, 148 + 7 * k, 21, 154 + 7 * k, 4); // Right

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood >= 65) {
                fill_rectangle(14, 149 + 7 * k, 20, 153 + 7 * k, 16);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood < 65 && Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood >= 40) {
                fill_rectangle(14, 149 + 7 * k, 20, 153 + 7 * k, 11);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood < 40 && Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood >= 20) {
                fill_rectangle(14, 149 + 7 * k, 20, 153 + 7 * k, 8);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood < 20) {
                fill_rectangle(14, 149 + 7 * k, 20, 153 + 7 * k, 0);
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Mood == 0) {
                fill_rectangle(14, 149 + 7 * k, 20, 153 + 7 * k, 3);
            }

            display::graphics.setForegroundColor(1);

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Sex == 1) {
                display::graphics.setForegroundColor(5);    // Show female 'nauts in blue
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].RetirementDelay > 0) {
                display::graphics.setForegroundColor(0);    // But show anyone who's announced retirement in black
            }

            if (Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Sex == 1 && Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].RetirementDelay > 0) {
                display::graphics.setForegroundColor(7);
            }

            // Show name in purple if 'naut is female AND has announced retirement
            draw_string(25, 153 + 7 * k, &Data->P[plr].Pool[Data->P[plr].Crew[i][l][k] - 1].Name[0]);
        }

        if (j == -1) {
            draw_string(25, 136, "UNAVAILABLE");
        }
    }

    if (Data->P[plr].Mission[pad].Prog > 0)
        PatchMe(plr, 126, 40, Data->P[plr].Mission[pad].Prog - 1,
                Data->P[plr].Mission[pad].Patch, 32);

    FadeIn(2, 10, 0, 0);

    return;
}
예제 #20
0
void ShowAstrosHist(char plr)
{
    char pos = 0, pos2 = 0, glorf = 0;
    vhptr2 = new display::Surface(112, 55);
    abuf = (struct Astros *) buffer;

    if (Data->P[plr].AstroCount == 0) {
        return;
    }

    memcpy(abuf, Data->P[plr].Pool, sizeof(Data->P[plr].Pool));
    qsort((void *)abuf, Data->P[plr].AstroCount, sizeof(struct Astros), astcomp);

    FadeOut(2, display::graphics.palette(), 5, 0, 0);
    fill_rectangle(1, 39, 157, 184, 3);
    draw_heading(68, 71, "NO", 0, -1);
    draw_heading(46, 90, "MISSION", 0, -1);
    draw_heading(27, 109, "EXPERIENCE", 0, -1);
    vhptr2->copyFrom(display::graphics.screen(), 22, 69, 133, 123);
    PatchMe(0, 0, 0, 0, 0, 32);
    display::graphics.screen()->clear(0);

    ORBox(0, 0, 319, 22, 3); // Draw Inbox around top

    if (plr == 0) {
        draw_heading(45, 4, "ASTRONAUT HISTORY", 0, -1);
    } else {
        draw_heading(45, 4, "COSMONAUT HISTORY", 0, -1);
    }

    IRBox(243, 3, 316, 19, 0); // Inbox around cont box
    ORBox(245, 5, 314, 17, 3); // box for cont box
    InBox(3, 3, 31, 19); // USA inbox

    if (plr == 0) {
        draw_small_flag(0, 4, 4);
    } else {
        draw_small_flag(1, 4, 4);
    }

    display::graphics.setForegroundColor(1);
    draw_string(257, 13, "CONTINUE");
    ShBox(0, 24, 158, 199);
    ShBox(161, 24, 319, 199);
    InBox(233, 29, 314, 80);
    InBox(287, 104, 309, 134);
    IRBox(165, 175, 315, 196, 0);
    IRBox(6, 185, 153, 197, 0);
    ORBox(8, 187, 151, 195, 3);
    IRBox(6, 26, 153, 38, 0);
    ORBox(8, 28, 151, 36, 3);
    display::graphics.setForegroundColor(11);
    draw_string(165, 32, "NAME:");
    draw_string(165, 60, "TENURE:");
    draw_string(165, 78, "MISSIONS: ");
    draw_string(165, 89, "PRESTIGE: ");
    draw_string(165, 99, "SKILLS:");
    draw_string(165, 149, "SPACE DURATION:");
    draw_string(165, 159, "LOCATION: ");
    display::graphics.setForegroundColor(6);
    draw_string(174, 107, "CAPSULE PILOT: ");
    draw_string(174, 115, "L.M. PILOT: ");
    draw_string(174, 123, "E.V.A.: ");
    draw_string(174, 131, "DOCKING: ");
    draw_string(174, 139, "ENDURANCE: ");
    ORBox(167, 177, 202, 194, 3);
    ORBox(204, 177, 239, 194, 3);
    ORBox(241, 177, 276, 194, 3);
    ORBox(278, 177, 313, 194, 3);

    Display_ARROW(0, 179, 179); //left
    Display_ARROW(1, 213, 179); //left arrow
    Display_ARROW(2, 250, 179); //right
    Display_ARROW(3, 290, 179); //right arrow
    display::graphics.setForegroundColor(11);
    draw_string(37, 34, "PREVIOUS MISSION");
    draw_string(47, 193, "NEXT MISSION");
    DisplAst(plr, &pos, &pos2);
    DisplAstData(plr, &pos, &pos2);
    FadeIn(2, display::graphics.palette(), 5, 0, 0);

    WaitForMouseUp();

    while (1) {
        GetMouse();

        // Parse Button actions, note that continue button is not a macro
        if ((x >= 245 && y >= 5 && x <= 314 && y <= 17 && mousebuttons > 0) || key == K_ENTER) {
            InBox(245, 5, 314, 17);

            if (key > 0) {
                delay(300);
                key = 0;
            };

            WaitForMouseUp();

            OutBox(245, 5, 314, 17);

            delete vhptr2;

            vhptr2 = NULL;

            key = 0;

            return;
        }

        pButton(8, 187, 151, 195, UpAstroData(plr, &pos, &pos2), key >> 8, 80);
        pButton(8, 28, 151, 36, DownAstroData(plr, &pos, &pos2), key >> 8, 72);
        pButton(167, 177, 202, 194, ShowAstroBack(plr, &pos, &pos2), key >> 8, 71); //Down to prev Astro
        pButton(204, 177, 239, 194, ShowAstroDown(plr, &pos, &pos2), key >> 8, 75);
        pButton(241, 177, 276, 194, ShowAstroUp(plr, &pos, &pos2), key >> 8, 77);
        pButton(278, 177, 313, 194, ShowAstroFor(plr, &pos, &pos2), key >> 8, 79);

        if (key >= 'A' && key <= 'Z') {
            glorf = 0;

            while (abuf[glorf].Name[0] < key && glorf < Data->P[plr].AstroCount - 1) {
                glorf++;
            }

            pos = glorf;
            DisplAst(plr, &pos, &pos2);
            key = 0;
        }

        key = 0;
    };
}
예제 #21
0
void ShowSpHist(char plr)
{
    int pos;

    FadeOut(2, display::graphics.palette(), 5, 0, 0);
    PatchMe(0, 0, 0, 0, 0, 32);
    display::graphics.screen()->clear(0);

    if ((Data->Year == 57 && Data->Season == 0) || Data->P[plr].PastMissionCount == 0) {
        pos = (Data->Year - 57) * 2 + Data->Season;
    } else pos = (Data->P[plr].History[Data->P[plr].PastMissionCount - 1].MissionYear - 57) * 2 +
                     ((Data->P[plr].History[Data->P[plr].PastMissionCount - 1].Month <= 5) ? 0 : 1);

    ORBox(0, 0, 319, 22, 3); // Draw Inbox around top
    draw_heading(48, 5, "MISSION HISTORY", 0, -1);
    IOBox(243, 3, 316, 19);
    InBox(3, 3, 31, 19); // USA inbox
    draw_small_flag(plr, 4, 4);
    display::graphics.setForegroundColor(1);
    draw_string(257, 13, "CONTINUE");

    ORBox(0, 24, 319, 199, 3);
    IRBox(4, 28, 315, 170, 0);
    IRBox(4, 174, 315, 195, 0);
    ORBox(7, 176, 49, 193, 3);
    ORBox(51, 176, 93, 193, 3);
    ORBox(95, 176, 224, 193, 3); //draw the boxes under date
    ORBox(226, 176, 268, 193, 3);
    ORBox(270, 176, 312, 193, 3);
    Display_ARROW(0, 23, 178); //left
    Display_ARROW(1, 63, 178); //left arrow
    Display_ARROW(2, 239, 178); //right
    Display_ARROW(3, 285, 178); //right arrow
    DrawMisHist(plr, &pos);
    FadeIn(2, display::graphics.palette(), 5, 0, 0);

    WaitForMouseUp();

    while (1) {
        GetMouse();
        Mission_Data_Buttons(plr, &pos);

        // Parse Button actions, note that return is embedded in first pButton
        if ((x >= 245 && y >= 5 && x <= 314 && y <= 17 && mousebuttons > 0) || key == K_ENTER) {
            InBox(245, 5, 314, 17);

            if (key > 0) {
                delay(300);
                key = 0;
            };

            WaitForMouseUp();

            OutBox(245, 5, 314, 17);

            return;
        }

        pButton(7, 176, 49, 193, FullRewind(plr, &pos), key >> 8, 71); //FullRewind Button etc..
        pButton(51, 176, 93, 193, RewindOne(plr, &pos), key >> 8, 75);
        pButton(226, 176, 268, 193, FastOne(plr, &pos), key >> 8, 77);
        pButton(270, 176, 312, 193, FullFast(plr, &pos), key >> 8, 79);
        key = 0;
    };
}
예제 #22
0
void ShowPrest(char plr)
{
    char pos = -1, pos2 = -1;
    int i, j;

    for (j = 0; j < 2; j++)
        for (i = 0; i < 28; i++) {
            TPoints[j] += (int) Data->Prestige[i].Points[j];
        }


    FadeOut(2, display::graphics.palette(), 5, 0, 0);
    PortPal(plr);
    display::graphics.screen()->clear(0);
    ShBox(0, 0, 319, 22);
    ShBox(0, 24, 319, 199);
    InBox(4, 27, 315, 196);
    fill_rectangle(5, 28, 314, 195, 0);

    //ShBox(6,29,125,101);
    ShBox(6, 29, 56, 101);
    InBox(17, 46, 44, 62);

    InBox(70, 42, 174, 92);

    ShBox(179, 29, 313, 101);
    ShBox(58, 29, 313, 101);

    InBox(70, 42, 174, 92);
    InBox(185, 42, 304, 92);

    //ShBox(136,74,163,90);
    IOBox(243, 3, 316, 19);
    ShBox(6, 104, 313, 194);
    InBox(10, 127, 309, 191);
    fill_rectangle(11, 128, 308, 190, 0);

    ShBox(297, 129, 307, 158);
    ShBox(297, 160, 307, 189); // Arrows

    draw_heading(8, 5, "PRESTIGE SUMMARY", 0, -1);
    draw_heading(14, 109, "EVENTS", 0, -1);
    display::graphics.setForegroundColor(11);
    draw_string(140, 120, "1ST:");
    draw_string(175, 120, "2ND:");
    draw_string(212, 120, "SUBS:");
    draw_string(254, 120, "FAIL:");
    display::graphics.setForegroundColor(1);
    draw_string(257, 13, "CONTINUE");
    draw_string(17, 39, "FIRST:");
    draw_string(19, 81, "DATE:");
    display::graphics.setForegroundColor(11);
    draw_string(71, 37, "# SPACE FIRSTS:");
    draw_string(187, 37, "TOTAL POINTS:");
    display::graphics.setForegroundColor(1);
    display::graphics.setForegroundColor(6);
    draw_string(210, 99, "USA");
    draw_string(90, 99, "USA");
    display::graphics.setForegroundColor(9);
    draw_string(261, 99, "USSR");
    draw_string(135, 99, "USSR");
    draw_up_arrow(299, 131);
    draw_down_arrow(299, 162);
    DPrest(plr, &pos, &pos2);
    FadeIn(2, display::graphics.palette(), 5, 0, 0);

    WaitForMouseUp();

    while (1) {
        GetMouse();

        // Parse Button actions, note that return is embedded in first pButton
        if ((x >= 245 && y >= 5 && x <= 314 && y <= 17 && mousebuttons > 0) || key == K_ENTER) {
            InBox(245, 5, 314, 17);

            if (key > 0) {
                delay(300);
                key = 0;
            };

            WaitForMouseUp();

            OutBox(245, 5, 314, 17);

            key = 0;

            helpText = "i000";

            keyHelpText = "k000";

            return;
        }

        pButton(297, 129, 307, 158, BackOne(plr, &pos, &pos2), key >> 8, 72);
        pButton(297, 160, 307, 189, ForOne(plr, &pos, &pos2), key >> 8, 80);
        Button2(15, 129, 160, 133, Move2(plr, &pos, &pos2, 0), key, 49);
        Button2(15, 136, 160, 140, Move2(plr, &pos, &pos2, 1), key, 50);
        Button2(15, 143, 160, 147, Move2(plr, &pos, &pos2, 2), key, 51);
        Button2(15, 150, 160, 154, Move2(plr, &pos, &pos2, 3), key, 52);
        Button2(15, 157, 160, 161, Move2(plr, &pos, &pos2, 4), key, 53);
        Button2(15, 164, 160, 168, Move2(plr, &pos, &pos2, 5), key, 54);
        Button2(15, 171, 160, 175, Move2(plr, &pos, &pos2, 6), key, 55);
        Button2(15, 178, 160, 182, Move2(plr, &pos, &pos2, 7), key, 56);
        Button2(15, 185, 160, 189, Move2(plr, &pos, &pos2, 8), key, 57);
        key = 0;
    };
}
예제 #23
0
void ImageActor::OnStageConnectionInternal()
{
  FadeIn();

  mImageNext.OnStageConnect();
}
예제 #24
0
void Rush(char plr)
{
    int i, R1, R2, R3, oR1, oR2, oR3, dgflag[3] = {0, 0, 0};
    char pRush = 0;

    R1 = R2 = R3 = oR1 = oR2 = oR3 = 0;
    fCsh = 0;
    DrawRush(plr);
    pRush = (Data->P[plr].Cash >= 3) ? 1 : 0;
    fCsh = Data->P[plr].Cash;
    display::graphics.setForegroundColor(1);
    music_start((plr == 1) ? M_USMIL : M_USSRMIL);
    FadeIn(2, display::graphics.palette(), 10, 0, 0);
    WaitForMouseUp();

    while (1) {
        key = 0;
        GetMouse();

        if (mousebuttons > 0 || key > 0) {
            if (((y >= 32 && y <= 74 && x >= 280 && x <= 312 && mousebuttons > 0) || (key >= '1' && key <= '3'))
                && pRush && Data->P[plr].Mission[0].MissionCode && Data->P[plr].Mission[0].part != 1) { /* L1: Row One */
                // R1=oR1;
                if (((y >= 49 && y <= 57 && mousebuttons > 0) || key == '2') && oR1 != 1 && fCsh < 3) {
                    Help("i117");
                }

                R1 = (((y >= 49 && y <= 57 && mousebuttons > 0) || key == '2') && fCsh >= 3) ? 1 : R1;

                if (((y >= 66 && y <= 74 && mousebuttons > 0) || key == '3') && oR1 != 2 && fCsh < 6) {
                    Help("i117");
                }

                R1 = (((y >= 66 && y <= 74 && mousebuttons > 0) || key == '3') && fCsh >= 6) ? 2 : R1;
                R1 = ((y >= 32 && y <= 40 && mousebuttons > 0) || key == '1') ? 0 : R1;

                if (oR1 != R1) {
                    ResetRush(oR1, 0);
                    SetRush(R1, 0);
                    oR1 = R1;
                }
            } else if (((x >= 280 && x <= 312 && y >= 90 && y <= 132 && mousebuttons > 0) || (key >= '4' && key <= '6'))
                       && pRush && Data->P[plr].Mission[1].MissionCode && Data->P[plr].Mission[1].part != 1) { /* L2: Row One */
                // R2=oR2;
                if (((y >= 107 && y <= 115 && mousebuttons > 0) || key == '5') && oR2 != 1 && fCsh < 3) {
                    Help("i117");
                }

                R2 = (((y >= 107 && y <= 115 && mousebuttons > 0) || key == '5') && fCsh >= 3) ? 1 : R2;

                if (((y >= 124 && y <= 132 && mousebuttons > 0) || key == '6') && oR2 != 2 && fCsh < 6) {
                    Help("i117");
                }

                R2 = (((y >= 124 && y <= 132 && mousebuttons > 0) || key == '6') && fCsh >= 6) ? 2 : R2;
                R2 = ((y >= 90 && y <= 98 && mousebuttons > 0) || key == '4') ? 0 : R2;

                if (oR2 != R2) {
                    ResetRush(oR2, 1);
                    SetRush(R2, 1);
                    oR2 = R2;
                }
            } else if (((x >= 280 && x <= 312 && y >= 148 && y <= 190 && mousebuttons > 0) || (key >= '7' && key <= '9'))
                       && pRush && Data->P[plr].Mission[2].MissionCode && Data->P[plr].Mission[2].part != 1) { /* L3: Row One */
                // R3=oR3;
                if (((y >= 165 && y <= 173 && mousebuttons > 0) || key == '8') && oR3 != 1 && fCsh < 3) {
                    Help("i117");
                }

                R3 = (((y >= 165 && y <= 173 && mousebuttons > 0) || key == '8') && fCsh >= 3) ? 1 : R3;

                if (((y >= 182 && y <= 190 && mousebuttons > 0) || key == '9') && oR3 != 2 && fCsh < 6) {
                    Help("i117");
                }

                R3 = (((y >= 182 && y <= 190 && mousebuttons > 0) || key == '9') && fCsh >= 6) ? 2 : R3;
                R3 = ((y >= 148 && y <= 156 && mousebuttons > 0) || key == '7') ? 0 : R3;

                if (oR3 != R3) {
                    ResetRush(oR3, 2);
                    SetRush(R3, 2);
                    oR3 = R3;
                }
            };

            // DOWNGRADE MISSION KEYBOARD
            if (key == 'Q' || key == 'R' || key == 'U') {
                if (key == 'Q') {
                    i = 0;
                } else if (key == 'R') {
                    i = 1;
                } else if (key == 'U') {
                    i = 2;
                } else {
                    i = 0;
                }

                if (Data->P[plr].Mission[i].MissionCode && Data->P[plr].Mission[i].part != 1) {

                    InBox(91, 41 + i * 58, 264, 59 + i * 58);
                    fill_rectangle(144, 29 + i * 58, 270, 37 + i * 58, 3);

                    if (dg[Data->P[plr].Mission[i].MissionCode][dgflag[i]] != 0) {
                        fill_rectangle(93, 43 + i * 58, 262, 57 + i * 58, 3);

                        display::graphics.setForegroundColor(5);
                        GetMisType(dg[Data->P[plr].Mission[i].MissionCode][dgflag[i]]);

                        draw_string(96, 48 + 58 * i, Mis.Abbr);

                        if (Mis.Dur >= 1) {
                            switch (Data->P[plr].Mission[i].Duration) {
                            case 1:
                                draw_string(0, 0, "");
                                break;

                            case 2:
                                draw_string(0, 0, " (B)");
                                break;

                            case 3:
                                draw_string(0, 0, " (C)");
                                break;

                            case 4:
                                draw_string(0, 0, " (D)");
                                break;

                            case 5:
                                draw_string(0, 0, " (E)");
                                break;

                            case 6:
                                draw_string(0, 0, " (F)");
                                break;

                            default:
                                draw_string(0, 0, "");
                                break;
                            }
                        }

                        //Missions(plr,96,48+58*i,dg[Data->P[plr].Mission[i].MissionCode][dgflag[i]],0);

                        dgflag[i]++;
                        fill_rectangle(191, 71 + i * 58, 270, 78 + i * 58, 3);
                        display::graphics.setForegroundColor(9);
                        draw_string(145, 33 + i * 58, "DOWNGRADED MISSION");
                        draw_string(193, 77 + i * 58, "-3 PRESTIGE");
                    } else {
                        dgflag[i] = 0;
                        fill_rectangle(93, 43 + i * 58, 262, 57 + i * 58, 3);
                        display::graphics.setForegroundColor(5);
                        GetMisType(Data->P[plr].Mission[i].MissionCode);

                        draw_string(96, 48 + 58 * i, Mis.Abbr);

                        if (Mis.Dur >= 1) {
                            switch (Data->P[plr].Mission[i].Duration) {
                            case 1:
                                draw_string(0, 0, "");
                                break;

                            case 2:
                                draw_string(0, 0, " (B)");
                                break;

                            case 3:
                                draw_string(0, 0, " (C)");
                                break;

                            case 4:
                                draw_string(0, 0, " (D)");
                                break;

                            case 5:
                                draw_string(0, 0, " (E)");
                                break;

                            case 6:
                                draw_string(0, 0, " (F)");
                                break;

                            default:
                                draw_string(0, 0, "");
                                break;
                            }
                        }

                        //Missions(plr,96,48+58*i,Data->P[plr].Mission[i].MissionCode,0);
                        fill_rectangle(191, 71 + i * 58, 270, 78 + i * 58, 3);

                        if (Data->P[plr].Mission[i].Name[24] == 1) {
                            display::graphics.setForegroundColor(9);
                            draw_string(145, 33 + i * 58, "DOWNGRADED MISSION");
                            draw_string(193, 77 + i * 58, "-3 PRESTIGE");
                        } else {
                            display::graphics.setForegroundColor(7);
                            draw_string(145, 33 + i * 58, "ORIGINAL MISSION");
                            draw_string(193, 77 + i * 58, "NO PENALTY");
                        }

                        //display::graphics.setForegroundColor(7);
                        //draw_string(145,33+i*58,"ORIGINAL MISSION");
                        //draw_string(193,77+i*58,"NO PENALTY");
                    }

                    WaitForMouseUp();
                    OutBox(91, 41 + i * 58, 264, 59 + i * 58);

                }
            };

            for (i = 0; i < 3; i++) {
                if (x >= 91 && x <= 264 && y >= 41 + i * 59 && y <= 59 + i * 59 && mousebuttons > 0
                    && Data->P[plr].Mission[i].MissionCode
                    && Data->P[plr].Mission[i].part != 1) { // Downgrade

                    InBox(91, 41 + i * 58, 264, 59 + i * 58);
                    fill_rectangle(144, 29 + i * 58, 270, 37 + i * 58, 3);

                    if (dg[Data->P[plr].Mission[i].MissionCode][dgflag[i]] != 0) {
                        fill_rectangle(93, 43 + i * 58, 262, 57 + i * 58, 3);
                        display::graphics.setForegroundColor(5);
                        GetMisType(dg[Data->P[plr].Mission[i].MissionCode][dgflag[i]]);
                        draw_string(96, 48 + 58 * i, Mis.Abbr);

                        if (Mis.Dur >= 1) {
                            switch (Data->P[plr].Mission[i].Duration) {
                            case 1:
                                draw_string(0, 0, "");
                                break;

                            case 2:
                                draw_string(0, 0, " (B)");
                                break;

                            case 3:
                                draw_string(0, 0, " (C)");
                                break;

                            case 4:
                                draw_string(0, 0, " (D)");
                                break;

                            case 5:
                                draw_string(0, 0, " (E)");
                                break;

                            case 6:
                                draw_string(0, 0, " (F)");
                                break;

                            default:
                                draw_string(0, 0, "");
                                break;
                            }
                        }

                        //Missions(plr,96,48+58*i,dg[Data->P[plr].Mission[i].MissionCode][dgflag[i]],0);
                        dgflag[i]++;
                        fill_rectangle(191, 71 + i * 58, 270, 78 + i * 58, 3);
                        display::graphics.setForegroundColor(9);
                        draw_string(145, 33 + i * 58, "DOWNGRADED MISSION");
                        draw_string(193, 77 + i * 58, "-3 PRESTIGE");
                    } else {
                        dgflag[i] = 0;
                        fill_rectangle(93, 43 + i * 58, 262, 57 + i * 58, 3);
                        display::graphics.setForegroundColor(5);
                        GetMisType(Data->P[plr].Mission[i].MissionCode);

                        draw_string(96, 48 + 58 * i, Mis.Abbr);

                        if (Mis.Dur >= 1) {
                            switch (Data->P[plr].Mission[i].Duration) {
                            case 1:
                                draw_string(0, 0, "");
                                break;

                            case 2:
                                draw_string(0, 0, " (B)");
                                break;

                            case 3:
                                draw_string(0, 0, " (C)");
                                break;

                            case 4:
                                draw_string(0, 0, " (D)");
                                break;

                            case 5:
                                draw_string(0, 0, " (E)");
                                break;

                            case 6:
                                draw_string(0, 0, " (F)");
                                break;

                            default:
                                draw_string(0, 0, "");
                                break;
                            }
                        }

                        //Missions(plr,96,48+58*i,Data->P[plr].Mission[i].MissionCode,0);
                        fill_rectangle(191, 71 + i * 58, 270, 78 + i * 58, 3);

                        if (Data->P[plr].Mission[i].Name[24] == 1) {
                            display::graphics.setForegroundColor(9);
                            draw_string(145, 33 + i * 58, "DOWNGRADED MISSION");
                            draw_string(193, 77 + i * 58, "-3 PRESTIGE");
                        } else {
                            display::graphics.setForegroundColor(7);
                            draw_string(145, 33 + i * 58, "ORIGINAL MISSION");
                            draw_string(193, 77 + i * 58, "NO PENALTY");
                        }

                        //display::graphics.setForegroundColor(7);
                        //draw_string(145,33+i*58,"ORIGINAL MISSION");
                        //draw_string(193,77+i*58,"NO PENALTY");
                    }

                    WaitForMouseUp();
                    OutBox(91, 41 + i * 58, 264, 59 + i * 58);

                }
            };

            if ((x >= 245 && y >= 5 && x <= 314 && y <= 17 && mousebuttons > 0) || key == K_ENTER) { //  CONTINUE
                InBox(245, 5, 314, 17);
                WaitForMouseUp();

                if (key > 0) {
                    delay(150);
                }

                OutBox(245, 5, 314, 17);
                delay(10);

                for (i = 0; i < 3; i++) {
                    if (Data->P[plr].Mission[i].MissionCode) {
                        if (dgflag[i] != 0) {
                            Data->P[plr].Mission[i].MissionCode = dg[Data->P[plr].Mission[i].MissionCode][dgflag[i] - 1];
                            pNeg[plr][i] = 1;
                        }
                    }
                }

                if (Data->P[plr].Mission[1].part == 1) {
                    R2 = R1;
                }

                if (Data->P[plr].Mission[2].part == 1) {
                    R3 = R2;
                }

                if (Data->P[plr].Mission[0].MissionCode && Data->P[plr].Cash >= 3 * R1) {
                    Data->P[plr].Cash -= 3 * R1;
                    Data->P[plr].Mission[0].Month -= R1;
                    Data->P[plr].Mission[0].Rushing = R1;
                };

                if (Data->P[plr].Mission[1].MissionCode && Data->P[plr].Cash >= 3 * R2) {
                    Data->P[plr].Cash -= 3 * R2;
                    Data->P[plr].Mission[1].Month -= R2;
                    Data->P[plr].Mission[1].Rushing = R2;
                };

                if (Data->P[plr].Mission[2].MissionCode && Data->P[plr].Cash >= 3 * R3) {
                    Data->P[plr].Cash -= 3 * R3;
                    Data->P[plr].Mission[2].Month -= R3;
                    Data->P[plr].Mission[2].Rushing = R3;
                }

                music_stop();
                return;  // Done
            }
        }
    }
}
예제 #25
0
void WrapperDLL::Sound_FadeIn(void* self,int32_t id,float second){
	auto self_ = (Sound*)self;
	auto arg0 = id;
	auto arg1 = second;
	self_->FadeIn(arg0,arg1);
};
예제 #26
0
void DrawPrefs(int where, char a1, char a2)
{
    int mode = 0;

    FadeOut(2, 10, 0, 0);
    helpText = "i013";
    keyHelpText = "K013";

    boost::shared_ptr<display::PalettizedSurface> prefs_image(Filesystem::readImage("images/preferences.png"));
    // fixme: don't use vhptr to draw this screen
    vhptr->palette().copy_from(prefs_image->palette());
    vhptr->draw(prefs_image, 0, 0);

    display::graphics.screen()->clear();
    prefs_image->exportPalette();
    ShBox(0, 0, 319, 22);
    ShBox(0, 24, 89, 199);
    ShBox(91, 24, 228, 107);
    IOBox(98, 28, 137, 63);
    IOBox(98, 68, 137, 103);
    IOBox(144, 28, 221, 63);
    /* This draws disabled button around camera */
    /* IOBox(144,68,221,103); */
    InBox(144, 68, 221, 103);

    ShBox(91, 109, 228, 199);
    InBox(95, 113, 224, 195);
    fill_rectangle(96, 114, 223, 194, 0);
    ShBox(230, 24, 319, 199);

    if (where == 2) {
        where = mode = 1;    //modem klugge
    } else if (where == 3) {
        where = mode = 2;    //play-by-mail
    }

    if (where == 0 || where == 2) {
        music_start(M_SOVTYP);
        IOBox(6, 105, 83, 140);
        IOBox(6, 158, 83, 193);
        IOBox(236, 105, 313, 140);
        IOBox(236, 158, 313, 193);
        InBox(6, 52, 83, 87);
        InBox(236, 52, 313, 87);
        fill_rectangle(7, 53, 82, 86, 0);
        fill_rectangle(237, 53, 312, 86, 0);
        OutBox(8, 77, 18, 85);
        OutBox(238, 77, 248, 85);
        //BinT(8,54,0);BinT(238,54,0);  // Old way with buttons
        BinT(8, 54, 1);
        BinT(238, 54, 1);  // No select Buttons
        fill_rectangle(237, 35, 312, 41, 0);
        fill_rectangle(7, 35, 82, 41, 0);
    } else {
        music_start(M_DRUMSM);
        InBox(8, 107, 81, 138);
        InBox(8, 160, 81, 191);
        InBox(238, 107, 311, 138);
        InBox(238, 160, 311, 191);
        InBox(8, 77, 18, 85);
        InBox(238, 77, 248, 85);
        BinT(8, 54, 1);
        BinT(238, 54, 1);
        fill_rectangle(237, 35, 312, 41, 0);
        fill_rectangle(7, 35, 82, 41, 0);
    };

    if (mode == 0) {
        draw_heading(6, 5, "PREFERENCES SELECTIONS", 0, -1);
    } else if (mode == 2) {
        draw_heading(3, 5, "PLAY BY MAIL SELECTIONS", 0, -1);
    } else {
        draw_heading(6, 5, "MODEM GAME SELECTIONS", 0, -1);
    }

    IOBox(243, 3, 316, 19);
    InBox(236, 34, 313, 42);
    InBox(6, 34, 83, 42);
    PLevels(0, Data->Def.Plr1);
    CLevels(0, a1);
    PLevels(1, Data->Def.Plr2);
    CLevels(1, a2);
    Levels(0, Data->Def.Lev1, 1);
    Levels(0, Data->Def.Ast1, 0);
    Levels(1, Data->Def.Lev2, 1);
    Levels(1, Data->Def.Ast2, 0);

    if (where == 0 || where == 2) {
        display::graphics.setForegroundColor(9);
    } else {
        display::graphics.setForegroundColor(34);
    }

    draw_string(23, 30, "PLAYER 1");
    display::graphics.setForegroundColor(34);
    draw_string(253, 30, "PLAYER 2");
    display::graphics.setForegroundColor(5);
    draw_string(23, 49, "COUNTRY");
    draw_string(254, 49, "COUNTRY");
    draw_string(17, 101, "GAME LEVEL");
    draw_string(247, 101, "GAME LEVEL");
    draw_string(249, 148, "COSMONAUT");
    draw_string(250, 155, "SELECTION");
    draw_string(19, 148, "ASTRONAUT");
    draw_string(20, 155, "SELECTION");
    display::graphics.setForegroundColor(1);
    draw_string(258, 13, "CONTINUE");
    draw_string(8, 40, &Data->P[ Data->Def.Plr1 ].Name[0]);
    draw_string(238, 40, &Data->P[ Data->Def.Plr2 ].Name[0]);

    // todo: convert to draw commands
    vhptr->copyTo(display::graphics.legacyScreen(), 153 + 34 * (Data->Def.Music), 0, 101, 31, 134, 60);
    vhptr->copyTo(display::graphics.legacyScreen(), 221 + 34 * (Data->Def.Sound), 0, 101, 71, 134, 100);

    vhptr->copyTo(display::graphics.legacyScreen(), 216, 30, 147, 31, 218, 60);
    vhptr->copyTo(display::graphics.legacyScreen(), 72 * (Data->Def.Anim), 90, 147, 71, 218, 100);
    HModel(Data->Def.Input, 1);

    // if (where==0 || where==2)
    FadeIn(2, 10, 0, 0);
    return;
}
예제 #27
0
파일: Light.cpp 프로젝트: alepulver/dhewm3
/*
================
idLight::Event_FadeIn
================
*/
void idLight::Event_FadeIn( float time ) {
	FadeIn( time );
}
예제 #28
0
파일: gghost.c 프로젝트: kivan117/gghost
/**
 * \brief The main game loop. This just cycles endlessly, it uses the game's 'state' to determine which screen to show and what to do.
 */
int main(){
	//looping back and forth forever (cards against humanity reference)
	while(1)
	{
		//some basic prep work performed once before our custom intro
		if(game_state == INTRO)
		{
			initialSetup();
			initIntro();
		}
		//perform custom intro
		while(game_state == INTRO)
		{
			//wait until the next frame
			WaitVsync(1);
			drawIntro();
			processIntro();
		}
		//prep the main menu
		if(game_state == MAIN_MENU)
		{
			FadeOut(0,true);
			ClearVram();
			SetTileTable(title_tiles);
			SetFontTilesIndex(TITLE_TILES_SIZE);
			drawMainMenu();
			FadeIn(0,false);
		}
		//draw menu and handle input
		while(game_state == MAIN_MENU)
		{
			WaitVsync(1);
			drawMenuCursor();
			processMainMenu();
		}
		if(game_state== GAME)
		{
			//run our setup for the main game
			ClearVram();
			FadeOut(0,true);
			gameSetup();
			FadeIn(0,false);
		}
		//when we're in the gameplay portion, draw and accept input for the game
		while(game_state == GAME)
		{
			WaitVsync(1);
			processScrollSpeed(); //scrolls screen as appropriate
			updateCity(); //offsets city for parallax
			processControls(); //accepts and processes controller input
			processPlayerMotion(); //update player position
			processSprites(); //updates and moves player image to player position
		}
		if(game_state == HIGH_SCORES)
		{
			FadeOut(0,true);
			SetTileTable(title_tiles);
			SetFontTilesIndex(TITLE_TILES_SIZE);
			drawLocalHighScoreMenu(); //draw up the high score screen
			FadeIn(0,false);
			deathclock=120; //reset death timer to 2 seconds
			if(score > topscores[9])
			{
			    LoadScore(0, 9); //load top 10 saved high scores
			    SaveScore(score); //save our current score if it's high enough
			    drawLocalHighScoreMenu(); //draw up the high score screen
			}
		}
		//draw and accepts input for the local high score screen
		while(game_state == HIGH_SCORES)
		{
			WaitVsync(1);
			processHighScoreMenu();
		}
    }
}
예제 #29
0
void DrawReview(char plr)
{
    int clr, i, cte, P_value;
    char Fired_Flag = 0, Reset_Flag = 0;

    if (Data->P[plr].PresRev[0] != 0x7F) {
        FadeOut(2, display::graphics.palette(), 10, 0, 0);
    }

    PortPal(plr);
    display::graphics.screen()->clear(0);

    if (Data->P[plr].PresRev[0] == 0x7F) {
        Fired_Flag = 1;
        Data->P[plr].PresRev[0] = 16;
    } else if (Data->P[plr].PresRev[0] >= 16) {
        Reset_Flag = 1;
        Data->P[plr].PresRev[0] = 15;
    }

    ShBox(0, 0, 319, 22);
    ShBox(0, 24, 319, 199);
    draw_small_flag(plr, 4, 4);
    fill_rectangle(5, 28, 314, 195, 0);
    fill_rectangle(5, 122, 314, 195, 0);
    ShBox(6, 123, 313, 194);
    fill_rectangle(7, 124, 312, 193, 9);
    InBox(11, 128, 307, 189);
    fill_rectangle(12, 129, 306, 188, 7);
    ShBox(6, 29, 177, 121);
    ShBox(179, 29, 313, 121);
    InBox(182, 32, 309, 117);
    InBox(3, 3, 30, 19);
    IOBox(243, 3, 316, 19);

    if (plr == 0) {
        draw_heading(40, 5, "PRESIDENTIAL REVIEW", 0, -1);
    } else {
        draw_heading(40, 5, "POLITBURO REVIEW", 0, -1);
    }

    display::graphics.setForegroundColor(1);
    draw_string(257, 13, "CONTINUE");
    display::graphics.setForegroundColor(1);
    draw_string(59, 36, "JOB PERFORMANCE");
    display::graphics.setForegroundColor(6);
    draw_string(8, 46, "GOOD");
    display::graphics.setForegroundColor(1);
    draw_string(8, 77, "FAIR");
    display::graphics.setForegroundColor(9);
    draw_string(8, 109, "POOR");
    display::graphics.setForegroundColor(1);
    draw_number(154, 117, Data->Year - 1);
    draw_number(126, 117, Data->Year - 2);
    draw_number(97, 117, Data->Year - 3);
    draw_number(70, 117, Data->Year - 4);
    draw_number(42, 117, Data->Year - 5);
    fill_rectangle(32, 39, 172, 111, 0);
    GradRect(33, 39, 171, 74, 0);
    GradRect(33, 75, 171, 110, 0);
    display::graphics.setForegroundColor(3);
    pline(60, 40, 60, 110);
    pline(88, 40, 88, 110);
    pline(116, 40, 116, 110);
    pline(144, 40, 144, 110);
    pline(33, 48, 171, 48);
    pline(33, 57, 171, 57);
    pline(33, 66, 171, 66);
    pline(33, 75, 171, 75);
    pline(33, 84, 171, 84);
    pline(33, 93, 171, 93);
    pline(33, 102, 171, 102);
    InBox(32, 39, 172, 111);

    for (i = 0; i < 5; i++) if (Data->P[plr].PresRev[i] > 16) {
            Data->P[plr].PresRev[i] = 16;
        }

    for (i = 0; i < 5; i++) {
        cte = 0;

        if (Data->P[plr].PresRev[i] < 8) {
            if (Data->P[plr].PresRev[i] == 7) {
                cte = 73;
            } else {
                cte = 40 + Data->P[plr].PresRev[i] * 5;
            }
        } else if (Data->P[plr].PresRev[i] > 8) {
            if (Data->P[plr].PresRev[i] == 9) {
                cte = 77;
            } else {
                cte = 80 + (Data->P[plr].PresRev[i] - 10) * 5;
            }
        };

        if (Data->P[plr].PresRev[i] == 8) {
            cte = 73;
        }

        fill_rectangle(166 - i * 28, 75, 151 - i * 28, cte, 5 + ((Data->P[plr].PresRev[i] <= 8) ? 0 : 3));
        display::graphics.setForegroundColor(6 + ((Data->P[plr].PresRev[i] <= 8) ? 0 : 3));
        pline(167 - i * 28, 75, 167 - i * 28, cte);
    }

    if (Fired_Flag == 1) {
        clr = 0;

        for (i = 0; i < Data->P[plr].AstroCount; i++)
            if (Data->P[plr].Pool[i].Status == AST_ST_DEAD) {
                clr++;
            }

        Data->P[plr].PresRev[0] = (clr >= 2) ? 17 : 16;
    }

    DrawRevText(plr, Data->P[plr].PresRev[0]);

    if (Data->P[plr].PresRev[0] == 17) {
        Data->P[plr].PresRev[0] = 16;
    }

    P_value = 0;

    // 0 pres. 1 v.p.
    if (plr == 0) {
        if (Data->P[plr].PresRev[0] <= 4 || Data->P[plr].PresRev[0] >= 11) {
            P_value = 0;
        } else {
            P_value = 1;
        }
    };

    if (plr == 1) {
        if (Data->P[plr].PresRev[0] <= 4 || Data->P[plr].PresRev[0] >= 12) {
            P_value = 0;
        } else {
            P_value = 1;
        }
    }

    if (plr == 0) {
        if (Data->Year <= 60) {
            if (P_value == 0) {
                PresPict(0);
            } else {
                PresPict(1);
            }
        } else if (Data->Year >= 61 && Data->Year <= 63) {
            if (P_value == 0) {
                PresPict(2);
            } else {
                PresPict(3);
            }
        } else if (Data->Year >= 64 && Data->Year <= 68) {
            if (P_value == 0) {
                PresPict(4);
            } else {
                PresPict(5);
            }
        } else if (Data->Year >= 69 && Data->Year <= 73) {
            if (P_value == 0) {
                PresPict(6);
            } else {
                PresPict(7);
            }
        } else if (Data->Year >= 74 && Data->Year <= 76) {
            if (P_value == 0) {
                PresPict(8);
            } else {
                PresPict(9);
            }
        } else if (Data->Year >= 77) {
            if (P_value == 0) {
                PresPict(10);
            } else {
                PresPict(11);
            }
        }
    }

    if (plr == 1) {
        if (Data->Year < 61) {
            if (P_value == 0) {
                PresPict(14);
            } else {
                PresPict(15);
            }
        } else if (Data->Year <= 64) {
            if (P_value == 0) {
                PresPict(12);
            } else {
                PresPict(13);
            }
        } else if (Data->Year >= 65) {
            if (P_value == 0) {
                PresPict(16);
            } else {
                PresPict(17);
            }
        }
    }

    if (Reset_Flag == 1) {
        Data->P[plr].PresRev[0] = 16;
    }

    FadeIn(2, display::graphics.palette(), 10, 0, 0);

    return;
}
예제 #30
0
void Museum(char plr)
{
    int i, tots = 7, beg;
    char AName[7][22] = {"DIRECTOR RANKING", "SPACE HISTORY", "MISSION RECORDS", "PRESTIGE SUMMARY",
                         "HARDWARE EFFICIENCY", "ASTRONAUT HISTORY", "EXIT THE MUSEUM"
                        };
    char AImg[7] = {8, 9, 10, 11, 13, 14, 0};

    if (Data->P[plr].AstroCount == 0) {
        memcpy(&AName[5][0], &AName[6][0], 22); // move up Exit
        AImg[5] = AImg[6];
        tots = 6;
    } else if (plr == 1) {
        strncpy(&AName[5][0], "COSMO", 5);
    }

    AImg[3] += plr;
    // FadeOut(2,pal,10,0,0);
    music_start(M_THEME);
    beg = 0;

    do {
        if (beg == 0) {
            beg = (Data->P[plr].AstroCount > 0) ? 7 : 6;    // mods for astros
        } else {
            FadeOut(2, display::graphics.palette(), 10, 0, 0);

            DrawSpaceport(plr);
            PortPal(plr);
            fill_rectangle(166, 191, 318, 198, 3);
            display::graphics.setForegroundColor(0);
            draw_string(257, 197, "CASH:");
            draw_megabucks(285, 197, Data->P[plr].Cash);
            display::graphics.setForegroundColor(11);
            draw_string(256, 196, "CASH:");
            draw_megabucks(284, 196, Data->P[plr].Cash);
            display::graphics.setForegroundColor(0);

            if (Data->Season == 0) {
                draw_string(166, 197, "SPRING 19");
            } else {
                draw_string(166, 197, "FALL 19");
            }

            draw_number(0, 0, Data->Year);
            display::graphics.setForegroundColor(11);

            if (Data->Season == 0) {
                draw_string(165, 196, "SPRING 19");
            } else {
                draw_string(165, 196, "FALL 19");
            }

            draw_number(0, 0, Data->Year);

            FadeIn(2, display::graphics.palette(), 10, 0, 0);
        }

        helpText = (plr == 0) ? "i700" : "i701";
        keyHelpText = (plr == 0) ? "k603" : "k604";
        i = BChoice(plr, tots, &AName[0][0], &AImg[0]);

        switch (i) {
        case 1:
            RankMe(plr);
            break;

        case 2:
            helpText = "i130";
            keyHelpText = "k031";
            ShowSpHist(plr);
            break;

        case 3:
            helpText = "i131";
            keyHelpText = "k321";
            Records(plr);
            break;

        case 4:
            helpText = "i132";
            keyHelpText = "k033";
            ShowPrest(plr);
            break;

        case 5:
            helpText = "i034";
            ShowHard(plr);
            break;

        case 6:
            helpText = (plr == 0) ? "i133" : "i134";
            keyHelpText = (plr == 0) ? "k035" : "k441";

            if (Data->P[plr].AstroCount > 0) {
                ShowAstrosHist(plr);
            }

            break;

        case 7:
        default:
            break;
        }

        helpText = "i000";
        keyHelpText = "k000";
    } while (i != beg);

    music_stop();
    return;
}