1
0
Fork 0
mirror of https://github.com/Oreolek/anthill.git synced 2024-04-26 14:19:20 +03:00

Initial commit

This commit is contained in:
Alexander Yakovlev 2014-07-22 22:16:05 +07:00
commit 35584dc294
11 changed files with 5538 additions and 0 deletions

3
Makefile Normal file
View file

@ -0,0 +1,3 @@
all:
lessc style.less >style.css
coffee -c game.coffee

2
README.md Normal file
View file

@ -0,0 +1,2 @@
# Муравейник
Короткая игра на Undum 2. Пока что больше proof of concept.

34
game.coffee Normal file
View file

@ -0,0 +1,34 @@
undum.game.id = "ac196662-11ac-11e4-aaef-8b0f8bf3404a"
undum.game.version = "1.0"
undum.game.situations =
intro: new undum.SimpleSituation(
"""
<p>
Каждый год я прихожу на берег озера. Возле высокой <a href="./tree">сосны</a> лежит огромный камень.
</p>
""",
actions:
"tree": """<p>Дерево как дерево. Длинная ветка</p>"""
,
enter: (character, system, from) ->
if character.qualities.time <= 2
system.write(
"""
<p>
Her bright, blood red lips had caught my sight when I came in. But when youre in my line of work, you learn to not let your glances show. She hesitated for a full five minutes, or however long it took for Elroy to mix my drink. She said, in a voice that betrayed nothing but polite inqry, perhaps the slightest hint of desperation, Is this seat taken?
</p>
"""
)
else
system.write(
"""
<p>TBW</p>
"""
)
)
undum.game.start = "intro"
undum.game.init = (character, system) ->
character.qualities.time = 1

77
index.html Normal file
View file

@ -0,0 +1,77 @@
<!DOCTYPE HTML>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Муравейник</title>
<link media="screen" rel="stylesheet" href="style.css">
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Tenor+Sans|Russo+One&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="page">
<div id="mid_panel">
<div id="buffer"></div>
<div id="title">
<div class="label">
<h1>Муравейник</h1>
<h2>Эпизод 1</h2>
<noscript><p class="noscript_message">Эта игра требует включённого Javascript.</p></noscript>
</div>
</div>
<div id="content_wrapper">
<div id="content">
</div>
<a name="end_of_content"></a>
</div>
<div id="legal">
<p>Автор игры &mdash; <a href="https://oreolek.ru">Oreolek.</a></p>
<p>Содержимое, дизайн выпущены под лицензией CC-BY-SA. Игра использует код и дизайн Scio, а также движок <a href="undum.com">Undum.</a></p>
</div>
</div>
</div> <!-- End of div.page -->
<!-- Holds UI elements that will be cloned and placed in the main
page. This block itself is always hidden. -->
<div id="ui_library">
<div id="quality" class="quality">
<span class="name" data-attr="name"></span>
<span class="value" data-attr="value"></span>
</div>
<div id="quality_group" class="quality_group">
<h2 data-attr="title"></h2>
<div class="qualities_in_group">
</div>
</div>
<div id="progress_bar" class="progress_bar">
<span class="name" data-attr="name"></span>
<span class="value" data-attr="value"></span>
<div class="progress_bar_track">
<div class="progress_bar_color" data-attr="width">
</div>
</div>
<span class="left_label" data-attr="left_label"></span>
<span class="right_label" data-attr="right_label"></span>
</div>
<hr id="turn_separator">
</div>
<div id="content_library">
</div>
<script type="text/javascript" src="js/undum.js"></script>
<script type="text/javascript" src="js/Hyphenator.js"></script>
<script type="text/javascript" src="js/lang/ru.js"></script>
<script type="text/javascript" src="game.js"></script>
<script type="text/javascript">
Hyphenator.config({
minwordlength : 4
});
Hyphenator.run();
$('#buffer').css("margin", ($(window).height()-$('#title').outerHeight())/2+"px" );
</script>
</body>
</html>

2772
js/Hyphenator.js Normal file

File diff suppressed because it is too large Load diff

27
js/lang/de.js Normal file
View file

