Skip to content

Instantly share code, notes, and snippets.

@fffonion
Created October 15, 2013 03:41
Show Gist options
  • Save fffonion/6986183 to your computer and use it in GitHub Desktop.
Save fffonion/6986183 to your computer and use it in GitHub Desktop.
MA收集品、妖精血量、妖精攻击计算器
import math
class calc():
WAKE_FAIRY,NORMAL_FAIRY=True,False
NORMAL_FAIRY_1,NORMAL_FAIRY_2,WAKE_FAIRY=0,1,2
@classmethod
def item_get(cls,fairy_lv,is_wake=False,damage_hp=0):
'''
收集品获得量计算器
'''
fairy_lv=int(fairy_lv)
fairy_hp=calc.fairy_hp(fairy_lv,is_wake)
if damage_hp==0:
damage_hp=fairy_hp
i=is_wake and ((1000+fairy_lv*40)*damage_hp/fairy_hp) or ((10*fairy_lv)*damage_hp/fairy_hp)
return int(math.ceil(i/10.0)*10)
@classmethod
def fairy_hp(cls,lv,wake=False):
'''
妖精预测血量计算器
'''
return wake and 30618*(lv+25) or 7783*(lv+2)
@classmethod
def fairy_atk(cls,lv,type=0):
'''
妖精预测平均攻击计算器
'''
pass
if __name__=='__main__':
print calc.fairy_hp(55,calc.WAKE_FAIRY)
print calc.item_get(55,calc.WAKE_FAIRY,115622)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment