Cycle code, English translation in progress

This commit is contained in:
Alexander Yakovlev 2015-12-13 12:58:33 +07:00
parent a15c523ebb
commit 9540ee3dea
6 changed files with 331 additions and 132 deletions

View File

@ -29,19 +29,30 @@ a = require('raconteur/lib/elements.js').a
way_to = (content, ref) -> a(content).class('way').ref(ref)
textlink = (content, ref) -> a(content).once().writer(ref)
textcycle = (content, ref) -> a(content).replacer(ref).class("cycle").id(ref).toString()
# Cycling link. It's implied there can be only one per situation.
# Also it saves the current index in the window object, which is not okay for longer games because no saving.
# You are welcome to improve this code.
cycle = (obj) ->
responses = obj.cycle_gallery()
window.cycle_index ?= []
window.cycle_index[obj.name] ?= 0
if window.cycle_index[obj.name] == responses.length
window.cycle_index[obj.name] = 0
response = responses[window.cycle_index[obj.name]]
window.cycle_index[obj.name]++
return textcycle(response, 'cyclewriter')
writemd = (system, text) ->
if typeof text is Function
text = text()
system.write(markdown.render(text))
situation "start",
cycle_gallery: () -> "christine".l()
content: () ->
return "start".l()(this.writers.smell)
return "start".l()(cycle(this))
choices: ["#start"],
writers:
smell: textcycle("пахнет сладким мёдом", "look")
look: textcycle("смотрит вдаль, о чём-то задумавшись", "touch")
touch: textcycle("крепко обнимает меня, впиваясь ногтями в плечо", "smell")
cyclewriter: () -> cycle(this)
is_visited = (situation) ->
situations = undum.game.situations[situation]

View File

