Code Combat - Noble Sacrifice

Words
134
Reading
1 min
Listen
Play
6y

这句游戏是有史以来感觉最惨烈的一局。。。

首先要捡钱,钱够了之后用“summon”函数召唤4个小兵。之后使用“command"指令,让四个小兵分别到指定的位置。。

惨烈的部分到了,这四个小兵是作为诱饵来吸引右上角的大怪物去敌人的营地。。。最后,除了我自己之外,所有的人都被怪物杀掉了。。。。

image.png

老规矩,源代码:

# Collect 80 gold
while hero.gold < 80:
    coin = hero.findNearestItem()
    hero.moveXY(coin.pos.x, coin.pos.y)
# Build 4 soldiers to use as bait
for i in range(4):
    hero.summon("soldier")
# Send your soldiers into position
points = []
points[0] = { "x": 13, "y": 73 }
points[1] = { "x": 51, "y": 73 }
points[2] = { "x": 51, "y": 53 }
points[3] = { "x": 90, "y": 52 }
friends = hero.findFriends()

for i in range(len(points)):
    hero.command(friends[i], "move", points[i])
# Use range to make an array to loop over.
# Match the friends to the points and command them to move
Code Combat - Noble Sacrifice | Ecency