Create a SpellCircle effect to consolidate the two separate effects. Add a type identifier system for Effects. Finish spawn pillar phase of second chapter boss. Fix bug with the boss display info still appearing despite no longer being in a boss stage if the player leaves a boss level before the text has expired. Release Build 9622.

removeExposedPackKey
sigonasr2 8 months ago
parent 09d3b2b233
commit 4a77391dec
  1. 4
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  2. 1
      Adventures in Lestoria/AdventuresInLestoria.cpp
  3. 4
      Adventures in Lestoria/Effect.cpp
  4. 15
      Adventures in Lestoria/Effect.h
  5. 56
      Adventures in Lestoria/SpellCircle.cpp
  6. 17
      Adventures in Lestoria/StoneGolem.cpp
  7. 3
      Adventures in Lestoria/Stone_Elemental.cpp
  8. 1
      Adventures in Lestoria/TODO.txt
  9. 2
      Adventures in Lestoria/Version.h
  10. 15
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  11. 2
      Adventures in Lestoria/assets/config/Monsters.txt
  12. 1
      Adventures in Lestoria/assets/config/gfx/gfx.txt
  13. BIN
      Adventures in Lestoria/assets/gamepack.pak
  14. BIN
      Adventures in Lestoria/assets/large_rock.png
  15. 1
      Adventures in Lestoria/olcUTIL_Animate2D.h
  16. BIN
      x64/Release/Adventures in Lestoria.exe

@ -899,6 +899,10 @@
<SubType> <SubType>
</SubType> </SubType>
</ClCompile> </ClCompile>
<ClCompile Include="SpellCircle.cpp">
<SubType>
</SubType>
</ClCompile>
<ClCompile Include="StageMaskPolygon.cpp"> <ClCompile Include="StageMaskPolygon.cpp">
<SubType> <SubType>
</SubType> </SubType>

