2023-11-20 23:25:36 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# pragma region License 
  
						 
					
						
							
								
									
										
										
										
											2023-11-14 18:11:32 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								License  ( OLC - 3 )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-11-14 18:12:54 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Copyright  2018  -  2023  OneLoneCoder . 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-20 23:25:36 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# pragma endregion 
  
						 
					
						
							
								
									
										
										
										
											2023-06-11 22:57:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# pragma once 
  
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:03:30 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# include  "olcPixelGameEngine.h" 
  
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:44:51 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Animation.h" 
  
						 
					
						
							
								
									
										
										
										
											2023-06-15 23:44:34 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "State.h" 
  
						 
					
						
							
								
									
										
										
										
											2023-07-14 15:44:17 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Buff.h" 
  
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:44:51 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "olcUTIL_Animate2D.h" 
  
						 
					
						
							
								
									
										
										
										
											2023-09-23 15:28:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "DEFINES.h" 
  
						 
					
						
							
								
									
										
										
										
											2023-10-03 02:34:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Attributable.h" 
  
						 
					
						
							
								
									
										
										
										
											2023-11-22 01:12:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Item.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "safemap.h" 
  
						 
					
						
							
								
									
										
										
										
											2023-09-08 14:36:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-11-21 22:03:48 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								INCLUDE_ITEM_DATA  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-11-26 18:16:40 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								struct  DamageNumber ;  
						 
					
						
							
								
									
										
										
										
											2023-07-14 15:44:17 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								struct  Player ;  
						 
					
						
							
								
									
										
										
										
											2023-09-09 07:10:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  Crawler ;  
						 
					
						
							
								
									
										
										
										
											2023-07-14 15:44:17 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-23 15:28:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								enum  class  Attribute ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								enum  MonsterAnimation {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									IDLE , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									JUMP , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									SHOOT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									DEATH 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 22:57:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-11-21 22:03:48 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								struct  MonsterDropData {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ItemInfo * item ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  dropChance ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  minQty = 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  maxQty = 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									MonsterDropData ( std : : string  itemName , float  dropChance , int  minQty = 1 , int  maxQty = 1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-22 01:12:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									: item ( & ITEM_DATA . at ( itemName ) ) , dropChance ( dropChance ) , minQty ( minQty ) , maxQty ( maxQty ) { } 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-21 22:03:48 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:03:30 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								struct  MonsterData {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									private : 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : string  name ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:03:30 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									int  hp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  atk ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  moveSpd ; //1.0=100%
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  size ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-06 19:00:09 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : vector < std : : string >  animations ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  strategy ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-16 01:10:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  collisionDmg ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-06 19:00:09 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : string  jumpAnimation = " WARRIOR_IDLE_S " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : string  shootAnimation = " WARRIOR_IDLE_S " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : string  deathAnimation = " WARRIOR_IDLE_S " ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-22 01:12:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : vector < MonsterDropData >  dropData ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:03:30 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									public : 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:26:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									MonsterData ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-22 01:12:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									MonsterData ( int  id , std : : string  name , int  hp , int  atk , std : : vector < std : : string > animations , std : : vector < MonsterDropData > drops , float  moveSpd = 1.0f , float  size = 1.0f , int  strategy = 0 , int  collisionDmg = 0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:26:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  GetHealth ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  GetAttack ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  GetMoveSpdMult ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  GetSizeMult ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  GetAIStrategy ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-16 01:10:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  GetCollisionDmg ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  GetID ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : string  GetIdleAnimation ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-06 19:00:09 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : string  GetJumpAnimation ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : string  GetShootAnimation ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : string  GetDeathAnimation ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : vector < std : : string > GetAnimations ( ) { 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 21:19:45 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  animations ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-22 01:12:09 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									const  std : : vector < MonsterDropData > & GetDropData ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-11 17:31:53 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : string  GetDisplayName ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-06 19:00:09 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									static  void  InitializeMonsterData ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									static  std : : map < int , Renderable * > imgs ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:03:30 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-06 20:03:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-03 02:34:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								struct  Monster : IAttributable {  
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									friend  struct  STRATEGY ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 22:32:04 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								private :  
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  id = 0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:26:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									vf2d  pos ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-15 23:44:34 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									vf2d  vel = { 0 , 0 } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  friction = 400 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									vf2d  target = { 0 , 0 } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  targetAcquireTimer = 0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:26:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  hp , maxhp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  atk ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  moveSpd ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  size ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-16 01:41:38 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  attackCooldownTimer = 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  queueShotTimer = 0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 22:32:04 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  z = 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  iframe_timer = 0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-15 23:44:34 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Key  facingDirection ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  strategy ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-09 07:10:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									State : : State  state = State : : NORMAL ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-06 19:00:09 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Animate2D : : Animation < std : : string > animation ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 21:19:45 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Animate2D : : AnimationState  internal_animState ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 21:54:51 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  randomFrameOffset = 0.f ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 22:57:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  deathTimer = 0.f ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-19 03:25:01 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : vector < Buff > buffList ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-06 19:00:09 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : string  GetDeathAnimationName ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-23 20:42:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  hasHitPlayer = false ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-24 01:18:21 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  canMove = true ;  //Set to false when stuck due to collisions.
 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-06 14:59:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  upperLevel = false ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-10 18:40:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									vf2d  pathTarget = { } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : vector < vf2d > path ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  pathIndex = 0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-25 19:48:24 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  lastHitTimer = 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : shared_ptr < DamageNumber > damageNumberPtr ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-07 01:35:23 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  phase = 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  diesNormally = true ;  //If set to false, the monster death is handled in a special way. Set it to true when it's time to die.
 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-07 20:20:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  targetSize = 0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-26 06:35:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  isBoss = false ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-22 15:49:41 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  OnDeath ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-01 20:47:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
									
										
										
										
											2023-08-06 19:00:09 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
									
										
										
										
											2023-07-01 20:47:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Monster ( ) = delete ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-26 06:35:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Monster ( vf2d  pos , MonsterData  data , bool  upperLevel = false , bool  bossMob = false ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:26:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									vf2d & GetPos ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  GetHealth ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  GetAttack ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  GetMoveSpdMult ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  GetSizeMult ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 21:54:51 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Animate2D : : Frame  GetFrame ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-06 19:00:09 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  UpdateAnimation ( std : : string  state ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 22:57:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  Update ( float  fElapsedTime ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-22 03:19:52 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									//Returns true when damage is actually dealt. Provide whether or not the attack is on the upper level or not. Monsters must be on the same level to get hit by it. (there is a death check and level check here.)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//If you need to hurt multiple enemies try Crawler::HurtEnemies()
 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-11 05:27:36 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  Hurt ( int  damage , bool  onUpperLevel , float  z ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-12 00:37:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  IsAlive ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-15 23:44:34 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									vf2d & GetTargetPos ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Key  GetFacingDirection ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  Draw ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-16 04:38:38 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  DrawReflection ( float  drawRatioX , float  multiplierX ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-14 15:44:17 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  Collision ( Player * p ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-15 23:44:34 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  Collision ( Monster & p ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  Collision ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  SetVelocity ( vf2d  vel ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-24 01:18:21 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									//Returns false if the monster could not be moved to the requested location due to collision.
 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-09 07:10:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  SetPos ( vf2d  pos ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-24 01:18:21 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									//Returns false if the monster could not be moved to the requested location due to collision.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  SetX ( float  x ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//Returns false if the monster could not be moved to the requested location due to collision.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  SetY ( float  y ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-16 01:10:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  PerformJumpAnimation ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-16 01:41:38 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  PerformShootAnimation ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  PerformIdleAnimation ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-07 04:49:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  OnUpperLevel ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-07 06:42:49 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  Moved ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-10 18:40:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  StartPathfinding ( float  pathingTime ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  PathAroundBehavior ( float  fElapsedTime ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-19 03:25:01 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  AddBuff ( BuffType  type , float  duration , float  intensity ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : vector < Buff > GetBuffs ( BuffType  buff ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-09 07:10:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									State : : State  GetState ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  SetState ( State : : State  newState ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-06 19:00:09 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									static  void  InitializeStrategies ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 22:32:04 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  HasIframes ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 23:01:23 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  GetZ ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-09 07:10:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  SetZ ( float  z ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-07 01:35:23 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : string  GetStrategy ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-07 20:20:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  SetSize ( float  newSize , bool  immediate = true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-09 07:10:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  SetStrategyDrawFunction ( std : : function < void ( Crawler * ) > func ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-19 02:51:52 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : function < void ( Crawler * ) > strategyDraw = [ ] ( Crawler * pge ) { } ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								private :  
						 
					
						
							
								
									
										
										
										
											2023-08-13 03:04:30 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									struct  STRATEGY { 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 20:53:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										static  int  _GetInt ( Monster & m , std : : string  param , int  strategyNumber , int  index = 0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										static  float  _GetFloat ( Monster & m , std : : string  param , int  strategyNumber , int  index = 0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										static  std : : string  _GetString ( Monster & m , std : : string  param , int  strategyNumber , int  index = 0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										static  void  RUN_STRATEGY ( Monster & m , float  fElapsedTime ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 20:53:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										static  void  RUN_TOWARDS ( Monster & m , float  fElapsedTime , int  strategyNumber ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										static  void  SHOOT_AFAR ( Monster & m , float  fElapsedTime , int  strategyNumber ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										static  void  TURRET ( Monster & m , float  fElapsedTime , int  strategyNumber ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-06 20:03:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										static  void  SLIMEKING ( Monster & m , float  fElapsedTime , int  strategyNumber ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-23 15:10:59 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										static  void  RUN_AWAY ( Monster & m , float  fElapsedTime , int  strategyNumber ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:44:51 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								struct  MonsterSpawner {  
						 
					
						
							
								
									
										
										
										
											2023-06-11 21:19:45 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									private : 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:44:51 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									vf2d  pos ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-22 17:44:51 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									vf2d  range ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-13 02:12:19 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : vector < std : : pair < int , vf2d > > monsters ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-12 00:37:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  triggered = false ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-10 19:22:33 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  upperLevel = false ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-26 05:22:04 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : string  bossNameDisplay = " " ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 21:19:45 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									public : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									MonsterSpawner ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 21:54:51 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									//For the monster list, the second pair item is the position relative to the spawner to spawn the monster.
 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-26 05:22:04 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									MonsterSpawner ( vf2d  pos , vf2d  range , std : : vector < std : : pair < int , vf2d > > MONSTER_LIST , bool  upperLevel = false , std : : string  bossNameDisplay = " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 21:19:45 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  SpawnTriggered ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-22 17:44:51 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									vf2d  GetRange ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 21:19:45 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									vf2d  GetPos ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-07-10 19:22:33 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  DoesUpperLevelSpawning ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 21:54:51 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  SetTriggered ( bool  trigger , bool  spawnMonsters = true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-22 17:44:51 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									friend  std : : ostream & operator < < ( std : : ostream & os , MonsterSpawner & rhs ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-11 20:03:30 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								} ;