@ -67,8 +67,12 @@ int Monster::STRATEGY::_GetInt(Monster&m,std::string param,std::string strategy,
} else
} else
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
return DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetInt ( index ) ;
return DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetInt ( index ) ;
} else {
} else
if ( DATA [ " MonsterStrategy " ] [ strategy ] . HasProperty ( param ) ) {
return DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetInt ( index ) ;
return DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetInt ( index ) ;
} else {
ERR ( std : : format ( " Monster {} trying to read non-existent Integer Property {}[{}] for Strategy {}. THIS SHOULD NOT BE HAPPENING! " , m . GetName ( ) , param , index , strategy ) ) ;
return { } ;
}
}
}
}
float Monster : : STRATEGY : : _GetFloat ( Monster & m , std : : string param , std : : string strategy , int index ) {
float Monster : : STRATEGY : : _GetFloat ( Monster & m , std : : string param , std : : string strategy , int index ) {
@ -77,8 +81,12 @@ float Monster::STRATEGY::_GetFloat(Monster&m,std::string param,std::string strat
} else
} else
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
return float ( DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetReal ( index ) ) ;
return float ( DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetReal ( index ) ) ;
} else {
} else
if ( DATA [ " MonsterStrategy " ] [ strategy ] . HasProperty ( param ) ) {
return float ( DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetReal ( index ) ) ;
return float ( DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetReal ( index ) ) ;
} else {
ERR ( std : : format ( " Monster {} trying to read non-existent Float Property {}[{}] for Strategy {}. THIS SHOULD NOT BE HAPPENING! " , m . GetName ( ) , param , index , strategy ) )
return { } ;
}
}
}
}
const std : : string & Monster : : STRATEGY : : _GetString ( Monster & m , std : : string param , std : : string strategy , int index ) {
const std : : string & Monster : : STRATEGY : : _GetString ( Monster & m , std : : string param , std : : string strategy , int index ) {
@ -87,8 +95,12 @@ const std::string&Monster::STRATEGY::_GetString(Monster&m,std::string param,std:
} else
} else
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
return DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetString ( index ) ;
return DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetString ( index ) ;
} else {
} else
if ( DATA [ " MonsterStrategy " ] [ strategy ] . HasProperty ( param ) ) {
return DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetString ( index ) ;
return DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetString ( index ) ;
} else {
ERR ( std : : format ( " Monster {} trying to read non-existent String Property {}[{}] for Strategy {}. THIS SHOULD NOT BE HAPPENING! " , m . GetName ( ) , param , index , strategy ) )
return { } ;
}
}
}
}
vf2d Monster : : STRATEGY : : _GetVec ( Monster & m , std : : string param , std : : string strategy , int index ) {
vf2d Monster : : STRATEGY : : _GetVec ( Monster & m , std : : string param , std : : string strategy , int index ) {
@ -97,8 +109,12 @@ vf2d Monster::STRATEGY::_GetVec(Monster&m,std::string param,std::string strategy
} else
} else
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
return { DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetReal ( index ) , DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetReal ( index + 1 ) } ;
return { DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetReal ( index ) , DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetReal ( index + 1 ) } ;
} else {
} else
if ( DATA [ " MonsterStrategy " ] [ strategy ] . HasProperty ( param ) ) {
return { DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetReal ( index ) , DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetReal ( index + 1 ) } ;
return { DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetReal ( index ) , DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetReal ( index + 1 ) } ;
} else {
ERR ( std : : format ( " Monster {} trying to read non-existent Vf2d Property {}[{}] for Strategy {}. THIS SHOULD NOT BE HAPPENING! " , m . GetName ( ) , param , index , strategy ) )
return { } ;
}
}
}
}
const datafile & Monster : : STRATEGY : : _Get ( Monster & m , std : : string param , std : : string strategy ) {
const datafile & Monster : : STRATEGY : : _Get ( Monster & m , std : : string param , std : : string strategy ) {
@ -107,8 +123,12 @@ const datafile&Monster::STRATEGY::_Get(Monster&m,std::string param,std::string s
} else
} else
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
return DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) ;
return DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) ;
} else {
} else
if ( DATA [ " MonsterStrategy " ] [ strategy ] . HasProperty ( param ) ) {
return DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) ;
return DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) ;
} else {
ERR ( std : : format ( " Monster {} trying to read non-existent Data Property {} for Strategy {} " , m . GetName ( ) , param , strategy ) ) ;
return { } ;
}
}
}
}
Pixel Monster : : STRATEGY : : _GetPixel ( Monster & m , std : : string param , std : : string strategy , int index ) {
Pixel Monster : : STRATEGY : : _GetPixel ( Monster & m , std : : string param , std : : string strategy , int index ) {
@ -117,8 +137,12 @@ Pixel Monster::STRATEGY::_GetPixel(Monster&m,std::string param,std::string strat
} else
} else
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
return DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetPixel ( index ) ;
return DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetPixel ( index ) ;
} else {
} else
if ( DATA [ " MonsterStrategy " ] [ strategy ] . HasProperty ( param ) ) {
return DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetPixel ( index ) ;
return DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetPixel ( index ) ;
} else {
ERR ( std : : format ( " Monster {} trying to read non-existent Pixel Property {}[{}] for Strategy {}. THIS SHOULD NOT BE HAPPENING! " , m . GetName ( ) , param , index , strategy ) )
return { } ;
}
}
}
}
@ -128,8 +152,12 @@ double Monster::STRATEGY::_GetPixels(Monster&m,std::string param,std::string str
} else
} else
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
if ( ! m . IsNPC ( ) & & DATA [ " Monsters " ] [ m . name ] . HasProperty ( param ) ) {
return DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetReal ( index ) / 100.f * 24 ;
return DATA [ " Monsters " ] [ m . name ] . GetProperty ( param ) . GetReal ( index ) / 100.f * 24 ;
} else {
} else
if ( DATA [ " MonsterStrategy " ] [ strategy ] . HasProperty ( param ) ) {
return DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetReal ( index ) / 100.f * 24 ;
return DATA [ " MonsterStrategy " ] [ strategy ] . GetProperty ( param ) . GetReal ( index ) / 100.f * 24 ;
} else {
ERR ( std : : format ( " Monster {} trying to read non-existent Real Property {}[{}] (for pixel conversion) for Strategy {}. THIS SHOULD NOT BE HAPPENING! " , m . GetName ( ) , param , index , strategy ) )
return { } ;
}
}
}
}