Add 0.25s fade time to generic bullets. Add feather bullet type. Add feather spawning to tornado attack for second bonus boss. Addresses Issue #56. Release Build 9576.

removeExposedPackKey
sigonasr2 8 months ago
parent 6dc986d424
commit 96790c3073
  1. 4
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  2. 10
      Adventures in Lestoria/Bullet.cpp
  3. 1
      Adventures in Lestoria/Bullet.h
  4. 4
      Adventures in Lestoria/BulletTypes.h
  5. 44
      Adventures in Lestoria/Feather.cpp
  6. 2
      Adventures in Lestoria/Version.h
  7. 24
      Adventures in Lestoria/Zephy.cpp
  8. 15
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  9. 1
      Adventures in Lestoria/assets/config/gfx/gfx.txt
  10. BIN
      Adventures in Lestoria/assets/feather.png
  11. BIN
      Adventures in Lestoria/assets/gamepack.pak
  12. BIN
      x64/Release/Adventures in Lestoria.exe

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

@ -192,8 +192,14 @@ BulletDestroyState Bullet::_MonsterHit(Monster&monster){
if(iframeTimerOnHit>0.f)monster.ApplyIframes(iframeTimerOnHit);
return destroyBullet;
}
BulletDestroyState Bullet::PlayerHit(Player*player){return BulletDestroyState::DESTROY;}
BulletDestroyState Bullet::MonsterHit(Monster&monster){return BulletDestroyState::DESTROY;}
BulletDestroyState Bullet::PlayerHit(Player*player){
fadeOutTime=0.25f;
return BulletDestroyState::KEEP_ALIVE;
}
BulletDestroyState Bullet::MonsterHit(Monster&monster){
fadeOutTime=0.25f;
return BulletDestroyState::KEEP_ALIVE;
}
bool Bullet::OnUpperLevel(){return upperLevel;}
const bool Bullet::IsDead()const{

@ -43,6 +43,7 @@ All rights reserved.
enum class BulletType{
UNDEFINED,
FEATHER,
LARGE_TORNADO,
};

@ -221,4 +221,8 @@ struct LargeTornado:public Bullet{
void Update(float fElapsedTime)override;
BulletDestroyState PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!!
BulletDestroyState MonsterHit(Monster&monster)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!!
};
struct Feather:public Bullet{
Feather(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool hitsMultiple=false,float lifetime=INFINITE,bool friendly=false,Pixel col=WHITE,vf2d scale={1,1},float image_angle=0.f);
};

@ -0,0 +1,44 @@
#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"
Feather::Feather(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool hitsMultiple,float lifetime,bool friendly,Pixel col,vf2d scale,float image_angle)
:Bullet(pos,vel,radius,damage,"feather.png",upperLevel,hitsMultiple,lifetime,true,friendly,col){
SetBulletType(BulletType::FEATHER);
}

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

@ -338,10 +338,12 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
m.phase=HALFHEALTH_PHASE;
CreateBullet(LargeTornado)(ConfigVec("Mid Phase.Large Tornado Position"),ConfigPixels("Mid Phase.Large Tornado Suction"),ConfigFloat("Mid Phase.Large Tornado Knockup Duration"),ConfigFloat("Mid Phase.Large Tornado Knockback Amount"),ConfigInt("Mid Phase.Large Tornado Damage"),ConfigFloat("Mid Phase.Large Tornado Radius"),INFINITY,m.OnUpperLevel())EndBullet;
BULLET_LIST.back()->SetFadeinTime(1.0f);
m.F(A::SHOOT_TIMER)=2.f;
}
}
}break;
case HALFHEALTH_PHASE:{
m.F(A::SHOOT_TIMER)-=fElapsedTime;
m.ApplyIframes(1.f);
m.UpdateFacingDirection(Direction::SOUTH);
m.PerformAnimation("ATTACK");
@ -350,10 +352,32 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
std::for_each(BULLET_LIST.begin(),BULLET_LIST.end(),[](std::unique_ptr<Bullet>&bullet){
if(bullet->GetBulletType()==BulletType::LARGE_TORNADO){
bullet->fadeOutTime=1.f;
}else if(bullet->GetBulletType()==BulletType::FEATHER){
bullet->fadeOutTime=0.25f;
}
});
game->SetWindSpeed({});
}
if(m.F(A::SHOOT_TIMER)<=0.f){
const auto GetHighestFeatherRateFromConfig=[&](const uint8_t monsterAliveCount){
uint8_t highestMatch=0U;
float featherRate=0.f;
const auto featherRateKeys=Config("Mid Phase.Feather Spawn Rate").GetKeys();
std::for_each(featherRateKeys.begin(),featherRateKeys.end(),[&](const std::pair<std::string,size_t>&data){
const int monsterCount=std::stoi(data.first);
if(monsterAliveCount>=monsterCount&&monsterCount>highestMatch){
highestMatch=monsterCount;
featherRate=1.f/ConfigFloat(std::format("Mid Phase.Feather Spawn Rate.{}",data.first));
}
});
return featherRate;
};
CreateBullet(Feather)(ConfigVec("Mid Phase.Large Tornado Position"),vf2d{ConfigPixels("Mid Phase.Feather Speed"),util::random(2*PI)}.cart(),ConfigFloat("Mid Phase.Feather Radius"),ConfigInt("Mid Phase.Feather Damage"),m.OnUpperLevel(),false,INFINITE,false,WHITE)EndBullet;
m.F(A::SHOOT_TIMER)=GetHighestFeatherRateFromConfig(game->BossEncounterMobCount());
}
}break;
}
}

@ -879,6 +879,21 @@ MonsterStrategy
Large Tornado Suction = 100units/s
Large Tornado Knockup Duration = 0.75s
Large Tornado Knockback Amount = 300
# We are specifying rates based on number of remaining targets.
Feather Spawn Rate
{
6 monsters = 2/s
5 monsters = 2.5/s
4 monsters = 3/s
3 monsters = 3.5/s
2 monsters = 4/s
1 monster = 4.5/s
}
Feather Speed = 150units/s
Feather Radius = 4px
Feather Damage = 10
}
}
Stone Golem

@ -105,6 +105,7 @@ Images
GFX_WindObjects = commercial_assets/wind_solid_objects.png
GFX_LargeTornado = large_tornado.png
GFX_SafeAreaIndicator = safeIndicatorGradient.png
GFX_Feather = feather.png
# Ability Icons
GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Loading…
Cancel
Save