From c68bdcc673e113ec2c1aa5814db6261827465157 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sun, 24 Sep 2023 05:55:13 -0500 Subject: [PATCH] Cooldown icon indicators. --- Crawler/Crawler.cpp | 46 +++++++++++----------- Crawler/Version.h | 2 +- Crawler/assets/config/classes/Ranger.txt | 24 +++++------ Crawler/assets/config/classes/Thief.txt | 24 +++++------ Crawler/assets/config/classes/Trapper.txt | 24 +++++------ Crawler/assets/config/classes/Warrior.txt | 24 +++++------ Crawler/assets/config/classes/Witch.txt | 24 +++++------ Crawler/assets/config/classes/Wizard.txt | 24 +++++------ Crawler/assets/config/gfx/gfx.txt | 1 + Crawler/assets/skill_overlay_icon.png | Bin 0 -> 827 bytes 10 files changed, 96 insertions(+), 97 deletions(-) create mode 100644 Crawler/assets/skill_overlay_icon.png diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index 9f1f9b71..248bd9c1 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -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::vectorcooldowns{ - player->GetRightClickAbility(), player->GetAbility1(), player->GetAbility2(), player->GetAbility3(), player->GetAbility4(), }; - std::vectoractiveCooldowns{}; - 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.cooldown0.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<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<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_ptrforeground,std::unique_ptr 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); } \ No newline at end of file diff --git a/Crawler/Version.h b/Crawler/Version.h index d6b84e93..f3df0b8b 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -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 diff --git a/Crawler/assets/config/classes/Ranger.txt b/Crawler/assets/config/classes/Ranger.txt index 96858460..d46a4095 100644 --- a/Crawler/assets/config/classes/Ranger.txt +++ b/Crawler/assets/config/classes/Ranger.txt @@ -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 diff --git a/Crawler/assets/config/classes/Thief.txt b/Crawler/assets/config/classes/Thief.txt index 8a36b51b..6f55b820 100644 --- a/Crawler/assets/config/classes/Thief.txt +++ b/Crawler/assets/config/classes/Thief.txt @@ -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 diff --git a/Crawler/assets/config/classes/Trapper.txt b/Crawler/assets/config/classes/Trapper.txt index 70341563..e338a98c 100644 --- a/Crawler/assets/config/classes/Trapper.txt +++ b/Crawler/assets/config/classes/Trapper.txt @@ -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 diff --git a/Crawler/assets/config/classes/Warrior.txt b/Crawler/assets/config/classes/Warrior.txt index d5309a41..ec9f687a 100644 --- a/Crawler/assets/config/classes/Warrior.txt +++ b/Crawler/assets/config/classes/Warrior.txt @@ -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 diff --git a/Crawler/assets/config/classes/Witch.txt b/Crawler/assets/config/classes/Witch.txt index efef1555..1e6356c2 100644 --- a/Crawler/assets/config/classes/Witch.txt +++ b/Crawler/assets/config/classes/Witch.txt @@ -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 diff --git a/Crawler/assets/config/classes/Wizard.txt b/Crawler/assets/config/classes/Wizard.txt index d71c79cb..12b1005b 100644 --- a/Crawler/assets/config/classes/Wizard.txt +++ b/Crawler/assets/config/classes/Wizard.txt @@ -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 diff --git a/Crawler/assets/config/gfx/gfx.txt b/Crawler/assets/config/gfx/gfx.txt index a2956f0b..88e76fc2 100644 --- a/Crawler/assets/config/gfx/gfx.txt +++ b/Crawler/assets/config/gfx/gfx.txt @@ -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 } \ No newline at end of file diff --git a/Crawler/assets/skill_overlay_icon.png b/Crawler/assets/skill_overlay_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a9438bb258c41cd1421811b6530f08f93e5a9c7f GIT binary patch literal 827 zcmV-B1H}A^P)EX>4Tx04R}tkv&MmP!xqvQ$;Nm2RjsTh)|vEq9Tr^ibb$c+6t{Yn7s54nlvOS zE{=k0!NH%!s)LKOt`4q(Aov5~>f)s6A|>9J6k5di;PO7sd*^W9eSpxcGS%#f0jg#h z=|o)24rtTK|H%@ z>74h8L#!+*#OK751~o|h$aUG}H_j!81)do)vgvu^5V2V5V!4Z1*-(jRh$D)sQNECK zS>e3JS*_MtyHEbYU_o2SaGh!t2`nLr6hz3Vqk<|dL}}MZF_EV8xQBnl@u$coldA$o zjs?`9LUR1zfAD*@W^sDTO$x?=-WS{c7zg@xfmXw|zmILZbprUGfh(=!uQh?WPtqG5 zEph}5Z37qA9ZlW?E_ZVi9;hqi@Os!?!?S&7E8O9H$RJmS(kl0~{Oz z6D7)C_jq@I_uT%y)1KcCwK;OZwx86D00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru=Lr}J92!Zgy=nje02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{009$8L_t(Y$HkVtZo@DPgugT5#U8x0OJ1XMU%hi5B74_n zhyv6Ft_vLqM*JfuMhS2brMr_Tk+xW8o``D+r~*%>`}0kME}{AZN%q(1tg_F~nM+ zwf&ZJRwYkv#ZxvQ+s7ezC?x5_FR}Xsd`0XU<4cTh0xl3pnSW<#`-#{!n+NcrBt4RP z+X*-arq8g$?vtbxacjt1QL;ycmZdI9I_FC_31l@<=l3J2zgJggKXbLvEgyZhi|zPf zfr_22+UXRYD|MdKGT1|86@IHo5w28Za{a%3^q=