Refactor redundant deactivation variable to now be tied to the fade out time. Make collision checks for bullets with radii of 0 no longer occur. Add mid phase tornado. Release Build 9546.
game->AddEffect(std::make_unique<BombBoom>(pos,0.f,OnUpperLevel(),vf2d{radius,radius}/12.f/1.5f/*Upscale 24x24 to 36x36*/,1.f,vf2d{},WHITE,0.f,0.f,true));
game->AddEffect(std::make_unique<BombBoom>(pos,0.f,OnUpperLevel(),vf2d{explosionRadius,explosionRadius}/12.f/1.5f/*Upscale 24x24 to 36x36*/,1.f,vf2d{},WHITE,0.f,0.f,true));
booldeactivated=false;//A deactivated bullet no longer interacts with the world. It's just a visual.
floatfadeOutTime=0;//Setting the fade out time causes the bullet's lifetime to be set to the fadeout time as well, as that's when the bullet's alpha will reach 0, so it dies.
boolfriendly=false;//Whether or not it's a player bullet or enemy bullet.
boolupperLevel=false;
@ -73,11 +82,13 @@ private:
floatiframeTimerOnHit{0.f};
boolplayerAutoAttackProjectile=false;//Set to true for bullets that are auto attack projectiles to identify them.
void_Draw()const;
BulletTypetype{BulletType::UNDEFINED};
protected:
floatdrawOffsetY{};
bool_PlayerHit(Player*player);
bool_MonsterHit(Monster&monster);
BulletDestroyState_PlayerHit(Player*player);//Return true to destroy the bullet on hit, return false otherwise. THE BULLET HIT HAS ALREADY OCCURRED.
BulletDestroyState_MonsterHit(Monster&monster);//Return true to destroy the bullet on hit, return false otherwise. THE BULLET HIT HAS ALREADY OCCURRED.
constfloat&GetFadeoutTimer()const;
voidSetBulletType(constBulletTypetype);
public:
Animate2D::Animation<std::string>animation;
Animate2D::AnimationStateinternal_animState;
@ -92,10 +103,10 @@ public:
void_Update(constfloatfElapsedTime);
//Used by special bullets to control custom despawning behavior! Return true when the bullet should be destroyed. Return false to handle it otherwise (like deactivating it instead). You become responsible for getting rid of the bullet.
//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!!
//Used by special bullets to control custom despawning behavior! Return true when the bullet should be destroyed. Return false to handle it otherwise (like deactivating it instead). You become responsible for getting rid of the bullet.
//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!!
//The rock will rotate around the attachedTarget towards the attackingTarget. The facingRotOffset determines the angle relative to the direction pointed towards this rock will be positioned at. Once the wait time expires, the rock is fired at target speed in that given direction.
//The lock on time is how long the rocks will follow the player. The wait time is how long to wait until firing.
if(game->GetPlayer()->IsAlive()&&IsActivated())game->SetWindSpeed(util::pointTo(game->GetPlayer()->GetPos(),pos)*suctionAmt);//The tornado shouldn't begin pulling in the player until it is actually active (due to fade-in)
hitList.clear();//This is a slight hack to make it so these tornados will always hit things multiple times.
radius=0.f;//Prevent the rocks from hitting anything by making their radius be zero.
drawOffsetY=cos(PI*game->GetRunTime())*3.f;
}
elseif(targetVel.has_value()){
vel=targetVel.value();
deactivated=false;
radius=collisionRadius;
}elseERR(std::format("WARNING! Levitating Rock does not have a target velocity! It did not get assigned somehow! Is Master: {}. THIS SHOULD NOT BE HAPPENING!",IsMaster()))