class WizardsCastle::StetsonPrinter

Public Class Methods

new(player,castle) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 4
def initialize(player,castle)
  @player = player
  @castle = castle
end

Public Instance Methods

armor_destroyed() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 632
def armor_destroyed
  puts "YOUR ARMOR HAS BEEN DESTROYED . . . GOOD LUCK!"
  puts
end
attributes_header() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 58
  def attributes_header
    s =<<END_ATT_HEADER
OK, #{player_race}, YOU HAVE THE FOLLOWING ATTRIBUTES :
STRENGTH = #{@player.str}  INTELLIGENCE = #{@player.int}  DEXTERITY = #{@player.dex}
AND #{@player.custom_attribute_points} OTHER POINTS TO ALLOCATE AS YOU WISH.

END_ATT_HEADER
    print s
  end
blind_command_error() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 232
def blind_command_error
  puts "** YOU CAN'T SEE ANYTHING, YOU DUMB #{player_race}!"
  puts
end
book_attack() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 648
def book_attack
  puts "** YOU CAN'T BEAT IT TO DEATH WITH A BOOK!"
  puts
end
book_effect(effect) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 378
def book_effect(effect)
  puts "YOU OPEN THE BOOK AND"
  case effect
  when :flash
    puts "FLASH! OH NO! YOU ARE NOW A BLIND #{player_race}!"
  when :poetry
    puts "IT'S ANOTHER VOLUME OF ZOT'S POETRY! - YECH!!"
  when :magazine
    puts "IT'S AN OLD COPY OF PLAY#{random_race}!"
  when :dex_manual
    puts "IT'S A MANUAL OF DEXTERITY!"
  when :str_manual
    puts "IT'S A MANUAL OF STRENGTH!"
  when :sticky
    puts "THE BOOK STICKS TO YOUR HANDS -"
    puts "NOW YOU ARE UNABLE TO DRAW YOUR WEAPON!"
  else
    puts "<ERROR - unrecognized effect '#{effect.to_s}'"
  end
  puts
end
bribe_accepted() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 694
def bribe_accepted
  puts "OK, JUST DON'T TELL ANYONE ELSE."
  puts
end
bribe_refused() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 681
def bribe_refused
  puts "ALL I WANT IS YOUR LIFE!"
  puts
end
cannot_afford_a_mace() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 844
def cannot_afford_a_mace
  puts "** SORRY SIR, I'M AFRAID I DON'T GIVE CREDIT!"
  puts
  puts
end
cannot_afford_a_sword() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 850
def cannot_afford_a_sword
  puts "** YOUR DUNGEON EXPRESS CARD - YOU LEFT HOME WITHOUT IT!"
  puts
  puts
end
cannot_afford_chainmail() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 810
def cannot_afford_chainmail
  puts "** YOU HAVEN'T GOT THAT MUCH CASH ON HAND!"
  puts
  puts
end
cannot_afford_plate() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 816
def cannot_afford_plate
  puts "** YOU CAN'T AFFORD PLATE ARMOR!"
  puts
  puts
end
cant_cast_now() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 700
def cant_cast_now
  puts "** YOU CAN'T CAST A SPELL NOW!"
  puts
end
cast_selection_error_msg() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 712
def cast_selection_error_msg
  puts
  puts "** TRY ONE OF THE OPTIONS GIVEN."
  puts
end
character_creation_header() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 37
def character_creation_header
  sleep 3  #simulate BASIC's delay
  beep
  puts "ALL RIGHT, BOLD ONE."
end
chest_effect(effect,gold_gain) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 400
def chest_effect(effect,gold_gain)
  puts "YOU OPEN THE CHEST AND"
  case effect
  when :kaboom
    puts "KABOOM! IT EXPLODES!!"
  when :gold
    puts "FIND #{gold_gain} GOLD PIECES!"
  when :gas
    puts "GAS!! YOU STAGGER FROM THE ROOM!"
  else
    raise "unrecognized chest effect '#{effect.to_s}'"
  end
  puts
