00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef COMBAT_H
00022 #define COMBAT_H 1
00023
00024 #include "schedule.h"
00025 #include "lists.h"
00026
00027 class Actor;
00028 class Spellbook_object;
00029
00030
00031
00032
00033 class Combat_schedule : public Schedule
00034 {
00035 protected:
00036 static unsigned long battle_time;
00037 static unsigned long battle_end_time;
00038 enum Phase
00039 {
00040 initial = 0,
00041 approach = 1,
00042 retreat = 2,
00043 flee = 3,
00044 strike = 4,
00045 fire = 5,
00046 parry = 6,
00047 stunned = 7,
00048 wait_return = 8
00049 } state;
00050 Schedule_types prev_schedule;
00051 Actor_queue opponents;
00052 Game_object *practice_target;
00053 int weapon_shape;
00054 int ammo_shape;
00055 int projectile_shape;
00056 Spellbook_object *spellbook;
00057
00058
00059 unsigned char strike_range, projectile_range, max_range;
00060 bool is_thrown;
00061 bool returns;
00062 bool no_blocking;
00063 unsigned char yelled;
00064 bool started_battle;
00065 unsigned char fleed;
00066 bool can_yell;
00067 int failures;
00068 unsigned int teleport_time;
00069 void start_battle();
00070 bool teleport();
00071 virtual void find_opponents();
00072 Actor *find_protected_attacker();
00073 Game_object *find_foe(int mode);
00074 Game_object *find_foe();
00075 void approach_foe();
00076 void start_strike();
00077 void run_away();
00078 Spellbook_object *readied_spellbook();
00079 public:
00080 Combat_schedule(Actor *n, Schedule_types prev_sched);
00081 static void monster_died();
00082 virtual void now_what();
00083 virtual void im_dormant();
00084 virtual void ending(int newtype);
00085 virtual void set_weapon();
00086 bool has_started_battle() const
00087 { return started_battle; }
00088 };
00089
00090
00091
00092
00093
00094 class Duel_schedule : public Combat_schedule
00095 {
00096 Tile_coord start;
00097 int attacks;
00098 virtual void find_opponents();
00099 public:
00100 Duel_schedule(Actor *n);
00101 virtual void now_what();
00102 };
00103
00104 bool In_ammo_family(int shnum, int family);
00105
00106 #endif