CDR now adjusts the cooldown timing live instead of setting the cooldown on use. CDR formula properly applied.

pull/28/head
sigonasr2 1 year ago
parent 6412f34dce
commit 28079609b7
  1. 2
      Crawler/Ability.cpp
  2. 16
      Crawler/Player.cpp
  3. 2
      Crawler/Version.h
  4. 1
      Crawler/assets/config/items/ItemDatabase.txt

@ -57,5 +57,5 @@ Ability::Ability(std::string name,std::string shortName,std::string description,
:name(name),shortName(shortName),description(description),cooldown(0),COOLDOWN_TIME(cooldownTime),manaCost(manaCost),input(input),icon(icon),barColor1(barColor1),barColor2(barColor2),precastInfo(precastInfo),canCancelCast(canCancelCast){} :name(name),shortName(shortName),description(description),cooldown(0),COOLDOWN_TIME(cooldownTime),manaCost(manaCost),input(input),icon(icon),barColor1(barColor1),barColor2(barColor2),precastInfo(precastInfo),canCancelCast(canCancelCast){}
const float Ability::GetCooldownTime()const{ const float Ability::GetCooldownTime()const{
return COOLDOWN_TIME*std::max(0.f,(1-game->GetPlayer()->GetCooldownReductionPct())); return COOLDOWN_TIME;
} }

@ -362,11 +362,17 @@ void Player::Update(float fElapsedTime){
animation.UpdateState(internal_animState,fElapsedTime); animation.UpdateState(internal_animState,fElapsedTime);
} }
} }
rightClickAbility.cooldown-=fElapsedTime; float cooldownMultiplier;
ability.cooldown-=fElapsedTime; if(game->GetPlayer()->GetCooldownReductionPct()>=1.0f){
ability2.cooldown-=fElapsedTime; cooldownMultiplier=999999;
ability3.cooldown-=fElapsedTime; }else{
ability4.cooldown-=fElapsedTime; cooldownMultiplier=1/(1-game->GetPlayer()->GetCooldownReductionPct());
}
rightClickAbility.cooldown-=fElapsedTime*cooldownMultiplier;
ability.cooldown-=fElapsedTime*cooldownMultiplier;
ability2.cooldown-=fElapsedTime*cooldownMultiplier;
ability3.cooldown-=fElapsedTime*cooldownMultiplier;
ability4.cooldown-=fElapsedTime*cooldownMultiplier;
item1.cooldown-=fElapsedTime; item1.cooldown-=fElapsedTime;
item2.cooldown-=fElapsedTime; item2.cooldown-=fElapsedTime;
item3.cooldown-=fElapsedTime; item3.cooldown-=fElapsedTime;

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 1 #define VERSION_PATCH 1
#define VERSION_BUILD 4854 #define VERSION_BUILD 4857
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -47,7 +47,6 @@ ItemDatabase
ItemScript = Buff ItemScript = Buff
Description = Increase your attack by 15% for 30 seconds. Description = Increase your attack by 15% for 30 seconds.
Attack % = 15%,30 Attack % = 15%,30
CDR = 50%,60
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 5.0 Cooldown Time = 5.0
Cast Time = 0.0 Cast Time = 0.0

Loading…
Cancel
Save