Add in missing placeholder item images. Finish collision checking for shockwave attack. Release Build 9715.

mac-build
sigonasr2 7 months ago
parent 5f0f8259e8
commit 1c9641be0c
  1. 1
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  2. 3
      Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
  3. 6
      Adventures in Lestoria/Chapter_2_Boss.txt
  4. 52
      Adventures in Lestoria/ExpandingRing.h
  5. 10
      Adventures in Lestoria/StageMaskPolygon.cpp
  6. 1
      Adventures in Lestoria/StageMaskPolygon.h
  7. 31
      Adventures in Lestoria/StoneGolem.cpp
  8. 2
      Adventures in Lestoria/Version.h
  9. 17
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  10. 6
      Adventures in Lestoria/assets/config/audio/events.txt
  11. 2
      Adventures in Lestoria/assets/config/items/ItemDatabase.txt
  12. BIN
      Adventures in Lestoria/assets/gamepack.pak
  13. BIN
      Adventures in Lestoria/assets/items/Elixir of the Wind.png
  14. 0
      Adventures in Lestoria/assets/items/Health Potion.png
  15. 0
      Adventures in Lestoria/assets/items/Mana Potion.png
  16. BIN
      Adventures in Lestoria/assets/items/Recovery Potion.png
  17. BIN
      Adventures in Lestoria/assets/sounds/shockwave.ogg
  18. 4
      Adventures in Lestoria/olcUTIL_DataFile.h
  19. BIN
      x64/Release/Adventures in Lestoria.exe

@ -356,6 +356,7 @@
</SubType>
</ClInclude>
<ClInclude Include="Error.h" />
<ClInclude Include="ExpandingRing.h" />
<ClInclude Include="FloatingMenuComponent.h">
<SubType>
</SubType>

@ -657,6 +657,9 @@
<ClInclude Include="Pixel.h">
<Filter>Header Files\Engine</Filter>
</ClInclude>
<ClInclude Include="ExpandingRing.h">
<Filter>Source Files\Effects</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Player.cpp">

@ -26,9 +26,9 @@ Size: 800%
every 10% (first time at 90%) use a shockwave where you need to hide behind one of the pillar to avoid the damage. (Shockwave has 3 seconds cast, 60 dmg)
>every 10% (first time at 90%) use a shockwave where you need to hide behind one of the pillar to avoid the damage. (Shockwave has 3 seconds cast, 60 dmg)
The pillars get damaged with every shockwave. after the 3rd the pillar break.
>The pillars get damaged with every shockwave. after the 3rd the pillar break.
@ -56,7 +56,7 @@ The Boss continues with its normal behaviour while the pillars are getting caste
>after 2.5 seconds the golems throws a giant rock with 250 radius on the players position. Damaging the player and destroying Pillars hit. (55 dmg)
Stone Throw cant overlap with shockwave. when a 10% mark is reached while a rock is targeting the player, Shockwave cast starts after the rock was thrown.
>Stone Throw cant overlap with shockwave. when a 10% mark is reached while a rock is targeting the player, Shockwave cast starts after the rock was thrown.

@ -0,0 +1,52 @@
#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
#pragma once
#include "Effect.h"
struct ExpandingRing:Effect{
inline ExpandingRing(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,vf2d expandingSize,vf2d size={1.f,1.f},float fadeout=0.f,vf2d spd={},Pixel col=WHITE,float rotation=0.f,float rotationSpd=0.f,bool additiveBlending=false)
:expandingSize(expandingSize),Effect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
inline bool Update(float fElapsedTime){
size+=expandingSize*fElapsedTime;
return true;
}
private:
const vf2d expandingSize;
};

