<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
use strict;
use warnings;
use lib "./";
use Roguelike;

# Setup
my $fast = 1;
foreach my $opt (@ARGV) {
  $fast = 1 if $opt eq "--fast";
  $fast = 0 if $opt eq "--intro";
  $Game-&gt;{Centered} = 1 if $opt eq "--center";
  $Game-&gt;{Testing} = 1 if $opt eq "--test";
}
$Game-&gt;{MaxDepth} = 20;

# Load stuff.
$Game-&gt;loaditems("Equipment");
$Game-&gt;loadmons("Monsters");
$Game-&gt;loaditems("Items");
$Game-&gt;loadkeymap("Keymap");

# Set up the opening room.
$Game-&gt;addlevel("&lt;opening");

# Add stairs
$Game-&gt;{Levels}[0]{Map}[22][21]{_} = "&lt;";
render($Game-&gt;{Levels}[0]{Map}[22][21]);
$Game-&gt;{Levels}[0]{StairsUp}[0] = [22, 21];
$Game-&gt;{Levels}[0]{Map}[1][21]{_} = "&gt;";
render($Game-&gt;{Levels}[0]{Map}[1][21]);
$Game-&gt;{Levels}[0]{StairsDown}[0] = [1, 21];

# Now Player. We need the map in place.
$Game-&gt;loadmons("Player");

# And items!
if ($fast) {
  $Game-&gt;{Silence} = 1;
  $Player-&gt;{Inv}-&gt;add(
    $Game-&gt;{Content}{incense}-&gt;new(Mod =&gt; 0, Qty =&gt; 4)
  );
  $Player-&gt;{Inv}-&gt;add(
    $Game-&gt;{Content}{tarotcard}-&gt;new(Qty =&gt; 2)
  );
  $Player-&gt;{Inv}-&gt;add(
    $Game-&gt;{Content}{trenchcoat}-&gt;new
  );
  $Player-&gt;{Inv}-&gt;add(
    $Game-&gt;{Content}{ratflail}-&gt;new
  );
  $Player-&gt;switchweapon;
  $Player-&gt;wear( $Player-&gt;{Inv}-&gt;get("d") );
  $Player-&gt;go(1, 21);
  push @{ $Game-&gt;{DelayedInit} }, sub {
    $Player-&gt;{Base}-&gt;eventoff("READYMSG");
  };
  $Game-&gt;{Silence} = 0;
  #Roguelike::Interface::Curses::ungetch("&gt;");
} else {
  $Game-&gt;{Levels}[0]-&gt;inv(20, 9, "add",
                          $Game-&gt;{Content}{incense}-&gt;new(Mod =&gt; 0, Qty =&gt; 3)
  );
  render($Game-&gt;{Levels}[0]{Map}[20][9]);
  $Game-&gt;{Levels}[0]-&gt;inv(15, 9, "add",
                          $Game-&gt;{Content}{tarotcard}-&gt;new(Qty =&gt; 2)
  );
  render($Game-&gt;{Levels}[0]{Map}[15][9]);
  $Game-&gt;{Levels}[0]-&gt;inv(22, 33, "add",
                          $Game-&gt;{Content}{incense}-&gt;new(Mod =&gt; 0)
  );
  render($Game-&gt;{Levels}[0]{Map}[22][33]);
  $Game-&gt;{Levels}[0]-&gt;inv(15, 33, "add",
                          $Game-&gt;{Content}{trenchcoat}-&gt;new
  );
  render($Game-&gt;{Levels}[0]{Map}[15][33]);
  $Game-&gt;{Levels}[0]-&gt;inv(19, 27, "add",
                          $Game-&gt;{Content}{ratflail}-&gt;new
  );
  render($Game-&gt;{Levels}[0]{Map}[19][27]);

  # Set the mood... introduction scene!
  $Game-&gt;{UI}-&gt;msgbox(0);
  $Game-&gt;{UI}-&gt;msgbox(1,
  "Hazy summer days, endless, just drifting. Constant work on your ambitious
  Perl roguelike project. Coffee, insomnia, incense. Night and day clashing in
  one titanic headache. Away from friends, just stranded on this surreal island 
  between two lives. And that constant, throbbing feeling of &lt;Blue&gt;Isometric
  Boredom&lt;black&gt;..."
  );
  $Game-&gt;{UI}-&gt;msgbox(1,
  "The monotony is nothing more than a distraction. You've thrown your heart
  into the water many times before, but the river of junior high was always so
  shallow that it never had far to sink. But at the very end, somehow, it sank
  into the depths of the ocean. The bubble of blissful beauty beneath the
  distorted surface soon popped, leaving you to face the terrors of the depths. 
  Your heart washed up on shore, bruised and beaten."
  );
  $Game-&gt;{UI}-&gt;msgbox(1,
  "The feverish dreams of agony began, curiously coinciding with the arrival of
  your new authentic Native American dreamcatcher. Somewhere deep in the depths
  of your own personal hell, you dropped your heart. This pitiful escape would
  sicken you, if you could still feel. You need to recover yourself."
  );
  $Game-&gt;{UI}-&gt;msgbox(1,
  "You waver gently on the stream of conciousness, treading calmly. The serene
  scene of phospherance above you swirls, emptying into an endless void. You've
  drifted way past the Lover's Reef, into the dreadful place where you cannot
  help but to sink into the place where you must face your worst..."
  );

  # Main menu!
  my $load = 0;
  while (1) {
    my $in = $Game-&gt;{UI}-&gt;msgbox(5,
      "EmotionRL",
      "By Da-Breegster",
      "",
      "Press space to begin the game.",
      "Or another key to choose another option.",
      "&lt;purple&gt;I&lt;black&gt;nstructions",
      "&lt;purple&gt;L&lt;black&gt;oad game"
    );
    if ($in eq " ") {
      last;
    } elsif ($in eq "i" or $in eq "I" or $in eq "?") {
      $Game-&gt;{UI}-&gt;msgbox(1,
      "&lt;purple&gt;Instructions&lt;black&gt;",
      "Welcome to EmotionRL, the first demo game made with the PerlRL engine!",
      "EmotionRL should be pretty easy; I wanted to show off my engine more than
      I wanted to create a balanced game.",
      "I'm assuming you're familiar with roguelikes. The summary of the keymap
       only holds ture if you haven't changed the Keymap file.",
      "&lt;Green&gt;I highly recommend that you examine all items and monsters, read
       all messages, and try out all items and attacks."
      );
      $Player-&gt;help;
    } elsif ($in eq "l" or $in eq "L") {
      if (-e "game.tgz") {
        $load = 1;
        last;
      } else {
        $Game-&gt;{UI}-&gt;msgbox(1,
          "There is no saved game in your current directory!"
        );
      }
    }
  }
  $Game-&gt;{UI}-&gt;msgbox(2);
  Roguelike::Interface::Curses::ungetch("L") if $load;
}

$Game-&gt;start;
</pre></body></html>