diff --git a/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj b/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj index 8b4d797d..adb98958 100644 --- a/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj +++ b/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj @@ -103,6 +103,7 @@ + diff --git a/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj.filters b/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj.filters index 46c4e2d1..d8b0f985 100644 --- a/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj.filters +++ b/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj.filters @@ -75,6 +75,9 @@ Source Files + + Source Files + diff --git a/Adventures in Lestoria Tests/BuffTests.cpp b/Adventures in Lestoria Tests/BuffTests.cpp new file mode 100644 index 00000000..68f20364 --- /dev/null +++ b/Adventures in Lestoria Tests/BuffTests.cpp @@ -0,0 +1,123 @@ +#pragma region License +/* +License (OLC-3) +~~~~~~~~~~~~~~~ + +Copyright 2024 Joshua Sigona + +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 "CppUnitTest.h" +#include "AdventuresInLestoria.h" +#include "config.h" +#include "ItemDrop.h" +#include "Tutorial.h" +#include "DamageNumber.h" +#include "GameHelper.h" + +using namespace Microsoft::VisualStudio::CppUnitTestFramework; +using namespace olc::utils; + +INCLUDE_MONSTER_DATA +INCLUDE_game +INCLUDE_GFX +INCLUDE_DAMAGENUMBER_LIST +INCLUDE_MONSTER_LIST +INCLUDE_INITIALIZEGAMECONFIGURATIONS + +TEST_MODULE_INITIALIZE(AiLTestSuite) +{ + debugLogger.open("debug.log"); +} + +namespace BuffTests +{ + TEST_CLASS(BuffTest) + { + public: + std::unique_ptrtestGame; + #pragma region Setup Functions + void SetupTestMonster(){ + InitializeGameConfigurations(); + testGame.reset(new AiL(true)); + ItemAttribute::Initialize(); + ItemInfo::InitializeItems(); + testGame->InitializeGraphics(); + testGame->InitializeClasses(); + sig::Animation::InitializeAnimations(); + testGame->InitializeDefaultKeybinds(); + testGame->InitializePlayer(); + sig::Animation::SetupPlayerAnimations(); + Menu::InitializeMenus(); + Tutorial::Initialize(); + Stats::InitializeDamageReductionTable(); + + GameState::Initialize(); + GameState::STATE=GameState::states.at(States::State::GAME_RUN); + testGame->ResetLevelStates(); + + #pragma region Setup a fake test map + game->MAP_DATA["CAMPAIGN_1_1"]; + game->_SetCurrentLevel("CAMPAIGN_1_1"); + ItemDrop::ClearDrops(); + #pragma endregion + + MonsterData testMonsterData{"TestName","Test Monster",30,10,5,{MonsterDropData{"Health Potion",100.f,1,1}},200.f}; + MONSTER_DATA["TestName"]=testMonsterData; + + Menu::themes.SetInitialized(); + GFX.SetInitialized(); + DAMAGENUMBER_LIST.clear(); + } + void SetupMockMap(){ + game->MAP_DATA["CAMPAIGN_1_1"]; + ItemDrop::ClearDrops(); + } + #pragma endregion + + TEST_METHOD_INITIALIZE(MonsterInitialize){ + SetupTestMonster(); + SetupMockMap(); + } + ~BuffTest(){ + testGame.release(); + } + TEST_METHOD(AddBuffMonsterCallbackExpireFunctionTest){ + Monster&m{game->SpawnMonster({},MONSTER_DATA.at("TestName"))}; + Game::Update(0.f); + Assert::AreEqual(size_t(0),m.GetBuffs(BuffType::AFFECTED_BY_LIGHTNING_BOLT).size(),L"Monsters do not have any lightning bolt affected buffs when spawning."); + m.AddBuff(BuffType::AFFECTED_BY_LIGHTNING_BOLT,3.f,1,[](std::weak_ptrattachedTarget,Buff&b){attachedTarget.lock()->Hurt(5,attachedTarget.lock()->OnUpperLevel(),attachedTarget.lock()->GetZ());}); + Assert::AreEqual(size_t(1),m.GetBuffs(BuffType::AFFECTED_BY_LIGHTNING_BOLT).size(),L"Monster now has Affected By Lightning Bolt buff. Should get hurt for 5 damage in 3 seconds..."); + Game::Update(3.f); + Assert::AreEqual(25,m.GetHealth(),L"Monster should have taken 5 health from the expired callback provided."); + } + }; +} \ No newline at end of file diff --git a/Adventures in Lestoria/Buff.cpp b/Adventures in Lestoria/Buff.cpp index dbacab9f..b324e76e 100644 --- a/Adventures in Lestoria/Buff.cpp +++ b/Adventures in Lestoria/Buff.cpp @@ -41,7 +41,13 @@ All rights reserved. #include "Monster.h" Buff::Buff(std::variant>attachedTarget,BuffType type,float duration,float intensity) - :attachedTarget(attachedTarget),type(type),duration(duration),intensity(intensity),originalDuration(this->duration){} + :Buff(attachedTarget,type,duration,intensity,[](std::weak_ptrm,Buff&b){}){} + +Buff::Buff(std::variant>attachedTarget,BuffType type,float duration,float intensity,PlayerBuffExpireCallbackFunction expireCallbackFunc) +:attachedTarget(attachedTarget),type(type),duration(duration),intensity(intensity),originalDuration(this->duration),playerBuffCallbackFunc(expireCallbackFunc){} +Buff::Buff(std::variant>attachedTarget,BuffType type,float duration,float intensity,MonsterBuffExpireCallbackFunction expireCallbackFunc) +:attachedTarget(attachedTarget),type(type),duration(duration),intensity(intensity),originalDuration(this->duration),monsterBuffCallbackFunc(expireCallbackFunc){} + Buff::Buff(std::variant>attachedTarget,BuffType type,float duration,float intensity,std::set attr) :attachedTarget(attachedTarget),type(type),duration(duration),intensity(intensity),attr(attr),originalDuration(this->duration){} Buff::Buff(std::variant>attachedTarget,BuffType type,float duration,float intensity,std::set attr) diff --git a/Adventures in Lestoria/Buff.h b/Adventures in Lestoria/Buff.h index ef764413..d789abc0 100644 --- a/Adventures in Lestoria/Buff.h +++ b/Adventures in Lestoria/Buff.h @@ -64,6 +64,7 @@ enum BuffType{ SWORD_ENCHANTMENT, CURSE_OF_PAIN, CURSE_OF_DEATH, + AFFECTED_BY_LIGHTNING_BOLT, //Intensity indicates number of repeats remaining. }; enum class BuffRestorationType{ ONE_OFF, //This is used as a hack fix for the RestoreDuringCast Item script since they require us to restore 1 tick immediately. Over time buffs do not apply a tick immediately. @@ -88,7 +89,7 @@ struct Buff{ using MonsterBuffExpireCallbackFunction=std::functionattachedTarget,Buff&b)>; BuffType type; - BuffRestorationType restorationType; + BuffRestorationType restorationType{BuffRestorationType::ONE_OFF}; float duration=1; float timeBetweenTicks=1; float intensity=1; @@ -103,6 +104,8 @@ struct Buff{ Buff(std::variant>attachedTarget,BuffType type,float duration,float intensity); Buff(std::variant>attachedTarget,BuffType type,float duration,float intensity,std::set attr); Buff(std::variant>attachedTarget,BuffType type,float duration,float intensity,std::set attr); + Buff(std::variant>attachedTarget,BuffType type,float duration,float intensity,PlayerBuffExpireCallbackFunction expireCallbackFunc); + Buff(std::variant>attachedTarget,BuffType type,float duration,float intensity,MonsterBuffExpireCallbackFunction expireCallbackFunc); Buff(std::variant>attachedTarget,BuffRestorationType restorationType,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks); Buff(std::variant>attachedTarget,BuffRestorationType restorationType,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks,PlayerBuffExpireCallbackFunction expireCallbackFunc); Buff(std::variant>attachedTarget,BuffRestorationType restorationType,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks,MonsterBuffExpireCallbackFunction expireCallbackFunc); diff --git a/Adventures in Lestoria/BulletTypes.h b/Adventures in Lestoria/BulletTypes.h index 3c7ffe71..3ec038a3 100644 --- a/Adventures in Lestoria/BulletTypes.h +++ b/Adventures in Lestoria/BulletTypes.h @@ -62,12 +62,19 @@ private: }; struct LightningBolt:public Bullet{ + enum ChainLightningStatus{//Any other number represents something not defined here, the number of hits remaining. + ORIGINAL_BOLT=-1, + NO_MORE_HITS=0, + }; float lastParticleSpawn=0; LightningBolt(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool friendly=false,Pixel col=WHITE); void Update(float fElapsedTime)override; BulletDestroyState PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!! BulletDestroyState MonsterHit(Monster&monster,const uint8_t markStacksBeforeHit)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!! void ModifyOutgoingDamageData(HurtDamageInfo&data); +private: + /*chainLightningRepeatCount - Set to higher amount to indicate when this monster instead affects monsters due to the enchantment, which changes which shock count variable we look at and will be used for counting down shock times.*/ + static void ApplyLightningShock(const Monster&monster,const bool onUpperLevel,const ChainLightningStatus chainLightningRepeatCount=ORIGINAL_BOLT); }; struct Arrow:public Bullet{ diff --git a/Adventures in Lestoria/LightningBolt.cpp b/Adventures in Lestoria/LightningBolt.cpp index 5d612909..7077ab36 100644 --- a/Adventures in Lestoria/LightningBolt.cpp +++ b/Adventures in Lestoria/LightningBolt.cpp @@ -48,8 +48,7 @@ INCLUDE_MONSTER_LIST INCLUDE_EMITTER_LIST LightningBolt::LightningBolt(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool friendly,Pixel col) - :Bullet(pos,vel,radius,damage, - "lightning_bolt.png",upperLevel,false,INFINITE,true,friendly,col){} + :Bullet(pos,vel,radius,damage,"lightning_bolt.png",upperLevel,false,INFINITE,true,friendly,col){} void LightningBolt::Update(float fElapsedTime){ lastParticleSpawn=std::max(0.f,lastParticleSpawn-fElapsedTime); @@ -77,38 +76,51 @@ void LightningBolt::Update(float fElapsedTime){ } } -BulletDestroyState LightningBolt::PlayerHit(Player*player) -{ +BulletDestroyState LightningBolt::PlayerHit(Player*player){ fadeOutTime="Wizard.Ability 2.BulletFadeoutTime"_F; game->AddEffect(std::make_unique(player->GetPos(),"Wizard.Ability 2.SplashLifetime"_F,"lightning_splash_effect.png",upperLevel,player->GetSizeMult(),"Wizard.Ability 2.SplashFadeoutTime"_F,vf2d{},WHITE,"Wizard.Ability 2.SplashRotationRange"_FRange)); - SoundEffect::PlaySFX("Wizard Lightning Bolt Hit",pos); + SoundEffect::PlaySFX("Wizard Lightning Bolt Hit",pos); return BulletDestroyState::KEEP_ALIVE; } -BulletDestroyState LightningBolt::MonsterHit(Monster&monster,const uint8_t markStacksBeforeHit) -{ +BulletDestroyState LightningBolt::MonsterHit(Monster&monster,const uint8_t markStacksBeforeHit){ fadeOutTime="Wizard.Ability 2.BulletFadeoutTime"_F; game->AddEffect(std::make_unique(monster.GetPos(),"Wizard.Ability 2.SplashLifetime"_F,"lightning_splash_effect.png",upperLevel,monster.GetSizeMult(),"Wizard.Ability 2.SplashFadeoutTime"_F,vf2d{},WHITE,"Wizard.Ability 2.SplashRotationRange"_FRange)); + + LightningBolt::ApplyLightningShock(monster,monster.OnUpperLevel()); + + SoundEffect::PlaySFX("Wizard Lightning Bolt Hit",pos); + return BulletDestroyState::KEEP_ALIVE; +} + +void LightningBolt::ModifyOutgoingDamageData(HurtDamageInfo&data){ + if(friendly)data.hurtFlags|=HurtFlag::PLAYER_ABILITY; +} + +void LightningBolt::ApplyLightningShock(const Monster&monster,const bool onUpperLevel,const ChainLightningStatus chainLightningRepeatCount/*Set to higher amount to indicate when this monster instead affects monsters due to the enchantment, which changes which shock count variable we look at and will be used for counting down shock times.*/){ int targetsHit=0; for(std::shared_ptr&m:MONSTER_LIST){ - if(&*m==&monster||monster.OnUpperLevel()!=m->OnUpperLevel())continue; + if(&*m==&monster||m->InUndamageableState(m->OnUpperLevel(),m->GetZ()))continue; geom2d::linelineToTarget=geom2d::line(monster.GetPos(),m->GetPos()); float dist=lineToTarget.length(); if(dist<="Wizard.Ability 2.LightningChainRadius"_F/100*24){ - if(m->Hurt(int(game->GetPlayer()->GetAttack()*"Wizard.Ability 2.LightningChainDamageMult"_F),OnUpperLevel(),0,HurtFlag::PLAYER_ABILITY)){ - EMITTER_LIST.push_back(std::make_unique(LightningBoltEmitter(monster.GetPos(),m->GetPos(),"Wizard.Ability 2.LightningChainFrequency"_F,"Wizard.Ability 2.LightningChainLifetime"_F,upperLevel))); - game->AddEffect(std::make_unique(m->GetPos(),"Wizard.Ability 2.LightningChainSplashLifetime"_F,"lightning_splash_effect.png",upperLevel,monster.GetSizeMult(),"Wizard.Ability 2.LightningChainSplashFadeoutTime"_F,vf2d{},WHITE,"Wizard.Ability 2.LightningChainSplashRotationRange"_FRange)); + int lightningChainDamage{int(game->GetPlayer()->GetAttack()*"Wizard.Ability 2.LightningChainDamageMult"_F)}; + if(chainLightningRepeatCount>0)lightningChainDamage=int(game->GetPlayer()->GetAttack()*"Chain Lightning"_ENC["SHOCK DAMAGE"]/100.f); + if(m->Hurt(lightningChainDamage,onUpperLevel,0,HurtFlag::PLAYER_ABILITY)){ + EMITTER_LIST.emplace_back(std::make_unique(LightningBoltEmitter(monster.GetPos(),m->GetPos(),"Wizard.Ability 2.LightningChainFrequency"_F,"Wizard.Ability 2.LightningChainLifetime"_F,onUpperLevel))); + game->AddEffect(std::make_unique(m->GetPos(),"Wizard.Ability 2.LightningChainSplashLifetime"_F,"lightning_splash_effect.png",onUpperLevel,monster.GetSizeMult(),"Wizard.Ability 2.LightningChainSplashFadeoutTime"_F,vf2d{},WHITE,"Wizard.Ability 2.LightningChainSplashRotationRange"_FRange)); + int chainLightningRepeat{}; + if(chainLightningRepeatCount>0)chainLightningRepeat=chainLightningRepeatCount-1; + else if(game->GetPlayer()->HasEnchant("Chain Lightning")&&chainLightningRepeatCount==ORIGINAL_BOLT)chainLightningRepeat=int("Chain Lightning"_ENC["REPEAT COUNT"]); + if(chainLightningRepeat>0&&game->GetPlayer()->HasEnchant("Chain Lightning"))m->AddBuff(BuffType::AFFECTED_BY_LIGHTNING_BOLT,"Chain Lightning"_ENC["ADDITIONAL SHOCK DELAY"],chainLightningRepeat,[](std::weak_ptrattachedTarget,Buff&b){ + LightningBolt::ApplyLightningShock(*attachedTarget.lock(),attachedTarget.lock()->OnUpperLevel(),ChainLightningStatus(b.intensity)); + }); targetsHit++; } } - if(targetsHit>=2)break; + int targetHitLimit{"Wizard.Ability 2.LightningChainTargets"_I}; + if(chainLightningRepeatCount>0)targetHitLimit="Chain Lightning"_ENC["ADDITIONAL SHOCK COUNT"]; + if(targetsHit>=targetHitLimit)break; } - - SoundEffect::PlaySFX("Wizard Lightning Bolt Hit",pos); - return BulletDestroyState::KEEP_ALIVE; -} - -void LightningBolt::ModifyOutgoingDamageData(HurtDamageInfo&data){ - if(friendly)data.hurtFlags|=HurtFlag::PLAYER_ABILITY; } \ No newline at end of file diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 815e6e24..8cb42770 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -346,7 +346,7 @@ bool Monster::Update(float fElapsedTime){ std::erase_if(buffList,[](Buff&b){ if(b.duration<=0.f){ if(!std::holds_alternative>(b.attachedTarget))ERR(std::format("WARNING! Somehow removed buff of type {} is inside the player buff list but is not attached to the Player? THIS SHOULD NOT BE HAPPENING!",int(b.type))); - b.monsterBuffCallbackFunc(std::get>(b.attachedTarget),b); + if(b.monsterBuffCallbackFunc)b.monsterBuffCallbackFunc(std::get>(b.attachedTarget),b); return true; } return false; @@ -862,7 +862,7 @@ const bool Monster::OnUpperLevel()const{ } void Monster::AddBuff(BuffType type,float duration,float intensity){ - buffList.push_back(Buff{GetWeakPointer(),type,duration,intensity}); + buffList.emplace_back(GetWeakPointer(),type,duration,intensity); } void Monster::AddBuff(BuffType type,float duration,float intensity,std::setattr){ @@ -875,6 +875,10 @@ void Monster::AddBuff(BuffType type,float duration,float intensity,std::setattr); //NOTE: If adding a % increase stat, please use the percentage version! 100% = 1!! void AddBuff(BuffType type,float duration,float intensity,std::setattr); + void AddBuff(BuffType type,float duration,float intensity,Buff::MonsterBuffExpireCallbackFunction expireCallback); void AddBuff(BuffRestorationType type,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks); void AddBuff(BuffRestorationType type,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks,Buff::MonsterBuffExpireCallbackFunction expireCallback); void AddBuff(BuffType type,BuffRestorationType restorationType,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks); diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index df9c5d68..8f4f1311 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -429,7 +429,7 @@ void Player::Update(float fElapsedTime){ std::erase_if(buffList,[](Buff&b){ if(b.duration<=0.f){ if(!std::holds_alternative(b.attachedTarget))ERR(std::format("WARNING! Somehow removed buff of type {} is inside the player buff list but is not attached to the Player? THIS SHOULD NOT BE HAPPENING!",int(b.type))); - b.playerBuffCallbackFunc(std::get(b.attachedTarget),b); + if(b.playerBuffCallbackFunc)b.playerBuffCallbackFunc(std::get(b.attachedTarget),b); return true; } return false; @@ -1131,33 +1131,37 @@ void Player::UpdateIdleAnimation(Key direction){ } void Player::AddBuff(BuffType type,float duration,float intensity){ - Buff&newBuff{buffList.emplace_back(Buff{this,type,duration,intensity})}; + Buff&newBuff{buffList.emplace_back(this,type,duration,intensity)}; + OnBuffAdd(newBuff); +} +void Player::AddBuff(BuffType type,float duration,float intensity,Buff::PlayerBuffExpireCallbackFunction expireCallbackFunc){ + Buff&newBuff{buffList.emplace_back(this,type,duration,intensity,expireCallbackFunc)}; OnBuffAdd(newBuff); } void Player::AddBuff(BuffType type,float duration,float intensity,std::setattr){ if(type==STAT_UP)std::for_each(attr.begin(),attr.end(),[](const ItemAttribute&attr){if(attr.ActualName()!="Health"&&attr.ActualName()!="Health %"&&attr.ActualName()!="Attack"&&attr.ActualName()!="Attack %"&&attr.ActualName()!="Defense"&&attr.ActualName()!="Defense %"&&attr.ActualName()!="CDR"&&attr.ActualName()!="Move Spd %")ERR(std::format("WARNING! Stat Up Attribute type {} is NOT IMPLEMENTED!",attr.ActualName()));}); - Buff&newBuff{buffList.emplace_back(Buff{this,type,duration,intensity,attr})}; + Buff&newBuff{buffList.emplace_back(this,type,duration,intensity,attr)}; OnBuffAdd(newBuff); } void Player::AddBuff(BuffType type,float duration,float intensity,std::setattr){ if(type==STAT_UP)std::for_each(attr.begin(),attr.end(),[](const std::string&attr){if(attr!="Health"&&attr!="Health %"&&attr!="Attack"&&attr!="Attack %"&&attr!="Defense"&&attr!="Defense %"&&attr!="CDR"&&attr!="Move Spd %")ERR(std::format("WARNING! Stat Up Attribute type {} is NOT IMPLEMENTED!",attr));}); - Buff&newBuff{buffList.emplace_back(Buff{this,type,duration,intensity,attr})}; + Buff&newBuff{buffList.emplace_back(this,type,duration,intensity,attr)}; OnBuffAdd(newBuff); } void Player::AddBuff(BuffRestorationType type,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks){ - Buff&newBuff{buffList.emplace_back(Buff{this,type,overTimeType,duration,intensity,timeBetweenTicks})}; + Buff&newBuff{buffList.emplace_back(this,type,overTimeType,duration,intensity,timeBetweenTicks)}; OnBuffAdd(newBuff); } void Player::AddBuff(BuffRestorationType type,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks,Buff::PlayerBuffExpireCallbackFunction expireCallbackFunc){ - Buff&newBuff{buffList.emplace_back(Buff{this,type,overTimeType,duration,intensity,timeBetweenTicks,expireCallbackFunc})}; + Buff&newBuff{buffList.emplace_back(this,type,overTimeType,duration,intensity,timeBetweenTicks,expireCallbackFunc)}; OnBuffAdd(newBuff); } void Player::AddBuff(BuffType type,BuffRestorationType restorationType,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks){ - Buff&newBuff{buffList.emplace_back(Buff{this,type,restorationType,overTimeType,duration,intensity,timeBetweenTicks})}; + Buff&newBuff{buffList.emplace_back(this,type,restorationType,overTimeType,duration,intensity,timeBetweenTicks)}; OnBuffAdd(newBuff); } void Player::AddBuff(BuffType type,BuffRestorationType restorationType,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks,Buff::PlayerBuffExpireCallbackFunction expireCallbackFunc){ - Buff&newBuff{buffList.emplace_back(Buff{this,type,restorationType,overTimeType,duration,intensity,timeBetweenTicks,expireCallbackFunc})}; + Buff&newBuff{buffList.emplace_back(this,type,restorationType,overTimeType,duration,intensity,timeBetweenTicks,expireCallbackFunc)}; OnBuffAdd(newBuff); } diff --git a/Adventures in Lestoria/Player.h b/Adventures in Lestoria/Player.h index 75bca237..baffdd82 100644 --- a/Adventures in Lestoria/Player.h +++ b/Adventures in Lestoria/Player.h @@ -180,6 +180,7 @@ public: void AddBuff(BuffType type,float duration,float intensity,std::setattr); //NOTE: If adding a % increase stat, please use the percentage version! 100% = 1!! void AddBuff(BuffType type,float duration,float intensity,std::setattr); + void AddBuff(BuffType type,float duration,float intensity,Buff::PlayerBuffExpireCallbackFunction expireCallbackFunc); void AddBuff(BuffRestorationType type,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks); void AddBuff(BuffRestorationType type,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks,Buff::PlayerBuffExpireCallbackFunction expireCallbackFunc); void AddBuff(BuffType type,BuffRestorationType restorationType,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks); diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 1031e69b..0e5068c3 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 5 -#define VERSION_BUILD 11309 +#define VERSION_BUILD 11328 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/classes/Wizard.txt b/Adventures in Lestoria/assets/config/classes/Wizard.txt index f3bf5da9..ab80c173 100644 --- a/Adventures in Lestoria/assets/config/classes/Wizard.txt +++ b/Adventures in Lestoria/assets/config/classes/Wizard.txt @@ -184,6 +184,9 @@ Wizard BulletFadeoutTime = 0.2 + # Number of targets that will be hit by the lightning chain. + LightningChainTargets = 2 + # How far away to look for nearby enemies to chain lightning to. LightningChainRadius = 300 # Damage multiplier for enemies hit by lightning chain. diff --git a/Adventures in Lestoria/assets/config/items/ItemEnchants.txt b/Adventures in Lestoria/assets/config/items/ItemEnchants.txt index b4cc7806..aec4bc13 100644 --- a/Adventures in Lestoria/assets/config/items/ItemEnchants.txt +++ b/Adventures in Lestoria/assets/config/items/ItemEnchants.txt @@ -529,7 +529,7 @@ Item Enchants } Summon Comet { - Description = "Meteor cast time reduced to {METEOR CAST TIME} seconds. Meteor attack falls {FALL SPEED MULT}x as quickly. Damage is reduced by {DAMAGE REDUCTION PCT}% and Cooldown reduced by {COOLDOWN REDUCTION} seconds." + Description = "Meteor cast time reduced to {METEOR CAST TIME} seconds. Meteor attack falls twice as quick. Damage is reduced by {DAMAGE REDUCTION PCT}% and -{COOLDOWN REDUCTION}s cooldown time." Affects = Ability 3 METEOR CAST TIME = 0.5s @@ -542,7 +542,7 @@ Item Enchants } Solar Flare { - Description = "Meteor cast time increased to {METEOR CAST TIME} seconds. Meteor is {SIZE MULT}x as large and deals {METEOR ATTACK}% attack. Lingering fire rings last {FIRE RING DURATION MULT}x as long. Cooldown increased by {COOLDOWN INCREASE} seconds." + Description = "Meteor cast time increased to {METEOR CAST TIME} seconds. Meteor is double size and deals {METEOR ATTACK}% attack. Fire rings last twice as long. +{COOLDOWN INCREASE}s cooldown time." Affects = Ability 3 METEOR CAST TIME = 3.5s diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak index d60bfa9c..a86da510 100644 Binary files a/Adventures in Lestoria/assets/gamepack.pak and b/Adventures in Lestoria/assets/gamepack.pak differ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index a9e45195..dd57f77c 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