Tuned wind streak spawns and settings. Good to go. Release Build 9491.

mac-build
sigonasr2 6 months ago
parent e83515e6a0
commit 831901cc08
  1. 4
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  2. 7
      Adventures in Lestoria/Effect.h
  3. 58
      Adventures in Lestoria/ForegroundEffect.cpp
  4. 2
      Adventures in Lestoria/Version.h
  5. 23
      Adventures in Lestoria/Zephy.cpp
  6. 5
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  7. 2
      Adventures in Lestoria/assets/config/gfx/gfx.txt
  8. BIN
      Adventures in Lestoria/assets/gamepack.pak
  9. BIN
      x64/Release/Adventures in Lestoria.exe

@ -715,6 +715,10 @@
</ClCompile> </ClCompile>
<ClCompile Include="FallingDebris.h" /> <ClCompile Include="FallingDebris.h" />
<ClCompile Include="FireBolt.cpp" /> <ClCompile Include="FireBolt.cpp" />
<ClCompile Include="ForegroundEffect.cpp">
<SubType>
</SubType>
</ClCompile>
<ClCompile Include="Frog.cpp"> <ClCompile Include="Frog.cpp">
<SubType> <SubType>
</SubType> </SubType>

@ -93,4 +93,11 @@ struct SwordSlash:Effect{
bool Update(float fElapsedTime)override; bool Update(float fElapsedTime)override;
private: private:
HitList hitList; HitList hitList;
};
//This draws effects using screen coordinates instead of world coordinates, useful for applying effects directly on the screen.
struct ForegroundEffect:Effect{
ForegroundEffect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,float size=1.0f,float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
ForegroundEffect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
virtual void Draw()const override final;
}; };

@ -0,0 +1,58 @@
#pragma region License
/*
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions or derivations of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice. This list of conditions and the following disclaimer must be
reproduced in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
#pragma endregion
#include "olcPixelGameEngine.h"
#include "Effect.h"
#include "DEFINES.h"
#include "AdventuresInLestoria.h"
INCLUDE_game
ForegroundEffect::ForegroundEffect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
:Effect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
ForegroundEffect::ForegroundEffect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
:Effect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
void ForegroundEffect::Draw()const{
if(additiveBlending)game->SetDecalMode(DecalMode::ADDITIVE);
if(fadeout==0){
game->DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,col);
} else {
game->DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,{col.r,col.g,col.b,uint8_t(fadeout/original_fadeoutTime*255)});
}
game->SetDecalMode(DecalMode::NORMAL);
}

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 3 #define VERSION_PATCH 3
#define VERSION_BUILD 9486 #define VERSION_BUILD 9491
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -45,6 +45,7 @@ All rights reserved.
INCLUDE_game INCLUDE_game
INCLUDE_MONSTER_DATA INCLUDE_MONSTER_DATA
INCLUDE_WINDOW_SIZE INCLUDE_WINDOW_SIZE
INCLUDE_GFX
using A=Attribute; using A=Attribute;
@ -89,7 +90,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
game->GetOverlay().Disable(); game->GetOverlay().Disable();
}break; }break;
case IDLE:{ case IDLE:{
const int randomAttackChoice=util::random()%3; const int randomAttackChoice=2;
switch(randomAttackChoice){ switch(randomAttackChoice){
case 0:{ case 0:{
@ -208,11 +209,15 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
else m.PerformAnimation("ATTACK",Direction::WEST); else m.PerformAnimation("ATTACK",Direction::WEST);
#pragma region Wind Streak Effect #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. //Assuming facing right / on left landing site for initial values.
if(m.F(A::ENVIRONMENT_TIMER)<=0.f){ if(m.F(A::ENVIRONMENT_TIMER)<=0.f){
vf2d randomScreenOffset={util::random(WINDOW_SIZE.x/2.f),float(WINDOW_SIZE.y)}; const bool spawnOnTopOfScreen=util::random()%2;
float randomSpeed=util::random_range(ConfigFloatArr("Wind Attack.Wind Streak Speed Range",0),ConfigFloatArr("Wind Attack.Wind Streak Speed Range",1)); 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)); float randomLifetime=util::random_range(ConfigFloatArr("Wind Attack.Wind Streak Lifetime Range",0),ConfigFloatArr("Wind Attack.Wind Streak Lifetime Range",1));
if(!OnLeftLandingSite){ if(!OnLeftLandingSite){
@ -220,6 +225,16 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
randomSpeed*=-1.f; 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"); m.F(A::ENVIRONMENT_TIMER)=ConfigFloat("Wind Attack.Wind Streak Spawn Rate");
} }
#pragma endregion #pragma endregion

@ -835,9 +835,10 @@ MonsterStrategy
Wind Overlay Sprite = "wind_vignette.png" Wind Overlay Sprite = "wind_vignette.png"
Wind Overlay Color = 64, 64, 64, 255 Wind Overlay Color = 64, 64, 64, 255
Wind Streak Spawn Rate = 0.15s Wind Streak Spawn Rate = 0.08s
# In pixels/sec # In pixels/sec
Wind Streak Speed Range = 24px/s, 128px/s Wind Streak X Speed Range = 240px/s, 768px/s
Wind Streak Y Speed Range = -16px/s, 16px/s
Wind Streak Lifetime Range = 2s, 8s Wind Streak Lifetime Range = 2s, 8s
} }
} }

@ -100,6 +100,8 @@ Images
GFX_BirdPoop = birdpoop.png GFX_BirdPoop = birdpoop.png
GFX_Tornado = tornado2.png GFX_Tornado = tornado2.png
GFX_WindOverlay = wind_vignette.png GFX_WindOverlay = wind_vignette.png
GFX_Wind1 = wind1.png
GFX_Wind2 = wind2.png
# Ability Icons # Ability Icons
GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png

Loading…
Cancel
Save