Defs.gd
1 extends Node 2 3 @export var def_drops = [] 4 @export var def_tiles = [] 5 @export var def_structures = [] 6 @export var def_jobs = [] 7 8 func _ready() -> void: 9 get_drop_dict() 10 get_tile_dict() 11 get_structure_dict() 12 get_job_dict() 13 14 func get_drop_dict(): 15 var list = self.get_property_list() 16 for item in list: 17 if item.name.begins_with('drop_dict'): 18 def_drops.append(item) 19 # --- Resource Defs for dropped items 20 var drop_dict_wood = { 21 "name": "wood", 22 "source": 0, 23 "atlas": Vector2i(0,0), 24 "stack_size": 75 25 } 26 27 func get_tile_dict(): 28 var list = self.get_property_list() 29 for item in list: 30 if item.name.begins_with('tile_dict'): 31 def_tiles.append(item) 32 # --- Tile Defs --- #still got to tweak the values 33 var tile_dict_grass = { 34 "text": "grass", 35 "source": 1, 36 "atlas": Vector2i(1,0), 37 "move_speed": 0.80, 38 "path_cost": 2, 39 "fertility": 1, 40 "cleanliness": 1.5, 41 "beauty": 1, 42 "flammability": 0.60, 43 "build_categories": "all", 44 "solid": false 45 } 46 var tile_dict_rich_soil = { 47 "text": "rich soil", 48 "source": 1, 49 "atlas": Vector2i(1,0), 50 "move_speed": 0.80, 51 "path_cost": 2, 52 "fertility": 1.4, 53 "cleanliness": -1.0, 54 "beauty": 0, 55 "flammability": 0.0, 56 "build_categories": "all", 57 "solid": false 58 } 59 var tile_dict_poor_soil = { 60 "text": "stony soil", 61 "source": 1, 62 "atlas": Vector2i(2,0), 63 "move_speed": 0.85, 64 "path_cost": 2, 65 "fertility": 0.7, 66 "cleanliness": -1.0, 67 "beauty": -1, 68 "flammability": 0.0, 69 "build_categories": "all", 70 "solid": false 71 } 72 var tile_dict_dirt = { 73 "text": "dirt", 74 "source": 1, 75 "atlas": Vector2i(4,0), 76 "move_speed": 0.85, 77 "path_cost": 2, 78 "fertility": 1.0, 79 "cleanliness": -1.5, 80 "beauty": -2, 81 "flammability": 0.0, 82 "build_categories": "all", 83 "solid": false 84 } 85 var tile_dict_dirt_path = { 86 "text": "dirt path", 87 "source": 1, 88 "atlas": Vector2i(0,0), 89 "move_speed": 1.0, 90 "path_cost": 1.5, 91 "fertility": 0.0, 92 "cleanliness": -1.0, 93 "beauty": -1, 94 "flammability": 0.0, 95 "build_categories": "all", 96 "solid": false 97 } 98 var tile_dict_brick_path = { 99 "text": "brick path", 100 "source": 0, 101 "atlas": Vector2i(2,0), 102 "move_speed": 1.0, 103 "path_cost": 1, 104 "fertility": 0.0, 105 "cleanliness": 0.0, 106 "beauty": 2, 107 "flammability": 0.0, 108 "build_categories": "heavy", 109 "solid": false 110 } 111 var tile_dict_steel_tile = { 112 "text": "steel tile", 113 "source": 1, 114 "atlas": Vector2i(7,0), 115 "move_speed": 1.0, 116 "path_cost": 1, 117 "fertility": 0.0, 118 "cleanliness": 0.2, 119 "beauty": 1, 120 "flammability": 0.0, 121 "build_categories": "heavy", 122 "solid": false 123 } 124 var tile_dict_concrete = { 125 "text": "concrete", 126 "source": 1, 127 "atlas": Vector2i(3,0), 128 "move_speed": 1.0, 129 "path_cost": 1, 130 "fertility": 0.0, 131 "cleanliness": 0.0, 132 "beauty": -1, 133 "flammability": 0.0, 134 "build_categories": "heavy", 135 "solid": false 136 } 137 var tile_dict_wood_tile = { 138 "text": "wood tile", 139 "source": 1, 140 "atlas": Vector2i(8,0), 141 "move_speed": 1.0, 142 "path_cost": 1, 143 "fertility": 0.0, 144 "cleanliness": 0.0, 145 "beauty": 3, 146 "flammability": 1.0, 147 "build_categories": "heavy", 148 "solid": false 149 } 150 var tile_dict_carpet = { 151 "text": "carpet", 152 "source": 1, 153 "atlas": Vector2i(5,0), 154 "move_speed": 1.0, 155 "path_cost": 1, 156 "fertility": 0.0, 157 "cleanliness": 0.0, 158 "beauty": 4, 159 "flammability": 1.2, 160 "build_categories": "light", 161 "solid": false 162 } 163 var tile_dict_sterile_tile = { 164 "text": "sterile tile", 165 "source": 1, 166 "atlas": Vector2i(0,1), 167 "move_speed": 1.0, 168 "path_cost": 1, 169 "fertility": 0.0, 170 "cleanliness": 0.6, 171 "beauty": 2, 172 "flammability": 0.0, 173 "build_categories": "heavy", 174 "solid": false 175 } 176 var tile_dict_marsh = { 177 "text": "marsh", 178 "source": 1, 179 "atlas": Vector2i(1,1), 180 "move_speed": 0.30, 181 "path_cost": 12, 182 "fertility": 0.5, 183 "cleanliness": -2.0, 184 "beauty": -1, 185 "flammability": 0.0, 186 "build_categories": "none", 187 "solid": false 188 } 189 func get_structure_dict(): 190 var list = self.get_property_list() 191 for item in list: 192 if item.name.begins_with('structure_dict'): 193 def_structures.append(item) 194 # --- Building Defs --- #not in use yet 195 var structure_dict_clear = { 196 "text": "clear", 197 "source": 0, 198 "atlas": Vector2i(-1,-1), 199 "beauty": 0, 200 "flammability": 0, 201 "build_categories": "none", 202 "solid": false 203 } 204 var structure_dict_wall = { 205 "text": "wall", 206 "source": 1, 207 "atlas": Vector2i(0,0), 208 "beauty": -1, 209 "flammability": 0.0, 210 "build_categories": "none", 211 "solid": true 212 } 213 var structure_dict_tree = { 214 "text": "tree", 215 "source": 1, 216 "atlas": Vector2i(6,0), 217 "beauty": 5, 218 "flammability": 0.0, 219 "build_categories": "none", 220 "solid": true 221 } 222 var structure_dict_mountain = { 223 "text": "mountain", 224 "source": 1, 225 "atlas": Vector2i(6,2), 226 "beauty": -1, 227 "flammability": 0.0, 228 "build_categories": "none", 229 "solid": true 230 } 231 var structure_dict_bench = { 232 "text": "bench", 233 "source": 2, 234 "atlas": Vector2i(1,0), 235 "beauty": -1, 236 "flammability": 0.0, 237 "build_categories": "none", 238 "solid": true 239 } 240 var structure_dict_growing = { 241 "text": "growing", 242 "source": 1, 243 "atlas": Vector2i(5,0), 244 "beauty": -1, 245 "flammability": 0.0, 246 "build_categories": "none", 247 "solid": false 248 } 249 var structure_dict_shelf = { 250 "text": "shelf", 251 "source": 1, 252 "atlas": Vector2i(3,2), 253 "beauty": -1, 254 "flammability": 0.0, 255 "build_categories": "none", 256 "solid": false 257 } 258 func get_job_dict(): 259 var list = self.get_property_list() 260 for item in list: 261 if item.name.begins_with('job_dict'): 262 def_jobs.append(item) 263 # --- Job Types --- #not in use yet 264 var job_dict_tree = { 265 "name": "tree", 266 "work_type": "plants", 267 "level_required": 0, 268 "work_max": 100, 269 "output": "drop_dict_wood" 270 } 271 var job_dict_rock = { 272 "name": "rock", 273 "work_type": "mining", 274 "level_required": 0, 275 "work_max": 100, 276 "output": "" 277 }