end
combat_menu(can_bribe) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 592
def combat_menu(can_bribe)
  puts "YOU MAY ATTACK OR RETREAT."
  puts "YOU CAN ALSO ATTEMPT A BRIBE." if can_bribe
  puts "YOU CAN ALSO CAST A SPELL." if @player.int > 14
  puts
end
combat_selection_error_msg() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 604
def combat_selection_error_msg
  puts "** CHOOSE ONE OF THE OPTIONS LISTED."
  puts
end
cure_blindness() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 213
def cure_blindness
  puts "THE OPAL EYE CURES YOUR BLINDNESS!"
  puts
end
cure_stickybook() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 218
def cure_stickybook
  puts "THE BLUE FLAME DISSOLVES THE BOOK!"
  puts
end
death() click to toggle source

ENDGAME

# File lib/wizards-castle/printers/stetson_printer.rb, line 486
def death
  beep
  puts "*" * 62
  puts
  puts "A NOBLE EFFORT, OH FORMERLY LIVING #{player_race}"
  puts
  print "YOU DIED DUE TO LACK OF "
  # Yes, if two stats hit 0 at once, this will print two attributes.
  # This is authentic to the original BASIC.
  puts "STRENGTH." if @player.str<1
  puts "INTELLIGENCE." if @player.int<1
  puts "DEXTERITY." if @player.dex<1
  puts
  puts "AT THE TIME YOU DIED, YOU HAD :"
end
deathspell_kills_enemy() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 735
def deathspell_kills_enemy
  puts "DEATH . . . HIS!"
  puts
end
deathspell_kills_player() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 740
def deathspell_kills_player
  puts "DEATH . . . YOURS!"
  puts
end
dex_report() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 887
def dex_report
  puts "YOUR DEXTERITY IS NOW #{@player.dex} ."
  puts
end
display_map() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 312
def display_map
  floor = @player.location.last
  lines = []
  (1..8).each do |row|
    lines << ''
    (1..8).each do |col|
      c = @player.knows_room?(row,col,floor) ? @castle.room(row,col,floor).display : "?"
      if [row,col,floor]==@player.location
        lines.last << "<#{c}>  "
      else
        lines.last << " #{c}   "
      end
    end
    lines.last << "\n\n"
  end
  puts lines
  self.you_are_here
end
drink_effect(effect) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 280
def drink_effect(effect)
  s = "YOU TAKE A DRINK AND "
  case effect
  when :stronger
    s+="FEEL STRONGER."
  when :weaker
    s+="FEEL WEAKER"
  when :smarter
    s+="FEEL SMARTER."
  when :dumber
    s+="FEEL DUMBER."
  when :nimbler
    s+="FEEL NIMBLER."
  when :clumsier
    s+="FEEL CLUMSIER."
  when :change_race
    s+="BECOME A #{player_race}."
  when :change_gender
    s+="TURN INTO A #{player_gender} #{player_race}!"
  else
    s+="<ERROR - unrecognized effect '#{effect}.to_s'>"
  end
  puts s
  puts
end
eat_a_monster() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 663
def eat_a_monster
  recipe = ["SANDWICH","STEW","SOUP","BURGER","ROAST","FILET","TACO","PIE"].sample
  puts "YOU SPEND AN HOUR EATING #{room_monster} #{recipe}."
  puts
end
endgame_possessions() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 528
def endgame_possessions
  weapon = @player.weapon==:nothing ? "NO WEAPON" : @player.weapon.to_s.upcase
  armor =  @player.armor==:nothing  ? "NO ARMOR"  : @player.armor.to_s.upcase
  lamp = @player.lamp? ? " AND A LAMP" : ""

  puts "THE RUBY RED" if @player.have_treasure? :ruby_red
  puts "THE NORN STONE" if @player.have_treasure? :norn_stone
  puts "THE PALE PEARL" if @player.have_treasure? :pale_pearl
  puts "THE OPAL EYE" if @player.have_treasure? :opal_eye
  puts "THE GREEN GEM" if @player.have_treasure? :green_gem
  puts "THE BLUE FLAME" if @player.have_treasure? :blue_flame
  puts "THE PALANTIR" if @player.have_treasure? :palantir
  puts "THE SILMARIL" if @player.have_treasure? :silmaril
  puts "#{weapon} AND #{armor}#{lamp}"
  puts "YOU ALSO HAD #{@player.flares} FLARES AND #{@player.gp} GOLD PIECES"
  puts "AND THE RUNESTAFF" if @player.runestaff?
  puts
  puts "AND IT TOOK YOU #{@player.turns} TURNS!"
  puts
