Cooldown icon indicators.

pull/28/head
sigonasr2 1 year ago
parent f48a6a89b2
commit c68bdcc673
  1. 46
      Crawler/Crawler.cpp
  2. 2
      Crawler/Version.h
  3. 24
      Crawler/assets/config/classes/Ranger.txt
  4. 24
      Crawler/assets/config/classes/Thief.txt
  5. 24
      Crawler/assets/config/classes/Trapper.txt
  6. 24
      Crawler/assets/config/classes/Warrior.txt
  7. 24
      Crawler/assets/config/classes/Witch.txt
  8. 24
      Crawler/assets/config/classes/Wizard.txt
  9. 1
      Crawler/assets/config/gfx/gfx.txt
  10. BIN
      Crawler/assets/skill_overlay_icon.png

@ -114,7 +114,7 @@ bool Crawler::OnUserCreate(){
LoadLevel(LEVEL_NAMES["starting_map"_S]);
InitializeClasses();
ChangePlayerClass(WARRIOR);
Warrior::ability4=Ranger::ability1; //Class ability swapping demonstration.
//Warrior::ability4=Ranger::ability1; //Class ability swapping demonstration.
return true;
}
@ -998,33 +998,34 @@ void Crawler::RenderHud(){
return newName;
};
std::vector<Ability>cooldowns{
player->GetRightClickAbility(),
player->GetAbility1(),
player->GetAbility2(),
player->GetAbility3(),
player->GetAbility4(),
};
std::vector<Ability>activeCooldowns{};
std::copy_if(cooldowns.begin(),cooldowns.end(),std::back_inserter(activeCooldowns),[](Ability&a){
return a.cooldown>0;
});
std::sort(activeCooldowns.begin(),activeCooldowns.end(),[&](Ability&a1,Ability&a2){
return a1.cooldown<a2.cooldown;
});
int offset=6*activeCooldowns.size();
for(Ability&a:activeCooldowns){
if(a.cooldown>0.1){
FillRectDecal(vf2d{10,ScreenHeight()-22.f}-vf2d{0,float(offset)},{64,6},BLACK);
FillRectDecal(vf2d{11,ScreenHeight()-21.f}-vf2d{0,float(offset)},{62,4},DARK_GREY);
GradientFillRectDecal(vf2d{10,ScreenHeight()-22.f}-vf2d{0,float(offset)},{(a.cooldown/a.COOLDOWN_TIME)*64,6},a.barColor1,a.barColor1,a.barColor2,a.barColor2);
DrawRotatedShadowStringPropDecal(vf2d{8,ScreenHeight()-20.f}+vf2d{1,1}-vf2d{0,float(offset)},capitalize(a.name),-PI/64,{0,0},WHITE,BLACK,{0.4,0.4},0.5);
std::stringstream cooldownTimeDisplay;
cooldownTimeDisplay<<std::fixed<<std::setprecision(1)<<a.cooldown;
DrawShadowStringPropDecal(vf2d{74,ScreenHeight()-22.f+1}-vf2d{float(GetTextSizeProp(cooldownTimeDisplay.str()).x*0.5),float(offset)},cooldownTimeDisplay.str(),WHITE,BLACK,{0.5,0.5});
const auto DrawCooldown=[&](vf2d pos,Ability&a){
if(a.name!="???"){
if(a.cooldown>0.1){
DrawPie(pos+vf2d{12,12},12,360-(a.cooldown/a.COOLDOWN_TIME)*360,PixelLerp(a.barColor1,a.barColor2,(a.cooldown/a.COOLDOWN_TIME)));
std::stringstream cooldownTimeDisplay;
cooldownTimeDisplay<<std::fixed<<std::setprecision(1)<<a.cooldown;
DrawShadowStringPropDecal(pos+vf2d{12,12}-vf2d{float(GetTextSizeProp(cooldownTimeDisplay.str()).x*0.5),float(GetTextSizeProp(cooldownTimeDisplay.str()).y*1)}/2,cooldownTimeDisplay.str(),WHITE,BLACK,{0.5,1});
}
DrawDecal(pos,GFX["skill_overlay_icon.png"].Decal());
}
};
vf2d iconPos={8.f,float(ScreenHeight()-32)};
for(Ability&a:cooldowns){
if(a.name!="???"){
DrawCooldown(iconPos,a);
iconPos+={32,0};
}
offset-=6;
}
DrawCooldown({float(ScreenWidth()-32),float(ScreenHeight()-32)},player->GetRightClickAbility());
if(GetPlayer()->GetCastInfo().castTimer>0){
FillRectDecal(vf2d{ScreenWidth()/2-92.f,ScreenHeight()-90.f},{184,20},BLACK);
FillRectDecal(vf2d{ScreenWidth()/2-90.f,ScreenHeight()-88.f},{180,16},DARK_GREY);
@ -1058,9 +1059,6 @@ void Crawler::RenderHud(){
DrawShadowStringDecal({0,128},player->GetPos().str());
DrawShadowStringDecal({0,136},"Spd: "+std::to_string(player->GetMoveSpdMult()));
}
DrawPie({120,120},20,90,BLUE);
}
void Crawler::AddEffect(std::unique_ptr<Effect>foreground,std::unique_ptr<Effect> background){
@ -1542,5 +1540,5 @@ void Crawler::SpawnMonster(vf2d pos,MonsterData*data,bool upperLevel){
}
void Crawler::DrawPie(vf2d center,float radius,float degreesCut,Pixel col){
DrawPolygonDecal(nullptr,circleCooldownPoints,circleCooldownPoints,int(degreesCut/4),center,radius,col);
DrawPolygonDecal(nullptr,circleCooldownPoints,circleCooldownPoints,std::max(1,int(degreesCut/4)),center,radius,col);
}

@ -2,7 +2,7 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define VERSION_BUILD 1484
#define VERSION_BUILD 1504
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -21,9 +21,9 @@ Ranger
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 0, 0, 64, 255
Cooldown Bar Color 2 = 0, 0, 128, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 0, 0, 64, 192
Cooldown Bar Color 2 = 0, 0, 128, 192
Precast Time = 0
Casting Range = 0
@ -42,9 +42,9 @@ Ranger
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -72,9 +72,9 @@ Ranger
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0.3
Casting Range = 0
@ -100,9 +100,9 @@ Ranger
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0

@ -10,9 +10,9 @@ Thief
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 0, 0, 64, 255
Cooldown Bar Color 2 = 0, 0, 128, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 0, 0, 64, 192
Cooldown Bar Color 2 = 0, 0, 128, 192
Precast Time = 0
Casting Range = 0
@ -26,9 +26,9 @@ Thief
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -42,9 +42,9 @@ Thief
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -58,9 +58,9 @@ Thief
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0

@ -10,9 +10,9 @@ Trapper
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 0, 0, 64, 255
Cooldown Bar Color 2 = 0, 0, 128, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 0, 0, 64, 192
Cooldown Bar Color 2 = 0, 0, 128, 192
Precast Time = 0
Casting Range = 0
@ -26,9 +26,9 @@ Trapper
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -42,9 +42,9 @@ Trapper
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -58,9 +58,9 @@ Trapper
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0

@ -20,9 +20,9 @@ Warrior
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 0, 0, 64, 255
Cooldown Bar Color 2 = 0, 0, 128, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 0, 0, 64, 192
Cooldown Bar Color 2 = 0, 0, 128, 192
Precast Time = 0
Casting Range = 0
@ -44,9 +44,9 @@ Warrior
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -88,9 +88,9 @@ Warrior
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -118,9 +118,9 @@ Warrior
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0

@ -10,9 +10,9 @@ Witch
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 0, 0, 64, 255
Cooldown Bar Color 2 = 0, 0, 128, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 0, 0, 64, 192
Cooldown Bar Color 2 = 0, 0, 128, 192
Precast Time = 0
Casting Range = 0
@ -26,9 +26,9 @@ Witch
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -42,9 +42,9 @@ Witch
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -58,9 +58,9 @@ Witch
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0

@ -33,9 +33,9 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 1
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 0, 0, 64, 255
Cooldown Bar Color 2 = 0, 0, 128, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 0, 0, 64, 192
Cooldown Bar Color 2 = 0, 0, 128, 192
Precast Time = 0
Casting Range = 0
@ -71,9 +71,9 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -135,9 +135,9 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 0
Casting Range = 0
@ -189,9 +189,9 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 0
#RGB Values. Color 1 is the left side of the bar, Color 2 is the right side.
Cooldown Bar Color 1 = 64, 0, 0, 255
Cooldown Bar Color 2 = 128, 0, 0, 255
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
Precast Time = 1.5
Casting Range = 900

@ -36,4 +36,5 @@ Images
GFX_Warrior_Sheet = nico-warrior.png
GFX_Wizard_Sheet = nico-wizard.png
GFX_SlimeKing_Cast = monsters/Slime King - Cast.png
GFX_SkillOverlayIcon = skill_overlay_icon.png
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Loading…
Cancel
Save