MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / getMagicCountdownTime

Method getMagicCountdownTime

code/main/Quest.ts:918–936  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

916 }
917
918 private getMagicCountdownTime(): number{
919 var time: number = 0;
920
921 // If we have the sorceress hat, the base time is 50
922 if(this.getGame().isEquipped("hat", "eqItemHatSorceressHat"))
923 time = 50;
924 // Else, it's 80
925 else
926 time = 80;
927
928 // Reduce the time thanks to the magic gift
929 time -= time * (Saving.loadNumber("gameGiftMagic")*15/100);
930
931 // Set the time to 0 if it is < 0 (which shouldn't happen anyway, but you know, since some people will probably modify the game variables by themselves it's better if we try to avoid bugs)
932 if(time < 0) time = 0;
933
934 // Return the time
935 return time;
936 }
937}

Callers 1

createPlayerSpellsMethod · 0.95

Calls 2

isEquippedMethod · 0.80
getGameMethod · 0.45

Tested by

no test coverage detected