end
entering_the_castle() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 134
def entering_the_castle
  puts "OK, #{player_race}, YOU ARE NOW ENTERING THE CASTLE!"
  puts
end
exit_castle() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 510
def exit_castle
  if @player.orb_of_zot?
    puts "YOU LEFT THE CASTLE WITH THE ORB OF ZOT."
    puts
    puts
    puts "AN INCREDIBLY GLORIOUS VICTORY!!"
    puts "IN ADDITION, YOU GOT OUT WITH THE FOLLOWING :"
  else
    puts "YOU LEFT THE CASTLE WITHOUT THE ORB OF ZOT."
    puts
    puts
    puts "A LESS THAN AWE-INSPIRING DEFEAT."
    puts
    puts "WHEN YOU LEFT THE CASTLE, YOU HAD :"
  end
  puts "YOUR MISERABLE LIFE!"
end
fireball_damage_report(n) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 729
def fireball_damage_report(n)
  puts "IT DOES #{n} POINTS WORTH OF DAMAGE."
  puts
  puts
end
flare() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 332
def flare
  locs = Castle.flare_locs(*@player.location)
  3.times do
    line = ""
    3.times do 
      loc = locs.shift
      c = @castle.room(*loc).display
      line << " #{c}   "
    end
    puts
    puts line
    puts
  end
  self.you_are_here
end
found_orb_of_zot() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 178
def found_orb_of_zot
  puts "GREAT UNMITIGATED ZOT!"
  puts
  puts "YOU JUST FOUND ***THE ORB OF ZOT***!"
  puts
  puts "THE RUNESTAFF HAS DISAPPEARED!"
  puts
end
gaze_effect(effect,effect_location) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 415
def gaze_effect(effect,effect_location)
  s = "YOU SEE "
  case effect
  when :bloody_heap
    s+="YOURSELF IN A BLOODY HEAP!"
  when :drink_and_become
    s+="YOURSELF DRINKING FROM A POOL AND BECOMING #{random_monster_text}!"
  when :monster_gazing_back
    s+="#{random_monster_text} GAZING BACK AT YOU!"
  when :random_room
    rc = @castle.room(*effect_location)
    s+="#{rc.text} AT ( #{effect_location[0]} , #{effect_location[1]} ) LEVEL #{effect_location[2]} ."
  when :zot_location
    s+="***THE ORB OF ZOT*** AT ( #{effect_location[0]} , #{effect_location[1]} ) LEVEL #{effect_location[2]} ."
  when :soap_opera_rerun
    s+="A SOAP OPERA RERUN!"
  else
    s+="<ERROR - unrecognized effect '#{effect.to_s}'>"
  end
  puts s
  puts
end
gold_and_armor_report() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 785
def gold_and_armor_report
  # If no armor, it will say "[...] AN NO ARMOR ARMOR."
  # This error is authentic to the original.
  armor = @player.armor==:nothing ? "NO ARMOR" : @player.armor.to_s.upcase
  puts "OK, HUMAN, YOU HAVE #{@player.gp} GP'S AND #{armor} ARMOR."
  puts
  puts
end
gold_and_weapon_report() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 822
def gold_and_weapon_report
  puts "YOU HAVE #{@player.gp} GP'S LEFT WITH #{@player.weapon.upcase} IN HAND."
  puts
  puts
end
gold_report1() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 80
def gold_report1
  puts "OK, #{player_race}, YOU HAVE #{@player.gp} GOLD PIECES (GP'S)."
  puts
end
gold_report2() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 85
def gold_report2
  puts "OK, BOLD #{player_race}, YOU HAVE #{@player.gp} GP'S LEFT."
  puts
