873 lines
20 KiB
C++
873 lines
20 KiB
C++
![]() |
/************************/
|
|||
|
/* process.c */
|
|||
|
/************************/
|
|||
|
#include "../systeminc/version.h"
|
|||
|
#include "../systeminc/system.h"
|
|||
|
#include "../ohta/ohta.h"
|
|||
|
//#include "../dwaf/dwafTestProc.h"
|
|||
|
#include "../systeminc/map.h"
|
|||
|
#include "../systeminc/ime_sa.h"
|
|||
|
#include "../other/caryIme.h"
|
|||
|
#include "../systeminc/menu.h"
|
|||
|
#include "../systeminc/pc.h"
|
|||
|
#include "../systeminc/character.h"
|
|||
|
#include "../systeminc/login.h"
|
|||
|
#include "../systeminc/netproc.h"
|
|||
|
#include "../systeminc/savedata.h"
|
|||
|
#include "../systeminc/testView.h"
|
|||
|
#include "../systeminc/battleProc.h"
|
|||
|
#include "../systeminc/produce.h"
|
|||
|
#include "../systeminc/lssproto_cli.h"
|
|||
|
#include "../systeminc/netmain.h"
|
|||
|
#include "../systeminc/battleMenu.h"
|
|||
|
#include "../systeminc/t_music.h"
|
|||
|
#include "../systeminc/field.h"
|
|||
|
#include "../systeminc/handletime.h"
|
|||
|
|
|||
|
#ifdef _NEW_MUISC_
|
|||
|
BOOL <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=TRUE;
|
|||
|
#endif
|
|||
|
/* ???????? *******************************************************************/
|
|||
|
extern void kakushi_command(void);
|
|||
|
/* ????<3F>k? */
|
|||
|
UINT ProcNo;
|
|||
|
/* ??????<3F>k? */
|
|||
|
UINT SubProcNo;
|
|||
|
/* ????<3F>k?(????????<3F><>?<3F>v??) */
|
|||
|
int ProcNo2;
|
|||
|
int SubProcNo2;
|
|||
|
|
|||
|
int palNo;
|
|||
|
int oldPalNo;
|
|||
|
int palTime;
|
|||
|
|
|||
|
#ifdef _PET_TRACE_MOUSE
|
|||
|
extern SCPlayPet PlayPet;
|
|||
|
#endif
|
|||
|
|
|||
|
/* ?????? ********************************************************************/
|
|||
|
void Process( void )
|
|||
|
{
|
|||
|
if (ProcNo2 >= 0)
|
|||
|
{
|
|||
|
ProcNo = ProcNo2;
|
|||
|
ProcNo2 = -1;
|
|||
|
SubProcNo = SubProcNo2;
|
|||
|
}
|
|||
|
|
|||
|
/* ????<3F><>? */
|
|||
|
switch (ProcNo)
|
|||
|
{
|
|||
|
case PROC_OPENNING:
|
|||
|
break;
|
|||
|
case PROC_INIT: /* ??????? */
|
|||
|
InitProc();
|
|||
|
initMapEffect(TRUE); // ???????????
|
|||
|
break;
|
|||
|
// ????????<3F>V???
|
|||
|
case PROC_ID_PASSWORD:
|
|||
|
#ifdef _NEW_MUISC_
|
|||
|
if(<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) {
|
|||
|
<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=FALSE;
|
|||
|
play_bgm(27);
|
|||
|
}
|
|||
|
#endif
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
idPasswordProc();
|
|||
|
#ifdef _PET_TRACE_MOUSE
|
|||
|
PlayPet.Proc();
|
|||
|
#endif
|
|||
|
RunAction(); // ?????????
|
|||
|
StockTaskDispBuffer(); // ???<3F><><EFBFBD><EFBFBD>????????????
|
|||
|
FlashKeyboardCursor(); // ?????????<3F><><EFBFBD><EFBFBD>??
|
|||
|
ImeProc(); // ???????
|
|||
|
#ifdef _LOGINKICK
|
|||
|
extern DWORD StartTime;
|
|||
|
StartTime = -1 ;
|
|||
|
#endif
|
|||
|
|
|||
|
break;
|
|||
|
// ????<3F><><EFBFBD><EFBFBD>?????<3F>k<EFBFBD><6B>
|
|||
|
case PROC_TITLE_MENU:
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
titleProc();
|
|||
|
TitleProduce(); // ?????<3F><>
|
|||
|
RunAction(); // ?????????
|
|||
|
StockTaskDispBuffer(); // ???<3F><><EFBFBD><EFBFBD>????????????
|
|||
|
|
|||
|
//cary 2002.1.4 kakushi_command(); // ????????
|
|||
|
break;
|
|||
|
// ???<3F>k<EFBFBD><6B>?<3F><>
|
|||
|
case PROC_CHAR_SELECT: // ???<3F>k<EFBFBD><6B>
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
selectCharacterProc();
|
|||
|
break;
|
|||
|
// ????<3F><>
|
|||
|
case PROC_CHAR_MAKE:
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
makeCharacterProc();
|
|||
|
break;
|
|||
|
// <20>k<EFBFBD><6B>??????????<3F><>
|
|||
|
case PROC_CHAR_LOGIN_START:
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
// charLoginStart();???????????????????
|
|||
|
// ?????????????
|
|||
|
initMap(); // ??????
|
|||
|
initPcAll(); // PC<50>ѩ<EFBFBD>?????????
|
|||
|
initCharObj(); // ????????????
|
|||
|
initOpenServerWindow(); // ????<3F><><EFBFBD><EFBFBD>?<3F><><EFBFBD><EFBFBD>???????????
|
|||
|
initFieldProc(); // ??????<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>????
|
|||
|
initMapEffect(FALSE); // ???????????
|
|||
|
EncountFlag = FALSE;
|
|||
|
logOutFlag = FALSE;
|
|||
|
InitOhtaParam(); // ??????????<3F>^<5E><><EFBFBD>M??
|
|||
|
#ifdef __SKYISLAND
|
|||
|
extern void SkyIslandInit();
|
|||
|
SkyIslandInit();
|
|||
|
#endif
|
|||
|
ChangeProc( PROC_CHAR_LOGIN );
|
|||
|
// ???????????<3F><>
|
|||
|
fade_out_bgm();
|
|||
|
break;
|
|||
|
case PROC_CHAR_LOGIN:
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
characterLoginProc();
|
|||
|
break;
|
|||
|
// ?????
|
|||
|
case PROC_CHAR_LOGOUT:
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
// BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
characterLogoutProc();
|
|||
|
break;
|
|||
|
case PROC_GAME: /* ??????? */
|
|||
|
GameProc();
|
|||
|
break;
|
|||
|
case PROC_DISCONNECT_SERVER:
|
|||
|
switch (SubProcNo)
|
|||
|
{
|
|||
|
case 0:
|
|||
|
// ???
|
|||
|
// PC????
|
|||
|
resetPc();
|
|||
|
// ?????????????
|
|||
|
initCharObj();
|
|||
|
// ??????<3F><>
|
|||
|
DeathAllAction();
|
|||
|
// ?<3F><>????
|
|||
|
ProduceInitFlag = TRUE;
|
|||
|
// ????????????<3F><>
|
|||
|
CopyBackBuffer();
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
BackBufferDrawType = DRAW_BACK_PRODUCE;
|
|||
|
// ???????????<3F><>
|
|||
|
fade_out_bgm();
|
|||
|
// ????????
|
|||
|
NowTime = TimeGetTime();
|
|||
|
SubProcNo++;
|
|||
|
break;
|
|||
|
case 1:
|
|||
|
// ?<3F><>?
|
|||
|
if (DrawProduce(PRODUCE_DOWN_ACCELE) == TRUE)
|
|||
|
{
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
SubProcNo++;
|
|||
|
}
|
|||
|
break;
|
|||
|
case 2:
|
|||
|
// ?<3F><>?<3F><>??
|
|||
|
break;
|
|||
|
}
|
|||
|
// <20><><EFBFBD>e?????????
|
|||
|
if (disconnectServer())
|
|||
|
{
|
|||
|
// ?????????
|
|||
|
cleanupNetwork();
|
|||
|
// ????????????
|
|||
|
PaletteChange(DEF_PAL, 0);
|
|||
|
// ?????<3F><>?
|
|||
|
//cary
|
|||
|
ChangeProc( PROC_ID_PASSWORD );
|
|||
|
SubProcNo = 0;
|
|||
|
// ??????<3F><>
|
|||
|
DeathAllAction();
|
|||
|
disconnectServerFlag = FALSE;
|
|||
|
oldDisconnectServerFlag = FALSE;
|
|||
|
break;
|
|||
|
}
|
|||
|
RunAction(); // ?????????
|
|||
|
StockTaskDispBuffer(); // ???<3F><><EFBFBD><EFBFBD>????????????
|
|||
|
break;
|
|||
|
case PROC_BATTLE: /* ??????? */
|
|||
|
BattleProc();
|
|||
|
break;
|
|||
|
#ifdef _STONDEBUG_
|
|||
|
//case PROC_OHTA_TEST: /* <20>^<5E><>??????? */
|
|||
|
// OhtaTestProc();
|
|||
|
// break;
|
|||
|
//case PROC_TAKE_TEST: /* <20>{<7B><>????????? */
|
|||
|
// TakeTestProc();
|
|||
|
// break;
|
|||
|
//case PROC_DWAF_TEST: // DWAF???
|
|||
|
// dwafTestProc();
|
|||
|
// break;
|
|||
|
case PROC_SPR_VIEW: // ??????<3F>_????
|
|||
|
SprViewProc();
|
|||
|
break;
|
|||
|
case PROC_ANIM_VIEW: // ????????<3F>_????
|
|||
|
AnimViewProc();
|
|||
|
break;
|
|||
|
case PROC_SE_TEST: // ???<3F>_????
|
|||
|
SeTestProc();
|
|||
|
break;
|
|||
|
#endif
|
|||
|
#ifdef _80_LOGIN_PLAY
|
|||
|
case PROC_80_LOGIN:
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
_80LoginProc();
|
|||
|
RunAction();
|
|||
|
StockTaskDispBuffer();
|
|||
|
break;
|
|||
|
#endif
|
|||
|
#ifdef _PK2007
|
|||
|
case PROC_PKSERVER_SELECT:
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
selectpkProc();
|
|||
|
break;
|
|||
|
#endif
|
|||
|
case PROC_ENDING:
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/* ????<3F><>??? ***********************************************************/
|
|||
|
void ChangeProc( int procNo )
|
|||
|
{
|
|||
|
#ifdef _NEW_MUISC_
|
|||
|
if(PROC_ID_PASSWORD==procNo){
|
|||
|
<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=TRUE;
|
|||
|
//t_music_se_volume = t_music_bgm_volume = 15;
|
|||
|
}
|
|||
|
#endif
|
|||
|
ProcNo = procNo;
|
|||
|
// ??????<3F>k?????
|
|||
|
SubProcNo = 0;
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
/* ????<3F><>??? ***********************************************************/
|
|||
|
void ChangeProc( int procNo, int subProcNo )
|
|||
|
{
|
|||
|
// ????<3F>k????
|
|||
|
ProcNo = procNo;
|
|||
|
// ??????<3F>k?????
|
|||
|
SubProcNo = subProcNo;
|
|||
|
}
|
|||
|
/* ????<3F><>??????????????<3F><>?<3F>v???**************************/
|
|||
|
void ChangeProc2( int procNo )
|
|||
|
{
|
|||
|
// ????<3F>k????
|
|||
|
ProcNo2 = procNo;
|
|||
|
SubProcNo2 = 0;
|
|||
|
}
|
|||
|
/* ????<3F><>??? ***********************************************************/
|
|||
|
void ChangeProc2( int procNo, int subProcNo )
|
|||
|
{
|
|||
|
// ????<3F>k????
|
|||
|
ProcNo2 = procNo;
|
|||
|
// ??????<3F>k?????
|
|||
|
SubProcNo2 = subProcNo;
|
|||
|
}
|
|||
|
|
|||
|
void GameProc( void )
|
|||
|
{
|
|||
|
static int now_bgm;
|
|||
|
static BOOL produceFlag;
|
|||
|
switch( SubProcNo ){
|
|||
|
case 0:
|
|||
|
//cary <20><>ֹ<EFBFBD>ٴε<D9B4><CEB5><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
extern short helpBtn, actBtn;
|
|||
|
helpBtn = 0;
|
|||
|
actBtn = 0;
|
|||
|
//end cary
|
|||
|
#ifdef _DEBUG__
|
|||
|
if( offlineFlag ){
|
|||
|
initMap();
|
|||
|
}
|
|||
|
#endif
|
|||
|
//InitIme();
|
|||
|
ClearIme();
|
|||
|
InitChat();
|
|||
|
produceFlag = FALSE;
|
|||
|
EncountFlag = FALSE;
|
|||
|
LoadAlbum();
|
|||
|
extern void AI_Init();
|
|||
|
AI_Init();
|
|||
|
nameOverTheHeadFlag = 0;
|
|||
|
SubProcNo++;
|
|||
|
case 150:
|
|||
|
SubProcNo = 100;
|
|||
|
|
|||
|
case 100:
|
|||
|
initPc();
|
|||
|
resetFieldProc();
|
|||
|
restorePtActCharObjAll();
|
|||
|
initOpenServerWindow();
|
|||
|
InitMenu();
|
|||
|
// BattleStatusBak[ 0 ] = NULL;// ???<3F>֢t???
|
|||
|
// BattleStatusReadPointer = BattleStatusWritePointer =0;
|
|||
|
GetKeyInputFocus( &MyChatBuffer );
|
|||
|
SubProcNo++;
|
|||
|
case 101:
|
|||
|
if( loginFlag ){
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
break;
|
|||
|
}
|
|||
|
SubProcNo++;
|
|||
|
case 102:
|
|||
|
paletteProc();
|
|||
|
|
|||
|
DispBuffer.DispCnt = 0;
|
|||
|
FontCnt = 0;
|
|||
|
initCharPartsPrio(); // ?????????<3F>I???<3F>e??????
|
|||
|
RunAction(); // ?????????
|
|||
|
StockTaskDispBuffer(); // ???<3F><><EFBFBD><EFBFBD>????????????
|
|||
|
stop_bgm(); //???<3F>_<EFBFBD><5F>
|
|||
|
drawMap(); // ???<3F><><EFBFBD><EFBFBD>
|
|||
|
MenuProc(); // ??????
|
|||
|
ChatProc(); // ??????
|
|||
|
ChatBufferToFontBuffer(); // ??????????????????????
|
|||
|
ImeProc(); // ???????
|
|||
|
SortDispBuffer(); // <20><><EFBFBD><EFBFBD>???????
|
|||
|
// ???????????????
|
|||
|
ClearBackSurface();
|
|||
|
// ????????????????
|
|||
|
PutBmp();
|
|||
|
// ??????????????????????
|
|||
|
lpBattleSurface->BltFast( 0, 0, lpDraw->lpBACKBUFFER, NULL, DDBLTFAST_WAIT );
|
|||
|
// ???????
|
|||
|
DispBuffer.DispCnt = 0;
|
|||
|
FontCnt = 0;
|
|||
|
|
|||
|
play_bgm( map_bgm_no );
|
|||
|
|
|||
|
// ????????
|
|||
|
NowTime = TimeGetTime();
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
// BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
BackBufferDrawType = DRAW_BACK_PRODUCE;
|
|||
|
// ?<3F><>?
|
|||
|
ProduceInitFlag = TRUE;
|
|||
|
DrawProduce( PRODUCE_BRAN_BIG );
|
|||
|
/*#ifdef __SKYISLAND
|
|||
|
ClearBackSurface();
|
|||
|
#endif*/
|
|||
|
SubProcNo++;
|
|||
|
break;
|
|||
|
|
|||
|
case 103:
|
|||
|
// ?<3F><>?
|
|||
|
BackBufferDrawType = DRAW_BACK_PRODUCE;
|
|||
|
if( DrawProduce( PRODUCE_BRAN_BIG ) == TRUE )
|
|||
|
{
|
|||
|
produceFlag = TRUE;
|
|||
|
fieldInfoTime = TimeGetTime();
|
|||
|
if( fastDrawTile )
|
|||
|
{
|
|||
|
SubProcNo = 20;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
SubProcNo = 3;
|
|||
|
}
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
// ????<3F><>
|
|||
|
case 200:
|
|||
|
ProduceInitFlag = TRUE;
|
|||
|
|
|||
|
// ???????
|
|||
|
DispBuffer.DispCnt = 0;
|
|||
|
FontCnt = 0;
|
|||
|
|
|||
|
// ????????
|
|||
|
NowTime = TimeGetTime();
|
|||
|
|
|||
|
// S??????C? warpEffectProc();?????
|
|||
|
// ?<3F><>???????????????
|
|||
|
SubProcNo++;
|
|||
|
|
|||
|
case 201:
|
|||
|
// ?<3F><>?
|
|||
|
BackBufferDrawType = DRAW_BACK_PRODUCE;
|
|||
|
if( DrawProduce( PRODUCE_CENTER_PRESSIN ) == TRUE )
|
|||
|
{
|
|||
|
SubProcNo++;
|
|||
|
}
|
|||
|
drawField(); // ??????<3F><>?????<3F><><EFBFBD><EFBFBD>
|
|||
|
MenuProc(); // ??????
|
|||
|
ImeProc(); // ???????
|
|||
|
break;
|
|||
|
|
|||
|
case 202:
|
|||
|
if( !warpEffectStart || !warpEffectOk )
|
|||
|
{
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
drawField(); // ??????<3F><>?????<3F><><EFBFBD><EFBFBD>
|
|||
|
MenuProc(); // ??????
|
|||
|
ImeProc(); // ???????
|
|||
|
break;
|
|||
|
}
|
|||
|
warpEffectStart = FALSE;
|
|||
|
warpEffectOk = FALSE;
|
|||
|
SubProcNo++;
|
|||
|
case 203:
|
|||
|
// ?<3F><>????<3F><>
|
|||
|
// ???????
|
|||
|
paletteProc();
|
|||
|
|
|||
|
DispBuffer.DispCnt = 0;
|
|||
|
FontCnt = 0;
|
|||
|
initCharPartsPrio(); // ?????????<3F>I???<3F>e??????
|
|||
|
RunAction(); // ?????????
|
|||
|
StockTaskDispBuffer(); // ???<3F><><EFBFBD><EFBFBD>????????????
|
|||
|
redrawMap();
|
|||
|
drawMap(); // ???<3F><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
// ?????????
|
|||
|
if( (mapEffectRainLevel == 0 && oldMapEffectRainLevel != 0 )
|
|||
|
|| (mapEffectSnowLevel == 0 && oldMapEffectSnowLevel != 0 )
|
|||
|
)
|
|||
|
initMapEffect(FALSE);
|
|||
|
ChatProc(); // ??????
|
|||
|
ChatBufferToFontBuffer(); // ??????????????????????
|
|||
|
SortDispBuffer(); // <20><><EFBFBD><EFBFBD>???????
|
|||
|
// ???????????????
|
|||
|
ClearBackSurface();
|
|||
|
if( (mapEffectRainLevel != 0 && oldMapEffectRainLevel == 0 )
|
|||
|
|| (mapEffectSnowLevel != 0 && oldMapEffectSnowLevel == 0 ) )
|
|||
|
mapEffectProc2( 80 ); // ???????????<3F>D??
|
|||
|
// ????????????????
|
|||
|
PutBmp();
|
|||
|
// ??????????????????????
|
|||
|
lpBattleSurface->BltFast( 0, 0, lpDraw->lpBACKBUFFER, NULL, DDBLTFAST_WAIT );
|
|||
|
// ???????
|
|||
|
DispBuffer.DispCnt = 0;
|
|||
|
FontCnt = 0;
|
|||
|
|
|||
|
// if( map_bgm_no != now_bgm )
|
|||
|
// {
|
|||
|
// stop_bgm(); //???<3F>_<EFBFBD><5F>
|
|||
|
// play_bgm( map_bgm_no );
|
|||
|
// }
|
|||
|
|
|||
|
// ????????
|
|||
|
NowTime = TimeGetTime();
|
|||
|
|
|||
|
ProduceInitFlag = TRUE;
|
|||
|
|
|||
|
SubProcNo++;
|
|||
|
|
|||
|
case 204:
|
|||
|
// ?<3F><>?
|
|||
|
BackBufferDrawType = DRAW_BACK_PRODUCE;
|
|||
|
if( DrawProduce( PRODUCE_CENTER_PRESSOUT ) == TRUE )
|
|||
|
{
|
|||
|
fieldInfoTime = TimeGetTime();
|
|||
|
if( fastDrawTile )
|
|||
|
{
|
|||
|
SubProcNo = 20;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
SubProcNo = 3;
|
|||
|
}
|
|||
|
#ifdef _NPC_DANCE
|
|||
|
if( nowFloor == 7027 )
|
|||
|
play_bgm ( 24 ) ;
|
|||
|
#endif
|
|||
|
}
|
|||
|
drawField(); // ??????<3F><>?????<3F><><EFBFBD><EFBFBD>
|
|||
|
MenuProc(); // ??????
|
|||
|
ImeProc(); // ???????
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
case 1:
|
|||
|
initPc(); // ?????????<3F><>
|
|||
|
resetFieldProc(); // ????????????
|
|||
|
restorePtActCharObjAll(); // ?????????????????
|
|||
|
initOpenServerWindow(); // ????<3F><><EFBFBD><EFBFBD>?<3F><><EFBFBD><EFBFBD>???????????
|
|||
|
InitMenu(); // ??????????
|
|||
|
// BattleStatusBak[ 0 ] = NULL;// ???<3F>֢t???
|
|||
|
// BattleStatusReadPointer = BattleStatusWritePointer =0;
|
|||
|
// <20>V??????<3F><><EFBFBD>x
|
|||
|
GetKeyInputFocus( &MyChatBuffer );
|
|||
|
|
|||
|
// ?<3F><>???
|
|||
|
if( produceFlag == TRUE ){
|
|||
|
// <20>P<EFBFBD>f????????????
|
|||
|
//if( BattleResultWndFlag == TRUE ){
|
|||
|
|
|||
|
// ?<3F><>????<3F><>
|
|||
|
// ???????
|
|||
|
DispBuffer.DispCnt = 0;
|
|||
|
FontCnt = 0;
|
|||
|
initCharPartsPrio(); // ?????????<3F>I???<3F>e??????
|
|||
|
RunAction(); // ?????????
|
|||
|
StockTaskDispBuffer(); // ???<3F><><EFBFBD><EFBFBD>????????????
|
|||
|
stop_bgm(); //???<3F>_<EFBFBD><5F>
|
|||
|
updateMapArea();
|
|||
|
redrawMap();
|
|||
|
drawMap(); // ???<3F><><EFBFBD><EFBFBD>
|
|||
|
//????????
|
|||
|
if(!draw_map_bgm_flg){
|
|||
|
//????????<3F><>
|
|||
|
play_bgm(map_bgm_no = now_bgm);
|
|||
|
draw_map_bgm_flg = 1;
|
|||
|
}
|
|||
|
MenuProc(); // ??????
|
|||
|
// ???????<3F>D??????<3F><>?
|
|||
|
//StockBoxDispBuffer( 0, 456, lpDraw->xSize, lpDraw->ySize, DISP_PRIO_MENU, 0, 1 );
|
|||
|
ChatProc(); // ??????
|
|||
|
ChatBufferToFontBuffer(); // ??????????????????????
|
|||
|
ImeProc(); // ???????
|
|||
|
SortDispBuffer(); // <20><><EFBFBD><EFBFBD>???????
|
|||
|
// ???????????????
|
|||
|
ClearBackSurface();
|
|||
|
// ????????????????
|
|||
|
PutBmp();
|
|||
|
// ??????????????????????
|
|||
|
lpBattleSurface->BltFast( 0, 0, lpDraw->lpBACKBUFFER, NULL, DDBLTFAST_WAIT );
|
|||
|
// ???????
|
|||
|
DispBuffer.DispCnt = 0;
|
|||
|
FontCnt = 0;
|
|||
|
// ????????
|
|||
|
NowTime = TimeGetTime();
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
BackBufferDrawType = DRAW_BACK_PRODUCE;
|
|||
|
// ?<3F><>?
|
|||
|
DrawProduce( PRODUCE_4WAY_IN );
|
|||
|
}else{
|
|||
|
// ?<3F><>?????
|
|||
|
produceFlag = TRUE;
|
|||
|
SubProcNo++;
|
|||
|
}
|
|||
|
SubProcNo++;
|
|||
|
|
|||
|
break;
|
|||
|
|
|||
|
case 2: // ????????<3F><>
|
|||
|
// ?<3F><>?
|
|||
|
if( DrawProduce( PRODUCE_4WAY_IN ) == TRUE ){
|
|||
|
warpEffectStart = FALSE;
|
|||
|
warpEffectOk = FALSE;
|
|||
|
if( fastDrawTile )
|
|||
|
{
|
|||
|
SubProcNo = 20;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
SubProcNo = 3;
|
|||
|
}
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
case 20:
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
repairMap();
|
|||
|
SubProcNo = 3;
|
|||
|
|
|||
|
case 3:
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
|
|||
|
BackBufferDrawType = DRAW_BACK_NORMAL;
|
|||
|
paletteProc();
|
|||
|
|
|||
|
initItemOverlapCheck(); // ????<3F><>????????????
|
|||
|
|
|||
|
if( !transmigrationEffectFlag ){
|
|||
|
drawGrid(); // ????????<3F><><EFBFBD><EFBFBD>
|
|||
|
fieldProc(); // ?????????
|
|||
|
// Nuke 0407
|
|||
|
if( bNewServer){
|
|||
|
moveProc(); // ?<3F>h??
|
|||
|
}else
|
|||
|
moveProc(); // ?<3F>h??
|
|||
|
}
|
|||
|
|
|||
|
initCharPartsPrio(); // ?????????<3F>I???<3F>e??????
|
|||
|
//addressBookProc(); // ?????????
|
|||
|
openServerWindowProc(); // ????<3F><>?????
|
|||
|
drawFieldInfoWin(); // ?????<3F><>?<3F>ѩ<EFBFBD>
|
|||
|
|
|||
|
/* ????????? */
|
|||
|
RunAction();
|
|||
|
// ???<3F><><EFBFBD><EFBFBD>????????????
|
|||
|
// <20><><EFBFBD>e<EFBFBD>d?????????
|
|||
|
StockTaskDispBuffer();
|
|||
|
|
|||
|
mapEffectProc(); // ???????????<3F>D??
|
|||
|
|
|||
|
drawMap2(); // ???<3F><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
if( !transmigrationEffectFlag ){
|
|||
|
drawField(); // ??????<3F><>?????<3F><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
/* ?????? */
|
|||
|
ChatProc();
|
|||
|
// ??????????????????????
|
|||
|
ChatBufferToFontBuffer();
|
|||
|
// ?????????<3F><><EFBFBD><EFBFBD>??
|
|||
|
FlashKeyboardCursor();
|
|||
|
// ??????
|
|||
|
MenuProc();
|
|||
|
// ???????
|
|||
|
ImeProc();
|
|||
|
}
|
|||
|
// ??<3F>q?????????????
|
|||
|
TimeZoneProc();
|
|||
|
|
|||
|
/*cary
|
|||
|
#ifdef _STONDEBUG_
|
|||
|
// ?????????
|
|||
|
if( joy_trg[ 0 ] & JOY_P_DOWN ){
|
|||
|
if( pc.ptAct != NULL ){
|
|||
|
resetMap(); // ?????????
|
|||
|
// ???????<3F><>
|
|||
|
if( bNewServer)
|
|||
|
lssproto_EN_send( sockfd, pc.ptAct->gx, pc.ptAct->gy );
|
|||
|
else
|
|||
|
old_lssproto_EN_send( sockfd, pc.ptAct->gx, pc.ptAct->gy );
|
|||
|
eventEnemyFlag = 0;
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
*/
|
|||
|
// ?????????
|
|||
|
if( EncountFlag == TRUE ){
|
|||
|
resetPc(); // PC????
|
|||
|
resetCharObj(); // ?????????????
|
|||
|
resetMap(); // ?????????
|
|||
|
clearPtActPartyParam(); // ??<3F>ѩ<EFBFBD>?????????????NULL???
|
|||
|
fieldInfoTime = 0; // <20><>?<3F>ѩ<EFBFBD>?<3F><>???<3F><>?
|
|||
|
drawFieldInfoWin(); // ?????<3F><>?<3F>ѩ<EFBFBD>
|
|||
|
resetFieldProc(); // ????????????
|
|||
|
nowEncountPercentage = minEncountPercentage;// ?????????<3F><>???
|
|||
|
sendEnFlag = 0;
|
|||
|
encountNowFlag = 1;
|
|||
|
eventEnemySendFlag = 0;
|
|||
|
duelSendFlag = 0;
|
|||
|
jbSendFlag = 0;
|
|||
|
// ?????????????????
|
|||
|
if( MenuToggleFlag & JOY_CTRL_M ) MapWmdFlagBak = TRUE;
|
|||
|
// <20><>???????????
|
|||
|
ResultWndTimer = RESULT_WND_CLOSE_TIME;
|
|||
|
InitMenu(); // ??????????
|
|||
|
BattleCmd[ 0 ] = NULL; // ??????????
|
|||
|
// BattleCmdBak[ 0 ] = NULL; // ??????????
|
|||
|
// BattleCmdReadPointer = BattleCmdWritePointer =0;
|
|||
|
BattleStatus[ 0 ] = NULL; // ???<3F>֢t???
|
|||
|
//BattleStatusBak[ 0 ] = NULL;// ???<3F>֢t???
|
|||
|
// BattleStatusReadPointer = BattleStatusWritePointer =0;
|
|||
|
BattleTurnReceiveFlag = TRUE; // ???<3F><><EFBFBD><EFBFBD>?????
|
|||
|
// ???????
|
|||
|
play_se( 215, 320, 240 );
|
|||
|
// ??????<3F><><EFBFBD>V
|
|||
|
now_bgm = t_music_bgm_no;
|
|||
|
// ???<3F>_<EFBFBD><5F>
|
|||
|
stop_bgm();
|
|||
|
//SubProcNo++;
|
|||
|
ChangeProc2( PROC_GAME, SubProcNo+1 );
|
|||
|
// printf("\nս<6E><D5BD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SubProcNo=%d",SubProcNo+1);
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
case 4: // ??????????<3F><>??????????
|
|||
|
// ????????????<3F><>
|
|||
|
CopyBackBuffer();
|
|||
|
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
BackBufferDrawType = DRAW_BACK_PRODUCE;
|
|||
|
SubProcNo++;
|
|||
|
// printf("\nDRAW_BACK_PRODUCEִ<45><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SubProcNo=%d",SubProcNo);
|
|||
|
break;
|
|||
|
|
|||
|
case 5: // ???????<3F><>
|
|||
|
|
|||
|
// ?<3F><>?
|
|||
|
if( DrawProduce( PRODUCE_HAGARE_OCHI_OUT ) == TRUE ){
|
|||
|
//if( DrawProduce( PRODUCE_RIGHT_ACCELE ) == TRUE ){
|
|||
|
//if( DrawProduce( PRODUCE_LEFT_RIGHT_ACCELE ) == TRUE ){
|
|||
|
//if( GameState == GAME_ENCOUNT_TO_BATTLE ){
|
|||
|
// ????????
|
|||
|
#ifdef _HALLOWEEN_EFFECT
|
|||
|
initMapEffect(FALSE);
|
|||
|
#endif
|
|||
|
ChangeProc( PROC_BATTLE );
|
|||
|
// printf("\nPROC_BATTLE<4C><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SubProcNo=%d",SubProcNo);
|
|||
|
}
|
|||
|
|
|||
|
MenuProc(); // ??????
|
|||
|
// printf("\nMenuProcִ<63><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
ImeProc(); // ???????
|
|||
|
// printf("\nImeProcִ<63><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ????<3F><>?
|
|||
|
void warpEffectProc( void )
|
|||
|
{
|
|||
|
oldMapEffectRainLevel = mapEffectRainLevel;
|
|||
|
oldMapEffectSnowLevel = mapEffectSnowLevel;
|
|||
|
|
|||
|
DispBuffer.DispCnt = 0;
|
|||
|
FontCnt = 0;
|
|||
|
|
|||
|
// ?????????????????
|
|||
|
if( MenuToggleFlag & JOY_CTRL_M ) MapWmdFlagBak = TRUE;
|
|||
|
InitMenu2();
|
|||
|
|
|||
|
fieldProc(); // ?????????
|
|||
|
initCharPartsPrio(); // ?????????<3F>I???<3F>e??????
|
|||
|
openServerWindowProc(); // ????<3F><>?????
|
|||
|
|
|||
|
fieldInfoTime = 0; // <20><>?<3F>ѩ<EFBFBD>?<3F><>???<3F><>?
|
|||
|
drawFieldInfoWin(); // ?????<3F><>?<3F>ѩ<EFBFBD>
|
|||
|
|
|||
|
|
|||
|
/* ????????? */
|
|||
|
RunAction();
|
|||
|
// ???<3F><><EFBFBD><EFBFBD>????????????
|
|||
|
StockTaskDispBuffer();
|
|||
|
|
|||
|
mapEffectProc(); // ???????????<3F>D??
|
|||
|
|
|||
|
redrawMap();
|
|||
|
drawMap(); // ???<3F><><EFBFBD><EFBFBD>
|
|||
|
/* ?????? */
|
|||
|
ChatProc();
|
|||
|
// ??????????????????????
|
|||
|
ChatBufferToFontBuffer();
|
|||
|
// ??<3F>q?????????????
|
|||
|
// TimeZoneProc();
|
|||
|
SortDispBuffer(); // <20><><EFBFBD><EFBFBD>???????
|
|||
|
// ???????????????
|
|||
|
ClearBackSurface();
|
|||
|
// ????????????????
|
|||
|
PutBmp();
|
|||
|
|
|||
|
#ifndef __SKYISLAND
|
|||
|
// ??????????????????????
|
|||
|
lpBattleSurface->BltFast( 0, 0, lpDraw->lpBACKBUFFER, NULL, DDBLTFAST_WAIT );
|
|||
|
#endif
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void repairMap( void )
|
|||
|
{
|
|||
|
float dx, dy;
|
|||
|
#ifdef _MOVE_SCREEN
|
|||
|
if (pc.bMoveScreenMode)
|
|||
|
{
|
|||
|
dx = (float)(+ (-nowGx) * (SURFACE_WIDTH >> 1) + -nowGy * (SURFACE_WIDTH >> 1) + viewOffsetX);
|
|||
|
dy = (float)(- (-nowGx) * (SURFACE_HEIGHT >> 1) + -nowGy * (SURFACE_HEIGHT >> 1) + viewOffsetY);
|
|||
|
}
|
|||
|
else
|
|||
|
#endif
|
|||
|
//
|
|||
|
camMapToGamen( 0.0, 0.0, &dx, &dy );
|
|||
|
|
|||
|
nowXFastDraw = (int)(dx+.5);
|
|||
|
nowYFastDraw = (int)(dy+.5);
|
|||
|
|
|||
|
nowXFastDraw2 = nowXFastDraw;
|
|||
|
nowYFastDraw2 = nowYFastDraw;
|
|||
|
|
|||
|
//???????????????
|
|||
|
if( ResoMode == 1 ){
|
|||
|
nowXFastDraw = (int)(dx/2+.5);
|
|||
|
nowYFastDraw = (int)(dy/2+.5);
|
|||
|
}
|
|||
|
|
|||
|
baseXFastDraw = nowXFastDraw;
|
|||
|
baseYFastDraw = nowYFastDraw;
|
|||
|
amountXFastDraw = nowXFastDraw - baseXFastDraw;
|
|||
|
amountYFastDraw = nowYFastDraw - baseYFastDraw;
|
|||
|
|
|||
|
DispBuffer.DispCnt = 0;
|
|||
|
FontCnt = 0;
|
|||
|
drawTile(); // ???<3F><><EFBFBD><EFBFBD>
|
|||
|
SortDispBuffer(); // <20><><EFBFBD><EFBFBD>???????
|
|||
|
// ???????????????
|
|||
|
//cary 2001 11 8
|
|||
|
ClearBackSurface();
|
|||
|
|
|||
|
// ????????????????
|
|||
|
fastDrawTileFlag = 0;
|
|||
|
PutBmp();
|
|||
|
fastDrawTileFlag = 1;
|
|||
|
#ifndef __SKYISLAND
|
|||
|
// ??????????????????????
|
|||
|
lpBattleSurface->BltFast( 0, 0, lpDraw->lpBACKBUFFER, NULL, DDBLTFAST_WAIT );
|
|||
|
#endif
|
|||
|
DispBuffer.DispCnt = 0;
|
|||
|
FontCnt = 0;
|
|||
|
// ????????
|
|||
|
NowTime = TimeGetTime();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void paletteProc( void )
|
|||
|
{
|
|||
|
if( palNo == -1 )
|
|||
|
{
|
|||
|
// ????????
|
|||
|
// the second PaletteChange( SaTimeZoneNo, 0 );
|
|||
|
PaletteChange( SaTimeZoneNo, palTime );
|
|||
|
// ??<3F>q????????????
|
|||
|
TimeZonePalChangeFlag = TRUE;
|
|||
|
palNo = -2;
|
|||
|
}
|
|||
|
else
|
|||
|
if( palNo >= 0 )
|
|||
|
{
|
|||
|
// ?<3F>e????<3F>@<40>e
|
|||
|
// the second PaletteChange( palNo, 0 );// ????????
|
|||
|
PaletteChange( palNo, palTime );// ????????
|
|||
|
// ??<3F>q?????????????
|
|||
|
TimeZonePalChangeFlag = FALSE;
|
|||
|
palNo = -2;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#ifdef _SURFACE_ANIM
|
|||
|
extern ACTION *SPACT[MAX_ANIM];
|
|||
|
void AniProc()
|
|||
|
{
|
|||
|
float mx,my;
|
|||
|
|
|||
|
for (int i = 0; i < MAX_ANIM; i++)
|
|||
|
{
|
|||
|
if(SPACT[i] != NULL)
|
|||
|
{
|
|||
|
camMapToGamen(SPACT[i]->mx, SPACT[i]->my, &mx, &my);
|
|||
|
if(SPACT[i]->anim_chr_no > 102002){
|
|||
|
SPACT[i]->x = (int)(mx - 5);
|
|||
|
SPACT[i]->y = (int)(my + 8);
|
|||
|
}else{
|
|||
|
SPACT[i]->x = (int)(mx +.5);
|
|||
|
SPACT[i]->y = (int)(my +.5);
|
|||
|
}
|
|||
|
pattern(SPACT[i], ANM_NOMAL_SPD, ANM_LOOP);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|