-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenemy.inc
69 lines (54 loc) · 2.63 KB
/
enemy.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
include button.inc
MAXENYCNT EQU 250 ; 最大的敌人数量
MAXROADMAPCNT EQU 50 ; 最大的路径点数量
DEFAULTENEMYCD EQU 40 ; 默认的出怪延迟
DEFAULTWAVECD EQU 350 ; 默认的相邻波之间延迟
DELTAECNT EQU 3 ; 相邻波之间增加的怪数
ENEMYDATA struct
isActive WORD ?
health DWORD ?
healthMax DWORD ?
xf REAL4 ?
yf REAL4 ?
speed REAL4 ?
radius REAL4 ?
attack DWORD ?
progress REAL4 ? ; total dist (1D)
aParam DWORD ? ; use for restore some data
bParam DWORD ? ; use for restore some data
pAsButton DWORD ?
pHurtEvent DWORD ?
pDeathEvent DWORD ?
pUpdateEvent DWORD ?
ENEMYDATA ends
EXTERNDEF nEnemyListCnt:DWORD
EXTERNDEF nRoadmapCnt:DWORD
EXTERNDEF nWaveNumber:DWORD
EXTERNDEF nWaveEnemiesRemain:DWORD
EXTERNDEF nWaveEnemiesTotal:DWORD
EXTERNDEF arrayEnemyListHead:DWORD
EXTERNDEF arrayRoadmapListHead:DWORD
RegisterEnemy PROTO hp: DWORD, speed: REAL4, atk: DWORD
EnemyBindButton PROTO self: ptr ENEMYDATA, btn: ptr BUTTONDATA
EnemyBindUpdate PROTO self: ptr ENEMYDATA, upd: DWORD
EnemyUpdatePosition PROTO self: ptr ENEMYDATA ; update button pos to enemy pos
EnemySetPositioni PROTO self: ptr ENEMYDATA, x:DWORD, y:DWORD
EnemySetPositionf PROTO self: ptr ENEMYDATA, x:REAL4, y:REAL4
EnemyMovePositioni PROTO self: ptr ENEMYDATA, x:DWORD, y:DWORD
EnemyMovePositionf PROTO self: ptr ENEMYDATA, x:REAL4, y:REAL4
EnemyUpdateRadius PROTO self: ptr ENEMYDATA ; use button size to set radius
EnemyStepForward PROTO self: ptr ENEMYDATA
EnemySetDeath PROTO self: ptr ENEMYDATA
EnemyDefaultUpdate PROTO cnt:DWORD, pEnemy: ptr ENEMYDATA
EnemyMouseUpdate PROTO cnt:DWORD, pEnemy: ptr ENEMYDATA
EnemyUpdateAll PROTO cnt:DWORD ; 发送更新消息
WaveReset PROTO
WaveStart PROTO waven:DWORD, ecnt:DWORD ; 波数 敌人数
WaveStepForward PROTO
RoadmapClear PROTO
RoadmapAddi PROTO x:DWORD, y:DWORD
RoadmapAddf PROTO x:REAL4, y:REAL4
RoadmapTotalDist PROTO
RoadmapCalcCurrent PROTO s:REAL4 ; 依据一维距离计算当前位置 返回-> eax, edx; ecx为是否到达终点
FindInrangeEnemyf PROTO xi:REAL4, yi:REAL4, radius:REAL4 ; -> ptr ENEMYDATA
FindInrangeEnemyi PROTO xi:DWORD, yi:DWORD, radius:DWORD