end
gold_report3() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 90
def gold_report3
  puts "OK, #{player_race}, YOU HAVE #{@player.gp} GOLD PIECES LEFT."
  puts
end
got_a_treasure(treasure_symbol) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 188
def got_a_treasure(treasure_symbol)
  puts "IT'S NOW YOURS!"
  puts
end
he_hit_you() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 622
def he_hit_you
  puts "OUCH! HE HIT YOU!"
  puts
end
he_missed_you() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 627
def he_missed_you
  puts "WHAT LUCK, HE MISSED YOU!"
  puts
end
help_message() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 237
  def help_message
    s=<<END_HELP
*** WIZARD'S CASTLE COMMAND AND INFORMATION SUMMARY ***

THE FOLLOWING COMMANDS ARE AVAILABLE :

H/ELP     N/ORTH    S/OUTH    E/AST     W/EST     U/P
D/OWN     DR/INK    M/AP      F/LARE    L/AMP     O/PEN
G/AZE     T/ELEPORT Q/UIT

THE CONTENTS OF ROOMS ARE AS FOLLOWS :

. = EMPTY ROOM      B = BOOK            C = CHEST
D = STAIRS DOWN     E = ENTRANCE/EXIT   F = FLARES
G = GOLD PIECES     M = MONSTER         O = CRYSTAL ORB
P = MAGIC POOL      S = SINKHOLE        T = TREASURE
U = STAIRS UP       V = VENDOR          W = WARP/ORB

THE BENEFITS OF HAVING TREASURES ARE :

RUBY RED - AVOID LETHARGY     PALE PEARL - AVOID LEECH
GREEN GEM - AVOID FORGETTING  OPAL EYE - CURES BLINDNESS
BLUE FLAME - DISSOLVES BOOKS  NORN STONE - NO BENEFIT
PALANTIR - NO BENEFIT         SILMARIL - NO BENEFIT

PRESS RETURN WHEN READY TO RESUME, #{player_race}.
END_HELP
    print s.chomp
    gets
    puts
  end
here_you_find(symbol) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 161
def here_you_find(symbol)
  puts "HERE YOU FIND #{RoomContent::ROOM_THINGS[symbol][:text]}."
  puts
end
int_report() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 875
def int_report
  puts "YOUR INTELLIGENCE IS NOW #{@player.int} ."
  puts
end
intro() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 15
  def intro
    s =<<END_INTRO


****************************************************************

               * * * THE WIZARD'S CASTLE * * *

****************************************************************

MANY CYCLES AGO, IN THE KINGDOM OF N'DIC, THE GNOMIC
WIZARD ZOT FORGED HIS GREAT *ORB OF POWER*. HE SOON
VANISHED, LEAVING BEHIND HIS VAST SUBTERRANEAN CASTLE
FILLED WITH ESURIENT MONSTERS, FABULOUS TREASURES, AND
THE INCREDIBLE *ORB OF ZOT*. FROM THAT TIME HENCE, MANY
A BOLD YOUTH HAS VENTURED INTO THE WIZARD'S CASTLE. AS
OF NOW, *NONE* HAS EVER EMERGED VICTORIOUSLY! BEWARE!!

END_INTRO
    puts s
  end
lamp_shine(row,col,floor) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 365
def lamp_shine(row,col,floor)
  puts "THE LAMP SHINES INTO ( #{row} , #{col} ) LEVEL #{floor} ."
  puts
  puts "THERE YOU WILL FIND #{@castle.room(row,col,floor).text}."
  puts
end
monster_is_dead() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 637
def monster_is_dead
  puts "#{room_monster} LIES DEAD AT OUR FEET!"
  puts
end
monster_stuck_in_web() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 723
def monster_stuck_in_web
  puts
  puts "THE #{room_monster} IS STUCK AND CAN'T ATTACK NOW!"
  puts
end
new_flare_count() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 172
def new_flare_count
  puts "YOU NOW HAVE #{@player.flares} FLARES"
  puts
end
new_gold_count() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 167
def new_gold_count
  puts "YOU NOW HAVE #{@player.gp} GOLD"
  puts
