<commit_before>module TheWizardsCastle
class StetsonPrinter

  def initialize(player,castle)
    @player = player
    @castle = castle
  end







  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

  def character_creation_header
    sleep 3  #simulate BASIC's delay
    beep
    puts "ALL RIGHT, BOLD ONE."
  end


  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

  def prompt_gender
    { prompt:  "WHICH SEX TO YOU PREFER? ",
      error:   "** CUTE #{player_race}, REAL CUTE. TRY M OR F.\n",
      success: "\n"
    }
  end

  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
    
  def prompt_add_to_strength
    return prompt_add_to_attribute("STRENGTH")
  end

  def prompt_add_to_intelligence
    return prompt_add_to_attribute("INTELLIGENCE")
  end

  def prompt_add_to_dexterity
    return prompt_add_to_attribute("DEXTERITY")
  end

  def gold_report1
    puts "OK, #{player_race}, YOU HAVE #{@player.gp} GOLD PIECES (GP'S)."
    puts
  end

  def gold_report2
    puts "OK, BOLD #{player_race}, YOU HAVE #{@player.gp} GP'S LEFT."
    puts
  end

  def gold_report3
    puts "OK, #{player_race}, YOU HAVE #{@player.gp} GOLD PIECES LEFT."
    puts
  end


  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

  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


  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


  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


  def entering_the_castle
    puts "OK, #{player_race}, YOU ARE NOW ENTERING THE CASTLE!"
    puts
  end

  def you_are_here
    row,col,floor = @player.location
    puts "YOU ARE AT ( #{row} , #{col} ) LEVEL #{floor} ."
    puts
  end

  def you_are_here_blind
    puts
  end

  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

  def here_you_find(symbol)
    puts "HERE YOU FIND #{RoomContent::ROOM_THINGS[symbol][:text]}."
    puts
  end


  def new_gold_count
    puts "YOU NOW HAVE #{@player.gp} GOLD"<commit_msg>add a slight pause for warps/sinkholes<commit_after>module TheWizardsCastle
class StetsonPrinter

  def initialize(player,castle)
    @player = player
    @castle = castle
  end







  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

  def character_creation_header
    sleep 3  #simulate BASIC's delay
    beep
    puts "ALL RIGHT, BOLD ONE."
  end


  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

  def prompt_gender
    { prompt:  "WHICH SEX TO YOU PREFER? ",
      error:   "** CUTE #{player_race}, REAL CUTE. TRY M OR F.\n",
      success: "\n"
    }
  end

  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
    
  def prompt_add_to_strength
    return prompt_add_to_attribute("STRENGTH")
  end

  def prompt_add_to_intelligence
    return prompt_add_to_attribute("INTELLIGENCE")
  end

  def prompt_add_to_dexterity
    return prompt_add_to_attribute("DEXTERITY")
  end

  def gold_report1
    puts "OK, #{player_race}, YOU HAVE #{@player.gp} GOLD PIECES (GP'S)."
    puts
  end

  def gold_report2
    puts "OK, BOLD #{player_race}, YOU HAVE #{@player.gp} GP'S LEFT."
    puts
  end

  def gold_report3
    puts "OK, #{player_race}, YOU HAVE #{@player.gp} GOLD PIECES LEFT."
    puts
  end


  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

  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


  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


  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


  def entering_the_castle
    puts "OK, #{player_race}, YOU ARE NOW ENTERING THE CASTLE!"
    puts
  end

  def you_are_here
    row,col,floor = @player.location
    puts "YOU ARE AT ( #{row} , #{col} ) LEVEL #{floor} ."
    puts
  end

  def you_are_here_blind
    puts
  end

  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

  def here_you_find(symbol)
    puts "HERE YOU FIND #{RoomContent::ROOM_THINGS[symbol][:text]}."
    sleep(0.4) if [:warp,:sinkhole].include?(symbol)
    puts
  end


  def new_gold_count
    puts "YOU NOW HAVE #{@player.gp} GOLD"
{'fraction_non_alphanumeric': 0.14798921039725355, 'fraction_numerical': 0.005640019617459539, 'mean_word_length': 2.865876777251185, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5445050', 'n_tokens_mistral': 3267, 'n_tokens_neox': 3056, 'n_words': 877}