@ -1,29 +1,40 @@
module.exports.language =
intro: """
-- Damn, they keep coming!
A narrow corridor, me and unstoppable line of pearlskinned shiny androids.
I'm sure I expected this New Year to be a lot different.
One crate of androids contains thirty five machines.
This is going to be a long battle.
"""
androidattack: "One of androids is so close he bites me!"
emptyclip: "I get rid of empty cartridge."
player_hit: [
"Android's head explodes like a Christmas fireworks.",
"Android tries to dodge but finds himself right on the bullet's wrong side.
He falls, flooding the floor with oil."
"""
The bullet pierces the creature's head, and it becomes water, spilling on the soil.
But the next one is already coming out of the portal.
""",
"""
Robot tries to dodge but comes square under the bullet.
He falls, spilling on soil.
""",
"""
The bullet tears the liquid robot apart to droplets.
It's a clear sky for a rain like that, don't you think?
""",
"""
The enemy blows up to a little liquid droplets.
""",
"""
The bullet pierces the robot and vanishes inside the portal.
There is only a pool of liquid chrome on this side.
I see a new suicidal coming out of the green door.
Seems like I wasn't very precise on the other side.
"""
]
player_finished: [
"I finish the android with a shot to his heart.",
"I finish the android with a precise shot.",
"The bullet pierces android's head and he finally falls on the floor motionless.",
"I finish the robot with a shot to his heart.",
"I finish the robot with a precise shot.",
"The bullet pierces robot's head and he finally spills on the floor.",
]
player_nicked: [
"""I shoot the enemy's leg off.
He falls but keeps slowly scratch his way with his hands.""",
"I shoot through the android's arm. He stumbles but keeps going.",
"""
I shoot the enemy's leg off.
He falls but keeps slowly scratch his way with his hands.
""",
"I shoot through the robots' arm. He stumbles but keeps going.",
]
shoot: [
"Shoot",
@ -35,11 +46,11 @@ module.exports.language =
"Attack",
"Shoot 'em",
"KILL THEM WITH PISTOL",
"I HATE ANDROIDS",
"I HATE ROBOTS",
"I. Hate. Machines.",
"MECHANOID ANNIHILATION",
'Destroy the mechanoids',
"Send a bullet to android",
"Send a bullet to robot",
"Send a bullet with explosion",
"Push the trigger FOR THE HUMANITY",
"Sit down and shoot from a hip",
@ -48,49 +59,10 @@ module.exports.language =
]
reload: "Reload the pistol",
reload_response: """
I put another clip in the pistol.
I hope it has some ammo.
"""
search: "Search for a clip"
search_response: [
"I hastily search the floor, trying to find at least one cartridge intact.",
"I quickly look around for a clip on the floor.",
]
finale: """
KABOOM!
The last android suddenly explodes like larded with dynamite.
Eh, with these machines you never know.
I turn around and go away, not looking at the fire.
My job is done.
<h3>THE END</h3>
The game uses following CC-BY and public domain sound effects and images:
* SpartanX109 - [Desert Eagle Fire.mp3](http://freesound.org/people/SpartanX109/sounds/89147/)
* ngphil22 - [DEagle wCasing.mp3](http://freesound.org/people/ngphil22/sounds/233322/)
* watupgroupie - [gunshots.mp3](http://freesound.org/people/watupgroupie/sounds/36815/)
* qubodup - [Bullet silhoettes](https://openclipart.org/detail/29029/bullet-silhouettes)
"""
finale_perfect: """
35 shots.
That's all it took.
Whether by impossible luck or by some higher being's meddling, there's still a lot of time left.
My job is done.
Now I can have a good New Year.
<h3>THE END</h3>
The game uses following CC-BY and public domain sound effects and images:
* SpartanX109 - [Desert Eagle Fire.mp3](http://freesound.org/people/SpartanX109/sounds/89147/)
* ngphil22 - [DEagle wCasing.mp3](http://freesound.org/people/ngphil22/sounds/233322/)
* watupgroupie - [gunshots.mp3](http://freesound.org/people/watupgroupie/sounds/36815/)
* qubodup - [Bullet silhoettes](https://openclipart.org/detail/29029/bullet-silhouettes)
I put another clip in the pistol.
I hope it has some ammo.
"""
search: "Ask Christine to search for a clip"
clips_not_found: [
"No, nothing here.",
"Come on, at least one! No, didn't find any.",
@ -118,11 +90,232 @@ module.exports.language =
A single shot there - and a section collapses, taking two enemies out.
",
]
start: (link) -> """
-- Tony, do you really need the pistol now?
We are sitting together, hugging each other, on our backyard.
Christine #{link}.
I adjust the holster on my hip.
"""
endintro: """
Before I have time to open my mouth, a big green portal opens before us,
and a large metallic humanlike robot with chrome body steps out.
He raises his hand and aims it on Christine.
I snatch the pistol from the holster before I comprehend a short wand in the robot's hand.
"""
firstmove: """
The bullet turns the thing I took for a robot in a water pillar.
It spills on the ground, losing the wand.
Christine tosses up her hands in *Fitnag* sign.
Shoot everything!
Almost on cue the green portal surface flickers and a chrome leg steps out.
"""
search_response:[
"""
Christine! Ammo!
I'm searching!”
"""
"""
I quickly look around.
Christine runs around the house searching for my ammo stashes.
""",
"""
I quickly look around.
Christine is already searching for ammo.
""",
"""
I hope she can hold the barrier and search for ammo at the same time.
""",
"""
Christine! Look in the freezer!
I swear you and your stashes...
I hope she'll find at least a half-spent clip.
""",
"""
Christine! In the toilet, under the cistern!
Who keeps his ammo under the cistern?!
Well, I don't remember, it might not be there. Please take a look!“
""",
"""
Christine! I need ammo!
I'm searching!”
""",
]
christine: [
"smells like sweet, sweet honey",
"looks far ahead, thinking about something",
"hugging me tight, sinking her nails in my shoulder",
]
finale:
"""
Ко мне подходит Кристина.
Она обнимает меня и целует.
-- Мой герой.
-- Тебе помочь закрыть портал?
-- Я сама виновата.
Не вспомнила про такую простую защиту.
-- Ну, ты могла бы в другой раз не унижать так много волшебников сразу.
Возможно, они бы не прислали своих големов или как это называется.
-- Конструкты. А ты мог бы быть лапушкой и держать свои патроны вместе с
оружием где-нибудь в оружейном сейфе.
-- А если...
-- А ты поставь второй секретный сейф.
-- Сделаю. Так что, мы ещё успеваем закончить романтический вечер?
-- Ты обещаешь быть жестоким и безоружным?
-- Я буду чист и многозаряден.
Я поцеловал Кристину и оставил её рядом с зелёным порталом.
Думаю, мне не надо беспокоиться за её безопасность.
Она может остановить любые пули и заклинания.
И всё-таки я оставлю тайник на чердаке с ракетами на всякий случай.
"""
finale_perfect:
"""
25 выстрелов.
Вот всё, что потребовалось.
Была ли это невероятная удача, или вмешательство высшей силы, но ещё осталось много времени.
Моя работа сделана.
А теперь наш вечер вдвоём будет таким, каким он должен быть.
"""
credits:
"""
### THE END
The game uses the following public domain and CC-BY assets:
* SpartanX109 - [Desert Eagle Fire](http://freesound.org/people/SpartanX109/sounds/89147/)
* ngphil22 - [DEagle wCasing](http://freesound.org/people/ngphil22/sounds/233322/)
* watupgroupie - [gunshots](http://freesound.org/people/watupgroupie/sounds/36815/)
* Yoyodaman234 - [metal footstep 1](http://freesound.org/people/Yoyodaman234/sounds/223168/)
* qubodup - [Bullet silhoettes](https://openclipart.org/detail/29029/bullet-silhouettes)
"""
stats:
"""
Thank you for finishing my game.
Want to compare yourself against other players?
"""
clips_not_found: [
"""
-- Не могу найти!
""",
"""
-- Ничего нет!
-- Ну хотя бы один!
-- Я держу барьер! Экономь патроны!
""",
"""
-- Пусто!
-- Ты посмотрела...
-- Да я везде уже посмотрела, нет больше твоих картриджей!
-- Ладно, дай тогда вспомню, где ещё были заначки.
""",
"-- Пусто!",
"-- Ничего!",
"-- Вспоминай лучше! Тут чисто!",
"""
-- Ты не можешь хранить все патроны в одном месте?!
Их не найти!
-- Это система!
-- Это мания!
""",
]
clips_found:[
"Ага! Есть один. Надеюсь, в нём есть патроны.",
"А, вот какой-то. На вес тяжёлый -- надеюсь, в нём есть патроны."
]
player_missed:[
"Пуля пролетает над левым плечом робота.",
"Робот вовремя уворачивается от выстрела. Ничего, в следующий раз я не промахнусь.",
"Чёрт! Промазал.",
"Мимо! Ну что за невезение.",
"На заметку: надо чаще упражняться в стрельбе. Часто промахиваюсь.",
"Чёрт! Почему я промазал именно сейчас?!",
]
player_trickshot: [
"""
Я разбегаюсь к стене и прыгаю, стреляя в полёте.
Пуля пролетает сквозь голову робота прямо в следующего, вырубая обоих.
""",
"""
Я замечаю слабое место в потолке.
Один выстрел туда -- и секция разваливается, убирая под собой двух врагов.
"""
]
pacifist: """
-- Не стреляйте! Я пацифист!
Один из роботов поднимает руки вверх.
На его лице написана мольба.
"""
shoot_pacifist: (link) -> """
Я простреливаю его блестящую металлическую #{link}.
Из портала выходит другой робот, который ударом ноги валит на землю товарища.
Затем он наступает на его голову.
Странный робот стекает в лужу, но его место уже занял другой, более нормальный.
"""
spare_pacifist: """
Я опускаю пистолет.
-- Спасибо! -- кричит странный робот. -- Я обязательно...
Тут его толкают сзади, и он падает на землю лицом вниз.
-- Директива А028. Девиантное поведение. Уничтожить.
Робот, следующий за ним, наносит пацифисту мощный удар в затылок.
После этого он перешагивает через свежую лужицу и смотрит на меня злым взглядом.
Похоже, битва продолжается.
"""
firststeps: "Это шаги? Похоже, что-то приближается по ту сторону портала."
secondsteps: "Шаги становятся громче. Оно большое."
thirdsteps: "Уже близко. Совсем близко."
boss: """
Из портала вылезает гигантская блестящая Рука.
Она цепляется за край портала и начинает его растягивать.
Кристина кричит:
-- Оно слишком большое! Я не смогу удержать!
Из растянутого портала показывается ведро.
Это голова робота-титана, который мог бы таранить города.
Я точно не хочу впускать его на задний двор своего дома.
"""
shoot_boss: "Успокоить титана свинцом"
trick_shot_discover: (character) ->
"""
I count the clips.
Only four left.
I've killed #{character.sandbox.killed} androids, meaning, there are still... oh.
I've killed #{character.sandbox.killed} robots, so there are still... oh.
OH.
I gotta conserve the ammo.
I can try trick shots but these are big risk.

View File

@ -83,7 +83,7 @@ module.exports.language =
"Стрельба",
"СТРЕЛЯТЬ!",
"УБИТЬ ИХ ИЗ ПИСТОЛЕТА",
"НЕНАВИЖУ АНДРОИДОВ",
"НЕНАВИЖУ РОБОТОВ",
"АННИГИЛЯЦИЯ МЕХАНОИДОВ",
"Уничтожить механоидов",
"Отправить пулю в робота",
@ -160,7 +160,7 @@ module.exports.language =
И всё-таки я оставлю тайник на чердаке с ракетами на всякий случай.
"""
finale_perfect: """
35 выстрелов.
25 выстрелов.
Вот всё, что потребовалось.
Была ли это невероятная удача, или вмешательство высшей силы, но ещё осталось много времени.
@ -210,9 +210,6 @@ module.exports.language =
-- Это мания!
""",
"""
--
"""
]
enemies: 'Врагов впереди'
clips: 'Картриджей с патронами'
@ -234,7 +231,7 @@ module.exports.language =
"""
Я пересчитываю картриджи.
Осталось всего четыре.
Я убил #{character.sandbox.killed} андроидов, то есть, впереди ещё... ой.
Я убил #{character.sandbox.killed} роботов, то есть, впереди ещё... ой.
ОЙ.
Надо экономить патроны.
Я могу попробовать хитрые выстрелы, но это -- большой риск.
@ -247,6 +244,11 @@ module.exports.language =
Один выстрел туда -- и секция разваливается, убирая под собой двух врагов.
"""
]
christine: [
"пахнет сладким мёдом",
"смотрит вдаль, о чём-то задумавшись",
"крепко обнимает меня, впиваясь ногтями в плечо",
]
pacifist: """
-- Не стреляйте! Я пацифист!

View File

@ -2,41 +2,53 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Thirty five shots</title>
<title>Bullets talk faster</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
</head>
<body>
<div id="page">
<div id="mid_panel">
<div id="title">
<div id="page" class="container">
<div class="row">
<div id="title" class="title">
<div class="label">
<h1>Thirty five shots</h1>
<h3>An online sci-fi first person cybertext shooter</h3>
<h1>Bullets talk faster</h1>
<h3>An online fantasy first person cybertext shooter</h3>
<noscript>
<p class="noscript_message">This game requires Javascript.</p>
</noscript>
<p class="click_message">click to play</p>
</div>
</div>
<div id="clip">
<p><img src="img/clip6.png"></p>
<div class="row">
<div class="controls">
<div id="clip">
<p><img src="img/clip6.png"></p>
</div>
<!-- Volume slider -->
<section class="volume">
<div id="slider"></div>
<span class="voldisplay"></span>
</section>
</div>
</div>
<div id="content_wrapper">
<div id="content_wrapper" class="row">
<div id="content">
</div>
<a name="end_of_content"></a>
</div>
<div id="legal">
<p>Approximate play time: five minites.</p>
<p>Made using <a href="http://undum.com">Undum</a> and <a href="http://sequitur.github.io/raconteur/">Raconteur</a>.</p>
<p>Betatesting credit: headless zombie</p>
<div class="row">
<div id="legal">
<div id="footleft">
<p>Approximate play time: five minites.</p>
<p>Made using <a href="http://undum.com">Undum</a> and <a href="http://sequitur.github.io/raconteur/">Raconteur</a>.</p>
<p>Betatesting credit: headless zombie</p>
</div>
<div id="footright">
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a>
</div>
</div>
</div>
</div>
</div> <!-- End of div.page -->
@ -52,18 +64,6 @@
<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>
@ -71,7 +71,27 @@
<audio id="shot1" preload="auto"><source src="audio/fire.mp3" type='audio/mpeg; codecs="mp3"'></audio>
<audio id="shot2" preload="auto"><source src="audio/casing.mp3" type='audio/mpeg; codecs="mp3"'></audio>
<audio id="reload" preload="auto"><source src="audio/reload.mp3" type='audio/mpeg; codecs="mp3"'></audio>
<audio id="step1" preload="auto"><source src="audio/step1.mp3" type='audio/mpeg; codecs="mp3"'></audio>
<audio id="step2" preload="auto"><source src="audio/step2.mp3" type='audio/mpeg; codecs="mp3"'></audio>
<audio id="roar" preload="auto"><source src="audio/roar.mp3" type='audio/mpeg; codecs="mp3"'></audio>
<script type="text/javascript" src="game/undum.js"></script>
<script type="text/javascript" src="game/bundle.js"></script>
<!-- Piwik tracking. Google or Yandex DON'T see these analytics. Also I support Do Not Track feature. -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDomains", ["*.oreolek.ru","*.itch.io"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['enableHeartBeatTimer']);
(function() {
var u="//oreolek.ru/webstats/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 2]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//webstats.oreolek.ru/piwik.php?idsite=2" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
</body>
</html>

View File

@ -65,18 +65,6 @@
<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>

View File

@ -25,24 +25,9 @@ body {
#content_wrapper {
display: none; // Shown by Javascript
}
/*
#content_wrapper {
margin: 1.1em auto;
padding: 2.8em;
}
@media (min-width: 981px) {
#content_wrapper {
margin: 1.1em 15%;
}
}
@media (min-width: 1281px) {
#content_wrapper {
margin: 1.1em 25%;
}
}
*/
// The title block
.title {
margin-top: 2em;
@include col(10,12);
@media (min-width: breakpoint-min(sm)) {
@include make-col-offset(1);