/* This file was generated by scramble.py. */
#line 1 "src/dungeon.py"
#ifndef _DUNGEON_
#define _DUNGEON_
typedef struct Tile Tile;
typedef enum EquipmentSlot EquipmentSlot;
typedef enum UtilityType UtilityType;
typedef struct Creature Creature;
typedef struct Dungeon Dungeon;
typedef struct PathNode PathNode;
#line 1
#include "common.h"
#include "data.h"
#include "render.h"
#include "create.h"
#line 6
#define board_w 39
#define board_h 35
#line 9
struct Tile {
    int kind /* 0 = border, 1 = ground, 2 = wall */;
    int kid;
    float light /* 0 = dark, 1 = bright */;
    int creature;
    int far;
    int path_step;
};
enum EquipmentSlot {
    Main,
    Off,
    Head,
    Neck
};
enum UtilityType {
    Water,
    Gas,
    Electric
};
struct Creature {
    int cid;
    Dungeon * dungeon;
    int ctype /* 1 = critter, 2 = npc, 3 = hero, 4 = monster */;
    int kid;
    int x, y;
    int d;
    int px, py, pd;
    bool hidden : 1;
    bool dead : 1;
    int fighting /* cid */;
    int healing /* cid */;
    int hp, hp_max;
    int mp, mp_max;
    int hitmin, hitmax;
    int leader /* 0 if solo, else the party leader */;
    bool to_exit;
    bool to_loot;
#line 47
    int equip [4] /* kid: main, off, head, neck */;
#line 49
    int pot_hp;
    int pot_mp;
    int pot_res;
    int pot_tel;
#line 54
    char * name;
};
struct Dungeon {
    Tile board [board_h * board_w];
    LandArray * creatures;
    int sx, sy;
    int ex, ey;
    int ticks;
    LandQueue * q;
    int floors;
    int level /* 0 = overworld, 1 = level 1, ... */;
    bool modified;
};
struct PathNode {
    int steps;
    int estimate;
    int d;
    int x, y;
    PathNode * parent;
};
#line 102
Dungeon* dungeon_new(void);
#line 108
void dungeon_destroy(Dungeon * self);
#line 112
void dungeon_move(int * xp, int * yp, int d);
#line 116
int dungeon_distance(int x1, int y1, int x2, int y2);
#line 163
int dungeon_dir(int x1, int y1, int x2, int y2);
#line 186
Tile* dungeon_tile(Dungeon * self, int x, int y);
#line 189
Tile* dungeon_tile_dir(Dungeon * self, int x, int y, int d);
#line 193
Creature* dungeon_creature(Dungeon * self, int cid);
#line 196
int dungeon_kind(Dungeon * self, int x, int y);
#line 199
void dungeon_clear(Dungeon * self);
#line 210
float dungeon_get_closest_light(Dungeon * self, int xp, int yp);
#line 221
void dungeon_light(Dungeon * self);
#line 230
Creature* dungeon_creature_new(Dungeon * self, Kind * kind, int x, int y);
#line 254
void dungeon_creature_update_stats(Creature * c);
#line 329
int count_kinds(Dungeon * self, int x, int y, int k);
#line 338
bool is_walkable(Dungeon * self, int x, int y, int d);
#line 346
int count_walkables(Dungeon * self, int x, int y);
#line 353
void check_attack(Creature * self);
#line 379
bool check_ranged(Creature * self, int x, int y, int d, int n, int radius, bool(* callback)(Creature * c, int p), int p, int * fx, int * fy);
#line 406
void check_attack_ranged(Creature * self, int radius, int ctype);
#line 416
void check_healing_ranged(Creature * self, int radius, int ctype);
#line 430
bool dungeon_teleport(Creature * self, int r);
#line 453
void dungeon_remove(Creature * self);
#line 457
void dungeon_appear(Creature * self);
#line 523
void dungeon_die(Creature * self);
#line 561
void creature_move(Creature * self, int d);
#line 567
bool check_equipment(Creature * self);
#line 633
bool buy_equipment(Creature * self, Kind * who, int where, Kind * what);
#line 642
bool check_vendor(Creature * self);
#line 676
bool check_trap(Creature * self);
#line 730
void hero_step(Creature * self);
#line 888
void dungeon_use(int kid);
#line 894
void dungeon_step(Dungeon * self);
#line 939
int dungeon_path(Dungeon * self, int x1, int y1, int x2, int y2, int maxlen, int * dirs);
#line 994
void dungeon_add_quest(Dungeon * dungeon, int q, bool spawn);
#endif
/* This file was generated by scramble.py. */