@ -2299,6 +2299,7 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){
worldColorFunc=[&](vi2d pos){return game->worldColor;}; worldColorFunc=[&](vi2d pos){return game->worldColor;};
levelTime=0; levelTime=0;
bossName=""; bossName="";
bossDisplayTimer=0.f;
worldShakeTime=0.f; worldShakeTime=0.f;
encounterDuration=0; encounterDuration=0;
totalDamageDealt=0; totalDamageDealt=0;

@ -85,3 +85,7 @@ Animate2D::Frame Effect::GetFrame()const{
bool Effect::OnUpperLevel(){ bool Effect::OnUpperLevel(){
return upperLevel; return upperLevel;
} }
const EffectType Effect::GetType()const{
return type;
}

@ -43,6 +43,11 @@ class Monster;
class Player; class Player;
using HitList=std::unordered_set<std::variant<Monster*,Player*>>; using HitList=std::unordered_set<std::variant<Monster*,Player*>>;
enum class EffectType{
NONE,
SPELL_CIRCLE,
};
struct Effect{ struct Effect{
friend class AiL; friend class AiL;
vf2d pos={0,0}; vf2d pos={0,0};
@ -63,8 +68,10 @@ public:
Animate2D::Frame GetFrame()const; Animate2D::Frame GetFrame()const;
virtual void Draw()const; virtual void Draw()const;
bool OnUpperLevel(); bool OnUpperLevel();
const EffectType GetType()const;
protected: protected:
float original_fadeoutTime; float original_fadeoutTime;
EffectType type{EffectType::NONE};
private: private:
Animate2D::Animation<std::string>animation; Animate2D::Animation<std::string>animation;
Animate2D::AnimationState internal_animState; Animate2D::AnimationState internal_animState;
@ -101,3 +108,11 @@ struct ForegroundEffect:Effect{
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); 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; virtual void Draw()const override final;
}; };
struct SpellCircle:Effect{
SpellCircle(vf2d pos,float lifetime,std::string imgFile,std::string spellInsigniaFile,bool upperLevel,float size=1.0f,float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false,float insigniaSize=1.0f,float insigniaFadeout=0.0f,vf2d insigniaSpd={},Pixel insigniaCol=WHITE,float insigniaSotation=0,float insigniaRotationSpd=0,bool insigniaAdditiveBlending=false);
SpellCircle(vf2d pos,float lifetime,std::string imgFile,std::string spellInsigniaFile,bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false,vf2d insigniaSize={1,1},float insigniaFadeout=0.0f,vf2d insigniaSpd={},Pixel insigniaCol=WHITE,float insigniaSotation=0,float insigniaRotationSpd=0,bool insigniaAdditiveBlending=false);
Effect spellInsignia{vf2d{},0.f,"spell_insignia.png",false,{}};
virtual bool Update(float fElapsedTime)override final;
virtual void Draw()const override final;
};

@ -0,0 +1,56 @@
#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 "Effect.h"
SpellCircle::SpellCircle(vf2d pos,float lifetime,std::string imgFile,std::string spellInsigniaFile,bool upperLevel,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending,vf2d insigniaSize,float insigniaFadeout,vf2d insigniaSpd,Pixel insigniaCol,float insigniaRotation,float insigniaRotationSpd,bool insigniaAdditiveBlending)
:Effect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){
type=EffectType::SPELL_CIRCLE;
spellInsignia=Effect{pos,lifetime,spellInsigniaFile,upperLevel,insigniaSize,insigniaFadeout,insigniaSpd,insigniaCol,insigniaRotation,insigniaRotationSpd,insigniaAdditiveBlending};
}
SpellCircle::SpellCircle(vf2d pos,float lifetime,std::string imgFile,std::string spellInsigniaFile,bool upperLevel,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending,float insigniaSize,float insigniaFadeout,vf2d insigniaSpd,Pixel insigniaCol,float insigniaRotation,float insigniaRotationSpd,bool insigniaAdditiveBlending)
:SpellCircle(pos,lifetime,imgFile,spellInsigniaFile,upperLevel,vf2d{size,size},fadeout,spd,col,rotation,rotationSpd,additiveBlending,vf2d{insigniaSize,insigniaSize},insigniaFadeout,insigniaSpd,insigniaCol,insigniaRotation,insigniaRotationSpd,insigniaAdditiveBlending){}
void SpellCircle::Draw()const{
Effect::Draw();
spellInsignia.Draw();
}
bool SpellCircle::Update(float fElapsedTime){
spellInsignia.Update(fElapsedTime);
return Effect::Update(fElapsedTime);
}

@ -52,6 +52,7 @@ void Monster::STRATEGY::STONE_GOLEM(Monster&m,float fElapsedTime,std::string str
SPAWN_PILLAR_PREPARE, SPAWN_PILLAR_PREPARE,
SPAWN_PILLAR_CAST, SPAWN_PILLAR_CAST,
STANDARD, STANDARD,
STONE_THROW_CAST,
}; };
switch(m.phase){ switch(m.phase){
@ -65,8 +66,7 @@ void Monster::STRATEGY::STONE_GOLEM(Monster&m,float fElapsedTime,std::string str
if(m.F(A::RECOVERY_TIME)<=0.f){ if(m.F(A::RECOVERY_TIME)<=0.f){
m.V(A::LOCKON_POS)=game->GetPlayer()->GetPos(); m.V(A::LOCKON_POS)=game->GetPlayer()->GetPos();
m.PerformAnimation("CAST",m.GetFacingDirectionToTarget(m.V(A::LOCKON_POS))); m.PerformAnimation("CAST",m.GetFacingDirectionToTarget(m.V(A::LOCKON_POS)));
game->AddEffect(std::make_unique<Effect>(m.V(A::LOCKON_POS),ConfigFloat("Beginning Phase.Pillar Cast Time"),"range_indicator.png",m.OnUpperLevel(),vf2d{1.f,1.f}*(MONSTER_DATA.at("Stone Golem Pillar").GetCollisionRadius()*MONSTER_DATA.at("Stone Golem Pillar").GetSizeMult()/12.f)*1.25f,0.3f,vf2d{},ConfigPixel("Beginning Phase.Pillar Spell Circle Color"),util::random(2*PI),util::degToRad(ConfigFloat("Beginning Phase.Pillar Spell Circle Rotation Spd"))),true); game->AddEffect(std::make_unique<SpellCircle>(m.V(A::LOCKON_POS),ConfigFloat("Beginning Phase.Pillar Cast Time"),"range_indicator.png","spell_insignia.png",m.OnUpperLevel(),vf2d{1.f,1.f}*(MONSTER_DATA.at("Stone Golem Pillar").GetCollisionRadius()*MONSTER_DATA.at("Stone Golem Pillar").GetSizeMult()/12.f)*1.25f,0.3f,vf2d{},ConfigPixel("Beginning Phase.Pillar Spell Circle Color"),util::random(2*PI),util::degToRad(ConfigFloat("Beginning Phase.Pillar Spell Circle Rotation Spd")),false,vf2d{1.f,1.f}*(MONSTER_DATA.at("Stone Golem Pillar").GetCollisionRadius()*MONSTER_DATA.at("Stone Golem Pillar").GetSizeMult()/12.f)*0.9f,0.3f,vf2d{},ConfigPixel("Beginning Phase.Pillar Spell Insignia Color"),util::random(2*PI),util::degToRad(ConfigFloat("Beginning Phase.Pillar Spell Insignia Rotation Spd"))),true);
game->AddEffect(std::make_unique<Effect>(m.V(A::LOCKON_POS),ConfigFloat("Beginning Phase.Pillar Cast Time"),"spell_insignia.png",m.OnUpperLevel(),vf2d{1.f,1.f}*(MONSTER_DATA.at("Stone Golem Pillar").GetCollisionRadius()*MONSTER_DATA.at("Stone Golem Pillar").GetSizeMult()/12.f)*0.9f,0.3f,vf2d{},ConfigPixel("Beginning Phase.Pillar Spell Insignia Color"),util::random(2*PI),util::degToRad(ConfigFloat("Beginning Phase.Pillar Spell Insignia Rotation Spd"))),true);
m.F(A::CASTING_TIMER)=ConfigFloat("Beginning Phase.Pillar Cast Time"); m.F(A::CASTING_TIMER)=ConfigFloat("Beginning Phase.Pillar Cast Time");
m.phase=SPAWN_PILLAR_CAST; m.phase=SPAWN_PILLAR_CAST;
} }
@ -88,6 +88,19 @@ void Monster::STRATEGY::STONE_GOLEM(Monster&m,float fElapsedTime,std::string str
}break; }break;
case STANDARD:{ case STANDARD:{
BEAR(m,fElapsedTime,"Bear"); BEAR(m,fElapsedTime,"Bear");
//Extending the bear script's variables to read the state of it...
const bool SlamHasFinished=m.I(A::ATTACK_COUNT)!=m.I(A::BEAR_STOMP_COUNT);
const bool StoneThrowRollSucceeds=util::random(100.f)<=ConfigFloat("Standard Attack.Stone Throw Chance");
if(SlamHasFinished&&StoneThrowRollSucceeds){
m.phase=STONE_THROW_CAST;
m.V(A::LOCKON_POS)=game->GetPlayer()->GetPos();
m.PerformAnimation("TOSS ROCK CAST");
m.F(A::CASTING_TIMER)=ConfigFloat("Standard Attack.Stone Throw Cast Time");
game->AddEffect(std::make_unique<SpellCircle>(m.V(A::LOCKON_POS),ConfigFloat("Standard Attack.Stone Throw Cast Time")+4.f,"range_indicator.png","spell_insignia.png",m.OnUpperLevel(),vf2d{1.f,1.f}*(ConfigPixels("Standard Attack.Stone Radius")/12.f)*1.25f,0.3f,vf2d{},ConfigPixel("Standard Attack.Stone Throw Spell Circle Color"),util::random(2*PI),util::degToRad(ConfigFloat("Standard Attack.Stone Throw Spell Circle Rotation Spd")),false,vf2d{1.f,1.f}*(ConfigPixels("Standard Attack.Stone Radius")/12.f)*0.9f,0.3f,vf2d{},ConfigPixel("Standard Attack.Stone Throw Spell Insignia Color"),util::random(2*PI),util::degToRad(ConfigFloat("Standard Attack.Stone Throw Spell Insignia Rotation Spd"))),true);
}
}break;
case STONE_THROW_CAST:{
}break; }break;
} }
} }

