@ -56,6 +56,7 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str
SEARCH ,
SEARCH ,
PREPARE_ATTACK ,
PREPARE_ATTACK ,
ATTACK_ANIMATION ,
ATTACK_ANIMATION ,
SUBMERGE ,
} ;
} ;
const auto GetAttackArc = [ attackRadius = ConfigFloat ( " Attack Radius " ) , attackArc = ConfigFloat ( " Attack Arc " ) ] ( const Monster & m ) {
const auto GetAttackArc = [ attackRadius = ConfigFloat ( " Attack Radius " ) , attackArc = ConfigFloat ( " Attack Arc " ) ] ( const Monster & m ) {
@ -79,7 +80,7 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str
const std : : string GIANT_OCTOPUS_NAME { " Giant Octopus " } ;
const std : : string GIANT_OCTOPUS_NAME { " Giant Octopus " } ;
const std : : string OCTOPUS_ARM_NAME { " Octopus Arm " } ;
const std : : string OCTOPUS_ARM_NAME { " Octopus Arm " } ;
if ( ! MONSTER_DATA . count ( GIANT_OCTOPUS_NAME ) ) ERR ( " WARNING! Octopus "
if ( ! MONSTER_DATA . count ( GIANT_OCTOPUS_NAME ) ) ERR ( std : : format ( " WARNING! {} does not exist on the map! THIS SHOULD NOT BE HAPPENING! " , GIANT_OCTOPUS_NAME ) ) ;
auto boss { std : : find_if ( MONSTER_LIST . begin ( ) , MONSTER_LIST . end ( ) , [ & GIANT_OCTOPUS_NAME ] ( const std : : shared_ptr < Monster > & m ) {
auto boss { std : : find_if ( MONSTER_LIST . begin ( ) , MONSTER_LIST . end ( ) , [ & GIANT_OCTOPUS_NAME ] ( const std : : shared_ptr < Monster > & m ) {
return m - > GetName ( ) = = GIANT_OCTOPUS_NAME ;
return m - > GetName ( ) = = GIANT_OCTOPUS_NAME ;
@ -88,8 +89,12 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str
Monster & bossMonster { * * boss } ;
Monster & bossMonster { * * boss } ;
bossMonster . Hurt ( bossDamageOnDeath , m . OnUpperLevel ( ) , m . GetZ ( ) ) ;
bossMonster . Hurt ( bossDamageOnDeath , m . OnUpperLevel ( ) , m . GetZ ( ) ) ;
}
}
std : : for_each ( MONSTER_LIST . begin ( ) , MONSTER_LIST . end ( ) , [ & OCTOPUS_ARM_NAME ] ( const std : : shared_ptr < Monster > & m ) {
std : : for_each ( MONSTER_LIST . begin ( ) , MONSTER_LIST . end ( ) , [ & OCTOPUS_ARM_NAME , & strategyName ] ( const std : : shared_ptr < Monster > & m ) {
if ( m - > GetName ( ) = = OCTOPUS_ARM_NAME )
if ( m - > GetName ( ) = = OCTOPUS_ARM_NAME ) {
m - > PerformAnimation ( " SUBMERGE " ) ;
m - > SetPhase ( strategyName , SUBMERGE ) ;
m - > GetFloat ( A : : RECOVERY_TIME ) = m - > GetCurrentAnimation ( ) . GetTotalAnimationDuration ( ) ;
}
} ) ;
} ) ;
return false ;
return false ;
} ) ;
} ) ;
@ -149,5 +154,13 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str
SETPHASE ( SEARCH ) ;
SETPHASE ( SEARCH ) ;
}
}
} break ;
} break ;
case SUBMERGE : {
m . F ( A : : RECOVERY_TIME ) - = fElapsedTime ;
if ( m . F ( A : : RECOVERY_TIME ) < = 0.f ) {
m . PerformAnimation ( " RISE " ) ;
m . F ( A : : CASTING_TIMER ) = m . GetCurrentAnimation ( ) . GetTotalAnimationDuration ( ) ;
SETPHASE ( RISE_ANIMATION ) ;
}
} break ;
}
}
}
}