⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tool.cpp

📁 国内著名网络游戏dragon的客户端登陆用完整源码 配套一起上传的服务端部分可开服 无说明文档
💻 CPP
📖 第 1 页 / 共 5 页
字号:
	ex = x;
	while( TileMap[ex][y].attr_light == 0 && ex < g_Map.file.wWidth )	ex++;
	if( ex >= g_Map.file.wWidth ) ex = g_Map.file.wWidth -1;
	
	for( ; sx <= ex ; sx ++)
	{
		TileMap[ sx][y].attr_light = 1;
	}
}		
//___________________________________________________________________________ // 010904 LTS DEPAINT GROUP
void DePaintTileAttrGeffect(int x, int y )		
{	
	int sx, ex;
	
	sx = x;
	while( TileMap[sx][y].attr_light == 1 && sx >= 0 )	sx--;
	if( sx < 0 ) sx = 0;
	
	ex = x;
	while( TileMap[ex][y].attr_light == 1 && ex < g_Map.file.wWidth )	ex++;
	if( ex >= g_Map.file.wWidth ) ex = g_Map.file.wWidth -1;
	
	for( ; sx <= ex ; sx ++)
	{
		TileMap[ sx][y].attr_light = 0;
	}
}		
//___________________________________________________________________________ // 010904 LTS

void PaintTileAttrInside(int x, int y )
{	
	int sx, ex;
	
	sx = x;
	while( TileMap[sx][y].attr_inside == 0 && sx >= 0 )	sx--;
	if( sx < 0 ) sx = 0;
	
	ex = x;
	while( TileMap[ex][y].attr_inside == 0 && ex < g_Map.file.wWidth )	ex++;
	if( ex >= g_Map.file.wWidth ) ex = g_Map.file.wWidth -1;
	
	for( ; sx <= ex ; sx ++)
	{
		TileMap[ sx][y].attr_inside = 1;
	}
}		
//___________________________________________________________________________ // 010904 LTS DEPAINT GROUP
void DePaintTileAttrInside(int x, int y )		
{	
	int sx, ex;
	
	sx = x;
	while( TileMap[sx][y].attr_inside == 1 && sx >= 0 )	sx--;
	if( sx < 0 ) sx = 0;
	
	ex = x;
	while( TileMap[ex][y].attr_inside == 1 && ex < g_Map.file.wWidth )	ex++;
	if( ex >= g_Map.file.wWidth ) ex = g_Map.file.wWidth -1;
	
	for( ; sx <= ex ; sx ++)
	{
		TileMap[ sx][y].attr_inside = 0;
	}
}		
//___________________________________________________________________________ // 010904 LTS

void PaintTileAttrNoBattle(int x, int y )
{	
	int sx, ex;
	
	sx = x;
	while( TileMap[sx][y].attr_no_battle == 0 && sx >= 0 )	sx--;
	if( sx < 0 ) sx = 0;
	
	ex = x;
	while( TileMap[ex][y].attr_no_battle == 0 && ex < g_Map.file.wWidth )	ex++;
	if( ex >= g_Map.file.wWidth ) ex = g_Map.file.wWidth -1;
	
	for( ; sx <= ex ; sx ++)
	{
		TileMap[ sx][y].attr_no_battle = 1;
	}
}		
//___________________________________________________________________________ // 010904 LTS DEPAINT GROUP
void DePaintTileAttrNoBattle(int x, int y )		
{	
	int sx, ex;
	
	sx = x;
	while( TileMap[sx][y].attr_no_battle == 1 && sx >= 0 )	sx--;
	if( sx < 0 ) sx = 0;
	
	ex = x;
	while( TileMap[ex][y].attr_no_battle == 1 && ex < g_Map.file.wWidth )	ex++;
	if( ex >= g_Map.file.wWidth ) ex = g_Map.file.wWidth -1;
	
	for( ; sx <= ex ; sx ++)
	{
		TileMap[ sx][y].attr_no_battle = 0;
	}
}		
//___________________________________________________________________________ // 010904 LTS

