Fix Damage Number flickering, add in extra projectile ring when king slime lands for phase 1. Phase 1 complete.
This commit is contained in:
parent
43b5503661
commit
cb600c8ea4
@ -378,6 +378,7 @@ void Crawler::UpdateEffects(float fElapsedTime){
|
|||||||
std::erase_if(EMITTER_LIST,[](std::unique_ptr<Emitter>&e){return e->dead;});
|
std::erase_if(EMITTER_LIST,[](std::unique_ptr<Emitter>&e){return e->dead;});
|
||||||
std::erase_if(backgroundEffects,[](std::unique_ptr<Effect>&e){return e->dead;});
|
std::erase_if(backgroundEffects,[](std::unique_ptr<Effect>&e){return e->dead;});
|
||||||
std::erase_if(foregroundEffects,[](std::unique_ptr<Effect>&e){return e->dead;});
|
std::erase_if(foregroundEffects,[](std::unique_ptr<Effect>&e){return e->dead;});
|
||||||
|
std::erase_if(DAMAGENUMBER_LIST,[](std::shared_ptr<DamageNumber>&n){return n->lifeTime>1;});
|
||||||
|
|
||||||
for(auto it=foregroundEffectsToBeInserted.begin();it!=foregroundEffectsToBeInserted.end();++it){
|
for(auto it=foregroundEffectsToBeInserted.begin();it!=foregroundEffectsToBeInserted.end();++it){
|
||||||
foregroundEffects.push_back(std::move(*it));
|
foregroundEffects.push_back(std::move(*it));
|
||||||
@ -674,6 +675,10 @@ void Crawler::RenderWorld(float fElapsedTime){
|
|||||||
#pragma endregion
|
#pragma endregion
|
||||||
//DrawDecal({0,0},MAP_TILESETS["assets/maps/"+MAP_DATA[LEVEL1].TilesetData[1].data["source"]]->Decal());
|
//DrawDecal({0,0},MAP_TILESETS["assets/maps/"+MAP_DATA[LEVEL1].TilesetData[1].data["source"]]->Decal());
|
||||||
|
|
||||||
|
for(Monster&m:MONSTER_LIST){
|
||||||
|
m.strategyDraw(this);
|
||||||
|
}
|
||||||
|
|
||||||
if(player->GetZ()>0){
|
if(player->GetZ()>0){
|
||||||
vf2d shadowScale=vf2d{8*player->GetSizeMult()/3.f,1}/std::max(1.f,player->GetZ()/24);
|
vf2d shadowScale=vf2d{8*player->GetSizeMult()/3.f,1}/std::max(1.f,player->GetZ()/24);
|
||||||
view.DrawDecal(player->GetPos()-vf2d{3,3}*shadowScale/2+vf2d{0,6*player->GetSizeMult()},GFX["circle.png"].Decal(),shadowScale,BLACK);
|
view.DrawDecal(player->GetPos()-vf2d{3,3}*shadowScale/2+vf2d{0,6*player->GetSizeMult()},GFX["circle.png"].Decal(),shadowScale,BLACK);
|
||||||
@ -803,16 +808,10 @@ void Crawler::RenderWorld(float fElapsedTime){
|
|||||||
dn->pauseTime-=fElapsedTime;
|
dn->pauseTime-=fElapsedTime;
|
||||||
} else{
|
} else{
|
||||||
dn->lifeTime+=fElapsedTime;
|
dn->lifeTime+=fElapsedTime;
|
||||||
if(dn->lifeTime>1){
|
if(dn->lifeTime<=1){
|
||||||
it=DAMAGENUMBER_LIST.erase(it);
|
|
||||||
if(it==DAMAGENUMBER_LIST.end()){
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(dn->lifeTime<DamageNumber::MOVE_UP_TIME){
|
if(dn->lifeTime<DamageNumber::MOVE_UP_TIME){
|
||||||
dn->pos.y-=20*fElapsedTime;
|
dn->pos.y-=20*fElapsedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::string text=std::to_string(dn->damage);
|
std::string text=std::to_string(dn->damage);
|
||||||
|
@ -184,7 +184,6 @@ Key Monster::GetFacingDirection(){
|
|||||||
return facingDirection;
|
return facingDirection;
|
||||||
}
|
}
|
||||||
void Monster::Draw(){
|
void Monster::Draw(){
|
||||||
strategyDraw(game);
|
|
||||||
if(GetZ()>0){
|
if(GetZ()>0){
|
||||||
vf2d shadowScale=vf2d{8*GetSizeMult()/3.f,1}/std::max(1.f,GetZ()/24);
|
vf2d shadowScale=vf2d{8*GetSizeMult()/3.f,1}/std::max(1.f,GetZ()/24);
|
||||||
game->view.DrawDecal(GetPos()-vf2d{3,3}*shadowScale/2+vf2d{0,6*GetSizeMult()},GFX["circle.png"].Decal(),shadowScale,BLACK);
|
game->view.DrawDecal(GetPos()-vf2d{3,3}*shadowScale/2+vf2d{0,6*GetSizeMult()},GFX["circle.png"].Decal(),shadowScale,BLACK);
|
||||||
|
@ -92,7 +92,6 @@ private:
|
|||||||
bool diesNormally=true; //If set to false, the monster death is handled in a special way. Set it to true when it's time to die.
|
bool diesNormally=true; //If set to false, the monster death is handled in a special way. Set it to true when it's time to die.
|
||||||
float targetSize=0;
|
float targetSize=0;
|
||||||
std::map<Attribute,std::variant<VARIANTS>>attributes;
|
std::map<Attribute,std::variant<VARIANTS>>attributes;
|
||||||
std::function<void(Crawler*)>strategyDraw=[](Crawler*pge){};
|
|
||||||
protected:
|
protected:
|
||||||
public:
|
public:
|
||||||
Monster()=delete;
|
Monster()=delete;
|
||||||
@ -146,6 +145,7 @@ public:
|
|||||||
bool&GetBool(Attribute a);
|
bool&GetBool(Attribute a);
|
||||||
vf2d&GetVf2d(Attribute a);
|
vf2d&GetVf2d(Attribute a);
|
||||||
void SetStrategyDrawFunction(std::function<void(Crawler*)>func);
|
void SetStrategyDrawFunction(std::function<void(Crawler*)>func);
|
||||||
|
std::function<void(Crawler*)>strategyDraw=[](Crawler*pge){};
|
||||||
private:
|
private:
|
||||||
struct STRATEGY{
|
struct STRATEGY{
|
||||||
static int _GetInt(Monster&m,std::string param,int strategyNumber,int index=0);
|
static int _GetInt(Monster&m,std::string param,int strategyNumber,int index=0);
|
||||||
|
@ -15,6 +15,7 @@ typedef Attribute A;
|
|||||||
|
|
||||||
void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumber){
|
void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumber){
|
||||||
|
|
||||||
|
|
||||||
float bulletSpd=ConfigFloat("BulletSpd")/100*24;
|
float bulletSpd=ConfigFloat("BulletSpd")/100*24;
|
||||||
|
|
||||||
m.F(A::SHOOT_RING_TIMER)=std::max(0.f,m.F(A::SHOOT_RING_TIMER)-fElapsedTime);
|
m.F(A::SHOOT_RING_TIMER)=std::max(0.f,m.F(A::SHOOT_RING_TIMER)-fElapsedTime);
|
||||||
@ -28,6 +29,13 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe
|
|||||||
BULLET_LIST.emplace_back(std::make_unique<Bullet>(m.GetPos(),vf2d{cos(angle),sin(angle)}*bulletSpd,6,ConfigInt("ProjectileDamage"),m.OnUpperLevel(),false,YELLOW,vf2d{6,6}));
|
BULLET_LIST.emplace_back(std::make_unique<Bullet>(m.GetPos(),vf2d{cos(angle),sin(angle)}*bulletSpd,6,ConfigInt("ProjectileDamage"),m.OnUpperLevel(),false,YELLOW,vf2d{6,6}));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
auto Landed=[&ShootBulletRing,&m](int currentPhase){
|
||||||
|
if(currentPhase==1){
|
||||||
|
ShootBulletRing(m.F(A::SHOOT_RING_OFFSET));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
auto StartJump=[&](float jumpDuration,vf2d targetPos,float recoveryTime){
|
auto StartJump=[&](float jumpDuration,vf2d targetPos,float recoveryTime){
|
||||||
m.V(A::JUMP_ORIGINAL_POS)=m.GetPos();
|
m.V(A::JUMP_ORIGINAL_POS)=m.GetPos();
|
||||||
m.F(A::JUMP_ORIGINAL_LANDING_TIMER)=m.F(A::JUMP_LANDING_TIMER)=jumpDuration;
|
m.F(A::JUMP_ORIGINAL_LANDING_TIMER)=m.F(A::JUMP_LANDING_TIMER)=jumpDuration;
|
||||||
@ -80,6 +88,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe
|
|||||||
}
|
}
|
||||||
game->GetPlayer()->Knockback(lineToPlayer.vector().norm()*ConfigInt("JumpKnockbackFactor"));
|
game->GetPlayer()->Knockback(lineToPlayer.vector().norm()*ConfigInt("JumpKnockbackFactor"));
|
||||||
}
|
}
|
||||||
|
Landed(m.phase);
|
||||||
m.SetStrategyDrawFunction([](Crawler*game){});
|
m.SetStrategyDrawFunction([](Crawler*game){});
|
||||||
} else
|
} else
|
||||||
if(m.F(A::JUMP_LANDING_TIMER)<=ConfigFloat("JumpWarningIndicatorTime")){
|
if(m.F(A::JUMP_LANDING_TIMER)<=ConfigFloat("JumpWarningIndicatorTime")){
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 1330
|
#define VERSION_BUILD 1334
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user