2023-11-20 23:25:36 -06:00
# pragma region License
2023-11-14 18:11:32 -06:00
/*
License ( OLC - 3 )
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
2024-01-02 00:46:32 -06:00
Copyright 2024 Joshua Sigona < sigonasr2 @ gmail . com >
2023-11-14 18:11:32 -06:00
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 .
2023-11-29 00:50:00 -06:00
2024-01-30 14:48:49 +00:00
Portions of this software are copyright © 2024 The FreeType
2023-11-29 00:50:00 -06:00
Project ( www . freetype . org ) . Please see LICENSE_FT . txt for more information .
All rights reserved .
2023-11-14 18:11:32 -06:00
*/
2023-11-20 23:25:36 -06:00
# pragma endregion
2023-06-15 00:11:39 -05:00
# pragma once
2024-01-10 02:24:12 -06:00
# include <string>
using BackdropName = std : : string ;
2024-05-21 05:05:02 -05:00
using MonsterSpawnerID = int ;
2023-08-06 19:00:09 -05:00
# define INCLUDE_ANIMATION_DATA extern safemap<std::string,Animate2D::FrameSequence>ANIMATION_DATA;
2024-07-26 03:09:55 -05:00
# define INCLUDE_MONSTER_LIST extern std::vector<std::shared_ptr<Monster>>MONSTER_LIST;
2024-05-21 05:05:02 -05:00
# define INCLUDE_SPAWNER_LIST extern std::unordered_map<MonsterSpawnerID,MonsterSpawner>SPAWNER_LIST;
# define INCLUDE_SPAWNER_CONTROLLER extern std::optional<std::queue<MonsterSpawnerID>>SPAWNER_CONTROLLER;
2023-07-25 19:48:24 -05:00
# define INCLUDE_DAMAGENUMBER_LIST extern std::vector<std::shared_ptr<DamageNumber>>DAMAGENUMBER_LIST;
2024-01-04 05:21:56 -06:00
# define INCLUDE_game extern AiL*game;
2023-12-19 00:15:47 -06:00
# define INCLUDE_MONSTER_DATA extern std::map<std::string,MonsterData>MONSTER_DATA;
2024-07-21 16:11:41 -05:00
# define INCLUDE_BULLET_LIST extern std::vector<std::unique_ptr<IBullet>>BULLET_LIST;
2023-07-12 00:23:36 -05:00
# define INCLUDE_EMITTER_LIST extern std::vector<std::unique_ptr<Emitter>>EMITTER_LIST;
2023-08-06 19:00:09 -05:00
# define INCLUDE_DATA extern utils::datafile DATA;
2023-12-18 15:40:36 -06:00
# define INCLUDE_STRATEGY_DATA extern safemap<std::string,std::function<void(Monster&,float,std::string)>>STRATEGY_DATA;
2023-09-12 05:07:12 -05:00
# define INCLUDE_TILE_ANIMATION_DATA extern std::map<int,std::vector<std::pair<int,float>>>TILE_ANIMATION_DATA;
2023-09-16 07:00:38 -05:00
# define INCLUDE_GFX extern safemap<std::string,Renderable>GFX;
2023-10-07 15:47:26 -05:00
# define INCLUDE_ITEM_DATA extern safemap<std::string,ItemInfo>ITEM_DATA;
2023-10-06 18:46:13 -05:00
# define INCLUDE_ITEM_CATEGORIES extern safemap<std::string,std::set<std::string>>ITEM_CATEGORIES;
2023-11-11 17:31:53 -06:00
# define DO_NOTHING [](MenuFuncData data){return true;}
2023-12-15 23:57:09 -06:00
# define INCLUDE_WINDOW_SIZE extern vi2d WINDOW_SIZE;
2024-01-30 21:55:32 -06:00
# define INCLUDE_ITEM_CONVERSIONS extern safemap<std::string,IT>ITEM_CONVERSIONS;
2024-08-05 06:38:54 -05:00
# define INCLUDE_ADMIN_MODE extern bool ADMIN_MODE;
2024-09-13 17:20:55 -05:00
# define INCLUDE_DEMO_BUILD extern bool DEMO_BUILD;
2024-10-18 00:16:55 -05:00
# define INCLUDE_ITEM_SCRIPTS extern safemap<std::string,ItemScript>ITEM_SCRIPTS;
2023-07-02 08:42:18 -07:00
2024-02-25 18:31:52 -06:00
# define INCLUDE_PACK_KEY extern std::string PACK_KEY;
2024-01-10 02:24:12 -06:00
# define INCLUDE_BACKDROP_DATA extern std::map<BackdropName,Renderable>BACKDROP_DATA;
2024-04-25 18:16:38 -05:00
# define INCLUDE_FOREDROP_DATA extern std::map<BackdropName,Renderable>FOREDROP_DATA;
2024-01-10 02:24:12 -06:00
2023-11-19 15:57:18 -06:00
# define INCLUDE_CENTERED extern const vf2d Menu::CENTERED;
2023-07-13 20:24:47 +00:00
# define ACCESS_PLAYER Player*p=game->GetPlayer();
2023-07-06 03:22:05 -05:00
2024-08-06 04:39:36 -05:00
# define INCLUDE_INITIALIZEGAMECONFIGURATIONS extern void InitializeGameConfigurations();
2024-06-18 11:38:03 -05:00
# define VARIANTS float,int,std::string,bool,vf2d,std::vector<std::any>,size_t
2023-11-21 06:05:52 -06:00
# undef INFINITE
2023-07-13 20:24:47 +00:00
# define INFINITE 999999
2024-12-13 02:06:54 -06:00
# define MAX_BULLETS size_t(512)
2023-07-13 20:24:47 +00:00
# define SETUP_CLASS(class) \
2023-07-23 12:33:20 -05:00
class : : class ( ) \
: Player : : Player ( ) { } \
2023-07-14 19:14:04 +00:00
class : : class ( Player * player ) \
2023-07-22 04:21:10 -05:00
: Player : : Player ( player ) { } \
2023-07-13 20:24:47 +00:00
Class class : : GetClass ( ) { return cl ; } \
2024-08-09 18:13:08 -05:00
void class : : CreateOriginalCopies ( ) { \
2024-09-07 04:14:18 -05:00
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 ; \
2024-08-09 18:13:08 -05:00
} \
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 ; \
} \
2024-01-30 21:55:32 -06:00
const std : : string & class : : GetClassName ( ) { return name ; } \
2023-07-13 20:24:47 +00:00
Ability & class : : GetRightClickAbility ( ) { return rightClickAbility ; } ; \
Ability & class : : GetAbility1 ( ) { return ability1 ; } ; \
Ability & class : : GetAbility2 ( ) { return ability2 ; } ; \
Ability & class : : GetAbility3 ( ) { return ability3 ; } ; \
2023-07-14 15:44:17 +00:00
Ability & class : : GetAbility4 ( ) { return ability4 ; } ; \
2024-09-15 21:24:48 -05:00
Ability & class : : _GetOriginalAbility1 ( ) { return GetOriginalAbility1 ( ) ; } ; \
Ability & class : : _GetOriginalAbility2 ( ) { return GetOriginalAbility2 ( ) ; } ; \
Ability & class : : _GetOriginalAbility3 ( ) { return GetOriginalAbility2 ( ) ; } ; \
Ability & class : : _GetOriginalRightClickAbility ( ) { return GetOriginalRightClickAbility ( ) ; } ; \
2024-09-07 04:14:18 -05:00
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 ; \
} \
2023-08-06 19:00:09 -05:00
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 ; } ; \
2023-07-26 19:46:39 -05:00
std : : string class : : name = " " ; \
Class class : : cl = ANY ; \
2023-09-26 02:40:38 -05:00
Ability class : : rightClickAbility = Ability ( ) ; \
Ability class : : ability1 = Ability ( ) ; \
Ability class : : ability2 = Ability ( ) ; \
Ability class : : ability3 = Ability ( ) ; \
Ability class : : ability4 = Ability ( ) ; \
2024-08-09 18:13:08 -05:00
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 ( ) ; \
2023-08-06 19:00:09 -05:00
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 " ;