end
no_crystal_orb_error() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 438
def no_crystal_orb_error
  puts "** IT'S HARD TO GAZE WITHOUT AN ORB!"
  puts
end
no_lamp_error() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 360
def no_lamp_error
  puts "** YOU DON'T HAVE A LAMP, #{player_race}!"
  puts
end
no_pool_error() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 306
def no_pool_error
  puts "** IF YOU WANT A DRINK, FIND A POOL!"
  puts
end
no_runestaff_error() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 443
def no_runestaff_error
  puts "** YOU CAN'T TELEPORT WITHOUT THE RUNESTAFF!"
  puts
end
nothing_to_open_error() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 373
def nothing_to_open_error
  puts "** THE ONLY THING OPENED WAS YOUR BIG MOUTH!"
  puts
end
out_of_flares() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 348
def out_of_flares
  puts "** HEY, BRIGHT ONE, YOU'RE OUT OF FLARES!"
  puts
end
play_again() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 556
def play_again
  puts "SOME #{player_race}S NEVER LEARN!"
  puts
end
player_action_flavor_text() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 194
def player_action_flavor_text
  rnd = 1+Random.rand(7)
  rnd +=1 if @player.blind?
  rnd=4 if rnd>7
  # ^^ pretty stupid, right?  But that's just how the BASIC impl does it.

  case rnd
  when 1 then puts "YOU SEE A BAT FLY BY!"
  when 2 then puts "YOU HEAR #{["A SCREAM!","FOOTSTEPS!","A WUMPUS!","THUNDER!"].sample}"
  when 3 then puts "YOU SNEEZED!"
  when 4 then puts "YOU STEPPED ON A FROG!"
  when 5 then puts "YOU SMELL #{random_monster_text} FRYING!"
  when 6 then puts "YOU FEEL LIKE YOU'RE BEING WATCHED!"
  when 7 then puts "YOU HEAR FAINT RUSTLING NOISES!"
  end
  puts
end
prompt_add_to_dexterity() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 76
def prompt_add_to_dexterity
  return prompt_add_to_attribute("DEXTERITY")
end
prompt_add_to_intelligence() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 72
def prompt_add_to_intelligence
  return prompt_add_to_attribute("INTELLIGENCE")
end
prompt_add_to_strength() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 68
def prompt_add_to_strength
  return prompt_add_to_attribute("STRENGTH")
end
prompt_armor() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 96
def prompt_armor
  prompt =  "THESE ARE THE TYPES OF ARMOR YOU CAN BUY :\n" +
            "PLATE<30> CHAINMAIL<20> LEATHER<10> NOTHING<0>\n" +
            "\n" + "YOUR CHOICE? "
  { prompt: prompt,
    error: Proc.new { "\n** ARE YOU A #{player_race} OR #{random_monster_text}?\n\n" },
    success: "\n"
  }
end
prompt_bribe_request(treasure_symbol) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 686
def prompt_bribe_request(treasure_symbol)
  treasure_text = RoomContent::ROOM_THINGS[treasure_symbol][:text]
  { prompt: "I WANT #{treasure_text}. WILL YOU GIVE IT TO ME? ",
    error:  "** PLEASE ANSWER YES OR NO\n\n",
    success: "\n"
  }
end
prompt_cast() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 705
def prompt_cast
  { prompt: "WHICH SPELL (WEB, FIREBALL, DEATHSPELL)? ",
    success: Proc.new {|x| x[0]=="W" ? "\n\n" : "\n"}
    # error is ignored in this one
  }
end
prompt_combat() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 609
def prompt_combat
  { prompt: "YOUR CHOICE? ",
    success: "\n"
    # error is ignored in this one
  }
end
prompt_confirm_quit() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 473
def prompt_confirm_quit
  { prompt: "DO YOU REALLY WANT TO QUIT NOW? ",
    confirmed: "\n\n",
    denied: "\n** THEN DON'T SAY THAT YOU DO!\n\n",
  }