void PaintTileAttrCanMatch(int x, int y )
{	
	int sx, ex;
	
	sx = x;
	while( TileMap[sx][y].canmatch == 0 && sx >= 0 )	sx--;
	if( sx < 0 ) sx = 0;
	
	ex = x;
	while( TileMap[ex][y].canmatch == 0 && ex < g_Map.file.wWidth )	ex++;
	if( ex >= g_Map.file.wWidth ) ex = g_Map.file.wWidth -1;
	
	for( ; sx <= ex ; sx ++)
	{
		TileMap[ sx][y].canmatch = 1;
	}
}		

//___________________________________________________________________________ // 010904 LTS DEPAINT GROUP
void DePaintTileAttrCanMatch(int x, int y )		
{	
	int sx, ex;
	
	sx = x;
	while( TileMap[sx][y].canmatch == 1 && sx >= 0 )	sx--;
	if( sx < 0 ) sx = 0;
	
	ex = x;
	while( TileMap[ex][y].canmatch == 1 && ex < g_Map.file.wWidth )	ex++;
	if( ex >= g_Map.file.wWidth ) ex = g_Map.file.wWidth -1;
	
	for( ; sx <= ex ; sx ++)
	{
		TileMap[ sx][y].canmatch = 0;
	}
}	
//___________________________________________________________________________ // 010904 LTS

//___________________________________________________________________________ // 010904 LTS DEPAINT GROUP

void PaintTileAttrTop(int x, int y )  
{	
	int sx, ex;
	
	sx = x;
	while( TileMap[sx][y].empty__4 == 0 && sx >= 0 )	sx--;
	if( sx < 0 ) sx = 0;
	
	ex = x;
	while( TileMap[ex][y].empty__4 == 0 && ex < g_Map.file.wWidth )	ex++;
	if( ex >= g_Map.file.wWidth ) ex = g_Map.file.wWidth -1;
	
	for( ; sx <= ex ; sx ++)
	{
		TileMap[ sx][y].empty__4 = 1;
	}
}		

void DePaintTileAttrTop(int x, int y )  // 010715 LTS
{	
	int sx, ex;
	
	sx = x;
	while( TileMap[sx][y].empty__4 == 1 && sx >= 0 )	sx--;
	if( sx < 0 ) sx = 0;
	
	ex = x;
	while( TileMap[ex][y].empty__4 == 1 && ex < g_Map.file.wWidth )	ex++;
	if( ex >= g_Map.file.wWidth ) ex = g_Map.file.wWidth -1;
	
	for( ; sx <= ex ; sx ++)
	{
		TileMap[ sx][y].empty__4 = 0;
	}
}		
//___________________________________________________________________________ // 010904 LTS

