Best Python code snippet using hypothesis
freeze-smooth.py
Source:freeze-smooth.py
1import numpy as np2# åºæ¬è®¾å®ï¼æ´å»ï¼å»ç»æ´å»ï¼æ½æ³æ¶é´ï¼å°æåå°æºæ¦ç3critical = 1 / 34critical_expectation = 1 + critical5critical_expectation = min(critical_expectation, 2)6freeze_critical_expectation = min(1 + 1.5 * critical + 0.5, 2)7freezeBolt_spellTime = 28gcd = 1.59fingersOfFrost_probability = 0.1510brainFreeze_probability = 0.311print(freeze_critical_expectation)12# å°åºè®¾å®ï¼åºæ¬ä¼¤å®³ï¼ææ伤害ï¼å»ç»ä¸ææ伤害13iceThorn_damage = 26814iceThorn_damage_expectation = iceThorn_damage * critical_expectation15iceThorn_damage_freeze_expectation = iceThorn_damage * freeze_critical_expectation16# å¯å°ç®è®¾å®ï¼åºæ¬ä¼¤å®³ï¼ææ伤害ï¼å»ç»ä¸ææ伤害17frostBolt_basic_damage = 75618frostBolt_damage_expectation = frostBolt_basic_damage * critical_expectation19frostBolt_damage_freeze_expectation = frostBolt_basic_damage * freeze_critical_expectation20#顺æ»å¯å°æ©è£
21freezeBolt_spellTime = freezeBolt_spellTime * 0.822frostBolt_damage_expectation = frostBolt_damage_expectation * 1.223frostBolt_damage_freeze_expectation = frostBolt_damage_freeze_expectation * 1.224# å°æªè®¾å®ï¼åºæ¬ä¼¤å®³ï¼å°éä¹å¬å¯¼çµå¨ï¼è¿éååºå¤©èµä¼¤å®³ï¼å°æä¸ææ伤害25iceLance_basic_damage = 56226frostBite = 0.05227iceLance_basic_damage = iceLance_basic_damage * (1 + frostBite)28iceLance_basic_damage = iceLance_basic_damage * 129iceLance_chain_damage = iceLance_basic_damage * 1.1530iceLance_basic_damage_fingersOfFrost_expectation = iceLance_basic_damage * 3 * freeze_critical_expectation31iceLance_chain_damage_fingersOfFrost_expectation = iceLance_chain_damage * 3 * freeze_critical_expectation32# å°é£æ´è®¾å®ï¼åºæ¬ä¼¤å®³ï¼å°æºä¸åºç¡ä¼¤å®³ï¼å°æºä¸ææ伤害33iceStorm_basic_damage = 122034iceStorm_damage_brainFreeze = iceStorm_basic_damage * 1.535iceStorm_damage_brainFreeze_expectation = iceStorm_damage_brainFreeze / 3 * critical_expectation \36 + iceStorm_damage_brainFreeze / 3 * 2 * freeze_critical_expectation37damage = 038time = 039fingersOfFrost_number = 040brainFreeze_number = 041iceThorn_number = 042# 第ä¸ç§ææ³ï¼æ 论ä½æ¶é½æ¯å°æºä¼å
ï¼ä¸ç®¡æ没æå°æï¼åªè¦æå°æºé½æ1+1+243while damage < 100000000000:44 # 读æ¡ä¸ä¸ªå¯å°ç®45 time = time + freezeBolt_spellTime46 damage = damage + frostBolt_damage_expectation47 fingersOfFrost_trigger = np.random.random()48 brainFreeze_trigger = np.random.random()49 # å¯å°ç®å¤ä¸æ ¹å°åºï¼å¤§äº5èªå¨åå°50 iceThorn_number += 151 iceThorn_auto = False52 if iceThorn_number > 5:53 iceThorn_auto = True54 iceThorn_number -= 155 damage = damage + iceThorn_damage_expectation56 # ä¹åæå°æï¼æ²¡æ触åå°æºï¼è¯»å®è¿ä¸ªå¯å°ç®æä¸ä¸ªå°æçå°æª57 if fingersOfFrost_number > 0 and brainFreeze_number == 0:58 time = time + gcd59 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation60 fingersOfFrost_number -= 161 # å°åºå¨æ®éç¶æä¸æ¸
062 damage = damage + iceThorn_number * iceThorn_damage_expectation63 iceThorn_number = 064 # å读å®çå¯å°ç®è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼ææææä¹ååçå°æåæäºè¿ä¸ªå°æï¼åå»æå¯å°ç®65 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:66 while fingersOfFrost_number > 0:67 time = time + gcd68 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation69 fingersOfFrost_number -= 170 time = time + gcd71 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation72 # å读å®çå¯å°ç®è§¦åäºå°æºï¼æ²¡è§¦åå°æï¼æ¹åèµæºæ°éåæ£å¸¸æ1+1+2ï¼çæäºåå°å¼å¤´æå¯å°ç®73 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:74 brainFreeze_number += 175 brainFreeze_number = min(brainFreeze_number, 1)76 # å读å®çå¯å°ç®è§¦åäºå°æºåå°æï¼æ¹åèµæºæ°éåæ£å¸¸æ1+1+2ï¼çæäºåå°å¼å¤´æå¯å°ç®77 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:78 fingersOfFrost_number += 179 fingersOfFrost_number = min(fingersOfFrost_number, 2)80 brainFreeze_number += 181 brainFreeze_number = min(brainFreeze_number, 1)82 # ä¹å触åäºå°æºï¼æ²¡æ触åå°æï¼æ£å¸¸1+1+283 elif fingersOfFrost_number == 0 and brainFreeze_number == 1:84 time = time + gcd * 385 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation86 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_chain_damage_fingersOfFrost_expectation * 287 brainFreeze_number = 088 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
089 iceThorn_number += 190 if iceThorn_auto:91 damage = damage - iceThorn_damage_expectation + iceThorn_damage_freeze_expectation92 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation93 iceThorn_number = 094 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ95 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:96 pass97 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼å¤äºä¸ä¸ªå°æº98 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:99 brainFreeze_number += 1100 brainFreeze_number = min(brainFreeze_number, 1)101 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æµªè´¹ä¸ä¸ªå°æï¼å¤äºä¸ä¸ªå°æº102 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:103 brainFreeze_number += 1104 brainFreeze_number = min(brainFreeze_number, 1)105 # ä¹å触åäºå°æºåå°æï¼æµªè´¹æåçå°ææ£å¸¸1+1+2106 elif fingersOfFrost_number > 0 and brainFreeze_number == 1:107 time = time + gcd * 3108 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation109 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_chain_damage_fingersOfFrost_expectation * 2110 brainFreeze_number = 0111 fingersOfFrost_number = 0112 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0113 iceThorn_number += 1114 if iceThorn_auto:115 damage = damage - iceThorn_damage_expectation + iceThorn_damage_freeze_expectation116 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation117 iceThorn_number = 0118 # å读å®çå¯å°ç®å¨åä¸ä¸ªå¯å°ç®å°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ119 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:120 pass121 # å读å®çå¯å°ç®å¨åä¸ä¸ªå¯å°ç®å°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼å¤äºä¸ä¸ªå°æº122 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:123 brainFreeze_number += 1124 brainFreeze_number = min(brainFreeze_number, 1)125 # å读å®çå¯å°ç®å¨åä¸ä¸ªå¯å°ç®å°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æµªè´¹ä¸ä¸ªå°æï¼å¤äºä¸ä¸ªå°æº126 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:127 brainFreeze_number += 1128 brainFreeze_number = min(brainFreeze_number, 1)129 # ä¹åå¥é½æ²¡ï¼è¯»å®è¿ä¸ªå¯å°ç®è®¡ç®å®è§¦åï¼å头继ç»è¯»130 else:131 # å读å®çå¯å°ç®ï¼è§¦åäºå°æå°æº132 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:133 fingersOfFrost_number += 1134 fingersOfFrost_number = min(fingersOfFrost_number, 2)135 brainFreeze_number += 1136 brainFreeze_number = min(brainFreeze_number, 1)137 # å读å®çå¯å°ç®ï¼è§¦åå°æºï¼æ²¡è§¦åå°æ138 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:139 brainFreeze_number += 1140 brainFreeze_number = min(brainFreeze_number, 1)141 # å读å®çå¯å°ç®è§¦åäºå°æ没触åå°æº142 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:143 fingersOfFrost_number += 1144 fingersOfFrost_number = min(fingersOfFrost_number, 2)145dps_1 = damage / time146damage = 0147time = 0148fingersOfFrost_number = 0149brainFreeze_number = 0150iceThorn_number = 0151# 第äºç§ææ³ï¼ç»ä¸æµªè´¹ä»»æå¯ä»¥æåºçå°æï¼æå°æºåå°æä¹å
æå°æ对åºçå°æªåå»1+1+2152while damage < 100000000000:153 # 读æ¡ä¸ä¸ªå¯å°ç®154 time = time + freezeBolt_spellTime155 damage = damage + frostBolt_damage_expectation156 fingersOfFrost_trigger = np.random.random()157 brainFreeze_trigger = np.random.random()158 # å¯å°ç®å¤ä¸æ ¹å°åºï¼å¤§äº5èªå¨åå°159 iceThorn_number += 1160 iceThorn_auto = False161 if iceThorn_number > 5:162 iceThorn_auto = True163 iceThorn_number -= 1164 damage = damage + iceThorn_damage_expectation165 # ä¹å触åäºå°æï¼æ²¡æ触åå°æºï¼æå®ææåçå°æ166 if fingersOfFrost_number > 0 and brainFreeze_number == 0:167 while fingersOfFrost_number > 0:168 time = time + gcd169 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation170 fingersOfFrost_number -= 1171 # å°åºå¨æ®éç¶æä¸æ¸
0172 damage = damage + iceThorn_number * iceThorn_damage_expectation173 iceThorn_number = 0174 # å读å®çå¯å°ç®è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æå®ä¹ååçå°æ对åºçå°æªï¼ç«å»ææè¿ä¸ªå¯å°ç®å°æçå°æªï¼å头读å¯å°ç®175 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:176 time = time + gcd177 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation178 # å读å®çå¯å°ç®è§¦åäºå°æºï¼æ²¡è§¦åå°æï¼æå®ä¹ååçå°æ对åºçå°æªï¼åå»æ£å¸¸æ1+1+2ï¼179 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:180 brainFreeze_number += 1181 brainFreeze_number = min(brainFreeze_number, 1)182 # å读å®çå¯å°ç®è§¦åäºå°æºåå°æï¼æå®ä¹ååçå°æ对åºçå°æªï¼å
æè¿ä¸ªå¯å°ç®å°æ对åºçå°æªï¼ååå°å¼å¤´æ1+1+2183 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:184 time = time + gcd185 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation186 brainFreeze_number += 1187 brainFreeze_number = min(brainFreeze_number, 1)188 # ä¹å触åäºå°æºï¼æ²¡æ触åå°æï¼æ£å¸¸1+1+2189 elif fingersOfFrost_number == 0 and brainFreeze_number == 1:190 time = time + gcd * 3191 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation192 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_chain_damage_fingersOfFrost_expectation * 2193 brainFreeze_number = 0194 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0195 iceThorn_number += 1196 if iceThorn_auto:197 damage = damage - iceThorn_damage_expectation + iceThorn_damage_freeze_expectation198 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation199 iceThorn_number = 0200 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ201 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:202 pass203 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼å¤äºä¸ä¸ªå°æº204 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:205 brainFreeze_number += 1206 brainFreeze_number = min(brainFreeze_number, 1)207 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æµªè´¹ä¸ä¸ªå°æï¼å¤äºä¸ä¸ªå°æº208 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:209 brainFreeze_number += 1210 brainFreeze_number = min(brainFreeze_number, 1)211 # ä¹å触åäºå°æºåå°æï¼æå®ä¹ååçå°æªï¼çè¿ä¸ªå¯å°ç®æ没æ触åå°æï¼åå头æ1+1+2212 elif fingersOfFrost_number > 0 and brainFreeze_number == 1:213 while fingersOfFrost_number > 0:214 time = time + gcd215 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation216 fingersOfFrost_number -= 1217 # å°åºå¨æ®éç¶æä¸æ¸
0218 damage = damage + iceThorn_number * iceThorn_damage_expectation219 iceThorn_number = 0220 # å读å®çå¯å°ç®å¨ä¹åå°æ对åºçå°æªåºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æå®ææåçå°æï¼æåºè¿ä¸ªå¯å°ç®å°æçå°æªï¼å头1+1+2221 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:222 time = time + gcd223 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation224 # å读å®çå¯å°ç®ä¹ååçå°æ对åºçå°æªåºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼åä¸ä¸ªå°æºè¿å¨ï¼æµªè´¹ä¸ä¸ªå°æº225 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:226 pass227 # å读å®çå¯å°ç®å¨ä¹åå°æ对åºçå°æªåºæåï¼è§¦åäºå°æåå°æºï¼åä¸ä¸ªå°æºè¿å¨,浪费ä¸ä¸ªå°æºï¼æåºè¿ä¸ªå¯å°ç®å°æ对åºçå°æªï¼å头228 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:229 time = time + gcd230 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation231 # ä¹åå¥é½æ²¡æï¼è¯»å®è¿ä¸ªå¯å°ç®è®¡ç®å®è§¦åï¼å头继ç»è¯»232 else:233 # å读å®çå¯å°ç®ï¼è§¦åäºå°æå°æº234 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:235 fingersOfFrost_number += 1236 fingersOfFrost_number = min(fingersOfFrost_number, 2)237 brainFreeze_number += 1238 brainFreeze_number = min(brainFreeze_number, 1)239 # å读å®çå¯å°ç®ï¼è§¦åå°æºï¼æ²¡è§¦åå°æ240 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:241 brainFreeze_number += 1242 brainFreeze_number = min(brainFreeze_number, 1)243 # å读å®çå¯å°ç®è§¦åäºå°æ没触åå°æº244 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:245 fingersOfFrost_number += 1246 fingersOfFrost_number = min(fingersOfFrost_number, 2)247dps_2 = damage / time248damage = 0249time = 0250fingersOfFrost_number = 0251brainFreeze_number = 0252iceThorn_number = 0253# 第ä¸ç§ææ³ï¼ä¸æµªè´¹ä»»ä½å°æï¼åæ¶é¤éæ¯ä¹ååªæå°æºï¼å¹¶ä¸åæåºå»äºå¯å°ç®ï¼ææ1+1+2ï¼å¦åæå°æºç´æ¥æå°é£æ´+2å°æª254while damage < 100000000000:255 # 读æ¡ä¸ä¸ªå¯å°ç®256 time = time + freezeBolt_spellTime257 damage = damage + frostBolt_damage_expectation258 fingersOfFrost_trigger = np.random.random()259 brainFreeze_trigger = np.random.random()260 # å¯å°ç®å¤ä¸æ ¹å°åºï¼å¤§äº5èªå¨åå°261 iceThorn_number += 1262 iceThorn_auto = False263 if iceThorn_number > 5:264 iceThorn_auto = True265 iceThorn_number -= 1266 damage = damage + iceThorn_damage_expectation267 # ä¹å触åäºå°æï¼æ²¡æ触åå°æºï¼æå®ææåçå°æ268 if fingersOfFrost_number > 0 and brainFreeze_number == 0:269 while fingersOfFrost_number > 0:270 time = time + gcd271 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation272 fingersOfFrost_number -= 1273 # å°åºå¨æ®éç¶æä¸æ¸
0274 damage = damage + iceThorn_number * iceThorn_damage_expectation275 iceThorn_number = 0276 # å读å®çå¯å°ç®è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æå®ä¹åå°æ对åºçå°æªç«å»ææè¿ä¸ªå¯å°ç®å°æçå°æªï¼åå»æå¯å°ç®277 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:278 time = time + gcd279 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation280 # å读å®çå¯å°ç®è§¦åäºå°æºï¼æ²¡è§¦åå°æï¼æå®ä¹åå°æ对åºçå°æªï¼æè¿ä¸ªå°æºçå°é£æ´+2å°æª281 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:282 time = time + gcd * 3283 damage = damage + iceStorm_damage_brainFreeze_expectation + \284 iceLance_chain_damage_fingersOfFrost_expectation * 2285 brainFreeze_number = 0286 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0,ä½æ¯ç±äºè¿ä¸ªå°é£æ´åé¢æ¯å°æªä¸æ¯å¯å°ç®ï¼å¯å°ç®çå°åºåä¸å°å»ç»287 iceThorn_number += 1288 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation289 iceThorn_number = 0290 # å读å®çå¯å°ç®è§¦åäºå°æºåå°æï¼æå®ä¹åå°æ对åºçå°æªï¼å
æè¿ä¸ªå¯å°ç®å°æ对åºçå°æªï¼åæè¿ä¸ªå°æºçå°é£æ´+2å°æª291 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:292 time = time + gcd293 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation294 time = time + gcd * 3295 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_chain_damage_fingersOfFrost_expectation * 2296 brainFreeze_number = 0297 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0,ä½æ¯ç±äºè¿ä¸ªå°é£æ´åé¢æ¯å°æªä¸æ¯å¯å°ç®ï¼å¯å°ç®çå°åºåä¸å°å»ç»298 iceThorn_number += 1299 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation300 iceThorn_number = 0301 # ä¹å触åäºå°æºï¼æ²¡æ触åå°æï¼æ£å¸¸1+1+2302 elif fingersOfFrost_number == 0 and brainFreeze_number == 1:303 time = time + gcd * 3304 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation305 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_chain_damage_fingersOfFrost_expectation * 2306 brainFreeze_number = 0307 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0308 iceThorn_number += 1309 if iceThorn_auto:310 damage = damage - iceThorn_damage_expectation + iceThorn_damage_freeze_expectation311 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation312 iceThorn_number = 0313 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ314 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:315 pass316 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼å¤äºä¸ä¸ªå°æº,æå®è¿ä¸ª1+1+2ï¼ç´æ¥æè¿ä¸ªå°æºçå°é£æ´+2å°æª317 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:318 time = time + gcd * 3319 damage = damage + iceStorm_damage_brainFreeze_expectation + \320 iceLance_chain_damage_fingersOfFrost_expectation * 2321 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0ï¼æ¤æ¶ä¸ç¨èèå读å®çå¯å°ç®çå°åºï¼ä¹åçå°é£æ´å·²ç»ç®å¨å
äº322 iceThorn_number += 1323 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation324 iceThorn_number = 0325 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æµªè´¹ä¸ä¸ªå°æï¼å¤äºä¸ä¸ªå°æº,æå®è¿ä¸ª1+1+2ï¼326 # ç´æ¥æè¿ä¸ªå°æºçå°é£æ´+2å°æª327 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:328 time = time + gcd * 3329 damage = damage + iceStorm_damage_brainFreeze_expectation + \330 iceLance_chain_damage_fingersOfFrost_expectation * 2331 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0ï¼æ¤æ¶ä¸ç¨èèå读å®çå¯å°ç®çå°åºï¼ä¹åçå°é£æ´å·²ç»ç®å¨å
äº332 iceThorn_number += 1333 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation334 iceThorn_number = 0335 # ä¹å触åäºå°æºåå°æï¼è¯»å®è¿ä¸ªå¯å°ç®ï¼æå®ææå°ææä¹åå°æºçå°é£æ´+2å°æª336 elif fingersOfFrost_number > 0 and brainFreeze_number == 1:337 while fingersOfFrost_number > 0:338 time = time + gcd339 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation340 fingersOfFrost_number -= 1341 time = time + gcd * 3342 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_chain_damage_fingersOfFrost_expectation * 2343 brainFreeze_number = 0344 # å°åºå¨æ®éç¶æä¸æ¸
0345 damage = damage + iceThorn_number * iceThorn_damage_expectation346 iceThorn_number = 0347 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0,ä½æ¯ç±äºè¿ä¸ªå°é£æ´åé¢æ¯å°æªä¸æ¯å¯å°ç®ï¼å¯å°ç®çå°åºåä¸å°å»ç»348 iceThorn_number += 1349 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation350 iceThorn_number = 0351 # å读å®çå¯å°ç®è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æå®ä¹åçå°æç«å»ææè¿ä¸ªå¯å°ç®å°æçå°æªï¼åæå°æºçå°é£æ´+2å°æªï¼ç¸å½äºå¤äºä¸ªå°æ352 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:353 time = time + gcd354 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation355 # å读å®çå¯å°ç®è§¦åäºå°æºï¼æ²¡è§¦åå°æï¼æµªè´¹ä¸ä¸ªå°æºï¼æå®ä¹åçå°æå°æº,å头356 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:357 pass358 # å读å®çå¯å°ç®è§¦åäºå°æºåå°æï¼æµªè´¹ä¸ä¸ªå°æºï¼æå®ä¹åå°æ对åºçå°æªï¼ç«å»ææè¿ä¸ªå¯å°ç®å°æçå°æªï¼åå°æºï¼å头359 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:360 time = time + gcd361 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation362 else:363 # å读å®çå¯å°ç®ï¼è§¦åäºå°æå°æº364 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:365 fingersOfFrost_number += 1366 fingersOfFrost_number = min(fingersOfFrost_number, 2)367 brainFreeze_number += 1368 brainFreeze_number = min(brainFreeze_number, 1)369 # å读å®çå¯å°ç®ï¼è§¦åå°æºï¼æ²¡è§¦åå°æ370 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:371 brainFreeze_number += 1372 brainFreeze_number = min(brainFreeze_number, 1)373 # å读å®çå¯å°ç®è§¦åäºå°æ没触åå°æº374 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:375 fingersOfFrost_number += 1376 fingersOfFrost_number = min(fingersOfFrost_number, 2)377dps_3 = damage / time378damage = 0379time = 0380fingersOfFrost_number = 0381brainFreeze_number = 0382iceThorn_number = 0383# 第åç§ææ³ï¼é¤éå好读å®ä¸ä¸ªå¯å°ç®åæ¶æå°æºï¼å¦åä¸æ1+1+2ï¼ç´æ¥æå°é£æ´+2å°æªï¼åæ¶æå°æºå°æï¼å°æºä¼å
ï¼å³æµªè´¹æå°æ384while damage < 100000000000:385 # 读æ¡ä¸ä¸ªå¯å°ç®386 time = time + freezeBolt_spellTime387 damage = damage + frostBolt_damage_expectation388 fingersOfFrost_trigger = np.random.random()389 brainFreeze_trigger = np.random.random()390 # å¯å°ç®å¤ä¸æ ¹å°åºï¼å¤§äº5èªå¨åå°391 iceThorn_number += 1392 iceThorn_auto = False393 if iceThorn_number > 5:394 iceThorn_auto = True395 iceThorn_number -= 1396 damage = damage + iceThorn_damage_expectation397 # ä¹åæå°æï¼æ²¡æ触åå°æºï¼è¯»å®è¿ä¸ªå¯å°ç®æä¸ä¸ªå°æçå°æª398 if fingersOfFrost_number > 0 and brainFreeze_number == 0:399 time = time + gcd400 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation401 fingersOfFrost_number -= 1402 # å°åºå¨æ®éç¶æä¸æ¸
0403 damage = damage + iceThorn_number * iceThorn_damage_expectation404 iceThorn_number = 0405 # å读å®çå¯å°ç®è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼ææææä¹ååçå°æåæäºè¿ä¸ªå°æï¼åå»æå¯å°ç®406 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:407 while fingersOfFrost_number > 0:408 time = time + gcd409 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation410 fingersOfFrost_number -= 1411 time = time + gcd412 damage = damage + iceLance_chain_damage_fingersOfFrost_expectation413 # å读å®çå¯å°ç®è§¦åäºå°æºï¼æ²¡è§¦åå°æï¼æå°é£æ´+2å°æªï¼å¯è½æµªè´¹å°æ414 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:415 time = time + gcd * 3416 damage = damage + iceStorm_damage_brainFreeze_expectation + \417 iceLance_chain_damage_fingersOfFrost_expectation * 2418 fingersOfFrost_number = 0419 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0,ä½æ¯ç±äºè¿ä¸ªå°é£æ´åé¢æ¯å°æªä¸æ¯å¯å°ç®ï¼å¯å°ç®çå°åºåä¸å°å»ç»420 iceThorn_number += 1421 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation422 iceThorn_number = 0423 # å读å®çå¯å°ç®è§¦åäºå°æºåå°æï¼æå°é£æ´+2å°æªï¼èµ·ç 浪费1å°æ424 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:425 time = time + gcd * 3426 damage = damage + iceStorm_damage_brainFreeze_expectation + \427 iceLance_chain_damage_fingersOfFrost_expectation * 2428 fingersOfFrost_number = 0429 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0,ä½æ¯ç±äºè¿ä¸ªå°é£æ´åé¢æ¯å°æªä¸æ¯å¯å°ç®ï¼å¯å°ç®çå°åºåä¸å°å»ç»430 iceThorn_number += 1431 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation432 iceThorn_number = 0433 # ä¹å触åäºå°æºï¼æ²¡æ触åå°æï¼æ£å¸¸1+1+2434 elif fingersOfFrost_number == 0 and brainFreeze_number == 1:435 time = time + gcd * 3436 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation437 damage = damage + iceStorm_damage_brainFreeze_expectation + \438 iceLance_chain_damage_fingersOfFrost_expectation * 2439 brainFreeze_number = 0440 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0441 iceThorn_number += 1442 if iceThorn_auto:443 damage = damage - iceThorn_damage_expectation + iceThorn_damage_freeze_expectation444 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation445 iceThorn_number = 0446 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ447 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:448 pass449 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼æå®ä¹åå°æºç1+1+2ï¼æè¿ä¸ªå°æºçå°é£æ´+2å°æª450 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:451 time = time + gcd * 3452 damage = damage + iceStorm_damage_brainFreeze_expectation + \453 iceLance_chain_damage_fingersOfFrost_expectation * 2454 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0ï¼æ¤æ¶ä¸ç¨èèå读å®çå¯å°ç®çå°åºï¼ä¹åçå°é£æ´å·²ç»ç®å¨å
äº455 iceThorn_number += 1456 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation457 iceThorn_number = 0458 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æå®ä¹åå°æºç1+1+2ï¼æè¿ä¸ªå°æºçå°é£æ´+2å°æªï¼æµªè´¹ä¸ä¸ªå°æ459 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:460 time = time + gcd * 3461 damage = damage + iceStorm_damage_brainFreeze_expectation + \462 iceLance_chain_damage_fingersOfFrost_expectation * 2463 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0ï¼æ¤æ¶ä¸ç¨èèå读å®çå¯å°ç®çå°åºï¼ä¹åçå°é£æ´å·²ç»ç®å¨å
äº464 iceThorn_number += 1465 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation466 iceThorn_number = 0467 # ä¹å触åäºå°æºåå°æï¼æµªè´¹æåçå°ææ£å¸¸1+1+2468 elif fingersOfFrost_number > 0 and brainFreeze_number == 1:469 time = time + gcd * 3470 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation471 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_chain_damage_fingersOfFrost_expectation * 2472 brainFreeze_number = 0473 fingersOfFrost_number = 0474 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0475 iceThorn_number += 1476 if iceThorn_auto:477 damage = damage - iceThorn_damage_expectation + iceThorn_damage_freeze_expectation478 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation479 iceThorn_number = 0480 # å读å®çå¯å°ç®ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ481 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:482 pass483 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼æå°é£æ´+2å°æª484 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:485 time = time + gcd * 3486 damage = damage + iceStorm_damage_brainFreeze_expectation + \487 iceLance_chain_damage_fingersOfFrost_expectation * 2488 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0ï¼æ¤æ¶ä¸ç¨èèå读å®çå¯å°ç®çå°åºï¼ä¹åçå°é£æ´å·²ç»ç®å¨å
äº489 iceThorn_number += 1490 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation491 iceThorn_number = 0492 # å读å®çå¯å°ç®å¨åä¸ä¸ªå¯å°ç®å°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æµªè´¹ä¸ä¸ªå°æï¼æå°é£æ´+2å°æª493 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:494 time = time + gcd * 3495 damage = damage + iceStorm_damage_brainFreeze_expectation + \496 iceLance_chain_damage_fingersOfFrost_expectation * 2497 # å°é£æ´å¤ä¸æ ¹å°åºï¼åæ¶å°åºå¨å»ç»ç¶æä¸æ¸
0ï¼æ¤æ¶ä¸ç¨èèå读å®çå¯å°ç®çå°åºï¼ä¹åçå°é£æ´å·²ç»ç®å¨å
äº498 iceThorn_number += 1499 damage = damage + iceThorn_number * iceThorn_damage_freeze_expectation500 iceThorn_number = 0501 # ä¹åå¥é½æ²¡ï¼è¯»å®è¿ä¸ªå¯å°ç®è®¡ç®å®è§¦åï¼å头继ç»è¯»502 else:503 # å读å®çå¯å°ç®ï¼è§¦åäºå°æå°æº504 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:505 fingersOfFrost_number += 1506 fingersOfFrost_number = min(fingersOfFrost_number, 2)507 brainFreeze_number += 1508 brainFreeze_number = min(brainFreeze_number, 1)509 # å读å®çå¯å°ç®ï¼è§¦åå°æºï¼æ²¡è§¦åå°æ510 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:511 brainFreeze_number += 1512 brainFreeze_number = min(brainFreeze_number, 1)513 # å读å®çå¯å°ç®è§¦åäºå°æ没触åå°æº514 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:515 fingersOfFrost_number += 1516 fingersOfFrost_number = min(fingersOfFrost_number, 2)517dps_4 = damage / time518print(dps_1)519print(dps_2)520print(dps_3)...
freeze2.py
Source:freeze2.py
1import numpy as np2# åºæ¬è®¾å®ï¼æ´å»ï¼å»ç»æ´å»ï¼æ½æ³æ¶é´ï¼å°æåå°æºæ¦çï¼ç¹å°å»ä¹è§¦ï¼3critical = 1/34critical_expectation = 1 + critical5critical_expectation = min(critical_expectation, 2)6freeze_critical_expectation = min(1 + 1.5 * critical + 0.5, 2)7freezeBolt_spellTime = 28gcd = 1.59fingersOfFrost_probability = 0.1810brainFreeze_probability = 0.3611print(freeze_critical_expectation)12#å¯å°ç®è®¾å®ï¼åºæ¬ä¼¤å®³ï¼ææ伤害ï¼å»ç»ä¸ææ伤害13frostBolt_basic_damage = 75614frostBolt_damage_expectation = frostBolt_basic_damage * critical_expectation15frostBolt_damage_freeze_expectation = frostBolt_basic_damage * freeze_critical_expectation16#å°æªè®¾å®ï¼åºæ¬ä¼¤å®³ï¼è¿éååºå¤©èµä¼¤å®³ï¼å°æä¸ææ伤害17iceLance_basic_damage = 56218iceLance_basic_damage_fingersOfFrost_expectation = iceLance_basic_damage * 3 * freeze_critical_expectation19#å°é£æ´è®¾å®ï¼åºæ¬ä¼¤å®³ï¼å°æºä¸åºç¡ä¼¤å®³ï¼å°æºä¸ææ伤害20iceStorm_basic_damage = 122021iceStorm_damage_brainFreeze = iceStorm_basic_damage * 1.522iceStorm_damage_brainFreeze_expectation = iceStorm_damage_brainFreeze / 3 * critical_expectation \23 + iceStorm_damage_brainFreeze / 3 * 2 * freeze_critical_expectation24damage = 025time = 026fingersOfFrost_number = 027brainFreeze_number = 028#t = np.random.random()29#第ä¸ç§ææ³ï¼æ 论ä½æ¶é½æ¯å°æºä¼å
ï¼ä¸ç®¡æ没æå°æï¼åªè¦æå°æºé½æ1+1+230while damage < 100000000000:31 #读æ¡ä¸ä¸ªå¯å°ç®32 time = time + freezeBolt_spellTime33 damage = damage + frostBolt_damage_expectation34 fingersOfFrost_trigger = np.random.random()35 brainFreeze_trigger = np.random.random()36 #ä¹åæå°æï¼æ²¡æ触åå°æºï¼è¯»å®è¿ä¸ªå¯å°ç®æä¸ä¸ªå°æçå°æª37 if fingersOfFrost_number > 0 and brainFreeze_number == 0:38 time = time + gcd39 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation40 fingersOfFrost_number -= 141 #å读å®çå¯å°ç®è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼ææææä¹ååçå°æåæäºè¿ä¸ªå°æï¼åå»æå¯å°ç®42 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:43 while fingersOfFrost_number > 0:44 time = time + gcd45 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation46 fingersOfFrost_number -= 147 time = time + gcd48 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation49 # å读å®çå¯å°ç®è§¦åäºå°æºï¼æ²¡è§¦åå°æï¼æ¹åèµæºæ°éåæ£å¸¸æ1+1+2ï¼çæäºåå°å¼å¤´æå¯å°ç®50 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:51 brainFreeze_number += 152 brainFreeze_number = min(brainFreeze_number, 1)53 # å读å®çå¯å°ç®è§¦åäºå°æºåå°æï¼æ¹åèµæºæ°éåæ£å¸¸æ1+1+2ï¼çæäºåå°å¼å¤´æå¯å°ç®54 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:55 fingersOfFrost_number += 156 fingersOfFrost_number = min(fingersOfFrost_number, 2)57 brainFreeze_number += 158 brainFreeze_number = min(brainFreeze_number, 1)59 # ä¹å触åäºå°æºï¼æ²¡æ触åå°æï¼æ£å¸¸1+1+260 elif fingersOfFrost_number == 0 and brainFreeze_number == 1:61 time = time + gcd * 362 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation63 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_basic_damage_fingersOfFrost_expectation * 264 brainFreeze_number = 065 #å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ66 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:67 pass68 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼å¤äºä¸ä¸ªå°æº69 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:70 brainFreeze_number += 171 brainFreeze_number = min(brainFreeze_number, 1)72 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æµªè´¹ä¸ä¸ªå°æï¼å¤äºä¸ä¸ªå°æº73 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:74 brainFreeze_number += 175 brainFreeze_number = min(brainFreeze_number, 1)76 # ä¹å触åäºå°æºåå°æï¼æµªè´¹æåçå°ææ£å¸¸1+1+277 elif fingersOfFrost_number > 0 and brainFreeze_number == 1:78 time = time + gcd * 379 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation80 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_basic_damage_fingersOfFrost_expectation * 281 brainFreeze_number = 082 fingersOfFrost_number = 083 #å读å®çå¯å°ç®å¨åä¸ä¸ªå¯å°ç®å°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ84 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:85 pass86 # å读å®çå¯å°ç®å¨åä¸ä¸ªå¯å°ç®å°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼å¤äºä¸ä¸ªå°æº87 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:88 brainFreeze_number += 189 brainFreeze_number = min(brainFreeze_number, 1)90 # å读å®çå¯å°ç®å¨åä¸ä¸ªå¯å°ç®å°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æµªè´¹ä¸ä¸ªå°æï¼å¤äºä¸ä¸ªå°æº91 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:92 brainFreeze_number += 193 brainFreeze_number = min(brainFreeze_number, 1)94 #ä¹åå¥é½æ²¡ï¼è¯»å®è¿ä¸ªå¯å°ç®è®¡ç®å®è§¦åï¼å头继ç»è¯»95 else:96 # å读å®çå¯å°ç®ï¼è§¦åäºå°æå°æº97 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:98 fingersOfFrost_number += 199 fingersOfFrost_number = min(fingersOfFrost_number, 2)100 brainFreeze_number += 1101 brainFreeze_number = min(brainFreeze_number, 1)102 # å读å®çå¯å°ç®ï¼è§¦åå°æºï¼æ²¡è§¦åå°æ103 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:104 brainFreeze_number += 1105 brainFreeze_number = min(brainFreeze_number, 1)106 # å读å®çå¯å°ç®è§¦åäºå°æ没触åå°æº107 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:108 fingersOfFrost_number += 1109 fingersOfFrost_number = min(fingersOfFrost_number, 2)110dps_1 = damage / time111damage = 0112time = 0113fingersOfFrost_number = 0114brainFreeze_number = 0115#第äºç§ææ³ï¼ç»ä¸æµªè´¹ä»»æå¯ä»¥æåºçå°æï¼æå°æºåå°æä¹å
æå°æ对åºçå°æªåå»1+1+2116while damage < 100000000000:117 #读æ¡ä¸ä¸ªå¯å°ç®118 time = time + freezeBolt_spellTime119 damage = damage + frostBolt_damage_expectation120 fingersOfFrost_trigger = np.random.random()121 brainFreeze_trigger = np.random.random()122 #ä¹å触åäºå°æï¼æ²¡æ触åå°æºï¼æå®ææåçå°æ123 if fingersOfFrost_number > 0 and brainFreeze_number == 0:124 while fingersOfFrost_number > 0:125 time = time + gcd126 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation127 fingersOfFrost_number -= 1128 #å读å®çå¯å°ç®è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æå®ä¹ååçå°æ对åºçå°æªï¼ç«å»ææè¿ä¸ªå¯å°ç®å°æçå°æªï¼å头读å¯å°ç®129 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:130 time = time + gcd131 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation132 # å读å®çå¯å°ç®è§¦åäºå°æºï¼æ²¡è§¦åå°æï¼æå®ä¹ååçå°æ对åºçå°æªï¼åå»æ£å¸¸æ1+1+2ï¼133 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:134 brainFreeze_number += 1135 brainFreeze_number = min(brainFreeze_number, 1)136 # å读å®çå¯å°ç®è§¦åäºå°æºåå°æï¼æå®ä¹ååçå°æ对åºçå°æªï¼å
æè¿ä¸ªå¯å°ç®å°æ对åºçå°æªï¼ååå°å¼å¤´æ1+1+2137 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:138 time = time + gcd139 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation140 brainFreeze_number += 1141 brainFreeze_number = min(brainFreeze_number, 1)142 # ä¹å触åäºå°æºï¼æ²¡æ触åå°æï¼æ£å¸¸1+1+2143 elif fingersOfFrost_number == 0 and brainFreeze_number == 1:144 time = time + gcd * 3145 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation146 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_basic_damage_fingersOfFrost_expectation * 2147 brainFreeze_number = 0148 #å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ149 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:150 pass151 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼å¤äºä¸ä¸ªå°æº152 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:153 brainFreeze_number += 1154 brainFreeze_number = min(brainFreeze_number, 1)155 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æµªè´¹ä¸ä¸ªå°æï¼å¤äºä¸ä¸ªå°æº156 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:157 brainFreeze_number += 1158 brainFreeze_number = min(brainFreeze_number, 1)159 # ä¹å触åäºå°æºåå°æï¼æå®ä¹ååçå°æªï¼çè¿ä¸ªå¯å°ç®æ没æ触åå°æï¼åå头æ1+1+2160 elif fingersOfFrost_number > 0 and brainFreeze_number == 1:161 while fingersOfFrost_number > 0:162 time = time + gcd163 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation164 fingersOfFrost_number -= 1165 #å读å®çå¯å°ç®å¨ä¹åå°æ对åºçå°æªåºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æå®ææåçå°æï¼æåºè¿ä¸ªå¯å°ç®å°æçå°æªï¼å头1+1+2166 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:167 time = time + gcd168 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation169 # å读å®çå¯å°ç®ä¹ååçå°æ对åºçå°æªåºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼åä¸ä¸ªå°æºè¿å¨ï¼æµªè´¹ä¸ä¸ªå°æº170 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:171 pass172 # å读å®çå¯å°ç®å¨ä¹åå°æ对åºçå°æªåºæåï¼è§¦åäºå°æåå°æºï¼åä¸ä¸ªå°æºè¿å¨,浪费ä¸ä¸ªå°æºï¼æåºè¿ä¸ªå¯å°ç®å°æ对åºçå°æªï¼å头173 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:174 time = time + gcd175 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation176 #ä¹åå¥é½æ²¡æï¼è¯»å®è¿ä¸ªå¯å°ç®è®¡ç®å®è§¦åï¼å头继ç»è¯»177 else:178 # å读å®çå¯å°ç®ï¼è§¦åäºå°æå°æº179 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:180 fingersOfFrost_number += 1181 fingersOfFrost_number = min(fingersOfFrost_number, 2)182 brainFreeze_number += 1183 brainFreeze_number = min(brainFreeze_number, 1)184 # å读å®çå¯å°ç®ï¼è§¦åå°æºï¼æ²¡è§¦åå°æ185 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:186 brainFreeze_number += 1187 brainFreeze_number = min(brainFreeze_number, 1)188 # å读å®çå¯å°ç®è§¦åäºå°æ没触åå°æº189 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:190 fingersOfFrost_number += 1191 fingersOfFrost_number = min(fingersOfFrost_number, 2)192dps_2 = damage / time193damage = 0194time = 0195fingersOfFrost_number = 0196brainFreeze_number = 0197#第ä¸ç§ææ³ï¼ä¸æµªè´¹ä»»ä½å°æï¼åæ¶é¤éæ¯ä¹ååªæå°æºï¼å¹¶ä¸åæåºå»äºå¯å°ç®ï¼ææ1+1+2ï¼å¦åæå°æºç´æ¥æå°é£æ´+2å°æª198while damage < 100000000000:199 #读æ¡ä¸ä¸ªå¯å°ç®200 time = time + freezeBolt_spellTime201 damage = damage + frostBolt_damage_expectation202 fingersOfFrost_trigger = np.random.random()203 brainFreeze_trigger = np.random.random()204 #ä¹å触åäºå°æï¼æ²¡æ触åå°æºï¼æå®ææåçå°æ205 if fingersOfFrost_number > 0 and brainFreeze_number == 0:206 while fingersOfFrost_number > 0:207 time = time + gcd208 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation209 fingersOfFrost_number -= 1210 # å读å®çå¯å°ç®è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æå®ä¹åå°æ对åºçå°æªç«å»ææè¿ä¸ªå¯å°ç®å°æçå°æªï¼åå»æå¯å°ç®211 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:212 time = time + gcd213 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation214 # å读å®çå¯å°ç®è§¦åäºå°æºï¼æ²¡è§¦åå°æï¼æå®ä¹åå°æ对åºçå°æªï¼æè¿ä¸ªå°æºçå°é£æ´+2å°æª215 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:216 time = time + gcd * 3217 damage = damage + iceStorm_damage_brainFreeze_expectation + \218 iceLance_basic_damage_fingersOfFrost_expectation * 2219 brainFreeze_number = 0220 # å读å®çå¯å°ç®è§¦åäºå°æºåå°æï¼æå®ä¹åå°æ对åºçå°æªï¼å
æè¿ä¸ªå¯å°ç®å°æ对åºçå°æªï¼åæè¿ä¸ªå°æºçå°é£æ´+2å°æª221 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:222 time = time + gcd223 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation224 time = time + gcd * 3225 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_basic_damage_fingersOfFrost_expectation * 2226 brainFreeze_number = 0227 # ä¹å触åäºå°æºï¼æ²¡æ触åå°æï¼æ£å¸¸1+1+2228 elif fingersOfFrost_number == 0 and brainFreeze_number == 1:229 time = time + gcd * 3230 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation231 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_basic_damage_fingersOfFrost_expectation * 2232 brainFreeze_number = 0233 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ234 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:235 pass236 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼å¤äºä¸ä¸ªå°æº,æå®è¿ä¸ª1+1+2ï¼ç´æ¥æè¿ä¸ªå°æºçå°é£æ´+2å°æª237 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:238 time = time + gcd * 3239 damage = damage + iceStorm_damage_brainFreeze_expectation + \240 iceLance_basic_damage_fingersOfFrost_expectation * 2241 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æµªè´¹ä¸ä¸ªå°æï¼å¤äºä¸ä¸ªå°æº,æå®è¿ä¸ª1+1+2ï¼242 # ç´æ¥æè¿ä¸ªå°æºçå°é£æ´+2å°æª243 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:244 time = time + gcd * 3245 damage = damage + iceStorm_damage_brainFreeze_expectation + \246 iceLance_basic_damage_fingersOfFrost_expectation * 2247 # ä¹å触åäºå°æºåå°æï¼è¯»å®è¿ä¸ªå¯å°ç®ï¼æå®ææå°ææä¹åå°æºçå°é£æ´+2å°æª248 elif fingersOfFrost_number > 0 and brainFreeze_number == 1:249 while fingersOfFrost_number > 0:250 time = time + gcd251 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation252 fingersOfFrost_number -= 1253 time = time + gcd * 3254 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_basic_damage_fingersOfFrost_expectation * 2255 brainFreeze_number = 0256 #å读å®çå¯å°ç®è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æå®ä¹åçå°æå°æºï¼ç«å»ææè¿ä¸ªå¯å°ç®å°æçå°æªï¼åå»æå¯å°ç®257 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:258 time = time + gcd259 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation260 # å读å®çå¯å°ç®è§¦åäºå°æºï¼æ²¡è§¦åå°æï¼æµªè´¹ä¸ä¸ªå°æºï¼æå®ä¹åçå°æå°æº,å头261 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:262 pass263 # å读å®çå¯å°ç®è§¦åäºå°æºåå°æï¼æµªè´¹ä¸ä¸ªå°æºï¼æå®ä¹åå°æ对åºçå°æªï¼ç«å»ææè¿ä¸ªå¯å°ç®å°æçå°æªï¼å头264 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:265 time = time + gcd266 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation267 else:268 # å读å®çå¯å°ç®ï¼è§¦åäºå°æå°æº269 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:270 fingersOfFrost_number += 1271 fingersOfFrost_number = min(fingersOfFrost_number, 2)272 brainFreeze_number += 1273 brainFreeze_number = min(brainFreeze_number, 1)274 # å读å®çå¯å°ç®ï¼è§¦åå°æºï¼æ²¡è§¦åå°æ275 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:276 brainFreeze_number += 1277 brainFreeze_number = min(brainFreeze_number, 1)278 # å读å®çå¯å°ç®è§¦åäºå°æ没触åå°æº279 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:280 fingersOfFrost_number += 1281 fingersOfFrost_number = min(fingersOfFrost_number, 2)282dps_3 = damage / time283damage = 0284time = 0285fingersOfFrost_number = 0286brainFreeze_number = 0287#第åç§ææ³ï¼é¤éå好读å®ä¸ä¸ªå¯å°ç®åæ¶æå°æºï¼å¦åä¸æ1+1+2ï¼ç´æ¥æå°é£æ´+2å°æªï¼åæ¶æå°æºå°æï¼å°æºä¼å
ï¼å³æµªè´¹æå°æï¼å®æ§ä¹è½åæåºè¿ä¸ªä¸è¡ï¼288while damage < 100000000000:289 #读æ¡ä¸ä¸ªå¯å°ç®290 time = time + freezeBolt_spellTime291 damage = damage + frostBolt_damage_expectation292 fingersOfFrost_trigger = np.random.random()293 brainFreeze_trigger = np.random.random()294 #ä¹åæå°æï¼æ²¡æ触åå°æºï¼è¯»å®è¿ä¸ªå¯å°ç®æä¸ä¸ªå°æçå°æª295 if fingersOfFrost_number > 0 and brainFreeze_number == 0:296 time = time + gcd297 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation298 fingersOfFrost_number -= 1299 #å读å®çå¯å°ç®è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼ææææä¹ååçå°æåæäºè¿ä¸ªå°æï¼åå»æå¯å°ç®300 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:301 while fingersOfFrost_number > 0:302 time = time + gcd303 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation304 fingersOfFrost_number -= 1305 time = time + gcd306 damage = damage + iceLance_basic_damage_fingersOfFrost_expectation307 # å读å®çå¯å°ç®è§¦åäºå°æºï¼æ²¡è§¦åå°æï¼æå°é£æ´+2å°æªï¼å¯è½æµªè´¹å°æ308 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:309 time = time + gcd * 3310 damage = damage + iceStorm_damage_brainFreeze_expectation + \311 iceLance_basic_damage_fingersOfFrost_expectation * 2312 fingersOfFrost_number = 0313 # å读å®çå¯å°ç®è§¦åäºå°æºåå°æï¼æå°é£æ´+2å°æªï¼èµ·ç 浪费1å°æ314 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:315 time = time + gcd * 3316 damage = damage + iceStorm_damage_brainFreeze_expectation + \317 iceLance_basic_damage_fingersOfFrost_expectation * 2318 fingersOfFrost_number = 0319 # ä¹å触åäºå°æºï¼æ²¡æ触åå°æï¼æ£å¸¸1+1+2320 elif fingersOfFrost_number == 0 and brainFreeze_number == 1:321 time = time + gcd * 3322 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation323 damage = damage + iceStorm_damage_brainFreeze_expectation + \324 iceLance_basic_damage_fingersOfFrost_expectation * 2325 brainFreeze_number = 0326 #å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ327 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:328 pass329 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼æå®ä¹åå°æºç1+1+2ï¼æè¿ä¸ªå°æºçå°é£æ´+2å°æª330 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:331 time = time + gcd * 3332 damage = damage + iceStorm_damage_brainFreeze_expectation + \333 iceLance_basic_damage_fingersOfFrost_expectation * 2334 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æå®ä¹åå°æºç1+1+2ï¼æè¿ä¸ªå°æºçå°é£æ´+2å°æªï¼æµªè´¹ä¸ä¸ªå°æ335 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:336 time = time + gcd * 3337 damage = damage + iceStorm_damage_brainFreeze_expectation + \338 iceLance_basic_damage_fingersOfFrost_expectation * 2339 # ä¹å触åäºå°æºåå°æï¼æµªè´¹æåçå°ææ£å¸¸1+1+2340 elif fingersOfFrost_number > 0 and brainFreeze_number == 1:341 time = time + gcd * 3342 damage = damage - frostBolt_damage_expectation + frostBolt_damage_freeze_expectation343 damage = damage + iceStorm_damage_brainFreeze_expectation + iceLance_basic_damage_fingersOfFrost_expectation * 2344 brainFreeze_number = 0345 fingersOfFrost_number = 0346 #å读å®çå¯å°ç®ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æï¼æ²¡è§¦åå°æºï¼æµªè´¹ä¸ä¸ªå°æ347 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:348 pass349 # å读å®çå¯å°ç®å¨ä¹åå°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åå°æºï¼æ²¡è§¦åå°æï¼æå°é£æ´+2å°æª350 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:351 time = time + gcd * 3352 damage = damage + iceStorm_damage_brainFreeze_expectation + \353 iceLance_basic_damage_fingersOfFrost_expectation * 2354 # å读å®çå¯å°ç®å¨åä¸ä¸ªå¯å°ç®å°æºå¯¹åºçå°é£æ´åºæåï¼è§¦åäºå°æåå°æºï¼æµªè´¹ä¸ä¸ªå°æï¼æå°é£æ´+2å°æª355 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:356 time = time + gcd * 3357 damage = damage + iceStorm_damage_brainFreeze_expectation + \358 iceLance_basic_damage_fingersOfFrost_expectation * 2359 #ä¹åå¥é½æ²¡ï¼è¯»å®è¿ä¸ªå¯å°ç®è®¡ç®å®è§¦åï¼å头继ç»è¯»360 else:361 # å读å®çå¯å°ç®ï¼è§¦åäºå°æå°æº362 if fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:363 fingersOfFrost_number += 1364 fingersOfFrost_number = min(fingersOfFrost_number, 2)365 brainFreeze_number += 1366 brainFreeze_number = min(brainFreeze_number, 1)367 # å读å®çå¯å°ç®ï¼è§¦åå°æºï¼æ²¡è§¦åå°æ368 elif fingersOfFrost_trigger > fingersOfFrost_probability and brainFreeze_trigger <= brainFreeze_probability:369 brainFreeze_number += 1370 brainFreeze_number = min(brainFreeze_number, 1)371 # å读å®çå¯å°ç®è§¦åäºå°æ没触åå°æº372 elif fingersOfFrost_trigger <= fingersOfFrost_probability and brainFreeze_trigger > brainFreeze_probability:373 fingersOfFrost_number += 1374 fingersOfFrost_number = min(fingersOfFrost_number, 2)375dps_4 = damage / time376print(dps_1)377print(dps_2)378print(dps_3)...
test_timeout.py
Source:test_timeout.py
...15 timeout = TimeoutManager()16 with pytest.raises(asyncio.TimeoutError):17 async with timeout.async_timeout(0.1):18 await hass.async_add_executor_job(lambda: time.sleep(0.2))19async def test_simple_global_timeout_freeze():20 """Test a simple global timeout freeze."""21 timeout = TimeoutManager()22 async with timeout.async_timeout(0.2):23 async with timeout.async_freeze():24 await asyncio.sleep(0.3)25async def test_simple_zone_timeout_freeze_inside_executor_job(hass):26 """Test a simple zone timeout freeze inside an executor job."""27 timeout = TimeoutManager()28 def _some_sync_work():29 with timeout.freeze("recorder"):30 time.sleep(0.3)31 async with timeout.async_timeout(1.0):32 async with timeout.async_timeout(0.2, zone_name="recorder"):33 await hass.async_add_executor_job(_some_sync_work)34async def test_simple_global_timeout_freeze_inside_executor_job(hass):35 """Test a simple global timeout freeze inside an executor job."""36 timeout = TimeoutManager()37 def _some_sync_work():38 with timeout.freeze():39 time.sleep(0.3)40 async with timeout.async_timeout(0.2):41 await hass.async_add_executor_job(_some_sync_work)42async def test_mix_global_timeout_freeze_and_zone_freeze_inside_executor_job(hass):43 """Test a simple global timeout freeze inside an executor job."""44 timeout = TimeoutManager()45 def _some_sync_work():46 with timeout.freeze("recorder"):47 time.sleep(0.3)48 async with timeout.async_timeout(0.1):49 async with timeout.async_timeout(0.2, zone_name="recorder"):50 await hass.async_add_executor_job(_some_sync_work)51async def test_mix_global_timeout_freeze_and_zone_freeze_different_order(hass):52 """Test a simple global timeout freeze inside an executor job before timeout was set."""53 timeout = TimeoutManager()54 def _some_sync_work():55 with timeout.freeze("recorder"):56 time.sleep(0.4)57 async with timeout.async_timeout(0.1):58 hass.async_add_executor_job(_some_sync_work)59 async with timeout.async_timeout(0.2, zone_name="recorder"):60 await asyncio.sleep(0.3)61async def test_mix_global_timeout_freeze_and_zone_freeze_other_zone_inside_executor_job(62 hass,63):64 """Test a simple global timeout freeze other zone inside an executor job."""65 timeout = TimeoutManager()66 def _some_sync_work():67 with timeout.freeze("not_recorder"):68 time.sleep(0.3)69 with pytest.raises(asyncio.TimeoutError):70 async with timeout.async_timeout(0.1):71 async with timeout.async_timeout(0.2, zone_name="recorder"):72 async with timeout.async_timeout(0.2, zone_name="not_recorder"):73 await hass.async_add_executor_job(_some_sync_work)74async def test_mix_global_timeout_freeze_and_zone_freeze_inside_executor_job_second_job_outside_zone_context(75 hass,76):77 """Test a simple global timeout freeze inside an executor job with second job outside of zone context."""78 timeout = TimeoutManager()79 def _some_sync_work():80 with timeout.freeze("recorder"):81 time.sleep(0.3)82 with pytest.raises(asyncio.TimeoutError):83 async with timeout.async_timeout(0.1):84 async with timeout.async_timeout(0.2, zone_name="recorder"):85 await hass.async_add_executor_job(_some_sync_work)86 await hass.async_add_executor_job(lambda: time.sleep(0.2))87async def test_simple_global_timeout_freeze_with_executor_job(hass):88 """Test a simple global timeout freeze with executor job."""89 timeout = TimeoutManager()90 async with timeout.async_timeout(0.2):91 async with timeout.async_freeze():92 await hass.async_add_executor_job(lambda: time.sleep(0.3))93async def test_simple_global_timeout_freeze_reset():94 """Test a simple global timeout freeze reset."""95 timeout = TimeoutManager()96 with pytest.raises(asyncio.TimeoutError):97 async with timeout.async_timeout(0.2):98 async with timeout.async_freeze():99 await asyncio.sleep(0.1)100 await asyncio.sleep(0.2)101async def test_simple_zone_timeout():102 """Test a simple zone timeout."""103 timeout = TimeoutManager()104 with pytest.raises(asyncio.TimeoutError):105 async with timeout.async_timeout(0.1, "test"):106 await asyncio.sleep(0.3)107async def test_multiple_zone_timeout():108 """Test a simple zone timeout."""109 timeout = TimeoutManager()110 with pytest.raises(asyncio.TimeoutError):111 async with timeout.async_timeout(0.1, "test"):112 async with timeout.async_timeout(0.5, "test"):113 await asyncio.sleep(0.3)114async def test_different_zone_timeout():115 """Test a simple zone timeout."""116 timeout = TimeoutManager()117 with pytest.raises(asyncio.TimeoutError):118 async with timeout.async_timeout(0.1, "test"):119 async with timeout.async_timeout(0.5, "other"):120 await asyncio.sleep(0.3)121async def test_simple_zone_timeout_freeze():122 """Test a simple zone timeout freeze."""123 timeout = TimeoutManager()124 async with timeout.async_timeout(0.2, "test"):125 async with timeout.async_freeze("test"):126 await asyncio.sleep(0.3)127async def test_simple_zone_timeout_freeze_without_timeout():128 """Test a simple zone timeout freeze on a zone that does not have a timeout set."""129 timeout = TimeoutManager()130 async with timeout.async_timeout(0.1, "test"):131 async with timeout.async_freeze("test"):132 await asyncio.sleep(0.3)133async def test_simple_zone_timeout_freeze_reset():134 """Test a simple zone timeout freeze reset."""135 timeout = TimeoutManager()136 with pytest.raises(asyncio.TimeoutError):137 async with timeout.async_timeout(0.2, "test"):138 async with timeout.async_freeze("test"):139 await asyncio.sleep(0.1)140 await asyncio.sleep(0.2, "test")141async def test_mix_zone_timeout_freeze_and_global_freeze():142 """Test a mix zone timeout freeze and global freeze."""143 timeout = TimeoutManager()144 async with timeout.async_timeout(0.2, "test"):145 async with timeout.async_freeze("test"):146 async with timeout.async_freeze():147 await asyncio.sleep(0.3)148async def test_mix_global_and_zone_timeout_freeze_():149 """Test a mix zone timeout freeze and global freeze."""150 timeout = TimeoutManager()151 async with timeout.async_timeout(0.2, "test"):152 async with timeout.async_freeze():153 async with timeout.async_freeze("test"):154 await asyncio.sleep(0.3)155async def test_mix_zone_timeout_freeze():156 """Test a mix zone timeout global freeze."""157 timeout = TimeoutManager()158 async with timeout.async_timeout(0.2, "test"):159 async with timeout.async_freeze():160 await asyncio.sleep(0.3)161async def test_mix_zone_timeout():162 """Test a mix zone timeout global."""163 timeout = TimeoutManager()164 async with timeout.async_timeout(0.1):165 with suppress(asyncio.TimeoutError):166 async with timeout.async_timeout(0.2, "test"):167 await asyncio.sleep(0.4)168async def test_mix_zone_timeout_trigger_global():169 """Test a mix zone timeout global with trigger it."""170 timeout = TimeoutManager()171 with pytest.raises(asyncio.TimeoutError):172 async with timeout.async_timeout(0.1):173 with suppress(asyncio.TimeoutError):174 async with timeout.async_timeout(0.1, "test"):175 await asyncio.sleep(0.3)176 await asyncio.sleep(0.3)177async def test_mix_zone_timeout_trigger_global_cool_down():178 """Test a mix zone timeout global with trigger it with cool_down."""179 timeout = TimeoutManager()180 async with timeout.async_timeout(0.1, cool_down=0.3):181 with suppress(asyncio.TimeoutError):182 async with timeout.async_timeout(0.1, "test"):183 await asyncio.sleep(0.3)184 await asyncio.sleep(0.2)185async def test_simple_zone_timeout_freeze_without_timeout_cleanup(hass):186 """Test a simple zone timeout freeze on a zone that does not have a timeout set."""187 timeout = TimeoutManager()188 async def background():189 async with timeout.async_freeze("test"):190 await asyncio.sleep(0.4)191 async with timeout.async_timeout(0.1):192 hass.async_create_task(background())193 await asyncio.sleep(0.2)194async def test_simple_zone_timeout_freeze_without_timeout_cleanup2(hass):195 """Test a simple zone timeout freeze on a zone that does not have a timeout set."""196 timeout = TimeoutManager()197 async def background():198 async with timeout.async_freeze("test"):199 await asyncio.sleep(0.2)200 with pytest.raises(asyncio.TimeoutError):201 async with timeout.async_timeout(0.1):202 hass.async_create_task(background())203 await asyncio.sleep(0.3)204async def test_simple_zone_timeout_freeze_without_timeout_exeption():205 """Test a simple zone timeout freeze on a zone that does not have a timeout set."""206 timeout = TimeoutManager()207 with pytest.raises(asyncio.TimeoutError):208 async with timeout.async_timeout(0.1):209 with suppress(RuntimeError):210 async with timeout.async_freeze("test"):211 raise RuntimeError()212 await asyncio.sleep(0.4)213async def test_simple_zone_timeout_zone_with_timeout_exeption():214 """Test a simple zone timeout freeze on a zone that does not have a timeout set."""215 timeout = TimeoutManager()216 with pytest.raises(asyncio.TimeoutError):217 async with timeout.async_timeout(0.1):218 with suppress(RuntimeError):219 async with timeout.async_timeout(0.3, "test"):220 raise RuntimeError()...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!