@ -0,0 +1,27 @@
/* This a language file. It contains ALL the strings of the Undum core. And
* so separates the translation from the implementation. If you want to
* translate Undum to another language, use this file as a basis. - Oreolek
*/
/* German version by St.JohnLimbo
*/
undum.language["de"] = {
terrible: "f&uuml;rchterlich",
poor: "schlecht",
mediocre: "mittelm&auml;&szlig;ig",
fair: "ordentlich",
good: "gut",
great: "gro&szlig;artig",
superb: "superb",
yes: "ja",
no: "nein",
no_group_definition: "Fuer {id} konnte keine Gruppendefinition gefunden werden.",
link_not_valid: "Der Link '{link}' scheint nicht gueltig zu sein.",
link_no_action: "Ein Link mit der Situation '.' muss eine Aktion beinhalten.",
unknown_situation: "Es kann nicht zu einer unbekannten Situation: {id} gewechselt werden.",
erase_message: "Achtung! Hierdurch wird der momentane Spielstand geloescht, und das Spiel beginnt von neuem! Bist du sicher?",
no_current_situation: "Anzeige nicht moeglich, denn wir befinden uns momentan nicht in einer Situation.",
no_local_storage: "Kein lokaler Speicherplatz verfuegbar.",
random_seed_error: "Es muss ein gueltiger Anfangswert fuer den Zufallsgenerator angegeben werden.",
random_error: "Der Zufallsgenerator muss mit einem nicht-leeren Anfangswert initialisiert werden.",
dice_string_error: "Das Schema fuer den Wuerfelwurf wurde nicht verstanden: '{string}'."
};

25
js/lang/ru.js Normal file
View file

@ -0,0 +1,25 @@
/* This a language file. It contains ALL the strings of the Undum core. And
* so separates the translation from the implementation. If you want to
* translate Undum to another language, use this file as a basis. - Oreolek
*/
undum.language["ru"] = {
terrible: "ужасно",
poor: "бедно",
mediocre: "средне",
fair: "нормально",
good: "хорошо",
great: "прекрасно",
superb: "идеально",
yes: "да",
no: "нет",
no_group_definition: "Невозможно найти определение группы {id}.",
link_not_valid: "Ссылка '{link}' не выглядит правильной.",
link_no_action: "Ссылка с ситуацией '.' должна иметь действие.",
unknown_situation: "Вы не можете переместиться в неизвестную ситуацию {id}.",
erase_message: "Это навсегда удалит вашего персонажа и немедленно вернёт вас к началу игры. Вы уверены?",
no_current_situation: "Я не могу отобразить, потому что у нас нет текущей ситуации.",
no_local_storage: "Локальное хранилище недоступно.",
random_seed_error: "Вы должны задать верное случайное зерно.",
random_error: "Проинициализируйте Random с непустым зерном перед использованием.",
dice_string_error: "не могу интерпретировать вашу строку кубиков: '{string}'."
};

19
js/patterns/en-us.js Normal file

File diff suppressed because one or more lines are too long

20
js/patterns/ru.js Normal file

File diff suppressed because one or more lines are too long

2216
js/undum.js Normal file

File diff suppressed because it is too large Load diff

343
style.less Normal file
View file

