📄 counseler.cpp
字号:
AGAIN_ :
switch( ViewTipsLoad( ViewTipsCount ) )
{
case 1 : PlayListAutoSounds( 64, 0, 0, 0 );
break;
case -1: ViewTipsCount = 0; goto AGAIN_;
default : ViewTipsCount =0; break;
}
}
void ViewTipsBack( void )
{
Spr *s;
int i,j;
int xl,yl;
int tx,ty;
if( ViewTipsFlag == 0 ) return;
s = &spr[ 71];
xl = s->xl+1;
yl = s->yl;
int X = TIPS_X+TIPS_X;
int Y = TIPS_Y+TIPS_Y;
ty = Y - s->oy;
for( j = 0 ; j < TIPS_YL / yl+1 ; j ++)
{
tx = X +s->ox-9;
for( i = 0 ; i < 6 ; i ++)
{
PutCompressedImageFX( tx, ty+9, s, 20, 1 );
tx += xl;
}
ty += yl;
}
Box( Mapx+1 , Mapy+1 + TIPS_Y-4, TIPS_XL+X+Mapx-1, TIPS_YL+Y+Mapy-1, RGB16( 150, 150,150 ));
Box( Mapx , Mapy + TIPS_Y-4, TIPS_XL+X+Mapx, TIPS_YL+Y+Mapy, RGB16( 100, 100,100 ));
}
void ViewTipsMenu( void )
{
int gapy = 110;
if( ViewTipsFlag )
{
int y = 8;
int bx= TIPS_PRE_X;
int by= TIPS_PRE_Y;
int nx= TIPS_NEX_X;
int ny= TIPS_NEX_Y;
if( BoxAndDotCrash( 0,0, 80, 40, g_pointMouseX, g_pointMouseY ) )
{
y++;
if( LButtonDownIng ) y++;
}
else
if( BoxAndDotCrash( 120+bx,0+115+by, 60, 20, g_pointMouseX, g_pointMouseY ) )
{
by++;
if( LButtonDownIng ) by++;
}
else
if( BoxAndDotCrash( 65+120+nx,0+115+ny, 60, 20, g_pointMouseX, g_pointMouseY ) )
{
ny++;
if( LButtonDownIng ) ny++;
}
Box( Mapx+1, Mapy+1+y, 80+Mapx-1+y, 20+Mapy-1+y, RGB16( 150, 150,150 ));
Box( Mapx, Mapy+y, 80+Mapx+y, 20+Mapy+y, RGB16( 100, 100,100 ));
HprintBold( 5,5+y, RGB(0xff,0xff,0), RGB(0x7f,0x7f,0), lan->OutputMessage(7,31) );//010215 lsw
char temp[ FILENAME_MAX];
sprintf( temp, lan->OutputMessage(7,32), ViewTipsCount+1);//010215 lsw
HprintBold( 120,15, RGB(0xbf,0xbf,0), RGB(0x6f,0x6f,0), temp );
Box( 120+Mapx+1+bx, Mapy+1+115 +by, 120+60+Mapx-1+bx, 20+Mapy-1+115+by, RGB16( 150, 150,150 ));
Box( 120+Mapx +bx, Mapy+115 +by, 120+60+Mapx+bx, 20+Mapy+115+by, RGB16( 100, 100,100 ));
HprintBold( 15+120+5+bx,5+115+by, RGB(0xff,0xff,0xff), RGB(0x7f,0x7f,0x7f), lan->OutputMessage(7,33) );//010215 lsw
Box( 65+120+Mapx+1+nx, Mapy+1+115+ny, 65+120+60+Mapx-1+nx, 20+Mapy-1+115+ny, RGB16( 150, 150,150 ));
Box( 65+120+Mapx +nx, Mapy+115 +ny, 65+120+60+Mapx+nx, 20+Mapy+115+ny, RGB16( 100, 100,100 ));
HprintBold( 75+120+5+nx,5+115+ny, RGB(0xff,0xff,0xff), RGB(0x7f,0x7f,0x7f), lan->OutputMessage(7,34) );//010215 lsw
}
else
{
/* // 001128 YGI
Box( Mapx+1, Mapy+1, 80+Mapx-1, 20+Mapy-1, RGB16( 150, 150,150 ));
Box( Mapx, Mapy, 80+Mapx, 20+Mapy, RGB16( 100, 100,100 ));
HprintBold( 10,5, RGB( 0xff, 0xff, 0xff), RGB( 0x7f, 0x7f, 0x7f), "Tip 焊扁" );*/
}
}
// 0818 khs
int ViewTipsCheck( void )
{
if( ViewTipToggle == 0 ) return 0;
if( YouCanViewTipsCheck == 1 ) YouCanViewTipsCheck = 0;
else return 0;
int bx= TIPS_PRE_X;
int by= TIPS_PRE_Y;
int nx= TIPS_NEX_X;
int ny= TIPS_NEX_Y;
if( ViewTipsFlag )
{
if( BoxAndDotCrash( 0,0, 80, 40, g_pointMouseX, g_pointMouseY ) )
{
ViewTipsFlag = 0;
PlayListAutoSounds( 490, 0, 0, 0 );
YouCanHeroActionProc =0;
return 1;
}
else
if( BoxAndDotCrash( 120+bx,0+115+by, 60, 20, g_pointMouseX, g_pointMouseY ) )
{
ViewTipsPrev();
YouCanHeroActionProc =0;
return 1;
}
else
if( BoxAndDotCrash( 65+120+nx,0+115+ny, 60, 20, g_pointMouseX, g_pointMouseY ) )
{
ViewTipsNext();
YouCanHeroActionProc =0;
return 1;
}
}
else
{
if( BoxAndDotCrash( 0,0, 80, 20, g_pointMouseX, g_pointMouseY ) )
{
ViewTipsLoad( ViewTipsCount );
ViewTipsFlag = 1;
PlayListAutoSounds( 489, 0, 0, 0 );
YouCanHeroActionProc =0;
return 1;
}
}
return 0;
}
// 0818 khs
void ViewTips( void )
{
int i;
int X = TIPS_X + 5;
int Y = TIPS_Y + 40;
int r,g,b;
if( ViewTipToggle == 0 ) return;
ViewTipsBack();
ViewTipsMenu();
if( ViewTipsFlag )
for( i = 0 ; i < TIPS_LINE ; i ++)
{
Getcolor( &r,&g,&b );
Hcolor( 70,70,70 );
HprintBoldcolor( X+1, Y+1, 30, Tips[i] );
Hcolor( 200,200,200 );
HprintBoldcolor( X, Y, 100 , Tips[i] );
Hcolor( r,g,b );
Y += 16;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Hero绰 寇何函荐...........................
void GuideRookie::GuideGhost_TypeTheHelp( bool t )
{
GG_TypeTheHelp = t;
}
int GuideRookie::GuideGhost_CheckGo( void )
{
if( Hero == NULL ) return 0;
if( Hero->viewtype != VIEWTYPE_GHOST_ ) { GG_oldstatus = GG_status; GG_status = GG_ALIVE; return 0; }
if( GG_status == GG_ALIVE )
{
GG_oldstatus = GG_status;
GG_status = GG_DEATH; // 陛规 磷菌促.
}
if( GG_TypeTheHelp == false )
if( Hero->lv > rookielevel ) return 0;
// 捞缠 谅钎啊 绝栏搁 府畔茄促.
switch( Hero->name_status.nation)
{
case N_VYSEUS : if( MapInfo[ MapNumber].ghostguide3x == 0 ) return 0; //
break;
case N_ZYPERN : if( MapInfo[ MapNumber].ghostguide4x == 0 ) return 0;
break;
}
GG_delay = GG_NO_MORE_DEATH; // 混酒唱歹扼档 距埃篮 巢酒 乐绢具 摆瘤..
return 1;
}
void GuideRookie::GuideGhost_GetChatMessage( const char *msg, int d )
{
if( msg == NULL ) return;
strcpy( szChatMessage, msg );
ChatDelay = d;
PlayListAutoSounds( GG_WAV_DIALOG, 0,0,0 );
}
void GuideRookie::GuideGhost_PreSet( void )
{
static int dt;
int x, y;
int dx,dy;
if( GuideGhost_CheckGo() == 0 )
{
if( GG_delay > 0 )
{
}
else return;
}
switch( GG_status )
{
case GG_DEATH : if( BoxAndDotCrash( Hero->x-50, Hero->y-50, 100, 100, gx, gy ))
{
GuideGhost_GetChatMessage( lan->OutputMessage(7,41) );//010215 lsw
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO;
GG_status_delay = 100;
}
break;
case GG_DEATH_GO : if( --GG_status_delay <= 0 )
{
switch( MapNumber )
{
// Scholium...
case 85 ://020827 lsw
case 30 : GuideGhost_GetChatMessage( lan->OutputMessage(7,42), 120 );//010215 lsw
GG_status_delay = 100;
break;
default : GuideGhost_GetChatMessage( lan->OutputMessage(7,43) );//010215 lsw
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO3;
GG_status_delay = 100;
break;
}
}
break;
case GG_DEATH_GO3 : if( --GG_status_delay <= 0 )
{
switch( MapNumber )
{
// Scholium...
case 85 : //020827 lsw
case 30 : GuideGhost_GetChatMessage( lan->OutputMessage(7,42), 120 );//010215 lsw
GG_status_delay = 100;
break;
default : switch( Hero->name_status.nation )
{
case N_VYSEUS : GuideGhost_GetChatMessage( lan->OutputMessage(7,44) );//010215 lsw
if( MapNumber == 0 ) // ma-in
{
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO4;
GG_status_delay = 150;
}
else
{
GG_status_delay = 150;
}
break;
case N_ZYPERN : GuideGhost_GetChatMessage( lan->OutputMessage(7,45) );//010215 lsw
if( MapNumber == 19 ) // renes_c
{
GG_status_delay = 150;
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO4;
}
else
{
GG_status_delay = 150;
}
break;
}
break;
}
}
break;
case GG_DEATH_GO4 : switch( Hero->name_status.nation )
{
case N_VYSEUS : if( MapNumber == 0 && BoxAndDotCrash( Hero->x-150, Hero->y-150, 300, 300, MapInfo[ MapNumber].ghostguide3x * TILE_SIZE, MapInfo[ MapNumber].ghostguide3y * TILE_SIZE ))
{
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO5;
GG_status_delay = 0;
}
else
{
GG_status_delay = 150;
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO3;
}
break;
case N_ZYPERN : if( MapNumber == 19 && BoxAndDotCrash( Hero->x-150, Hero->y-150, 300, 300, MapInfo[ MapNumber].ghostguide4x * TILE_SIZE, MapInfo[ MapNumber].ghostguide4y * TILE_SIZE ))
{
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO5;
GG_status_delay = 0;
}
else
{
GG_status_delay = 150;
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO3;
}
break;
}
break;
case GG_DEATH_GO5 : switch( Hero->name_status.nation )
{
case N_VYSEUS : if( MapNumber == 0 && BoxAndDotCrash( Hero->x-150, Hero->y-150, 300, 300, MapInfo[ MapNumber].ghostguide3x * TILE_SIZE, MapInfo[ MapNumber].ghostguide3y * TILE_SIZE ))
{
}
else
{
GG_status_delay = 150;
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO3;
}
break;
case N_ZYPERN : if( MapNumber == 19 && BoxAndDotCrash( Hero->x-150, Hero->y-150, 300, 300, MapInfo[ MapNumber].ghostguide4x * TILE_SIZE, MapInfo[ MapNumber].ghostguide4y * TILE_SIZE ))
{
}
else
{
GG_status_delay = 150;
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO3;
}
break;
}
if( --GG_status_delay <= 0 )
{
GG_oldstatus = GG_status;
GG_status = GG_DEATH_GO5;
GG_status_delay = 120;
GuideGhost_GetChatMessage( lan->OutputMessage(7,46), 120 );//010215 lsw
}
break;
case GG_ALIVE : switch ( GG_delay )
{
case GG_NO_MORE_DEATH - 2 : GuideGhost_GetChatMessage( lan->OutputMessage(7,47));//010215 lsw
break;
case GG_NO_MORE_DEATH - 100: GuideGhost_GetChatMessage( lan->OutputMessage(7,48) );//010215 lsw
break;
}
break;
}
x = Hero->x;
y = Hero->y;
GuideGhost_changexy( Hero->name_status.nation, MapNumber,&tx, &ty );
dx = (int)(tx-gx)/8;
dy = (int)(ty-gy)/8;
gx += dx;
gy += dy;
}
void GuideRookie::GuideGhost_OutPut( void )
{
static int d;
static int startcirclemagic;
int x, y;
if( GuideGhost_CheckGo() == 0 )
{
if( GG_delay > 0 )
{
--GG_delay;
}
else return;
}
if( d == 0 )
{
if( startcirclemagic <= 0 ) startcirclemagic = 50;
else startcirclemagic--;
x = (int )(5.*cos((startcirclemagic *5)%360*3.1415/180.));
y = (int )(5.*sin((startcirclemagic *5)%360*3.1415/180.));
InsertMagic( Hero, Hero, 386, 9, 0, 0, gx+x, gy+y );
}
GuideGhost_DisplayChatMessage();
d++;
if( d > 3 ) d = 0;
}
void GuideRookie::GuideGhost_changexy( int nation, int mapno, int *x, int *y )
{
int nx, ny;
switch( nation )
{
case N_VYSEUS : nx = MapInfo[ mapno].ghostguide3x * TILE_SIZE;
ny = MapInfo[ mapno].ghostguide3y * TILE_SIZE;
break;
case N_ZYPERN : nx = MapInfo[ mapno].ghostguide4x * TILE_SIZE;
ny = MapInfo[ mapno].ghostguide4y * TILE_SIZE;
break;
}
int x1, y1, x2, y2, dist;
float decline;
x1 = Hero->x;
y1 = Hero->y;
x2 = nx;
y2 = ny;
if( GG_status == GG_DEATH ) dist = 20;
else dist = 200;
decline = (float)atan2(y2-y1,x2-x1);
*x = x1 + (int)((float )dist*(float)cos(decline));
*y = y1 + (int)((float )dist*(float)sin(decline));
}
void GuideRookie::GuideGhost_DisplayChatMessage( void )
{
if( ChatDelay <= 0 )
{
return;
}
ChatDelay--;
TxtOut.Init(COLOR_BLACK, TXT_BG_NORMAL_WIDTH,12);
const int iX = gx - Mapx+20;
const int iY = gy - Mapy-10;
const int iGab = 10;//甸咯 静扁
const int iChatWidth = 135;
const int iLGab = CHAT_BG_HEIGHT;//临 埃拜
::Hcolor(FONT_COLOR_WHITE);
const int iLCt = TxtOut.RcChatOut(iX, iY, iChatWidth,iGab,CHAT_COLOR_TYPE_DEFAULT,szChatMessage);
::Hcolor(FONT_COLOR_GREEN);
TxtOut.RcChatHeaderOut(iX, iY-iLGab*(iLCt+1), iChatWidth,iGab,CHAT_COLOR_TYPE_DEFAULT,lan->OutputMessage(7,49));//iLCt+1 牢 捞蜡绰 捞抚 锭巩
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -