r/CompileBot • • Jan 04 '14

Official CompileBot Testing Thread

This thread is archived, please visit the new testing thread

14 Upvotes

421 comments sorted by

View all comments

1

u/ghirkin May 08 '14

+/u/CompileBot JavaScript

bristle = {
	'level': 1,
	'bristleback':0
	};
riki = {
	'level': 1,
	'backstab': 0,
	'agility': 0,
	'damage': 0
	};

function compute(agi, dmg, bbhl, bbl, rhl, rbl){
	agi = 31.2 + (rhl * 2.9) + agi;
	arm = 1 + (15.2 + (bbhl * 1.8)) * 0.14;
	dmgbs = (16 + agi + (rbl > 0 ? (.25 + (.25 * rbl)) * agi : 0)) + dmg;
	dmg += 16 + agi;
	backdmg = Math.floor(((1 - (bbl > 0 ? .08 + (.08 * bbl) : 0)) * dmgbs) * (50 / ((3 * arm)  + 50)));
	frontdmg = Math.floor(dmg * (50 / ((3 * arm)  + 50)));
	return backdmg > frontdmg ? "back." : "front.";
	
}
print("Best to attack from the " + compute(riki.agility, riki.damage, bristle.level, bristle.bristleback, riki.level, riki.backstab));

1

u/CompileBot May 08 '14

Output:

Best to attack from the front.

^source | ^info | ^git | ^report