00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef PATHS_H
00022 #define PATHS_H 1
00023
00024 #include "PathFinder.h"
00025 #include "tiles.h"
00026 #include "rect.h"
00027 #include "chunks.h"
00028
00029 class Actor;
00030 class Game_object;
00031 class Game_window;
00032
00033
00034
00035
00036 class Actor_pathfinder_client : public Pathfinder_client
00037 {
00038 int dist;
00039 Actor *npc;
00040 public:
00041
00042
00043 Actor_pathfinder_client(Actor *npc, int d = 0);
00044
00045 virtual int get_max_cost(int cost_to_goal);
00046
00047 virtual int get_step_cost(Tile_coord from, Tile_coord& to);
00048
00049 virtual int estimate_cost(Tile_coord& from, Tile_coord& to);
00050
00051 virtual int at_goal(Tile_coord& tile, Tile_coord& goal);
00052 };
00053
00054
00055
00056
00057
00058 class Onecoord_pathfinder_client : public Actor_pathfinder_client
00059 {
00060 public:
00061 Onecoord_pathfinder_client(Actor *n) : Actor_pathfinder_client(n)
00062 { }
00063
00064 virtual int estimate_cost(Tile_coord& from, Tile_coord& to);
00065
00066 virtual int at_goal(Tile_coord& tile, Tile_coord& goal);
00067 };
00068
00069
00070
00071
00072
00073 class Offscreen_pathfinder_client : public Actor_pathfinder_client
00074 {
00075 Rectangle screen;
00076 Tile_coord best;
00077 public:
00078 Offscreen_pathfinder_client(Actor *n);
00079 Offscreen_pathfinder_client(Actor *n, Tile_coord b);
00080
00081 virtual int get_step_cost(Tile_coord from, Tile_coord& to);
00082
00083 virtual int estimate_cost(Tile_coord& from, Tile_coord& to);
00084
00085 virtual int at_goal(Tile_coord& tile, Tile_coord& goal);
00086 };
00087
00088
00089
00090
00091
00092 class Fast_pathfinder_client : public Pathfinder_client
00093 {
00094 int dist;
00095 public:
00096 Fast_pathfinder_client(int d = 0, int mf = 1 << 5) : dist(d)
00097 { set_move_flags(mf); }
00098
00099 virtual int get_max_cost(int cost_to_goal);
00100
00101 virtual int get_step_cost(Tile_coord from, Tile_coord& to);
00102
00103 virtual int estimate_cost(Tile_coord& from, Tile_coord& to);
00104
00105 virtual int at_goal(Tile_coord& tile, Tile_coord& goal);
00106 static int is_grabable(Tile_coord from, Tile_coord to);
00107
00108 static int is_straight_path(Tile_coord from, Tile_coord to);
00109 };
00110
00111
00112
00113
00114 class Monster_pathfinder_client : public Fast_pathfinder_client
00115 {
00116 Rectangle destbox;
00117 int intelligence;
00118 int axtiles, aytiles, aztiles;
00119 public:
00120 Monster_pathfinder_client(Actor *npc, Tile_coord dest, int dist);
00121
00122 Monster_pathfinder_client(Actor *attacker, int reach,
00123 Game_object *opponent);
00124
00125 virtual int get_max_cost(int cost_to_goal);
00126
00127 virtual int at_goal(Tile_coord& tile, Tile_coord& goal);
00128
00129 virtual int get_step_cost(Tile_coord from, Tile_coord& to);
00130 };
00131
00132
00133 #endif
00134