|
|
|
@ -48,6 +48,7 @@ INCLUDE_BULLET_LIST |
|
|
|
|
INCLUDE_GFX |
|
|
|
|
INCLUDE_MONSTER_LIST |
|
|
|
|
INCLUDE_MONSTER_DATA |
|
|
|
|
INCLUDE_DATA |
|
|
|
|
|
|
|
|
|
using A=Attribute; |
|
|
|
|
|
|
|
|
@ -66,6 +67,8 @@ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy |
|
|
|
|
m.AddBuff(BARRIER_DAMAGE_REDUCTION,INFINITE,ConfigFloat("Phase 2.Barrier Damage Reduction")/100.f); |
|
|
|
|
m.I(A::PHASE_REPEAT_COUNT)=ConfigInt("Phase 2.Wisp Pattern Spawn Count"); |
|
|
|
|
SoundEffect::PlaySFX("Ursule Phase Transition",SoundEffect::CENTERED); |
|
|
|
|
m.F(A::ENVIRONMENT_TIMER)=ConfigFloat("Phase 2.Environment Fade-out Time"); |
|
|
|
|
m.I(A::ENVIRONMENT_PHASE)=0; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if(m.GetRemainingHPPct()<=ConfigFloat("Phase 2.Change")/100.f){ |
|
|
|
@ -110,6 +113,31 @@ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy |
|
|
|
|
case 2:{ |
|
|
|
|
m.PerformOtherAnimation(2); |
|
|
|
|
m.F(A::SHOOT_TIMER)=std::max(0.f,m.F(A::SHOOT_TIMER)-fElapsedTime); |
|
|
|
|
|
|
|
|
|
m.F(A::ENVIRONMENT_TIMER)=std::max(0.f,m.F(A::ENVIRONMENT_TIMER)-fElapsedTime); |
|
|
|
|
switch(m.I(A::ENVIRONMENT_PHASE)){ |
|
|
|
|
case 0:{ //Fade out.
|
|
|
|
|
game->SetWorldColor(WHITE*util::lerp(0.f,1.0f,m.F(A::ENVIRONMENT_TIMER)/ConfigFloat("Phase 2.Environment Fade-out Time"))); |
|
|
|
|
if(m.F(A::ENVIRONMENT_TIMER)==0.f){ |
|
|
|
|
game->SetWorldColor({0,0,0,255}); |
|
|
|
|
m.F(A::ENVIRONMENT_TIMER)=ConfigFloat("Phase 2.Environment Fade-in Time"); |
|
|
|
|
m.I(A::ENVIRONMENT_PHASE)++; |
|
|
|
|
game->SetWorldColorFunc([&](vi2d pos){ |
|
|
|
|
float fadeInRange=DATA["MonsterStrategy"]["Ursule"]["Phase 2"]["Environment Fade-In Range"].GetReal()/100.f*24.f; |
|
|
|
|
float distToPlayer=geom2d::line<float>(game->GetPlayer()->GetPos(),pos).length(); |
|
|
|
|
return game->GetWorldColor()*std::min(1.0f,fadeInRange/distToPlayer); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case 1:{ //Fade in.
|
|
|
|
|
Pixel fadeInCol=ConfigPixel("Phase 2.Environment Fade-In Color"); |
|
|
|
|
|
|
|
|
|
game->SetWorldColor(fadeInCol*util::lerp(1.f,0.f,m.F(A::ENVIRONMENT_TIMER)/ConfigFloat("Phase 2.Environment Fade-in Time"))); |
|
|
|
|
if(m.F(A::ENVIRONMENT_TIMER)==0.f){ |
|
|
|
|
game->SetWorldColor(fadeInCol); |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(m.I(A::PHASE_REPEAT_COUNT)>0){ |
|
|
|
|
if(m.F(A::SHOOT_TIMER)==0.f){ |
|
|
|
@ -139,7 +167,7 @@ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy |
|
|
|
|
std::string_view row=ConfigString(std::format("Wisp Pattern {}.Row[{}]",wispPattern,y)); |
|
|
|
|
if(row[int(x/wispSize.x)%row.length()]!='.'){ |
|
|
|
|
float ySpawn=ConfigInt("Phase 2.Wisp Pattern Spawn Y")+y*wispSize.y; |
|
|
|
|
BULLET_LIST.push_back(std::make_unique<Wisp>(vf2d{x,ySpawn},vf2d{0,ConfigFloat("Phase 2.Wisp Speed")},wispSize.x/2,m.GetAttack(),m.OnUpperLevel(),false,ConfigPixel("Phase 2.Wisp Color"))); |
|
|
|
|
BULLET_LIST.push_back(std::make_unique<Wisp>(vf2d{x,ySpawn},vf2d{0,ConfigFloat("Phase 2.Wisp Speed")},wispSize.x/3.f,m.GetAttack(),m.OnUpperLevel(),false,ConfigPixel("Phase 2.Wisp Color"))); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -158,7 +186,7 @@ void Monster::STRATEGY::URSULE(Monster&m,float fElapsedTime,std::string strategy |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case 3:{ |
|
|
|
|
std::cout<<"Phase 3"<<std::endl; |
|
|
|
|
|
|
|
|
|
}break; |
|
|
|
|
default:{ |
|
|
|
|
ERR(std::format("WARNING! Unknown phase {} for {} reached!",m.phase,m.GetName())); |
|
|
|
|