medical attention
codecombat吧
全部回复
仅看楼主
level 2
boo6786733 楼主
// Ask the healer for help when you're under half health.
loop {
var currentHealth = this.health;
var healingThreshold = this.maxHealth / 2;
var enemy=this.findNearestEnemy();
if (currentHealth > healingThreshold )
{
if(enemy){
this.attack(enemy);
}
}
else if (currentHealth < healingThreshold)
{
this.moveXY(64,46);
this.say("heal me");
}
// If your current health is less than the threshold,
// move to the healing point and say, "heal me".
// Otherwise, attack. You'll need to fight hard!
}
2015年01月07日 03点01分 1
1