end
prompt_flares() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 125
def prompt_flares
  { prompt: "FLARES COST 1 GP EACH. HOW MANY DO YOU WANT? ",
    success: "\n",
    error: "\n** IF YOU DON'T WANT ANY, JUST TYPE 0 (ZERO).\n\n",
    out_of_range: "\n** YOU CAN ONLY AFFORD #{@player.gp} .\n\n"
  }
end
prompt_gender() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 51
def prompt_gender
  { prompt:  "WHICH SEX TO YOU PREFER? ",
    error:   "** CUTE #{player_race}, REAL CUTE. TRY M OR F.\n",
    success: "\n"
  }
end
prompt_lamp() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 117
def prompt_lamp
  { prompt: "DO YOU WANT TO BUY A LAMP FOR 20 GP'S? ",
    error: "** PLEASE ANSWER YES OR NO\n\n",
    success: "\n"
  }
end
prompt_play_again() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 549
def prompt_play_again
  { prompt: "ARE YOU FOOLISH ENOUGH TO WANT TO PLAY AGAIN? ",
    error: "\n** PLEASE ANSWER YES OR NO\n",
    success: "\n"
  }
end
prompt_race() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 44
def prompt_race
  { prompt:  "YOU MAY BE AN ELF, DWARF, MAN, OR HOBBIT.\n\nYOUR CHOICE? ",
    error:   "\n** THAT WAS INCORRECT. PLEASE TYPE E, D, M, OR H.\n",
    success: "\n"
  }
end
prompt_retreat_direction() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 580
def prompt_retreat_direction
  { prompt: "DO YOU WANT TO GO NORTH, SOUTH, EAST, OR WEST? ",
    error: "\n** DON'T PRESS YOUR LUCK, #{player_race}!\n\n",
    success: "\n"
  }
end
prompt_sell_treasure(treasure_symbol,amount) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 772
def prompt_sell_treasure(treasure_symbol,amount)
  treasure_text = RoomContent::ROOM_THINGS[treasure_symbol][:text]
  { prompt: "DO YOU WANT TO SELL #{treasure_text} FOR #{amount} GP'S? ",
    success: "\n",
    error: "** PLEASE ANSWER YES OR NO\n\n"
  }
end
prompt_shine_lamp() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 353
def prompt_shine_lamp
  { prompt: "WHERE DO YOU WANT TO SHINE THE LAMP (N,S,E,W)? ",
    error: "\n** THAT'S NOT A DIRECTION, #{player_race}!\n\n",
    success: "\n"
  }
end
prompt_standard_action() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 224
def prompt_standard_action
  { prompt:  "ENTER YOUR COMMAND : ",
    error:   "\n** SILLY #{player_race}, THAT WASN'T A VALID COMMAND!\n\n",
    success: Proc.new {|x| x[0]=="F" ? '' : x=="T" ? "\n\n" : "\n" }
  }
end
prompt_teleport_column() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 456
def prompt_teleport_column
  { prompt: "Y-COORDINATE? ",
    success: "\n",
    error: "\n** TRY A NUMBER FROM 1 TO 8.\n\n",
    out_of_range: "\n** TRY A NUMBER FROM 1 TO 8.\n\n"
  }
end
prompt_teleport_floor() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 464
def prompt_teleport_floor
  { prompt: "Z-COORDINATE? ",
    success: "\n",
    error: "\n** TRY A NUMBER FROM 1 TO 8.\n\n",
    out_of_range: "\n** TRY A NUMBER FROM 1 TO 8.\n\n"
  }
end
prompt_teleport_row() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 448
def prompt_teleport_row
  { prompt: "X-COORDINATE? ",
    success: "\n",
    error: "\n** TRY A NUMBER FROM 1 TO 8.\n\n",
    out_of_range: "\n** TRY A NUMBER FROM 1 TO 8.\n\n"
  }
end
prompt_vendor_armor() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 803
def prompt_vendor_armor
  { prompt: "YOUR CHOICE? ",
    success: "\n\n",
    error: "\n\n** DON'T BE SILLY. CHOOSE A SELECTION.\n\n\n"
  }
end
prompt_vendor_buy_lamp() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 892
def prompt_vendor_buy_lamp
  { prompt: "DO YOU WANT TO BUY A LAMP FOR 1000 GP'S? ",
    success: "\n",
    error: "** PLEASE ANSWER YES OR NO\n\n"
  }
