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

311 lines
7.4 KiB
C++
Raw Permalink Normal View History

2020-06-23 15:27:59 +08:00
/************************/
/* takecess.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"
#if 0
extern ACTION* oft_test();
extern void damage_num( ACTION *a0 );
extern int piyo_point;
int flash_pal_cnt;
PALETTEENTRY Palette2[256]; // ?????<3F>B<EFBFBD>l
/* ?<3F><>????? *********************************************************/
void die_flash( void )
{
int d0 = 0;
int d1,d7;
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;
}
lpDraw->lpPALETTE->SetEntries( 0, 0, 256, Palette2 );
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 > 2)
d1 = 2;
if(d1 < -2)
d1 = -2;
Palette2[d7].peRed -= d1;
}
if(WindowMode){ //??????????
flash_pal_cnt++;
if(flash_pal_cnt == 10){ //<2F><>??<3F>u??
flash_pal_cnt = 0;
lpDraw->lpPALETTE->SetEntries( 0, 0, 256, Palette2 );
} else {
d0 = 1; //<2F><>????
}
} else {
lpDraw->lpPALETTE->SetEntries( 0, 0, 256, Palette2 );
}
if(d0 == 0){ //<2F><>???
flash_vct_no = 0;
}
break;
#if 0
//?????????? ?<3F><> ??????????
case 4:
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 = 0xf0;
Palette2[d7].peGreen = 0xf0;
Palette2[d7].peRed = 0xf0;
Palette2[d7].peFlags = Palette[d7].peFlags;
}
lpDraw->lpPALETTE->SetEntries( 0, 0, 256, Palette2 );
flash_pal_cnt = 0;
flash_vct_no = 6;
break;
//?????????? ????? ??????????
case 5:
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 = 0xff;
Palette2[d7].peGreen = 0x80;
Palette2[d7].peRed = 0x80;
Palette2[d7].peFlags = Palette[d7].peFlags;
}
lpDraw->lpPALETTE->SetEntries( 0, 0, 256, Palette2 );
flash_pal_cnt = 0;
flash_vct_no = 6;
break;
//?????????? ?<3F><> ? ????? ??????????
case 6:
for(d7=10; d7<246; d7++){
if(Palette2[d7].peRed != Palette[d7].peRed){
d0 = 1;
d1 = Palette2[d7].peRed - Palette[d7].peRed;
if(d1 > 4)
d1 = 4;
if(d1 < -4)
d1 = -4;
Palette2[d7].peRed -= d1;
}
if(Palette2[d7].peGreen != Palette[d7].peGreen){
d0 = 1;
d1 = Palette2[d7].peGreen - Palette[d7].peGreen;
if(d1 > 4)
d1 = 4;
if(d1 < -4)
d1 = -4;
Palette2[d7].peGreen -= d1;
}
if(Palette2[d7].peBlue != Palette[d7].peBlue){
d0 = 1;
d1 = Palette2[d7].peBlue - Palette[d7].peBlue;
if(d1 > 4)
d1 = 4;
if(d1 < -4)
d1 = -4;
Palette2[d7].peBlue -= d1;
}
}
if(WindowMode){ //??????????
flash_pal_cnt++;
if(flash_pal_cnt == 10){ //<2F><>??<3F>u??
flash_pal_cnt = 0;
lpDraw->lpPALETTE->SetEntries( 0, 0, 256, Palette2 );
} else {
d0 = 1; //<2F><>????
}
} else {
lpDraw->lpPALETTE->SetEntries( 0, 0, 256, Palette2 );
}
if(d0 == 0){ //<2F><>???
flash_vct_no = 0;
}
break;
#endif
}
}
/* ???????<3F>k<EFBFBD><6B><EFBFBD><EFBFBD> *********************************************************/
void damage_dispx( void )
{
ACTION *pActLoop = pActTop->pNext; /* <20>I<EFBFBD>d????????<3F><><EFBFBD>x */
ACTION *pActLoopBak; /* ?<3F><>???????? */
int d0;
char szMoji[ 256 ];
// ?????
while(1){
/* ??<3F><>???????? */
if( pActLoop == pActBtm ) break;
/* <20><>????? */
if( pActLoop->deathFlag == FALSE ){
/* Pd( pActLoop->prio ); */
/* ?????????<3F><>? */
if( pActLoop->func == damage_num ){
if(ATR_INT_WORK1(pActLoop) == 0){ //????
sprintf_s( szMoji,"Miss" );
} else if(ATR_INT_WORK1(pActLoop) == 1){ //???????
sprintf_s( szMoji,"Counter" );
} else if(ATR_INT_WORK1(pActLoop) == 3){ //?????
sprintf_s( szMoji,"Guard" );
} else {
sprintf_s( szMoji,"%d", ATR_INT_WORK0(pActLoop) );
}
d0 = GetStrWidth( szMoji ) >> 1;
StockFontBuffer( ATR_H_POS(pActLoop) - d0, ATR_V_POS(pActLoop), FONT_PRIO_BACK, ATR_INT_WORK1(pActLoop), szMoji, 0 );
}
/* ?????????? */
pActLoop = pActLoop->pNext;
}else{ /* ?????? */
/* <20>q????? */
pActLoop->pPrev->pNext = pActLoop->pNext;
pActLoop->pNext->pPrev = pActLoop->pPrev;
/* ?????? */
pActLoopBak = pActLoop->pNext;
/* ??????<3F><> */
ClearAction( pActLoop );
/* ???????? */
pActLoop = pActLoopBak;
}
}
}
/* ?????? ********************************************************************/
void TakeTestProc( void )
{
s_timer++;
switch( SubProcNo ){
case 0:
slow_flg = 0;
oft_test();
SubProcNo++;
InitChat();
GetKeyInputFocus( &MyChatBuffer );
#ifdef _NEW_RESOMODE
//drawMap();
ReadBattleMap( BattleMapNo );
#else
ReadBattleMap( BattleMapNo );
#endif
break;
case 1:
if(joy_trg[0]&JOY_A){
DeathAllAction();
SubProcNo = 0;
break;
}
FlashKeyboardCursor();
if(slow_flg){
if(!(s_timer&7)){
piyo_point++;
piyo_point &= 63;
}
if(s_timer&3){
damage_dispx(); //???????<3F>k<EFBFBD><6B><EFBFBD><EFBFBD>
goto TakeTestProc01_100;
}
} else {
if(!(s_timer&1)){
piyo_point++;
piyo_point &= 63;
}
}
/* ????????? */
RunAction();
TakeTestProc01_100:
if(flash_vct_no){ //?<3F><>???????
die_flash(); //?<3F><>?????
}
// ???<3F><><EFBFBD><EFBFBD>????????????
StockTaskDispBuffer();
/* ?????? */
ChatProc();
// ??????????????????????
ChatBufferToFontBuffer();
// ??????
MenuProc();
// ???????
ImeProc();
break;
}
}
#endif
/* ?????? ********************************************************************/
void TakeTestProc( void ){}