module Eschaton::GameMaster

Public Class Methods

accuracy() click to toggle source
# File lib/eschaton/gamemaster.rb, line 5
def self.accuracy
        rand(1..20)
end
spasex(combatant, opponent) click to toggle source
# File lib/eschaton/gamemaster.rb, line 9
def self.spasex(combatant, opponent)
        lobaccuracy = accuracy

        target = StrategicTargets.random

        case accuracy
                when 18..20
                        combatant.lob(opponent)
                        combatant.accuracy += 1
                        combatant.inddir += 20
                        puts "#{combatant.nation}'s warhead directly (+20 INDDIR) hits a #{target.name}(+#{target.ptvalue} INDDIR)! Ho-ly CROW!"
                        combatant.hit_target(target)
                        combatant.inddir += target.ptvalue
                        puts combatant
                when 4..17
                        combatant.lob(opponent)
                        puts "#{combatant.nation}'s warhead hit a #{target.name}(+#{target.ptvalue} INDDIR)!"
                        combatant.hit_target(target)
                        combatant.inddir += target.ptvalue
                        puts combatant
                else
                        puts "#{combatant.nation} whiffed it!"
                        combatant.megatonnage -= 5
                        puts combatant
        end
end