diff options
Diffstat (limited to 'src/ap_state.cpp')
| -rw-r--r-- | src/ap_state.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
| diff --git a/src/ap_state.cpp b/src/ap_state.cpp index 50601d4..5b02ba6 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp | |||
| @@ -85,6 +85,13 @@ struct APState { | |||
| 85 | "Achievement|" + GD_GetPanel(panel_id).achievement_name); | 85 | "Achievement|" + GD_GetPanel(panel_id).achievement_name); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | for (const MapArea& map_area : GD_GetMapAreas()) { | ||
| 89 | for (const Location& location : map_area.locations) { | ||
| 90 | tracked_data_storage_keys.push_back( | ||
| 91 | "Hunt|" + std::to_string(location.ap_location_id)); | ||
| 92 | } | ||
| 93 | } | ||
| 94 | |||
| 88 | initialized = true; | 95 | initialized = true; |
| 89 | } | 96 | } |
| 90 | 97 | ||
| @@ -311,6 +318,12 @@ struct APState { | |||
| 311 | return checked_locations.count(location_id); | 318 | return checked_locations.count(location_id); |
| 312 | } | 319 | } |
| 313 | 320 | ||
| 321 | bool HasCheckedHuntPanel(int location_id) { | ||
| 322 | std::string key = | ||
| 323 | data_storage_prefix + "Hunt|" + std::to_string(location_id); | ||
| 324 | return data_storage.count(key) && data_storage.at(key); | ||
| 325 | } | ||
| 326 | |||
| 314 | bool HasItem(int item_id, int quantity) { | 327 | bool HasItem(int item_id, int quantity) { |
| 315 | return inventory.count(item_id) && inventory.at(item_id) >= quantity; | 328 | return inventory.count(item_id) && inventory.at(item_id) >= quantity; |
| 316 | } | 329 | } |
| @@ -360,6 +373,10 @@ bool AP_HasCheckedGameLocation(int location_id) { | |||
| 360 | return GetState().HasCheckedGameLocation(location_id); | 373 | return GetState().HasCheckedGameLocation(location_id); |
| 361 | } | 374 | } |
| 362 | 375 | ||
| 376 | bool AP_HasCheckedHuntPanel(int location_id) { | ||
| 377 | return GetState().HasCheckedHuntPanel(location_id); | ||
| 378 | } | ||
| 379 | |||
| 363 | bool AP_HasItem(int item_id, int quantity) { | 380 | bool AP_HasItem(int item_id, int quantity) { |
| 364 | return GetState().HasItem(item_id, quantity); | 381 | return GetState().HasItem(item_id, quantity); |
| 365 | } | 382 | } |