@ -199,4 +199,14 @@ void StageMaskPolygon::PerformScreenClippingAndDrawPolygon(const geom2d::polygon
void StageMaskPolygon::Draw(){
PerformScreenClippingAndDrawPolygon(polygon); //Modifies polygon
}
const std::vector<geom2d::triangle<float>>StageMaskPolygon::GetCollisionTriangles()const{
int index{1};
std::vector<geom2d::triangle<float>>tris;
while(index<polygon.pos.size()-1){
tris.emplace_back(geom2d::triangle<float>{polygon.pos[0],polygon.pos[index],polygon.pos[index+1]});
index++;
}
return tris;
}

@ -60,6 +60,7 @@ public:
void SetBlendColor(const Pixel overlayCol);
const bool HasOverlay()const;
const StageMaskOverlay&GetOverlay()const;
const std::vector<geom2d::triangle<float>>GetCollisionTriangles()const;
void Draw();
private:
void PerformScreenClippingAndDrawPolygon(const geom2d::polygon<float>&poly);

@ -44,6 +44,7 @@ All rights reserved.
#include "BulletTypes.h"
#include "SoundEffect.h"
#include "StageMaskPolygon.h"
#include "ExpandingRing.h"
INCLUDE_game
INCLUDE_MONSTER_LIST
@ -150,6 +151,7 @@ void Monster::STRATEGY::STONE_GOLEM(Monster&m,float fElapsedTime,std::string str
if(m.F(A::HEALTH_PCT_PHASE)-m.GetHealthRatio()>=0.1f){
m.F(A::HEALTH_PCT_PHASE)-=0.1f;
m.F(A::CASTING_TIMER)=ConfigFloat("Shockwave.Cast Time");
PrepareSafeAreas();
m.phase=SHOCKWAVE;
break;
@ -191,9 +193,38 @@ void Monster::STRATEGY::STONE_GOLEM(Monster&m,float fElapsedTime,std::string str
}
}break;
case SHOCKWAVE:{
m.F(A::CASTING_TIMER)-=fElapsedTime;
Pixel newCol{PixelLerp(VERY_DARK_BLUE,BLACK,sin(geom2d::pi*game->GetRunTime()*2)/2.f+0.5f)};
newCol.a=util::lerp(255.f,210.f,sin(geom2d::pi*game->GetRunTime()*2)/2.f+0.5f);
game->SetWorldColor(newCol);
if(m.F(A::CASTING_TIMER)<=0.f){
game->SetupWorldShake(ConfigFloat("Shockwave.Shockwave Screen Shake Time"));
bool isSafe{false};
for(std::any&data:m.VEC(A::STAGE_POLYGONS)){
std::vector<geom2d::triangle<float>>collisionTris{any_cast<StageMaskPolygon>(data).GetCollisionTriangles()};
for(geom2d::triangle<float>tri:collisionTris){
if(geom2d::overlaps(game->GetPlayer()->Hitbox(),tri)){
isSafe=true;
goto DoneWithCollisionCheck;
}
}
}
DoneWithCollisionCheck:
if(!isSafe){
game->GetPlayer()->Hurt(ConfigInt("Shockwave.Damage"),m.OnUpperLevel(),m.GetZ());
game->GetPlayer()->Knockback(util::pointTo(m.GetPos(),game->GetPlayer()->GetPos())*ConfigFloat("Shockwave.Knockback Amount"));
}
m.VEC(A::STAGE_POLYGONS).clear();
std::for_each(MONSTER_LIST.begin(),MONSTER_LIST.end(),[&](const std::unique_ptr<Monster>&monsterPtr){
if(monsterPtr->GetName()!="Stone Golem Pillar")return;
monsterPtr->_DealTrueDamage(ConfigInt("Shockwave.Pillar Damage"));
});
SoundEffect::PlaySFX("Shockwave",m.GetPos());
game->AddEffect(std::make_unique<ExpandingRing>(m.GetPos(),ConfigFloat("Shockwave.Shockwave Ring Lifetime"),"finishring.png",m.OnUpperLevel(),vf2d{ConfigFloat("Shockwave.Ring Expand Speed"),ConfigFloat("Shockwave.Ring Expand Speed")},vf2d{1.f,1.f},ConfigFloat("Shockwave.Shockwave Fadeout Time"),vf2d{},ConfigPixel("Shockwave.Shockwave Color")),true);
m.phase=STANDARD;
game->SetWorldColor(WHITE);
}
}break;
}
}

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

@ -931,13 +931,26 @@ MonsterStrategy
# Degrees/sec. Positive is CW, Negative is CCW.
Stone Throw Spell Insignia Rotation Spd = 50
}
Shockwave
{
Cast Time = 3s
Damage = 60
Pillar Damage = 1
Knockback Amount = 450
Shockwave Screen Shake Time = 0.75s
Ring Expand Speed = 5.0/s
Shockwave Ring Lifetime = 2.5s
Shockwave Fadeout Time = 0.5s
Shockwave Color = 255 red, 255 green, 255 blue, 120 alpha
}
}
Breaking Pillar
{
Unbroken Animation Name = NORMAL
Break Phase 1 HP % Threshold = below 68%
Break Phase 1 HP % Threshold = 68% or below
Break Phase 1 Animation Name = BREAK1
Break Phase 2 HP % Threshold = below 34%
Break Phase 2 HP % Threshold = 34% or below
Break Phase 2 Animation Name = BREAK2
Death Ring Bullet Count = 24

@ -212,6 +212,12 @@ Events
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
File[0] = rocktosscast.ogg, 100%
}
Shockwave
{
CombatSound = True
# Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%)
File[0] = shockwave.ogg, 70%
}
Slime Dead
{
CombatSound = True

@ -111,7 +111,7 @@ ItemDatabase
BuyValue = 10
UseSound = Consume Item
}
Health Potion
Health Potion
{
ItemScript = Restore
Description = Restores 75 health points.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

@ -114,7 +114,7 @@ namespace olc::utils
// Retrieves the Real Value of a Property (for a given index) or 0.0
inline const float GetReal(const size_t nItem = 0) const
{
return std::atof(GetString(nItem).c_str());
return std::stof(GetString(nItem).c_str());
}
// Sets the Real Value of a Property (for a given index)
@ -126,7 +126,7 @@ namespace olc::utils
// Retrieves the Integer Value of a Property (for a given index) or 0
inline const int32_t GetInt(const size_t nItem = 0) const
{
return std::atoi(GetString(nItem).c_str());
return std::stoi(GetString(nItem).c_str());
}
// Retrieves the Integer Value of a Property (for a given index) or 0

Loading…
Cancel
Save