Parrot Monster scripts initialized.
This commit is contained in:
parent
20f8abf8b5
commit
970b15ac5d
@ -1256,11 +1256,7 @@ const float Monster::GetCollisionDamage()const{
|
|||||||
|
|
||||||
//Sets the strategy death function that runs when a monster dies.
|
//Sets the strategy death function that runs when a monster dies.
|
||||||
// The function should return false to indicate the event is over. If the event should keep running, return true.
|
// The function should return false to indicate the event is over. If the event should keep running, return true.
|
||||||
//Arguments are:
|
void Monster::SetStrategyDeathFunction(std::function<bool(GameEvent&event,Monster&monster,const std::string&strategyName)>func){
|
||||||
// GameEvent& - The death event itself.
|
|
||||||
// Monster& - The monster reference
|
|
||||||
// const std::string& - The strategy name.
|
|
||||||
void Monster::SetStrategyDeathFunction(std::function<bool(GameEvent&,Monster&,const std::string&)>func){
|
|
||||||
strategyDeathFunc=func;
|
strategyDeathFunc=func;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,6 +320,7 @@ private:
|
|||||||
float stunTimer{};
|
float stunTimer{};
|
||||||
int accumulatedCurseOfDeathDamage{};
|
int accumulatedCurseOfDeathDamage{};
|
||||||
vf2d addedVel{};
|
vf2d addedVel{};
|
||||||
|
std::weak_ptr<Monster>attachedTarget; //A monster attached to another monster can then use this to alter behaviors based on the state of that other monster.
|
||||||
|
|
||||||
struct STRATEGY{
|
struct STRATEGY{
|
||||||
static std::string ERR;
|
static std::string ERR;
|
||||||
|
@ -47,5 +47,9 @@ using A=Attribute;
|
|||||||
INCLUDE_game
|
INCLUDE_game
|
||||||
|
|
||||||
void Monster::STRATEGY::PARROT(Monster&m,float fElapsedTime,std::string strategy){
|
void Monster::STRATEGY::PARROT(Monster&m,float fElapsedTime,std::string strategy){
|
||||||
|
HAWK(m,fElapsedTime,"Hawk");
|
||||||
|
m.SetStrategyDeathFunction([](GameEvent&event,Monster&monster,const std::string&strategyName){
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
@ -71,6 +71,7 @@ void Monster::STRATEGY::PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std::string
|
|||||||
switch(m.phase){
|
switch(m.phase){
|
||||||
case INIT:{
|
case INIT:{
|
||||||
m.F(A::TARGET_TIMER)=ConfigFloat("Shooting Frequency");
|
m.F(A::TARGET_TIMER)=ConfigFloat("Shooting Frequency");
|
||||||
|
m.F(A::WAIT_TIMER)=ConfigFloat("");
|
||||||
m.mounted_animation=Animate2D::Animation<std::string>{};
|
m.mounted_animation=Animate2D::Animation<std::string>{};
|
||||||
for(bool firstAnimation=true;const std::string&animation:Config("Imposed Monster Animations").GetValues()){
|
for(bool firstAnimation=true;const std::string&animation:Config("Imposed Monster Animations").GetValues()){
|
||||||
m.mounted_animation.value().AddState(animation,ANIMATION_DATA.at(animation));
|
m.mounted_animation.value().AddState(animation,ANIMATION_DATA.at(animation));
|
||||||
|
@ -1699,11 +1699,10 @@ Monsters
|
|||||||
# Animations must be defined in the same order as they are in their sprite sheets
|
# Animations must be defined in the same order as they are in their sprite sheets
|
||||||
# The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator.
|
# The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator.
|
||||||
IDLE = 4, 0.2, Repeat
|
IDLE = 4, 0.2, Repeat
|
||||||
SWIM = 4, 0.15, Repeat
|
FLYING = 4, 0.15, Repeat
|
||||||
SAND ATTACK = 6, 0.2, OneShot
|
ATTACKING = 2, 0.3, Repeat
|
||||||
DEATH = 4, 0.15, OneShot
|
DEATH = 4, 0.15, OneShot
|
||||||
BURROW = 6, 0.1, OneShot
|
ATTACK = 2, 0.3, Repeat
|
||||||
EMERGE = 5, 0.1, OneShot
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity
|
# Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity
|
||||||
|
Loading…
x
Reference in New Issue
Block a user