class Rules::Spawn
Public Class Methods
new(short_name)
click to toggle source
Calls superclass method
Rules::Foe::new
# File lib/rpg-prompt/rules_sheet.rb, line 273 def initialize(short_name) super(short_name) @creation_array = RulesHashes::CreationArray.new() @creation_array[:full_name] = [:question_full_name, :multiple, nil] @creation_array[:nickname] = [:question_nickname, :multiple, nil] end
Public Instance Methods
clone_sheet(sheet, short_name)
click to toggle source
# File lib/rpg-prompt/rules_sheet.rb, line 314 def clone_sheet(sheet, short_name) sheet.each do |key, val| if key == :short_name self.load_attribute(:short_name, short_name) elsif (key == :full_name) || (key == :nickname) self.load_attribute(key, get_random(sheet[key])) else self.load_attribute(key, val) end end end
create_new_w_questions()
click to toggle source
Calls superclass method
Rules::Sheet#create_new_w_questions
# File lib/rpg-prompt/rules_sheet.rb, line 289 def create_new_w_questions super @short_name = read_attribute(:short_name) @hp = read_attribute(:hp) @full_name = read_attribute(:full_name) @nickname = read_attribute(:nickname) end
creation_array()
click to toggle source
# File lib/rpg-prompt/rules_sheet.rb, line 279 def creation_array @creation_array end
full_name()
click to toggle source
# File lib/rpg-prompt/rules_sheet.rb, line 305 def full_name String.new("enemy of kind " + self[:short_name]) end
get_random(name_list)
click to toggle source
# File lib/rpg-prompt/rules_sheet.rb, line 309 def get_random(name_list) r = rand(name_list.length) name_list[r] end
get_random_full_name(short_name, name_list)
click to toggle source
# File lib/rpg-prompt/rules_sheet.rb, line 297 def get_random_full_name(short_name, name_list) get_random(short_name, name_list, :full_name) end
get_random_nickname(short_name, name_list)
click to toggle source
# File lib/rpg-prompt/rules_sheet.rb, line 301 def get_random_nickname(short_name, name_list) get_random(short_name, name_list, :nickname) end
good?()
click to toggle source
# File lib/rpg-prompt/rules_sheet.rb, line 285 def good? false end
unique?()
click to toggle source
# File lib/rpg-prompt/rules_sheet.rb, line 282 def unique? false end