Logo Search packages:      
Sourcecode: 7kaa version File versions  Download package

Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Member Functions

Unit Class Reference

Inheritance diagram for Unit:
Inheritance graph
[legend]
Collaboration diagram for Unit:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { WAY_POINT_ADJUST_SIZE = 5 }

Public Member Functions

virtual float actual_damage ()
void add_way_point (short x, short y)
int ai_build_camp ()
int ai_escape_fire ()
int ai_handle_seek_path_fail ()
void ai_leader_being_attacked (int attackerUnitRecno)
void ai_move_to_nearby_town ()
int ai_settle_new_town ()
void ask_team_help_attack (Unit *attackerUnit)
void assign (int buildXLoc, int buildYLoc, short curAssignUnitNum=1)
void assign_to_ship (int destX, int destY, short shipRecno, int miscNo=0)
void attack_firm (int firmXLoc, int firmYLoc, int xOffset=0, int yOffset=0, int resetBlockedEdge=1)
void attack_town (int townXLoc, int townYLoc, int xOffset=0, int yOffset=0, int resetBlockedEdge=1)
void attack_unit (int targetXLoc, int targetYLoc, int xOffset=0, int yOffset=0, int resetBlockedEdge=1)
void attack_unit (short targetRecno, int xOffset=0, int yOffset=0, int resetBlockedEdge=1)
void attack_wall (int wallXLoc, int wallYLoc, int xOffset=0, int yOffset=0, int resetBlockedEdge=1)
int betray (int newNationRecno)
void build_firm (int buildXLoc, int buildYLoc, int firmId, char remoteAction)
void burn (int burnXLoc, int burnYLoc, char remoteAction)
int can_attack ()
int can_attack_guard ()
int can_move_guard ()
virtual int can_resign ()
int can_spy_change_nation ()
int can_stand_guard ()
int caravan_in_firm ()
void change_hit_points (float changePoints)
void change_loyalty (int loyaltyChange)
void change_nation (int newNationRecno)
void clear_monster_defend_mode ()
virtual void clear_ptr ()
void clear_town_defend_mode ()
void clear_unit_defense_mode ()
int commanded_soldier_count ()
int commander_power ()
virtual UCHAR crc8 ()
SpriteAttackcur_sprite_attack ()
SpriteDiecur_sprite_die ()
SpriteFramecur_sprite_frame (int *needMirror=0)
SpriteMovecur_sprite_move ()
SpriteStopcur_sprite_stop ()
short cur_x_loc ()
short cur_y_loc ()
void cycle_eqv_attack ()
void defense_attack_firm (int targetXLoc, int targetYLoc)
void defense_attack_town (int targetXLoc, int targetYLoc)
void defense_attack_unit (short targetRecno)
void defense_attack_wall (int targetXLoc, int targetYLoc)
void defense_detect_target ()
virtual void deinit ()
void deinit_sprite (int keepSelected=0)
void deinit_unit_id ()
void deinit_unit_mode ()
void del_team_member (int)
virtual void detect_info ()
virtual int detect_unit_profile ()
virtual void die ()
void different_territory_destination (int &destX, int &destY)
void disable_force_move ()
virtual void disp_info (int refreshFlag)
virtual void disp_unit_profile (int dispY1, int refreshFlag)
UCHAR display_dir ()
void draw ()
virtual void draw_outlined ()
void draw_selected ()
void draw_skill_icon ()
void embark (int vehicleRecno)
void enable_force_move ()
int firm_can_assign (short firmRecno)
virtual void fix_attack_info ()
void gain_experience ()
int get_cur_loc (short &xLoc, short &yLoc)
int get_dir (int curX, int curY, int destX, int destY)
int get_monster_id ()
int get_monster_soldier_id ()
int get_weapon_version ()
void go_cast_power (int castXLoc, int castYLoc, char castPowerType, char remoteAction)
short go_x_loc ()
short go_y_loc ()
void group_transform (char remoteAction, short *selectedArray=NULL, short selectedCount=0)
void hit_building (Unit *parentUnit, int targetXLoc, int targetYLoc, float attackDamage)
void hit_firm (Unit *parentUnit, int targetXLoc, int targetYLoc, float attackDamage)
void hit_target (Unit *parentUnit, Unit *targetUnit, float attackDamage)
void hit_town (Unit *parentUnit, int targetXLoc, int targetYLoc, float attackDamage)
void hit_wall (Unit *attackUnit, int targetXLoc, int targetYLoc, float attackDamage)
int in_auto_defense_mode ()
int in_defend_town_mode ()
int in_monster_defend_mode ()
void inc_minor_combat_level (int)
void inc_minor_skill_level (int)
int independent_nation_can_attack (short nationRecno)
virtual void init (int unitId, int nationRecno, int rankId=0, int unitLoyalty=0, int startX=-1, int startY=-1)
void init (short spriteId, short startX, short startY)
virtual void init_derived ()
void init_sprite (int startXLoc, int startYLoc)
void init_unit_id (int unitId)
int is_action_attack ()
virtual int is_ai_all_stop ()
int is_civilian ()
int is_dir_correct ()
int is_guarding ()
int is_nation (int nationRecno)
int is_own ()
int is_own_spy ()
int is_shealth ()
int is_unit_dead ()
int is_visible ()
int match_dir ()
int max_attack_range ()
int move_step_magn ()
virtual void move_to (int destX, int destY, int preserveAction=0, short searchMode=1, short miscNo=0, short numOfPath=1, short reuseMode=GENERAL_GROUP_MOVEMENT, short pathReuseStatus=0)
void move_to_firm_surround (int destXLoc, int destYLoc, int width, int height, int miscNo=0, int readyDist=0)
void move_to_town_surround (int destXLoc, int destYLoc, int width, int height, int miscNo=0, int readyDist=0)
void move_to_unit_surround (int destXLoc, int destYLoc, int width, int height, int miscNo=0, int readyDist=0)
void move_to_wall_surround (int destXLoc, int destYLoc, int width, int height, int miscNo=0, int readyDist=0)
int nation_can_attack (short nationRecno)
int need_mirror (UCHAR dispDir)
virtual void next_day ()
short next_x_loc ()
short next_y_loc ()
void overseer_migrate (int destTownRecno)
virtual void pre_process ()
virtual void process_ai ()
virtual int process_attack ()
virtual int process_die ()
virtual void process_extra_move ()
virtual void process_idle ()
virtual void process_move ()
void process_turn ()
virtual void process_wait ()
void process_way_point ()
virtual int read_derived_file (File *filePtr)
int read_file (File *filePtr)
short rebel_recno ()
BYTE region_id ()
void reset_action_misc_para ()
void reset_action_para ()
void reset_action_para2 (int keepMode=0)
void reset_way_point_array ()
void resign (int remoteAction)
void resume_original_action ()
void resume_original_attack_action ()
int return_camp ()
void reward (int rewardNationRecno)
void save_original_action ()
void select_search_sub_mode (int sx, int sy, int dx, int dy, short nationRecno, short searchMode)
void set_attack ()
void set_combat_level (int)
void set_cur (int curX, int curY)
void set_die ()
void set_dir (int curX, int curY, int destX, int destY)
void set_dir (UCHAR newDir)
void set_guard_off ()
void set_guard_on ()
void set_idle ()
void set_mode (char modeId, short modePara=0)
void set_monster_id (int monsterId)
void set_monster_soldier_id (int monsterSoldierId)
void set_move ()
void set_name (WORD newNameId)
void set_next (int nextX, int nextY, int para=0, int blockedChecked=0)
void set_rank (int rankId)
void set_ready ()
void set_remain_attack_delay ()
void set_ship_extra_move ()
void set_spy (int spyRecno)
void set_turn ()
void set_wait ()
void set_weapon_version (int weaponVersion)
void settle (int settleXLoc, int settleYLoc, short curSettleUnitNum=1)
void ship_to_beach (int destX, int destY, int &finalDestX, int &finalDestY)
int should_show_info ()
void sprite_move (int desX, int desY)
void spy_change_nation (int nationRecno, char remoteAction)
virtual void stop (int preserveAction=0)
void stop2 (int preserveAction=0)
int think_aggressive_action ()
int think_assign_weapon_to_camp ()
int think_betray ()
int think_build_camp ()
int think_change_attack_target ()
int think_general_action ()
int think_general_flee ()
void think_independent_unit ()
int think_king_action ()
int think_king_flee ()
int think_leader_action ()
int think_normal_human_action ()
int think_resume_original_action ()
int think_reward ()
int think_ship_action ()
void think_spy_action ()
int think_stop_chase ()
int think_weapon_action ()
void transform ()
int true_nation_recno ()
virtual char * unit_name (int withTitle=1)
int unit_power ()
virtual void update_abs_pos (SpriteFrame *=0)
void update_loyalty ()
void validate_team ()
virtual int write_derived_file (File *filePtr)
int write_file (File *filePtr)

