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

1173 lines
29 KiB
C++
Raw Normal View History

2020-06-23 15:27:59 +08:00
/************************/
/* battleProc.cpp */
/************************/
#include "../systeminc/version.h"
#include "../systeminc/system.h"
#include "../other/caryIme.h"
#include "../systeminc/ime_sa.h"
#include "../systeminc/map.h"
#include "../systeminc/menu.h"
#include "../systeminc/battlemap.h"
#include "../systeminc/battleProc.h"
#include "../systeminc/battleMenu.h"
#include "../systeminc/battleMap.h"
#include "../systeminc/produce.h"
#include "../systeminc/lssproto_cli.h"
#include "../systeminc/netmain.h"
#include "../systeminc/t_music.h"
#include "../systeminc/pc.h"
#include "../systeminc/character.h"
#include "../systeminc/handletime.h"
#include "../systeminc/savedata.h"
#include "../systeminc/field.h"
extern ACTION* oft_test();
extern void damage_num( ACTION *a0 );
extern void WindowDisp( ACTION *a0 );
extern int piyo_point;
extern void set_bc( void );
extern void disp_kanji(ACTION *a0);
extern BOOL bNewServer;
#ifdef _PROFESSION_ADDSKILL
extern ACTION *boundary_2,*boundary_mark[2];
#endif
#ifdef __ATTACK_MAGIC
// Global vars
extern int g_iRunEarthQuake; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״<EFBFBD><D7B4>: 0 --> û<><C3BB><EFBFBD><EFBFBD> , 1 --> <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> , 2 --> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern int g_iCurRunEarthQuake; // Ŀǰ<C4BF><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
extern int g_iNumRunEarthQuake; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD>
#endif
extern BOOL BattlingFlag;
int flash_pal_cnt;
PALETTEENTRY Palette2[256]; // ?????<3F>B<EFBFBD>l
// ?????????
BOOL EncountFlag = FALSE;
// ???????
BOOL DuelFlag = FALSE;
// ???<3F><>???
BOOL NoHelpFlag = FALSE;
#ifdef _MAGIC_NOCAST//<2F><>Ĭ
BOOL NoCastFlag = FALSE;
#endif
// ???????????
BOOL EncountOffFlag = FALSE;
// ?<3F><>??<3F>K<EFBFBD><4B>?????
BOOL Battle1P2PFlag;
// <20><>?<3F>e?<3F><><EFBFBD><EFBFBD>?????
ACTION* pActSurprisalWnd;
ACTION* pActAudienceExitWnd;
#ifdef _NEWDRAWBATTLEMAP // (<28><><EFBFBD>ɿ<EFBFBD><C9BF><EFBFBD>) Syu ADD <20>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>BattleMap
static ACTION *BattleWaterAct[8]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#endif
// <20>u<EFBFBD><75>??????
extern int check_all_dead( void );
// ????????
extern char att_select_flg;
// ???
// ??????????
int BattleDebTurnNo = 0;
// ?????????
char *BattleBcDeb[] =
{
#include "../systeminc/BattleBcDeb.h"
};
// ??????????
char *BattleCmdDeb[] =
{
#include "../systeminc/BattleMvDeb.h"
};
extern
/* <20>P<EFBFBD>f<EFBFBD><66><EFBFBD><EFBFBD> *********************************************************/
void battle_quake( void )
{
switch(quake_vct_no){
case 0: //??<3F><>?
break;
case 1: //<2F><><EFBFBD><EFBFBD>?<3F><>
quake_flg = 60;
quake_vct_no = 2;
break;
case 2: //<2F><><EFBFBD><EFBFBD>?
if(quake_flg >= 16){
piyo_point += 16;
} else {
piyo_point += quake_flg;
}
piyo_point &= 63;
if(!--quake_flg){ //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>???
quake_vct_no = 0;
}
break;
}
#ifdef __ATTACK_MAGIC
switch( g_iRunEarthQuake )
{
// û<><C3BB><EFBFBD><EFBFBD>
case 0:
break;
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
case 1:
g_iRunEarthQuake = 2;
break;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
case 2:
if( g_iNumRunEarthQuake >= 16 )
g_iCurRunEarthQuake += 16;
else
g_iCurRunEarthQuake += g_iNumRunEarthQuake;
g_iCurRunEarthQuake &= 63;
if( 0 == --g_iNumRunEarthQuake )
g_iRunEarthQuake = 0;
break;
}
#endif
}
/* ?<3F><>????? *********************************************************/
void die_flash( void )
{
int d0 = 0;
int d1,d7;
return;
switch(flash_vct_no){
case 0:
break;
//?????????? ?<3F><> ??????????
case 1:
flash_vct_no++;
break;
case 2:
for( d7 = 0; d7 < 10; d7++ ){
Palette2[d7].peBlue = Palette[d7].peBlue;
Palette2[d7].peGreen = Palette[d7].peGreen;
Palette2[d7].peRed = Palette[d7].peRed;
Palette2[d7].peFlags = Palette[d7].peFlags;
Palette2[d7+246].peBlue = Palette[d7+246].peBlue;
Palette2[d7+246].peGreen = Palette[d7+246].peGreen;
Palette2[d7+246].peRed = Palette[d7+246].peRed;
Palette2[d7+246].peFlags = Palette[d7].peFlags;
}
for( d7 = 10; d7 < 246; d7++ ){ //??????????
Palette2[d7].peBlue = Palette[d7].peBlue;
Palette2[d7].peGreen = Palette[d7].peGreen;
Palette2[d7].peRed = 0xff;
Palette2[d7].peFlags = Palette[d7].peFlags;
}
#ifndef D3D_ENGINE
lpDraw->lpPALETTE->SetEntries(0, 0, 256, Palette2);
#endif
flash_pal_cnt = 20;
flash_vct_no++;
break;
case 3:
if(--flash_pal_cnt){
break;
}
flash_vct_no++;
break;
case 4:
for(d7=10; d7<246; d7++){
if(Palette2[d7].peRed == Palette[d7].peRed){
continue;
}
d0 = 1;
d1 = Palette2[d7].peRed - Palette[d7].peRed;
if(d1 > 3)
d1 = 3;
if(d1 < -3)
d1 = -3;
Palette2[d7].peRed -= d1;
}
if(WindowMode){ //??????????
flash_pal_cnt++;
if(flash_pal_cnt == 10){ //<2F><>??<3F>u??
flash_pal_cnt = 0;
#ifndef D3D_ENGINE
lpDraw->lpPALETTE->SetEntries( 0, 0, 256, Palette2 );
#endif
} else {
d0 = 1; //<2F><>????
}
} else {
#ifndef D3D_ENGINE
lpDraw->lpPALETTE->SetEntries( 0, 0, 256, Palette2 );
#endif
}
if(d0 == 0){ //<2F><>???
flash_vct_no = 0;
}
break;
}
}
/* ???????<3F>k<EFBFBD><6B><EFBFBD><EFBFBD> *********************************************************/
void damage_dispx( void )
{
ACTION *pActLoop = pActTop->pNext; /* <20>I<EFBFBD>d????????<3F><><EFBFBD>x */
ACTION *pActLoopBak; /* ?<3F><>???????? */
// ?????
while(1){
/* ??<3F><>???????? */
if( pActLoop == pActBtm ) break;
/* <20><>????? */
if( pActLoop->deathFlag == FALSE ){
/* Pd( pActLoop->prio ); */
/* ?????????<3F><>? */
if( pActLoop->func == damage_num ){
damage_num(pActLoop);
}
if( pActLoop->func == WindowDisp ){
WindowDisp(pActLoop);
}
if( pActLoop->func == disp_kanji ){
disp_kanji(pActLoop);
}
/* ?????????? */
pActLoop = pActLoop->pNext;
}else{ /* ?????? */
/* <20>q????? */
pActLoop->pPrev->pNext = pActLoop->pNext;
pActLoop->pNext->pPrev = pActLoop->pPrev;
/* ?????? */
pActLoopBak = pActLoop->pNext;
/* ??????<3F><> */
ClearAction( pActLoop );
/* ???????? */
pActLoop = pActLoopBak;
}
}
}
// <20><>?<3F>e?<3F><><EFBFBD><EFBFBD>?? **************************************************************/
void SurprisalDisp( void )
{
// <20><>???????????
if( BattleBpFlag & BATTLE_BP_ENEMY_SURPRISAL || BattleBpFlag & BATTLE_BP_PLAYER_SURPRISAL ){
// ?????<3F><>????
if( pActSurprisalWnd == NULL ){
// ?????<3F><><EFBFBD><EFBFBD>????<3F><>
pActSurprisalWnd = MakeWindowDisp( 320 - 96, 240 - 48, 3, 2, NULL, 1 );
// ????????
play_se( 202, 320, 240 );
}
// ?????<3F><>????????
if( pActSurprisalWnd->hp > 0 ){
// ????????<3F><>????
if( MenuToggleFlag & JOY_CTRL_E || MenuToggleFlag & JOY_CTRL_A ){
if( pActSurprisalWnd->x < 320 - 96 + 56 ) pActSurprisalWnd->x += 6;
}else{
if( pActSurprisalWnd->x > 320 - 96 ) pActSurprisalWnd->x -= 6;
}
// <20><>?<3F><>???????<3F><>???????
if( BattleBpFlag & BATTLE_BP_ENEMY_SURPRISAL ){
StockFontBuffer( pActSurprisalWnd->x + 38, pActSurprisalWnd->y + 40, FONT_PRIO_FRONT, 0, " <20><><EFBFBD><EFBFBD>͵Ϯ ", 0 );
}
// ??????<3F><>??????
if( BattleBpFlag & BATTLE_BP_PLAYER_SURPRISAL ){
StockFontBuffer( pActSurprisalWnd->x + 38, pActSurprisalWnd->y + 40, FONT_PRIO_FRONT, 0, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD>", 0 );
}
}
}
}
int xxx;
/*Battle Process<73><73><EFBFBD><EFBFBD>******************************************************************/
#ifdef _AI_OTHER
#ifdef _AI_CAPTURE
extern int AI_OtherSetting[2];
#else
extern int AI_OtherSetting[1];
#endif
#endif
void BattleProc( void )
{
int i;
int z;
s_timer++;
xxx = 0;
#ifndef _STREET_VENDOR
#ifdef _TABLEOFSKILL
extern short skillBtn ;
skillBtn = 0 ;
#endif
#endif
#ifdef _FRIENDCHANNEL //ROG ADD <20><><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>
extern short chatRoomBtn ;
chatRoomBtn = 0;
SelRoomBtn = 0;
#endif
switch( SubProcNo ){
case BATTLE_SUBPROC_INIT: //<2F><><EFBFBD>ڻ<EFBFBD>
#ifdef __AI
extern char *AI_Choosen;
AI_Choosen = NULL;
#endif
BattlingFlag = TRUE;
#ifdef _PROFESSION_ADDSKILL
if( boundary_2 != NULL ){
DeathAction( boundary_2 );
boundary_2 = NULL;
}
if( boundary_mark[0] ){
DeathAction( boundary_mark[0] );
boundary_mark[0] = NULL;
}
if( boundary_mark[1] ){
DeathAction( boundary_mark[1] );
boundary_mark[1] = NULL;
}
#endif
//Action<6F><6E><EFBFBD><EFBFBD>
DeathAllAction();
// ս<><D5BD><EFBFBD><EFBFBD>ʼʱ<CABC>ͷŵ<CDB7>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<D0B5><C4B6><EFBFBD>
#ifdef _AniRandom // Syu ADD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern void AniRandomRelease();
AniRandomRelease();
#endif
#ifdef _AniCrossFrame // Syu ADD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ι<EFBFBD><CEB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern void crossAniRelease();
crossAniRelease();
#endif
#ifdef _AniCharBubble // Syu ADD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>³<EFBFBD><C2B3><EFBFBD><EFBFBD><EFBFBD>
extern void CharbubbleRelease();
CharbubbleRelease();
#endif
#ifdef _AniImmobile // Syu ADD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD>
extern void ImmobileAniRelease();
ImmobileAniRelease();
#endif
#ifdef _SPECIALSPACEANIM // Syu ADD <20><><EFBFBD><EFBFBD><E2B3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern void ReleaseSpecAnim();
ReleaseSpecAnim();
#endif
#ifdef _NEWDRAWBATTLEMAP // Syu ADD <20>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>BattleMap
if ( nowFloor == 817 || nowFloor == 8007 || nowFloor == 8101 || nowFloor == 8100 ||
nowFloor == 8027 || nowFloor == 8028 || nowFloor == 8029 || nowFloor == 8015 || nowFloor == 8113 || nowFloor == 8114 )
{
for ( z = 0 ; z < 8 ; z ++ )
{
if ( BattleWaterAct [ z ] == NULL )
{
BattleWaterAct[ z ] = MakeAnimDisp (
( 80 * (z + 1) ),
Rnd ( 5 , 450 ) ,
Rnd( 101502 , 101509) ,
0);
BattleWaterAct[ z ]->dispPrio = 30 ;
}
}
}
#endif
slow_flg = 0;
action_inf = 0;
oft_test();
// Menu<6E><75>ʼ<EFBFBD><CABC>
InitMenu();
// BattleMenu<6E><75>ʼ<EFBFBD><CABC>
InitBattleMenu();
pActSurprisalWnd = NULL;
pActAudienceExitWnd = NULL;
// Produce<63><65>ʼ<EFBFBD><CABC>
ProduceInitFlag = TRUE;
// <20><><EFBFBD><EFBFBD>focusȡ<73><C8A1>
GetKeyInputFocus( &MyChatBuffer );
// ?<3F><>????<3F><>
// Buffer<65><72>ʼ<EFBFBD><CABC>
DispBuffer.DispCnt = 0;
FontCnt = 0;
// BattleMap<61><70>ȡ
#ifdef _NEW_RESOMODE
//drawMap();
ReadBattleMap( BattleMapNo );
#else
ReadBattleMap( BattleMapNo );
#endif
ChatProc(); // Chat<61><74><EFBFBD><EFBFBD>
ChatBufferToFontBuffer(); // ??????????????????????
// ???????????????
ClearBackSurface();
// ????????????????
#ifdef __SKYISLAND
fastDrawTileFlag = 0;
PutBmp();
fastDrawTileFlag = 1;
#else
PutBmp();
// ??????????????????????
lpBattleSurface->BltFast( 0, 0, lpDraw->lpBACKBUFFER, NULL, DDBLTFAST_WAIT );
#endif
// ???????
DispBuffer.DispCnt = 0;
FontCnt = 0;
//?<3F>e<EFBFBD><65>???????
if(DuelFlag == TRUE || eventEnemyFlag == 1 || vsLookFlag == 1)
{
#ifdef _NEWMUSICFILE6_0 // Syu ADD 6.0 <20>µ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>
if ( nowFloor != 817 && nowFloor != 8007 && nowFloor != 8101 && nowFloor != 8100 &&
nowFloor != 8027 && nowFloor != 8028 && nowFloor != 8029 && nowFloor != 8015 && nowFloor != 8113 && nowFloor != 8114 )
{
#endif
//BossսBGM<47><4D><EFBFBD><EFBFBD>
if( map_bgm_no>=15 && map_bgm_no<=21)
play_bgm( 13 );
else
play_bgm( 6 );
if(nowFloor == 8519) play_bgm(14);
#ifdef _NEWMUSICFILE6_0 // Syu ADD 6.0 <20>µ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>
}
else play_bgm ( 24 ) ;
#endif
}
else
{
#ifdef _NEWMUSICFILE6_0 // Syu ADD 6.0 <20>µ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>
if ( nowFloor != 817 && nowFloor != 8007 && nowFloor != 8101 && nowFloor != 8100 &&
nowFloor != 8027 && nowFloor != 8028 && nowFloor != 8029 && nowFloor != 8015 && nowFloor != 8113 && nowFloor != 8114 )
{
#endif
//ͨ<><CDA8>ս<EFBFBD><D5BD>BGM<47><4D><EFBFBD><EFBFBD>
if( map_bgm_no>=15 && map_bgm_no<=21)
play_bgm( 12 );
else
play_bgm( 5 );
#ifdef _NEWMUSICFILE6_0 // Syu ADD 6.0 <20>µ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>
}
else
play_bgm ( 24 ) ;
#endif
}
// ????????
NowTime = TimeGetTime();
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
BackBufferDrawType = DRAW_BACK_PRODUCE;
// ?<3F><>?
DrawProduce( PRODUCE_HAGARE_OCHI_IN );
// <20><><EFBFBD><EFBFBD>?<3F><>???
MenuProc(); // ??????
ImeProc(); // ???????
// <20><><EFBFBD><EFBFBD> field menu ???????????
fieldProc2();
// menu flag on ?????????
battleMenuFlag2 = TRUE;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ??????????
for( i = 0 ; i < 5 ; i++ ){
// ????????????
if( pet[ i ].useFlag == FALSE ){
// ??????
if( i == pc.battlePetNo ) pc.battlePetNo = -1;
// ?????
if( i == pc.mailPetNo ) pc.mailPetNo = -1;
// ??????????
pc.selectPetNo[ i ] = FALSE;
}
}
// ????????
saveUserSetting();
// ????<3F>k????
SubProcNo++;
break;
case BATTLE_SUBPROC_IN_PRODUCE: // ??????<3F><>
// ת<><D7AA> ?<3F><>?
if( DrawProduce( PRODUCE_HAGARE_OCHI_IN ) == TRUE ){
// ???????
DispBuffer.DispCnt = 0;
FontCnt = 0;
// ??????<3F><>????????????????<3F><> */
#ifdef _NEW_RESOMODE
//drawMap();
ReadBattleMap( BattleMapNo );
#else
ReadBattleMap( BattleMapNo );
#endif
// ???????????????
ClearBackSurface();
// ????????????????
#ifdef __SKYISLAND
fastDrawTileFlag = 0;
PutBmp();
fastDrawTileFlag = 1;
#else
PutBmp();
// ??????????????????????
lpBattleSurface->BltFast( 0, 0, lpDraw->lpBACKBUFFER, NULL, DDBLTFAST_WAIT );
#endif
// ???????
DispBuffer.DispCnt = 0;
FontCnt = 0;
// ????????
NowTime = TimeGetTime();
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
BackBufferDrawType = DRAW_BACK_BATTLE;
// ?????????<3F><>?
/* ?????? */
ChatProc();
// ??????????????????????
ChatBufferToFontBuffer();
// ?????????<3F><><EFBFBD><EFBFBD>??
FlashKeyboardCursor();
// ??????
MenuProc();
// ???????
ImeProc();
// ???????????
fieldProc2();
SubProcNo++;
}else{
MenuProc(); // ??????
ImeProc(); // ???????
// ???????????
fieldProc2();
}
break;
case BATTLE_SUBPROC_RECEIVE_BC: //ÿ<>غ<EFBFBD><D8BA><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>״̬<D7B4><CCAC>ʾ
#ifdef _DEBUG__
if(offlineFlag == TRUE){
#ifdef _BATTLE_PK_PLAYER_FOR_40
strcpy(BattleStatus,"BC|3|"
"0|ishikawa|title|18768|1|20|20|0|"
"1|ishikawa|title|18768|1|20|20|0|"
"2|ishikawa|title|18768|1|20|20|0|"
"3|ishikawa|title|18768|1|20|20|0|"
"4|ishikawa|title|18768|1|20|20|0|"
"5|beron|title|18813|1|20|20|0|"
"6|beron|title|18813|1|20|20|0|"
"7|beron|title|18813|1|20|20|0|"
"8|beron|title|18813|1|20|20|0|"
"9|beron|title|18813|1|20|20|0|"
"A|ishikawa|title|18813|1|20|20|0|"
"B|ishikawa|title|18813|1|20|20|0|"
"C|ishikawa|title|18813|1|20|20|0|"
"D|ishikawa|title|18813|1|20|20|0|"
"E|ishikawa|title|18813|1|20|20|0|"
"F|beron|title|187BA|1|20|20|0|"
"10|beron|title|187BA|1|20|20|0|"
"11|beron|title|187BA|1|20|20|0|"
"12|beron|title|187BA|1|20|20|0|"
"13|beron|title|187BA|1|20|20|0|"
"14|beron|title|187BA|1|20|20|0|"
"15|beron|title|187BA|1|20|20|0|"
"16|beron|title|187BA|1|20|20|0|"
"17|beron|title|187BA|1|20|20|0|"
"18|beron|title|187BA|1|20|20|0|"
"19|beron|title|187BA|1|20|20|0|"
"1A|beron|title|187BA|1|20|20|0|"
"1B|beron|title|187BA|1|20|20|0|"
"1C|beron|title|187BA|1|20|20|0|"
"1D|beron|title|187BA|1|20|20|0|"
"1E|beron|title|187BA|1|20|20|0|"
"1F|beron|title|187BA|1|20|20|0|"
"20|beron|title|187BA|1|20|20|0|"
"21|beron|title|187BA|1|20|20|0|"
"22|beron|title|187BA|1|20|20|0|"
"23|beron|title|187BA|1|20|20|0|"
"24|beron|title|187BA|1|20|20|0|"
"25|beron|title|187BA|1|20|20|0|"
"26|beron|title|187BA|1|20|20|0|"
"27|beron|title|187BA|1|20|20|0|"
);
#endif
#ifdef _BATTLE_PK_PLAYER_FOR_6VS6
strcpy(BattleStatus, "BC|3|"
"0|friend1|title|18A97|1|20|20|1|"
"1|friend2|title|18A97|1|20|20|1|"
"2|friend3|title|18A97|1|20|20|1|"
"3|friend4|title|18A97|1|20|20|1|"
"4|friend5|title|18A97|1|20|20|1|"
"5|friend6|title|18A97|1|20|20|1|"
"6|mypet1|title|18813|1|20|20|1|"
"7|mypet2|title|18813|1|20|20|1|"
"8|mypet3|title|18813|1|20|20|1|"
"9|mypet4|title|18813|1|20|20|1|"
"A|mypet5|title|18813|1|20|20|1|"
"B|mypet6|title|18813|1|20|20|1|"
"C|enemy|title|18A97|2|20|20|1|"
"D|enemy|title|18A97|2|20|20|1|"
"E|enemy|title|18A97|2|20|20|1|"
"F|enemy|title|18A97|2|20|20|1|"
"10|enemy|title|18A97|2|20|20|1|"
"11|enemy|title|18A97|2|20|20|1|"
"12|enemy|title|18813|2|20|20|1|"
"13|enemy|title|18813|2|20|20|1|"
"14|enemy|title|18813|2|20|20|1|"
"15|enemy|title|18813|2|20|20|1|"
"16|enemy|title|18813|2|20|20|1|"
"17|enemy|title|18813|2|20|20|1|"
);
#endif
//strcpy( BattleStatus, BattleBcDeb[ BattleDebTurnNo ] );
//<2F><><EFBFBD><EFBFBD>BC<42><43><EFBFBD><EFBFBD>
set_bc();
SubProcNo++;
break;
}
#endif
/* ?????? */
ChatProc();
/*
#ifndef __AI
//cary <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
if( PauseAI == 2)
PauseAI = 0;
if( PauseAI == 1)
PauseAI = 2;
extern int battleButtonBak;
if( AI == AI_SELECT)
battleButtonBak = -1;
#endif
*/
// ??????????????????????
ChatBufferToFontBuffer();
// ?????????<3F><><EFBFBD><EFBFBD>??
FlashKeyboardCursor();
// ??????
MenuProc();
// ???????
ImeProc();
// ???????????
fieldProc2();
// ??<3F>q?????????????
TimeZoneProc();
// <20>ӡP??
if( BattleBpFlag & BATTLE_BP_JOIN ){
// ??????
strcpy( OneLineInfoStr,"<EFBFBD>ȴ<EFBFBD><EFBFBD>غϽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
// ?????????????????
if( EncountFlag == FALSE ){
// ??????????
if( !( s_timer & 7 ) ){
piyo_point++;
piyo_point &= 63;
}
/* ????????? */
RunAction();
// ???<3F><><EFBFBD><EFBFBD>????????????
StockTaskDispBuffer();
}
if( BattleStatusReadPointer != BattleStatusWritePointer ){
strcpy( BattleStatus, BattleStatusBak[ BattleStatusReadPointer ] );
BattleStatusReadPointer = ( BattleStatusReadPointer + 1 ) & ( BATTLE_BUF_SIZE-1 );
EncountFlag = FALSE;
set_bc();
if( BattleMyNo < BATTLKPKPLYAERNUM ) {
if( p_party[ BattleMyNo ]->petFall == 2 ) {
lssproto_TK_recv( sockfd, 0, "P|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>", FONT_PAL_YELLOW);
p_party[ BattleMyNo ]->petFall = 0;
}else if( p_party[ BattleMyNo ]->onRide == -1 ) {
lssproto_TK_recv( sockfd, 0, "P|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>أ<EFBFBD><D8A3><EFBFBD><EFBFBD>˳<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>", FONT_PAL_YELLOW);
}
#ifdef _PETSKILL_BECOMEFOX
else if( p_party[ BattleMyNo ]->onRide == -2 ) {
lssproto_TK_recv( sockfd, 0, "P|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>", FONT_PAL_YELLOW);
}
#endif
#ifdef _PETSKILL_BECOMEPIG
else if( p_party[ BattleMyNo ]->onRide == -3 ) {
lssproto_TK_recv( sockfd, 0, "P|<7C><EFBFBD><E3B4A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>", FONT_PAL_YELLOW);
}
#endif
#ifdef _PETSKILL_EXPLODE
else if( p_party[ BattleMyNo ]->onRide == -4 ) {
lssproto_TK_recv( sockfd, 0, "P|<7C><><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><CBB1>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>", FONT_PAL_YELLOW);
}
#endif
}
// <20>P<EFBFBD>f??<3F><>????????
CheckBattleNewPet();
// ?<3F>P???????
if( BattleMyNo < BATTLKPKPLYAERNUM ){
// ???<3F>@<40>e
p_party[ BattleMyNo ]->mp = BattleMyMp;
}
// ?<3F><>??<3F>K<EFBFBD><4B>??????
Battle1P2PFlag = CheckBattle1P2P();
SubProcNo++;
}
// ?<3F>P?????????<3F><><EFBFBD><EFBFBD>
if( BattleMyNo >= 20 ){
// ?????<3F><>????
if( pActAudienceExitWnd == NULL ){
// ?????<3F><><EFBFBD><EFBFBD>????<3F><>
pActAudienceExitWnd = MakeWindowDisp( 444, 4, 3, 2, NULL, 1 );
// ????????
play_se( 202, 320, 240 );
}
}
break;
case BATTLE_SUBPROC_CHAR_IN: // <20>K<EFBFBD><4B>?<3F><>
// ??????????l
if( !( s_timer & 7 ) ){
piyo_point++;
piyo_point &= 63;
}
// <20><>?<3F>e?<3F><><EFBFBD><EFBFBD>??
SurprisalDisp();
// ????<3F>V???????????
CheckBattleAnimFlag();
/* ????????? */
RunAction();
// ???<3F><><EFBFBD><EFBFBD>????????????
StockTaskDispBuffer();
/* ?????? */
ChatProc();
// ??????????????????????
ChatBufferToFontBuffer();
// ?????????<3F><><EFBFBD><EFBFBD>??
FlashKeyboardCursor();
// ??????
MenuProc();
// ???????
ImeProc();
// ???????????
fieldProc2();
// ??<3F>q?????????????
TimeZoneProc();
// <20><><EFBFBD>q?<3F><><EFBFBD><EFBFBD>
BattleNameDisp();
// <20>K<EFBFBD><4B><EFBFBD><EFBFBD>???
if( action_inf == 3 ){
action_inf = 0;
// <20>P<EFBFBD>f<EFBFBD>ӡP??????
BattleBpFlag &= ~BATTLE_BP_JOIN;
// <20>u<EFBFBD><75>??????
if( check_all_dead() == 1 ){
SubProcNo = BATTLE_SUBPROC_OUT_PRODUCE_INIT;
break;
}
// <20><>?<3F>e??????<3F><>????
if( pActSurprisalWnd != NULL ){
// ??????<3F><>
DeathAction( pActSurprisalWnd );
pActSurprisalWnd = NULL;
// <20><>?<3F>e???????
BattleBpFlag &= ~BATTLE_BP_ENEMY_SURPRISAL;
BattleBpFlag &= ~BATTLE_BP_PLAYER_SURPRISAL;
}
// ???????
SubProcNo++;
}
//<2F>P<EFBFBD>f<EFBFBD>D<EFBFBD><44>??
if( action_inf == 2 ){
SubProcNo = BATTLE_SUBPROC_OUT_PRODUCE_INIT; //<2F>P<EFBFBD>f<EFBFBD><66>??<3F><>?
action_inf = 0;
// ??????????
BattleCmd[ 0 ] = NULL;
}
break;
case BATTLE_SUBPROC_CMD_INPUT: // ????<3F>V?
#ifdef _DEBUG__
if(offlineFlag == TRUE){
SubProcNo++;
break;
}
#endif
// ??????????
if( !( s_timer & 7 ) ){
piyo_point++;
piyo_point &= 63;
}
{
#ifndef __AI
if( mouse.onceState == MOUSE_RIGHT_CRICK)
PauseAI = 2;
// ?????????
BattleMenuProc();
#else
extern void AI_ChooseAction();
if( AI == AI_SELECT){
void CloseInfoWnd();
CloseInfoWnd();
AI_ChooseAction();
}else
BattleMenuProc();
#endif
}
// ????<3F>V???????????
CheckBattleAnimFlag();
/* ????????? */
RunAction();
// ???<3F><><EFBFBD><EFBFBD>????????????
StockTaskDispBuffer();
/* ?????? */
ChatProc();
// ??????????????????????
ChatBufferToFontBuffer();
// ?????????<3F><><EFBFBD><EFBFBD>??
FlashKeyboardCursor();
// ??????
MenuProc();
// ???????
ImeProc();
// ???????????
fieldProc2();
// ??<3F>q?????????????
TimeZoneProc();
// <20><><EFBFBD>q?<3F><><EFBFBD><EFBFBD>
BattleNameDisp();
break;
case BATTLE_SUBPROC_RECEIVE_MOVIE: // ????<3F><><EFBFBD><EFBFBD><EFBFBD>r?
#ifdef _DEBUG__
if(offlineFlag == TRUE){
strcpy( BattleCmd,"BY teki_A jibun_0 flg_0 damage_0 jibun_1 flg_0 damage_0 jibun_2 flg_0 damage_0"
" jibun_3 flg_0 damage_0 jibun_4 flg_0 damage_0 jibun_5 flg_0 damage_0"
" jibun_6 flg_0 damage_0 jibun_7 flg_0 damage_0 jibun_8 flg_0 damage_0"
" jibun_9 flg_0 damage_1 FF");
strcpy( BattleCmd, BattleCmdDeb[ BattleDebTurnNo ] );
BattleMyNo = 0;
//????????
att_select_flg = FALSE;
SubProcNo++;
break;
}
#endif
#ifndef __AI
if( mouse.onceState == MOUSE_RIGHT_CRICK)
PauseAI = 1;
#else
extern char *AI_Choosen;
#endif
// ??????????
if( !( s_timer & 7 ) ){
piyo_point++;
piyo_point &= 63;
}
// ????<3F>V???????????
CheckBattleAnimFlag();
/* ????????? */
RunAction();
// ???<3F><><EFBFBD><EFBFBD>????????????
StockTaskDispBuffer();
/* ?????? */
ChatProc();
// ??????????????????????
ChatBufferToFontBuffer();
// ?????????<3F><><EFBFBD><EFBFBD>??
FlashKeyboardCursor();
// ??????
MenuProc();
// ???????
ImeProc();
// ???????????
fieldProc2();
// ??<3F>q?????????????
TimeZoneProc();
// <20><><EFBFBD>q?<3F><><EFBFBD><EFBFBD>
BattleNameDisp();
// ???????<3F>r?
if( BattleCmdReadPointer != BattleCmdWritePointer ){
strcpy( BattleCmd, BattleCmdBak[ BattleCmdReadPointer ] );
BattleCmdReadPointer = ( BattleCmdReadPointer + 1 ) & ( BATTLE_BUF_SIZE-1 );
action_inf = 0;
//?????????
att_select_flg = FALSE;
SubProcNo++;
}
// <20>K<EFBFBD><4B>???
if( Battle1P2PFlag == 2 ){
// ??????
strcpy( OneLineInfoStr,"<EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҡ<EFBFBD>");
}
// ?<3F>P??
if( BattleMyNo >= BATTLKPKPLYAERNUM ){
// <20><>?<3F><>???
for( i = 0 ; i < BATTLKPKPLYAERNUM ; i++ ){
// <20>o??????<3F><><EFBFBD><EFBFBD>
HpMeterDisp( i );
}
}else{
// ????????
if( BattleMyNo < 10 ){
for( i = 0 ; i < 10 ; i++ ) HpMeterDisp( i ); // <20>o??????<3F><><EFBFBD><EFBFBD>
}else
// ????????
if( BattleMyNo >= 10 ){
for( i = 10 ; i < 20 ; i++ ) HpMeterDisp( i ); // <20>o??????<3F><><EFBFBD><EFBFBD>
}
#ifdef _BATTLE_PK_PLAYER_FOR_40
if( BattleMyNo < 30 ){
for( i = 20 ; i < 30 ; i++ ) HpMeterDisp( i ); // <20>o??????<3F><><EFBFBD><EFBFBD>
}else
// ????????
if( BattleMyNo >= 40 ){
for( i = 30 ; i < 40 ; i++ ) HpMeterDisp( i ); // <20>o??????<3F><><EFBFBD><EFBFBD>
}
#endif
}
break;
case BATTLE_SUBPROC_MOVIE: // ??????
#ifdef _DEBUG__
if(offlineFlag == TRUE){
if(joy_trg[0]&JOY_A){ //??????
DeathAllAction();
SubProcNo = 0;
BattleCmd[0] = NULL;
break;
}
}
#endif
//????????<3F><>???
#ifndef __AI
if( mouse.onceState == MOUSE_RIGHT_CRICK)
PauseAI = 1;
#else
if( AI_Choosen){
StockFontBuffer( 640-strlen(AI_Choosen)*7-4 + DISPLACEMENT_X, 440 + DISPLACEMENT_Y, FONT_PRIO_FRONT, FONT_PAL_YELLOW, AI_Choosen, 0 );
}
#endif
if( slow_flg ){
if( !( s_timer & 31 ) ){ // ????????
piyo_point++; // ?????????<3F><>???
piyo_point &= 63; // ????????
}
if( s_timer & 3 ){ // ????????????????????
damage_dispx(); // ?????????<3F>k<EFBFBD><6B><EFBFBD><EFBFBD>
}else{
RunAction(); /* ????????? */
battle_quake(); //<2F>P<EFBFBD>f<EFBFBD><66><EFBFBD><EFBFBD>
}
} else { // ???????
if( !( s_timer & 7 ) ){
piyo_point++;
piyo_point &= 63;
}
RunAction(); /* ????????? */
battle_quake(); //<2F>P<EFBFBD>f<EFBFBD><66><EFBFBD><EFBFBD>
}
//?<3F><>???????
if( flash_vct_no ) die_flash(); //?<3F><>?????
// ???<3F><><EFBFBD><EFBFBD>????????????
StockTaskDispBuffer();
/* ?????? */
ChatProc();
// ??????????????????????
ChatBufferToFontBuffer();
// ?????????<3F><><EFBFBD><EFBFBD>??
FlashKeyboardCursor();
// ??????
MenuProc();
// ???????
ImeProc();
// ???????????
fieldProc2();
// ??<3F>q?????????????
TimeZoneProc();
// <20><><EFBFBD>q?<3F><><EFBFBD><EFBFBD>
//BattleNameDisp();
//???<3F><>???
if( action_inf == 1 ){
SubProcNo = BATTLE_SUBPROC_RECEIVE_BC; //?????
#ifndef PK_SYSTEM_TIMER_BY_ZHU
BattleCliTurnNo++; // ?????????<3F><>??
#endif
#ifdef _DEBUG__
if(offlineFlag == TRUE){
SubProcNo = BATTLE_SUBPROC_RECEIVE_BC; //?????????
BattleDebTurnNo++;
// ????????
if( BattleDebTurnNo >= sizeof( BattleCmdDeb )/sizeof(int) ) BattleDebTurnNo = 0;
}
#endif
action_inf = 0;
// ??????????
BattleCmd[ 0 ] = NULL;
// ?????????
battleMenuFlag2 = TRUE;
}
//<2F>P<EFBFBD>f<EFBFBD>D<EFBFBD><44>??
if( action_inf == 2 ){
SubProcNo = BATTLE_SUBPROC_OUT_PRODUCE_INIT; //<2F>P<EFBFBD>f<EFBFBD><66>??<3F><>?
action_inf = 0;
// ??????????
BattleCmd[ 0 ] = NULL;
}
break;
case BATTLE_SUBPROC_OUT_PRODUCE_INIT: // <20><>??<3F><>???
//??????????
fade_out_bgm();
// ????????????<3F><>
CopyBackBuffer();
// ????????<3F><>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
BackBufferDrawType = DRAW_BACK_PRODUCE;
SubProcNo++;
#ifdef _NEWDRAWBATTLEMAP // (<28><><EFBFBD>ɿ<EFBFBD><C9BF><EFBFBD>) Syu ADD <20>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>BattleMap
extern int RandBattleBg ;
RandBattleBg = 0 ;
for ( z = 0 ; z < 8 ; z ++ )
{
if ( BattleWaterAct[ z ] != NULL )
{
DeathAction(BattleWaterAct[ z ]);
BattleWaterAct[ z ] = NULL;
}
}
#endif
break;
case BATTLE_SUBPROC_OUT_PRODUCE: // <20><>??<3F><>
// ?<3F><>?
if( DrawProduce( PRODUCE_4WAY_OUT ) == TRUE ){
#ifdef _HUNDRED_KILL
BattleHundredFlag = FALSE;
#endif
// ????????
ChangeProc( PROC_GAME, 1 );
// ?????<3F>u?<3F><>
DeathAllAction();
// ?????????????????<3F><>
BattlingFlag = FALSE;
clearPtActCharObj();
// ????????????????<3F><>?<3F><>??
encountNowFlag = 0;
// ????????????????<3F><>?????????
if( bNewServer)
lssproto_EO_send( sockfd, 0 );
else
old_lssproto_EO_send( sockfd, 0 );
//??????????<3F><>
// <20>P<EFBFBD>f???????<3F><>???<3F>`????????????<3F><>???
if( battleResultMsg.useFlag >= 1 ){
BattleResultWndFlag = battleResultMsg.useFlag; // ?????????
battleResultMsg.useFlag = FALSE; // ?<3F>B<EFBFBD>l???????
}
#ifdef _AI_OTHER
if(AI_OtherSetting[0]){
ITEM *pItem = pc.item;
#ifdef _NEW_ITEM_
for(int i=0;i<MAX_MAXHAVEITEM*3;i++){
#else
for(int i=0;i<MAX_MAXHAVEITEM;i++){
#endif
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵĵ<CFB5><C4B5><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD>
if(pItem[i+9].useFlag && (pItem[i+9].graNo >= 24000 && pItem[i+9].graNo <= 24044)){
// <20><><EFBFBD><EFBFBD>
if(bNewServer) lssproto_DI_send(sockfd,nowGx,nowGy,i+9);
else old_lssproto_DI_send(sockfd,nowGx,nowGy,i+9);
}
}
}
#endif
return;
}
break;
case 12: // ?<3F><>
break;
}
#ifndef _CHANNEL_MODIFY
// Robin 0805 channel
if( bNewServer && joy_trg[1] & JOY_CTRL_C )
{
char buf[64];
if( pc.channel == -1 ) {
if( (pc.quickChannel != -1) && (pc.familyName[0] != NULL) ) {
sprintf( buf, "C|J|%d", pc.quickChannel);
if( bNewServer)
lssproto_FM_send( sockfd, buf );
else
old_lssproto_FM_send( sockfd, buf );
}
}
else{
if( bNewServer)
lssproto_FM_send( sockfd, "C|J|-1" );
else
old_lssproto_FM_send( sockfd, "C|J|-1" );
}
}
#endif
// ????????????
if( BackBufferDrawType != DRAW_BACK_PRODUCE ){
// <20>P<EFBFBD>f?<3F><><EFBFBD><EFBFBD>???
if( BattleEscFlag == TRUE ){
// <20><>??????
SubProcNo = BATTLE_SUBPROC_OUT_PRODUCE_INIT;
// ??????
BattleEscFlag = FALSE;
}
// ?<3F>P???????????
if( mouse.onceState & MOUSE_RIGHT_CRICK && BattleMyNo >= 20 ){
DeathAction(pActAudienceExitWnd);
pActAudienceExitWnd=NULL;
if( bNewServer)
lssproto_B_send( sockfd, "U" );
else
old_lssproto_B_send( sockfd, "U" );
}
// ????????
if( pActAudienceExitWnd != NULL ){
// ?<3F>P<EFBFBD><50>?<3F><>?<3F><><EFBFBD><EFBFBD>??????<3F><>????????
if( pActAudienceExitWnd->hp > 0 ){
// <20><>??<3F><><EFBFBD><EFBFBD>
StockFontBuffer( pActAudienceExitWnd->x + 30, pActAudienceExitWnd->y + 28, FONT_PRIO_FRONT, 0, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҽ<EFBFBD>", 0 );
StockFontBuffer( pActAudienceExitWnd->x + 30, pActAudienceExitWnd->y + 52, FONT_PRIO_FRONT, 0, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ս", 0 );
}
}
}
}