@ -96,8 +96,7 @@ void Monster::STRATEGY::STONE_ELEMENTAL(Monster&m,float fElapsedTime,std::string
m.phase=STONE_PILLAR_CAST; m.phase=STONE_PILLAR_CAST;
m.F(A::CASTING_TIMER)=ConfigFloat("Stone Pillar Cast Time"); m.F(A::CASTING_TIMER)=ConfigFloat("Stone Pillar Cast Time");
m.V(A::LOCKON_POS)=game->GetPlayer()->GetPos(); m.V(A::LOCKON_POS)=game->GetPlayer()->GetPos();
game->AddEffect(std::make_unique<Effect>(m.V(A::LOCKON_POS),ConfigFloat("Stone Pillar Cast Time"),"range_indicator.png",m.OnUpperLevel(),vf2d{1.f,1.f}*(MONSTER_DATA.at("Stone Pillar").GetCollisionRadius()*MONSTER_DATA.at("Stone Pillar").GetSizeMult()/12.f)*1.25f,0.3f,vf2d{},ConfigPixel("Stone Pillar Spell Circle Color"),util::random(2*PI),util::degToRad(ConfigFloat("Stone Pillar Spell Circle Rotation Spd"))),true); game->AddEffect(std::make_unique<SpellCircle>(m.V(A::LOCKON_POS),ConfigFloat("Stone Pillar Cast Time"),"range_indicator.png","spell_insignia.png",m.OnUpperLevel(),vf2d{1.f,1.f}*(MONSTER_DATA.at("Stone Pillar").GetCollisionRadius()*MONSTER_DATA.at("Stone Pillar").GetSizeMult()/12.f)*1.25f,0.3f,vf2d{},ConfigPixel("Stone Pillar Spell Circle Color"),util::random(2*PI),util::degToRad(ConfigFloat("Stone Pillar Spell Circle Rotation Spd")),false,vf2d{1.f,1.f}*(MONSTER_DATA.at("Stone Pillar").GetCollisionRadius()*MONSTER_DATA.at("Stone Pillar").GetSizeMult()/12.f)*0.9f,0.3f,vf2d{},ConfigPixel("Stone Pillar Spell Insignia Color"),util::random(2*PI),util::degToRad(ConfigFloat("Stone Pillar Spell Insignia Rotation Spd"))),false);
game->AddEffect(std::make_unique<Effect>(m.V(A::LOCKON_POS),ConfigFloat("Stone Pillar Cast Time"),"spell_insignia.png",m.OnUpperLevel(),vf2d{1.f,1.f}*(MONSTER_DATA.at("Stone Pillar").GetCollisionRadius()*MONSTER_DATA.at("Stone Pillar").GetSizeMult()/12.f)*0.9f,0.3f,vf2d{},ConfigPixel("Stone Pillar Spell Insignia Color"),util::random(2*PI),util::degToRad(ConfigFloat("Stone Pillar Spell Insignia Rotation Spd"))),true);
}break; }break;
case 1:{ case 1:{
m.PerformAnimation("ROCK TOSS CAST"); m.PerformAnimation("ROCK TOSS CAST");

@ -23,4 +23,3 @@ New Monster Sound Effects
DEMO DEMO
==== ====
Go back and apply new rendering code.

@ -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 9613 #define VERSION_BUILD 9622
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -912,6 +912,21 @@ MonsterStrategy
# Degrees/sec. Positive is CW, Negative is CCW. # Degrees/sec. Positive is CW, Negative is CCW.
Pillar Spell Insignia Rotation Spd = 50 Pillar Spell Insignia Rotation Spd = 50
} }
Standard Attack
{
Stone Throw Chance = 25%
Stone Radius = 250
Stone Damage = 55
Stone Pillar Damage = 3
Stone Throw Cast Time = 2.5s
Stone Throw Spell Circle Color = 40, 40, 40, 80
Stone Throw Spell Insignia Color = 144, 137, 160, 255
# Degrees/sec. Positive is CW, Negative is CCW.
Stone Throw Spell Circle Rotation Spd = -30
# Degrees/sec. Positive is CW, Negative is CCW.
Stone Throw Spell Insignia Rotation Spd = 50
}
} }
Breaking Pillar Breaking Pillar
{ {

@ -1038,7 +1038,7 @@ Monsters
DEATH = 4, 0.15, OneShot DEATH = 4, 0.15, OneShot
BURROW UNDERGROUND = 5, 0.15, OneShot BURROW UNDERGROUND = 5, 0.15, OneShot
RISE FROM UNDERGROUND = 5, 0.15, OneShot RISE FROM UNDERGROUND = 5, 0.15, OneShot
TOSS ROCK Cast = 2, 0.2, Repeat TOSS ROCK CAST = 2, 0.2, Repeat
SLAM = 3, 0.15, OneShot SLAM = 3, 0.15, OneShot
TOSS ROCK = 4, 0.2, OneShot TOSS ROCK = 4, 0.2, OneShot
} }

@ -106,6 +106,7 @@ Images
GFX_LargeTornado = large_tornado.png GFX_LargeTornado = large_tornado.png
GFX_SafeAreaIndicator = safeIndicatorGradient.png GFX_SafeAreaIndicator = safeIndicatorGradient.png
GFX_Feather = feather.png GFX_Feather = feather.png
GFX_LargeRock = large_rock.png
# Ability Icons # Ability Icons
GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

@ -55,6 +55,7 @@ David Barr, aka javidx9, <EFBFBD>OneLoneCoder 2019, 2020, 2021, 2022
#pragma once #pragma once
#include "olcUTIL_Geometry2D.h" #include "olcUTIL_Geometry2D.h"
#define OLC_IGNOREVEC2D
#include "olcPixelGameEngine.h" #include "olcPixelGameEngine.h"
namespace olc::utils::Animate2D namespace olc::utils::Animate2D

Loading…
Cancel
Save