Fix Warrior slowdown cancel bug (#16). Added debug configuration options to display collision and hidden player info on-screen. Release Build 935.
This commit is contained in:
parent
2486627adf
commit
23d1d800d5
Crawler
Buff.hCrawler.cppCrawler.vcxprojMonster.cppMonster.hPlayer.cppPlayer.hVersion.hWarrior.cpp
assets/config
x64/Release Desktop
@ -3,6 +3,7 @@ enum BuffType{
|
|||||||
ATTACK_UP,
|
ATTACK_UP,
|
||||||
DAMAGE_REDUCTION,
|
DAMAGE_REDUCTION,
|
||||||
SLOWDOWN,
|
SLOWDOWN,
|
||||||
|
BLOCK_SLOWDOWN,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Buff{
|
struct Buff{
|
||||||
|
@ -18,9 +18,6 @@
|
|||||||
|
|
||||||
INCLUDE_EMITTER_LIST
|
INCLUDE_EMITTER_LIST
|
||||||
|
|
||||||
//#define DEBUG_COLLISIONS //Shows collision hitboxes.
|
|
||||||
//#define DEBUG_POS //Shows player position.
|
|
||||||
|
|
||||||
//192x192
|
//192x192
|
||||||
vi2d WINDOW_SIZE={24*15,24*10};
|
vi2d WINDOW_SIZE={24*15,24*10};
|
||||||
std::map<AnimationState,Animate2D::FrameSequence>ANIMATION_DATA;
|
std::map<AnimationState,Animate2D::FrameSequence>ANIMATION_DATA;
|
||||||
@ -565,13 +562,13 @@ void Crawler::RenderWorld(float fElapsedTime){
|
|||||||
if(!IsForegroundTile(tileSheet,tileSheetIndex)&&!IsUpperForegroundTile(tileSheet,tileSheetIndex)){
|
if(!IsForegroundTile(tileSheet,tileSheetIndex)&&!IsUpperForegroundTile(tileSheet,tileSheetIndex)){
|
||||||
view.DrawPartialDecal(vi2d{x,y}*24,{24,24},tileSheet.tileset.tileset->Decal(),vi2d{tileSheetX,tileSheetY}*24,{24,24});
|
view.DrawPartialDecal(vi2d{x,y}*24,{24,24},tileSheet.tileset.tileset->Decal(),vi2d{tileSheetX,tileSheetY}*24,{24,24});
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_COLLISIONS
|
if("debug_collision_boxes"_I){
|
||||||
if(tileSheet.tileset.collision.find(tileSheetIndex)!=tileSheet.tileset.collision.end()){
|
if(tileSheet.tileset.collision.find(tileSheetIndex)!=tileSheet.tileset.collision.end()){
|
||||||
geom2d::rect<int>collision=tileSheet.tileset.collision[tileSheetIndex].collision;
|
geom2d::rect<int>collision=tileSheet.tileset.collision[tileSheetIndex].collision;
|
||||||
view.FillRectDecal(vi2d{x,y}*24+collision.pos,collision.size,{0,0,0,128});
|
view.FillRectDecal(vi2d{x,y}*24+collision.pos,collision.size,{0,0,0,128});
|
||||||
view.DrawRectDecal(vi2d{x,y}*24+collision.pos,collision.size,GREY);
|
view.DrawRectDecal(vi2d{x,y}*24+collision.pos,collision.size,GREY);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -824,10 +821,10 @@ void Crawler::RenderHud(){
|
|||||||
}
|
}
|
||||||
std::string versionStr("v" + std::to_string(VERSION_MAJOR) + "." + std::to_string(VERSION_MINOR) + "." + std::to_string(VERSION_PATCH) + "." + std::to_string(VERSION_BUILD));
|
std::string versionStr("v" + std::to_string(VERSION_MAJOR) + "." + std::to_string(VERSION_MINOR) + "." + std::to_string(VERSION_PATCH) + "." + std::to_string(VERSION_BUILD));
|
||||||
DrawShadowStringDecal(vf2d{ GetScreenSize() } - vf2d{ GetTextSize(versionStr) }*0.4,versionStr,WHITE,BLACK,{0.4,0.4},0.4);
|
DrawShadowStringDecal(vf2d{ GetScreenSize() } - vf2d{ GetTextSize(versionStr) }*0.4,versionStr,WHITE,BLACK,{0.4,0.4},0.4);
|
||||||
|
if("debug_player_info"_I){
|
||||||
#ifdef DEBUG_POS
|
|
||||||
DrawShadowStringDecal({0,128},player->GetPos().str());
|
DrawShadowStringDecal({0,128},player->GetPos().str());
|
||||||
#endif
|
DrawShadowStringDecal({0,136},"Spd: "+std::to_string(player->GetMoveSpdMult()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Crawler::AddEffect(std::unique_ptr<Effect>foreground,std::unique_ptr<Effect> background){
|
void Crawler::AddEffect(std::unique_ptr<Effect>foreground,std::unique_ptr<Effect> background){
|
||||||
|
@ -118,6 +118,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
@ -135,6 +136,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
@ -154,6 +156,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
@ -171,7 +174,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
@ -193,7 +196,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
@ -216,7 +219,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
@ -236,11 +239,17 @@
|
|||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
</Link>
|
</Link>
|
||||||
|
<ClCompile>
|
||||||
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
|
</ClCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Emscripten|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Emscripten|x64'">
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
</Link>
|
</Link>
|
||||||
|
<ClCompile>
|
||||||
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
|
</ClCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Ability.h" />
|
<ClInclude Include="Ability.h" />
|
||||||
|
@ -126,7 +126,7 @@ bool Monster::Update(float fElapsedTime){
|
|||||||
SetPosition(line.rpoint(-0.1));
|
SetPosition(line.rpoint(-0.1));
|
||||||
vel=line.vector().norm()*-128;
|
vel=line.vector().norm()*-128;
|
||||||
}
|
}
|
||||||
if(state==NORMAL){
|
if(GetState()==State::NORMAL){
|
||||||
if(game->GetPlayer()->GetX()>pos.x){
|
if(game->GetPlayer()->GetX()>pos.x){
|
||||||
facingDirection=RIGHT;
|
facingDirection=RIGHT;
|
||||||
} else {
|
} else {
|
||||||
@ -139,7 +139,7 @@ bool Monster::Update(float fElapsedTime){
|
|||||||
if(targetAcquireTimer==0){
|
if(targetAcquireTimer==0){
|
||||||
targetAcquireTimer=3;
|
targetAcquireTimer=3;
|
||||||
target=geom2d::line(pos,game->GetPlayer()->GetPos()).upoint(1.2);
|
target=geom2d::line(pos,game->GetPlayer()->GetPos()).upoint(1.2);
|
||||||
state=MOVE_TOWARDS;
|
SetState(MOVE_TOWARDS);
|
||||||
hasHitPlayer=false;
|
hasHitPlayer=false;
|
||||||
}
|
}
|
||||||
switch(state){
|
switch(state){
|
||||||
@ -151,7 +151,7 @@ bool Monster::Update(float fElapsedTime){
|
|||||||
}
|
}
|
||||||
PerformJumpAnimation();
|
PerformJumpAnimation();
|
||||||
} else {
|
} else {
|
||||||
state=NORMAL;//Revert state once we've finished moving towards target.
|
SetState(NORMAL);//Revert state once we've finished moving towards target.
|
||||||
UpdateAnimation(MONSTER_DATA[type].GetAnimations()[0]);
|
UpdateAnimation(MONSTER_DATA[type].GetAnimations()[0]);
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
@ -180,16 +180,16 @@ bool Monster::Update(float fElapsedTime){
|
|||||||
if(line.length()<24*6){
|
if(line.length()<24*6){
|
||||||
target=line.upoint(-1.2);
|
target=line.upoint(-1.2);
|
||||||
if(canMove){
|
if(canMove){
|
||||||
state=MOVE_AWAY;
|
SetState(MOVE_AWAY);
|
||||||
} else {
|
} else {
|
||||||
state=NORMAL;
|
SetState(NORMAL);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if(line.length()>24*7){
|
if(line.length()>24*7){
|
||||||
target=line.upoint(1.2);
|
target=line.upoint(1.2);
|
||||||
state=MOVE_TOWARDS;
|
SetState(MOVE_TOWARDS);
|
||||||
} else {
|
} else {
|
||||||
state=NORMAL;
|
SetState(NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
canMove=true;
|
canMove=true;
|
||||||
@ -208,7 +208,7 @@ bool Monster::Update(float fElapsedTime){
|
|||||||
StartPathfinding(2.5);
|
StartPathfinding(2.5);
|
||||||
}else
|
}else
|
||||||
if(line.length()<=24*7){
|
if(line.length()<=24*7){
|
||||||
state=NORMAL;
|
SetState(NORMAL);
|
||||||
}
|
}
|
||||||
if(moveTowardsLine.vector().x>0){
|
if(moveTowardsLine.vector().x>0){
|
||||||
facingDirection=RIGHT;
|
facingDirection=RIGHT;
|
||||||
@ -229,7 +229,7 @@ bool Monster::Update(float fElapsedTime){
|
|||||||
StartPathfinding(2.5);
|
StartPathfinding(2.5);
|
||||||
}else
|
}else
|
||||||
if(line.length()>=24*6){
|
if(line.length()>=24*6){
|
||||||
state=NORMAL;
|
SetState(NORMAL);
|
||||||
}
|
}
|
||||||
if(moveTowardsLine.vector().x>0){
|
if(moveTowardsLine.vector().x>0){
|
||||||
facingDirection=RIGHT;
|
facingDirection=RIGHT;
|
||||||
@ -297,8 +297,8 @@ void Monster::Collision(Monster&m){
|
|||||||
Collision();
|
Collision();
|
||||||
}
|
}
|
||||||
void Monster::Collision(){
|
void Monster::Collision(){
|
||||||
if(strategy==RUN_TOWARDS&&state==MOVE_TOWARDS){
|
if(strategy==RUN_TOWARDS&&GetState()==MOVE_TOWARDS){
|
||||||
state=NORMAL;
|
SetState(NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Monster::SetVelocity(vf2d vel){
|
void Monster::SetVelocity(vf2d vel){
|
||||||
@ -392,7 +392,7 @@ void Monster::AddBuff(BuffType type,float duration,float intensity){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Monster::StartPathfinding(float pathingTime){
|
void Monster::StartPathfinding(float pathingTime){
|
||||||
state=State::PATH_AROUND;
|
SetState(PATH_AROUND);
|
||||||
path=game->pathfinder.Solve_AStar(pos,target,12,OnUpperLevel());
|
path=game->pathfinder.Solve_AStar(pos,target,12,OnUpperLevel());
|
||||||
if(path.size()>0){
|
if(path.size()>0){
|
||||||
pathIndex=0;
|
pathIndex=0;
|
||||||
@ -431,3 +431,11 @@ std::vector<Buff>Monster::GetBuffs(BuffType buff){
|
|||||||
std::copy_if(buffList.begin(),buffList.end(),std::back_inserter(filteredBuffs),[buff](Buff&b){return b.type==buff;});
|
std::copy_if(buffList.begin(),buffList.end(),std::back_inserter(filteredBuffs),[buff](Buff&b){return b.type==buff;});
|
||||||
return filteredBuffs;
|
return filteredBuffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
State Monster::GetState(){
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Monster::SetState(State newState){
|
||||||
|
state=newState;
|
||||||
|
}
|
@ -125,6 +125,8 @@ protected:
|
|||||||
void PathAroundBehavior(float fElapsedTime);
|
void PathAroundBehavior(float fElapsedTime);
|
||||||
void AddBuff(BuffType type,float duration,float intensity);
|
void AddBuff(BuffType type,float duration,float intensity);
|
||||||
std::vector<Buff>GetBuffs(BuffType buff);
|
std::vector<Buff>GetBuffs(BuffType buff);
|
||||||
|
State GetState();
|
||||||
|
void SetState(State newState);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MonsterSpawner{
|
struct MonsterSpawner{
|
||||||
|
@ -139,7 +139,10 @@ int Player::GetAttack(){
|
|||||||
float Player::GetMoveSpdMult(){
|
float Player::GetMoveSpdMult(){
|
||||||
float mod_moveSpd=moveSpd;
|
float mod_moveSpd=moveSpd;
|
||||||
for(Buff&b:GetBuffs(BuffType::SLOWDOWN)){
|
for(Buff&b:GetBuffs(BuffType::SLOWDOWN)){
|
||||||
mod_moveSpd-=moveSpd*b.intensity;
|
mod_moveSpd-=mod_moveSpd*b.intensity;
|
||||||
|
}
|
||||||
|
for(Buff&b:GetBuffs(BuffType::BLOCK_SLOWDOWN)){
|
||||||
|
mod_moveSpd-=mod_moveSpd*b.intensity;
|
||||||
}
|
}
|
||||||
return mod_moveSpd;
|
return mod_moveSpd;
|
||||||
}
|
}
|
||||||
@ -171,6 +174,7 @@ void Player::Update(float fElapsedTime){
|
|||||||
notEnoughManaDisplay.second=std::max(0.f,notEnoughManaDisplay.second-fElapsedTime);
|
notEnoughManaDisplay.second=std::max(0.f,notEnoughManaDisplay.second-fElapsedTime);
|
||||||
notificationDisplay.second=std::max(0.f,notificationDisplay.second-fElapsedTime);
|
notificationDisplay.second=std::max(0.f,notificationDisplay.second-fElapsedTime);
|
||||||
lastHitTimer=std::max(0.f,lastHitTimer-fElapsedTime);
|
lastHitTimer=std::max(0.f,lastHitTimer-fElapsedTime);
|
||||||
|
blockTimer=std::max(0.f,blockTimer-fElapsedTime);
|
||||||
manaTickTimer-=fElapsedTime;
|
manaTickTimer-=fElapsedTime;
|
||||||
if(castInfo.castTimer>0){
|
if(castInfo.castTimer>0){
|
||||||
castInfo.castTimer-=fElapsedTime;
|
castInfo.castTimer-=fElapsedTime;
|
||||||
@ -237,7 +241,7 @@ void Player::Update(float fElapsedTime){
|
|||||||
animation.UpdateState(internal_animState,fElapsedTime);
|
animation.UpdateState(internal_animState,fElapsedTime);
|
||||||
}break;
|
}break;
|
||||||
case BLOCK:{
|
case BLOCK:{
|
||||||
if(rightClickAbility.COOLDOWN_TIME-rightClickAbility.cooldown>"Warrior.Right Click Ability.Duration"_F){
|
if(blockTimer<=0){
|
||||||
SetState(NORMAL);
|
SetState(NORMAL);
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
@ -457,6 +461,9 @@ void Player::SetSwordSwingTimer(float val){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Player::SetState(State newState){
|
void Player::SetState(State newState){
|
||||||
|
if(GetState()==State::BLOCK){
|
||||||
|
RemoveAllBuffs(BuffType::BLOCK_SLOWDOWN);
|
||||||
|
}
|
||||||
state=newState;
|
state=newState;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,7 +481,7 @@ bool Player::HasIframes(){
|
|||||||
|
|
||||||
bool Player::Hurt(int damage,bool onUpperLevel){
|
bool Player::Hurt(int damage,bool onUpperLevel){
|
||||||
if(hp<=0||iframe_time!=0||OnUpperLevel()!=onUpperLevel) return false;
|
if(hp<=0||iframe_time!=0||OnUpperLevel()!=onUpperLevel) return false;
|
||||||
if(state==State::BLOCK)damage*=1-"Warrior.Right Click Ability.DamageReduction"_F;
|
if(GetState()==State::BLOCK)damage*=1-"Warrior.Right Click Ability.DamageReduction"_F;
|
||||||
float mod_dmg=damage;
|
float mod_dmg=damage;
|
||||||
for(Buff&b:GetBuffs(BuffType::DAMAGE_REDUCTION)){
|
for(Buff&b:GetBuffs(BuffType::DAMAGE_REDUCTION)){
|
||||||
mod_dmg-=damage*b.intensity;
|
mod_dmg-=damage*b.intensity;
|
||||||
@ -542,7 +549,7 @@ void Player::Moved(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Player::Spin(float duration,float spinSpd){
|
void Player::Spin(float duration,float spinSpd){
|
||||||
state=State::SPIN;
|
SetState(State::SPIN);
|
||||||
spin_attack_timer=duration;
|
spin_attack_timer=duration;
|
||||||
spin_spd=spinSpd;
|
spin_spd=spinSpd;
|
||||||
spin_angle=0;
|
spin_angle=0;
|
||||||
@ -584,6 +591,24 @@ std::vector<Buff>Player::GetBuffs(BuffType buff){
|
|||||||
return filteredBuffs;
|
return filteredBuffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::RemoveBuff(BuffType buff){
|
||||||
|
for(auto it=buffList.begin();it!=buffList.end();++it){
|
||||||
|
Buff&b=*it;
|
||||||
|
if(b.type==buff){
|
||||||
|
buffList.erase(it);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Player::RemoveAllBuffs(BuffType buff){
|
||||||
|
std::erase_if(buffList,[&](Buff&b){return b.type==buff;});
|
||||||
|
}
|
||||||
|
|
||||||
|
void Player::RemoveAllBuffs(){
|
||||||
|
buffList.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void Player::CastSpell(Ability&ability){
|
void Player::CastSpell(Ability&ability){
|
||||||
vf2d castPosition=game->GetWorldMousePos();
|
vf2d castPosition=game->GetWorldMousePos();
|
||||||
float distance=sqrt(pow(GetX()-game->GetWorldMousePos().x,2)+pow(GetY()-game->GetWorldMousePos().y,2));
|
float distance=sqrt(pow(GetX()-game->GetWorldMousePos().x,2)+pow(GetY()-game->GetWorldMousePos().y,2));
|
||||||
|
@ -92,6 +92,7 @@ protected:
|
|||||||
const float RETREAT_GHOST_FRAME_DELAY=0.025;
|
const float RETREAT_GHOST_FRAME_DELAY=0.025;
|
||||||
float ghostFrameTimer=0;
|
float ghostFrameTimer=0;
|
||||||
float ghostRemoveTimer=0;
|
float ghostRemoveTimer=0;
|
||||||
|
float blockTimer=0;
|
||||||
float retreatTimer=0;
|
float retreatTimer=0;
|
||||||
std::vector<vf2d>ghostPositions;
|
std::vector<vf2d>ghostPositions;
|
||||||
float rapidFireTimer=0;
|
float rapidFireTimer=0;
|
||||||
@ -130,6 +131,9 @@ public:
|
|||||||
|
|
||||||
void AddBuff(BuffType type,float duration,float intensity);
|
void AddBuff(BuffType type,float duration,float intensity);
|
||||||
std::vector<Buff>GetBuffs(BuffType buff);
|
std::vector<Buff>GetBuffs(BuffType buff);
|
||||||
|
void RemoveBuff(BuffType type); //Removes the first buff found.
|
||||||
|
void RemoveAllBuffs(BuffType type); //Removes all buffs of a certain type.
|
||||||
|
void RemoveAllBuffs(); //Remove every buff.
|
||||||
|
|
||||||
bool Hurt(int damage,bool onUpperLevel);
|
bool Hurt(int damage,bool onUpperLevel);
|
||||||
//specificClass is a bitwise-combination of classes from the Class enum. It makes sure certain animations only play if you are a certain class.
|
//specificClass is a bitwise-combination of classes from the Class enum. It makes sure certain animations only play if you are a certain class.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 927
|
#define VERSION_BUILD 935
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -71,7 +71,8 @@ void Warrior::InitializeClassAbilities(){
|
|||||||
if(p->GetState()==State::NORMAL){
|
if(p->GetState()==State::NORMAL){
|
||||||
rightClickAbility.cooldown=rightClickAbility.COOLDOWN_TIME;
|
rightClickAbility.cooldown=rightClickAbility.COOLDOWN_TIME;
|
||||||
p->SetState(State::BLOCK);
|
p->SetState(State::BLOCK);
|
||||||
p->AddBuff(BuffType::SLOWDOWN,"Warrior.Right Click Ability.Duration"_F,"Warrior.Right Click Ability.SlowAmt"_F);
|
p->blockTimer="Warrior.Right Click Ability.Duration"_F;
|
||||||
|
p->AddBuff(BuffType::BLOCK_SLOWDOWN,"Warrior.Right Click Ability.Duration"_F,"Warrior.Right Click Ability.SlowAmt"_F);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -13,7 +13,7 @@ Warrior
|
|||||||
Right Click Ability
|
Right Click Ability
|
||||||
{
|
{
|
||||||
Name = Block
|
Name = Block
|
||||||
Cooldown = 15
|
Cooldown = 1
|
||||||
Mana Cost = 0
|
Mana Cost = 0
|
||||||
|
|
||||||
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
|
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
|
||||||
|
@ -17,3 +17,9 @@ class_list = Warrior, Thief, Ranger, Trapper, Wizard, Witch
|
|||||||
|
|
||||||
# Whether or not to show individual data accesses from config data structure.
|
# Whether or not to show individual data accesses from config data structure.
|
||||||
debug_access_options = 0
|
debug_access_options = 0
|
||||||
|
|
||||||
|
# Shows extra info about the player on the HUD
|
||||||
|
debug_player_info = 0
|
||||||
|
|
||||||
|
# Shows collision boxes of tiles.
|
||||||
|
debug_collision_boxes = 0
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user