Class: Gemwarrior::QueenRuby
- Defined in:
- lib/gemwarrior/entities/people/queen_ruby.rb
Constant Summary collapse
- MOVE_TEXT =
CONSTANTS
'** WHOOOOOOSH **'
Instance Attribute Summary
Attributes inherited from Creature
#atk_hi, #atk_lo, #defense, #dexterity, #face, #hands, #hp_cur, #hp_max, #inventory, #level, #mood, #rox, #speak, #xp
Attributes inherited from Entity
#consumable, #describe, #describe_detailed, #description, #display_shopping_cart, #equippable, #equipped, #name, #name_display, #number_of_uses, #takeable, #talkable, #useable, #useable_battle, #used, #used_again
Instance Method Summary collapse
-
#initialize ⇒ QueenRuby
constructor
A new instance of QueenRuby.
- #use(world) ⇒ Object
Methods inherited from Creature
Methods inherited from Entity
Constructor Details
#initialize ⇒ QueenRuby
Returns a new instance of QueenRuby.
12 13 14 15 16 17 18 |
# File 'lib/gemwarrior/entities/people/queen_ruby.rb', line 12 def initialize super self.name = 'queen_ruby' self.name_display = 'Queen Ruby' self.description = 'Queen Ruby glimmers like she was made from the substance of her name. She wears a wan smile, and her hands are delicately intertwined as she sits patiently.' end |
Instance Method Details
#use(world) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/gemwarrior/entities/people/queen_ruby.rb', line 20 def use(world) speak('Thank you for bringing back the ShinyThing(tm)! The land of Jool is saved!') STDIN.getc speak("Please, #{world.player.name}, hand the ShinyThing(tm) to me, before all is lost!") print 'Hand over the ShinyThing(tm)? (y/n) ' answer = gets.chomp.downcase case answer when 'y', 'yes' if world.player.inventory.contains_item?('sparkly_thing') world.player.inventory.remove_item('sparkly_thing') speak('Oh, thank you! Now that the evil Emerald is defeated, and I, Queen Ruby, have the ShinyThing(tm) again, peace can come to the land of Jool.') speak('Your reward is', no_end_quote = true, no_line_feed = true) Animation.run(phrase: '......', oneline: true, speed: :slow, color: :yellow, numeric: false, alpha: false) Animation.run(phrase: 'my thanks!', oneline: true, speed: :insane, color: :yellow) print '"'.colorize(:yellow) print "\n" STDIN.getc puts 'You feel an audible groan spill out of your mouth, but Queen Ruby doesn\'t seem to notice.' STDIN.getc speak('Now, be a dear and run on home.') STDIN.getc puts 'And with that, she waves her arm in a tired, yet mystical, manner. Your mind and sight go blank, and you "poof" out of existence.' puts Animation.run(phrase: MOVE_TEXT) puts return { type: 'move', data: 'home' } else speak('Hold on a minute!', no_end_quote = false, no_line_feed = true) STDIN.getc speak('You don\'t even have the SparklyThing(tm)!', no_end_quote = false, no_line_feed = true) STDIN.getc speak('How on earth did you even get here without unknowningly being transported after acquiring it?', no_end_quote = false, no_line_feed = true) STDIN.getc speak('...', no_end_quote = false, no_line_feed = true) STDIN.getc speak('...are you a wizard?!') return { type: nil, data: nil } end when 'n', 'no' speak('No? No??? Well, you are not leaving this room until you do, so think long and hard about that.') return { type: nil, data: nil } else speak('Hmm. I see. Take your time and let me know when you are going to give me the ShinyThing(tm), all right?') return { type: nil, data: nil } end end |