Adjust all spaces to tabs for consistent whitespace formatting on source files. Implement Throw Poison Ability. Added general Color Mod Buff so coloring targets a certain color based on applied buff is simpler. Release Build 10389.
This commit is contained in:
parent
f27caf4382
commit
a5f7973c4d
@ -985,6 +985,10 @@
|
||||
</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Pixel.cpp" />
|
||||
<ClCompile Include="PoisonBottle.cpp">
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PurpleEnergyBall.cpp">
|
||||
<SubType>
|
||||
</SubType>
|
||||
|
@ -1151,6 +1151,9 @@
|
||||
<ClCompile Include="PurpleEnergyBall.cpp">
|
||||
<Filter>Source Files\Bullet Types</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PoisonBottle.cpp">
|
||||
<Filter>Source Files\Bullet Types</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="cpp.hint" />
|
||||
|
@ -56,6 +56,7 @@ enum BuffType{
|
||||
ONE_OFF,
|
||||
OVER_TIME_DURING_CAST,
|
||||
GLOW_PURPLE,
|
||||
COLOR_MOD,
|
||||
};
|
||||
enum class BuffRestorationType{
|
||||
ONE_OFF,
|
||||
|
@ -330,3 +330,18 @@ private:
|
||||
const float homingRadius;
|
||||
std::optional<std::weak_ptr<Monster>>homingTarget;
|
||||
};
|
||||
|
||||
struct PoisonBottle:public Bullet{
|
||||
PoisonBottle(vf2d pos,vf2d targetPos,float explodeRadius,float z,float totalFallTime,float totalRiseZAmt,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});
|
||||
void Update(float fElapsedTime)override;
|
||||
void ModifyOutgoingDamageData(HurtDamageInfo&data);
|
||||
private:
|
||||
const vf2d targetPos;
|
||||
const vf2d startingPos;
|
||||
const float totalFallTime;
|
||||
const float originalRisingTime,originalFallingTime;
|
||||
float risingTime,fallingTime;
|
||||
const float initialZ;
|
||||
const float totalRiseZAmt;
|
||||
const float explodeRadius;
|
||||
};
|
@ -442,7 +442,8 @@ void Monster::Draw()const{
|
||||
|
||||
if(GetBuffs(BuffType::GLOW_PURPLE).size()>0)glowPurpleBuff=GetBuffs(BuffType::GLOW_PURPLE)[0];
|
||||
|
||||
if(GetBuffs(BuffType::SLOWDOWN).size()>0)blendCol=Pixel{uint8_t(255*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration))),uint8_t(255*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration))),uint8_t(128+127*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration)))};
|
||||
if(GetBuffs(BuffType::COLOR_MOD).size()>0)blendCol=Pixel{uint8_t(PixelRaw(GetBuffs(BuffType::COLOR_MOD)[0].intensity).r*abs(sin(1.4*GetBuffs(BuffType::COLOR_MOD)[0].duration))),uint8_t(PixelRaw(GetBuffs(BuffType::COLOR_MOD)[0].intensity).g*abs(sin(1.4*GetBuffs(BuffType::COLOR_MOD)[0].duration))),uint8_t(PixelRaw(GetBuffs(BuffType::COLOR_MOD)[0].intensity).b*abs(sin(1.4*GetBuffs(BuffType::COLOR_MOD)[0].duration)))};
|
||||
else if(GetBuffs(BuffType::SLOWDOWN).size()>0)blendCol=Pixel{uint8_t(255*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration))),uint8_t(255*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration))),uint8_t(128+127*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration)))};
|
||||
else if(glowPurpleBuff.has_value())blendCol=Pixel{uint8_t(255*abs(sin(1.4*glowPurpleBuff.value().get().duration))),uint8_t(255*abs(sin(1.4*glowPurpleBuff.value().get().duration))),uint8_t(128+127*abs(sin(1.4*glowPurpleBuff.value().get().duration)))};
|
||||
|
||||
const vf2d hitTimerOffset=vf2d{sin(20*PI*lastHitTimer+randomFrameOffset),0.f}*2.f*GetSizeMult();
|
||||
|
@ -536,7 +536,7 @@ void Player::Update(float fElapsedTime){
|
||||
SetZ(0.f);
|
||||
break;
|
||||
}
|
||||
SetZ((sin((1.f/totalLeapTime)*PI*leapTimer)/2.f+0.5f)*"Witch.Right Click Ability.Leap Max Z"_F);
|
||||
SetZ((sin((1.f/totalLeapTime)*PI*leapTimer)/2.f)*"Witch.Right Click Ability.Leap Max Z"_F);
|
||||
SetVelocity(vf2d{"Witch.Right Click Ability.Leap Velocity"_F/100.f*24,transformTargetDir}.cart());
|
||||
animation.UpdateState(internal_animState,fElapsedTime);
|
||||
}break;
|
||||
|
93
Adventures in Lestoria/PoisonBottle.cpp
Normal file
93
Adventures in Lestoria/PoisonBottle.cpp
Normal file
@ -0,0 +1,93 @@
|
||||
#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 <ranges>
|
||||
#include "util.h"
|
||||
|
||||
INCLUDE_game
|
||||
|
||||
PoisonBottle::PoisonBottle(vf2d pos,vf2d targetPos,float explodeRadius,float z,float totalFallTime,float totalRiseZAmt,int damage,bool upperLevel,bool hitsMultiple,float lifetime,bool friendly,Pixel col,vf2d scale,float image_angle)
|
||||
:Bullet(pos,util::pointTo(pos,targetPos)*util::distance(pos,targetPos)/totalFallTime,0.f,damage,"poison_bottle.png",upperLevel,hitsMultiple,lifetime,false,friendly,col,scale,image_angle),initialZ(z),explodeRadius(explodeRadius),totalRiseZAmt(totalRiseZAmt),totalFallTime(totalFallTime),startingPos(pos),targetPos(targetPos),originalRisingTime(totalFallTime*0.25f),risingTime(originalRisingTime),originalFallingTime(totalFallTime*0.75f),fallingTime(originalFallingTime){
|
||||
this->z=z;
|
||||
}
|
||||
|
||||
void PoisonBottle::Update(float fElapsedTime){
|
||||
if(IsDeactivated())return;
|
||||
image_angle+=0.5*PI*fElapsedTime;
|
||||
|
||||
const bool Landed{fallingTime<=0.f};
|
||||
if(Landed){
|
||||
z=0.f;
|
||||
const float poisonCircleScale{"Witch.Ability 2.Casting Size"_F/100.f};
|
||||
game->AddEffect(std::make_unique<Effect>(pos,0.f,"poison_pool.png",game->GetPlayer()->OnUpperLevel(),0.5f,1.2f,vf2d{poisonCircleScale,poisonCircleScale},vf2d{},WHITE,0.f,0.f,false),true);
|
||||
for(int i:std::ranges::iota_view(0,200)){
|
||||
float size{util::random_range(0.4f,0.8f)};
|
||||
Pixel col{PixelLerp(VERY_DARK_GREEN,DARK_GREEN,util::random(1))};
|
||||
col.a=util::random_range(60,200);
|
||||
game->AddEffect(std::make_unique<Effect>(pos+vf2d{util::random(16)*poisonCircleScale,util::random(2*PI)}.cart(),util::random_range(1.f,4.f),"circle.png",game->GetPlayer()->OnUpperLevel(),vf2d{size,size},util::random_range(0.2f,0.5f),vf2d{util::random_range(-6.f,6.f),util::random_range(-12.f,-4.f)},col));
|
||||
}
|
||||
const HurtList hurtList{game->Hurt(pos,explodeRadius,damage,OnUpperLevel(),z,HurtType::MONSTER,HurtFlag::PLAYER_ABILITY)};
|
||||
for(const auto&[targetPtr,wasHit]:hurtList){
|
||||
if(wasHit){
|
||||
Monster*monsterPtr{std::get<Monster*>(targetPtr)};
|
||||
const int buffDamage{int(game->GetPlayer()->GetAttack()*"Witch.Ability 2.Poison Debuff"_f[0])};
|
||||
const float buffDuration{"Witch.Ability 2.Poison Debuff"_f[2]};
|
||||
const float buffTimeBetweenTicks{"Witch.Ability 2.Poison Debuff"_f[1]};
|
||||
monsterPtr->AddBuff(BuffType::COLOR_MOD,buffDuration,Pixel{GREEN}.n);
|
||||
monsterPtr->ApplyDot(buffDuration,buffDamage,buffTimeBetweenTicks);
|
||||
}
|
||||
}
|
||||
vel={};
|
||||
fadeOutTime=0.25f;
|
||||
Deactivate();
|
||||
}else{
|
||||
if(risingTime>0.f){
|
||||
risingTime-=fElapsedTime;
|
||||
z=util::lerp(initialZ,initialZ+totalRiseZAmt,1-(risingTime/originalRisingTime));
|
||||
}else{
|
||||
fallingTime-=fElapsedTime;
|
||||
z=util::lerp(initialZ+totalRiseZAmt,0.f,1-(fallingTime/originalFallingTime));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PoisonBottle::ModifyOutgoingDamageData(HurtDamageInfo&data){
|
||||
if(friendly)data.hurtFlags|=HurtFlag::PLAYER_ABILITY;
|
||||
}
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 3
|
||||
#define VERSION_BUILD 10363
|
||||
#define VERSION_BUILD 10389
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
@ -154,10 +154,13 @@ void Witch::InitializeClassAbilities(){
|
||||
}else return false;
|
||||
};
|
||||
#pragma endregion
|
||||
#pragma region Witch Ability 2 (???)
|
||||
#pragma region Witch Ability 2 (Throw Poison)
|
||||
Witch::ability2.action=
|
||||
[](Player*p,vf2d pos={}){
|
||||
return false;
|
||||
const float totalFallTime{util::lerp(0.f,0.3f,util::distance(p->GetPos(),pos)/("Witch.Ability 2.Casting Range"_F/100.f*24))};
|
||||
|
||||
CreateBullet(PoisonBottle)(p->GetPos(),pos,"Witch.Ability 2.Casting Size"_F/100.f*24,12.f,totalFallTime,"Witch.Ability 2.Toss Max Z"_F,p->GetAttack()*"Witch.Ability 2.Damage Mult"_F,p->OnUpperLevel(),false,INFINITE,true,WHITE,vf2d{1.f,1.f},util::random(2*PI))EndBullet;
|
||||
return true;
|
||||
};
|
||||
#pragma endregion
|
||||
#pragma region Witch Ability 3 (???)
|
||||
|
@ -86,14 +86,18 @@ Witch
|
||||
Short Name = POISON
|
||||
Description = Throw a poison bottle at target location. All targets caught in the range take poison damage over time.
|
||||
Icon = throw_poison.png
|
||||
Cooldown = 16
|
||||
Mana Cost = 40
|
||||
Cooldown = 1
|
||||
Mana Cost = 0
|
||||
# Whether or not this ability cancels casts.
|
||||
CancelCast = 0
|
||||
|
||||
Damage Mult = 5x
|
||||
# Damage per tick, time between ticks, total debuff time
|
||||
Poison Debuff = 0.5x, 3s, 30s
|
||||
|
||||
Toss Max Range Time = 0.5s
|
||||
Toss Max Z = 12px
|
||||
|
||||
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
|
||||
Cooldown Bar Color 1 = 64, 0, 0, 192
|
||||
Cooldown Bar Color 2 = 128, 0, 0, 192
|
||||
|
@ -115,6 +115,8 @@ Images
|
||||
GFX_ExplosiveTrap = explosive_trap.png
|
||||
GFX_Explosion = explosionframes.png
|
||||
GFX_PurpleEnergyBallHit = purpleenergyball_hit.png
|
||||
GFX_PoisonPool = poison_pool.png
|
||||
GFX_PoisonBottle = poison_bottle.png
|
||||
|
||||
GFX_Thief_Sheet = nico-thief.png
|
||||
GFX_Trapper_Sheet = nico-trapper.png
|
||||
|
Binary file not shown.
BIN
Adventures in Lestoria/assets/poison_bottle.png
Normal file
BIN
Adventures in Lestoria/assets/poison_bottle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 777 B |
BIN
Adventures in Lestoria/assets/poison_pool.png
Normal file
BIN
Adventures in Lestoria/assets/poison_pool.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 752 B |
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user