Add slight knockback effect on goblin dagger stabs. Release Build 9035.

mac-build
sigonasr2 7 months ago
parent 270d70a387
commit b694535812
  1. 3
      Adventures in Lestoria/BulletTypes.h
  2. 7
      Adventures in Lestoria/DaggerStab.cpp
  3. 2
      Adventures in Lestoria/Goblin_Dagger.cpp
  4. 2
      Adventures in Lestoria/Version.h
  5. 3
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  6. BIN
      x64/Release/Adventures in Lestoria.exe

@ -120,9 +120,10 @@ struct DaggerStab:public Bullet{
Direction facingDir;
float frameDuration;
float daggerStabDistance;
float knockbackAmt;
DirectionOffsets daggerPositionOffsets;
HorizontalFlip horizontalFlip;
DaggerStab(Monster&sourceMonster,float radius,int damage,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerStabDistance,const HorizontalFlip horizontalFlip,const DirectionOffsets offsets,bool friendly=false,Pixel col=WHITE);
DaggerStab(Monster&sourceMonster,float radius,int damage,const float knockbackAmt,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerStabDistance,const HorizontalFlip horizontalFlip,const DirectionOffsets offsets,bool friendly=false,Pixel col=WHITE);
void Update(float fElapsedTime)override;
bool PlayerHit(Player*player)override;
bool MonsterHit(Monster&monster)override;

@ -40,13 +40,14 @@ All rights reserved.
#include "SoundEffect.h"
#include "AdventuresInLestoria.h"
#include "DEFINES.h"
#include "util.h"
INCLUDE_game
INCLUDE_ANIMATION_DATA
DaggerStab::DaggerStab(Monster&sourceMonster,float radius,int damage,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerStabDistance,const HorizontalFlip horizontalFlip,const DirectionOffsets offsets,bool friendly,Pixel col)
DaggerStab::DaggerStab(Monster&sourceMonster,float radius,int damage,const float knockbackAmt,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerStabDistance,const HorizontalFlip horizontalFlip,const DirectionOffsets offsets,bool friendly,Pixel col)
:Bullet(sourceMonster.GetPos(),{},radius,damage,"dagger_stab.png",upperLevel,false,daggerFrameDuration*ANIMATION_DATA["dagger_stab.png"].GetFrameCountBasedOnAnimationStyle(),true,friendly,col),
sourceMonster(sourceMonster),frameDuration(daggerFrameDuration),daggerStabDistance(daggerStabDistance),facingDir(facingDir),daggerPositionOffsets(offsets),horizontalFlip(horizontalFlip){}
sourceMonster(sourceMonster),frameDuration(daggerFrameDuration),daggerStabDistance(daggerStabDistance),facingDir(facingDir),daggerPositionOffsets(offsets),horizontalFlip(horizontalFlip),knockbackAmt(knockbackAmt){}
void DaggerStab::Update(float fElapsedTime){
ANIMATION_DATA["dagger_stab.png"].ChangeFrameDuration(frameDuration);
#pragma region Dagger Position Offset
@ -95,10 +96,12 @@ void DaggerStab::Update(float fElapsedTime){
bool DaggerStab::PlayerHit(Player*player){
deactivated=true;
game->AddEffect(std::make_unique<Effect>(pos,0,"lightning_splash_effect.png",upperLevel,player->GetSizeMult()*0.25f,0.25,vf2d{}));
player->Knockback(util::pointTo(sourceMonster.GetPos(),player->GetPos())*knockbackAmt);
return false;
}
bool DaggerStab::MonsterHit(Monster&monster){
deactivated=true;
game->AddEffect(std::make_unique<Effect>(pos,0,"lightning_splash_effect.png",upperLevel,monster.GetSizeMult()*0.25f,0.25,vf2d{}));
monster.Knockback(util::pointTo(sourceMonster.GetPos(),monster.GetPos())*knockbackAmt);
return false;
}

@ -107,7 +107,7 @@ void Monster::STRATEGY::GOBLIN_DAGGER(Monster&m,float fElapsedTime,std::string s
case STAB:{
vf2d stabTarget=game->GetPlayer()->GetPos();
SetFacingAnimation(STAB_ANIMATION,stabTarget);
CreateBullet(DaggerStab)(m,ConfigFloat("Dagger Hit Radius"),m.GetAttack(),m.OnUpperLevel(),m.GetFacingDirectionToTarget(stabTarget),ConfigFloat("Dagger Frame Duration"),ConfigFloat("Dagger Stab Distance"),IsSpriteFlipped()?DaggerStab::HorizontalFlip::FLIPPED:DaggerStab::HorizontalFlip::NONE,
CreateBullet(DaggerStab)(m,ConfigFloat("Dagger Hit Radius"),m.GetAttack(),ConfigFloat("Dagger Stab Knockback"),m.OnUpperLevel(),m.GetFacingDirectionToTarget(stabTarget),ConfigFloat("Dagger Frame Duration"),ConfigFloat("Dagger Stab Distance"),IsSpriteFlipped()?DaggerStab::HorizontalFlip::FLIPPED:DaggerStab::HorizontalFlip::NONE,
DaggerStab::DirectionOffsets{ConfigVec("Dagger Up Offset"),ConfigVec("Dagger Down Offset"),ConfigVec("Dagger Left Offset")})EndBullet;
}break;
case SLASH:{

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define VERSION_BUILD 9033
#define VERSION_BUILD 9035
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -569,10 +569,13 @@ MonsterStrategy
# Number of pixels of reach the dagger stab has.
Dagger Stab Distance = 2
Dagger Stab Knockback = 100
# How long between each dagger stab frame.
Dagger Frame Duration = 0.1s
# Offset for the dagger stab effect per direction from the monster's center.
# NOTE: Right is missing because left and right get mirrored by the game engine.
Dagger Up Offset = 6,-5
Dagger Down Offset = -5,11
Dagger Left Offset = -10,6

Loading…
Cancel
Save