|
|
|
@ -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; |
|
|
|
|
} |