stoneage8.5/石器时代8.5客户端最新源代码/石器源码/system/process.cpp

873 lines
20 KiB
C++
Raw Permalink Normal View History

2020-06-23 15:53:23 +08:00
/************************/
2020-06-23 15:27:59 +08:00
/* 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_
2020-06-23 15:53:23 +08:00
BOOL =TRUE;
2020-06-23 15:27:59 +08:00
#endif
/* ???????? *******************************************************************/
extern void kakushi_command(void);
2020-06-23 15:53:23 +08:00
/* ????吻? */
2020-06-23 15:27:59 +08:00
UINT ProcNo;
2020-06-23 15:53:23 +08:00
/* ??????吻? */
2020-06-23 15:27:59 +08:00
UINT SubProcNo;
2020-06-23 15:53:23 +08:00
/* ????吻?(?????????▔??) */
2020-06-23 15:27:59 +08:00
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;
}
2020-06-23 15:53:23 +08:00
/* ????希? */
2020-06-23 15:27:59 +08:00
switch (ProcNo)
{
case PROC_OPENNING:
break;
case PROC_INIT: /* ??????? */
InitProc();
initMapEffect(TRUE); // ???????????
break;
2020-06-23 15:53:23 +08:00
// ????????向???
2020-06-23 15:27:59 +08:00
case PROC_ID_PASSWORD:
#ifdef _NEW_MUISC_
2020-06-23 15:53:23 +08:00
if() {
=FALSE;
2020-06-23 15:27:59 +08:00
play_bgm(27);
}
#endif
BackBufferDrawType = DRAW_BACK_NORMAL;
idPasswordProc();
#ifdef _PET_TRACE_MOUSE
PlayPet.Proc();
#endif
RunAction(); // ?????????
2020-06-23 15:53:23 +08:00
StockTaskDispBuffer(); // ???牙????????????
FlashKeyboardCursor(); // ?????????????
2020-06-23 15:27:59 +08:00
ImeProc(); // ???????
#ifdef _LOGINKICK
extern DWORD StartTime;
StartTime = -1 ;
#endif
break;
2020-06-23 15:53:23 +08:00
// ????牙?????︻?
2020-06-23 15:27:59 +08:00
case PROC_TITLE_MENU:
2020-06-23 15:53:23 +08:00
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_NORMAL;
titleProc();
2020-06-23 15:53:23 +08:00
TitleProduce(); // ?????
2020-06-23 15:27:59 +08:00
RunAction(); // ?????????
2020-06-23 15:53:23 +08:00
StockTaskDispBuffer(); // ???牙????????????
2020-06-23 15:27:59 +08:00
//cary 2002.1.4 kakushi_command(); // ????????
break;
2020-06-23 15:53:23 +08:00
// ???︻??
case PROC_CHAR_SELECT: // ???︻?
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_NORMAL;
selectCharacterProc();
break;
2020-06-23 15:53:23 +08:00
// ????
2020-06-23 15:27:59 +08:00
case PROC_CHAR_MAKE:
2020-06-23 15:53:23 +08:00
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_NORMAL;
makeCharacterProc();
break;
2020-06-23 15:53:23 +08:00
// ︻???????????
2020-06-23 15:27:59 +08:00
case PROC_CHAR_LOGIN_START:
2020-06-23 15:53:23 +08:00
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_NORMAL;
// charLoginStart();???????????????????
// ?????????????
initMap(); // ??????
2020-06-23 15:53:23 +08:00
initPcAll(); // PC??????????
2020-06-23 15:27:59 +08:00
initCharObj(); // ????????????
2020-06-23 15:53:23 +08:00
initOpenServerWindow(); // ?????牙???????????
initFieldProc(); // ??????牙岌????
2020-06-23 15:27:59 +08:00
initMapEffect(FALSE); // ???????????
EncountFlag = FALSE;
logOutFlag = FALSE;
2020-06-23 15:53:23 +08:00
InitOhtaParam(); // ??????????兣?﹐??
2020-06-23 15:27:59 +08:00
#ifdef __SKYISLAND
extern void SkyIslandInit();
SkyIslandInit();
#endif
ChangeProc( PROC_CHAR_LOGIN );
2020-06-23 15:53:23 +08:00
// ???????????
2020-06-23 15:27:59 +08:00
fade_out_bgm();
break;
case PROC_CHAR_LOGIN:
2020-06-23 15:53:23 +08:00
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_NORMAL;
characterLoginProc();
break;
// ?????
case PROC_CHAR_LOGOUT:
2020-06-23 15:53:23 +08:00
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
// BackBufferDrawType = DRAW_BACK_NORMAL;
characterLogoutProc();
break;
case PROC_GAME: /* ??????? */
GameProc();
break;
case PROC_DISCONNECT_SERVER:
switch (SubProcNo)
{
case 0:
// ???
// PC????
resetPc();
// ?????????????
initCharObj();
2020-06-23 15:53:23 +08:00
// ??????
2020-06-23 15:27:59 +08:00
DeathAllAction();
2020-06-23 15:53:23 +08:00
// ?????
2020-06-23 15:27:59 +08:00
ProduceInitFlag = TRUE;
2020-06-23 15:53:23 +08:00
// ????????????
2020-06-23 15:27:59 +08:00
CopyBackBuffer();
2020-06-23 15:53:23 +08:00
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_PRODUCE;
2020-06-23 15:53:23 +08:00
// ???????????
2020-06-23 15:27:59 +08:00
fade_out_bgm();
// ????????
NowTime = TimeGetTime();
SubProcNo++;
break;
case 1:
2020-06-23 15:53:23 +08:00
// ??
2020-06-23 15:27:59 +08:00
if (DrawProduce(PRODUCE_DOWN_ACCELE) == TRUE)
{
BackBufferDrawType = DRAW_BACK_NORMAL;
SubProcNo++;
}
break;
case 2:
2020-06-23 15:53:23 +08:00
// ????
2020-06-23 15:27:59 +08:00
break;
}
2020-06-23 15:53:23 +08:00
// κ?????????
2020-06-23 15:27:59 +08:00
if (disconnectServer())
{
// ?????????
cleanupNetwork();
// ????????????
PaletteChange(DEF_PAL, 0);
2020-06-23 15:53:23 +08:00
// ???????
2020-06-23 15:27:59 +08:00
//cary
ChangeProc( PROC_ID_PASSWORD );
SubProcNo = 0;
2020-06-23 15:53:23 +08:00
// ??????
2020-06-23 15:27:59 +08:00
DeathAllAction();
disconnectServerFlag = FALSE;
oldDisconnectServerFlag = FALSE;
break;
}
RunAction(); // ?????????
2020-06-23 15:53:23 +08:00
StockTaskDispBuffer(); // ???牙????????????
2020-06-23 15:27:59 +08:00
break;
case PROC_BATTLE: /* ??????? */
BattleProc();
break;
#ifdef _STONDEBUG_
2020-06-23 15:53:23 +08:00
//case PROC_OHTA_TEST: /* 兣???????? */
2020-06-23 15:27:59 +08:00
// OhtaTestProc();
// break;
2020-06-23 15:53:23 +08:00
//case PROC_TAKE_TEST: /* ㄌ?????????? */
2020-06-23 15:27:59 +08:00
// TakeTestProc();
// break;
//case PROC_DWAF_TEST: // DWAF???
// dwafTestProc();
// break;
2020-06-23 15:53:23 +08:00
case PROC_SPR_VIEW: // ??????囝????
2020-06-23 15:27:59 +08:00
SprViewProc();
break;
2020-06-23 15:53:23 +08:00
case PROC_ANIM_VIEW: // ????????囝????
2020-06-23 15:27:59 +08:00
AnimViewProc();
break;
2020-06-23 15:53:23 +08:00
case PROC_SE_TEST: // ???囝????
2020-06-23 15:27:59 +08:00
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;
}
}
2020-06-23 15:53:23 +08:00
/* ????阪??? ***********************************************************/
2020-06-23 15:27:59 +08:00
void ChangeProc( int procNo )
{
#ifdef _NEW_MUISC_
if(PROC_ID_PASSWORD==procNo){
2020-06-23 15:53:23 +08:00
=TRUE;
2020-06-23 15:27:59 +08:00
//t_music_se_volume = t_music_bgm_volume = 15;
}
#endif
ProcNo = procNo;
2020-06-23 15:53:23 +08:00
// ??????吻?????
2020-06-23 15:27:59 +08:00
SubProcNo = 0;
}
2020-06-23 15:53:23 +08:00
/* ????阪??? ***********************************************************/
2020-06-23 15:27:59 +08:00
void ChangeProc( int procNo, int subProcNo )
{
2020-06-23 15:53:23 +08:00
// ????吻????
2020-06-23 15:27:59 +08:00
ProcNo = procNo;
2020-06-23 15:53:23 +08:00
// ??????吻?????
2020-06-23 15:27:59 +08:00
SubProcNo = subProcNo;
}
2020-06-23 15:53:23 +08:00
/* ????阪???????????????▔???**************************/
2020-06-23 15:27:59 +08:00
void ChangeProc2( int procNo )
{
2020-06-23 15:53:23 +08:00
// ????吻????
2020-06-23 15:27:59 +08:00
ProcNo2 = procNo;
SubProcNo2 = 0;
}
2020-06-23 15:53:23 +08:00
/* ????阪??? ***********************************************************/
2020-06-23 15:27:59 +08:00
void ChangeProc2( int procNo, int subProcNo )
{
2020-06-23 15:53:23 +08:00
// ????吻????
2020-06-23 15:27:59 +08:00
ProcNo2 = procNo;
2020-06-23 15:53:23 +08:00
// ??????吻?????
2020-06-23 15:27:59 +08:00
SubProcNo2 = subProcNo;
}
void GameProc( void )
{
static int now_bgm;
static BOOL produceFlag;
switch( SubProcNo ){
case 0:
2020-06-23 15:53:23 +08:00
//cary 滅砦婬棒腎奀腔弝敦紹隱
2020-06-23 15:27:59 +08:00
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();
2020-06-23 15:53:23 +08:00
// BattleStatusBak[ 0 ] = NULL;// ???┤???
2020-06-23 15:27:59 +08:00
// BattleStatusReadPointer = BattleStatusWritePointer =0;
GetKeyInputFocus( &MyChatBuffer );
SubProcNo++;
case 101:
if( loginFlag ){
BackBufferDrawType = DRAW_BACK_NORMAL;
break;
}
SubProcNo++;
case 102:
paletteProc();
DispBuffer.DispCnt = 0;
FontCnt = 0;
2020-06-23 15:53:23 +08:00
initCharPartsPrio(); // ????????????叉??????
2020-06-23 15:27:59 +08:00
RunAction(); // ?????????
2020-06-23 15:53:23 +08:00
StockTaskDispBuffer(); // ???牙????????????
stop_bgm(); //???于
drawMap(); // ???牙
2020-06-23 15:27:59 +08:00
MenuProc(); // ??????
ChatProc(); // ??????
ChatBufferToFontBuffer(); // ??????????????????????
ImeProc(); // ???????
2020-06-23 15:53:23 +08:00
SortDispBuffer(); // 牙???????
2020-06-23 15:27:59 +08:00
// ???????????????
ClearBackSurface();
// ????????????????
PutBmp();
// ??????????????????????
lpBattleSurface->BltFast( 0, 0, lpDraw->lpBACKBUFFER, NULL, DDBLTFAST_WAIT );
// ???????
DispBuffer.DispCnt = 0;
FontCnt = 0;
play_bgm( map_bgm_no );
// ????????
NowTime = TimeGetTime();
2020-06-23 15:53:23 +08:00
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
// BackBufferDrawType = DRAW_BACK_NORMAL;
BackBufferDrawType = DRAW_BACK_PRODUCE;
2020-06-23 15:53:23 +08:00
// ??
2020-06-23 15:27:59 +08:00
ProduceInitFlag = TRUE;
DrawProduce( PRODUCE_BRAN_BIG );
/*#ifdef __SKYISLAND
ClearBackSurface();
#endif*/
SubProcNo++;
break;
case 103:
2020-06-23 15:53:23 +08:00
// ??
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_PRODUCE;
if( DrawProduce( PRODUCE_BRAN_BIG ) == TRUE )
{
produceFlag = TRUE;
fieldInfoTime = TimeGetTime();
if( fastDrawTile )
{
SubProcNo = 20;
}
else
{
SubProcNo = 3;
}
}
break;
2020-06-23 15:53:23 +08:00
// ????
2020-06-23 15:27:59 +08:00
case 200:
ProduceInitFlag = TRUE;
// ???????
DispBuffer.DispCnt = 0;
FontCnt = 0;
// ????????
NowTime = TimeGetTime();
// S??????C? warpEffectProc();?????
2020-06-23 15:53:23 +08:00
// ?????????????????
2020-06-23 15:27:59 +08:00
SubProcNo++;
case 201:
2020-06-23 15:53:23 +08:00
// ??
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_PRODUCE;
if( DrawProduce( PRODUCE_CENTER_PRESSIN ) == TRUE )
{
SubProcNo++;
}
2020-06-23 15:53:23 +08:00
drawField(); // ????????????牙
2020-06-23 15:27:59 +08:00
MenuProc(); // ??????
ImeProc(); // ???????
break;
case 202:
if( !warpEffectStart || !warpEffectOk )
{
BackBufferDrawType = DRAW_BACK_NORMAL;
2020-06-23 15:53:23 +08:00
drawField(); // ????????????牙
2020-06-23 15:27:59 +08:00
MenuProc(); // ??????
ImeProc(); // ???????
break;
}
warpEffectStart = FALSE;
warpEffectOk = FALSE;
SubProcNo++;
case 203:
2020-06-23 15:53:23 +08:00
// ?????
2020-06-23 15:27:59 +08:00
// ???????
paletteProc();
DispBuffer.DispCnt = 0;
FontCnt = 0;
2020-06-23 15:53:23 +08:00
initCharPartsPrio(); // ????????????叉??????
2020-06-23 15:27:59 +08:00
RunAction(); // ?????????
2020-06-23 15:53:23 +08:00
StockTaskDispBuffer(); // ???牙????????????
2020-06-23 15:27:59 +08:00
redrawMap();
2020-06-23 15:53:23 +08:00
drawMap(); // ???牙
2020-06-23 15:27:59 +08:00
// ?????????
if( (mapEffectRainLevel == 0 && oldMapEffectRainLevel != 0 )
|| (mapEffectSnowLevel == 0 && oldMapEffectSnowLevel != 0 )
)
initMapEffect(FALSE);
ChatProc(); // ??????
ChatBufferToFontBuffer(); // ??????????????????????
2020-06-23 15:53:23 +08:00
SortDispBuffer(); // 牙???????
2020-06-23 15:27:59 +08:00
// ???????????????
ClearBackSurface();
if( (mapEffectRainLevel != 0 && oldMapEffectRainLevel == 0 )
|| (mapEffectSnowLevel != 0 && oldMapEffectSnowLevel == 0 ) )
2020-06-23 15:53:23 +08:00
mapEffectProc2( 80 ); // ?????????????
2020-06-23 15:27:59 +08:00
// ????????????????
PutBmp();
// ??????????????????????
lpBattleSurface->BltFast( 0, 0, lpDraw->lpBACKBUFFER, NULL, DDBLTFAST_WAIT );
// ???????
DispBuffer.DispCnt = 0;
FontCnt = 0;
// if( map_bgm_no != now_bgm )
// {
2020-06-23 15:53:23 +08:00
// stop_bgm(); //???于
2020-06-23 15:27:59 +08:00
// play_bgm( map_bgm_no );
// }
// ????????
NowTime = TimeGetTime();
ProduceInitFlag = TRUE;
SubProcNo++;
case 204:
2020-06-23 15:53:23 +08:00
// ??
2020-06-23 15:27:59 +08:00
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
}
2020-06-23 15:53:23 +08:00
drawField(); // ????????????牙
2020-06-23 15:27:59 +08:00
MenuProc(); // ??????
ImeProc(); // ???????
break;
case 1:
2020-06-23 15:53:23 +08:00
initPc(); // ?????????
2020-06-23 15:27:59 +08:00
resetFieldProc(); // ????????????
restorePtActCharObjAll(); // ?????????????????
2020-06-23 15:53:23 +08:00
initOpenServerWindow(); // ?????牙???????????
2020-06-23 15:27:59 +08:00
InitMenu(); // ??????????
2020-06-23 15:53:23 +08:00
// BattleStatusBak[ 0 ] = NULL;// ???┤???
2020-06-23 15:27:59 +08:00
// BattleStatusReadPointer = BattleStatusWritePointer =0;
2020-06-23 15:53:23 +08:00
// 向??????台
2020-06-23 15:27:59 +08:00
GetKeyInputFocus( &MyChatBuffer );
2020-06-23 15:53:23 +08:00
// ????
2020-06-23 15:27:59 +08:00
if( produceFlag == TRUE ){
2020-06-23 15:53:23 +08:00
// ·卯????????????
2020-06-23 15:27:59 +08:00
//if( BattleResultWndFlag == TRUE ){
2020-06-23 15:53:23 +08:00
// ?????
2020-06-23 15:27:59 +08:00
// ???????
DispBuffer.DispCnt = 0;
FontCnt = 0;
2020-06-23 15:53:23 +08:00
initCharPartsPrio(); // ????????????叉??????
2020-06-23 15:27:59 +08:00
RunAction(); // ?????????
2020-06-23 15:53:23 +08:00
StockTaskDispBuffer(); // ???牙????????????
stop_bgm(); //???于
2020-06-23 15:27:59 +08:00
updateMapArea();
redrawMap();
2020-06-23 15:53:23 +08:00
drawMap(); // ???牙
2020-06-23 15:27:59 +08:00
//????????
if(!draw_map_bgm_flg){
2020-06-23 15:53:23 +08:00
//????????
2020-06-23 15:27:59 +08:00
play_bgm(map_bgm_no = now_bgm);
draw_map_bgm_flg = 1;
}
MenuProc(); // ??????
2020-06-23 15:53:23 +08:00
// ???????主???????
2020-06-23 15:27:59 +08:00
//StockBoxDispBuffer( 0, 456, lpDraw->xSize, lpDraw->ySize, DISP_PRIO_MENU, 0, 1 );
ChatProc(); // ??????
ChatBufferToFontBuffer(); // ??????????????????????
ImeProc(); // ???????
2020-06-23 15:53:23 +08:00
SortDispBuffer(); // 牙???????
2020-06-23 15:27:59 +08:00
// ???????????????
ClearBackSurface();
// ????????????????
PutBmp();
// ??????????????????????
lpBattleSurface->BltFast( 0, 0, lpDraw->lpBACKBUFFER, NULL, DDBLTFAST_WAIT );
// ???????
DispBuffer.DispCnt = 0;
FontCnt = 0;
// ????????
NowTime = TimeGetTime();
2020-06-23 15:53:23 +08:00
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_PRODUCE;
2020-06-23 15:53:23 +08:00
// ??
2020-06-23 15:27:59 +08:00
DrawProduce( PRODUCE_4WAY_IN );
}else{
2020-06-23 15:53:23 +08:00
// ??????
2020-06-23 15:27:59 +08:00
produceFlag = TRUE;
SubProcNo++;
}
SubProcNo++;
break;
2020-06-23 15:53:23 +08:00
case 2: // ????????
// ??
2020-06-23 15:27:59 +08:00
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:
2020-06-23 15:53:23 +08:00
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_NORMAL;
paletteProc();
2020-06-23 15:53:23 +08:00
initItemOverlapCheck(); // ????????????????
2020-06-23 15:27:59 +08:00
if( !transmigrationEffectFlag ){
2020-06-23 15:53:23 +08:00
drawGrid(); // ????????牙
2020-06-23 15:27:59 +08:00
fieldProc(); // ?????????
// Nuke 0407
if( bNewServer){
2020-06-23 15:53:23 +08:00
moveProc(); // ?去??
2020-06-23 15:27:59 +08:00
}else
2020-06-23 15:53:23 +08:00
moveProc(); // ?去??
2020-06-23 15:27:59 +08:00
}
2020-06-23 15:53:23 +08:00
initCharPartsPrio(); // ????????????叉??????
2020-06-23 15:27:59 +08:00
//addressBookProc(); // ?????????
2020-06-23 15:53:23 +08:00
openServerWindowProc(); // ?????????
drawFieldInfoWin(); // ???????
2020-06-23 15:27:59 +08:00
/* ????????? */
RunAction();
2020-06-23 15:53:23 +08:00
// ???牙????????????
// 叉吳?????????
2020-06-23 15:27:59 +08:00
StockTaskDispBuffer();
2020-06-23 15:53:23 +08:00
mapEffectProc(); // ?????????????
2020-06-23 15:27:59 +08:00
2020-06-23 15:53:23 +08:00
drawMap2(); // ???牙
2020-06-23 15:27:59 +08:00
if( !transmigrationEffectFlag ){
2020-06-23 15:53:23 +08:00
drawField(); // ????????????牙
2020-06-23 15:27:59 +08:00
/* ?????? */
ChatProc();
// ??????????????????????
ChatBufferToFontBuffer();
2020-06-23 15:53:23 +08:00
// ?????????????
2020-06-23 15:27:59 +08:00
FlashKeyboardCursor();
// ??????
MenuProc();
// ???????
ImeProc();
}
2020-06-23 15:53:23 +08:00
// ??┼?????????????
2020-06-23 15:27:59 +08:00
TimeZoneProc();
/*cary
#ifdef _STONDEBUG_
// ?????????
if( joy_trg[ 0 ] & JOY_P_DOWN ){
if( pc.ptAct != NULL ){
resetMap(); // ?????????
2020-06-23 15:53:23 +08:00
// ???????
2020-06-23 15:27:59 +08:00
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(); // ?????????
2020-06-23 15:53:23 +08:00
clearPtActPartyParam(); // ????????????????NULL???
fieldInfoTime = 0; // ???????
drawFieldInfoWin(); // ???????
2020-06-23 15:27:59 +08:00
resetFieldProc(); // ????????????
2020-06-23 15:53:23 +08:00
nowEncountPercentage = minEncountPercentage;// ????????????
2020-06-23 15:27:59 +08:00
sendEnFlag = 0;
encountNowFlag = 1;
eventEnemySendFlag = 0;
duelSendFlag = 0;
jbSendFlag = 0;
// ?????????????????
if( MenuToggleFlag & JOY_CTRL_M ) MapWmdFlagBak = TRUE;
2020-06-23 15:53:23 +08:00
// ???????????
2020-06-23 15:27:59 +08:00
ResultWndTimer = RESULT_WND_CLOSE_TIME;
InitMenu(); // ??????????
BattleCmd[ 0 ] = NULL; // ??????????
// BattleCmdBak[ 0 ] = NULL; // ??????????
// BattleCmdReadPointer = BattleCmdWritePointer =0;
2020-06-23 15:53:23 +08:00
BattleStatus[ 0 ] = NULL; // ???┤???
//BattleStatusBak[ 0 ] = NULL;// ???┤???
2020-06-23 15:27:59 +08:00
// BattleStatusReadPointer = BattleStatusWritePointer =0;
2020-06-23 15:53:23 +08:00
BattleTurnReceiveFlag = TRUE; // ????????
2020-06-23 15:27:59 +08:00
// ???????
play_se( 215, 320, 240 );
2020-06-23 15:53:23 +08:00
// ??????卒㎏
2020-06-23 15:27:59 +08:00
now_bgm = t_music_bgm_no;
2020-06-23 15:53:23 +08:00
// ???于
2020-06-23 15:27:59 +08:00
stop_bgm();
//SubProcNo++;
ChangeProc2( PROC_GAME, SubProcNo+1 );
2020-06-23 15:53:23 +08:00
// printf("\n桵須啎揭燴硒俴俇救 SubProcNo=%d",SubProcNo+1);
2020-06-23 15:27:59 +08:00
}
break;
2020-06-23 15:53:23 +08:00
case 4: // ????????????????????
// ????????????
2020-06-23 15:27:59 +08:00
CopyBackBuffer();
2020-06-23 15:53:23 +08:00
// ????????丙???阪?
2020-06-23 15:27:59 +08:00
BackBufferDrawType = DRAW_BACK_PRODUCE;
SubProcNo++;
2020-06-23 15:53:23 +08:00
// printf("\nDRAW_BACK_PRODUCE硒俴俇救 SubProcNo=%d",SubProcNo);
2020-06-23 15:27:59 +08:00
break;
2020-06-23 15:53:23 +08:00
case 5: // ???????
2020-06-23 15:27:59 +08:00
2020-06-23 15:53:23 +08:00
// ??
2020-06-23 15:27:59 +08:00
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 );
2020-06-23 15:53:23 +08:00
// printf("\nPROC_BATTLE載遙俇救 SubProcNo=%d",SubProcNo);
2020-06-23 15:27:59 +08:00
}
MenuProc(); // ??????
2020-06-23 15:53:23 +08:00
// printf("\nMenuProc硒俴俇救");
2020-06-23 15:27:59 +08:00
ImeProc(); // ???????
2020-06-23 15:53:23 +08:00
// printf("\nImeProc硒俴俇救");
2020-06-23 15:27:59 +08:00
break;
}
}
2020-06-23 15:53:23 +08:00
// ?????
2020-06-23 15:27:59 +08:00
void warpEffectProc( void )
{
oldMapEffectRainLevel = mapEffectRainLevel;
oldMapEffectSnowLevel = mapEffectSnowLevel;
DispBuffer.DispCnt = 0;
FontCnt = 0;
// ?????????????????
if( MenuToggleFlag & JOY_CTRL_M ) MapWmdFlagBak = TRUE;
InitMenu2();
fieldProc(); // ?????????
2020-06-23 15:53:23 +08:00
initCharPartsPrio(); // ????????????叉??????
openServerWindowProc(); // ?????????
2020-06-23 15:27:59 +08:00
2020-06-23 15:53:23 +08:00
fieldInfoTime = 0; // ???????
drawFieldInfoWin(); // ???????
2020-06-23 15:27:59 +08:00
/* ????????? */
RunAction();
2020-06-23 15:53:23 +08:00
// ???牙????????????
2020-06-23 15:27:59 +08:00
StockTaskDispBuffer();
2020-06-23 15:53:23 +08:00
mapEffectProc(); // ?????????????
2020-06-23 15:27:59 +08:00
redrawMap();
2020-06-23 15:53:23 +08:00
drawMap(); // ???牙
2020-06-23 15:27:59 +08:00
/* ?????? */
ChatProc();
// ??????????????????????
ChatBufferToFontBuffer();
2020-06-23 15:53:23 +08:00
// ??┼?????????????
2020-06-23 15:27:59 +08:00
// TimeZoneProc();
2020-06-23 15:53:23 +08:00
SortDispBuffer(); // 牙???????
2020-06-23 15:27:59 +08:00
// ???????????????
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;
2020-06-23 15:53:23 +08:00
drawTile(); // ???牙
SortDispBuffer(); // 牙???????
2020-06-23 15:27:59 +08:00
// ???????????????
//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 );
2020-06-23 15:53:23 +08:00
// ??┼????????????
2020-06-23 15:27:59 +08:00
TimeZonePalChangeFlag = TRUE;
palNo = -2;
}
else
if( palNo >= 0 )
{
2020-06-23 15:53:23 +08:00
// ?叉???? 叉
2020-06-23 15:27:59 +08:00
// the second PaletteChange( palNo, 0 );// ????????
PaletteChange( palNo, palTime );// ????????
2020-06-23 15:53:23 +08:00
// ??┼?????????????
2020-06-23 15:27:59 +08:00
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