Changed child class from Effect to new IEffect class. Remove child IEffect class from variant structure. Resolves Issue #133. Release Build 13940.
This commit is contained in:
parent
05d797a785
commit
c9fc060197
@ -400,10 +400,6 @@
|
||||
</SubType>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BlizzardSnowEmitter.h" />
|
||||
<ClInclude Include="BombBoom.h">
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Buff.h" />
|
||||
<ClInclude Include="Bullet.h">
|
||||
<SubType>
|
||||
@ -842,6 +838,10 @@
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BombBoom.cpp">
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BreakingPillar.cpp">
|
||||
<SubType>
|
||||
</SubType>
|
||||
|
||||
@ -654,9 +654,6 @@
|
||||
<ClInclude Include="MonsterData.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BombBoom.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Direction.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -729,9 +726,6 @@
|
||||
<ClInclude Include="TileGroup.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Effect.h">
|
||||
<Filter>Source Files\Effects</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="catch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -756,6 +750,9 @@
|
||||
<ClInclude Include="MenuFragmentItemButton.h">
|
||||
<Filter>Header Files\Interface</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Effect.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Player.cpp">
|
||||
@ -1442,6 +1439,9 @@
|
||||
<ClCompile Include="GraphicsManager.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BombBoom.cpp">
|
||||
<Filter>Source Files\Effects</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="cpp.hint" />
|
||||
|
||||
@ -1435,7 +1435,7 @@ void AiL::RenderWorld(float fElapsedTime){
|
||||
{
|
||||
auto it=backgroundEffectsLower.begin();
|
||||
while(it!=backgroundEffectsLower.end()){
|
||||
const Effect&e=EFF((*it).get());
|
||||
const IEffect&e=EFF((*it).get());
|
||||
e._Draw();
|
||||
++it;
|
||||
}
|
||||
@ -1730,7 +1730,7 @@ void AiL::RenderWorld(float fElapsedTime){
|
||||
{
|
||||
auto it=backgroundEffectsUpper.begin();
|
||||
while(it!=backgroundEffectsUpper.end()){
|
||||
const Effect&e=EFF((*it).get());
|
||||
const IEffect&e=EFF((*it).get());
|
||||
e._Draw();
|
||||
++it;
|
||||
}
|
||||
|
||||
@ -48,8 +48,7 @@ INCLUDE_game
|
||||
|
||||
Arrow::Arrow(vf2d pos,vf2d targetPos,vf2d vel,float radius,int damage,bool upperLevel,FriendlyType friendly,Pixel col)
|
||||
:finalDistance(geom2d::line(pos,targetPos).length()*1.2f),acc(PI/2*250),targetPos(targetPos),
|
||||
Bullet(pos,vel,radius,damage,
|
||||
"assets/arrow.png",upperLevel,false,INFINITE,true,friendly,col){}
|
||||
Bullet(pos,vel,radius,damage,"assets/arrow.png",upperLevel,false,INFINITE,true,friendly,col){}
|
||||
|
||||
Arrow::Arrow(vf2d pos,vf2d targetPos,vf2d vel,const std::string_view gfx,float radius,int damage,bool upperLevel,FriendlyType friendly,Pixel col)
|
||||
:finalDistance(geom2d::line(pos,targetPos).length()*1.2f),acc(PI/2*250),targetPos(targetPos),
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
INCLUDE_MONSTER_LIST
|
||||
|
||||
BlackHole::BlackHole(Oscillator<vf2d>pos,const std::string&img,float lifetime,bool onUpperLevel,Oscillator<vf2d>size,vf2d spd,Oscillator<Pixel>col,float rotation,float rotationSpd,bool additiveBlending,float particleSpawnFreq,const std::function<Effect(const Effect&self)>&particleGenerator)
|
||||
BlackHole::BlackHole(Oscillator<vf2d>pos,const std::string&img,float lifetime,bool onUpperLevel,Oscillator<vf2d>size,vf2d spd,Oscillator<Pixel>col,float rotation,float rotationSpd,bool additiveBlending,float particleSpawnFreq,const std::function<Effect(const IEffect&self)>&particleGenerator)
|
||||
:FadeInOutEffect(pos,img,lifetime,onUpperLevel,size,spd,col,rotation,rotationSpd,additiveBlending,particleSpawnFreq,particleGenerator){}
|
||||
|
||||
bool BlackHole::Update(float fElapsedTime){
|
||||
|
||||
@ -44,12 +44,12 @@ All rights reserved.
|
||||
INCLUDE_game
|
||||
|
||||
Blizzard::Blizzard(const vf2d pos,const float radius, const float lifetime,const int damage,const float tickRate,const std::pair<MinScale,MaxScale>snowSizeRange,const float emitterFreq,const bool upperLevel,const FriendlyType friendly)
|
||||
:damage(damage),tickRate(tickRate),tickTimer(tickRate),radius(radius),friendly(friendly),blizzardSFX("Blizzard",pos),Effect(pos,lifetime,"assets/aiming_target.png",upperLevel,(radius*2)*vf2d{1.f,1.f}/24.f,0.5f,{},{199,247,239,128},0.f,0.f,true)
|
||||
:damage(damage),tickRate(tickRate),tickTimer(tickRate),radius(radius),friendly(friendly),blizzardSFX("Blizzard",pos),IEffect(pos,lifetime,"assets/aiming_target.png",upperLevel,(radius*2)*vf2d{1.f,1.f}/24.f,0.5f,{},{199,247,239,128},0.f,0.f,true)
|
||||
,snow(std::make_unique<BlizzardSnowEmitter>(pos,"assets/circle.png",radius*1.25f,snowSizeRange,emitterFreq,lifetime,upperLevel)){
|
||||
for(int i:std::ranges::iota_view(0,200))snow->Emit();
|
||||
}
|
||||
Blizzard&Blizzard::operator=(const Blizzard&newEff){
|
||||
Effect::operator=(newEff);
|
||||
IEffect::operator=(newEff);
|
||||
this->damage=newEff.damage;
|
||||
this->tickRate=newEff.tickRate;
|
||||
this->tickTimer=newEff.tickTimer;
|
||||
@ -60,7 +60,7 @@ Blizzard&Blizzard::operator=(const Blizzard&newEff){
|
||||
return *this;
|
||||
}
|
||||
Blizzard&Blizzard::operator=(Blizzard&&newEff){
|
||||
Effect::operator=(newEff);
|
||||
IEffect::operator=(newEff);
|
||||
this->damage=newEff.damage;
|
||||
this->tickRate=newEff.tickRate;
|
||||
this->tickTimer=newEff.tickTimer;
|
||||
@ -71,11 +71,11 @@ Blizzard&Blizzard::operator=(Blizzard&&newEff){
|
||||
return *this;
|
||||
}
|
||||
Blizzard::Blizzard(const Blizzard&newEff)
|
||||
:Effect(dynamic_cast<Effect&>(const_cast<Blizzard&>(newEff))){
|
||||
:IEffect(dynamic_cast<Effect&>(const_cast<Blizzard&>(newEff))){
|
||||
*this=newEff;
|
||||
}
|
||||
Blizzard::Blizzard(Blizzard&&newEff)
|
||||
:Effect(dynamic_cast<Effect&>(const_cast<Blizzard&>(newEff))){
|
||||
:IEffect(dynamic_cast<Effect&>(const_cast<Blizzard&>(newEff))){
|
||||
*this=newEff;
|
||||
}
|
||||
bool Blizzard::Update(float fElapsedTime){
|
||||
@ -90,5 +90,5 @@ bool Blizzard::Update(float fElapsedTime){
|
||||
}
|
||||
}
|
||||
snow->Update(fElapsedTime);
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
@ -39,7 +39,6 @@ All rights reserved.
|
||||
#include "BulletTypes.h"
|
||||
#include "util.h"
|
||||
#include "AdventuresInLestoria.h"
|
||||
#include "BombBoom.h"
|
||||
#include "SoundEffect.h"
|
||||
|
||||
INCLUDE_DATA
|
||||
@ -66,7 +65,6 @@ void Bomb::Update(float fElapsedTime){
|
||||
if(fadeOutTime==0.f){
|
||||
z=0; //Force the bomb to be grounded.
|
||||
fadeOutTime=bombFadeoutTime;
|
||||
game->AddEffect(BombBoom{pos,0.f,OnUpperLevel(),vf2d{explosionRadius,explosionRadius}/12.f/1.5f/*Upscale 24x24 to 36x36*/,1.f,vf2d{},WHITE,0.f,0.f,true});
|
||||
SoundEffect::PlaySFX("Bomb Explode",pos);
|
||||
float distToPlayer=geom2d::line<float>(pos,game->GetPlayer()->GetPos()).length();
|
||||
if(friendly){
|
||||
|
||||
@ -35,18 +35,11 @@ Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
|
||||
All rights reserved.
|
||||
*/
|
||||
#pragma endregion
|
||||
#include "Effect.h"
|
||||
#include "DEFINES.h"
|
||||
#include "safemap.h"
|
||||
#include "EffectTypes.h"
|
||||
|
||||
BombBoom::BombBoom(vf2d pos,float lifetime,bool upperLevel,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:IEffect(pos,lifetime,"assets/bomb_boom.png",upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
|
||||
|
||||
class BombBoom:public Effect{
|
||||
public:
|
||||
inline BombBoom(vf2d pos,float lifetime,bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false)
|
||||
:Effect(pos,lifetime,"assets/bomb_boom.png",upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
|
||||
inline bool Update(float fElapsedTime)override{
|
||||
return Effect::Update(fElapsedTime);
|
||||
}
|
||||
};
|
||||
bool BombBoom::Update(float fElapsedTime){
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
@ -43,14 +43,14 @@ All rights reserved.
|
||||
|
||||
INCLUDE_game
|
||||
CollectCoinEffect::CollectCoinEffect(const Entity attachedTarget,float coinArcRiseZAmt,float lifetime,const std::string&imgFile,bool upperLevel,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(attachedTarget.GetPos(),lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending),attachedTarget(attachedTarget),sizeFlipper(-1.f,1.f,lifetime*2.f),zRiser(0.f,coinArcRiseZAmt,1/lifetime){
|
||||
:IEffect(attachedTarget.GetPos(),lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending),attachedTarget(attachedTarget),sizeFlipper(-1.f,1.f,lifetime*2.f),zRiser(0.f,coinArcRiseZAmt,1/lifetime){
|
||||
}
|
||||
bool CollectCoinEffect::Update(float fElapsedTime){
|
||||
zRiser.Update(fElapsedTime);
|
||||
pos=attachedTarget.GetPos()-vf2d{0,zRiser.get()}; //A hack, instead of using the built-in z (which would display a shadow, we instead manipulate the final position based on the zRiser output).
|
||||
size.x=sizeFlipper.Update(fElapsedTime);
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
void CollectCoinEffect::Draw(const Pixel blendCol)const{
|
||||
Effect::Draw(blendCol);
|
||||
IEffect::Draw(blendCol);
|
||||
}
|
||||
@ -46,24 +46,40 @@ INCLUDE_game
|
||||
|
||||
//Note: The fadeout time activates when the original lifetime of the bullet expires! It doesn't begin immediately.
|
||||
Effect::Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(pos,lifetime,imgFile,upperLevel,0.f,fadeout,vf2d{size,size},spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,0.f,fadeout,vf2d{size,size},spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
|
||||
//Note: The fadeout time activates when the original lifetime of the bullet expires! It doesn't begin immediately.
|
||||
Effect::Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(pos,lifetime,imgFile,upperLevel,0.f,fadeout,size,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,0.f,fadeout,size,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
|
||||
//Note: The fadeout time activates when the original lifetime of the bullet expires! It doesn't begin immediately.
|
||||
Effect::Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float fadein,float fadeout,vf2d size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(pos,lifetime,imgFile,upperLevel,fadein,fadeout,size,spd,EffectType::NONE,col,rotation,rotationSpd,additiveBlending){}
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,fadein,fadeout,size,spd,EffectType::NONE,col,rotation,rotationSpd,additiveBlending){}
|
||||
|
||||
//Note: The fadeout time activates when the original lifetime of the bullet expires! It doesn't begin immediately.
|
||||
Effect::Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float fadein,float fadeout,vf2d size,vf2d spd,EffectType type,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:pos(pos),lifetime(lifetime),upperLevel(upperLevel),size(size),fadein(fadein),original_fadeInTime(fadein),fadeout(fadeout),original_fadeOutTime(fadeout),spd(spd),col(col),rotation(rotation),rotationSpd(rotationSpd),additiveBlending(additiveBlending),type(type){
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,fadein,fadeout,size,spd,type,col,rotation,rotationSpd,additiveBlending){}
|
||||
|
||||
IEffect::IEffect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,0.f,fadeout,vf2d{size,size},spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
IEffect::IEffect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,0.f,fadeout,size,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
IEffect::IEffect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float fadein,float fadeout,vf2d size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,fadein,fadeout,size,spd,EffectType::NONE,col,rotation,rotationSpd,additiveBlending){}
|
||||
IEffect::IEffect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float fadein,float fadeout,vf2d size,vf2d spd,EffectType type,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:pos(pos),lifetime(lifetime),upperLevel(upperLevel),size(size),fadein(fadein),original_fadeInTime(fadein),fadeout(fadeout),original_fadeOutTime(fadeout),spd(spd),col(col),rotation(rotation),rotationSpd(rotationSpd),additiveBlending(additiveBlending),type(type){
|
||||
this->animation.AddState(imgFile,ANIMATION_DATA.at(imgFile));
|
||||
this->animation.ChangeState(internal_animState,imgFile);
|
||||
}
|
||||
|
||||
bool Effect::Update(float fElapsedTime){
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
|
||||
void Effect::Draw(const Pixel blendCol)const{
|
||||
IEffect::Draw(blendCol);
|
||||
}
|
||||
bool IEffect::Update(float fElapsedTime){
|
||||
aliveTime+=fElapsedTime;
|
||||
if(fadein<original_fadeInTime){
|
||||
fadein=std::min(original_fadeInTime,fadein+fElapsedTime);
|
||||
@ -83,7 +99,7 @@ bool Effect::Update(float fElapsedTime){
|
||||
return true;
|
||||
}
|
||||
|
||||
void Effect::_Draw()const{
|
||||
void IEffect::_Draw()const{
|
||||
if(additiveBlending)game->SetDecalMode(DecalMode::ADDITIVE);
|
||||
const bool FadeInFinished{original_fadeInTime==0||fadein==original_fadeInTime};
|
||||
const bool HasFadeout{fadeout>0};
|
||||
@ -105,7 +121,7 @@ void Effect::_Draw()const{
|
||||
game->SetDecalMode(DecalMode::NORMAL);
|
||||
}
|
||||
|
||||
void Effect::Draw(const Pixel blendCol)const{
|
||||
void IEffect::Draw(const Pixel blendCol)const{
|
||||
if(GetZ()>0){
|
||||
vf2d shadowScale=vf2d{8*size.x/3.f,1}/std::max(1.f,GetZ()/24);
|
||||
game->view.DrawDecal(pos-vf2d{3,3}*shadowScale/2+vf2d{0,6*size.x},GFX["assets/circle.png"].Decal(),shadowScale,BLACK);
|
||||
@ -115,31 +131,31 @@ void Effect::Draw(const Pixel blendCol)const{
|
||||
//game->view.DrawRectDecal(pos,GetFrame().GetSourceRect().size);
|
||||
}
|
||||
|
||||
Animate2D::Frame Effect::GetFrame()const{
|
||||
Animate2D::Frame IEffect::GetFrame()const{
|
||||
return animation.GetFrame(internal_animState);
|
||||
}
|
||||
|
||||
bool Effect::OnUpperLevel(){
|
||||
bool IEffect::OnUpperLevel(){
|
||||
return upperLevel;
|
||||
}
|
||||
|
||||
const EffectType Effect::GetType()const{
|
||||
const EffectType IEffect::GetType()const{
|
||||
return type;
|
||||
}
|
||||
|
||||
const float Effect::GetZ()const{
|
||||
const float IEffect::GetZ()const{
|
||||
return z;
|
||||
}
|
||||
|
||||
void Effect::SetType(const EffectType type){
|
||||
void IEffect::SetType(const EffectType type){
|
||||
this->type=type;
|
||||
}
|
||||
|
||||
const bool&Effect::OnUpperLevel()const{
|
||||
const bool&IEffect::OnUpperLevel()const{
|
||||
return upperLevel;
|
||||
}
|
||||
|
||||
const bool Effect::IsDead()const{
|
||||
const bool IEffect::IsDead()const{
|
||||
return lifetime<=0.f;
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
using EffectT=std::variant<
|
||||
Effect,
|
||||
Meteor,
|
||||
PulsatingFire,
|
||||
PulsatingFire,
|
||||
SwordSlash,
|
||||
ForegroundEffect,
|
||||
SpellCircle,
|
||||
@ -25,7 +25,8 @@ using EffectT=std::variant<
|
||||
ExpandingRing,
|
||||
FallEffect,
|
||||
FallWShadowEffect,
|
||||
GroundSlamEffect
|
||||
GroundSlamEffect,
|
||||
BombBoom
|
||||
>;
|
||||
|
||||
struct EffectOverloads{
|
||||
@ -50,13 +51,13 @@ struct EffectManager{
|
||||
static size_t GetBackgroundEffectCount();
|
||||
struct funcName_Overloads {
|
||||
template<typename T>
|
||||
const Effect& operator()(T&obj) {
|
||||
const IEffect& operator()(T&obj) {
|
||||
return obj;
|
||||
};
|
||||
};
|
||||
template<typename T>
|
||||
static Effect& GetEffect(T& eff) {
|
||||
return const_cast<Effect&>(std::visit(funcName_Overloads{},eff));
|
||||
static IEffect& GetEffect(T& eff) {
|
||||
return const_cast<IEffect&>(std::visit(funcName_Overloads{},eff));
|
||||
};
|
||||
private:
|
||||
inline static int GLOBAL_EFFECT_ID{0};
|
||||
|
||||
@ -58,9 +58,14 @@ enum class EffectType{
|
||||
BLIZZARD_SNOW,
|
||||
};
|
||||
|
||||
struct Effect{
|
||||
struct IEffect{
|
||||
friend class AiL;
|
||||
friend struct FallingBullet;
|
||||
public:
|
||||
IEffect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float size=1.0f,float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
IEffect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
IEffect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float fadein,float fadeout,vf2d size,vf2d spd,Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
IEffect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float fadein,float fadeout,vf2d size,vf2d spd,EffectType type,Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
vf2d pos={0,0};
|
||||
float lifetime=0;
|
||||
float fadeout=0;
|
||||
@ -73,15 +78,10 @@ struct Effect{
|
||||
vf2d scaleSpd{};
|
||||
bool additiveBlending=false;
|
||||
float z{};
|
||||
public:
|
||||
Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float size=1.0f,float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float fadein,float fadeout,vf2d size,vf2d spd,Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float fadein,float fadeout,vf2d size,vf2d spd,EffectType type,Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
virtual bool Update(float fElapsedTime);
|
||||
virtual void Draw(const Pixel blendCol)const;
|
||||
Animate2D::Frame GetFrame()const;
|
||||
void _Draw()const;
|
||||
virtual void Draw(const Pixel blendCol)const;
|
||||
bool OnUpperLevel();
|
||||
const EffectType GetType()const;
|
||||
const float GetZ()const;
|
||||
@ -104,10 +104,19 @@ public:
|
||||
double aliveTime{};
|
||||
};
|
||||
|
||||
struct Effect:IEffect{
|
||||
Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float size=1.0f,float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float fadein,float fadeout,vf2d size,vf2d spd,Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
Effect(vf2d pos,float lifetime,const std::string&imgFile,bool upperLevel,float fadein,float fadeout,vf2d size,vf2d spd,EffectType type,Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
virtual bool Update(float fElapsedTime)override final;
|
||||
virtual void Draw(const Pixel blendCol)const override final;
|
||||
};
|
||||
|
||||
using MeteorDamage=int;
|
||||
using PulsatingFireDamage=int;
|
||||
|
||||
struct Meteor:Effect{
|
||||
struct Meteor:IEffect{
|
||||
enum MeteorSetting{
|
||||
METEOR,
|
||||
COMET,
|
||||
@ -134,7 +143,7 @@ private:
|
||||
mutableconst MeteorSetting setting;
|
||||
};
|
||||
|
||||
struct PulsatingFire:Effect{
|
||||
struct PulsatingFire:IEffect{
|
||||
enum PulsatingFireSetting{
|
||||
PLAYER,
|
||||
SKELETON_MAGE,
|
||||
@ -150,7 +159,7 @@ struct PulsatingFire:Effect{
|
||||
void Draw(const Pixel blendCol)const override; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
};
|
||||
|
||||
struct SwordSlash:Effect{
|
||||
struct SwordSlash:IEffect{
|
||||
SwordSlash(float lifetime,std::string imgFile,float damageMult, float swordSweepAngle,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
bool Update(float fElapsedTime)override; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
private:
|
||||
@ -160,13 +169,13 @@ private:
|
||||
};
|
||||
|
||||
//This draws effects using screen coordinates instead of world coordinates, useful for applying effects directly on the screen.
|
||||
struct ForegroundEffect:Effect{
|
||||
struct ForegroundEffect:IEffect{
|
||||
ForegroundEffect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,float size=1.0f,float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
ForegroundEffect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
virtual void Draw(const Pixel blendCol)const override final; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
};
|
||||
|
||||
struct SpellCircle:Effect{
|
||||
struct SpellCircle:IEffect{
|
||||
SpellCircle(vf2d pos,float lifetime,std::string imgFile,std::string spellInsigniaFile,bool upperLevel,float size=1.0f,float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false,float insigniaSize=1.0f,float insigniaFadeout=0.0f,vf2d insigniaSpd={},Pixel insigniaCol=WHITE,float insigniaRotation=0,float insigniaRotationSpd=0,bool insigniaAdditiveBlending=false);
|
||||
SpellCircle(vf2d pos,float lifetime,std::string imgFile,std::string spellInsigniaFile,bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false,vf2d insigniaSize={1,1},float insigniaFadeout=0.0f,vf2d insigniaSpd={},Pixel insigniaCol=WHITE,float insigniaRotation=0,float insigniaRotationSpd=0,bool insigniaAdditiveBlending=false);
|
||||
Effect spellInsignia{vf2d{},0.f,"assets/spell_insignia.png",false,{}};
|
||||
@ -174,7 +183,7 @@ struct SpellCircle:Effect{
|
||||
virtual void Draw(const Pixel blendCol)const override final; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
};
|
||||
|
||||
struct RockLaunch:Effect{
|
||||
struct RockLaunch:IEffect{
|
||||
//The lifetime is for how long the effect lasts after it's launched. You don't have to calculate extra lifetime to compensate for the delayTime, it is done for you.
|
||||
RockLaunch(vf2d pos,float lifetime,std::string imgFile,float delayTime,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending=false);
|
||||
virtual bool Update(float fElapsedTime)override final; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
@ -183,7 +192,7 @@ private:
|
||||
vf2d futureSpd;
|
||||
};
|
||||
|
||||
struct ShineEffect:Effect{
|
||||
struct ShineEffect:IEffect{
|
||||
//An effect that starts invisible, becomes visible, then fades out again.
|
||||
ShineEffect(vf2d pos,float fadeinTime,float fadeoutTime,std::string imgFile,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending=false);
|
||||
virtual bool Update(float fElapsedTime)override final; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
@ -193,7 +202,7 @@ private:
|
||||
};
|
||||
|
||||
//Spawns and moves towards the player after some amount of time.
|
||||
struct MonsterSoul:Effect{
|
||||
struct MonsterSoul:IEffect{
|
||||
MonsterSoul(vf2d pos,float fadeoutTime,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending=false);
|
||||
virtual bool Update(float fElapsedTime)override final; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
virtual void Draw(const Pixel blendCol)const override final; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
@ -209,14 +218,14 @@ public:
|
||||
float fadeoutTime;
|
||||
};
|
||||
|
||||
struct FadeInOutEffect:Effect{
|
||||
struct FadeInOutEffect:IEffect{
|
||||
//cycleSpd is how long it takes to get from fully opaque to fully transparent, and back to fully opaque
|
||||
FadeInOutEffect(vf2d pos,const std::string&img,float lifetime,float cycleSpd,bool onUpperLevel,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending=false,float particleSpawnFreq=0.f,const std::function<Effect(const Effect&self)>&particleGenerator={});
|
||||
FadeInOutEffect(vf2d pos,const std::string&img,float lifetime,float cycleSpd,bool onUpperLevel,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending=false,float particleSpawnFreq=0.f,const std::function<Effect(const IEffect&self)>&particleGenerator={});
|
||||
//A version with oscillators for position and colors, for extra animation effects!
|
||||
FadeInOutEffect(Oscillator<vf2d>pos,const std::string&img,float lifetime,bool onUpperLevel,Oscillator<vf2d>size,vf2d spd,Oscillator<Pixel>col,float rotation,float rotationSpd,bool additiveBlending=false,float particleSpawnFreq=0.f,const std::function<Effect(const Effect&self)>&particleGenerator={});
|
||||
FadeInOutEffect(Oscillator<vf2d>pos,const std::string&img,float lifetime,bool onUpperLevel,Oscillator<vf2d>size,vf2d spd,Oscillator<Pixel>col,float rotation,float rotationSpd,bool additiveBlending=false,float particleSpawnFreq=0.f,const std::function<Effect(const IEffect&self)>&particleGenerator={});
|
||||
virtual bool Update(float fElapsedTime)override; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
virtual void Draw(const Pixel blendCol)const override; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
std::function<Effect(const Effect&self)>particleGenerator;
|
||||
std::function<Effect(const IEffect&self)>particleGenerator;
|
||||
mutableconst float particleSpawnFreq;
|
||||
Oscillator<vf2d>posOscillator;
|
||||
Oscillator<vf2d>sizeOscillator;
|
||||
@ -226,7 +235,7 @@ struct FadeInOutEffect:Effect{
|
||||
};
|
||||
|
||||
struct LingeringEffect:FadeInOutEffect{
|
||||
LingeringEffect(vf2d pos,const std::string&img,const std::string&soundEffect,float radius,int damage,float damageFreq,const HurtType friendly,float lifetime,float cycleSpd,bool onUpperLevel,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending=false,float particleSpawnFreq=0.f,const std::function<Effect(const Effect&self)>&particleGenerator={});
|
||||
LingeringEffect(vf2d pos,const std::string&img,const std::string&soundEffect,float radius,int damage,float damageFreq,const HurtType friendly,float lifetime,float cycleSpd,bool onUpperLevel,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending=false,float particleSpawnFreq=0.f,const std::function<Effect(const IEffect&self)>&particleGenerator={});
|
||||
virtual bool Update(float fElapsedTime)override final; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
mutableconst int damage;
|
||||
float damageTimer{};
|
||||
@ -236,7 +245,7 @@ struct LingeringEffect:FadeInOutEffect{
|
||||
mutableconst size_t sfxID{};
|
||||
};
|
||||
|
||||
struct Ink:Effect{
|
||||
struct Ink:IEffect{
|
||||
//NOTE: The way ink works is that every update frame, each ink stack will check for distance to player, and if the player collides with the radius of the ink it will add one to the ink debuff for the player.
|
||||
// At the end of AdventuresInLestoria::HandleUserInput(), the ink stack counter is reset after handling user input for moving the player.
|
||||
Ink(vf2d pos,float radius,float lifetime,float inkSlowdownDuration,float inkSlowdownPct,float fadeinTime,float fadeoutTime,vf2d size,Pixel col,bool onUpperLevel,float rotation);
|
||||
@ -247,7 +256,7 @@ private:
|
||||
mutableconst float inkSlowdownAmount;
|
||||
};
|
||||
|
||||
struct FlipCoinEffect:Effect{
|
||||
struct FlipCoinEffect:IEffect{
|
||||
//cycleSpd is how long it takes to get from fully opaque to fully transparent, and back to fully opaque
|
||||
FlipCoinEffect(Oscillator<vf2d>startEndPos,float coinArcRiseZAmt,float lifetime,const std::string&imgFile,bool upperLevel,float size=1.0f,float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
virtual bool Update(float fElapsedTime)override; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
@ -257,7 +266,7 @@ struct FlipCoinEffect:Effect{
|
||||
Oscillator<float>zRiser;
|
||||
};
|
||||
|
||||
struct CollectCoinEffect:Effect{
|
||||
struct CollectCoinEffect:IEffect{
|
||||
//cycleSpd is how long it takes to get from fully opaque to fully transparent, and back to fully opaque
|
||||
CollectCoinEffect(const Entity attachedTarget,float coinArcRiseZAmt,float lifetime,const std::string&imgFile,bool upperLevel,float size=1.0f,float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
virtual bool Update(float fElapsedTime)override; //NOTE: In most cases, call Effect::Update() in your overwritten function!
|
||||
@ -267,7 +276,7 @@ struct CollectCoinEffect:Effect{
|
||||
Oscillator<float>zRiser;
|
||||
};
|
||||
|
||||
struct Blizzard:Effect{
|
||||
struct Blizzard:IEffect{
|
||||
public:
|
||||
Blizzard(const vf2d pos,const float radius,const float lifetime,const int damage,const float tickRate,const std::pair<MinScale,MaxScale>snowSizeRange,const float emitterFreq,const bool upperLevel,const FriendlyType friendly);
|
||||
Blizzard(const Blizzard&newEff);
|
||||
@ -285,7 +294,7 @@ private:
|
||||
EnvironmentalAudio blizzardSFX;
|
||||
};
|
||||
|
||||
struct FreezeGround:Effect{
|
||||
struct FreezeGround:IEffect{
|
||||
struct FreezeGroundSettings{
|
||||
float radius;
|
||||
float slowdownPerStack;
|
||||
@ -308,7 +317,7 @@ private:
|
||||
mutableconst FreezeGroundSettings settings;
|
||||
};
|
||||
|
||||
struct TrailEffect:Effect{
|
||||
struct TrailEffect:IEffect{
|
||||
TrailEffect(vf2d startPos,float lifetime,const std::string&imgFile,int damage,float damageTickFrequency,bool upperLevel,float fadeout,vf2d scale,float imgXOffsetSpd,Oscillator<Pixel>col,EffectType type=EffectType::NONE,bool additiveBlending=false);
|
||||
void SetEndPos(const vf2d pos);
|
||||
bool Update(float fElapsedTime);
|
||||
@ -324,19 +333,19 @@ private:
|
||||
};
|
||||
|
||||
struct BlackHole:FadeInOutEffect{
|
||||
BlackHole(Oscillator<vf2d>pos,const std::string&img,float lifetime,bool onUpperLevel,Oscillator<vf2d>size,vf2d spd,Oscillator<Pixel>col,float rotation,float rotationSpd,bool additiveBlending=false,float particleSpawnFreq=0.f,const std::function<Effect(const Effect&self)>&particleGenerator={});
|
||||
BlackHole(Oscillator<vf2d>pos,const std::string&img,float lifetime,bool onUpperLevel,Oscillator<vf2d>size,vf2d spd,Oscillator<Pixel>col,float rotation,float rotationSpd,bool additiveBlending=false,float particleSpawnFreq=0.f,const std::function<Effect(const IEffect&self)>&particleGenerator={});
|
||||
bool Update(float fElapsedTime);
|
||||
};
|
||||
|
||||
|
||||
struct ExpandingRing:Effect{
|
||||
struct ExpandingRing:IEffect{
|
||||
ExpandingRing(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,vf2d expandingSize,vf2d size={1.f,1.f},float fadeout=0.f,vf2d spd={},Pixel col=WHITE,float rotation=0.f,float rotationSpd=0.f,bool additiveBlending=false);
|
||||
bool Update(float fElapsedTime);
|
||||
private:
|
||||
mutableconst vf2d expandingSize;
|
||||
};
|
||||
|
||||
class FallEffect:public Effect{
|
||||
class FallEffect:public IEffect{
|
||||
public:
|
||||
FallEffect(vf2d pos, float lifetime,const std::string&imgFile, bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
bool Update(float fElapsedTime)override;
|
||||
@ -344,7 +353,7 @@ private:
|
||||
mutableconst float gravity{20};
|
||||
};
|
||||
|
||||
class FallWShadowEffect:public Effect{
|
||||
class FallWShadowEffect:public IEffect{
|
||||
public:
|
||||
FallWShadowEffect(vf2d pos,const float z,const float gravity,const std::string&imgFile, bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false,const EffectType type=EffectType::NONE);
|
||||
bool Update(float fElapsedTime)override;
|
||||
@ -352,7 +361,7 @@ private:
|
||||
mutableconst float gravity;
|
||||
};
|
||||
|
||||
class GroundSlamEffect:public Effect{
|
||||
class GroundSlamEffect:public IEffect{
|
||||
public:
|
||||
struct GroundSlamSettings{
|
||||
float range;
|
||||
@ -371,4 +380,10 @@ private:
|
||||
|
||||
mutableconst GroundSlamSettings settings;
|
||||
|
||||
};
|
||||
|
||||
class BombBoom:public IEffect{
|
||||
public:
|
||||
BombBoom(vf2d pos,float lifetime,bool upperLevel,vf2d size={1,1},float fadeout=0.0f,vf2d spd={},Pixel col=WHITE,float rotation=0,float rotationSpd=0,bool additiveBlending=false);
|
||||
bool Update(float fElapsedTime)override;
|
||||
};
|
||||
@ -37,10 +37,10 @@ All rights reserved.
|
||||
#pragma endregion
|
||||
#pragma once
|
||||
|
||||
#include "EffectTypes.h"
|
||||
#include "Effect.h"
|
||||
|
||||
ExpandingRing::ExpandingRing(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,vf2d expandingSize,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:expandingSize(expandingSize),Effect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
:expandingSize(expandingSize),IEffect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
bool ExpandingRing::Update(float fElapsedTime){
|
||||
size+=expandingSize*fElapsedTime;
|
||||
return true;
|
||||
|
||||
@ -43,10 +43,10 @@ All rights reserved.
|
||||
|
||||
INCLUDE_game
|
||||
|
||||
FadeInOutEffect::FadeInOutEffect(vf2d pos,const std::string&img,float lifetime,float cycleSpd,bool onUpperLevel,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending,float particleSpawnFreq,const std::function<Effect(const Effect&self)>&particleGenerator)
|
||||
FadeInOutEffect::FadeInOutEffect(vf2d pos,const std::string&img,float lifetime,float cycleSpd,bool onUpperLevel,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending,float particleSpawnFreq,const std::function<Effect(const IEffect&self)>&particleGenerator)
|
||||
:FadeInOutEffect({pos,pos,cycleSpd},img,lifetime,onUpperLevel,{{size,size},{size,size},cycleSpd},spd,{col,{col.r,col.g,col.b,0},cycleSpd},rotation,rotationSpd,additiveBlending,particleSpawnFreq,particleGenerator){}
|
||||
FadeInOutEffect::FadeInOutEffect(Oscillator<vf2d>pos,const std::string&img,float lifetime,bool onUpperLevel,Oscillator<vf2d>size,vf2d spd,Oscillator<Pixel>col,float rotation,float rotationSpd,bool additiveBlending,float particleSpawnFreq,const std::function<Effect(const Effect&self)>&particleGenerator)
|
||||
:particleSpawnFreq(particleSpawnFreq),particleGenerator(particleGenerator),particleSpawnTimer(particleSpawnFreq),originalParticleSpawnTimer(particleSpawnTimer),posOscillator(pos),colOscillator(col),sizeOscillator(size),Effect(pos.first,lifetime,img,onUpperLevel,size.first,0.25f,spd,col.first,rotation,rotationSpd,additiveBlending){}
|
||||
FadeInOutEffect::FadeInOutEffect(Oscillator<vf2d>pos,const std::string&img,float lifetime,bool onUpperLevel,Oscillator<vf2d>size,vf2d spd,Oscillator<Pixel>col,float rotation,float rotationSpd,bool additiveBlending,float particleSpawnFreq,const std::function<Effect(const IEffect&self)>&particleGenerator)
|
||||
:particleSpawnFreq(particleSpawnFreq),particleGenerator(particleGenerator),particleSpawnTimer(particleSpawnFreq),originalParticleSpawnTimer(particleSpawnTimer),posOscillator(pos),colOscillator(col),sizeOscillator(size),IEffect(pos.first,lifetime,img,onUpperLevel,size.first,0.25f,spd,col.first,rotation,rotationSpd,additiveBlending){}
|
||||
bool FadeInOutEffect::Update(float fElapsedTime){
|
||||
if(particleGenerator){
|
||||
particleSpawnTimer-=fElapsedTime;
|
||||
@ -58,8 +58,8 @@ bool FadeInOutEffect::Update(float fElapsedTime){
|
||||
pos=posOscillator.Update(fElapsedTime);
|
||||
size=sizeOscillator.Update(fElapsedTime);
|
||||
col=colOscillator.Update(fElapsedTime);
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
void FadeInOutEffect::Draw(const Pixel blendCol)const{
|
||||
Effect::Draw(blendCol);
|
||||
IEffect::Draw(blendCol);
|
||||
}
|
||||
@ -38,15 +38,15 @@ All rights reserved.
|
||||
#include "EffectTypes.h"
|
||||
|
||||
FallEffect::FallEffect(vf2d pos, float lifetime,const std::string&imgFile, bool upperLevel,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
|
||||
bool FallEffect::Update(float fElapsedTime){
|
||||
spd.y+=gravity*fElapsedTime;
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
|
||||
FallWShadowEffect::FallWShadowEffect(vf2d pos,const float z,const float gravity,const std::string&imgFile, bool upperLevel,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending,const EffectType type)
|
||||
:gravity(gravity),Effect(pos,INFINITY,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){
|
||||
:gravity(gravity),IEffect(pos,INFINITY,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){
|
||||
this->z=z;
|
||||
this->SetType(type);
|
||||
}
|
||||
@ -54,5 +54,5 @@ FallWShadowEffect::FallWShadowEffect(vf2d pos,const float z,const float gravity,
|
||||
bool FallWShadowEffect::Update(float fElapsedTime){
|
||||
z-=gravity*fElapsedTime;
|
||||
if(z<=0.f)lifetime=0.f;
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
@ -44,15 +44,15 @@ All rights reserved.
|
||||
INCLUDE_game
|
||||
|
||||
FlipCoinEffect::FlipCoinEffect(Oscillator<vf2d>startEndPos,float coinArcRiseZAmt,float lifetime,const std::string&imgFile,bool upperLevel,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(startEndPos.first,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending),startEndPos(startEndPos),sizeFlipper(-1.f,1.f,lifetime*2.f),zRiser(0.f,coinArcRiseZAmt,1/lifetime){
|
||||
:IEffect(startEndPos.first,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending),startEndPos(startEndPos),sizeFlipper(-1.f,1.f,lifetime*2.f),zRiser(0.f,coinArcRiseZAmt,1/lifetime){
|
||||
}
|
||||
bool FlipCoinEffect::Update(float fElapsedTime){
|
||||
zRiser.Update(fElapsedTime);
|
||||
pos=startEndPos.Update(fElapsedTime);
|
||||
size.y=sizeFlipper.Update(fElapsedTime);
|
||||
z=zRiser.get();
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
void FlipCoinEffect::Draw(const Pixel blendCol)const{
|
||||
Effect::Draw(blendCol);
|
||||
IEffect::Draw(blendCol);
|
||||
}
|
||||
@ -44,9 +44,9 @@ All rights reserved.
|
||||
INCLUDE_game
|
||||
|
||||
ForegroundEffect::ForegroundEffect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
ForegroundEffect::ForegroundEffect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
void ForegroundEffect::Draw(const Pixel blendCol)const{
|
||||
game->DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage().Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,blendCol);
|
||||
}
|
||||
@ -7,7 +7,7 @@ INCLUDE_game
|
||||
|
||||
|
||||
FreezeGround::FreezeGround(const vf2d pos,const float lifetime,const int damage,const FreezeGroundSettings settings,const bool upperLevel,const FriendlyType friendly)
|
||||
:damage(damage),friendly(friendly),settings(settings),Effect(pos,lifetime,"assets/freezeground.png",upperLevel,settings.radius/100.f/(GFX_FORCE["assets/freezeground.png"].Sprite()->Size().x/24.f)*2.35f,0.5f,{},{199,247,239,32},0.f,0.f,true)
|
||||
:damage(damage),friendly(friendly),settings(settings),IEffect(pos,lifetime,"assets/freezeground.png",upperLevel,settings.radius/100.f/(GFX_FORCE["assets/freezeground.png"].Sprite()->Size().x/24.f)*2.35f,0.5f,{},{199,247,239,32},0.f,0.f,true)
|
||||
{
|
||||
SoundEffect::PlaySFX("Freezing Ice",pos);
|
||||
|
||||
@ -52,5 +52,5 @@ bool FreezeGround::Update(float fElapsedTime){
|
||||
tickTimer-=settings.slowdownFrequency;
|
||||
}
|
||||
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ All rights reserved.
|
||||
INCLUDE_game
|
||||
|
||||
GroundSlamEffect::GroundSlamEffect(vf2d pos,const float z,const float lifetime,GroundSlamSettings settings,bool upperLevel,float fadeout,Pixel col,bool additiveBlending)
|
||||
:settings(settings),Effect(pos,lifetime,"assets/ground-slam-attack-front.png",upperLevel,settings.visualRadius,fadeout,{},col,0.f,0.f,additiveBlending){
|
||||
:settings(settings),IEffect(pos,lifetime,"assets/ground-slam-attack-front.png",upperLevel,settings.visualRadius,fadeout,{},col,0.f,0.f,additiveBlending){
|
||||
game->AddEffect(Effect{pos,lifetime,"assets/ground-slam-attack-back.png",upperLevel,settings.visualRadius,fadeout,{},col,0.f,0.f,additiveBlending},true);
|
||||
|
||||
#pragma region Knockback effect
|
||||
@ -69,5 +69,5 @@ GroundSlamEffect::GroundSlamEffect(vf2d pos,const float z,const float lifetime,G
|
||||
SoundEffect::PlaySFX(settings.soundEffectName,pos);
|
||||
}
|
||||
bool GroundSlamEffect::Update(float fElapsedTime){
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
@ -41,12 +41,12 @@ All rights reserved.
|
||||
INCLUDE_game
|
||||
|
||||
Ink::Ink(vf2d pos,float radius,float lifetime,float inkSlowdownDuration,float inkSlowdownPct,float fadeinTime,float fadeoutTime,vf2d size,Pixel col,bool onUpperLevel,float rotation)
|
||||
:Effect(pos,lifetime,"assets/ink.png",onUpperLevel,fadeinTime,fadeoutTime,size,{},EffectType::NONE,col,rotation,0.f,false),radius(radius),inkSlowdownDuration(inkSlowdownDuration),inkSlowdownAmount(inkSlowdownPct){}
|
||||
:IEffect(pos,lifetime,"assets/ink.png",onUpperLevel,fadeinTime,fadeoutTime,size,{},EffectType::NONE,col,rotation,0.f,false),radius(radius),inkSlowdownDuration(inkSlowdownDuration),inkSlowdownAmount(inkSlowdownPct){}
|
||||
bool Ink::Update(float fElapsedTime){
|
||||
const float distToPlayer{util::distance(game->GetPlayer()->GetPos(),pos)};
|
||||
if(distToPlayer<=radius){
|
||||
Buff¤tInkSlowdown{game->GetPlayer()->GetOrAddBuff(BuffType::INK_SLOWDOWN,{inkSlowdownDuration,inkSlowdownAmount})};
|
||||
currentInkSlowdown.lifetime=inkSlowdownDuration; //Reset the duration if needed.
|
||||
}
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
@ -88,7 +88,7 @@ void ItemInfo::InitializeScripts(){
|
||||
if(props.GetFloat("Linger Time")>0.f){
|
||||
const int damage{props.GetInt("Tick Base Damage")+int(props.GetFloat("Tick Player Damage Mult")*game->GetPlayer()->GetAttack())};
|
||||
lingeringEffect.emplace(vf2d{},props.GetString("Lingering Effect"),props.GetString("Lingering Sound"),props.GetFloat("Linger Radius")/100.f*24,damage,props.GetFloat("Tick Rate"),HurtType::MONSTER,props.GetFloat("Linger Time"),5.f,game->GetPlayer()->OnUpperLevel(),1.f,vf2d{},DARK_RED,util::random(2*PI),0.f,false,0.2f,
|
||||
[](const Effect&self){
|
||||
[](const IEffect&self){
|
||||
return Effect{self.pos,0.5f,"assets/fire_ring.png",self.OnUpperLevel(),util::random_range(0.7f,1.f),0.1f,{},PixelLerp(Pixel(0xF7B752),Pixel(0xE74F30),util::random(1.f)),util::random(2*PI),0.f,true};
|
||||
});
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ INCLUDE_MONSTER_LIST
|
||||
|
||||
|
||||
Meteor::Meteor(const vf2d pos,const float lifetime,const bool upperLevel,const MeteorSetting setting,const std::pair<MeteorDamage,PulsatingFireDamage>damage,const float fadeout,const vf2d spd,const Pixel col,const float rotation,const float rotationSpd,const bool additiveBlending)
|
||||
:setting(setting),damage(damage),Effect(pos,lifetime,setting==COMET?"assets/comet.png":setting==COMET_FLARE?"assets/comet_flare.png":"assets/meteor.png",upperLevel,{},fadeout,spd,col,rotation,rotationSpd,additiveBlending),startLifetime(lifetime){
|
||||
:setting(setting),damage(damage),IEffect(pos,lifetime,setting==COMET?"assets/comet.png":setting==COMET_FLARE?"assets/comet_flare.png":"assets/meteor.png",upperLevel,{},fadeout,spd,col,rotation,rotationSpd,additiveBlending),startLifetime(lifetime){
|
||||
switch(setting){
|
||||
case METEOR:{
|
||||
meteorImpactParticles="Wizard.Ability 3.MeteorImpactParticles"_I;
|
||||
@ -143,7 +143,7 @@ bool Meteor::Update(float fElapsedTime){
|
||||
#undef PLAYER_CASES
|
||||
SoundEffect::PlaySFX(meteorCrashSFX,pos);
|
||||
}
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
|
||||
void Meteor::Draw(const Pixel blendCol)const{
|
||||
|
||||
@ -45,11 +45,11 @@ INCLUDE_game
|
||||
|
||||
|
||||
MonsterSoul::MonsterSoul(vf2d pos,float fadeoutTime,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(pos,INFINITE,"assets/monstersoul.png",OnUpperLevel(),size,fadeoutTime,spd,col,rotation,rotationSpd,additiveBlending),fadeoutTime(fadeoutTime){
|
||||
:IEffect(pos,INFINITE,"assets/monstersoul.png",OnUpperLevel(),size,fadeoutTime,spd,col,rotation,rotationSpd,additiveBlending),fadeoutTime(fadeoutTime){
|
||||
type=EffectType::MONSTER_SOUL;
|
||||
}
|
||||
bool MonsterSoul::Update(float fElapsedTime){
|
||||
bool updateResult{Effect::Update(fElapsedTime)};
|
||||
bool updateResult{IEffect::Update(fElapsedTime)};
|
||||
switch(phase){
|
||||
case RISING:{
|
||||
if(GetZ()<10.f){
|
||||
@ -88,5 +88,5 @@ void MonsterSoul::Draw(const Pixel blendCol)const{
|
||||
game->SetDecalMode(DecalMode::ADDITIVE);
|
||||
game->view.DrawRotatedDecal(pos-vf2d{0,GetZ()},GFX["assets/monstersoulglow.png"].Decal(),0.f,GFX["assets/monstersoulglow.png"].Sprite()->Size()/2,size*util::lerp(0.6f,1.4f,abs(sin(2*PI*lifetime))));
|
||||
game->SetDecalMode(DecalMode::NORMAL);
|
||||
Effect::Draw(blendCol);
|
||||
IEffect::Draw(blendCol);
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ void PoisonBottle::OnGroundLand(){
|
||||
game->AddEffect(Effect{pos+vf2d{util::random(16)*poisonCircleScale,util::random(2*PI)}.cart(),util::random_range(1.f,4.f),"assets/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});
|
||||
}
|
||||
if(additionalBounceCount==0&&game->GetPlayer()->HasEnchant("Pooling Poison")){
|
||||
game->AddEffect(LingeringEffect{pos,"assets/poison_pool.png","Poison Pool",bounceExplodeRadius,int(game->GetPlayer()->GetAttack()*"Pooling Poison"_ENC["POISON POOL DAMAGE PCT"]/100.f),"Pooling Poison"_ENC["POISON POOL DAMAGE FREQUENCY"],friendly?HurtType::MONSTER:HurtType::PLAYER,"Pooling Poison"_ENC["SPLASH LINGER TIME"],0.5f,OnUpperLevel(),poisonCircleScale,vf2d{},WHITE,0.f,0.f,false,0.05f,[pos=pos,col=col,poisonCircleScale](const Effect&self){
|
||||
game->AddEffect(LingeringEffect{pos,"assets/poison_pool.png","Poison Pool",bounceExplodeRadius,int(game->GetPlayer()->GetAttack()*"Pooling Poison"_ENC["POISON POOL DAMAGE PCT"]/100.f),"Pooling Poison"_ENC["POISON POOL DAMAGE FREQUENCY"],friendly?HurtType::MONSTER:HurtType::PLAYER,"Pooling Poison"_ENC["SPLASH LINGER TIME"],0.5f,OnUpperLevel(),poisonCircleScale,vf2d{},WHITE,0.f,0.f,false,0.05f,[pos=pos,col=col,poisonCircleScale](const IEffect&self){
|
||||
float size{util::random_range(0.4f,0.8f)};
|
||||
return Effect{pos+vf2d{util::random(16)*poisonCircleScale,util::random(2*PI)}.cart(),util::random_range(1.f,4.f),"assets/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};
|
||||
}},true);
|
||||
|
||||
@ -42,7 +42,7 @@ All rights reserved.
|
||||
|
||||
INCLUDE_game
|
||||
|
||||
LingeringEffect::LingeringEffect(vf2d pos,const std::string&img,const std::string&soundEffect,float radius,int damage,float damageFreq,const HurtType friendly,float lifetime,float cycleSpd,bool onUpperLevel,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending,float particleSpawnFreq,const std::function<Effect(const Effect&self)>&particleGenerator)
|
||||
LingeringEffect::LingeringEffect(vf2d pos,const std::string&img,const std::string&soundEffect,float radius,int damage,float damageFreq,const HurtType friendly,float lifetime,float cycleSpd,bool onUpperLevel,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending,float particleSpawnFreq,const std::function<Effect(const IEffect&self)>&particleGenerator)
|
||||
:damage(damage),damageTimer(damageFreq),originalDamageTimer(damageTimer),radius(radius),friendly(friendly),sfxID(SoundEffect::PlayLoopingSFX(soundEffect,pos)),FadeInOutEffect(pos,img,lifetime,cycleSpd,onUpperLevel,size,spd,col,rotation,rotationSpd,additiveBlending,particleSpawnFreq,particleGenerator){}
|
||||
|
||||
bool LingeringEffect::Update(float fElapsedTime){
|
||||
|
||||
@ -47,7 +47,7 @@ INCLUDE_ANIMATION_DATA
|
||||
INCLUDE_MONSTER_LIST
|
||||
|
||||
PulsatingFire::PulsatingFire(vf2d pos,float lifetime,const float radius,std::string animation,bool upperLevel,int damage,const PulsatingFireSetting setting,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:setting(setting),radius(radius),damage(damage),Effect(pos,lifetime,animation,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){
|
||||
:setting(setting),radius(radius),damage(damage),IEffect(pos,lifetime,animation,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){
|
||||
for(int i=0;i<8;i++){
|
||||
pulsatingFireValues.push_back(util::random(1));
|
||||
}
|
||||
@ -81,7 +81,7 @@ bool PulsatingFire::Update(float fElapsedTime){
|
||||
}break;
|
||||
}
|
||||
}
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
|
||||
void PulsatingFire::Draw(const Pixel blendCol)const{
|
||||
|
||||
@ -39,9 +39,9 @@ All rights reserved.
|
||||
#include "Effect.h"
|
||||
|
||||
RockLaunch::RockLaunch(vf2d pos,float lifetime,std::string imgFile,float delayTime,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:Effect(pos,lifetime+delayTime,imgFile,false,size,fadeout,{},col,rotation,rotationSpd,additiveBlending),delayTime(delayTime),futureSpd(spd){}
|
||||
:IEffect(pos,lifetime+delayTime,imgFile,false,size,fadeout,{},col,rotation,rotationSpd,additiveBlending),delayTime(delayTime),futureSpd(spd){}
|
||||
bool RockLaunch::Update(float fElapsedTime){
|
||||
delayTime-=fElapsedTime;
|
||||
if(delayTime<=0.f)spd=futureSpd;
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
};
|
||||
@ -40,10 +40,10 @@ All rights reserved.
|
||||
#include "util.h"
|
||||
|
||||
ShineEffect::ShineEffect(vf2d pos,float fadeinTime,float fadeoutTime,std::string imgFile,float size,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending)
|
||||
:fadeinTime(fadeinTime),originalCol(col),Effect(pos,fadeinTime,imgFile,false,size,fadeoutTime,spd,col,rotation,rotationSpd,additiveBlending){
|
||||
:fadeinTime(fadeinTime),originalCol(col),IEffect(pos,fadeinTime,imgFile,false,size,fadeoutTime,spd,col,rotation,rotationSpd,additiveBlending){
|
||||
col.a=0; //Starts invisible.
|
||||
}
|
||||
bool ShineEffect::Update(float fElapsedTime){
|
||||
col.a=util::lerp(0.f,1.f,lifetime/fadeinTime)*originalCol.a;
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
@ -38,7 +38,7 @@ All rights reserved.
|
||||
|
||||
#include "Effect.h"
|
||||
SpellCircle::SpellCircle(vf2d pos,float lifetime,std::string imgFile,std::string spellInsigniaFile,bool upperLevel,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending,vf2d insigniaSize,float insigniaFadeout,vf2d insigniaSpd,Pixel insigniaCol,float insigniaRotation,float insigniaRotationSpd,bool insigniaAdditiveBlending)
|
||||
:Effect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){
|
||||
:IEffect(pos,lifetime,imgFile,upperLevel,size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){
|
||||
type=EffectType::SPELL_CIRCLE;
|
||||
spellInsignia=Effect{pos,lifetime,spellInsigniaFile,upperLevel,insigniaSize,insigniaFadeout,insigniaSpd,insigniaCol,insigniaRotation,insigniaRotationSpd,insigniaAdditiveBlending};
|
||||
}
|
||||
@ -46,11 +46,11 @@ SpellCircle::SpellCircle(vf2d pos,float lifetime,std::string imgFile,std::string
|
||||
:SpellCircle(pos,lifetime,imgFile,spellInsigniaFile,upperLevel,vf2d{size,size},fadeout,spd,col,rotation,rotationSpd,additiveBlending,vf2d{insigniaSize,insigniaSize},insigniaFadeout,insigniaSpd,insigniaCol,insigniaRotation,insigniaRotationSpd,insigniaAdditiveBlending){}
|
||||
|
||||
void SpellCircle::Draw(const Pixel blendCol)const{
|
||||
Effect::Draw(blendCol);
|
||||
IEffect::Draw(blendCol);
|
||||
spellInsignia._Draw();
|
||||
}
|
||||
|
||||
bool SpellCircle::Update(float fElapsedTime){
|
||||
spellInsignia.Update(fElapsedTime);
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
@ -42,7 +42,7 @@ All rights reserved.
|
||||
INCLUDE_game
|
||||
|
||||
SwordSlash::SwordSlash(float lifetime, std::string imgFile,float damageMult, float swordSweepAngle,vf2d size, float fadeout, vf2d spd, Pixel col, float rotation, float rotationSpd, bool additiveBlending)
|
||||
:damageMult(damageMult),swordSweepAngle(swordSweepAngle),Effect(game->GetPlayer()->GetPos(),lifetime,imgFile,game->GetPlayer()->OnUpperLevel(),size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
:damageMult(damageMult),swordSweepAngle(swordSweepAngle),IEffect(game->GetPlayer()->GetPos(),lifetime,imgFile,game->GetPlayer()->OnUpperLevel(),size,fadeout,spd,col,rotation,rotationSpd,additiveBlending){}
|
||||
|
||||
bool SwordSlash::Update(float fElapsedTime){
|
||||
if(lifetime>0){
|
||||
@ -50,5 +50,5 @@ bool SwordSlash::Update(float fElapsedTime){
|
||||
}
|
||||
pos=game->GetPlayer()->GetPos();
|
||||
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
@ -184,9 +184,9 @@ void Thief::InitializeClassAbilities(){
|
||||
#pragma region Thief Ability 2 (Deadly Dash)
|
||||
Thief::ability2.action=
|
||||
[](Entity e,vf2d pos={}){Player*p=e.ToPlayer(); //TODO
|
||||
game->AddEffect(ShineEffect{p->GetPos()+vf2d{4.f,4.f},0.5f,0.5f,"assets/shine.png",1.5f,vf2d{},WHITE,util::random(2*PI),PI/2,true});
|
||||
p->ApplyIframes("Thief.Ability 2.Initial Wait"_F+"Thief.Ability 2.Ending Wait"_F+"Thief.Ability 2.Completed Dash Extra Iframe Time"_F);
|
||||
SoundEffect::PlaySFX("Charge Up",p->GetPos());
|
||||
game->AddEffect(ShineEffect{e.GetPos()+vf2d{4.f,4.f},0.5f,0.5f,"assets/shine.png",1.5f,vf2d{},WHITE,util::random(2*PI),PI/2,true});
|
||||
e.ApplyIframes(CONFIG_F("Thief.Ability 2.Initial Wait")+CONFIG_F("Thief.Ability 2.Ending Wait")+CONFIG_F("Thief.Ability 2.Completed Dash Extra Iframe Time"));
|
||||
SoundEffect::PlaySFX("Charge Up",e.GetPos());
|
||||
p->SetState(State::DEADLYDASH);
|
||||
p->deadlyDashWaitTimer="Thief.Ability 2.Initial Wait"_F;
|
||||
p->deadlyDashAfterDashTimer=p->deadlyDashWaitTimer+"Thief.Ability 2.Ending Wait"_F;
|
||||
|
||||
@ -44,7 +44,7 @@ INCLUDE_game
|
||||
INCLUDE_MONSTER_LIST
|
||||
|
||||
TrailEffect::TrailEffect(vf2d startPos,float lifetime,const std::string&imgFile,int damage,float damageTickFrequency,bool upperLevel,float fadeout,vf2d scale,float imgXOffsetSpd,Oscillator<Pixel>col,EffectType type,bool additiveBlending)
|
||||
:endPos(startPos),imageXSpd(imgXOffsetSpd),damage(damage),col(col),damageTickFrequency(damageTickFrequency),Effect(startPos,lifetime,imgFile,upperLevel,0.f,fadeout,scale,{},type,WHITE,0.f,0.f,additiveBlending){}
|
||||
:endPos(startPos),imageXSpd(imgXOffsetSpd),damage(damage),col(col),damageTickFrequency(damageTickFrequency),IEffect(startPos,lifetime,imgFile,upperLevel,0.f,fadeout,scale,{},type,WHITE,0.f,0.f,additiveBlending){}
|
||||
void TrailEffect::SetEndPos(const vf2d pos){
|
||||
this->endPos=pos;
|
||||
}
|
||||
@ -66,7 +66,7 @@ bool TrailEffect::Update(float fElapsedTime){
|
||||
hitTimer+=damageTickFrequency;
|
||||
}
|
||||
|
||||
return Effect::Update(fElapsedTime);
|
||||
return IEffect::Update(fElapsedTime);
|
||||
}
|
||||
void TrailEffect::Draw(const Pixel blendCol)const{
|
||||
geom2d::line<float>flameTrailLine{pos,endPos};
|
||||
|
||||
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 13902
|
||||
#define VERSION_BUILD 13940
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
||||
@ -162,7 +162,7 @@ void Wizard::InitializeClassAbilities(){
|
||||
p->lastPathfindingCooldown=0.1f;
|
||||
|
||||
if(p->HasEnchant("Black Hole")){
|
||||
game->AddEffect(BlackHole{Oscillator<vf2d>{p->GetPos(),p->GetPos()+vf2d{0,-6.f},0.75f},"assets/blackhole.png","Black Hole"_ENC["BLACK HOLE DURATION"],p->OnUpperLevel(),Oscillator<vf2d>{{3.4f,3.4f},{3.7f,3.7f},0.75f},vf2d{},Oscillator<Pixel>{WHITE,WHITE,0.75f},util::random(2*PI),PI/3,false,0.03f,[](const Effect&self){
|
||||
game->AddEffect(BlackHole{Oscillator<vf2d>{p->GetPos(),p->GetPos()+vf2d{0,-6.f},0.75f},"assets/blackhole.png","Black Hole"_ENC["BLACK HOLE DURATION"],p->OnUpperLevel(),Oscillator<vf2d>{{3.4f,3.4f},{3.7f,3.7f},0.75f},vf2d{},Oscillator<Pixel>{WHITE,WHITE,0.75f},util::random(2*PI),PI/3,false,0.03f,[](const IEffect&self){
|
||||
vf2d particlePos{self.pos+vf2d{"Black Hole"_ENC["PULL IN RADIUS"]/100.f*24,util::random(2*PI)}.cart()};
|
||||
return Effect{particlePos,util::random_range(0.3f,0.5f),"assets/pixel.png",self.OnUpperLevel(),util::random(2.f),0.1f,util::pointTo(particlePos,self.pos)*util::random_range(700,1000),PixelLerp(BLACK,Pixel(0x9859de),util::random(1.f)),0.f,0.f,false};
|
||||
}},true);
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user