Make knockups pause monster strategies. Fix Effect drawing code being invisible if their fadein timer was zero. Add explosion sound effect to Trapper's Explosive Trap ability. Add knockup and 100% temporary slowdown to Trapper's Bear Trap ability. Release Build 10324.

removeExposedPackKey
sigonasr2 4 months ago
parent 5c1144a3bf
commit 5ae21944d6
  1. 2
      Adventures in Lestoria/Animation.cpp
  2. 4
      Adventures in Lestoria/BearTrap.cpp
  3. 1
      Adventures in Lestoria/BulletTypes.h
  4. 13
      Adventures in Lestoria/Effect.cpp
  5. 3
      Adventures in Lestoria/Effect.h
  6. 20
      Adventures in Lestoria/ExplosiveTrap.cpp
  7. 6
      Adventures in Lestoria/Monster.cpp
  8. 1
      Adventures in Lestoria/Monster.h
  9. 3
      Adventures in Lestoria/PurpleEnergyBall.cpp
  10. 2
      Adventures in Lestoria/Version.h
  11. 16
      Adventures in Lestoria/Witch.cpp
  12. 29
      Adventures in Lestoria/assets/config/audio/events.txt
  13. 5
      Adventures in Lestoria/assets/config/classes/Trapper.txt
  14. BIN
      Adventures in Lestoria/assets/sounds/explosion.ogg
  15. BIN
      x64/Release/Adventures in Lestoria.exe

@ -410,7 +410,7 @@ void sig::Animation::InitializeAnimations(){
CreateHorizontalAnimationSequence("bear_trap.png",3,{24,24},AnimationData{.frameDuration{0.1f},.style{Animate2D::Style::PingPong}});
CreateHorizontalAnimationSequence("explosive_trap.png",4,{48,48},AnimationData{.frameDuration{0.06f},.style{Animate2D::Style::PingPong}});
CreateHorizontalAnimationSequence("explosionframes.png",21,{24,24},AnimationData{.frameDuration{0.05f},.style{Animate2D::Style::OneShot}});
CreateHorizontalAnimationSequence("explosionframes.png",21,{24,24},AnimationData{.frameDuration{0.02f},.style{Animate2D::Style::OneShot}});
for(auto&dat:GFX){
std::string imgFile=dat.first;

@ -72,5 +72,9 @@ BulletDestroyState BearTrap::MonsterHit(Monster&monster,const uint8_t markStacks
monster.ApplyMark("Trapper.Ability 2.Marked Target Reset Time"_F,numberOfStacksToReplenish);
monster.AddBuff(BuffRestorationType::OVER_TIME,BuffOverTimeType::HP_DAMAGE_OVER_TIME,bleedDuration,bleedDamage,timeBetweenTicks);
}
monster.AddBuff(BuffType::SLOWDOWN,"Trapper.Ability 2.Slowdown Time"_F,"Trapper.Ability 2.Slowdown Amount"_F/100.f);
monster.Knockup("Trapper.Ability 2.Knockup Amount"_F);
return BulletDestroyState::KEEP_ALIVE;
}

@ -316,6 +316,7 @@ private:
float automaticDetonationTime{};
float activationWaitTime{};
float lastBeepTime{};
uint8_t beepCount{1U};
};
struct PurpleEnergyBall:public Bullet{

@ -73,6 +73,7 @@ bool Effect::Update(float fElapsedTime){
}
}
rotation+=rotationSpd*fElapsedTime;
size+=scaleSpd*fElapsedTime;
pos+=spd*fElapsedTime;
animation.UpdateState(internal_animState,fElapsedTime);
return true;
@ -80,14 +81,16 @@ bool Effect::Update(float fElapsedTime){
void Effect::Draw()const{
if(additiveBlending)game->SetDecalMode(DecalMode::ADDITIVE);
if(fadeout==0&&fadein==original_fadeInTime){
game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,col);
}else
if(fadein==original_fadeInTime){
const bool FadeInFinished{original_fadeInTime==0||fadein==original_fadeInTime};
const bool HasFadeout{fadeout>0};
[[unlikely]]if(!FadeInFinished){
game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,{col.r,col.g,col.b,uint8_t(fadein/original_fadeInTime*col.a)});
}else
if(fadeout==0){
[[likely]]if(HasFadeout){
game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,{col.r,col.g,col.b,uint8_t(fadeout/original_fadeOutTime*col.a)});
}else{
game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,col);
}
game->SetDecalMode(DecalMode::NORMAL);
}

