Corrected and migrated the Ground Slam ability to be handled via the Entity system. Updated damage numbers system to keep drawing during death transition screen. Release Build 13664.
This commit is contained in:
parent
a9b63001eb
commit
9d097e3cdd
@ -24,7 +24,8 @@ using EffectT=std::variant<
|
||||
BlackHole,
|
||||
ExpandingRing,
|
||||
FallEffect,
|
||||
FallWShadowEffect
|
||||
FallWShadowEffect,
|
||||
GroundSlamEffect
|
||||
>;
|
||||
|
||||
struct EffectOverloads{
|
||||
|
||||
@ -361,7 +361,7 @@ public:
|
||||
float knockbackWeightFactor;
|
||||
int damage;
|
||||
FriendlyType friendly;
|
||||
int visualRadius;
|
||||
float visualRadius;
|
||||
bool hasSlamShockEnchant;
|
||||
std::string soundEffectName;
|
||||
};
|
||||
|
||||
@ -45,10 +45,9 @@ All rights reserved.
|
||||
INCLUDE_game
|
||||
|
||||
GroundSlamEffect::GroundSlamEffect(vf2d pos,const float z,const float lifetime,GroundSlamSettings settings,bool upperLevel,float fadeout,Pixel col,bool additiveBlending)
|
||||
:settings(settings),Effect(pos,lifetime,"ground-slam-attack-front.png",upperLevel,settings.visualRadius/64.f/2,fadeout,{},col,0.f,0.f,additiveBlending){
|
||||
game->AddEffect(Effect{pos,lifetime,"ground-slam-attack-back.png",upperLevel,settings.visualRadius/64.f/2,fadeout,{},col,0.f,0.f,additiveBlending},true);
|
||||
}
|
||||
bool GroundSlamEffect::Update(float fElapsedTime){
|
||||
:settings(settings),Effect(pos,lifetime,"ground-slam-attack-front.png",upperLevel,settings.visualRadius,fadeout,{},col,0.f,0.f,additiveBlending){
|
||||
game->AddEffect(Effect{pos,lifetime,"ground-slam-attack-back.png",upperLevel,settings.visualRadius,fadeout,{},col,0.f,0.f,additiveBlending},true);
|
||||
|
||||
#pragma region Knockback effect
|
||||
for(auto&[targetPtr,wasHurt]:game->Hurt(pos,settings.range,settings.damage,OnUpperLevel(),0,settings.friendly?HurtType::MONSTER:HurtType::PLAYER,settings.friendly?HurtFlag::PLAYER_ABILITY:HurtFlag::NONE)){
|
||||
Entity entity{targetPtr};
|
||||
@ -64,9 +63,11 @@ bool GroundSlamEffect::Update(float fElapsedTime){
|
||||
}
|
||||
knockbackAmt=std::max(1.f,knockbackAmt-settings.knockbackWeightFactor*(entity.GetSizeMult()-1.f));
|
||||
entity.Knockback(vf2d{knockbackAmt,knockbackDir}.cart());
|
||||
if(entity.IsFriendly())entity.SetIframeTime(1.f);
|
||||
}
|
||||
#pragma endregion
|
||||
SoundEffect::PlaySFX("Warrior Ground Slam",pos);
|
||||
|
||||
SoundEffect::PlaySFX(settings.soundEffectName,pos);
|
||||
}
|
||||
bool GroundSlamEffect::Update(float fElapsedTime){
|
||||
return Effect::Update(fElapsedTime);
|
||||
}
|
||||
@ -471,11 +471,25 @@ void Player::Update(float fElapsedTime){
|
||||
float groundSlamVisualRange{"Warrior.Ability 2.Range"_F/300*1.33f};
|
||||
float groundSlamRange{"Warrior.Ability 2.Range"_F/100*12};
|
||||
int groundSlamDamage{int(GetAttack()*"Warrior.Ability 2.DamageMult"_F)};
|
||||
game->AddEffect<Effect,Effect>({GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-front.png",upperLevel,groundSlamVisualRange,"Warrior.Ability 2.EffectFadetime"_F},{GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-back.png",upperLevel,groundSlamVisualRange,"Warrior.Ability 2.EffectFadetime"_F});
|
||||
}
|
||||
if(lastAnimationFlip>0){
|
||||
lastAnimationFlip=std::max(0.f,lastAnimationFlip-fElapsedTime);
|
||||
if(HasEnchant("Improved Ground Slam")){
|
||||
groundSlamVisualRange+=groundSlamVisualRange*"Improved Ground Slam"_ENC["GROUND SLAM RADIUS INCREASE"]/100.f;
|
||||
groundSlamRange+=groundSlamRange*"Improved Ground Slam"_ENC["GROUND SLAM RADIUS INCREASE"]/100.f;
|
||||
groundSlamDamage+=GetDefense()*"Improved Ground Slam"_ENC["DEFENSE DAMAGE"]/100.f;
|
||||
}
|
||||
GroundSlamEffect::GroundSlamSettings groundSlamSettings{
|
||||
.range=groundSlamRange,
|
||||
.knockbackAmt="Warrior.Ability 2.KnockbackAmt"_F,
|
||||
.knockbackReduction="Warrior.Ability 2.KnockbackReduction"_F,
|
||||
.knockbackWeightFactor="Warrior.Ability 2.KnockbackWeightFactor"_F,
|
||||
.damage=groundSlamDamage,
|
||||
.friendly=FRIENDLY,
|
||||
.visualRadius=groundSlamVisualRange,
|
||||
.hasSlamShockEnchant=HasEnchant("Slam Shock"),
|
||||
.soundEffectName="Warrior Ground Slam"
|
||||
};
|
||||
game->AddEffect(GroundSlamEffect{GetPos(),GetZ(),"Warrior.Ability 2.EffectLifetime"_F,groundSlamSettings,OnUpperLevel(),"Warrior.Ability 2.EffectFadetime"_F});
|
||||
}
|
||||
if(lastAnimationFlip>0)lastAnimationFlip=std::max(0.f,lastAnimationFlip-fElapsedTime);
|
||||
UpdateAnimationStates();
|
||||
}break;
|
||||
case State::BLOCK:{
|
||||
@ -945,8 +959,6 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z,const TrueDamageFlag dama
|
||||
hp=std::max(0,hp-int(mod_dmg));
|
||||
}
|
||||
}
|
||||
|
||||
if(!IsAlive()&&GameState::STATE!=GameState::states[States::DEATH])GameState::ChangeState(States::DEATH);
|
||||
|
||||
hurtRumbleTime="Player.Hurt Rumble Time"_F;
|
||||
Input::StartVibration();
|
||||
@ -986,6 +998,8 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z,const TrueDamageFlag dama
|
||||
Menu::OpenMenu(MenuType::PAUSE);
|
||||
}
|
||||
|
||||
if(!IsAlive()&&GameState::STATE!=GameState::states[States::DEATH])GameState::ChangeState(States::DEATH);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -35,18 +35,20 @@ Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
|
||||
All rights reserved.
|
||||
*/
|
||||
#pragma endregion
|
||||
#include "State_Death.h"
|
||||
#include "AdventuresInLestoria.h"
|
||||
#include "DEFINES.h"
|
||||
#include "Menu.h"
|
||||
#include "ItemDrop.h"
|
||||
#include "VisualNovel.h"
|
||||
#include "State_OverworldMap.h"
|
||||
#include "GameEvent.h"
|
||||
#include "MenuComponent.h"
|
||||
#include "Unlock.h"
|
||||
#include"State_Death.h"
|
||||
#include"AdventuresInLestoria.h"
|
||||
#include"DEFINES.h"
|
||||
#include"Menu.h"
|
||||
#include"ItemDrop.h"
|
||||
#include"VisualNovel.h"
|
||||
#include"State_OverworldMap.h"
|
||||
#include"GameEvent.h"
|
||||
#include"MenuComponent.h"
|
||||
#include"Unlock.h"
|
||||
#include"DamageNumber.h"
|
||||
|
||||
INCLUDE_MONSTER_LIST
|
||||
INCLUDE_DAMAGENUMBER_LIST
|
||||
INCLUDE_game
|
||||
|
||||
void State_Death::OnStateChange(GameState*prevState){
|
||||
@ -108,4 +110,9 @@ void State_Death::OnUserUpdate(AiL*game){
|
||||
}
|
||||
void State_Death::Draw(AiL*game){
|
||||
game->RenderWorld(game->GetElapsedTime());
|
||||
|
||||
for(std::vector<std::shared_ptr<DamageNumber>>::iterator it=DAMAGENUMBER_LIST.begin();it!=DAMAGENUMBER_LIST.end();++it){
|
||||
DamageNumber*dn=(*it).get();
|
||||
dn->Draw();
|
||||
}
|
||||
}
|
||||
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 13643
|
||||
#define VERSION_BUILD 13664
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
||||
@ -31,7 +31,7 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
Portions of this software are copyright © 2024 The FreeType
|
||||
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
|
||||
Project (www.freetype.org). Please see LICENSE)T.txt for more information.
|
||||
All rights reserved.
|
||||
*/
|
||||
#pragma endregion
|
||||
@ -63,12 +63,32 @@ DEFINE_STRATEGY(WARRIORTHIEF)
|
||||
}
|
||||
}break;
|
||||
case SPIN:{
|
||||
m.SetCollisionRadius(0.f);
|
||||
m.target=game->GetPlayer()->GetPos();
|
||||
m.RunStrategy(MonsterStrategy::RUN_TOWARDS);
|
||||
m.F(A::SPIN_ANGLE)+=ConfigFloat("Warrior.Ability 2.SpinSpd")*game->GetElapsedTime();
|
||||
if((m.F(A::SPIN_ATTACK_TIMER)-=game->GetElapsedTime())>0){
|
||||
m.SetZ(float("Warrior.Ability 2.SpinMaxHeight"_I)*sin(PI*(ConfigFloat("Warrior.Ability 2.SpinTime")-m.F(A::SPIN_ATTACK_TIMER))/ConfigFloat("Warrior.Ability 2.SpinTime")));
|
||||
}else SETPHASE(RUN);
|
||||
}else{
|
||||
m.SetZ(0.f);
|
||||
float groundSlamVisualRange{ConfigFloat("Warrior.Ability 2.Range")/300*1.33f};
|
||||
float groundSlamRange{ConfigFloat("Warrior.Ability 2.Range")/100*12};
|
||||
int groundSlamDamage{int(m.GetAttack()*ConfigFloat("Warrior.Ability 2.DamageMult"))};
|
||||
GroundSlamEffect::GroundSlamSettings groundSlamSettings{
|
||||
.range=groundSlamRange,
|
||||
.knockbackAmt=ConfigFloat("Warrior.Ability 2.KnockbackAmt"),
|
||||
.knockbackReduction=ConfigFloat("Warrior.Ability 2.KnockbackReduction"),
|
||||
.knockbackWeightFactor=ConfigFloat("Warrior.Ability 2.KnockbackWeightFactor"),
|
||||
.damage=groundSlamDamage,
|
||||
.friendly=NON_FRIENDLY,
|
||||
.visualRadius=groundSlamVisualRange,
|
||||
.hasSlamShockEnchant=false,
|
||||
.soundEffectName="Warrior Ground Slam"
|
||||
};
|
||||
game->AddEffect(GroundSlamEffect{m.GetPos(),m.GetZ(),ConfigFloat("Warrior.Ability 2.EffectLifetime"),groundSlamSettings,m.OnUpperLevel(),ConfigFloat("Warrior.Ability 2.EffectFadetime")});
|
||||
m.SetCollisionRadius(m.GetOriginalCollisionRadius());
|
||||
SETPHASE(RUN);
|
||||
}
|
||||
}break;
|
||||
}
|
||||
END_STRATEGY
|
||||
BIN
x64/Release/Adventures in Lestoria.exe
Normal file
BIN
x64/Release/Adventures in Lestoria.exe
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user