void DoSomeThingWithKey( WPARAM wParam, LPARAM lParam )
{			
	switch(wParam)
	{
	case 'H':
		{
			if(EWndMgr.IsFocus(HWND_GAME_MAIN))
			{
				ViewTipToggle = !ViewTipToggle;
			}
		}break;
	case VK_F12:
		{
			CaptureScreenForJpg();
		}break;
	default:
		{
		}break;
	}
#ifdef _DEBUG
	if( !GetSysInfo( SI_GAME_MAKE_MODE ) ) return;
	
	switch( wParam )									
	{						
	case VK_PRIOR :	if( tMapAttr_Offset_Modify == IDC_ATTR_OFFSET_YES2 )
					{
						TileMap[tMapAttrX][tMapAttrY].frontoffset -=1;
					}
		else
		{
			AddSkillCursor( Hero, 1, rand()%30, 150+ Mapx,200 +Mapy, 1);
		}
		break;		
		
	case VK_NEXT :	if( tMapAttr_Offset_Modify == IDC_ATTR_OFFSET_YES2 )
					{
						TileMap[tMapAttrX][tMapAttrY].frontoffset +=1;
					}
		break;		
		
	case VK_F2 :
		{
		}break;
	case VK_F3 : 
		Hero->nCharacterData[ MOVP ] += 10;
		break;
		
	case VK_F4 : 
		
		LoadCursorAni();
		LoadMouseCursor( "Cursor.Spr" );
		JustMsg(" CursorAni.txt甫 佬菌嚼聪促." );
		break;
		
	case VK_F5 :	
		{
			
			struct tm *now;
			time_t nowTime;
			short int hour, min, sec;
			time( &nowTime );
			now = localtime(&nowTime);
			hour = now->tm_hour;
			min  = now->tm_min;
			sec  = now->tm_sec;
			
			// PJH 0422
			FILE *fp;
			fp = fopen( "CharacterInfo.txt", "at+" );
			if( fp )
			{
				if( Hero == NULL )
				{
					fprintf( fp, " --- CharacterInfo --- \n Hero == NULL !!!!\n" );
					fclose(fp);
				}
				else
				{
					fprintf( fp, " --- CharacterInfo(%2d矫%2d盒%2d檬) --- \n name = %s\n position(x,y) = (%d, %d),(%d, %d),(%d, %d) \n condition = %d\n ",
						hour,min,sec,
						Hero->name,
						Hero->x,Hero->y,Hero->gox,Hero->goy,		
						Hero->destx,Hero->desty,
						Hero->condition
						);			
					
					int sprc	= Hero->AnimationTable[ Hero->nCurrentAction].cFrame[  Hero->nCurrentFrame ];
					int sprno	= Hero->sprno;
					int ac0		= Hero->accessory[0];
					int ac1		= Hero->accessory[1];
					int ac2		= Hero->accessory[2];
					int ac3		= Hero->accessory[3];
					
					Hero->sp		= &CharSpr[ sprno ].sp[ Hero->direction][ sprc];
					
					fprintf( fp, "nCurrentAction=%d nCurrentFrame=%d sprc=%d sprno=%d dir=%d sp=%p \n\n", 
						Hero->nCurrentAction, 
						Hero->nCurrentFrame,
						sprc,	
						sprno,	
						Hero->direction,
						Hero->sp );
					
					fclose(fp);	
				}				
			}
		}
		break;
		
		
	case VK_F6 :
		
		
		if (! pMusic->OpenFile("A.MP3") )
			MessageBox( g_hwndMain, "Visual Play Error","error",MB_ICONEXCLAMATION|MB_OK);
		else pMusic->Play();
		
		/*
		t_just_ani tp;
		
		  tp.id = 10008;
		  tp.ani = 1;
		  
			extern void Recv_JustAni( t_just_ani  *tp );
			Recv_JustAni( &tp );
		*/			
		
		break;
		
	case VK_F7 :	pMusic->Stop();
		
	case VK_F8 : 
		break;    
		
	case VK_F9 : 
		// acer4
		if( !Hero ) break;
		DestroyCharacterListExceptHero();
		OutputSmallMap();
		break;	  	
	}
#endif
}																	

