starcraft: preliminary game key emulator
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 6 May 2009 03:09:46 +0000 (03:09 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 18 Jun 2010 22:01:54 +0000 (22:01 +0000)
starcraft.inc.pl [new file with mode: 0644]
starcraft.plp [new file with mode: 0644]

diff --git a/starcraft.inc.pl b/starcraft.inc.pl
new file mode 100644 (file)
index 0000000..8c4af9c
--- /dev/null
@@ -0,0 +1,243 @@
+use utf8;
+
+my %CONS = ( # producing building
+       r => ["rally point", 'pm'],
+);
+my %UNIT = ( # any unit
+       m => ["move", 'pm'],
+       s => ["stop", 'pm'],
+);
+my %UNITF = ( # fighter
+       p => ["patrol", 'pm'],
+       h => ["hold", 'pm'],
+);
+my %UNITA = (
+       a => ["attack", 'pm'],
+);
+my %UNITB = (
+       b => ["burrow", 'ci'],
+);
+my %UNITH = (
+       %UNITA,
+       g => ["gather", 'pm'],
+       c => ["return cargo", 'pm'],
+);
+
+'' => {
+},
+
+P => {
+       desc => 'Protoss Probe',
+       %UNIT, %UNITH,
+       b => ["build structure", 'me modePb'],
+       v => ["build adv$sign{_}anced structure", 'me modePv'],
+},
+Pb => {
+       desc => 'Protoss Probe build',
+       n => ["nexus", 'mo modePbn'],
+       p => ["pylon", 'me'],
+       a => ["assimi$sign{_}lator", 'me'],
+       g => ["gate$sign{_}way", 'mo modePbg'],
+       f => ["forge", 'mv modePbf'],
+       c => ["photon cannon", 'me'],
+       y => ["cyber$sign{_}netics core", 'mv modePby'],
+       b => ["shield batt$sign{_}ery", 'me modePbb'],
+},
+Pbn => {
+       desc => 'Protoss Nexus',
+       %CONS,
+       p => ["probe", 'co modeP'],
+},
+Pbg => {
+       desc => 'Protoss Gateway',
+       %CONS,
+       z => ["zealot", 'co'],
+       d => ["dragoon", 'cp'],
+       t => ["high templar", 'cp modePbgt'],
+       k => ["dark templar", 'cp modePbgk'],
+},
+Pbgt => {
+       desc => 'Protoss High Templar',
+       %UNIT, %UNITF,
+       t => ["psionic storm", 'ci'],
+       l => ["halluci$sign{_}nation", 'ci'],
+       r => ["archon warp", 'cp'],
+},
+Pbgk => {
+       desc => 'Protoss Dark Templar',
+       %UNIT, %UNITF, %UNITA,
+       r => ["dark archon meld", 'cp modePbgkr'],
+},
+Pbgkr => {
+       desc => 'Protoss Dark Archon',
+       %UNIT, %UNITF,
+       f => ["feed$sign{_}back", 'pm'],
+       c => ["mind control", 'ci'],
+       e => ["mael$sign{_}strom", 'ci'],
+},
+Pbf => {
+       desc => 'Protoss Forge',
+       w => ["ground weap$sign{_}on$sign{_}s", 'mv'],
+       a => ["ground armor", 'mv'],
+       s => ["plasma shields", 'mv'],
+},
+Pby => {
+       desc => 'Protoss Cybernetics Core',
+       w => ["air weap$sign{_}on$sign{_}s", 'mv'],
+       a => ["air armor", 'mv'],
+       s => ["dragoon range", 'mv'],
+},
+Pbb => {
+       desc => 'Protoss Shield Battery',
+       r => ["recharge shields", 'pm'],
+},
+Pv => {
+       desc => 'Protoss Probe advanced build',
+       r => ["robotics facility", 'mo modePvr'],
+       s => ["stargate", 'mo modePvs'],
+       c => ["citadel of adun", 'mv modePvc'],
+       b => ["support bay", 'mv modePvb'],
+       f => ["fleet beacon", 'mv modePvf'],
+       t => ["templar archives", 'mv modePvt'],
+       o => ["observa$sign{_}tory", 'mv modePvo'],
+       a => ["arbiter tribunal", 'mv modePva'],
+},
+Pvr => {
+       desc => 'Protoss Robotics facility',
+       %CONS,
+       s => ["shuttle", 'co'],
+       o => ["observer", 'cp'],
+       v => ["reaver", 'cp modePvrv'],
+},
+Pvrv => {
+       desc => 'Protoss Reaver',
+       %UNIT, %UNITF, %UNITA,
+       r => ["scarab", 'co'],
+},
+Pvs => {
+       desc => 'Protoss Stargate',
+       %CONS,
+       s => ["scout", 'co'],
+       c => ["carrier", 'cp modePvsc'],
+       a => ["arbiter", 'cp modePvsa'],
+       o => ["corsair", 'co modePvso ext'],
+},
+Pvsc => {
+       desc => 'Protoss Carrier',
+       %UNIT, %UNITF, %UNITA,
+       i => ["inter$sign{_}ceptor", 'co'],
+},
+Pvsa => {
+       desc => 'Protoss Arbiter',
+       %UNIT, %UNITF, %UNITA,
+       r => ["recall"],
+       t => ["statis field"],
+},
+Pvso => {
+       desc => 'Protoss Corsair',
+       %UNIT, %UNITF, %UNITA,
+       d => ["disrup$sign{_}tion web", 'ci'],
+},
+Pvc => {
+       l => ["leg en$sign{_}hancem$sign{_}ent$sign{_}s", 'mv'],
+},
+Pvb => {
+       s => ["scarab damage", 'mv'],
+       c => ["reaver capacity", 'mv'],
+       g => ["gravitic drive", 'mv'],
+},
+Pvf => {
+       a => ["apial sensors", 'mv'],
+       g => ["gravitic thrust$sign{_}ers", 'mv'],
+       c => ["carrier capacity", 'mv'],
+       d => ["disrup$sign{_}tion web", 'mv ext'],
+       j => ["argus jewel", 'mv'],
+},
+Pvt => {
+       desc => 'Protoss Templar Archives',
+       t => ["psionic storm", 'mv'],
+       h => ["halluci$sign{_}nation", 'mv'],
+       k => ["khayda$sign{_}rin amul$sign{_}et", 'mv'],
+#      c => ["mind control?", 'mv'], #TODO
+       e => ["mael$sign{_}strom", 'mv'],
+       t => ["argus talisman", 'mv'],
+},
+Pvo => {
+       desc => 'Protoss Observatory',
+       g => ["gravitic booster", 'mv'],
+       s => ["sensor array", 'mv'],
+},
+Pva => {
+       desc => 'Protoss Arbiter Tribunal',
+       r => ["recall", 'mv'],
+       s => ["stasis field", 'mv'],
+       k => ["khayda$sign{_}rin core", 'mv'],
+},
+
+Z => {
+       desc => 'Zerg Larva',
+       d => ["drone", 'co modeZd'],
+       z => ["zergling", 'cp'],
+       o => ["overlord", 'co modeZo'],
+       h => ["hydra$sign{_}lisk", 'cp modeZh'],
+       q => ["queen", 'mv modeZq'],
+},
+Zd => {
+       desc => 'Zerg Drone',
+       %UNIT, %UNITH, %UNITB,
+       b => ["basic mutat$sign{_}ion", 'me modeZdb'],
+       v => ["advance$sign{_}d mutat$sign{_}ion", 'me modeZdv'],
+},
+Zdb => {
+       desc => 'Zerg basic Drone mutation',
+       h => ["hatche$sign{_}ry", 'mo modeZdbh'],
+       c => ["creep colony", 'mo modeZdbc'],
+       e => ["extrac$sign{_}tor", 'me'],
+       s => ["spawning pool", 'mv modeZdbs'],
+       v => ["evolution chamber", 'mv modeZdbv'],
+       d => ["hydra$sign{_}lisk den", 'mv modeZdbd'],
+},
+Zdbh => {
+       desc => 'Zerg Hatchery',
+       %CONS,
+       b => ["burrow", 'me'],
+       s => ["select larvae", 'pm modeZ'],
+       l => ["lair", 'mo modeZdbhl'],
+},
+Zdbhl => {
+       desc => 'Zerg Lair',
+       %CONS,
+       b => ["burrow", 'me'],
+       v => ["ventral sacs", 'mv'],
+       a => ["antennae", 'mv'],
+       p => ["pneumatized carapace", 'mv'],
+       h => ["hive", 'mo modeZdbhlh'],
+},
+modeZdbhlh => {
+       desc => 'Zerg Hive',
+       %CONS,
+       b => ["burrow", 'me'],
+       v => ["ventral sacs", 'mv'],
+       a => ["antennae", 'mv'],
+       p => ["pneumatized carapace", 'mv'],
+},
+Zdbs => {
+       desc => 'Zerg Spawning Pool',
+       m => ["metabol boost", 'mv'],
+       a => ["adrenal glands", 'mv'],
+},
+Zdbv => {
+       m => ["melee attack$sign{_}s", 'mv'],
+       a => ["missile attack$sign{_}s", 'mv'],
+       c => ["carapace", 'mv'],
+},
+Zdbd => {
+       desc => 'Zerg Hydralisk Den',
+       m => ["muscular augments", 'mv'],
+       g => ["grooved spines", 'mv'],
+       l => ["lurker aspect", 'mv'],
+},
+Zdv => {
+       desc => 'Zerg advanced Drone mutation',
+},
+
diff --git a/starcraft.plp b/starcraft.plp
new file mode 100644 (file)
index 0000000..8279df3
--- /dev/null
@@ -0,0 +1,117 @@
+<:
+use utf8;
+use strict;
+use warnings;
+no  warnings 'qw';  # you know what you doing
+no  warnings 'uninitialized';  # save some useless checks for more legible code
+
+use Shiar_Sheet::KeySigns qw(%sign);
+
+our $VERSION = 'v1.0';
+
+$header{content_type} = "text/html; charset=$sign{charset}";
+
+:><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<head>
+<title>starcraft cheat sheet</title>
+<meta http-equiv="content-type" content="<:= $header{content_type} :>">
+<link rel="stylesheet" type="text/css" media="all" href="base.css">
+<!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->
+<!--[if lte IE 7]><style> .help dl.legend dd {float:none} </style><![endif]--><:
+       my %styles = map {$_ => $_} qw(dark circus mono red terse);
+       our $style = exists $get{style} && $styles{$get{style}} || 'light';
+       printf(qq{\n<link rel="%s" type="text/css" media="all" href="%s" title="%s">},
+               $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "$_.css", $_
+       ) for keys %styles;
+
+       our $showkeys = exists $get{keys} && $get{keys} ne '0';
+       print "\n<style> .no {visibility:hidden} </style>" unless $showkeys;
+       print "\n<style> .no, .alias {opacity:.5} </style>"
+               if $showkeys and $get{keys} eq 'ghost';
+:>
+<script type="text/javascript" src="/keys.js"></script>
+
+<body id="starcraft">
+
+<h1>StarCraft cheat sheet</h1>
+
+<h2>normal mode (default)</h2>
+
+<ul id="rows">
+
+<li class="row">
+       <ul class="keys omni">
+       <li class="mv chr27" onclick="setmode()"><b>Esc</b> normal mode
+               <!-- not as static anymore, but never bothered; just see ^[ -->
+       </ul>
+</li>
+
+<:
+use Shiar_Sheet::Keyboard;
+my $keys = Shiar_Sheet::Keyboard->new({do 'starcraft.inc.pl'});
+$keys->map($get{map}) or undef $get{map};
+$keys->print_rows($get{rows} || '1 =P1 Z1', [0]);
+:>
+</ul>
+
+<hr>
+
+<div class="help">
+       <div class="left">
+               <dl class="legend legend-types">
+               <dt class="ci">ability
+                       <dd>Unit action available after upgrade.
+               <dt class="pm">action
+                       <dd>Default unit action.
+               <dt class="po">
+                       <dd>
+               <dt class="co">unit
+                       <dd>Unit available at all times.
+               <dt class="cp">dep unit
+                       <dd>Unit with dependencies.
+               <dt class="mi">
+                       <dd>
+               <dt class="mo">build
+                       <dd>Unit producing construction.
+               <dt class="mv">upgrade
+                       <dd>Building or research providing unit upgrade.
+               <dt class="me">other
+                       <dd>Miscellaneous facility.
+               </dl>
+       </div>
+
+       <div class="right">
+               <dl class="legend legend-options">
+               <dt>key<:= $sign{arg} :>
+                       <dd>Commands with a dot need a char argument afterwards.
+               <dt>key<:= $sign{args} :>
+                       <dd>Commands with two dots require variable arguments afterwards.
+               </dl>
+
+               <ul class="legend legend-set">
+               <li>keyboard <strong>map</strong> is
+                       <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
+               <li><strong>ascii</strong> mode is
+                       <:= defined $sign{-ascii} && 'forced ' :><em><:=
+                               $sign{-ascii} ? 'on' : 'off' :></em>
+               <li><strong>keys</strong> are
+                       <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
+                               !exists $get{keys} && ' by default' :>
+               <li>default <strong>style</strong> is
+                       <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
+               </ul>
+       </div>
+</div>
+
+<p class="footer">
+       <a href="/" rel="home">sheet.shiar.nl</a>/starcraft
+       <a href="git://git.shiar.nl/sheet" rel="vcs-git" title="Git repository"><:= $VERSION :></a>
+       created by <a href="http://shiar.nl/" rel="author">Shiar</a> <:= $sign{sep} :>
+       <a title="Licensed under the GNU Affero General Public License, version 3" rel="copyright"
+          href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a>
+</p>
+
+</html>