On death, Chapter 2 bonus boss clears the wind and overlay if it was in the middle of that attack. Wind speed gets reset when casting timer ends. Add an extra layer to bullet rendering so there is some consistency with rendering even when bullet Draws are overriden. Fix bug w/opening debug.log file once the AiL class has been initialized. Double the iframe time from getting hit by a tornado to prevent double-hits. Setup wind debris projectiles. Release Build 9515.

mac-build
sigonasr2 6 months ago
parent 62766ec928
commit e4e1a42fc1
  1. 4
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  2. 5
      Adventures in Lestoria/AdventuresInLestoria.cpp
  3. 4
      Adventures in Lestoria/Bomb.cpp
  4. 5
      Adventures in Lestoria/Bullet.cpp
  5. 6
      Adventures in Lestoria/Bullet.h
  6. 17
      Adventures in Lestoria/BulletTypes.h
  7. 61
      Adventures in Lestoria/Debris.cpp
  8. 2
      Adventures in Lestoria/FrogTongue.cpp
  9. 4
      Adventures in Lestoria/LevitatingRock.cpp
  10. 1
      Adventures in Lestoria/TODO.txt
  11. 4
      Adventures in Lestoria/Tornado.cpp
  12. 2
      Adventures in Lestoria/Version.h
  13. 15
      Adventures in Lestoria/Zephy.cpp
  14. 1
      Adventures in Lestoria/assets/config/gfx/gfx.txt
  15. BIN
      Adventures in Lestoria/assets/gamepack.pak
  16. BIN
      x64/Release/Adventures in Lestoria.exe

@ -683,6 +683,10 @@
<SubType>
</SubType>
</ClCompile>
<ClCompile Include="Debris.cpp">
<SubType>
</SubType>
</ClCompile>
<ClCompile Include="discord-files\achievement_manager.cpp" />
<ClCompile Include="discord-files\activity_manager.cpp" />
<ClCompile Include="discord-files\application_manager.cpp" />