void CheckCharacterFrameOrder( WPARAM wParam, LPARAM lParam )
{					
	int i,j;		
	
	if( SysInfo.viewcharacterframe == 0 ) return;
	if( AnimationEditWorkStartFlag == 1 ) return;
	
	
	switch( wParam )
	{		
	case VK_DOWN :	SpriteOrderDir += 7;
		SpriteOrderDir = (SpriteOrderDir) % 8;	break;
	case VK_UP   :	SpriteOrderDir = (++SpriteOrderDir) % 8;	break;
		
	case VK_LEFT :	SpriteOrderFrame--; if( SpriteOrderFrame < 0 )		SpriteOrderFrame = 74;
		
		break;	
		
	case VK_RIGHT :  SpriteOrderFrame++; if( SpriteOrderFrame >= 75 )	SpriteOrderFrame = 0;
	/*					if( SpriteOrderFrame < 27 ) // 茄颊.. 规菩.
	{
	Hero->accessory[2] = 61;
	Hero->accessory[3] = 87;
	}
	else if( 27 <= SpriteOrderFrame && SpriteOrderFrame < 35 )  // 剧颊.
	{
	Hero->accessory[2] = 74;
	Hero->accessory[3] = 0;
	}
	else if( 36 <= SpriteOrderFrame && SpriteOrderFrame < 71 ) // 劝悼累..
	{
	Hero->accessory[2] = 61;
	Hero->accessory[3] = 87;
	}
	else if( 71 <= SpriteOrderFrame && SpriteOrderFrame < 75 ) 
	{
	Hero->accessory[2] = 74;
	Hero->accessory[3] = 0;
	}*/
		break;	
		
	case ' ' :
	case 'Z' :
	case 'z' :  SpriteOrder[Hero->sprno][ SpriteOrderDir][ SpriteOrderFrame] ++;
		if( SpriteOrder[Hero->sprno][ SpriteOrderDir][ SpriteOrderFrame] > 5 )
			SpriteOrder[Hero->sprno][ SpriteOrderDir][ SpriteOrderFrame] = 0;
		break;
		
	case 's' :		
	case 'S' :  
		{		
			FILE *fp;
			char tempfilename[ FILENAME_MAX];
			sprintf( tempfilename, "./char/%02dClothOrder.bin",  Hero->sprno );
			fp = Fopen( tempfilename, "wb" );
			if( fp )
			{	
				for( i = 0 ; i < 8 ; i ++)
				{
					for( j = 0 ; j < 75 ; j ++)
					{
						fwrite( &SpriteOrder[Hero->sprno][i][j], 1,1, fp );
					}
				}
				fclose(fp);
				JustMsg( tempfilename );
			}	
		}		
		break;	
	}	
}		


//----------------------------------------------------------------------------------


//-----------------------   Mode Setting   ----------------
//-----------------------   Mode Setting   ----------------
//-----------------------   Mode Setting   ----------------
//-----------------------   Mode Setting   ----------------
//-----------------------   Mode Setting   ----------------



#define SM_ReadInt(x)	fscanf (fp, "%d", &##x); 
#define SM_WriteInt(x)	fprintf (fp, "%d\n", ##x);

#define DEVELOPEMENT_ENVIR_FILENAME	"dragonrajaonline_hongdoit.txt"

void LoadInitialData (void)
{		
	SysInfo.music    = 1;		// 1捞搁 澜厩阑 脑 
	SysInfo.effect   = 1;		// 1捞搁 瓤苞阑 脑 
	
	//	return;//
	
#ifdef _DEBUG
	
	
	FILE *fp = Fopen ( DEVELOPEMENT_ENVIR_FILENAME, "rt");
	if( fp )
	{	
		SM_ReadInt (SysInfo.dx);
		SM_ReadInt (SysInfo.notdead );
		SM_ReadInt (SysInfo.music);
		SM_ReadInt (SysInfo.effect);
		SM_ReadInt (SysInfo.cddata);
		SM_ReadInt (SysInfo.onekill );
		SM_ReadInt (SysInfo.gamemakemode );
		SM_ReadInt (SysInfo.notconectserver );
		SM_ReadInt (SysInfo.enable_menu );
		SM_ReadInt (SysInfo.viewcharacterframe );
		SM_ReadInt (SysInfo.gamemakemode );
		SM_ReadInt (SysInfo.loaditemfromtoi2 );
		SM_ReadInt (SysInfo.makeanitable_bin );
		SM_ReadInt (SysInfo.port );
		SM_ReadInt (SysInfo.entergameserver );
		SM_ReadInt (SysInfo.enteragent );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -