root/src/map/unit.h @ 22

Revision 1, 4.5 kB (checked in by jinshiro, 17 years ago)
Line 
1// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
2// For more information, see LICENCE in the main folder
3
4#ifndef _UNIT_H_
5#define _UNIT_H_
6
7//#include "map.h"
8struct block_list;
9struct unit_data;
10struct map_session_data;
11
12#include "map.h" // struct block_list
13#include "path.h" // struct walkpath_data
14#include "skill.h" // struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset
15
16struct unit_data {
17        struct block_list *bl;
18        struct walkpath_data walkpath;
19        struct skill_timerskill *skilltimerskill[MAX_SKILLTIMERSKILL];
20        struct skill_unit_group *skillunit[MAX_SKILLUNITGROUP];
21        struct skill_unit_group_tickset skillunittick[MAX_SKILLUNITGROUPTICKSET];
22        short attacktarget_lv;
23        short to_x,to_y;
24        short skillx,skilly;
25        short skillid,skilllv;
26        int   skilltarget;
27        int   skilltimer;
28        int   target;
29        int   attacktimer;
30        int   walktimer;
31        int     chaserange;
32        unsigned int attackabletime;
33        unsigned int canact_tick;
34        unsigned int canmove_tick;
35        uint8 dir;
36        unsigned char walk_count;
37        struct {
38                unsigned change_walk_target : 1 ;
39                unsigned skillcastcancel : 1 ;
40                unsigned attack_continue : 1 ;
41                unsigned walk_easy : 1 ;
42                unsigned running : 1;
43                unsigned speed_changed : 1;
44        } state;
45};
46
47struct view_data {
48        unsigned short
49                class_,
50                weapon,
51                shield, //Or left-hand weapon.
52                head_top,
53                head_mid,
54                head_bottom,
55                hair_style,
56                hair_color,
57                cloth_color;
58        char sex;
59        unsigned dead_sit : 2;
60};
61
62// PC, MOB, PET ‚É‹€’Ê‚·‚鏈—‚ð‚P‚‚ɂ܂Ƃ߂éŒv‰æ
63
64// •àsŠJŽn
65//     –ß‚è’l‚́A0 ( ¬Œ÷ ), 1 ( Žž”s )
66int unit_walktoxy( struct block_list *bl, short x, short y, int easy);
67int unit_walktobl( struct block_list *bl, struct block_list *target, int range, int easy);
68int unit_run(struct block_list *bl);
69
70// •às’âŽ~
71// type‚͈ȉº‚Ì‘g‚ݍ‡‚킹 :
72//     1: ˆÊ’uî•ñ‚Ì‘—M( ‚±‚̊֐”‚ÌŒã‚Ɉʒuî•ñ‚𑗐M‚·‚éê‡‚Í•s—v )
73//     2: ƒ_ƒ[ƒWƒfƒBƒŒƒC—L‚è
74//     4: •s–Ÿ(MOB‚̂݁H)
75int unit_stop_walking(struct block_list *bl,int type);
76int unit_can_move(struct block_list *bl);
77int unit_is_walking(struct block_list *bl);
78int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int type);
79
80int unit_escape(struct block_list *bl, struct block_list *target, short dist);
81// ˆÊ’u‚Ì‹­§ˆÚ“®(‚«”ò‚΂µ‚È‚Ç)
82int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath);
83int unit_warp(struct block_list *bl, short map, short x, short y, int type);
84int unit_setdir(struct block_list *bl,unsigned char dir);
85uint8 unit_getdir(struct block_list *bl);
86
87// ‚»‚±‚܂ŕàs‚Å‚œ‚ǂ蒅‚¯‚é‚©‚Ì”»’è
88bool unit_can_reach_pos(struct block_list *bl,int x,int y,int easy);
89bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, int easy, short *x, short *y);
90
91// UŒ‚ŠÖ˜A
92int unit_stop_attack(struct block_list *bl);
93int unit_attack(struct block_list *src,int target_id,int continuous);
94int unit_cancel_combo(struct block_list *bl);
95
96// ƒXƒLƒ‹Žg—p
97int unit_skilluse_id(struct block_list *src, int target_id, short skill_num, short skill_lv);
98int unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, short skill_num, short skill_lv);
99
100// ƒXƒLƒ‹Žg—p( •␳Ï‚݃LƒƒƒXƒgŽžŠÔAƒLƒƒƒ“ƒZƒ‹•s‰ÂÝ’è•t‚« )
101int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, short skill_lv, int casttime, int castcancel);
102int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, short skill_num, short skill_lv, int casttime, int castcancel);
103
104// ‰r¥ƒLƒƒƒ“ƒZƒ‹
105int unit_skillcastcancel(struct block_list *bl,int type);
106
107int unit_counttargeted(struct block_list *bl,int target_lv);
108
109// unit_data ‚̏‰Šú‰»ˆ—
110void unit_dataset(struct block_list *bl);
111
112int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int tick,int sdelay,int ddelay,int damage,int div,int type,int damage2);
113// ‚»‚Ì‘Œ
114struct unit_data* unit_bl2ud(struct block_list *bl);
115void unit_remove_map_pc(struct map_session_data *sd, int clrtype);
116void unit_free_pc(struct map_session_data *sd);
117#define unit_remove_map(bl,clrtype) unit_remove_map_(bl,clrtype,__FILE__,__LINE__,__func__)
118int unit_remove_map_(struct block_list *bl, int clrtype, const char* file, int line, const char* func);
119int unit_free(struct block_list *bl, int clrtype);
120int unit_changeviewsize(struct block_list *bl,short size);
121
122// ‰Šú‰»ƒ‹[ƒ`ƒ“
123int do_init_unit(void);
124int do_final_unit(void);
125
126extern const short dirx[8];
127extern const short diry[8];
128
129#endif /* _UNIT_H_ */
Note: See TracBrowser for help on using the browser.