# pragma region License
/*
License ( OLC - 3 )
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Copyright 2024 Joshua Sigona < sigonasr2 @ gmail . com >
Redistribution and use in source and binary forms , with or without modification ,
are permitted provided that the following conditions are met :
1. Redistributions or derivations of source code must retain the above copyright
notice , this list of conditions and the following disclaimer .
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice . This list of conditions and the following disclaimer must be
reproduced in the documentation and / or other materials provided with the distribution .
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission .
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY
EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT ,
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , DATA , OR PROFITS ; OR
BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY , WHETHER IN
CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE .
Portions of this software are copyright © 2024 The FreeType
Project ( www . freetype . org ) . Please see LICENSE_FT . txt for more information .
All rights reserved .
*/
# pragma endregion
# pragma once
# include <string>
using BackdropName = std : : string ;
using MonsterSpawnerID = int ;
# define INCLUDE_ANIMATION_DATA extern safemap<std::string,Animate2D::FrameSequence>ANIMATION_DATA;
# define INCLUDE_MONSTER_LIST extern std::vector<std::shared_ptr<Monster>>MONSTER_LIST;
# define INCLUDE_SPAWNER_LIST extern std::unordered_map<MonsterSpawnerID,MonsterSpawner>SPAWNER_LIST;
# define INCLUDE_SPAWNER_CONTROLLER extern std::optional<std::queue<MonsterSpawnerID>>SPAWNER_CONTROLLER;
# define INCLUDE_DAMAGENUMBER_LIST extern std::vector<std::shared_ptr<DamageNumber>>DAMAGENUMBER_LIST;
# define INCLUDE_game extern AiL*game;
# define INCLUDE_MONSTER_DATA extern std::map<std::string,MonsterData>MONSTER_DATA;
# define INCLUDE_BULLET_LIST extern std::vector<std::unique_ptr<IBullet>>BULLET_LIST;
# define INCLUDE_EMITTER_LIST extern std::vector<std::unique_ptr<Emitter>>EMITTER_LIST;
# define INCLUDE_DATA extern utils::datafile DATA;
# define INCLUDE_STRATEGY_DATA extern safemap<std::string,std::function<void(Monster&,float,std::string)>>STRATEGY_DATA;
# define INCLUDE_TILE_ANIMATION_DATA extern std::map<int,std::vector<std::pair<int,float>>>TILE_ANIMATION_DATA;
# define INCLUDE_GFX extern safemap<std::string,Renderable>GFX;
# define INCLUDE_ITEM_DATA extern safemap<std::string,ItemInfo>ITEM_DATA;
# define INCLUDE_ITEM_CATEGORIES extern safemap<std::string,std::set<std::string>>ITEM_CATEGORIES;
# define DO_NOTHING [](MenuFuncData data){return true;}
# define INCLUDE_WINDOW_SIZE extern vi2d WINDOW_SIZE;
# define INCLUDE_ITEM_CONVERSIONS extern safemap<std::string,IT>ITEM_CONVERSIONS;
# define INCLUDE_ADMIN_MODE extern bool ADMIN_MODE;
# define INCLUDE_PACK_KEY extern std::string PACK_KEY;
# define INCLUDE_BACKDROP_DATA extern std::map<BackdropName,Renderable>BACKDROP_DATA;
# define INCLUDE_FOREDROP_DATA extern std::map<BackdropName,Renderable>FOREDROP_DATA;
# define INCLUDE_CENTERED extern const vf2d Menu::CENTERED;
# define ACCESS_PLAYER Player*p=game->GetPlayer();
# define INCLUDE_INITIALIZEGAMECONFIGURATIONS extern void InitializeGameConfigurations();
# define VARIANTS float,int,std::string,bool,vf2d,std::vector<std::any>,size_t
# undef INFINITE
# define INFINITE 999999
# define SETUP_CLASS(class) \
class : : class ( ) \
: Player : : Player ( ) { } \
class : : class ( Player * player ) \
: Player : : Player ( player ) { } \
Class class : : GetClass ( ) { return cl ; } \
void class : : CreateOriginalCopies ( ) { \
original_rightClickAbility = rightClickAbility ; \
original_ability1 = ability1 ; \
original_ability2 = ability2 ; \
original_ability3 = ability3 ; \
original_ability4 = ability4 ; \
original_rightClickAbility . isOriginalAbility = true ; \
original_ability1 . isOriginalAbility = true ; \
original_ability2 . isOriginalAbility = true ; \
original_ability3 . isOriginalAbility = true ; \
original_ability4 . isOriginalAbility = true ; \
} \
void class : : ResetToOriginalAbilities ( ) { \
rightClickAbility . COOLDOWN_TIME = original_rightClickAbility . COOLDOWN_TIME ; \
ability1 . COOLDOWN_TIME = original_ability1 . COOLDOWN_TIME ; \
ability2 . COOLDOWN_TIME = original_ability2 . COOLDOWN_TIME ; \
ability3 . COOLDOWN_TIME = original_ability3 . COOLDOWN_TIME ; \
ability4 . COOLDOWN_TIME = original_ability4 . COOLDOWN_TIME ; \
rightClickAbility . MAX_CHARGES = original_rightClickAbility . MAX_CHARGES ; \
ability1 . MAX_CHARGES = original_ability1 . MAX_CHARGES ; \
ability2 . MAX_CHARGES = original_ability2 . MAX_CHARGES ; \
ability3 . MAX_CHARGES = original_ability3 . MAX_CHARGES ; \
ability4 . MAX_CHARGES = original_ability4 . MAX_CHARGES ; \
rightClickAbility . precastInfo = original_rightClickAbility . precastInfo ; \
ability1 . precastInfo = original_ability1 . precastInfo ; \
ability2 . precastInfo = original_ability2 . precastInfo ; \
ability3 . precastInfo = original_ability3 . precastInfo ; \
ability4 . precastInfo = original_ability4 . precastInfo ; \
} \
const std : : string & class : : GetClassName ( ) { return name ; } \
Ability & class : : GetRightClickAbility ( ) { return rightClickAbility ; } ; \
Ability & class : : GetAbility1 ( ) { return ability1 ; } ; \
Ability & class : : GetAbility2 ( ) { return ability2 ; } ; \
Ability & class : : GetAbility3 ( ) { return ability3 ; } ; \
Ability & class : : GetAbility4 ( ) { return ability4 ; } ; \
Ability & class : : GetOriginalAbility1 ( ) { return original_ability1 ; } ; \
Ability & class : : GetOriginalAbility2 ( ) { return original_ability2 ; } ; \
Ability & class : : GetOriginalAbility3 ( ) { return original_ability3 ; } ; \
Ability & class : : GetOriginalRightClickAbility ( ) { return original_rightClickAbility ; } ; \
void class : : SetAbility4 ( const Ability & originalAbility ) { \
auto it = std : : find ( Player : : ABILITY_LIST . begin ( ) , Player : : ABILITY_LIST . end ( ) , originalAbility ) ; \
if ( it = = Player : : ABILITY_LIST . end ( ) ) ERR ( std : : format ( " WARNING! Could not find ability {} in original ability list! This function MUST be supplied with an original ability. Was original ability: {} " , originalAbility . name , originalAbility . isOriginalAbility ) ) ; \
class : : original_ability4 = class : : ability4 = originalAbility ; \
} \
std : : string & class : : GetWalkNAnimation ( ) { return walk_n ; } ; \
std : : string & class : : GetWalkEAnimation ( ) { return walk_e ; } ; \
std : : string & class : : GetWalkSAnimation ( ) { return walk_s ; } ; \
std : : string & class : : GetWalkWAnimation ( ) { return walk_w ; } ; \
std : : string & class : : GetIdleNAnimation ( ) { return idle_n ; } ; \
std : : string & class : : GetIdleEAnimation ( ) { return idle_e ; } ; \
std : : string & class : : GetIdleSAnimation ( ) { return idle_s ; } ; \
std : : string & class : : GetIdleWAnimation ( ) { return idle_w ; } ; \
std : : string class : : name = " " ; \
Class class : : cl = ANY ; \
Ability class : : rightClickAbility = Ability ( ) ; \
Ability class : : ability1 = Ability ( ) ; \
Ability class : : ability2 = Ability ( ) ; \
Ability class : : ability3 = Ability ( ) ; \
Ability class : : ability4 = Ability ( ) ; \
Ability class : : original_rightClickAbility = Ability ( ) ; \
Ability class : : original_ability1 = Ability ( ) ; \
Ability class : : original_ability2 = Ability ( ) ; \
Ability class : : original_ability3 = Ability ( ) ; \
Ability class : : original_ability4 = Ability ( ) ; \
std : : string class : : idle_n = " WARRIOR_IDLE_N " ; \
std : : string class : : idle_e = " WARRIOR_IDLE_E " ; \
std : : string class : : idle_s = " WARRIOR_IDLE_S " ; \
std : : string class : : idle_w = " WARRIOR_IDLE_W " ; \
std : : string class : : walk_n = " WARRIOR_WALK_N " ; \
std : : string class : : walk_e = " WARRIOR_WALK_E " ; \
std : : string class : : walk_s = " WARRIOR_WALK_S " ; \
std : : string class : : walk_w = " WARRIOR_WALK_W " ;