Tuned wind streak spawns and settings. Good to go. Release Build 9491.
This commit is contained in:
@@ -45,6 +45,7 @@ All rights reserved.
|
||||
INCLUDE_game
|
||||
INCLUDE_MONSTER_DATA
|
||||
INCLUDE_WINDOW_SIZE
|
||||
INCLUDE_GFX
|
||||
|
||||
using A=Attribute;
|
||||
|
||||
@@ -89,7 +90,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
|
||||
game->GetOverlay().Disable();
|
||||
}break;
|
||||
case IDLE:{
|
||||
const int randomAttackChoice=util::random()%3;
|
||||
const int randomAttackChoice=2;
|
||||
|
||||
switch(randomAttackChoice){
|
||||
case 0:{
|
||||
@@ -208,11 +209,15 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
|
||||
else m.PerformAnimation("ATTACK",Direction::WEST);
|
||||
|
||||
#pragma region Wind Streak Effect
|
||||
m.F(A::ENVIRONMENT_TIMER)-=fElapsedTime;
|
||||
m.F(A::ENVIRONMENT_TIMER)-=fElapsedTime;
|
||||
//Assuming facing right / on left landing site for initial values.
|
||||
if(m.F(A::ENVIRONMENT_TIMER)<=0.f){
|
||||
vf2d randomScreenOffset={util::random(WINDOW_SIZE.x/2.f),float(WINDOW_SIZE.y)};
|
||||
float randomSpeed=util::random_range(ConfigFloatArr("Wind Attack.Wind Streak Speed Range",0),ConfigFloatArr("Wind Attack.Wind Streak Speed Range",1));
|
||||
const bool spawnOnTopOfScreen=util::random()%2;
|
||||
float windStreakYPos=util::random(WINDOW_SIZE.y/4.f);
|
||||
if(!spawnOnTopOfScreen)windStreakYPos=WINDOW_SIZE.y-windStreakYPos;
|
||||
vf2d randomScreenOffset={util::random(WINDOW_SIZE.x/2.f),windStreakYPos};
|
||||
|
||||
vf2d randomSpeed=vf2d{util::random_range(ConfigFloatArr("Wind Attack.Wind Streak X Speed Range",0),ConfigFloatArr("Wind Attack.Wind Streak X Speed Range",1)),util::random_range(ConfigFloatArr("Wind Attack.Wind Streak Y Speed Range",0),ConfigFloatArr("Wind Attack.Wind Streak Y Speed Range",1))};
|
||||
float randomLifetime=util::random_range(ConfigFloatArr("Wind Attack.Wind Streak Lifetime Range",0),ConfigFloatArr("Wind Attack.Wind Streak Lifetime Range",1));
|
||||
|
||||
if(!OnLeftLandingSite){
|
||||
@@ -220,6 +225,16 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
|
||||
randomSpeed*=-1.f;
|
||||
}
|
||||
|
||||
const uint8_t randomColAmt=util::random()%256;
|
||||
const uint8_t randomAlpha=util::random()%256;
|
||||
const std::string windImageChoice=util::random()%2?"wind1.png":"wind2.png";
|
||||
|
||||
const bool positiveWindRotation=util::random()%2;
|
||||
float windRotationSpd=util::random(util::degToRad(15.f));
|
||||
if(!positiveWindRotation)windRotationSpd*=-1;
|
||||
|
||||
game->AddEffect(std::make_unique<ForegroundEffect>(randomScreenOffset,randomLifetime,windImageChoice,m.OnUpperLevel(),vf2d{1.f,1.f}*(util::random_range(0.25f,1.f)),1.f,randomSpeed,Pixel{randomColAmt,randomColAmt,randomColAmt,randomAlpha},util::random(2*PI),windRotationSpd,true));
|
||||
|
||||
m.F(A::ENVIRONMENT_TIMER)=ConfigFloat("Wind Attack.Wind Streak Spawn Rate");
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
Reference in New Issue
Block a user