Parrot Monster scripts initialized.

master
sigonasr2 2 months ago
parent 20f8abf8b5
commit 970b15ac5d
  1. 6
      Adventures in Lestoria/Monster.cpp
  2. 1
      Adventures in Lestoria/Monster.h
  3. 4
      Adventures in Lestoria/Parrot.cpp
  4. 1
      Adventures in Lestoria/Pirate_Captain.cpp
  5. 7
      Adventures in Lestoria/assets/config/Monsters.txt

@ -1256,11 +1256,7 @@ const float Monster::GetCollisionDamage()const{
//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.
//Arguments are:
// 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){
void Monster::SetStrategyDeathFunction(std::function<bool(GameEvent&event,Monster&monster,const std::string&strategyName)>func){
strategyDeathFunc=func;
}

@ -320,6 +320,7 @@ private:
float stunTimer{};
int accumulatedCurseOfDeathDamage{};
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{
static std::string ERR;

@ -47,5 +47,9 @@ using A=Attribute;
INCLUDE_game
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){
case INIT:{
m.F(A::TARGET_TIMER)=ConfigFloat("Shooting Frequency");
m.F(A::WAIT_TIMER)=ConfigFloat("");
m.mounted_animation=Animate2D::Animation<std::string>{};
for(bool firstAnimation=true;const std::string&animation:Config("Imposed Monster Animations").GetValues()){
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
# 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
SWIM = 4, 0.15, Repeat
SAND ATTACK = 6, 0.2, OneShot
FLYING = 4, 0.15, Repeat
ATTACKING = 2, 0.3, Repeat
DEATH = 4, 0.15, OneShot
BURROW = 6, 0.1, OneShot
EMERGE = 5, 0.1, OneShot
ATTACK = 2, 0.3, Repeat
}
# Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity

Loading…
Cancel
Save