Add knockback amount to bear strategy, allowing for configuration.

pull/35/head
sigonasr2 10 months ago
parent e7760bcf97
commit e3a3328882
  1. 9
      Adventures in Lestoria/Bear.cpp
  2. 2
      Adventures in Lestoria/Version.h
  3. 9
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  4. 3
      Adventures in Lestoria/assets/config/Monsters.txt
  5. BIN
      x64/Release/Adventures in Lestoria.exe

@ -85,16 +85,19 @@ void Monster::STRATEGY::BEAR(Monster&m,float fElapsedTime,std::string strategy){
SoundEffect::PlaySFX("Bear Slam Attack",m.GetPos()+m.V(A::LOCKON_POS));
m.I(A::PHASE)=0;
geom2d::circle<float>attackCircle={m.GetPos()+m.V(A::LOCKON_POS),float(operator""_Pixels(ConfigFloat("Smash Attack Diameter"))/2.f)};
float lockOnDistToPlayer=geom2d::line<float>(m.V(A::LOCKON_POS),game->GetPlayer()->GetPos()).length();
float lockOnDistToPlayer=geom2d::line<float>(game->GetPlayer()->GetPos(),m.V(A::LOCKON_POS)).length();
if(geom2d::overlaps(attackCircle,game->GetPlayer()->Hitbox())){
if(game->GetPlayer()->Hurt(m.GetAttack(),m.OnUpperLevel(),0.f)){
game->GetPlayer()->Knockup(ConfigFloat("Attack Knockup Duration"));
vf2d playerDirVecNorm=geom2d::line<float>(game->GetPlayer()->GetPos(),m.V(A::LOCKON_POS)).vector().norm();
game->GetPlayer()->Knockback(playerDirVecNorm*ConfigFloat("Attack Knockback Amount"));
}
}
for(Monster&otherM:MONSTER_LIST){
if(!otherM.AttackAvoided(m.GetZ())&&&m!=&otherM&&
geom2d::overlaps(attackCircle,otherM.Hitbox())){
if(!otherM.AttackAvoided(m.GetZ())&&&m!=&otherM&&geom2d::overlaps(attackCircle,otherM.Hitbox())){
otherM.Knockup(ConfigFloat("Attack Knockup Duration"));
vf2d monsterDirVecNorm=geom2d::line<float>(m.V(A::LOCKON_POS),otherM.GetPos()).vector().norm();
game->GetPlayer()->Knockback(monsterDirVecNorm*ConfigFloat("Attack Knockback Amount"));
}
}
m.spriteRot=0.f;

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 6381
#define VERSION_BUILD 6388
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -226,6 +226,9 @@ MonsterStrategy
# How long the duration of the knockup is.
Attack Knockup Duration = 0.7s
# Sets how much knockback the attack will have.
Attack Knockback Amount = 0.0
}
# The Ursule, Mother of Bears Boss script
Ursule
@ -372,6 +375,7 @@ MonsterStrategy
# How much time (in seconds) to wait between each pattern spawn.
# 100% speed means it takes 6 seconds for all the wisps to move entirely down.
# "Wisp Pattern Spawn Y" / Speed determines time between spawns.
Wisp Pattern Spawn Wait Time = 1.6s
# This value is either Bag or Random. Bag means every pattern gets selected once before re-cycling. Random is truly random with potential repeats.
@ -454,8 +458,9 @@ MonsterStrategy
Wisp Fadeout Time = 0.3s
# How much time (in seconds) to wait between each pattern spawn.
# 100% speed means it takes 6 seconds for all the wisps to move entirely down.
Wisp Pattern Spawn Wait Time = 1.6s
# 100 speed means it takes 1.44 seconds for 6 rows of wisps to move down
# "Wisp Pattern Spawn Y" / Speed determines time between spawns.
Wisp Pattern Spawn Wait Time = 1.51s
# This value is either Bag or Random. Bag means every pattern gets selected once before re-cycling. Random is truly random with potential repeats.
Wisp Pattern Random Selection = Random

@ -359,6 +359,9 @@ Monsters
# How long the duration of the knockup is.
Attack Knockup Duration = 0.4s
# Sets how much knockback the attack will have.
Attack Knockback Amount = 250
# ^^^^^ End Bear script overrides ^^^^^

Loading…
Cancel
Save