@ -54,12 +54,13 @@ struct Effect{
vf2d pos={0,0};
float lifetime=0;
float fadeout=0;
float fadein=0;
float fadein{0.f};
vf2d size={1,1};
Pixel col=WHITE;
vf2d spd={};
float rotation=0;
float rotationSpd=0;
vf2d scaleSpd{};
bool additiveBlending=false;
private:
bool dead=false;

@ -56,19 +56,23 @@ ExplosiveTrap::ExplosiveTrap(vf2d pos,float radius,float explosionRadius,float a
void ExplosiveTrap::Update(float fElapsedTime){
const bool trapActivated{radius==activationRadius};
if(IsDeactivated())return;
if(!trapActivated){
activationWaitTime-=fElapsedTime;
if(activationWaitTime<=0.f){
radius=activationRadius;
animation.ChangeState(internal_animState,"explosive_trap.png");
SoundEffect::PlaySFX("Beep",pos);
beepCount=std::min(4U,beepCount+1U);
SoundEffect::PlaySFX(std::format("Beep {}",beepCount),pos);
lastBeepTime=1.f;
}
}else{
automaticDetonationTime-=fElapsedTime;
lastBeepTime-=fElapsedTime;
if(lastBeepTime<=0.f){
SoundEffect::PlaySFX("Beep",pos);
beepCount=std::min(4U,beepCount+1U);
SoundEffect::PlaySFX(std::format("Beep {}",beepCount),pos);
lastBeepTime=1.f;
}
if(IsActivated()&&automaticDetonationTime<=0.f)Detonate();
@ -89,14 +93,16 @@ void ExplosiveTrap::Detonate(){
const HurtList list{game->HurtNotHit(pos,"Trapper.Ability 3.Explosion Radius"_F/100.f*24,damage,hitList,OnUpperLevel(),GetZ(),HurtType::MONSTER,HurtFlag::PLAYER_ABILITY)};
for(const auto&[targetPtr,wasHit]:list){
if(wasHit){
std::get<Monster*>(targetPtr)->ProximityKnockback(pos,"Trapper.Ability 3.Explosion Knockup Amount"_F);
std::get<Monster*>(targetPtr)->Knockup("Trapper.Ability 3.Explosion Knockup Amount"_F);
std::get<Monster*>(targetPtr)->ApplyMark("Trapper.Ability 3.Explosion Mark Stack Time"_F,"Trapper.Ability 3.Explosion Mark Stack Increase"_I);
std::get<Monster*>(targetPtr)->ProximityKnockback(pos,"Trapper.Ability 3.Explosion Knockback Amount"_F);
std::get<Monster*>(targetPtr)->Knockup("Trapper.Ability 3.Explosion Knockup Amount"_F);
}
}
game->AddEffect(std::make_unique<Effect>(pos,ANIMATION_DATA["explosionframes.png"].GetTotalAnimationDuration()-0.2f,"explosionframes.png",OnUpperLevel(),scale*2.f,0.2f,vf2d{},WHITE,util::random(2*PI),0.f));
std::unique_ptr<Effect>explodeEffect{std::make_unique<Effect>(pos,ANIMATION_DATA["explosionframes.png"].GetTotalAnimationDuration()-0.2f,"explosionframes.png",OnUpperLevel(),scale*2.f,0.2f,vf2d{0,-6.f},WHITE,util::random(2*PI),0.f)};
explodeEffect->scaleSpd={0.125f,0.125f};
game->AddEffect(std::move(explodeEffect));
SoundEffect::PlaySFX("Explosion",pos);
Deactivate();
}
@ -105,7 +111,7 @@ BulletDestroyState ExplosiveTrap::MonsterHit(Monster&monster,const uint8_t markS
monster.Hurt(0,monster.OnUpperLevel(),monster.GetZ(),HurtFlag::PLAYER_ABILITY);//Triggers mark multiple times after the first mark.
}
monster.ProximityKnockback(pos,"Trapper.Ability 3.Explosion Knockup Amount"_F);
monster.ProximityKnockback(pos,"Trapper.Ability 3.Explosion Knockback Amount"_F);
monster.Knockup("Trapper.Ability 3.Explosion Knockup Amount"_F);
Detonate();

@ -364,7 +364,7 @@ bool Monster::Update(float fElapsedTime){
if(GetState()==State::NORMAL){
UpdateFacingDirection(game->GetPlayer()->GetPos());
}
if(!game->TestingModeEnabled())Monster::STRATEGY::RUN_STRATEGY(*this,fElapsedTime);
if(!game->TestingModeEnabled()&&CanMove())Monster::STRATEGY::RUN_STRATEGY(*this,fElapsedTime);
}
if(!IsAlive()){
deathTimer+=fElapsedTime;
@ -1299,3 +1299,7 @@ const bool Monster::InUndamageableState(const bool onUpperLevel,const float z)co
void Monster::AddBuff(BuffRestorationType type,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks){
buffList.push_back(Buff{this,type,overTimeType,duration,intensity,timeBetweenTicks});
}
const bool Monster::CanMove()const{
return knockUpTimer==0.f&&IsAlive();
}

@ -206,6 +206,7 @@ public:
//Gets the nearest target that can be immediately targeted
static std::optional<Monster*>GetNearestMonster(const vf2d point,const float maxDistance,const bool onUpperLevel,const float z);
const bool InUndamageableState(const bool onUpperLevel,const float z)const;
const bool CanMove()const;
private:
//NOTE: Marking a monster for deletion does not trigger any death events. It just simply removes the monster from the field!!
// The way this works is that monsters marked for deletion will cause the monster update loop to detect there's at least one or more monsters that must be deleted and will call erase_if on the list at the end of the iteration loop.

@ -50,6 +50,7 @@ void PurpleEnergyBall::Update(float fElapsedTime){
void PurpleEnergyBall::Draw(const Pixel blendCol)const{
const vf2d lightOrbScale{initialScale.lerp(initialScale/2.f,sin(12*PI*game->GetRunTime())/2.f+0.5f)};
game->SetDecalMode(DecalMode::ADDITIVE);
game->DrawPartialDecal(pos,initialScale+0.2f,animation.GetFrame(internal_animState).GetSourceImage()->Decal(),animation.GetFrame(internal_animState).GetSourceRect().pos,animation.GetFrame(internal_animState).GetSourceRect().size);
game->SetDecalMode(DecalMode::NORMAL);
Bullet::Draw(blendCol);
}

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 3
#define VERSION_BUILD 10308
#define VERSION_BUILD 10324
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -48,14 +48,14 @@ INCLUDE_game
void Witch::Initialize(){
READFROMCONFIG(Witch,WITCH);
Witch::idle_n="WARRIOR_IDLE_N";
Witch::idle_e="WARRIOR_IDLE_E";
Witch::idle_s="WARRIOR_IDLE_S";
Witch::idle_w="WARRIOR_IDLE_W";
Witch::walk_n="WARRIOR_WALK_N";
Witch::walk_e="WARRIOR_WALK_E";
Witch::walk_s="WARRIOR_WALK_S";
Witch::walk_w="WARRIOR_WALK_W";
Witch::idle_n="WITCH_IDLE_N";
Witch::idle_e="WITCH_IDLE_E";
Witch::idle_s="WITCH_IDLE_S";
Witch::idle_w="WITCH_IDLE_W";
Witch::walk_n="WITCH_WALK_N";
Witch::walk_e="WITCH_WALK_E";
Witch::walk_s="WITCH_WALK_S";
Witch::walk_w="WITCH_WALK_W";
}
SETUP_CLASS(Witch)

@ -19,11 +19,29 @@ Events
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
File[0] = bear_slam.ogg, 70%
}
Beep
Beep 1
{
CombatSound = True
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
File[0] = beep.ogg, 100%
File[0] = beep.ogg, 100%, 70%, 70%
}
Beep 2
{
CombatSound = True
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
File[0] = beep.ogg, 100%, 90%, 90%
}
Beep 3
{
CombatSound = True
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
File[0] = beep.ogg, 100%, 110%, 110%
}
Beep 4
{
CombatSound = True
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
File[0] = beep.ogg, 100%, 130%, 130%
}
Bomb Explode
{
@ -101,6 +119,11 @@ Events
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
File[0] = equip_ring.ogg, 100%
}
Explosion
{
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
File[0] = explosion.ogg, 80%
}
Footstep
{
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
@ -166,7 +189,7 @@ Events
{
CombatSound = True
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
File[0] = lockon.ogg, 100%
File[0] = lockon.ogg, 100%, 140%, 140%
}
Menu Navigate
{

@ -88,6 +88,9 @@ Trapper
# % of Attack, Duration, Time per tick
Marked Target Bleed = 10%, 10s, 1s
Trap Radius = 11px
Knockup Amount = 0.3s
Slowdown Amount = 100%
Slowdown Time = 0.6s
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
@ -120,7 +123,7 @@ Trapper
Trap Radius = 17px
Explosion Knockback Amount = 250
Explosion Knockback Amount = 200
Explosion Knockup Amount = 0.6s
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.

Loading…
Cancel
Save