LoginSignup
0
0

More than 5 years have passed since last update.

#17 【攻略】RubyWarrior Level8 ~中級編~

Posted at

level8です。中級編の中で一番簡単でした。

概要

今回は狭い通路に敵2体が立ちふさがっています。しかしwarriorは道中で爆弾の入ったケースを見つけたらしいので、今回は爆薬を使って敵をまとめて倒していきます。

ちなみにこの爆弾はwarrior自身もダメージを受けるのでちょっと工夫して使う必要があります。

スクリプト

class Player
  def play_turn(warrior)
    if warrior.feel(:forward).enemy?
      warrior.detonate!(:forward)
    elsif warrior.feel.captive?
      warrior.rescue!
    else
      warrior.walk!
    end
  end
end

解説

敵がいたら近づいて爆弾を投げる、いないなら前進するか捕虜を救出。それだけです笑
めちゃくちゃシンプルですね...

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0