?? sub_funtion.cpp
字號:
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <io.h>
#include <math.h>
#include "dragon.h"
#include "hong_sprite.h"
#include "char.h"
#include "Map.h"
#include "item.h"
#include "effect.h"
#include "gameProc.h"
#include "hong_sub.h"
#include "tool.h"
#include "CharDataTable.h"
#define FIGHT_RANGE 12
void Display_Fight_Time(int); //1:1 搬捧俊輯 皋牢
void Check_Time(void);
void Check_Length(int, int);
void Fight_Stone_End(void);
void SetFightMode(int target_id, int stone_X, int stone_Y);
//void One_Print(void);
void DisplayFightStone(void)
{
int hero_length;
static int fram_check=0;
int color;
if(Hero->fight_flag == 1) // 1:1 措搬葛靛啊 登擱 角青..
{
int display_x, display_y; // 盔狼 吝痢 諒釬..
int radius = FIGHT_RANGE*TILE_SIZE; //館瘤撫.. //卿..恐撈凡鱉??
display_x = Hero->stone_x - g_Map.x * TILE_SIZE; //葛聰磐 拳擱惑狼 諒釬...
display_y = Hero->stone_y - g_Map.y * TILE_SIZE; //
DWORD early = (g_ClientTime%16); //悼繳盔 瀕糊烙闌 力絹竅扁 困秦
if((early >=2 && early <= 3) || (early >=8 && early <= 9) || (early >=12 && early <=13))
{
color = (int)( RGB16( 40, 180, 40 ) );
Circle(display_x, display_y, radius+1, color);
color = (int)( RGB16( 100, 255, 100 ) );
Circle(display_x, display_y, radius-1, color);
//color = (int)( RGB16( 50, 200, 80 ) );
//Circle(xc, yc, radius+1, color);
}
//芭府備竅綽 傍僥.. sqrt((pow(x1-x2), 2) + (pow(y1-y2), 2))..........
hero_length = (int)sqrt(pow(Hero->stone_x - Hero->x, 2) + pow(Hero->stone_y - Hero->y, 2));
Check_Length(FIGHT_RANGE*TILE_SIZE, hero_length); //452, 469
Check_Time();
}
}
/*
//////////// 唱撈寇俊 茄葷恩父 樂綽啊 ////////////
int Fight_search(void)
{
LPCHARACTER lpCharacter;
int count=0;
lpCharacter = Hero;
while(lpCharacter != NULL)
{
if(lpCharacter == Hero ) lpCharacter->lpNext;
else
{
lpCharacter->lpNext;
count++;
}
}
return count;
}
*/
void Check_Length(int length, int hero_length) //裹困甫 哈絹唱擱.. 嚨..
{
if(length < hero_length)
{
SendCMD_CHARACTER_DEMAND(CCD_FIGHT_LOSE, Hero->id); //牢磊:目膏靛 皋矯瘤 #define疙莫,格釬id
Hero->fight_flag = 0;
}
}
void Check_Time(void)
{
DWORD clinet_time = g_ClientTime/1000;
DWORD delay = (clinet_time - Hero->fight_time); //霸烙撈 6硅 弧扼輯..
if(!delay) return;
if( delay%30 ==0 )
{
Display_Fight_Time(delay/30);
if(delay >= 300) //5盒撈 場抄版快..
{
SendCMD_CHARACTER_DEMAND(CCD_FIGHT_DRAW, Hero->id); //牢磊:目膏靛 皋矯瘤 #define疙莫,格釬id
Hero->fight_flag = 0;
}
}
}
static int old_degree=0;
void Display_Fight_Time(int degree) //degree -> 1~5 30檬寸..
{
if(old_degree==degree) return; //竄 茄鍋父 免仿闌 困秦
if(degree==1)
{
AddCurrentStatusMessage(255, 120, 30, lan->OutputMessage(3,198), degree*30);//lsw
old_degree = degree;
}
else if( degree && !((degree*30)%60) )
{
AddCurrentStatusMessage(255, 120, 30, lan->OutputMessage(3,199), (degree*30)/60);//lsw
old_degree = degree;
}
else if( degree && (degree*30)%60 )
{
AddCurrentStatusMessage(255, 120, 30, lan->OutputMessage(3,200), (degree*30)/60, (degree*30)-((degree*30)/60)*60);//lsw
old_degree = degree;
}
}
void Fight_Stone_End(void)
{
//LPCHARACTER lpTarget;
//if(Hero->fight_id!=NULL)
// lpTarget = ReturnCharacterPoint(Hero->fight_id);
Hero->fight_flag= 0;
Hero->stone_x = 0;
Hero->stone_y = 0;
Hero->fight_id = 0;
Hero->fight_time= 0;
/*
if(lpTarget!=NULL)
{
lpTarget->fight_flag = 0;
lpTarget->stone_x = 0;
lpTarget->stone_y = 0;
lpTarget->fight_id = 0;
lpTarget->fight_time= 0;
}
*/
}
void SetFightMode(int target_id, int stone_X, int stone_Y) //措惑苞 唱狼 1措1 傈捧葛靛 悸潑
{
Hero->fight_flag = 1;
Hero->stone_x = stone_X;
Hero->stone_y = stone_Y;
Hero->fight_id = target_id;
Hero->fight_time = g_ClientTime/1000; //檬竄困 矯埃闌 持絹霖促.
t_packet packet;
packet.h.header.type = CMD_SERVER_FIGHT_STONE;
packet.h.header.size = sizeof( t_fight_stone );
packet.u.angra.server_fight_stone.fight_flag = Hero->fight_flag;
packet.u.angra.server_fight_stone.fight_id = Hero->fight_id;
QueuePacket( &packet, 1 );
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -