- 在開始非巨人機關出現時不要移動,站在原地并僅在敵人接近時輸出,距離判斷可以自行調試,這裡取25,防止當投石車出現時自動跑到雷區邊上普通攻擊投石車,進而巨人出現的時候來不及逃跑造成死亡。
- 距離較遠的時候使用單體高傷害技能"lightning-bolt"(閃電)。
- 距離近的時候使用"chain-lightning"(閃電鍊),因為當敵人群體出現時肯定會沖到你的附近,避免使用閃電鍊攻擊遠處單個敵人導緻技能CD陣亡。
- 當巨人出現時撤退,直接去坐标(8, 32)處踩引爆器,全螢幕爆炸巨人投石車全部帶走實作完美通關。
# # Defeat as many ogres as you can.
# # Use 'cast' and 'canCast' for spells.
def attackEnemy():
enemy = hero.findNearestEnemy()
if enemy:
if enemy.type == "ogre":
hero.moveXY(8, 32)
distance = hero.distanceTo(enemy)
if distance > 25:
if hero.canCast("lightning-bolt", enemy):
hero.cast("lightning-bolt", enemy)
elif hero.canCast("chain-lightning", enemy):
hero.cast("chain-lightning", enemy)
else:
hero.attack(enemy)
else:
if hero.canCast("regen", hero):
hero.cast("regen", hero)
while True:
attackEnemy()