Finish entire class refactor. Class swapping needs to be reimplemented. Fixed shadow color from white to black
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
32c1d9d30c
commit
adf0d17190
@ -8,7 +8,7 @@ struct Ability{
|
|||||||
float COOLDOWN_TIME=0;
|
float COOLDOWN_TIME=0;
|
||||||
int manaCost=0;
|
int manaCost=0;
|
||||||
Pixel barColor1,barColor2;
|
Pixel barColor1,barColor2;
|
||||||
std::function<bool()>action;
|
std::function<bool()>action=[&](){return false;};
|
||||||
Ability();
|
Ability();
|
||||||
Ability(std::string name,float cooldownTime,int manaCost,Pixel barColor1=VERY_DARK_RED,Pixel barColor2=DARK_RED);
|
Ability(std::string name,float cooldownTime,int manaCost,Pixel barColor1=VERY_DARK_RED,Pixel barColor2=DARK_RED);
|
||||||
};
|
};
|
@ -5,7 +5,7 @@ struct EnergyBolt:public Bullet{
|
|||||||
float lastParticleSpawn=0;
|
float lastParticleSpawn=0;
|
||||||
EnergyBolt(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool friendly=false,Pixel col=WHITE);
|
EnergyBolt(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool friendly=false,Pixel col=WHITE);
|
||||||
void Update(float fElapsedTime)override;
|
void Update(float fElapsedTime)override;
|
||||||
bool PlayerHit(Player&player)override;
|
bool PlayerHit(Player*player)override;
|
||||||
bool MonsterHit(Monster&monster)override;
|
bool MonsterHit(Monster&monster)override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ struct FireBolt:public Bullet{
|
|||||||
float lastParticleSpawn=0;
|
float lastParticleSpawn=0;
|
||||||
FireBolt(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool friendly=false,Pixel col=WHITE);
|
FireBolt(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool friendly=false,Pixel col=WHITE);
|
||||||
void Update(float fElapsedTime)override;
|
void Update(float fElapsedTime)override;
|
||||||
bool PlayerHit(Player&player)override;
|
bool PlayerHit(Player*player)override;
|
||||||
bool MonsterHit(Monster&monster)override;
|
bool MonsterHit(Monster&monster)override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -21,6 +21,6 @@ struct LightningBolt:public Bullet{
|
|||||||
float lastParticleSpawn=0;
|
float lastParticleSpawn=0;
|
||||||
LightningBolt(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool friendly=false,Pixel col=WHITE);
|
LightningBolt(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool friendly=false,Pixel col=WHITE);
|
||||||
void Update(float fElapsedTime)override;
|
void Update(float fElapsedTime)override;
|
||||||
bool PlayerHit(Player&player)override;
|
bool PlayerHit(Player*player)override;
|
||||||
bool MonsterHit(Monster&monster)override;
|
bool MonsterHit(Monster&monster)override;
|
||||||
};
|
};
|
@ -1,277 +0,0 @@
|
|||||||
|
|
||||||
#include "DEFINES.h"
|
|
||||||
#include "Crawler.h"
|
|
||||||
#include "BulletTypes.h"
|
|
||||||
|
|
||||||
INCLUDE_game
|
|
||||||
INCLUDE_MONSTER_LIST
|
|
||||||
INCLUDE_BULLET_LIST
|
|
||||||
|
|
||||||
std::map<Class,std::unique_ptr<ClassData>>CLASS_DATA;
|
|
||||||
|
|
||||||
void ClassData::InitializeClassData(){
|
|
||||||
CLASS_DATA[WARRIOR]=std::make_unique<Warrior>(Warrior("Warrior",WARRIOR,
|
|
||||||
,
|
|
||||||
,
|
|
||||||
,
|
|
||||||
,
|
|
||||||
WARRIOR_WALK_N,WARRIOR_WALK_E,WARRIOR_WALK_S,WARRIOR_WALK_W,
|
|
||||||
WARRIOR_IDLE_N,WARRIOR_IDLE_E,WARRIOR_IDLE_S,WARRIOR_IDLE_W));
|
|
||||||
CLASS_DATA[RANGER]=std::make_unique<Ranger>(Ranger("Ranger",RANGER,
|
|
||||||
{"Retreat",7,0,VERY_DARK_BLUE,DARK_BLUE},
|
|
||||||
{"Rapid Fire",12,35},
|
|
||||||
{"Charged Shot",15,40},
|
|
||||||
{"Multishot",25,50},
|
|
||||||
RANGER_WALK_N,RANGER_WALK_E,RANGER_WALK_S,RANGER_WALK_W,
|
|
||||||
RANGER_IDLE_N,RANGER_IDLE_E,RANGER_IDLE_S,RANGER_IDLE_W));
|
|
||||||
CLASS_DATA[TRAPPER]=std::make_unique<Bard>(Bard("Bard",TRAPPER,
|
|
||||||
{"???",7,0,VERY_DARK_BLUE,DARK_BLUE},
|
|
||||||
{"???",12,0},
|
|
||||||
{"???",15,0},
|
|
||||||
{"???",25,0},
|
|
||||||
WARRIOR_WALK_N,WARRIOR_WALK_E,WARRIOR_WALK_S,WARRIOR_WALK_W,
|
|
||||||
WARRIOR_IDLE_N,WARRIOR_IDLE_E,WARRIOR_IDLE_S,WARRIOR_IDLE_W));
|
|
||||||
CLASS_DATA[WIZARD]=std::make_unique<Wizard>(Wizard("Wizard",WIZARD,
|
|
||||||
{"Teleport",8,5,VERY_DARK_BLUE,DARK_BLUE},
|
|
||||||
{"Firebolt",6,30},
|
|
||||||
{"Lightning Bolt",6,25},
|
|
||||||
{"Meteor",40,75},
|
|
||||||
WIZARD_WALK_N,WIZARD_WALK_E,WIZARD_WALK_S,WIZARD_WALK_W,
|
|
||||||
WIZARD_IDLE_N,WIZARD_IDLE_E,WIZARD_IDLE_S,WIZARD_IDLE_W));
|
|
||||||
CLASS_DATA[WITCH]=std::make_unique<Witch>(Witch("Witch",WITCH,
|
|
||||||
{"???",8,0,VERY_DARK_BLUE,DARK_BLUE},
|
|
||||||
{"???",6,0},
|
|
||||||
{"???",6,0},
|
|
||||||
{"???",40,0},
|
|
||||||
WARRIOR_WALK_N,WARRIOR_WALK_E,WARRIOR_WALK_S,WARRIOR_WALK_W,
|
|
||||||
WARRIOR_IDLE_N,WARRIOR_IDLE_E,WARRIOR_IDLE_S,WARRIOR_IDLE_W));
|
|
||||||
}
|
|
||||||
|
|
||||||
ClassData::ClassData(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w)
|
|
||||||
:name(name),cl(cl),rightClickAbility(rightClickAbility),ability1(ability1),ability2(ability2),ability3(ability3),
|
|
||||||
walk_n(walk_n),walk_e(walk_e),walk_s(walk_s),walk_w(walk_w),idle_n(idle_n),idle_w(idle_w),idle_s(idle_s),idle_e(idle_e)
|
|
||||||
{}
|
|
||||||
|
|
||||||
Warrior::Warrior(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w)
|
|
||||||
:ClassData(name,cl,rightClickAbility,ability1,ability2,ability3,
|
|
||||||
walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w)
|
|
||||||
{}
|
|
||||||
|
|
||||||
Thief::Thief(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w)
|
|
||||||
:ClassData(name,cl,rightClickAbility,ability1,ability2,ability3,
|
|
||||||
walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void Thief::Update(float fElapsedTime){
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Thief::AutoAttack(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Thief::Ability1(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Thief::Ability2(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Thief::Ability3(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Thief::RightClickAbility(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ranger::Ranger(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w)
|
|
||||||
:ClassData(name,cl,rightClickAbility,ability1,ability2,ability3,
|
|
||||||
walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void Ranger::Update(float fElapsedTime){
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Ranger::AutoAttack(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Ranger::Ability1(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Ranger::Ability2(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Ranger::Ability3(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Ranger::RightClickAbility(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bard::Bard(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w)
|
|
||||||
:ClassData(name,cl,rightClickAbility,ability1,ability2,ability3,
|
|
||||||
walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void Bard::Update(float fElapsedTime){
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Bard::AutoAttack(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Bard::Ability1(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Bard::Ability2(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Bard::Ability3(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Bard::RightClickAbility(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Wizard::Wizard(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w)
|
|
||||||
:ClassData(name,cl,rightClickAbility,ability1,ability2,ability3,
|
|
||||||
walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void Wizard::Update(float fElapsedTime){
|
|
||||||
ACCESS_PLAYER
|
|
||||||
if(p->attack_cooldown_timer>0){
|
|
||||||
CLASS_DATA[cl]->idle_n=AnimationState::WIZARD_IDLE_ATTACK_N;
|
|
||||||
CLASS_DATA[cl]->idle_e=AnimationState::WIZARD_IDLE_ATTACK_E;
|
|
||||||
CLASS_DATA[cl]->idle_s=AnimationState::WIZARD_IDLE_ATTACK_S;
|
|
||||||
CLASS_DATA[cl]->idle_w=AnimationState::WIZARD_IDLE_ATTACK_W;
|
|
||||||
CLASS_DATA[cl]->walk_n=AnimationState::WIZARD_ATTACK_N;
|
|
||||||
CLASS_DATA[cl]->walk_e=AnimationState::WIZARD_ATTACK_E;
|
|
||||||
CLASS_DATA[cl]->walk_s=AnimationState::WIZARD_ATTACK_S;
|
|
||||||
CLASS_DATA[cl]->walk_w=AnimationState::WIZARD_ATTACK_W;
|
|
||||||
} else {
|
|
||||||
CLASS_DATA[cl]->idle_n=AnimationState::WIZARD_IDLE_N;
|
|
||||||
CLASS_DATA[cl]->idle_e=AnimationState::WIZARD_IDLE_E;
|
|
||||||
CLASS_DATA[cl]->idle_s=AnimationState::WIZARD_IDLE_S;
|
|
||||||
CLASS_DATA[cl]->idle_w=AnimationState::WIZARD_IDLE_W;
|
|
||||||
CLASS_DATA[cl]->walk_n=AnimationState::WIZARD_WALK_N;
|
|
||||||
CLASS_DATA[cl]->walk_e=AnimationState::WIZARD_WALK_E;
|
|
||||||
CLASS_DATA[cl]->walk_s=AnimationState::WIZARD_WALK_S;
|
|
||||||
CLASS_DATA[cl]->walk_w=AnimationState::WIZARD_WALK_W;
|
|
||||||
}
|
|
||||||
if(p->GetState()==State::CASTING){
|
|
||||||
switch(p->GetFacingDirection()){
|
|
||||||
case UP:{
|
|
||||||
p->UpdateAnimation(AnimationState::WIZARD_CAST_N);
|
|
||||||
}break;
|
|
||||||
case DOWN:{
|
|
||||||
p->UpdateAnimation(AnimationState::WIZARD_CAST_S);
|
|
||||||
}break;
|
|
||||||
case LEFT:{
|
|
||||||
p->UpdateAnimation(AnimationState::WIZARD_CAST_W);
|
|
||||||
}break;
|
|
||||||
case RIGHT:{
|
|
||||||
p->UpdateAnimation(AnimationState::WIZARD_CAST_E);
|
|
||||||
}break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Wizard::AutoAttack(){
|
|
||||||
ACCESS_PLAYER
|
|
||||||
p->attack_cooldown_timer=p->MAGIC_ATTACK_COOLDOWN;
|
|
||||||
float angleToCursor=atan2(game->GetWorldMousePos().y-p->GetPos().y,game->GetWorldMousePos().x-p->GetPos().x);
|
|
||||||
BULLET_LIST.push_back(std::make_unique<EnergyBolt>(EnergyBolt(p->GetPos(),{cos(angleToCursor)*200,sin(angleToCursor)*200},12,p->GetAttack(),p->upperLevel,true,WHITE)));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Wizard::Ability1(){
|
|
||||||
ACCESS_PLAYER
|
|
||||||
float angleToCursor=atan2(game->GetWorldMousePos().y-p->GetPos().y,game->GetWorldMousePos().x-p->GetPos().x);
|
|
||||||
BULLET_LIST.push_back(std::make_unique<FireBolt>(FireBolt(p->GetPos(),{cos(angleToCursor)*275,sin(angleToCursor)*275},12,p->GetAttack(),p->upperLevel,true,{240,120,60})));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Wizard::Ability2(){
|
|
||||||
ACCESS_PLAYER
|
|
||||||
float angleToCursor=atan2(game->GetWorldMousePos().y-p->GetPos().y,game->GetWorldMousePos().x-p->GetPos().x);
|
|
||||||
BULLET_LIST.push_back(std::make_unique<LightningBolt>(LightningBolt(p->GetPos(),{cos(angleToCursor)*230,sin(angleToCursor)*230},12,p->GetAttack()*4,p->upperLevel,true,WHITE)));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Wizard::Ability3(){
|
|
||||||
ACCESS_PLAYER
|
|
||||||
p->SetState(State::CASTING);
|
|
||||||
game->AddEffect(std::make_unique<Meteor>(p->GetPos(),3,AnimationState::METEOR,p->OnUpperLevel(),vf2d{1,1},2));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Wizard::RightClickAbility(){
|
|
||||||
ACCESS_PLAYER
|
|
||||||
float pointMouseDirection=atan2(game->GetWorldMousePos().y-p->GetPos().y,game->GetWorldMousePos().x-p->GetPos().x);
|
|
||||||
vf2d pointTowardsMouse={cos(pointMouseDirection),sin(pointMouseDirection)};
|
|
||||||
float dist=std::clamp(geom2d::line<float>{p->GetPos(),game->GetWorldMousePos()}.length(),0.f,6.5f*24);
|
|
||||||
if(dist<12)return false;
|
|
||||||
vf2d teleportPoint=p->GetPos()+pointTowardsMouse*dist;
|
|
||||||
while(dist>0&&game->HasTileCollision(game->GetCurrentLevel(),teleportPoint)&&p->CanPathfindTo(p->GetPos(),teleportPoint)){
|
|
||||||
dist-=24;
|
|
||||||
teleportPoint=p->GetPos()+pointTowardsMouse*dist;
|
|
||||||
}
|
|
||||||
if(dist>0&&p->CanPathfindTo(p->GetPos(),teleportPoint)){
|
|
||||||
p->SetState(State::TELEPORT);
|
|
||||||
p->teleportAnimationTimer=0.35;
|
|
||||||
p->teleportTarget=teleportPoint;
|
|
||||||
p->teleportStartPosition=p->GetPos();
|
|
||||||
p->iframe_time=0.35;
|
|
||||||
for(int i=0;i<16;i++){
|
|
||||||
game->AddEffect(std::make_unique<Effect>(p->GetPos()+vf2d{(rand()%160-80)/10.f,(rand()%160-80)/10.f},float(rand()%300)/1000,AnimationState::DOT_PARTICLE,p->upperLevel,0.3,0.2,vf2d{float(rand()%1000-500)/100,float(rand()%1000-500)/100},BLACK));
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
p->notificationDisplay={"Cannot Teleport to that location!",0.5};
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Witch::Witch(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w)
|
|
||||||
:ClassData(name,cl,rightClickAbility,ability1,ability2,ability3,
|
|
||||||
walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void Witch::Update(float fElapsedTime){
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Witch::AutoAttack(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Witch::Ability1(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Witch::Ability2(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Witch::Ability3(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Witch::RightClickAbility(){
|
|
||||||
return true;
|
|
||||||
}
|
|
@ -3,79 +3,13 @@
|
|||||||
#include "Animation.h"
|
#include "Animation.h"
|
||||||
#include "olcPixelGameEngine.h"
|
#include "olcPixelGameEngine.h"
|
||||||
|
|
||||||
|
//Classes have bit-wise operator capabilities.
|
||||||
enum Class{
|
enum Class{
|
||||||
WARRIOR,THIEF,RANGER,TRAPPER,WIZARD,WITCH
|
ANY=0,
|
||||||
};
|
WARRIOR=1,
|
||||||
struct ClassData{
|
THIEF=2,
|
||||||
static void InitializeClassData();
|
RANGER=4,
|
||||||
ClassData(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
TRAPPER=8,
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w);
|
WIZARD=16,
|
||||||
virtual ~ClassData()=default;
|
WITCH=32
|
||||||
virtual void Update(float fElapsedTime)=0;
|
|
||||||
virtual bool AutoAttack()=0;
|
|
||||||
virtual bool Ability1()=0;
|
|
||||||
virtual bool Ability2()=0;
|
|
||||||
virtual bool Ability3()=0;
|
|
||||||
virtual bool RightClickAbility()=0;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Warrior:public ClassData{
|
|
||||||
Warrior(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w);
|
|
||||||
void Update(float fElapsedTime)override;
|
|
||||||
bool AutoAttack()override;
|
|
||||||
bool Ability1()override;
|
|
||||||
bool Ability2()override;
|
|
||||||
bool Ability3()override;
|
|
||||||
bool RightClickAbility()override;
|
|
||||||
};
|
|
||||||
struct Thief:public ClassData{
|
|
||||||
Thief(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w);
|
|
||||||
void Update(float fElapsedTime)override;
|
|
||||||
bool AutoAttack()override;
|
|
||||||
bool Ability1()override;
|
|
||||||
bool Ability2()override;
|
|
||||||
bool Ability3()override;
|
|
||||||
bool RightClickAbility()override;
|
|
||||||
};
|
|
||||||
struct Ranger:public ClassData{
|
|
||||||
Ranger(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w);
|
|
||||||
void Update(float fElapsedTime)override;
|
|
||||||
bool AutoAttack()override;
|
|
||||||
bool Ability1()override;
|
|
||||||
bool Ability2()override;
|
|
||||||
bool Ability3()override;
|
|
||||||
bool RightClickAbility()override;
|
|
||||||
};
|
|
||||||
struct Bard:public ClassData{
|
|
||||||
Bard(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w);
|
|
||||||
void Update(float fElapsedTime)override;
|
|
||||||
bool AutoAttack()override;
|
|
||||||
bool Ability1()override;
|
|
||||||
bool Ability2()override;
|
|
||||||
bool Ability3()override;
|
|
||||||
bool RightClickAbility()override;
|
|
||||||
};
|
|
||||||
struct Wizard:public ClassData{
|
|
||||||
Wizard(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w);
|
|
||||||
void Update(float fElapsedTime)override;
|
|
||||||
bool AutoAttack()override;
|
|
||||||
bool Ability1()override;
|
|
||||||
bool Ability2()override;
|
|
||||||
bool Ability3()override;
|
|
||||||
bool RightClickAbility()override;
|
|
||||||
};
|
|
||||||
struct Witch:public ClassData{
|
|
||||||
Witch(std::string name,Class cl,Ability rightClickAbility,Ability ability1,Ability ability2,Ability ability3,
|
|
||||||
AnimationState walk_n,AnimationState walk_e,AnimationState walk_s,AnimationState walk_w,AnimationState idle_n,AnimationState idle_e,AnimationState idle_s,AnimationState idle_w);
|
|
||||||
void Update(float fElapsedTime)override;
|
|
||||||
bool AutoAttack()override;
|
|
||||||
bool Ability1()override;
|
|
||||||
bool Ability2()override;
|
|
||||||
bool Ability3()override;
|
|
||||||
bool RightClickAbility()override;
|
|
||||||
};
|
};
|
BIN
Crawler/Crawler
BIN
Crawler/Crawler
Binary file not shown.
@ -15,7 +15,6 @@
|
|||||||
#include <queue>
|
#include <queue>
|
||||||
#include "Emitter.h"
|
#include "Emitter.h"
|
||||||
|
|
||||||
INCLUDE_CLASS_DATA
|
|
||||||
INCLUDE_EMITTER_LIST
|
INCLUDE_EMITTER_LIST
|
||||||
|
|
||||||
//#define DEBUG_COLLISIONS //Shows collision hitboxes.
|
//#define DEBUG_COLLISIONS //Shows collision hitboxes.
|
||||||
@ -40,11 +39,9 @@ bool Crawler::OnUserCreate(){
|
|||||||
|
|
||||||
InitializeLevel("assets/Campaigns/1_1.tmx",CAMPAIGN_1_1);
|
InitializeLevel("assets/Campaigns/1_1.tmx",CAMPAIGN_1_1);
|
||||||
|
|
||||||
#ifdef OLC_PLATFORM_EMSCRIPTEN
|
std::cout<<"Player loading."<<std::endl;
|
||||||
ConsoleCaptureStdOut(true);
|
player=std::make_unique<Warrior>();
|
||||||
#endif
|
std::cout<<"Player loaded."<<std::endl;
|
||||||
|
|
||||||
ClassData::InitializeClassData();
|
|
||||||
|
|
||||||
//Initialize Camera.
|
//Initialize Camera.
|
||||||
camera=Camera2D{WINDOW_SIZE};
|
camera=Camera2D{WINDOW_SIZE};
|
||||||
@ -53,6 +50,7 @@ bool Crawler::OnUserCreate(){
|
|||||||
camera.SetWorldBoundary({0,0},WORLD_SIZE*24);
|
camera.SetWorldBoundary({0,0},WORLD_SIZE*24);
|
||||||
camera.EnableWorldBoundary(false);
|
camera.EnableWorldBoundary(false);
|
||||||
|
|
||||||
|
std::cout<<"Camera loaded."<<std::endl;
|
||||||
//Graphics
|
//Graphics
|
||||||
GFX_Warrior_Sheet.Load("assets/nico-warrior.png");
|
GFX_Warrior_Sheet.Load("assets/nico-warrior.png");
|
||||||
GFX_Slime_Sheet.Load("assets/slime.png");
|
GFX_Slime_Sheet.Load("assets/slime.png");
|
||||||
@ -79,6 +77,7 @@ bool Crawler::OnUserCreate(){
|
|||||||
GFX_ChainLightning.Load("assets/chain_lightning.png");
|
GFX_ChainLightning.Load("assets/chain_lightning.png");
|
||||||
GFX_LightningSplash.Load("assets/lightning_splash_effect.png");
|
GFX_LightningSplash.Load("assets/lightning_splash_effect.png");
|
||||||
GFX_Meteor.Load("assets/meteor.png");
|
GFX_Meteor.Load("assets/meteor.png");
|
||||||
|
std::cout<<"Images loaded."<<std::endl;
|
||||||
|
|
||||||
//Animations
|
//Animations
|
||||||
sig::Animation::InitializeAnimations();
|
sig::Animation::InitializeAnimations();
|
||||||
@ -87,8 +86,9 @@ bool Crawler::OnUserCreate(){
|
|||||||
view=TileTransformedView{GetScreenSize(),{1,1}};
|
view=TileTransformedView{GetScreenSize(),{1,1}};
|
||||||
|
|
||||||
LoadLevel(CAMPAIGN_1_1);
|
LoadLevel(CAMPAIGN_1_1);
|
||||||
|
std::cout<<"Done Loading."<<std::endl;
|
||||||
player->ChangeClass(WARRIOR);
|
//ChangePlayerClass(WARRIOR);
|
||||||
|
std::cout<<"Set player class."<<std::endl;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -141,26 +141,26 @@ void Crawler::HandleUserInput(float fElapsedTime){
|
|||||||
if(GetMouseWheel()>0){
|
if(GetMouseWheel()>0){
|
||||||
switch(player->GetClass()){
|
switch(player->GetClass()){
|
||||||
case WARRIOR:{
|
case WARRIOR:{
|
||||||
player->ChangeClass(RANGER);
|
ChangePlayerClass(RANGER);
|
||||||
}break;
|
}break;
|
||||||
case RANGER:{
|
case RANGER:{
|
||||||
player->ChangeClass(WIZARD);
|
ChangePlayerClass(WIZARD);
|
||||||
}break;
|
}break;
|
||||||
case WIZARD:{
|
case WIZARD:{
|
||||||
player->ChangeClass(WARRIOR);
|
ChangePlayerClass(WARRIOR);
|
||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(GetMouseWheel()<0){
|
if(GetMouseWheel()<0){
|
||||||
switch(player->GetClass()){
|
switch(player->GetClass()){
|
||||||
case WARRIOR:{
|
case WARRIOR:{
|
||||||
player->ChangeClass(WIZARD);
|
ChangePlayerClass(WIZARD);
|
||||||
}break;
|
}break;
|
||||||
case RANGER:{
|
case RANGER:{
|
||||||
player->ChangeClass(WARRIOR);
|
ChangePlayerClass(WARRIOR);
|
||||||
}break;
|
}break;
|
||||||
case WIZARD:{
|
case WIZARD:{
|
||||||
player->ChangeClass(RANGER);
|
ChangePlayerClass(RANGER);
|
||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -540,7 +540,7 @@ void Crawler::RenderWorld(float fElapsedTime){
|
|||||||
|
|
||||||
if(player->GetZ()>0){
|
if(player->GetZ()>0){
|
||||||
vf2d shadowScale=vf2d{8/3.f,1}/std::max(1.f,player->GetZ()/4);
|
vf2d shadowScale=vf2d{8/3.f,1}/std::max(1.f,player->GetZ()/4);
|
||||||
view.DrawDecal(player->GetPos()-vf2d{3,3}*shadowScale/2+vf2d{0,6},GFX_Circle.Decal(),shadowScale);
|
view.DrawDecal(player->GetPos()-vf2d{3,3}*shadowScale/2+vf2d{0,6},GFX_Circle.Decal(),shadowScale,BLACK);
|
||||||
}
|
}
|
||||||
for(Effect*e:backgroundEffectsLower){
|
for(Effect*e:backgroundEffectsLower){
|
||||||
e->Draw();
|
e->Draw();
|
||||||
@ -679,10 +679,11 @@ void Crawler::RenderHud(){
|
|||||||
return newName;
|
return newName;
|
||||||
};
|
};
|
||||||
std::vector<Ability>cooldowns{
|
std::vector<Ability>cooldowns{
|
||||||
player->rightClickAbility,
|
player->GetRightClickAbility(),
|
||||||
player->ability1,
|
player->GetAbility1(),
|
||||||
player->ability2,
|
player->GetAbility2(),
|
||||||
player->ability3
|
player->GetAbility3(),
|
||||||
|
player->GetAbility4(),
|
||||||
};
|
};
|
||||||
std::vector<Ability>activeCooldowns;
|
std::vector<Ability>activeCooldowns;
|
||||||
std::copy_if(cooldowns.begin(),cooldowns.end(),std::back_inserter(activeCooldowns),[](Ability a){
|
std::copy_if(cooldowns.begin(),cooldowns.end(),std::back_inserter(activeCooldowns),[](Ability a){
|
||||||
@ -752,6 +753,7 @@ void Crawler::SetupWorldShake(float duration){
|
|||||||
|
|
||||||
void Crawler::InitializeLevel(std::string mapFile,MapName map){
|
void Crawler::InitializeLevel(std::string mapFile,MapName map){
|
||||||
TMXParser level(mapFile);
|
TMXParser level(mapFile);
|
||||||
|
std::cout<<"Done parsing."<<std::endl;
|
||||||
size_t slashMarker = mapFile.find_last_of('/');
|
size_t slashMarker = mapFile.find_last_of('/');
|
||||||
std::string baseDir=mapFile.substr(0,slashMarker+1);
|
std::string baseDir=mapFile.substr(0,slashMarker+1);
|
||||||
MAP_DATA[map]=level.GetData();
|
MAP_DATA[map]=level.GetData();
|
||||||
@ -760,6 +762,7 @@ void Crawler::InitializeLevel(std::string mapFile,MapName map){
|
|||||||
std::string baseSourceDir=tag.data["source"].substr(slashMarkerSourceDir+1);
|
std::string baseSourceDir=tag.data["source"].substr(slashMarkerSourceDir+1);
|
||||||
if(MAP_TILESETS.find("assets/maps/"+baseSourceDir)==MAP_TILESETS.end()){
|
if(MAP_TILESETS.find("assets/maps/"+baseSourceDir)==MAP_TILESETS.end()){
|
||||||
TSXParser tileset(baseDir+tag.data["source"]);
|
TSXParser tileset(baseDir+tag.data["source"]);
|
||||||
|
std::cout<<"Done parsing tex. "<<std::endl;
|
||||||
Renderable*r=new Renderable();
|
Renderable*r=new Renderable();
|
||||||
MAP_TILESETS["assets/maps/"+baseSourceDir].tileset=r;
|
MAP_TILESETS["assets/maps/"+baseSourceDir].tileset=r;
|
||||||
MAP_TILESETS["assets/maps/"+baseSourceDir].foregroundTiles=tileset.GetData().ForegroundTileData;
|
MAP_TILESETS["assets/maps/"+baseSourceDir].foregroundTiles=tileset.GetData().ForegroundTileData;
|
||||||
@ -767,8 +770,10 @@ void Crawler::InitializeLevel(std::string mapFile,MapName map){
|
|||||||
MAP_TILESETS["assets/maps/"+baseSourceDir].collision=tileset.GetData().CollisionData;
|
MAP_TILESETS["assets/maps/"+baseSourceDir].collision=tileset.GetData().CollisionData;
|
||||||
MAP_TILESETS["assets/maps/"+baseSourceDir].staircaseTiles=tileset.GetData().StaircaseData;
|
MAP_TILESETS["assets/maps/"+baseSourceDir].staircaseTiles=tileset.GetData().StaircaseData;
|
||||||
r->Load("assets/maps/"+tileset.GetData().ImageData.data["source"]);
|
r->Load("assets/maps/"+tileset.GetData().ImageData.data["source"]);
|
||||||
|
std::cout<<"Done loading. "<<std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
std::cout<<"Function done. "<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crawler::LoadLevel(MapName map){
|
void Crawler::LoadLevel(MapName map){
|
||||||
@ -776,6 +781,7 @@ void Crawler::LoadLevel(MapName map){
|
|||||||
foregroundTileGroups.clear();
|
foregroundTileGroups.clear();
|
||||||
currentLevel=map;
|
currentLevel=map;
|
||||||
WORLD_SIZE={MAP_DATA[map].MapData.width,MAP_DATA[map].MapData.height};
|
WORLD_SIZE={MAP_DATA[map].MapData.width,MAP_DATA[map].MapData.height};
|
||||||
|
std::cout<<"Setup world size."<<std::endl;
|
||||||
for(auto key:MAP_DATA[map].SpawnerData){
|
for(auto key:MAP_DATA[map].SpawnerData){
|
||||||
SpawnerTag&spawnData=MAP_DATA[map].SpawnerData[key.first];
|
SpawnerTag&spawnData=MAP_DATA[map].SpawnerData[key.first];
|
||||||
std::vector<std::pair<MonsterName,vf2d>>monster_list;
|
std::vector<std::pair<MonsterName,vf2d>>monster_list;
|
||||||
@ -789,6 +795,7 @@ void Crawler::LoadLevel(MapName map){
|
|||||||
}
|
}
|
||||||
SPAWNER_LIST.push_back(MonsterSpawner{{spawnData.ObjectData.GetFloat("x"),spawnData.ObjectData.GetFloat("y")},spawnerRadius*2,monster_list,spawnData.upperLevel});
|
SPAWNER_LIST.push_back(MonsterSpawner{{spawnData.ObjectData.GetFloat("x"),spawnData.ObjectData.GetFloat("y")},spawnerRadius*2,monster_list,spawnData.upperLevel});
|
||||||
}
|
}
|
||||||
|
std::cout<<"Spawner lists done."<<std::endl;
|
||||||
std::set<vi2d>foregroundTilesAdded,upperForegroundTilesAdded;
|
std::set<vi2d>foregroundTilesAdded,upperForegroundTilesAdded;
|
||||||
for(int x=0;x<WORLD_SIZE.x;x++){
|
for(int x=0;x<WORLD_SIZE.x;x++){
|
||||||
for(int y=0;y<WORLD_SIZE.y;y++){
|
for(int y=0;y<WORLD_SIZE.y;y++){
|
||||||
@ -870,6 +877,7 @@ void Crawler::LoadLevel(MapName map){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
std::cout<<"Done preparing tilesheet reads"<<std::endl;
|
||||||
int counter=0;
|
int counter=0;
|
||||||
bridgeLayerIndex=-1;
|
bridgeLayerIndex=-1;
|
||||||
for(LayerTag&layer:MAP_DATA[map].LayerData){
|
for(LayerTag&layer:MAP_DATA[map].LayerData){
|
||||||
@ -878,8 +886,10 @@ void Crawler::LoadLevel(MapName map){
|
|||||||
}
|
}
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
std::cout<<"Bridge Layer indexing done."<<std::endl;
|
||||||
player->upperLevel=false; //Assume player starts on lower level.
|
player->upperLevel=false; //Assume player starts on lower level.
|
||||||
player->SetPos(MAP_DATA[map].MapData.playerSpawnLocation);
|
player->SetPos(MAP_DATA[map].MapData.playerSpawnLocation);
|
||||||
|
std::cout<<"Player spawn info set."<<std::endl;
|
||||||
pathfinder.Initialize();
|
pathfinder.Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define INCLUDE_game extern Crawler*game;
|
#define INCLUDE_game extern Crawler*game;
|
||||||
#define INCLUDE_MONSTER_DATA extern std::map<MonsterName,MonsterData>MONSTER_DATA;
|
#define INCLUDE_MONSTER_DATA extern std::map<MonsterName,MonsterData>MONSTER_DATA;
|
||||||
#define INCLUDE_BULLET_LIST extern std::vector<std::unique_ptr<Bullet>>BULLET_LIST;
|
#define INCLUDE_BULLET_LIST extern std::vector<std::unique_ptr<Bullet>>BULLET_LIST;
|
||||||
#define INCLUDE_CLASS_DATA extern std::map<Class,std::unique_ptr<ClassData>>CLASS_DATA;
|
|
||||||
#define INCLUDE_PARTICLE_LIST extern std::vector<Particle>PARTICLE_LIST;
|
#define INCLUDE_PARTICLE_LIST extern std::vector<Particle>PARTICLE_LIST;
|
||||||
#define INCLUDE_EMITTER_LIST extern std::vector<std::unique_ptr<Emitter>>EMITTER_LIST;
|
#define INCLUDE_EMITTER_LIST extern std::vector<std::unique_ptr<Emitter>>EMITTER_LIST;
|
||||||
|
|
||||||
@ -15,10 +14,19 @@
|
|||||||
#define INFINITE 999999
|
#define INFINITE 999999
|
||||||
|
|
||||||
#define SETUP_CLASS(class) \
|
#define SETUP_CLASS(class) \
|
||||||
|
class::class(){InitializeClassAbilities();} \
|
||||||
Class class::GetClass(){return cl;} \
|
Class class::GetClass(){return cl;} \
|
||||||
std::string class::GetClassName(){return name;} \
|
std::string class::GetClassName(){return name;} \
|
||||||
Ability&class::GetRightClickAbility(){return rightClickAbility;}; \
|
Ability&class::GetRightClickAbility(){return rightClickAbility;}; \
|
||||||
Ability&class::GetAbility1(){return ability1;}; \
|
Ability&class::GetAbility1(){return ability1;}; \
|
||||||
Ability&class::GetAbility2(){return ability2;}; \
|
Ability&class::GetAbility2(){return ability2;}; \
|
||||||
Ability&class::GetAbility3(){return ability3;}; \
|
Ability&class::GetAbility3(){return ability3;}; \
|
||||||
Ability&class::GetAbility4(){return ability4;};
|
Ability&class::GetAbility4(){return ability4;}; \
|
||||||
|
AnimationState&class::GetWalkNAnimation(){return walk_n;}; \
|
||||||
|
AnimationState&class::GetWalkEAnimation(){return walk_e;}; \
|
||||||
|
AnimationState&class::GetWalkSAnimation(){return walk_s;}; \
|
||||||
|
AnimationState&class::GetWalkWAnimation(){return walk_w;}; \
|
||||||
|
AnimationState&class::GetIdleNAnimation(){return idle_n;}; \
|
||||||
|
AnimationState&class::GetIdleEAnimation(){return idle_e;}; \
|
||||||
|
AnimationState&class::GetIdleSAnimation(){return idle_s;}; \
|
||||||
|
AnimationState&class::GetIdleWAnimation(){return idle_w;};
|
@ -15,4 +15,5 @@ bool Emitter::Update(float fElapsedTime){
|
|||||||
if(timer<0){
|
if(timer<0){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
#include "olcPixelGameEngine.h"
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "olcPixelGameEngine.h"
|
||||||
|
|
||||||
struct Emitter{
|
struct Emitter{
|
||||||
float frequency;
|
float frequency;
|
||||||
|
@ -17,11 +17,11 @@ void EnergyBolt::Update(float fElapsedTime){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EnergyBolt::PlayerHit(Player& player)
|
bool EnergyBolt::PlayerHit(Player*player)
|
||||||
{
|
{
|
||||||
deactivated=true;
|
deactivated=true;
|
||||||
fadeOutTime=0.2f;
|
fadeOutTime=0.2f;
|
||||||
game->AddEffect(std::make_unique<Effect>(player.GetPos(),0,AnimationState::SPLASH_EFFECT,upperLevel,player.GetSizeMult(),0.25));
|
game->AddEffect(std::make_unique<Effect>(player->GetPos(),0,AnimationState::SPLASH_EFFECT,upperLevel,player->GetSizeMult(),0.25));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,11 +18,11 @@ void FireBolt::Update(float fElapsedTime){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FireBolt::PlayerHit(Player& player)
|
bool FireBolt::PlayerHit(Player*player)
|
||||||
{
|
{
|
||||||
deactivated=true;
|
deactivated=true;
|
||||||
fadeOutTime=0.2f;
|
fadeOutTime=0.2f;
|
||||||
game->AddEffect(std::make_unique<Effect>(player.GetPos(),0,AnimationState::SPLASH_EFFECT,upperLevel,5,0.25,vf2d{},Pixel{240,120,60}));
|
game->AddEffect(std::make_unique<Effect>(player->GetPos(),0,AnimationState::SPLASH_EFFECT,upperLevel,5,0.25,vf2d{},Pixel{240,120,60}));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,11 +34,11 @@ void LightningBolt::Update(float fElapsedTime){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LightningBolt::PlayerHit(Player& player)
|
bool LightningBolt::PlayerHit(Player*player)
|
||||||
{
|
{
|
||||||
deactivated=true;
|
deactivated=true;
|
||||||
fadeOutTime=0.2f;
|
fadeOutTime=0.2f;
|
||||||
game->AddEffect(std::make_unique<Effect>(player.GetPos(),0.3,AnimationState::LIGHTNING_SPLASH,upperLevel,player.GetSizeMult(),0.25,vf2d{},WHITE,util::random(PI)));
|
game->AddEffect(std::make_unique<Effect>(player->GetPos(),0.3,AnimationState::LIGHTNING_SPLASH,upperLevel,player->GetSizeMult(),0.25,vf2d{},WHITE,util::random(PI)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,10 +285,10 @@ void Monster::Draw(){
|
|||||||
game->view.DrawPartialDecal(GetPos()-vf2d{12,12}*GetSizeMult(),GetFrame().GetSourceImage()->Decal(),GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,vf2d(GetSizeMult(),GetSizeMult()),GetBuffs(BuffType::SLOWDOWN).size()>0?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)))}:WHITE);
|
game->view.DrawPartialDecal(GetPos()-vf2d{12,12}*GetSizeMult(),GetFrame().GetSourceImage()->Decal(),GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,vf2d(GetSizeMult(),GetSizeMult()),GetBuffs(BuffType::SLOWDOWN).size()>0?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)))}:WHITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Monster::Collision(Player&p){
|
void Monster::Collision(Player*p){
|
||||||
if(MONSTER_DATA[type].GetCollisionDmg()>0&&!hasHitPlayer){
|
if(MONSTER_DATA[type].GetCollisionDmg()>0&&!hasHitPlayer){
|
||||||
hasHitPlayer=true;
|
hasHitPlayer=true;
|
||||||
p.Hurt(MONSTER_DATA[type].GetCollisionDmg());
|
p->Hurt(MONSTER_DATA[type].GetCollisionDmg());
|
||||||
}
|
}
|
||||||
Collision();
|
Collision();
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
#include "olcPixelGameEngine.h"
|
#include "olcPixelGameEngine.h"
|
||||||
#include "Animation.h"
|
#include "Animation.h"
|
||||||
#include "State.h"
|
#include "State.h"
|
||||||
#include "Player.h"
|
#include "Buff.h"
|
||||||
#include "olcUTIL_Animate2D.h"
|
#include "olcUTIL_Animate2D.h"
|
||||||
|
|
||||||
|
struct Player;
|
||||||
|
|
||||||
enum MonsterStrategy{
|
enum MonsterStrategy{
|
||||||
RUN_TOWARDS,
|
RUN_TOWARDS,
|
||||||
SHOOT_AFAR
|
SHOOT_AFAR
|
||||||
@ -101,7 +103,7 @@ protected:
|
|||||||
vf2d&GetTargetPos();
|
vf2d&GetTargetPos();
|
||||||
Key GetFacingDirection();
|
Key GetFacingDirection();
|
||||||
void Draw();
|
void Draw();
|
||||||
void Collision(Player&p);
|
void Collision(Player*p);
|
||||||
void Collision(Monster&p);
|
void Collision(Monster&p);
|
||||||
void Collision();
|
void Collision();
|
||||||
void SetVelocity(vf2d vel);
|
void SetVelocity(vf2d vel);
|
||||||
|
@ -12,13 +12,12 @@ INCLUDE_ANIMATION_DATA
|
|||||||
INCLUDE_SPAWNER_LIST
|
INCLUDE_SPAWNER_LIST
|
||||||
INCLUDE_BULLET_LIST
|
INCLUDE_BULLET_LIST
|
||||||
INCLUDE_DAMAGENUMBER_LIST
|
INCLUDE_DAMAGENUMBER_LIST
|
||||||
INCLUDE_CLASS_DATA
|
|
||||||
INCLUDE_game
|
INCLUDE_game
|
||||||
|
|
||||||
const float Player::GROUND_SLAM_SPIN_TIME=0.6f;
|
const float Player::GROUND_SLAM_SPIN_TIME=0.6f;
|
||||||
|
|
||||||
Player::Player():
|
Player::Player()
|
||||||
state(State::NORMAL),lastReleasedMovementKey(DOWN),facingDirection(DOWN){}
|
:state(State::NORMAL),lastReleasedMovementKey(DOWN),facingDirection(DOWN){}
|
||||||
|
|
||||||
bool Player::SetX(float x){
|
bool Player::SetX(float x){
|
||||||
vf2d newPos={x,pos.y};
|
vf2d newPos={x,pos.y};
|
||||||
@ -151,10 +150,10 @@ State Player::GetState(){
|
|||||||
|
|
||||||
void Player::Update(float fElapsedTime){
|
void Player::Update(float fElapsedTime){
|
||||||
Ability&rightClickAbility=GetRightClickAbility(),
|
Ability&rightClickAbility=GetRightClickAbility(),
|
||||||
ability1=GetAbility1(),
|
&ability1=GetAbility1(),
|
||||||
ability2=GetAbility2(),
|
&ability2=GetAbility2(),
|
||||||
ability3=GetAbility3(),
|
&ability3=GetAbility3(),
|
||||||
ability4=GetAbility4();
|
&ability4=GetAbility4();
|
||||||
attack_cooldown_timer=std::max(0.f,attack_cooldown_timer-fElapsedTime);
|
attack_cooldown_timer=std::max(0.f,attack_cooldown_timer-fElapsedTime);
|
||||||
iframe_time=std::max(0.f,iframe_time-fElapsedTime);
|
iframe_time=std::max(0.f,iframe_time-fElapsedTime);
|
||||||
notEnoughManaDisplay.second=std::max(0.f,notEnoughManaDisplay.second-fElapsedTime);
|
notEnoughManaDisplay.second=std::max(0.f,notEnoughManaDisplay.second-fElapsedTime);
|
||||||
@ -173,7 +172,7 @@ void Player::Update(float fElapsedTime){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Class-specific update events.
|
//Class-specific update events.
|
||||||
Update(fElapsedTime);
|
OnUpdate(fElapsedTime);
|
||||||
switch(state){
|
switch(state){
|
||||||
case SPIN:{
|
case SPIN:{
|
||||||
switch(facingDirection){
|
switch(facingDirection){
|
||||||
@ -258,7 +257,7 @@ void Player::Update(float fElapsedTime){
|
|||||||
for(Monster&m:MONSTER_LIST){
|
for(Monster&m:MONSTER_LIST){
|
||||||
if(iframe_time==0&&OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){
|
if(iframe_time==0&&OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){
|
||||||
if(m.IsAlive()){
|
if(m.IsAlive()){
|
||||||
m.Collision(*this);
|
m.Collision(this);
|
||||||
}
|
}
|
||||||
geom2d::line line(pos,m.GetPos());
|
geom2d::line line(pos,m.GetPos());
|
||||||
float dist = line.length();
|
float dist = line.length();
|
||||||
@ -390,8 +389,10 @@ void Player::AddAnimation(AnimationState state){
|
|||||||
animation.AddState(state,ANIMATION_DATA[state]);
|
animation.AddState(state,ANIMATION_DATA[state]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::UpdateAnimation(AnimationState animState){
|
void Player::UpdateAnimation(AnimationState animState,int specificClass){
|
||||||
|
if(specificClass==ANY||specificClass&GetClass()){
|
||||||
animation.ChangeState(internal_animState,animState);
|
animation.ChangeState(internal_animState,animState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Animate2D::Frame Player::GetFrame(){
|
Animate2D::Frame Player::GetFrame(){
|
||||||
|
170
Crawler/Player.h
170
Crawler/Player.h
@ -31,8 +31,8 @@ struct Player{
|
|||||||
Animate2D::Animation<AnimationState>animation;
|
Animate2D::Animation<AnimationState>animation;
|
||||||
Animate2D::AnimationState internal_animState;
|
Animate2D::AnimationState internal_animState;
|
||||||
Key lastReleasedMovementKey;
|
Key lastReleasedMovementKey;
|
||||||
void AddAnimation(AnimationState state);
|
|
||||||
void Update(float fElapsedTime);
|
void Update(float fElapsedTime);
|
||||||
|
void AddAnimation(AnimationState state);
|
||||||
std::vector<Buff>buffList;
|
std::vector<Buff>buffList;
|
||||||
protected:
|
protected:
|
||||||
const float ATTACK_COOLDOWN=0.35f;
|
const float ATTACK_COOLDOWN=0.35f;
|
||||||
@ -90,7 +90,8 @@ public:
|
|||||||
std::vector<Buff>GetBuffs(BuffType buff);
|
std::vector<Buff>GetBuffs(BuffType buff);
|
||||||
|
|
||||||
bool Hurt(int damage);
|
bool Hurt(int damage);
|
||||||
void UpdateAnimation(AnimationState animState);
|
//specificClass is a bitwise-combination of classes from the Class enum. It makes sure certain animations only play if you are a certain class.
|
||||||
|
void UpdateAnimation(AnimationState animState,int specificClass=ANY);
|
||||||
Animate2D::Frame GetFrame();
|
Animate2D::Frame GetFrame();
|
||||||
Key GetLastReleasedMovementKey();
|
Key GetLastReleasedMovementKey();
|
||||||
float GetSwordSwingTimer();
|
float GetSwordSwingTimer();
|
||||||
@ -100,6 +101,7 @@ public:
|
|||||||
virtual ~Player()=default;
|
virtual ~Player()=default;
|
||||||
virtual Class GetClass()=0;
|
virtual Class GetClass()=0;
|
||||||
virtual bool AutoAttack()=0;
|
virtual bool AutoAttack()=0;
|
||||||
|
virtual void OnUpdate(float fElapsedTime)=0;
|
||||||
virtual void InitializeClassAbilities()=0;
|
virtual void InitializeClassAbilities()=0;
|
||||||
virtual std::string GetClassName()=0;
|
virtual std::string GetClassName()=0;
|
||||||
virtual Ability&GetRightClickAbility()=0;
|
virtual Ability&GetRightClickAbility()=0;
|
||||||
@ -107,14 +109,14 @@ public:
|
|||||||
virtual Ability&GetAbility2()=0;
|
virtual Ability&GetAbility2()=0;
|
||||||
virtual Ability&GetAbility3()=0;
|
virtual Ability&GetAbility3()=0;
|
||||||
virtual Ability&GetAbility4()=0;
|
virtual Ability&GetAbility4()=0;
|
||||||
virtual AnimationState GetWalkNAnimation()=0;
|
virtual AnimationState&GetWalkNAnimation()=0;
|
||||||
virtual AnimationState GetWalkEAnimation()=0;
|
virtual AnimationState&GetWalkEAnimation()=0;
|
||||||
virtual AnimationState GetWalkSAnimation()=0;
|
virtual AnimationState&GetWalkSAnimation()=0;
|
||||||
virtual AnimationState GetWalkWAnimation()=0;
|
virtual AnimationState&GetWalkWAnimation()=0;
|
||||||
virtual AnimationState GetIdleNAnimation()=0;
|
virtual AnimationState&GetIdleNAnimation()=0;
|
||||||
virtual AnimationState GetIdleEAnimation()=0;
|
virtual AnimationState&GetIdleEAnimation()=0;
|
||||||
virtual AnimationState GetIdleSAnimation()=0;
|
virtual AnimationState&GetIdleSAnimation()=0;
|
||||||
virtual AnimationState GetIdleWAnimation()=0;
|
virtual AnimationState&GetIdleWAnimation()=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Warrior:Player{
|
struct Warrior:Player{
|
||||||
@ -122,8 +124,10 @@ struct Warrior:Player{
|
|||||||
static Class cl;
|
static Class cl;
|
||||||
static Ability rightClickAbility,ability1,ability2,ability3,ability4;
|
static Ability rightClickAbility,ability1,ability2,ability3,ability4;
|
||||||
static AnimationState walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w;
|
static AnimationState walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w;
|
||||||
|
Warrior();
|
||||||
Class GetClass()override;
|
Class GetClass()override;
|
||||||
bool AutoAttack()override;
|
bool AutoAttack()override;
|
||||||
|
void OnUpdate(float fElapsedTime)override;
|
||||||
void InitializeClassAbilities()override;
|
void InitializeClassAbilities()override;
|
||||||
std::string GetClassName()override;
|
std::string GetClassName()override;
|
||||||
Ability&GetRightClickAbility()override;
|
Ability&GetRightClickAbility()override;
|
||||||
@ -131,12 +135,142 @@ struct Warrior:Player{
|
|||||||
Ability&GetAbility2()override;
|
Ability&GetAbility2()override;
|
||||||
Ability&GetAbility3()override;
|
Ability&GetAbility3()override;
|
||||||
Ability&GetAbility4()override;
|
Ability&GetAbility4()override;
|
||||||
AnimationState GetWalkNAnimation()override;
|
AnimationState&GetWalkNAnimation()override;
|
||||||
AnimationState GetWalkEAnimation()override;
|
AnimationState&GetWalkEAnimation()override;
|
||||||
AnimationState GetWalkSAnimation()override;
|
AnimationState&GetWalkSAnimation()override;
|
||||||
AnimationState GetWalkWAnimation()override;
|
AnimationState&GetWalkWAnimation()override;
|
||||||
AnimationState GetIdleNAnimation()override;
|
AnimationState&GetIdleNAnimation()override;
|
||||||
AnimationState GetIdleEAnimation()override;
|
AnimationState&GetIdleEAnimation()override;
|
||||||
AnimationState GetIdleSAnimation()override;
|
AnimationState&GetIdleSAnimation()override;
|
||||||
AnimationState GetIdleWAnimation()override;
|
AnimationState&GetIdleWAnimation()override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Thief:Player{
|
||||||
|
static std::string name;
|
||||||
|
static Class cl;
|
||||||
|
static Ability rightClickAbility,ability1,ability2,ability3,ability4;
|
||||||
|
static AnimationState walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w;
|
||||||
|
Thief();
|
||||||
|
Class GetClass()override;
|
||||||
|
bool AutoAttack()override;
|
||||||
|
void OnUpdate(float fElapsedTime)override;
|
||||||
|
void InitializeClassAbilities()override;
|
||||||
|
std::string GetClassName()override;
|
||||||
|
Ability&GetRightClickAbility()override;
|
||||||
|
Ability&GetAbility1()override;
|
||||||
|
Ability&GetAbility2()override;
|
||||||
|
Ability&GetAbility3()override;
|
||||||
|
Ability&GetAbility4()override;
|
||||||
|
AnimationState&GetWalkNAnimation()override;
|
||||||
|
AnimationState&GetWalkEAnimation()override;
|
||||||
|
AnimationState&GetWalkSAnimation()override;
|
||||||
|
AnimationState&GetWalkWAnimation()override;
|
||||||
|
AnimationState&GetIdleNAnimation()override;
|
||||||
|
AnimationState&GetIdleEAnimation()override;
|
||||||
|
AnimationState&GetIdleSAnimation()override;
|
||||||
|
AnimationState&GetIdleWAnimation()override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Ranger:Player{
|
||||||
|
static std::string name;
|
||||||
|
static Class cl;
|
||||||
|
static Ability rightClickAbility,ability1,ability2,ability3,ability4;
|
||||||
|
static AnimationState walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w;
|
||||||
|
Ranger();
|
||||||
|
Class GetClass()override;
|
||||||
|
bool AutoAttack()override;
|
||||||
|
void OnUpdate(float fElapsedTime)override;
|
||||||
|
void InitializeClassAbilities()override;
|
||||||
|
std::string GetClassName()override;
|
||||||
|
Ability&GetRightClickAbility()override;
|
||||||
|
Ability&GetAbility1()override;
|
||||||
|
Ability&GetAbility2()override;
|
||||||
|
Ability&GetAbility3()override;
|
||||||
|
Ability&GetAbility4()override;
|
||||||
|
AnimationState&GetWalkNAnimation()override;
|
||||||
|
AnimationState&GetWalkEAnimation()override;
|
||||||
|
AnimationState&GetWalkSAnimation()override;
|
||||||
|
AnimationState&GetWalkWAnimation()override;
|
||||||
|
AnimationState&GetIdleNAnimation()override;
|
||||||
|
AnimationState&GetIdleEAnimation()override;
|
||||||
|
AnimationState&GetIdleSAnimation()override;
|
||||||
|
AnimationState&GetIdleWAnimation()override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Trapper:Player{
|
||||||
|
static std::string name;
|
||||||
|
static Class cl;
|
||||||
|
static Ability rightClickAbility,ability1,ability2,ability3,ability4;
|
||||||
|
static AnimationState walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w;
|
||||||
|
Trapper();
|
||||||
|
Class GetClass()override;
|
||||||
|
bool AutoAttack()override;
|
||||||
|
void OnUpdate(float fElapsedTime)override;
|
||||||
|
void InitializeClassAbilities()override;
|
||||||
|
std::string GetClassName()override;
|
||||||
|
Ability&GetRightClickAbility()override;
|
||||||
|
Ability&GetAbility1()override;
|
||||||
|
Ability&GetAbility2()override;
|
||||||
|
Ability&GetAbility3()override;
|
||||||
|
Ability&GetAbility4()override;
|
||||||
|
AnimationState&GetWalkNAnimation()override;
|
||||||
|
AnimationState&GetWalkEAnimation()override;
|
||||||
|
AnimationState&GetWalkSAnimation()override;
|
||||||
|
AnimationState&GetWalkWAnimation()override;
|
||||||
|
AnimationState&GetIdleNAnimation()override;
|
||||||
|
AnimationState&GetIdleEAnimation()override;
|
||||||
|
AnimationState&GetIdleSAnimation()override;
|
||||||
|
AnimationState&GetIdleWAnimation()override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Wizard:Player{
|
||||||
|
static std::string name;
|
||||||
|
static Class cl;
|
||||||
|
static Ability rightClickAbility,ability1,ability2,ability3,ability4;
|
||||||
|
static AnimationState walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w;
|
||||||
|
Wizard();
|
||||||
|
Class GetClass()override;
|
||||||
|
bool AutoAttack()override;
|
||||||
|
void OnUpdate(float fElapsedTime)override;
|
||||||
|
void InitializeClassAbilities()override;
|
||||||
|
std::string GetClassName()override;
|
||||||
|
Ability&GetRightClickAbility()override;
|
||||||
|
Ability&GetAbility1()override;
|
||||||
|
Ability&GetAbility2()override;
|
||||||
|
Ability&GetAbility3()override;
|
||||||
|
Ability&GetAbility4()override;
|
||||||
|
AnimationState&GetWalkNAnimation()override;
|
||||||
|
AnimationState&GetWalkEAnimation()override;
|
||||||
|
AnimationState&GetWalkSAnimation()override;
|
||||||
|
AnimationState&GetWalkWAnimation()override;
|
||||||
|
AnimationState&GetIdleNAnimation()override;
|
||||||
|
AnimationState&GetIdleEAnimation()override;
|
||||||
|
AnimationState&GetIdleSAnimation()override;
|
||||||
|
AnimationState&GetIdleWAnimation()override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Witch:Player{
|
||||||
|
static std::string name;
|
||||||
|
static Class cl;
|
||||||
|
static Ability rightClickAbility,ability1,ability2,ability3,ability4;
|
||||||
|
static AnimationState walk_n,walk_e,walk_s,walk_w,idle_n,idle_e,idle_s,idle_w;
|
||||||
|
Witch();
|
||||||
|
Class GetClass()override;
|
||||||
|
bool AutoAttack()override;
|
||||||
|
void OnUpdate(float fElapsedTime)override;
|
||||||
|
void InitializeClassAbilities()override;
|
||||||
|
std::string GetClassName()override;
|
||||||
|
Ability&GetRightClickAbility()override;
|
||||||
|
Ability&GetAbility1()override;
|
||||||
|
Ability&GetAbility2()override;
|
||||||
|
Ability&GetAbility3()override;
|
||||||
|
Ability&GetAbility4()override;
|
||||||
|
AnimationState&GetWalkNAnimation()override;
|
||||||
|
AnimationState&GetWalkEAnimation()override;
|
||||||
|
AnimationState&GetWalkSAnimation()override;
|
||||||
|
AnimationState&GetWalkWAnimation()override;
|
||||||
|
AnimationState&GetIdleNAnimation()override;
|
||||||
|
AnimationState&GetIdleEAnimation()override;
|
||||||
|
AnimationState&GetIdleSAnimation()override;
|
||||||
|
AnimationState&GetIdleWAnimation()override;
|
||||||
};
|
};
|
62
Crawler/Ranger.cpp
Normal file
62
Crawler/Ranger.cpp
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#include "Class.h"
|
||||||
|
#include "olcPixelGameEngine.h"
|
||||||
|
#include "DEFINES.h"
|
||||||
|
#include "Player.h"
|
||||||
|
#include "Effect.h"
|
||||||
|
#include "Crawler.h"
|
||||||
|
|
||||||
|
INCLUDE_MONSTER_LIST
|
||||||
|
INCLUDE_BULLET_LIST
|
||||||
|
INCLUDE_game
|
||||||
|
|
||||||
|
std::string Ranger::name="Ranger";
|
||||||
|
Class Ranger::cl=RANGER;
|
||||||
|
Ability Ranger::rightClickAbility={"Retreat",7,0,VERY_DARK_BLUE,DARK_BLUE};
|
||||||
|
Ability Ranger::ability1={"Rapid Fire",12,35};
|
||||||
|
Ability Ranger::ability2={"Charged Shot",15,40};
|
||||||
|
Ability Ranger::ability3={"Multishot",25,50};
|
||||||
|
Ability Ranger::ability4={"???",0,0};
|
||||||
|
AnimationState Ranger::idle_n=RANGER_IDLE_N;
|
||||||
|
AnimationState Ranger::idle_e=RANGER_IDLE_E;
|
||||||
|
AnimationState Ranger::idle_s=RANGER_IDLE_S;
|
||||||
|
AnimationState Ranger::idle_w=RANGER_IDLE_W;
|
||||||
|
AnimationState Ranger::walk_n=RANGER_WALK_N;
|
||||||
|
AnimationState Ranger::walk_e=RANGER_WALK_E;
|
||||||
|
AnimationState Ranger::walk_s=RANGER_WALK_S;
|
||||||
|
AnimationState Ranger::walk_w=RANGER_WALK_W;
|
||||||
|
|
||||||
|
SETUP_CLASS(Ranger)
|
||||||
|
|
||||||
|
void Ranger::OnUpdate(float fElapsedTime){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Ranger::AutoAttack(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
void Ranger::InitializeClassAbilities(){
|
||||||
|
#pragma region Ranger Right-click Ability (???)
|
||||||
|
Ranger::rightClickAbility.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Ranger Ability 1 (???)
|
||||||
|
Ranger::ability1.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Ranger Ability 2 (???)
|
||||||
|
Ranger::ability2.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Ranger Ability 3 (???)
|
||||||
|
Ranger::ability3.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
}
|
@ -18,7 +18,7 @@ struct Tileset{
|
|||||||
|
|
||||||
class TSXParser{
|
class TSXParser{
|
||||||
public:
|
public:
|
||||||
Tileset GetData();
|
Tileset&GetData();
|
||||||
private:
|
private:
|
||||||
Tileset parsedTilesetInfo;
|
Tileset parsedTilesetInfo;
|
||||||
void ParseTag(std::string tag);
|
void ParseTag(std::string tag);
|
||||||
@ -31,7 +31,7 @@ class TSXParser{
|
|||||||
|
|
||||||
#ifdef TSX_PARSER_SETUP
|
#ifdef TSX_PARSER_SETUP
|
||||||
#undef TSX_PARSER_SETUP
|
#undef TSX_PARSER_SETUP
|
||||||
Tileset TSXParser::GetData() {
|
Tileset&TSXParser::GetData() {
|
||||||
return parsedTilesetInfo;
|
return parsedTilesetInfo;
|
||||||
}
|
}
|
||||||
std::ostream&operator<<(std::ostream& os, Tileset& rhs){
|
std::ostream&operator<<(std::ostream& os, Tileset& rhs){
|
||||||
|
62
Crawler/Thief.cpp
Normal file
62
Crawler/Thief.cpp
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#include "Class.h"
|
||||||
|
#include "olcPixelGameEngine.h"
|
||||||
|
#include "DEFINES.h"
|
||||||
|
#include "Player.h"
|
||||||
|
#include "Effect.h"
|
||||||
|
#include "Crawler.h"
|
||||||
|
|
||||||
|
INCLUDE_MONSTER_LIST
|
||||||
|
INCLUDE_BULLET_LIST
|
||||||
|
INCLUDE_game
|
||||||
|
|
||||||
|
std::string Thief::name="Thief";
|
||||||
|
Class Thief::cl=THIEF;
|
||||||
|
Ability Thief::rightClickAbility={"???",15,0,VERY_DARK_BLUE,DARK_BLUE};
|
||||||
|
Ability Thief::ability1={"???",12,40};
|
||||||
|
Ability Thief::ability2={"???",15,50};
|
||||||
|
Ability Thief::ability3={"???",40,60};
|
||||||
|
Ability Thief::ability4={"???",0,0};
|
||||||
|
AnimationState Thief::idle_n=WARRIOR_IDLE_N;
|
||||||
|
AnimationState Thief::idle_e=WARRIOR_IDLE_E;
|
||||||
|
AnimationState Thief::idle_s=WARRIOR_IDLE_S;
|
||||||
|
AnimationState Thief::idle_w=WARRIOR_IDLE_W;
|
||||||
|
AnimationState Thief::walk_n=WARRIOR_WALK_N;
|
||||||
|
AnimationState Thief::walk_e=WARRIOR_WALK_E;
|
||||||
|
AnimationState Thief::walk_s=WARRIOR_WALK_S;
|
||||||
|
AnimationState Thief::walk_w=WARRIOR_WALK_W;
|
||||||
|
|
||||||
|
SETUP_CLASS(Thief)
|
||||||
|
|
||||||
|
void Thief::OnUpdate(float fElapsedTime){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Thief::AutoAttack(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
void Thief::InitializeClassAbilities(){
|
||||||
|
#pragma region Thief Right-click Ability (???)
|
||||||
|
Thief::rightClickAbility.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Thief Ability 1 (???)
|
||||||
|
Thief::ability1.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Thief Ability 2 (???)
|
||||||
|
Thief::ability2.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Thief Ability 3 (???)
|
||||||
|
Thief::ability3.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
}
|
62
Crawler/Trapper.cpp
Normal file
62
Crawler/Trapper.cpp
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#include "Class.h"
|
||||||
|
#include "olcPixelGameEngine.h"
|
||||||
|
#include "DEFINES.h"
|
||||||
|
#include "Player.h"
|
||||||
|
#include "Effect.h"
|
||||||
|
#include "Crawler.h"
|
||||||
|
|
||||||
|
INCLUDE_MONSTER_LIST
|
||||||
|
INCLUDE_BULLET_LIST
|
||||||
|
INCLUDE_game
|
||||||
|
|
||||||
|
std::string Trapper::name="Trapper";
|
||||||
|
Class Trapper::cl=TRAPPER;
|
||||||
|
Ability Trapper::rightClickAbility={"???",15,0,VERY_DARK_BLUE,DARK_BLUE};
|
||||||
|
Ability Trapper::ability1={"???",12,40};
|
||||||
|
Ability Trapper::ability2={"???",15,50};
|
||||||
|
Ability Trapper::ability3={"???",40,60};
|
||||||
|
Ability Trapper::ability4={"???",0,0};
|
||||||
|
AnimationState Trapper::idle_n=WARRIOR_IDLE_N;
|
||||||
|
AnimationState Trapper::idle_e=WARRIOR_IDLE_E;
|
||||||
|
AnimationState Trapper::idle_s=WARRIOR_IDLE_S;
|
||||||
|
AnimationState Trapper::idle_w=WARRIOR_IDLE_W;
|
||||||
|
AnimationState Trapper::walk_n=WARRIOR_WALK_N;
|
||||||
|
AnimationState Trapper::walk_e=WARRIOR_WALK_E;
|
||||||
|
AnimationState Trapper::walk_s=WARRIOR_WALK_S;
|
||||||
|
AnimationState Trapper::walk_w=WARRIOR_WALK_W;
|
||||||
|
|
||||||
|
SETUP_CLASS(Trapper)
|
||||||
|
|
||||||
|
void Trapper::OnUpdate(float fElapsedTime){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Trapper::AutoAttack(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
void Trapper::InitializeClassAbilities(){
|
||||||
|
#pragma region Trapper Right-click Ability (???)
|
||||||
|
Trapper::rightClickAbility.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Trapper Ability 1 (???)
|
||||||
|
Trapper::ability1.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Trapper Ability 2 (???)
|
||||||
|
Trapper::ability2.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Trapper Ability 3 (???)
|
||||||
|
Trapper::ability3.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
}
|
@ -16,9 +16,21 @@ Ability Warrior::ability1={"Battlecry",12,40};
|
|||||||
Ability Warrior::ability2={"Ground Slam",15,50};
|
Ability Warrior::ability2={"Ground Slam",15,50};
|
||||||
Ability Warrior::ability3={"Sonic Slash",40,60};
|
Ability Warrior::ability3={"Sonic Slash",40,60};
|
||||||
Ability Warrior::ability4={"???",0,0};
|
Ability Warrior::ability4={"???",0,0};
|
||||||
|
AnimationState Warrior::idle_n=WARRIOR_IDLE_N;
|
||||||
|
AnimationState Warrior::idle_e=WARRIOR_IDLE_E;
|
||||||
|
AnimationState Warrior::idle_s=WARRIOR_IDLE_S;
|
||||||
|
AnimationState Warrior::idle_w=WARRIOR_IDLE_W;
|
||||||
|
AnimationState Warrior::walk_n=WARRIOR_WALK_N;
|
||||||
|
AnimationState Warrior::walk_e=WARRIOR_WALK_E;
|
||||||
|
AnimationState Warrior::walk_s=WARRIOR_WALK_S;
|
||||||
|
AnimationState Warrior::walk_w=WARRIOR_WALK_W;
|
||||||
|
|
||||||
SETUP_CLASS(Warrior)
|
SETUP_CLASS(Warrior)
|
||||||
|
|
||||||
|
void Warrior::OnUpdate(float fElapsedTime){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
bool Warrior::AutoAttack(){
|
bool Warrior::AutoAttack(){
|
||||||
if(GetState()!=State::SPIN){
|
if(GetState()!=State::SPIN){
|
||||||
bool attack=false;
|
bool attack=false;
|
||||||
@ -39,16 +51,16 @@ bool Warrior::AutoAttack(){
|
|||||||
SetState(State::SWING_SWORD);
|
SetState(State::SWING_SWORD);
|
||||||
switch(facingDirection){
|
switch(facingDirection){
|
||||||
case DOWN:{
|
case DOWN:{
|
||||||
UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_S);
|
UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_S,WARRIOR|THIEF);
|
||||||
}break;
|
}break;
|
||||||
case RIGHT:{
|
case RIGHT:{
|
||||||
UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_E);
|
UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_E,WARRIOR|THIEF);
|
||||||
}break;
|
}break;
|
||||||
case LEFT:{
|
case LEFT:{
|
||||||
UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_W);
|
UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_W,WARRIOR|THIEF);
|
||||||
}break;
|
}break;
|
||||||
case UP:{
|
case UP:{
|
||||||
UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_N);
|
UpdateAnimation(AnimationState::WARRIOR_SWINGSWORD_N,WARRIOR|THIEF);
|
||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -100,22 +112,22 @@ void Warrior::InitializeClassAbilities(){
|
|||||||
case UP:{
|
case UP:{
|
||||||
vel.y=70;
|
vel.y=70;
|
||||||
bulletVel.y=-400;
|
bulletVel.y=-400;
|
||||||
UpdateAnimation(AnimationState::WARRIOR_SWINGSONICSWORD_N);
|
UpdateAnimation(AnimationState::WARRIOR_SWINGSONICSWORD_N,WARRIOR);
|
||||||
}break;
|
}break;
|
||||||
case LEFT:{
|
case LEFT:{
|
||||||
vel.x=70;
|
vel.x=70;
|
||||||
bulletVel.x=-400;
|
bulletVel.x=-400;
|
||||||
UpdateAnimation(AnimationState::WARRIOR_SWINGSONICSWORD_W);
|
UpdateAnimation(AnimationState::WARRIOR_SWINGSONICSWORD_W,WARRIOR);
|
||||||
}break;
|
}break;
|
||||||
case RIGHT:{
|
case RIGHT:{
|
||||||
vel.x=-70;
|
vel.x=-70;
|
||||||
bulletVel.x=400;
|
bulletVel.x=400;
|
||||||
UpdateAnimation(AnimationState::WARRIOR_SWINGSONICSWORD_E);
|
UpdateAnimation(AnimationState::WARRIOR_SWINGSONICSWORD_E,WARRIOR);
|
||||||
}break;
|
}break;
|
||||||
case DOWN:{
|
case DOWN:{
|
||||||
vel.y=-70;
|
vel.y=-70;
|
||||||
bulletVel.y=400;
|
bulletVel.y=400;
|
||||||
UpdateAnimation(AnimationState::WARRIOR_SWINGSONICSWORD_S);
|
UpdateAnimation(AnimationState::WARRIOR_SWINGSONICSWORD_S,WARRIOR);
|
||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
BULLET_LIST.push_back(std::make_unique<Bullet>(GetPos(),bulletVel,30,GetAttack()*8,AnimationState::SONICSLASH,upperLevel,true,2.25,true,true,WHITE));
|
BULLET_LIST.push_back(std::make_unique<Bullet>(GetPos(),bulletVel,30,GetAttack()*8,AnimationState::SONICSLASH,upperLevel,true,2.25,true,true,WHITE));
|
||||||
|
62
Crawler/Witch.cpp
Normal file
62
Crawler/Witch.cpp
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#include "Class.h"
|
||||||
|
#include "olcPixelGameEngine.h"
|
||||||
|
#include "DEFINES.h"
|
||||||
|
#include "Player.h"
|
||||||
|
#include "Effect.h"
|
||||||
|
#include "Crawler.h"
|
||||||
|
|
||||||
|
INCLUDE_MONSTER_LIST
|
||||||
|
INCLUDE_BULLET_LIST
|
||||||
|
INCLUDE_game
|
||||||
|
|
||||||
|
std::string Witch::name="Witch";
|
||||||
|
Class Witch::cl=WITCH;
|
||||||
|
Ability Witch::rightClickAbility={"???",15,0,VERY_DARK_BLUE,DARK_BLUE};
|
||||||
|
Ability Witch::ability1={"???",12,40};
|
||||||
|
Ability Witch::ability2={"???",15,50};
|
||||||
|
Ability Witch::ability3={"???",40,60};
|
||||||
|
Ability Witch::ability4={"???",0,0};
|
||||||
|
AnimationState Witch::idle_n=WARRIOR_IDLE_N;
|
||||||
|
AnimationState Witch::idle_e=WARRIOR_IDLE_E;
|
||||||
|
AnimationState Witch::idle_s=WARRIOR_IDLE_S;
|
||||||
|
AnimationState Witch::idle_w=WARRIOR_IDLE_W;
|
||||||
|
AnimationState Witch::walk_n=WARRIOR_WALK_N;
|
||||||
|
AnimationState Witch::walk_e=WARRIOR_WALK_E;
|
||||||
|
AnimationState Witch::walk_s=WARRIOR_WALK_S;
|
||||||
|
AnimationState Witch::walk_w=WARRIOR_WALK_W;
|
||||||
|
|
||||||
|
SETUP_CLASS(Witch)
|
||||||
|
|
||||||
|
void Witch::OnUpdate(float fElapsedTime){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Witch::AutoAttack(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
void Witch::InitializeClassAbilities(){
|
||||||
|
#pragma region Witch Right-click Ability (???)
|
||||||
|
Witch::rightClickAbility.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Witch Ability 1 (???)
|
||||||
|
Witch::ability1.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Witch Ability 2 (???)
|
||||||
|
Witch::ability2.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Witch Ability 3 (???)
|
||||||
|
Witch::ability3.action=
|
||||||
|
[&](){
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
}
|
128
Crawler/Wizard.cpp
Normal file
128
Crawler/Wizard.cpp
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
#include "Class.h"
|
||||||
|
#include "olcPixelGameEngine.h"
|
||||||
|
#include "DEFINES.h"
|
||||||
|
#include "Player.h"
|
||||||
|
#include "Effect.h"
|
||||||
|
#include "Crawler.h"
|
||||||
|
#include "BulletTypes.h"
|
||||||
|
|
||||||
|
INCLUDE_MONSTER_LIST
|
||||||
|
INCLUDE_BULLET_LIST
|
||||||
|
INCLUDE_game
|
||||||
|
|
||||||
|
std::string Wizard::name="Wizard";
|
||||||
|
Class Wizard::cl=WIZARD;
|
||||||
|
Ability Wizard::rightClickAbility={"Teleport",8,5,VERY_DARK_BLUE,DARK_BLUE};
|
||||||
|
Ability Wizard::ability1={"Firebolt",6,30};
|
||||||
|
Ability Wizard::ability2={"Lightning Bolt",6,25};
|
||||||
|
Ability Wizard::ability3={"Meteor",40,75};
|
||||||
|
Ability Wizard::ability4={"???",0,0};
|
||||||
|
AnimationState Wizard::idle_n=WIZARD_IDLE_N;
|
||||||
|
AnimationState Wizard::idle_e=WIZARD_IDLE_E;
|
||||||
|
AnimationState Wizard::idle_s=WIZARD_IDLE_S;
|
||||||
|
AnimationState Wizard::idle_w=WIZARD_IDLE_W;
|
||||||
|
AnimationState Wizard::walk_n=WIZARD_WALK_N;
|
||||||
|
AnimationState Wizard::walk_e=WIZARD_WALK_E;
|
||||||
|
AnimationState Wizard::walk_s=WIZARD_WALK_S;
|
||||||
|
AnimationState Wizard::walk_w=WIZARD_WALK_W;
|
||||||
|
|
||||||
|
SETUP_CLASS(Wizard)
|
||||||
|
|
||||||
|
void Wizard::OnUpdate(float fElapsedTime){
|
||||||
|
if(attack_cooldown_timer>0){
|
||||||
|
idle_n=AnimationState::WIZARD_IDLE_ATTACK_N;
|
||||||
|
idle_e=AnimationState::WIZARD_IDLE_ATTACK_E;
|
||||||
|
idle_s=AnimationState::WIZARD_IDLE_ATTACK_S;
|
||||||
|
idle_w=AnimationState::WIZARD_IDLE_ATTACK_W;
|
||||||
|
walk_n=AnimationState::WIZARD_ATTACK_N;
|
||||||
|
walk_e=AnimationState::WIZARD_ATTACK_E;
|
||||||
|
walk_s=AnimationState::WIZARD_ATTACK_S;
|
||||||
|
walk_w=AnimationState::WIZARD_ATTACK_W;
|
||||||
|
} else {
|
||||||
|
idle_n=AnimationState::WIZARD_IDLE_N;
|
||||||
|
idle_e=AnimationState::WIZARD_IDLE_E;
|
||||||
|
idle_s=AnimationState::WIZARD_IDLE_S;
|
||||||
|
idle_w=AnimationState::WIZARD_IDLE_W;
|
||||||
|
walk_n=AnimationState::WIZARD_WALK_N;
|
||||||
|
walk_e=AnimationState::WIZARD_WALK_E;
|
||||||
|
walk_s=AnimationState::WIZARD_WALK_S;
|
||||||
|
walk_w=AnimationState::WIZARD_WALK_W;
|
||||||
|
}
|
||||||
|
if(GetState()==State::CASTING){
|
||||||
|
switch(GetFacingDirection()){
|
||||||
|
case UP:{
|
||||||
|
UpdateAnimation(AnimationState::WIZARD_CAST_N,WIZARD|WITCH);
|
||||||
|
}break;
|
||||||
|
case DOWN:{
|
||||||
|
UpdateAnimation(AnimationState::WIZARD_CAST_S,WIZARD|WITCH);
|
||||||
|
}break;
|
||||||
|
case LEFT:{
|
||||||
|
UpdateAnimation(AnimationState::WIZARD_CAST_W,WIZARD|WITCH);
|
||||||
|
}break;
|
||||||
|
case RIGHT:{
|
||||||
|
UpdateAnimation(AnimationState::WIZARD_CAST_E,WIZARD|WITCH);
|
||||||
|
}break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Wizard::AutoAttack(){
|
||||||
|
attack_cooldown_timer=MAGIC_ATTACK_COOLDOWN;
|
||||||
|
float angleToCursor=atan2(game->GetWorldMousePos().y-GetPos().y,game->GetWorldMousePos().x-GetPos().x);
|
||||||
|
BULLET_LIST.push_back(std::make_unique<EnergyBolt>(EnergyBolt(GetPos(),{cos(angleToCursor)*200,sin(angleToCursor)*200},12,GetAttack(),upperLevel,true,WHITE)));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
void Wizard::InitializeClassAbilities(){
|
||||||
|
#pragma region Wizard Right-click Ability (???)
|
||||||
|
Wizard::rightClickAbility.action=
|
||||||
|
[&](){
|
||||||
|
float pointMouseDirection=atan2(game->GetWorldMousePos().y-GetPos().y,game->GetWorldMousePos().x-GetPos().x);
|
||||||
|
vf2d pointTowardsMouse={cos(pointMouseDirection),sin(pointMouseDirection)};
|
||||||
|
float dist=std::clamp(geom2d::line<float>{GetPos(),game->GetWorldMousePos()}.length(),0.f,6.5f*24);
|
||||||
|
if(dist<12)return false;
|
||||||
|
vf2d teleportPoint=GetPos()+pointTowardsMouse*dist;
|
||||||
|
while(dist>0&&game->HasTileCollision(game->GetCurrentLevel(),teleportPoint)&&CanPathfindTo(GetPos(),teleportPoint)){
|
||||||
|
dist-=24;
|
||||||
|
teleportPoint=GetPos()+pointTowardsMouse*dist;
|
||||||
|
}
|
||||||
|
if(dist>0&&CanPathfindTo(GetPos(),teleportPoint)){
|
||||||
|
SetState(State::TELEPORT);
|
||||||
|
teleportAnimationTimer=0.35;
|
||||||
|
teleportTarget=teleportPoint;
|
||||||
|
teleportStartPosition=GetPos();
|
||||||
|
iframe_time=0.35;
|
||||||
|
for(int i=0;i<16;i++){
|
||||||
|
game->AddEffect(std::make_unique<Effect>(GetPos()+vf2d{(rand()%160-80)/10.f,(rand()%160-80)/10.f},float(rand()%300)/1000,AnimationState::DOT_PARTICLE,upperLevel,0.3,0.2,vf2d{float(rand()%1000-500)/100,float(rand()%1000-500)/100},BLACK));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
notificationDisplay={"Cannot Teleport to that location!",0.5};
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Wizard Ability 1 (???)
|
||||||
|
Wizard::ability1.action=
|
||||||
|
[&](){
|
||||||
|
float angleToCursor=atan2(game->GetWorldMousePos().y-GetPos().y,game->GetWorldMousePos().x-GetPos().x);
|
||||||
|
BULLET_LIST.push_back(std::make_unique<FireBolt>(FireBolt(GetPos(),{cos(angleToCursor)*275,sin(angleToCursor)*275},12,GetAttack(),upperLevel,true,{240,120,60})));
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Wizard Ability 2 (???)
|
||||||
|
Wizard::ability2.action=
|
||||||
|
[&](){
|
||||||
|
float angleToCursor=atan2(game->GetWorldMousePos().y-GetPos().y,game->GetWorldMousePos().x-GetPos().x);
|
||||||
|
BULLET_LIST.push_back(std::make_unique<LightningBolt>(LightningBolt(GetPos(),{cos(angleToCursor)*230,sin(angleToCursor)*230},12,GetAttack()*4,upperLevel,true,WHITE)));
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
#pragma region Wizard Ability 3 (???)
|
||||||
|
Wizard::ability3.action=
|
||||||
|
[&](){
|
||||||
|
SetState(State::CASTING);
|
||||||
|
game->AddEffect(std::make_unique<Meteor>(GetPos(),3,AnimationState::METEOR,OnUpperLevel(),vf2d{1,1},2));
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
#pragma endregion
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
export AUTO_UPDATE=true
|
export AUTO_UPDATE=false
|
||||||
|
|
||||||
source utils/define.sh
|
source utils/define.sh
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user