Slash animation plays when ghost saber hits player. Release Build 12036.

master
sigonasr2 1 month ago
parent d24c016d3e
commit ded7e53fd7
  1. 8
      Adventures in Lestoria/GhostOfPirateCaptain.cpp
  2. 8
      Adventures in Lestoria/GhostSaber.cpp
  3. 4
      Adventures in Lestoria/Monster.cpp
  4. 3
      Adventures in Lestoria/Monster.h
  5. 1
      Adventures in Lestoria/MonsterAttribute.h
  6. 2
      Adventures in Lestoria/Version.h
  7. BIN
      x64/Release/Adventures in Lestoria.exe

@ -53,6 +53,7 @@ void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std
INIT,
NORMAL,
AFTERIMAGE_FADEIN,
GHOSTSABER_SLASH=999,
};
enum CannonShotType{
@ -187,5 +188,12 @@ void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std
m.SetCollisionRadius(m.GetOriginalCollisionRadius());
}
}break;
case GHOSTSABER_SLASH:{ //This was triggered by GhostSaber when
m.F(A::GHOST_SABER_SLASH_ANIMATION_TIMER)-=fElapsedTime;
if(m.F(A::GHOST_SABER_SLASH_ANIMATION_TIMER)<=0.f){
m.PerformIdleAnimation();
SETPHASE(m.I(A::PREVIOUS_PHASE));
}
}break;
}
}

@ -37,6 +37,7 @@ All rights reserved.
#pragma endregion
#include "BulletTypes.h"
#include "Attributable.h"
GhostSaber::GhostSaber(const vf2d pos,const std::weak_ptr<Monster>target,const float lifetime,const float distFromTarget,const float knockbackAmt,const float initialRot,const float radius,const float expandSpd,const int damage,const bool upperLevel,const float rotSpd,const bool friendly,const Pixel col,const vf2d scale,const float image_angle)
:Bullet(target.lock()->GetPos()+vf2d{distFromTarget,initialRot}.cart(),{},radius,damage,"ghost_dagger.png",upperLevel,false,INFINITE,false,friendly,col,scale,image_angle),attachedMonster(target),rotSpd(rotSpd),distFromTarget(distFromTarget),rot(initialRot),aliveTime(lifetime),knockbackAmt(knockbackAmt),expandSpd(expandSpd){}
@ -64,6 +65,13 @@ void GhostSaber::Update(float fElapsedTime){
BulletDestroyState GhostSaber::PlayerHit(Player*player){
player->ApplyIframes(0.2f);
player->Knockback(vf2d{knockbackAmt,rot}.cart());
if(!attachedMonster.expired()){
const int GHOSTSABER_SLASH_PHASEID{999};
attachedMonster.lock()->GetInt(Attribute::PREVIOUS_PHASE)=attachedMonster.lock()->GetPhase(attachedMonster.lock()->GetStrategyName());
attachedMonster.lock()->SetPhase(attachedMonster.lock()->GetStrategyName(),GHOSTSABER_SLASH_PHASEID);
attachedMonster.lock()->PerformAnimation("SLASHING");
attachedMonster.lock()->GetFloat(Attribute::GHOST_SABER_SLASH_ANIMATION_TIMER)=attachedMonster.lock()->GetCurrentAnimation().GetTotalAnimationDuration();
}
return BulletDestroyState::KEEP_ALIVE;
}

@ -1712,4 +1712,8 @@ void Monster::SetupAfterImage(){
afterImage.Decal()->Update();
removeLineTimer=TIME_BETWEEN_LINE_REMOVALS;
scanLine=1U;
}
const std::string&Monster::GetStrategyName()const{
return strategy;
}

@ -75,7 +75,7 @@ public:
DeathSpawnInfo(const std::string_view monsterName,const uint8_t spawnAmt,const vf2d spawnOffset={});
void Spawn(const vf2d monsterDeathPos,const bool onUpperLevel);
};
class Monster:IAttributable{
class Monster:public IAttributable{
friend struct STRATEGY;
friend class AiL;
friend class InventoryCreator;
@ -238,6 +238,7 @@ public:
const int GetPhase(const std::string&strategyName);
const float GetOriginalCollisionRadius()const;
void SetCollisionRadius(const float collisionRadius);
const std::string&GetStrategyName()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.

@ -174,4 +174,5 @@ enum class Attribute{
LAST_PLAYER_POS,
FIRST_WAVE_COMPLETE,
GHOST_SABER_TIMER,
GHOST_SABER_SLASH_ANIMATION_TIMER,
};

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 12032
#define VERSION_BUILD 12036
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save