end
prompt_vendor_dex_potion() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 880
def prompt_vendor_dex_potion
  { prompt: "DO YOU WANT TO BUY A POTION OF DEXTERITY FOR 1000 GP'S? ",
    success: "\n",
    error: "** PLEASE ANSWER YES OR NO\n\n"
  }
end
prompt_vendor_encounter() click to toggle source

VENDOR

# File lib/wizards-castle/printers/stetson_printer.rb, line 749
def prompt_vendor_encounter
  { prompt: "YOU MAY TRADE WITH, ATTACK, OR IGNORE THE VENDOR.\n\nYOUR CHOICE? ",
    success: "\n",
    error: "\n** NICE SHOT, #{player_race}!\n\n"
  }
end
prompt_vendor_int_potion() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 868
def prompt_vendor_int_potion
  { prompt: "DO YOU WANT TO BUY A POTION OF INTELLIGENCE FOR 1000 GP'S? ",
    success: "\n",
    error: "** PLEASE ANSWER YES OR NO\n\n"
  }
end
prompt_vendor_str_potion() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 856
def prompt_vendor_str_potion
  { prompt: "DO YOU WANT TO BUY A POTION OF STRENGTH FOR 1000 GP'S? ",
    success: "\n",
    error: "** PLEASE ANSWER YES OR NO\n\n"
  }
end
prompt_vendor_weapon() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 837
def prompt_vendor_weapon
  { prompt: "YOUR CHOICE? ",
    success: "\n\n",
    error: "\n** TRY CHOOSING A SELECTION!\n\n\n"
  }
end
prompt_weapon() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 106
def prompt_weapon
  prompt = "THESE ARE THE TYPES OF WEAPONS YOU CAN BUY :\n" +
           "SWORD<30> MACE<20> DAGGER<10> NOTHING<0>\n" +
           "\n" + "YOUR CHOICE? "
  { prompt: prompt,
    error: "** IS YOUR IQ REALLY #{@player.int} ?\n\n",
    success: "\n"
  }
end
quit() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 502
def quit
  puts
  puts "A LESS THAN AWE-INSPIRING DEFEAT."
  puts
  puts "WHEN YOU LEFT THE CASTLE, YOU HAD :"
  puts "YOUR MISERABLE LIFE!"
end
restock() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 561
def restock
  puts "PLEASE BE PATIENT WHILE THE CASTLE IS RESTOCKED."
  puts
end
shut_down() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 566
def shut_down
  puts "MAYBE DUMB #{player_race} IS NOT SO DUMB AFTER ALL!"
  puts
end
stairs_down_error() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 275
def stairs_down_error
  puts "** THERE ARE NO STAIRS GOING DOWN FROM HERE!"
  puts
end
stairs_up_error() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 270
def stairs_up_error
  puts "** THERE ARE NO STAIRS GOING UP FROM HERE!"
  puts
end
stat_block() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 149
  def stat_block
    s =<<END_STAT_BLOCK
STRENGTH = #{@player.str}  INTELLIGENCE = #{@player.int}  DEXTERITY = #{@player.dex}
TREASURES = #{@player.treasure_count}  FLARES = #{@player.flares}  GOLD PIECES = #{@player.gp}
WEAPON = #{@player.weapon.to_s.upcase}  ARMOR = #{@player.armor.to_s.upcase}
END_STAT_BLOCK
    s.chomp!
    s << "  AND A LAMP" if @player.lamp?
    s << "\n\n"
    print s
  end
str_report() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 863
def str_report
  puts "YOUR STRENGTH IS NOW #{@player.str} ."
  puts
end
the_monster_attacks() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 617
def the_monster_attacks
  puts "THE #{room_monster_no_article} ATTACKS!"
  puts
end
the_web_broke() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 718
def the_web_broke
  puts "THE WEB JUST BROKE!"
  puts
end
too_poor_to_trade() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 780
def too_poor_to_trade
  puts "YOU'RE TOO POOR TO TRADE, #{player_race}."
  puts
