Add knockback amount to bear strategy, allowing for configuration.
This commit is contained in:
parent
e7760bcf97
commit
e3a3328882
@ -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));
|
SoundEffect::PlaySFX("Bear Slam Attack",m.GetPos()+m.V(A::LOCKON_POS));
|
||||||
m.I(A::PHASE)=0;
|
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)};
|
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(geom2d::overlaps(attackCircle,game->GetPlayer()->Hitbox())){
|
||||||
if(game->GetPlayer()->Hurt(m.GetAttack(),m.OnUpperLevel(),0.f)){
|
if(game->GetPlayer()->Hurt(m.GetAttack(),m.OnUpperLevel(),0.f)){
|
||||||
game->GetPlayer()->Knockup(ConfigFloat("Attack Knockup Duration"));
|
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){
|
for(Monster&otherM:MONSTER_LIST){
|
||||||
if(!otherM.AttackAvoided(m.GetZ())&&&m!=&otherM&&
|
if(!otherM.AttackAvoided(m.GetZ())&&&m!=&otherM&&geom2d::overlaps(attackCircle,otherM.Hitbox())){
|
||||||
geom2d::overlaps(attackCircle,otherM.Hitbox())){
|
|
||||||
otherM.Knockup(ConfigFloat("Attack Knockup Duration"));
|
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;
|
m.spriteRot=0.f;
|
||||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
|||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 3
|
#define VERSION_MINOR 3
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 6381
|
#define VERSION_BUILD 6388
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -226,6 +226,9 @@ MonsterStrategy
|
|||||||
|
|
||||||
# How long the duration of the knockup is.
|
# How long the duration of the knockup is.
|
||||||
Attack Knockup Duration = 0.7s
|
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
|
# The Ursule, Mother of Bears Boss script
|
||||||
Ursule
|
Ursule
|
||||||
@ -372,6 +375,7 @@ MonsterStrategy
|
|||||||
|
|
||||||
# How much time (in seconds) to wait between each pattern spawn.
|
# 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.
|
# 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
|
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.
|
# 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
|
Wisp Fadeout Time = 0.3s
|
||||||
|
|
||||||
# How much time (in seconds) to wait between each pattern spawn.
|
# 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.
|
# 100 speed means it takes 1.44 seconds for 6 rows of wisps to move down
|
||||||
Wisp Pattern Spawn Wait Time = 1.6s
|
# "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.
|
# 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
|
Wisp Pattern Random Selection = Random
|
||||||
|
@ -359,6 +359,9 @@ Monsters
|
|||||||
# How long the duration of the knockup is.
|
# How long the duration of the knockup is.
|
||||||
Attack Knockup Duration = 0.4s
|
Attack Knockup Duration = 0.4s
|
||||||
|
|
||||||
|
# Sets how much knockback the attack will have.
|
||||||
|
Attack Knockback Amount = 250
|
||||||
|
|
||||||
# ^^^^^ End Bear script overrides ^^^^^
|
# ^^^^^ End Bear script overrides ^^^^^
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user