Skip to content

Instantly share code, notes, and snippets.

@BGMcoder BGMcoder/CatStack.ahk
Last active Apr 27, 2018

Embed
What would you like to do?
Battle Cats: Get a cat's hp or dmg based on it's level and stat's max
;3:04 PM Monday, April 23, 2018
;Get a cat's hp based on it's level
;works perfectly! Test with Ramen Cat - see the wiki for matches:
;http://battle-cats.wikia.com/wiki/Treasure
#NoEnv
#singleinstance, force
setformat, float, 0.0
whatlevel := 30 ;cat's level
whatmax := 11220 ;cat's stat at level 30
treasure := 2.5 ;treasure bonus
whattype := "rare" ;type of cat
;Figure Reduction Point based on cat's type and level
;red1 is the first reduction point level
;red2 is the second reduction point level
if(whattype = "normal"){
red1 = 60
red2 = 0
}else if(whattype = "special"){
red1 = 60
red2 = 0
}else if(whattype = "rare"){
red1 = 70
red2 = 0
}else if(whattype = "super-rare"){
red1 = 60
red2 = 80
}else if(whattype = "crazed"){
red1 = 20
red2 = 40
}else if(whattype = "uber-rare"){
red1 = 60
red2 = 80
}else{
red1 = 60
red2 = 80
}
;Initial Stat never changes
div := treasure * (1 + (29 - 1) /5)
initialstat := whatmax / div
If(whatlevel < red1){
stat := treasure * initialstat * (1 + (whatlevel - 1) / 5)
levelgain := treasure * initialstat /5
whichred := "pre-red"
}else if(whatlevel >= red1 And whatlevel < red2){
stat := treasure * initialstat * ((1 + (red1 - 1)/5) + (whatlevel - red1)/10)
levelgain := (initialstat /5) /2
whichred := "red1:" . red1
}else if(whatlevel >= red2){
stat := treasure * initialstat * ( 1 + ((red1 - 1)/5) + ((red2 - red1)/10) + ((whatlevel - red2)/20) )
levelgain := ((initialstat /5) /2) /2
whichred := "red2:" . red2
}
msgbox % "level:" . whatlevel . "`rinitialstat:" . initialstat . "`rdiv:" . div . "`rReduction Point:" . whichred . "`rhp or dmg:" . stat . "`rlevelgain: " . levelgain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.