Public Attributes

static short abs_y1
static short abs_y2
char action_misc
short action_misc_para
char action_mode
char action_mode2
short action_para
short action_para2
short action_x_loc
short action_x_loc2
short action_y_loc
short action_y_loc2
char aggressive_mode
WORD ai_action_id
char ai_no_suitable_action
short ai_original_target_x_loc
short ai_original_target_y_loc
char ai_unit
char attack_count
UCHAR attack_dir
AttackInfoattack_info_array
char attack_range
char blocked_by_member
char blocked_edge [4]
char can_attack_flag
char can_guard_flag
UCHAR cur_action
UCHAR cur_attack
UCHAR cur_dir
UCHAR cur_frame
short cur_power
short cur_x
short cur_y
UCHAR final_dir
char force_move_flag
short go_x
short go_y
char group_select_id
char guard_count
float hit_points
short home_camp_firm_recno
char ignore_power_nation
short leader_unit_recno
char loyalty
short max_hit_points
short max_power
char mobile_type
short move_to_x_loc
short move_to_y_loc
WORD name_id
short nation_contribution
char nation_recno
short next_x
short next_y
char original_action_mode
short original_action_para
short original_action_x_loc
short original_action_y_loc
short original_target_x_loc
short original_target_y_loc
char race_id
short range_attack_x_loc
short range_attack_y_loc
char rank_id
UCHAR remain_attack_delay
UCHAR remain_frames_per_step
ResultNoderesult_node_array
int result_node_count
short result_node_recno
short result_path_dist
char seek_path_fail_count
char selected_flag
Skill skill
short sprite_id
SpriteInfosprite_info
short sprite_recno
short spy_recno
char swapping
char target_loyalty
DWORD team_id
TeamInfoteam_info
short total_reward
char turn_delay
DWORD unit_group_id
char unit_id
char unit_mode
short unit_mode_para
static short view_top_y
char waiting_term
ResultNodeway_point_array
short way_point_array_size
short way_point_count

