1 /** 2 * @file 3 * @brief Look-up functions for dungeon and item tiles. 4 **/ 5 6 #pragma once 7 8 #include "ability-type.h" 9 #include "command-type.h" 10 #include "game-type.h" 11 #include "trap-type.h" 12 #include "rltiles/tiledef_defines.h" 13 #include "job-type.h" 14 #include "species-type.h" 15 16 #define TILE_NUM_KEY "tile_num" 17 18 struct bolt; 19 struct cloud_info; 20 struct coord_def; 21 struct item_def; 22 class monster; 23 struct monster_info; 24 struct shop_struct; 25 struct show_type; 26 27 bool is_door_tile(tileidx_t tile); 28 29 TextureID get_tile_texture(tileidx_t idx); 30 31 // Tile index lookup from Crawl data. 32 tileidx_t tileidx_feature(const coord_def &gc); 33 tileidx_t tileidx_trap(trap_type type); 34 tileidx_t tileidx_shop(const shop_struct *shop); 35 tileidx_t tileidx_feature_base(dungeon_feature_type feat); 36 tileidx_t tileidx_out_of_bounds(int branch); 37 void tileidx_out_of_los(tileidx_t *fg, tileidx_t *bg, tileidx_t *cloud, const coord_def& gc); 38 39 tileidx_t tileidx_monster(const monster_info& mon); 40 tileidx_t tileidx_draco_base(const monster_info& mon); 41 tileidx_t tileidx_draco_job(const monster_info& mon); 42 tileidx_t tileidx_demonspawn_base(const monster_info& mon); 43 tileidx_t tileidx_demonspawn_job(const monster_info& mon); 44 tileidx_t tileidx_player_mons(); 45 tileidx_t tileidx_tentacle(const monster_info& mon); 46 47 tileidx_t tileidx_item(const item_def &item); 48 tileidx_t tileidx_item_throw(const item_def &item, int dx, int dy); 49 tileidx_t tileidx_known_base_item(tileidx_t label); 50 51 tileidx_t tileidx_cloud(const cloud_info &cl); 52 tileidx_t tileidx_bolt(const bolt &bolt); 53 tileidx_t vary_bolt_tile(tileidx_t tile, int dist); 54 tileidx_t tileidx_zap(int colour); 55 tileidx_t tileidx_spell(const spell_type spell); 56 tileidx_t tileidx_skill(const skill_type skill, int train); 57 tileidx_t tileidx_command(const command_type cmd); 58 tileidx_t tileidx_gametype(const game_type gtype); 59 tileidx_t tileidx_ability(const ability_type ability); 60 tileidx_t tileidx_branch(const branch_type br); 61 tileidx_t tileidx_player_job(const job_type job, bool recommended); 62 tileidx_t tileidx_player_species(const species_type species, bool recommended); 63 64 tileidx_t tileidx_known_brand(const item_def &item); 65 tileidx_t tileidx_corpse_brand(const item_def &item); 66 67 tileidx_t tileidx_unseen_flag(const coord_def &gc); 68 69 // Return the level of enchantment as an int. None is 0, Randart is 4. 70 int enchant_to_int(const item_def &item); 71 // If tile has variations, select among them based upon the enchant of item. 72 tileidx_t tileidx_enchant_equ(const item_def &item, tileidx_t tile, 73 bool player = false); 74 75 void bind_item_tile(item_def &item); 76 77 // For a given fg/bg set of tile indices and a 1 character prefix, 78 // return index, flag, and tile name as a printable string. 79 string tile_debug_string(tileidx_t fg, tileidx_t bg, char prefix); 80 81 void tile_init_props(monster* mon); 82 tileidx_t tileidx_monster_base(int type, int mon_id, bool in_water = false, 83 int colour = 0, int number = 4, int tile_num_prop = 0, 84 bool vary = true); 85 tileidx_t tileidx_mon_clamp(tileidx_t tile, int offset); 86