@ -0,0 +1,343 @@
body {
background: lightblue;
color: black;
font-family: 'Tenor Sans', 'Open Sans', sans-serif;
font-size: 18px;
line-height: 1.6em;
background-attachment: fixed;
overflow-y: scroll;
}
/* Basic structure */
#page {
margin: 0 auto;
position: relative;
}
#mid_panel {
margin: 0 auto;
}
/* The title block */
#title, #title .label, #content, .tools {
border-radius: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
}
#title {
max-width: 28em;
margin: 2.2em auto 1.1em auto;
padding: 1.7em;
border: 1.1em solid rgba(0,0,0,0.25);
cursor: pointer; /* Until we click to start. */
.label {
overflow: hidden;
padding: 2.0em;
padding-left: 0.5em;
padding-right: 0.5em;
margin: auto;
max-width: 30em;
position: relative;
}
h1 {
margin: 0;
font-family: 'Russo One', cursive;
font-size: 1.6em;
line-height: 1.4em;
letter-spacing: 0.2em;
text-shadow: rgba(255,255,255,0.25) 1px 1px 2px;
color: #80806b;
}
h2 {
font-size: 0.74em;
font-weight: normal;
text-align: center;
}
#dynamicsub {
margin: 0;
margin-bottom: -2em;
}
#staticsub {
bottom: 0;
right: 3.4em;
position: absolute;
}
h3 {
font-size: 1.0em;
font-weight: normal;
text-align: center;
margin: 1.1em 0 0 0;
}
.noscript_message {
left: 0;
right: 0;
bottom: 0;
position: absolute;
font-size: 0.9em;
font-style: italic;
text-align: center;
color: #943;
}
}
/* Main content */
#content_wrapper {
max-width: 975px;
position: relative;
background: #060606;
background-color: rgba(0,0,0,0.25);
margin: 0.6em auto 1.1em auto;
padding: 2.8em;
display: none; /* Shown by Javascript */
overflow: auto;
}
span.drop + p {
text-indent: -0.4em;
}
p {
margin: 0;
padding-bottom: 0.2em;
}
hr {
border: none;
background-color: #0a0a0b;
width: 1.1em;
height: 1.1em;
margin-left: -3.2em;
position: absolute;
}
br + * {
text-indent: 1.6em;
}
p + p, p + img + p, p + hr + p {
text-indent: 1.6em;
}
ul {
margin: 0;
padding: 0 0 0 1em;
&.options {
border: 2px solid #876;
padding: 0;
margin-bottom: 0.7em;
list-style-type: none;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
li {
border-bottom: 1px solid #876;
padding: 0.5em;
}
}
}
ul.options li:hover {
background-color: rgba(153,136,119,0.2);
cursor: pointer;
}
ul.options li:last-child {
border-bottom: none;
}
h1 {
font-size: 1.0em;
text-transform: uppercase;
letter-spacing: 2px;
margin: 2.3em 0 1.1em 0;
color: #654;
text-align: center;
}
h1:first-child {
margin-top: 0;
}
a {
color: #900;
text-decoration: none;
border-bottom: 1px solid transparent;
&:hover {
border-bottom: 1px dotted #900;
}
}
img.float_right {
float: right;
margin: 1.1em 0 1.1em 1.1em;
}
img.float_left {
float: left;
margin: 1.1em 1.1em 1.1em 0;
}
img.float_center {
float: center;
width: 100%;
}
#toolbar {
display: none;
}
#tools_wrapper {
position: fixed;
max-width: 56em;
top: 2.2em;
left: 0.4em;
right: 0.4em;
margin: 0 auto;
display: none; /* Shown by Javascript */
}
#info_panel, #character_panel {
display: none;
}
.tools {
padding: 0.6em;
width: 8.9em;
background: #cec3ae url("../img/tools_bg.jpg") repeat left top;
position: absolute;
}
.tools p {
font-size: 0.95em;
line-height: 1.5em;
}
.tools.left {
left: 0;
}
.tools.right {
right: 0;
}
.tools h1 {
font-size: 1.0em;
font-weight: normal;
border-bottom: 1px solid #321;
margin-bottom: 0.6em;
}
.buttons {
padding-top: 0.6em;
margin-top: 0.6em;
border-top: 1px solid #321;
text-align: center;
}
.buttons button {
font-size: 0.8em;
background: #876;
color: #e6e6c6;
border: none;
padding: 0.3em 1.0em;
cursor: pointer;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
.buttons button:hover {
background: #987;
}
.buttons button + button {
margin-left: 0.3em;
}
.buttons button[disabled], .buttons button[disabled]:hover {
background: #ba9;
color: #dcb;
cursor: default;
}
#legal {
max-width: 33em;
color: #654;
margin: 1em auto 0 auto;
padding-bottom: 2.2em;
display: none; /* Shown by Javascript */
}
#legal p {
font-size: 0.7em;
line-height: 1.3em;
margin-bottom: 0.5em;
}
#legal p + p {
text-indent: 0;
}
#character {
font-size: 1.0em;
line-height: 1.4em;
}
#qualities .quality, #character_text {
position: relative;
clear: both;
overflow: hidden;
margin: 0 -0.25em;
padding: 0 0.25em;
}
#character_text {
margin-bottom: 0.6em;
}
#character_text_content {
position: relative;
z-index: 100;
}
#qualities span {
position: relative;
z-index: 100;
}
#qualities span.name {
float: left;
}
#qualities span.value {
float: right;
}
.highlight {
background: rgba(255, 255, 0, 0.75);
position: absolute;
left: -4px;
right: -4px;
top: 0;
bottom: 0;
}
#qualities h2 {
margin: 0.5em 0 0.25em 0;
font-size: 1.0em;
border-bottom: 1px solid #321;
}
.progress_bar {
position: relative;
overflow: hidden;
margin: 0.6em 0;
}
.progress_bar_track {
z-index: 100;
background: rgba(255,255,255,0.25);
border: 2px solid #876;
height: 0.75em;
width: 27.7em;
clear: both;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
.progress_bar_color {
background: #987;
width: 0;
height: 0.75em;
}
.progress_bar span {
z-index: 100;
}
.progress_bar .name {
font-weight: bold;
}
.progress_bar .value {
float: right;
}
.progress_bar .left_label {
float: left;
}
.progress_bar .right_label {
float: right;
}
#content_library, #ui_library {
display: none;
}
#menu {
display: none;
}
#content {
font-size: 0.9em;
}