Static Public Attributes

static short abs_x1
static short abs_x2
static short view_top_x

Protected Member Functions

int detect_basic_info ()
void detect_build ()
void detect_build_menu ()
void detect_button ()
void detect_main_menu ()
void detect_settle ()
void detect_spy_menu (int dispY1)
void disp_basic_info (int dispY1, int refreshFlag)
void disp_build (int)
void disp_build_menu (int)
void disp_button (int dispY1)
void disp_hit_point (int dispY1)
void disp_main_menu (int)
void disp_settle (int)
void disp_spy_menu (int dispY1, int refreshFlag)
void disp_unit_info (int dispY1, int refreshFlag)
void general_die ()
void king_die ()
void next_move ()
void pay_expense ()
void process_assign ()
void process_assign_to_ship ()
void process_attack_firm ()
void process_attack_town ()
void process_attack_unit ()
void process_attack_wall ()
void process_build_firm ()
void process_burn ()
void process_go_cast_power ()
void process_rebel ()
void process_recover ()
void process_settle ()
void process_ship_to_beach ()
void reset_path ()
int spy_menu_height ()
void terminate_move ()

Private Member Functions

void abort_searching (int reuseSetNext)
void add_close_attack_effect ()
void attack_target (Unit *targetUnit)
int avail_node_enough_for_search (short x1, short y1, short x2, short y2)
int cal_distance (int targetXLoc, int targetYLoc, int targetWidth, int targetHeight)
int can_attack_different_target_type ()
int can_attack_with (int i)
int can_attack_with (AttackInfo *attackInfo)
void check_self_surround ()
void choose_best_attack_mode (int attackDistance, char targetMobileType=UNIT_LAND)
void cycle_wait_shift_recno (Unit *curUnit, Unit *nextUnit)
void defend_town_attack_unit (short targetRecno)
void defend_town_back_town (short townRecno)
void defend_town_detect_target ()
int defend_town_follow_target ()
void defense_back_camp (int targetXLoc, int targetYLoc)
int defense_follow_target ()
int detect_surround_target ()
int edit_path_to_surround (int x1, int y1, int x2, int y2, int readyDist)
int free_space_for_range_attack (int targetXLoc, int targetYLoc, int targetWidth, int targetHeight, int targetMobileType, int maxRange)
void general_defend_mode_detect_target (int checkDefendMode=0)
int general_defend_mode_process_attack_target ()
void get_hit_x_y (short *xPtr, short *yPtr)
void handle_blocked_attack_firm (Unit *unitPtr)
void handle_blocked_attack_town (Unit *unitPtr)
void handle_blocked_attack_unit (Unit *unitPtr, Unit *targetPtr)
void handle_blocked_attack_wall (Unit *unitPtr)
void handle_blocked_by_idle_unit (Unit *unitPtr)
void handle_blocked_move (Location *blockedLoc)
void handle_blocked_move_s11 (Unit *unitPtr)
void handle_blocked_same_target_attack (Unit *unitPtr, Unit *targetPtr)
void handle_blocked_wait (Unit *unitPtr)
int idle_detect_attack (int startLoc=0, int dimensionInput=0, char defenseMode=0)
int idle_detect_choose_target (char defenseMode)
int idle_detect_firm_checking (short targetRecno)
void idle_detect_helper_attack (short unitRecno)
int idle_detect_town_checking (short targetRecno)
int idle_detect_unit_checking (short targetRecno)
int idle_detect_wall_checking (int targetXLoc, int targetYLoc)
int in_any_defense_mode ()
int is_in_surrounding (int checkXLoc, int checkYLoc, int width, int targetXLoc, int targetYLoc, int targetWidth, int targetHeight)
void monster_defend_attack_firm (int targetXLoc, int targetYLoc)
void monster_defend_attack_town (int targetXLoc, int targetYLoc)
void monster_defend_attack_unit (short targetRecno)
void monster_defend_attack_wall (int targetXLoc, int targetYLoc)
void monster_defend_back_firm (int targetXLoc, int targetYLoc)
void monster_defend_detect_target ()
int monster_defend_follow_target ()
void move_to_my_loc (Unit *unitPtr)
int move_to_range_attack (int targetXLoc, int targetYLoc, short miscNo, short searchMode, short maxRange)
int move_try_to_range_attack (Unit *targetUnit)
int on_my_path (short checkXLoc, short checkYLoc)
int on_way_to_attack (Unit *targetUnit)
void opposite_direction_blocked (short vecX, short vecY, short unitPtrVecX, short unitPtrVecY, Unit *unitPtr)
int possible_place_for_range_attack (int targetXLoc, int targetYLoc, int targetWidth, int targetHeight, int maxRange)
void process_auto_defense_attack_target ()
void process_auto_defense_back_camp ()
void process_auto_defense_detect_target ()
void process_defend_town_attack_target ()
void process_defend_town_back_town ()
void process_defend_town_detect_target ()
void process_monster_defend_attack_target ()
void process_monster_defend_back_firm ()
void process_monster_defend_detect_target ()
int reactivate_idle_action ()
void reset_search_tries ()
int search (int destX, int destY, int preserveAction=0, short searchMode=1, short miscNo=0, short numOfPath=1, short reuseMode=GENERAL_GROUP_MOVEMENT, short pathReuseStatus=0)
void search_or_stop (int destX, int destY, int preserveAction=0, short searchMode=1, short miscNo=0)
void search_or_wait ()
int searching (int destX, int destY, int preserveAction, short searchMode, short miscNo, short numOfPath, short reuseMode, short pathReuseStatus)
void set_attack_dir (short curX, short curY, short targetX, short targetY)
int set_move_to_surround (int buildXLoc, int buildYLoc, int width, int height, int buildingType, int miscNo=0, int readyDist=0, short curSettleUnitNum=1)
void set_search_tries (int tries)
void set_unreachable_location (int xLoc, int yLoc)
void ship_leave_beach (int shipOldXLoc, int shipOldYLoc)
int ship_surr_has_free_land (int targetXLoc, int targetYLoc, UCHAR regionId)
int ship_to_beach_path_edit (int &resultXLoc, int &resultYLoc, UCHAR regionNo)
int space_around_target (int squareXLoc, int squareYLoc, int width, int height)
int space_around_target_ver2 (int targetXLoc, int targetYLoc, int targetWidth, int targetHeight)
int space_for_attack (int targetXLoc, int targetYLoc, char targetMobileType, int targetWidth, int targetHeight)
void target_move (Unit *targetUnit)
void unit_auto_guarding (Unit *attackUnit)
int update_attack_path_dist ()

Detailed Description

Definition at line 209 of file OUNIT.h.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index