From b4692769a0990f50d2b08fb5d810f44bb19072c0 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sat, 29 Jul 2023 09:44:38 -0500 Subject: [PATCH] Add configuration parameters for Wizard Meteor ability. --- Crawler/LightningBolt.cpp | 2 +- Crawler/Meteor.cpp | 24 +++++----- Crawler/PulsatingFire.cpp | 20 ++++---- Crawler/Version.h | 2 +- Crawler/Wizard.cpp | 2 +- Crawler/assets/config/classes/Wizard.txt | 58 ++++++++++++++++++++++-- 6 files changed, 80 insertions(+), 28 deletions(-) diff --git a/Crawler/LightningBolt.cpp b/Crawler/LightningBolt.cpp index f32eef88..f1c39eb8 100644 --- a/Crawler/LightningBolt.cpp +++ b/Crawler/LightningBolt.cpp @@ -54,7 +54,7 @@ bool LightningBolt::MonsterHit(Monster& monster) if(&m==&monster||monster.OnUpperLevel()!=m.OnUpperLevel())continue; geom2d::linelineToTarget=geom2d::line(monster.GetPos(),m.GetPos()); float dist=lineToTarget.length(); - if(dist<="Wizard.Ability 2.LightningChainDistance"_F/100*12){ + if(dist<="Wizard.Ability 2.LightningChainRadius"_F/100*24){ if(m.Hurt(game->GetPlayer()->GetAttack()*"Wizard.Ability 2.LightningChainDamageMult"_F,OnUpperLevel())){ 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,AnimationState::LIGHTNING_SPLASH,upperLevel,monster.GetSizeMult(),"Wizard.Ability 2.LightningChainSplashFadeoutTime"_F,vf2d{},WHITE,"Wizard.Ability 2.LightningChainSplashRotationRange"_FRange)); diff --git a/Crawler/Meteor.cpp b/Crawler/Meteor.cpp index b7155251..b4da273c 100644 --- a/Crawler/Meteor.cpp +++ b/Crawler/Meteor.cpp @@ -14,18 +14,18 @@ Meteor::Meteor(vf2d pos, float lifetime, AnimationState animation, bool upperLev bool Meteor::Update(float fElapsedTime){ if(lifetime<=0&&!shakeField){ shakeField=true; - game->SetupWorldShake(2); - vf2d meteorOffset=pos+vf2d{lifetime,-lifetime}*320-vf2d{0,GetFrame().GetSourceRect().size.y/4.f}; - for(int i=0;i<650;i++){ - float randomAngle=util::random(2*PI); - float randomRange=100*size.x*(1-util::random(0.25))*(1-util::random(0.25)); - float randomColorTintG=256-(util::random(128)+util::random(128)); - float randomColorTint=util::random(128); + game->SetupWorldShake("Wizard.Ability 3.WorldShakeTime"_F); + vf2d meteorOffset=pos+vf2d{lifetime*"Wizard.Ability 3.MeteorXMovementMult"_I,lifetime*"Wizard.Ability 3.MeteorYMovementMult"_I}*"Wizard.Ability 3.MeteorStartingDist"_F-vf2d{0,"Wizard.Ability 3.MeteorRadius"_F/100*12}; + for(int i=0;i<"Wizard.Ability 3.MeteorImpactParticles"_I;i++){ + float randomAngle="Wizard.Ability 3.MeteorImpactParticleAngleRange"_FRange; + float randomRange=100*size.x*(1-util::random("Wizard.Ability 3.MeteorImpactParticleRandomVariance"_F))*(1-util::random("Wizard.Ability 3.MeteorImpactParticleRandomVariance"_F)); + float randomColorTintG=256*(1-util::random("Wizard.Ability 3.MeteorImpactParticleColorGVariance"_F))*(1-util::random("Wizard.Ability 3.MeteorImpactParticleColorGVariance"_F)); + float randomColorTintB="Wizard.Ability 3.MeteorImpactParticleColorBlueRange"_FRange; vf2d effectPos=vf2d{cos(randomAngle),sin(randomAngle)}*randomRange+meteorOffset; - game->AddEffect(std::make_unique(effectPos,0,AnimationState::DOT_PARTICLE,OnUpperLevel(),vf2d{util::random(2)+1,util::random(3)+1},util::random(3)+1,vf2d{util::random(10)-5,-util::random(20)-5},Pixel{255,uint8_t(randomColorTintG),uint8_t(randomColorTint),uint8_t(util::random(128)+128)},0,0,true),effectPos.yAddEffect(std::make_unique(effectPos,0,AnimationState::DOT_PARTICLE,OnUpperLevel(),vf2d{util::random(2)+1,util::random(3)+1},util::random(3)+1,vf2d{util::random(10)-5,-util::random(20)-5},Pixel{255,uint8_t(randomColorTintG),uint8_t(randomColorTintB),uint8_t("Wizard.Ability 3.MeteorImpactParticleAlphaRange"_FRange)},0,0,true),effectPos.yHurtEnemies(pos,4*24,game->GetPlayer()->GetAttack()*9,OnUpperLevel()); - game->AddEffect(std::make_unique(pos,3,AnimationState::FIRE_RING1,OnUpperLevel(),vf2d{8,8},1),true); + game->HurtEnemies(pos,"Wizard.Ability 3.MeteorRadius"_F/100*24,game->GetPlayer()->GetAttack()*"Wizard.Ability 3.MeteorDamageMult"_F,OnUpperLevel()); + game->AddEffect(std::make_unique(pos,"Wizard.Ability 3.FireRingLifetime"_F,AnimationState::FIRE_RING1,OnUpperLevel(),vf2d{"Wizard.Ability 3.MeteorRadius"_F/100*2,"Wizard.Ability 3.MeteorRadius"_F/100*2},"Wizard.Ability 3.FireRingFadeoutTime"_F),true); } return Effect::Update(fElapsedTime); } @@ -33,11 +33,11 @@ bool Meteor::Update(float fElapsedTime){ void Meteor::Draw(){ if(lifetime>0){ vf2d scale=vf2d{192,64}/3.f*(startLifetime+1-lifetime)*0.25*size; - vf2d meteorOffset=vf2d{lifetime,0}*120; + vf2d meteorOffset=vf2d{lifetime*"Wizard.Ability 3.MeteorXMovementMult"_I,0}*"Wizard.Ability 3.MeteorShadowStartingDist"_F; vf2d centerPoint=pos-vf2d{game->GFX_Circle.Sprite()->width*scale.x/2,game->GFX_Circle.Sprite()->height*scale.y/2}; game->view.DrawDecal(centerPoint+meteorOffset,game->GFX_Circle.Decal(),scale,{0,0,0,192}); } - vf2d meteorOffset=pos+vf2d{lifetime,-lifetime}*320-vf2d{0,GetFrame().GetSourceRect().size.y/4.f}*size; + vf2d meteorOffset=pos+vf2d{lifetime*"Wizard.Ability 3.MeteorXMovementMult"_I,lifetime*"Wizard.Ability 3.MeteorYMovementMult"_I}*"Wizard.Ability 3.MeteorStartingDist"_F-vf2d{0,GetFrame().GetSourceRect().size.y/4.f}*size; if(lifetime<=0){ meteorOffset=pos-vf2d{0,GetFrame().GetSourceRect().size.y/4.f}*size; } diff --git a/Crawler/PulsatingFire.cpp b/Crawler/PulsatingFire.cpp index 0e308ebf..f73da02f 100644 --- a/Crawler/PulsatingFire.cpp +++ b/Crawler/PulsatingFire.cpp @@ -18,19 +18,19 @@ bool PulsatingFire::Update(float fElapsedTime){ lastParticleTimer-=fElapsedTime; lastDamageTimer-=fElapsedTime; if(lastParticleTimer<=0){ - int particleCount=rand()%5+1; + int particleCount="Wizard.Ability 3.FireRingParticleSpawnAmtRange"_FRange; for(int i=0;iAddEffect(std::make_unique(pos+vf2d{cos(randomAngle),sin(randomAngle)}*randomRange,0,AnimationState::DOT_PARTICLE,OnUpperLevel(),vf2d{util::random(2)+1,1},util::random(4)+2,vf2d{util::random(10)-5,-util::random(15)-5},Pixel{128,uint8_t(randomColorTintG),uint8_t(randomColorTint),uint8_t(util::random(128)+128)})); + float randomAngle="Wizard.Ability 3.FireRingParticleAngleRange"_FRange; + float randomRange=12*size.x*(1-util::random("Wizard.Ability 3.FireRingParticleRandomVariance"_F))*(1-util::random("Wizard.Ability 3.FireRingParticleRandomVariance"_F)); + float randomColorTintG=128*(1-util::random("Wizard.Ability 3.FireRingParticleColorGVariance"_F))*(1-util::random("Wizard.Ability 3.FireRingParticleColorGVariance"_F)); + float randomColorTint="Wizard.Ability 3.FireRingParticleColorBlueRange"_FRange; + game->AddEffect(std::make_unique(pos+vf2d{cos(randomAngle),sin(randomAngle)}*randomRange,0,AnimationState::DOT_PARTICLE,OnUpperLevel(),vf2d{"Wizard.Ability 3.FireRingParticleXSizeRange"_FRange,"Wizard.Ability 3.FireRingParticleYSizeRange"_FRange},"Wizard.Ability 3.FireRingParticleFadeoutTimeRange"_FRange,vf2d{"Wizard.Ability 3.FireRingParticleXSpeedRange"_FRange,"Wizard.Ability 3.FireRingParticleYSpeedRange"_FRange},Pixel{128,uint8_t(randomColorTintG),uint8_t(randomColorTint),uint8_t("Wizard.Ability 3.FireRingParticleAlphaRange"_FRange)})); } - lastParticleTimer=util::random(0.2)+0.025; + lastParticleTimer="Wizard.Ability 3.FireRingParticleFreqRange"_FRange; } if(lastDamageTimer<=0){ - lastDamageTimer=0.99; - game->HurtEnemies(pos,4*24,game->GetPlayer()->GetAttack()*1,OnUpperLevel()); + lastDamageTimer="Wizard.Ability 3.FireRingDamageFreq"_F-0.01; + game->HurtEnemies(pos,"Wizard.Ability 3.MeteorRadius"_F/100*24,game->GetPlayer()->GetAttack()*"Wizard.Ability 3.FireRingDamageMult"_F,OnUpperLevel()); } return Effect::Update(fElapsedTime); } @@ -58,6 +58,6 @@ void PulsatingFire::Draw(){ effectSpr=&ANIMATION_DATA[AnimationState::FIRE_RING1]; } const Renderable*img=effectSpr->GetFrame(0).GetSourceImage(); - game->view.DrawPartialDecal(pos-effectSpr->GetFrame(0).GetSourceRect().size/2*size,img->Decal(),effectSpr->GetFrame(0).GetSourceRect().pos,effectSpr->GetFrame(0).GetSourceRect().size,size,{255,uint8_t(pulsatingFireValues[i]*256),0,uint8_t((63*(sin(3*lifetime+PI*pulsatingFireValues[i]))+64)*(fadeout/original_fadeoutTime))}); + game->view.DrawPartialDecal(pos-effectSpr->GetFrame(0).GetSourceRect().size/2*size,img->Decal(),effectSpr->GetFrame(0).GetSourceRect().pos,effectSpr->GetFrame(0).GetSourceRect().size,size,{255,uint8_t(pulsatingFireValues[i]*256),0,uint8_t((63*(sin("Wizard.Ability 3.FireRingOscillatingFrequency"_F*lifetime+PI*pulsatingFireValues[i]))+63)*(fadeout/original_fadeoutTime))}); } } \ No newline at end of file diff --git a/Crawler/Version.h b/Crawler/Version.h index 4e7a7c95..89359e43 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -2,7 +2,7 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 0 -#define VERSION_BUILD 920 +#define VERSION_BUILD 927 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Crawler/Wizard.cpp b/Crawler/Wizard.cpp index 2a543894..16f0e2d7 100644 --- a/Crawler/Wizard.cpp +++ b/Crawler/Wizard.cpp @@ -120,7 +120,7 @@ void Wizard::InitializeClassAbilities(){ Wizard::ability3.action= [](Player*p,vf2d pos={}){ p->CastSpell(Wizard::ability3); - game->AddEffect(std::make_unique(pos,3,AnimationState::METEOR,p->OnUpperLevel(),vf2d{1,1},2)); + game->AddEffect(std::make_unique(pos,3,AnimationState::METEOR,p->OnUpperLevel(),vf2d{"Wizard.Ability 3.MeteorRadius"_F/100/4,"Wizard.Ability 3.MeteorRadius"_F/100/4},"Wizard.Ability 3.MeteorFadeoutTime"_F)); return true; }; #pragma endregion diff --git a/Crawler/assets/config/classes/Wizard.txt b/Crawler/assets/config/classes/Wizard.txt index 34e7c777..d7c2840b 100644 --- a/Crawler/assets/config/classes/Wizard.txt +++ b/Crawler/assets/config/classes/Wizard.txt @@ -147,7 +147,7 @@ Wizard BulletFadeoutTime = 0.2 # How far away to look for nearby enemies to chain lightning to. - LightningChainDistance = 600 + LightningChainRadius = 300 # Damage multiplier for enemies hit by lightning chain. LightningChainDamageMult = 2 # How fast the chain lightning chases its target (Frequency updates in seconds). @@ -156,12 +156,12 @@ Wizard LightningChainSplashLifetime = 0.5 LightningChainSplashFadeoutTime = 0.25 - LightningChainSplashRotationRange = 0,3.14159 + LightningChainSplashRotationRange = 0,6.28318 # How long the splash effect lasts. SplashLifetime = 0.3 SplashFadeoutTime = 0.25 - SplashRotationRange = 0,3.14159 + SplashRotationRange = 0,6.28318 # How much time passes before another particle spawns from the bullet. ParticleFrequency = 0.01 @@ -186,5 +186,57 @@ Wizard Precast Time = 1.5 Casting Range = 900 Casting Size = 400 + + MeteorFadeoutTime = 2 + + MeteorRadius = 400 + MeteorDamageMult = 9 + FireRingDamageMult = 1 + # How often the fire ring deals damage to enemies inside of it. + FireRingDamageFreq = 1 + FireRingLifetime = 4 + + WorldShakeTime = 2 + + # -1 = Moving Right, 0 = Stationary, 1 = Moving Left + MeteorXMovementMult = 1 + # -1 = Moving Down, 0 = Stationary, 1 = Moving Up + MeteorYMovementMult = -1 + # How far away the meteor is from its final landing location. + MeteorStartingDist = 320 + # How far away the shadow is from its final landing location. + MeteorShadowStartingDist = 120 + + MeteorImpactParticles = 650 + + MeteorImpactParticleAngleRange = 0,6.28318 + + # How far the particles will stray from its outer edge. (1 = middle, 0 = outside) + MeteorImpactParticleRandomVariance = 0.25 + MeteorImpactParticleColorGVariance = 0.5 + # Red is always 255. Blue gets set using this range value. + MeteorImpactParticleColorBlueRange = 0,128 + MeteorImpactParticleAlphaRange = 128,25 + + FireRingOscillatingFrequency=3 + + FireRingParticleSpawnAmtRange = 1,5 + FireRingParticleFreqRange = 0.025,0.225 + + FireRingFadeoutTime = 1 + + FireRingParticleAngleRange = 0,6.28318 + + # How far the particles will stray from its outer edge. (1 = middle, 0 = outside) + FireRingParticleRandomVariance = 0.25 + FireRingParticleColorGVariance = 0.5 + # Red is always 128. Blue gets set using this range value. + FireRingParticleColorBlueRange = 0,16 + FireRingParticleAlphaRange = 128,255 + FireRingParticleXSizeRange = 1,3 + FireRingParticleYSizeRange = 1,1 + FireRingParticleFadeoutTimeRange = 2,6 + FireRingParticleXSpeedRange = -5,5 + FireRingParticleYSpeedRange = -20,-5 } } \ No newline at end of file