class OldSchool::HiScores::Minigame

Represents a Minigame in OldSchool Runescape

Attributes

name[R]

@return [String] The name of this minigame

rank[R]

@return [Number] The rank of this minigame on the HiScores

score[R]

@return [Number] The score of this minigame on the HiScores

symbol[R]

@return [Symbol] The symbol of this minigame

Public Class Methods

new(symbol, rank = 0, score = 0) click to toggle source

Creates a new Minigame instance

@see OldSchool::HiScores::MINIGAMES Complete list of OldSchool Minigames

@param symbol [Symbol] the symbol of the minigame @param rank [Number] the rank of the minigame on the HiScores @param score [Number] the score of the minigame on the HiScores

# File lib/oldschool/hiscores/minigame.rb, line 25
def initialize(symbol, rank = 0, score = 0)
  @symbol = symbol
  @name = HiScores.human_name_for symbol
  @rank = rank
  @score = score
end

Public Instance Methods

dangerous?() click to toggle source

Determines if this minigame is dangerous

A minigame is dangerous if you lose items when you die

@example Bounty Hunter Rogue is a dangerous minigame

minigame = OldSchool::HiScores::Minigame.new :bh_rogue
minigame.dangerous? #=> true

@note This is the inverse of safe? @see safe?

# File lib/oldschool/hiscores/minigame.rb, line 61
def dangerous?
  !safe?
end
safe?() click to toggle source

Determines if this minigame is safe

A minigame is safe if when you die while doing the minigame, you don't lose your items.

@example Bounty Hunter you lose items on death

minigame = OldSchool::HiScores::Minigame.new :bh_hunter
minigame.safe? #=> false

@note You can die during Clue Scrolls, but their intents are

not PVP or even combat related, so clue scrolls are listed
as safe.

@return [true] if the minigame is classified as safe @return [false] if the minigame is classified as dangerous

# File lib/oldschool/hiscores/minigame.rb, line 46
def safe?
  HiScores::MINIGAMES_SAFE.include? @symbol
end