@ -157,7 +157,6 @@ InputGroup AiL::KEY_TOGGLE_MAP;
float AiL::SIZE_CHANGE_SPEED=1;
AiL::AiL(){
debugLogger.open("debug.log");
utils::datafile::Read(DATA,"assets/config/configuration.txt");
std::filesystem::create_directories("save_file_path"_S);
@ -1436,7 +1435,7 @@ void AiL::RenderWorld(float fElapsedTime){
ItemDrop::drops[dropInd].Draw();
}
for(const Bullet*const b:bulletsLower){
b->Draw();
b->_Draw();
}
for(const Effect*const e:foregroundEffectsLower){
e->Draw();
@ -1739,7 +1738,7 @@ void AiL::RenderWorld(float fElapsedTime){
++dropsAfterUpperIt;
}
for(const Bullet*const b:bulletsUpper){
b->Draw();
b->_Draw();
}
for(const Effect*const e:foregroundEffectsUpper){
e->Draw();

@ -102,7 +102,7 @@ bool Bomb::MonsterHit(Monster&monster){
return false;
}
void Bomb::Draw()const{
Bullet::Draw();
void Bomb::Draw(const Pixel blendCol)const{
Bullet::Draw(blendCol);
game->view.DrawPartialRotatedDecal(pos-vf2d{0,GetZ()},bomb_animation.GetFrame(animation).GetSourceImage()->Decal(),rotates?atan2(vel.y,vel.x)-PI/2:0,bomb_animation.GetFrame(animation).GetSourceRect().size/2,bomb_animation.GetFrame(animation).GetSourceRect().pos,bomb_animation.GetFrame(animation).GetSourceRect().size,scale,fadeOutTime==0?col:Pixel{col.r,col.g,col.b,uint8_t(util::lerp(col.a,0,1-((fadeOutTime-GetFadeoutTimer())/fadeOutTime)))});
}

@ -151,7 +151,7 @@ void Bullet::_Update(const float fElapsedTime){
}
}
void Bullet::Draw()const{
void Bullet::_Draw()const{
Pixel blendCol=col;
if(fadeInTime==0&&fadeOutTime==0)blendCol.a=col.a;
@ -169,7 +169,10 @@ void Bullet::Draw()const{
&&(game->GetPlayer()->HasIframes()||game->GetPlayer()->GetZ()>1)){
blendCol.a/=1.59f; //Comes from 255 divided by 160 which is roughly what we want the alpha to be when the bullet has full transparency.
}
Draw(blendCol);
}
void Bullet::Draw(const Pixel blendCol)const{
if(animated){
game->view.DrawPartialRotatedDecal(pos-vf2d{0,GetZ()}+drawOffsetY,GetFrame().GetSourceImage()->Decal(),rotates?atan2(vel.y,vel.x)-PI/2+image_angle:image_angle,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,scale,blendCol);
}else{

@ -42,6 +42,7 @@ All rights reserved.
#include "DEFINES.h"
struct Bullet{
friend class AiL;
vf2d vel;
vf2d pos;
float radius;
@ -61,16 +62,17 @@ struct Bullet{
protected:
float distanceTraveled=0.f;
vf2d scale={1,1};
private:
float fadeOutTimer=0;
float fadeInTime=0; //Setting the fade in time causes the bullet to be disabled and the bullet's alpha will fade in from zero to the actual alpha of the bullet. When the fade in timer reaches the fade in time automatically, the bullet will be enabled.
float fadeInTimer=0;
void UpdateFadeTime(float fElapsedTime);
virtual void Update(float fElapsedTime);
private:
bool dead=false; //When marked as dead it wil be removed by the next frame.
bool simulated=false; //A simulated bullet cannot interact / damage things in the world. It's simply used for simulating the trajectory and potential path of the bullet
float iframeTimerOnHit{0.f};
bool playerAutoAttackProjectile=false; //Set to true for bullets that are auto attack projectiles to identify them.
void _Draw()const;
protected:
float drawOffsetY{};
bool _PlayerHit(Player*player);
@ -95,7 +97,7 @@ public:
//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!!
virtual bool MonsterHit(Monster&monster);
Animate2D::Frame GetFrame()const;
virtual void Draw()const;
virtual void Draw(const Pixel blendCol)const;
bool OnUpperLevel();
const bool IsDead()const;
const float GetZ()const;

@ -96,7 +96,7 @@ struct FrogTongue:public Bullet{
void Update(float fElapsedTime)override;
bool PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!!
bool MonsterHit(Monster&monster)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!!
void Draw()const override;
void Draw(const Pixel blendCol)const override;
};
struct Wisp:public Bullet{
@ -159,7 +159,7 @@ struct Bomb:public Bullet{
void Update(float fElapsedTime)override;
bool PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!!
bool MonsterHit(Monster&monster)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!!
void Draw()const override;
void Draw(const Pixel blendCol)const override;
};
struct LevitatingRock:public Bullet{
@ -180,7 +180,7 @@ struct LevitatingRock:public Bullet{
void Update(float fElapsedTime)override;
bool PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!!
bool MonsterHit(Monster&monster)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!!
void Draw()const override;
void Draw(const Pixel blendCol)const override;
void AssignMaster(LevitatingRock*masterRock);
const bool IsMaster()const;
};
@ -197,4 +197,15 @@ struct Tornado:public Bullet{
void Update(float fElapsedTime)override;
bool PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!!
bool MonsterHit(Monster&monster)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!!
};
struct Debris:public Bullet{
const int randomFrame{};
const float rotatingSpd{};
float knockbackAmt{};
Debris(const vf2d pos,const vf2d vel,const int damage,const float radius,const float knockbackAmt,const float rotSpd,const float lifetime,bool upperLevel,bool friendly=false,Pixel col=WHITE,const vf2d scale={1,1});
void Update(float fElapsedTime)override;
bool PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!!
bool MonsterHit(Monster&monster)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!!
void Draw(const Pixel blendCol)const override;
};

@ -0,0 +1,61 @@
#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 "BulletTypes.h"
#include "AdventuresInLestoria.h"
#include "util.h"
INCLUDE_GFX
INCLUDE_game
Debris::Debris(const vf2d pos,const vf2d vel,const int damage,const float radius,const float knockbackAmt,const float rotSpd,const float lifetime,bool upperLevel,bool friendly,Pixel col,const vf2d scale)
:Bullet(pos,vel,radius,damage,"commercial_assets/wind_solid_objects.png",upperLevel,false,lifetime,false,friendly,col,scale),knockbackAmt(knockbackAmt),rotatingSpd(rotSpd),randomFrame(util::random(GFX["commercial_assets/wind_solid_objects.png"].Sprite()->Size().x/24)){}
void Debris::Update(float fElapsedTime){
image_angle+=rotatingSpd;
}
bool Debris::PlayerHit(Player*player){
player->Knockback(vel.norm()*knockbackAmt);
return true;
}
bool Debris::MonsterHit(Monster&monster){
monster.Knockback(vel.norm()*knockbackAmt);
return true;
}
void Debris::Draw(const Pixel blendCol)const{
game->view.DrawPartialRotatedDecal(pos-vf2d{0,GetZ()}+drawOffsetY,GetFrame().GetSourceImage()->Decal(),rotates?atan2(vel.y,vel.x)-PI/2+image_angle:image_angle,{12,12},vf2d{randomFrame*24.f,0.f},{24,24},scale,blendCol);
}

@ -91,7 +91,7 @@ bool FrogTongue::MonsterHit(Monster&monster){
monster.Knockback(geom2d::line<float>(pos+drawVec,targetPos).vector()*knockbackStrength);
return false;
}
void FrogTongue::Draw()const{
void FrogTongue::Draw(const Pixel blendCol)const{
geom2d::line<float>lineToTarget(pos,targetPos);
vf2d drawVec=lineToTarget.vector().norm()*3;

@ -103,8 +103,8 @@ bool LevitatingRock::MonsterHit(Monster&monster){
return true;
}
void LevitatingRock::Draw()const{
Bullet::Draw();
void LevitatingRock::Draw(const Pixel blendCol)const{
Bullet::Draw(blendCol);
game->view.DrawRotatedDecal(pos-vf2d{0,GetZ()}+drawOffsetY,GFX["rock_outline.png"].Decal(),rotates?atan2(vel.y,vel.x)-PI/2:0,GFX["rock_outline.png"].Sprite()->Size()/2,scale,col);
}

@ -23,5 +23,4 @@ New Monster Sound Effects
DEMO
====
Health % max health healing bug
Go back and apply new rendering code.

@ -61,7 +61,7 @@ bool Tornado::PlayerHit(Player*player){
player->Knockback(util::pointTo(centerPoint,player->GetPos())*knockbackAmt);
player->Knockup(knockupDuration);
player->ApplyIframes(knockupDuration);
player->ApplyIframes(knockupDuration*2);
return false;
}
@ -72,7 +72,7 @@ bool Tornado::MonsterHit(Monster&monster){
monster.Knockback(util::pointTo(centerPoint,monster.GetPos())*knockbackAmt);
monster.Knockup(knockupDuration);
monster.ApplyIframes(knockupDuration);
monster.ApplyIframes(knockupDuration*2);
return false;
}

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

@ -89,9 +89,15 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
m.phase=IDLE;
game->SetOverlay(ConfigString("Wind Attack.Wind Overlay Sprite"),ConfigPixel("Wind Attack.Wind Overlay Color"));
game->GetOverlay().Disable();
m.SetStrategyDeathFunction([](GameEvent&ev,Monster&m,const std::string&strategy){
game->SetWindSpeed({});
game->GetOverlay().Disable();
return true;
});
}break;
case IDLE:{
const int randomAttackChoice=2;
const int randomAttackChoice=1;
switch(randomAttackChoice){
case 0:{
@ -204,11 +210,13 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
m.F(A::CASTING_TIMER)=ConfigFloat("Wind Attack.Wind Duration");
m.F(A::WIND_STRENGTH)=ConfigFloat("Wind Attack.Wind Starting Strength")/100.f;
m.F(A::WIND_PHASE_TIMER)=ConfigFloat("Wind Attack.Wind Increase Phase Wait Time");
m.F(A::SHOOT_TIMER)=ConfigFloat("Wind Attack.Wind Projectile Spawn Rate");
}
}break;
case WIND_ATTACK:{
m.F(A::CASTING_TIMER)-=fElapsedTime;
m.F(A::WIND_PHASE_TIMER)-=fElapsedTime;
m.F(A::SHOOT_TIMER)-=fElapsedTime;
const bool OnLeftLandingSite=m.I(A::ATTACK_CHOICE);
@ -257,12 +265,15 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
vf2d windSpd={m.F(A::WIND_STRENGTH)*"Player.MoveSpd"_F,0.f}; //Assume we landed left and causing a wind attack to the right.
if(!LeftLandingSite)windSpd*=-1;
game->SetWindSpeed(windSpd);
m.F(A::CASTING_TIMER)=ConfigFloat("Wind Attack.Wind Duration");
#pragma endregion
if(m.F(A::CASTING_TIMER)<=0.f){
m.phase=IDLE;
game->GetOverlay().Disable();
game->SetWindSpeed({});
}
if(m.F(A::SHOOT_TIMER)<=0.f){
}
}break;
case HALFHEALTH_PHASE:{

@ -102,6 +102,7 @@ Images
GFX_WindOverlay = wind_vignette.png
GFX_Wind1 = wind1.png
GFX_Wind2 = wind2.png
GFX_WindObjects = commercial_assets/wind_solid_objects.png
# Ability Icons
GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png

Loading…
Cancel
Save