end
unarmed_attack() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 643
def unarmed_attack
  puts "** POUNDING ON #{room_monster} WON'T HURT IT!"
  puts
end
vendor_armors() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 794
def vendor_armors
  s  = "THESE ARE THE TYPES OF ARMOR YOU CAN BUY :\n"
  s += "NOTHING<0> LEATHER<1250>"
  s += " CHAINMAIL<1500>" if @player.gp>1499
  s += " PLATE<2000>" if @player.gp>1999
  puts s
  puts
end
vendor_loot() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 761
def vendor_loot
  puts "YOU GET ALL HIS WARES :"
  puts "PLATE ARMOR"
  puts "A SWORD"
  puts "A STRENGTH POTION"
  puts "AN INTELLIGENCE POTION"
  puts "A DEXTERITY POTION"
  puts "A LAMP" unless @player.lamp?
  puts
end
vendor_responds_to_attack() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 756
def vendor_responds_to_attack
  puts "YOU'LL BE SORRY THAT YOU DID THAT!"
  puts
end
vendor_weapons() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 828
def vendor_weapons
  s  = "THESE ARE THE TYPES OF WEAPON YOU CAN BUY :\n"
  s += "NOTHING<0> DAGGER<1250>"
  s += " MACE<1500>" if @player.gp>1499
  s += " SWORD<2000>" if @player.gp>1999
  puts s
  puts
end
you_are_here() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 139
def you_are_here
  row,col,floor = @player.location
  puts "YOU ARE AT ( #{row} , #{col} ) LEVEL #{floor} ."
  puts
end
you_are_here_blind() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 145
def you_are_here_blind
  puts
end
you_bought_a_lamp() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 899
def you_bought_a_lamp
  puts "IT'S GUARANTEED TO OUTLIVE YOU!"
  puts
end
you_got_monster_gold(n) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 675
def you_got_monster_gold(n)
  puts "YOU NOW GET HIS HOARD OF #{n} GP's"
  puts
end
you_got_the_runestaff() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 669
def you_got_the_runestaff
  beep
  puts "GREAT ZOT! YOU'VE FOUND THE RUNESTAFF!"
  puts
end
you_have_escaped() click to toggle source

COMBAT

# File lib/wizards-castle/printers/stetson_printer.rb, line 575
def you_have_escaped
  puts "YOU HAVE ESCAPED!"
  puts
end
you_hit_him() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 653
def you_hit_him
  puts "YOU HIT THE EVIL #{room_monster_no_article}!"
  puts
end
your_battle_stats() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 599
def your_battle_stats
  puts "YOUR STRENGTH IS #{@player.str} AND YOUR DEXTERITY IS #{@player.dex} ."
  puts
end
your_weapon_broke() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 658
def your_weapon_broke
  puts "OH NO! YOUR #{@player.weapon.to_s.upcase} BROKE!"
  puts
end
youre_facing_a_monster() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 587
def youre_facing_a_monster
  puts "YOU'RE FACING #{room_monster}!"
  puts
end

Private Instance Methods

beep() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 931
def beep
  print "\a"
end
player_gender() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 910
def player_gender
  @player.gender.to_s.upcase
end
player_race() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 906
def player_race
  @player.race.to_s.upcase
end
prompt_add_to_attribute(att) click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 922
def prompt_add_to_attribute(att)
  s = "HOW MANY POINTS DO YOU WISH TO ADD TO YOUR #{att}? "
  { prompt: s,
    success: "\n",
    error: "\n** ",
    out_of_range: "\n** "
  }
end
random_monster_text() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 914
def random_monster_text
  RoomContent::ROOM_THINGS[Castle::MONSTERS.sample][:text]
end
random_race() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 918
def random_race
  Player::RACES.sample.to_s.upcase
end
room_monster() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 935
def room_monster
  rc = @castle.room( *@player.location )
  rc.text
end
room_monster_no_article() click to toggle source
# File lib/wizards-castle/printers/stetson_printer.rb, line 940
def room_monster_no_article
  room_monster.sub(/^\S*\s/,'')
end