Merge pull request #2 from doublespeakgames/master

Update 2015-05-04
This commit is contained in:
Andrea Rendine
2015-05-04 16:21:08 +02:00
6 changed files with 365 additions and 192 deletions
+28 -10
View File
@@ -6,16 +6,34 @@ a minimalist text adventure game for your browser
[Click to play](http://adarkroom.doublespeakgames.com)
Available | Languages
--------- | ---------
[Chinese](http://adarkroom.doublespeakgames.com/?lang=zh_cn) | [English](http://adarkroom.doublespeakgames.com/?lang=en)
[French](http://adarkroom.doublespeakgames.com/?lang=fr) | [German](http://adarkroom.doublespeakgames.com/?lang=de)
[Italian](http://adarkroom.doublespeakgames.com/?lang=it) | [Japanese](http://adarkroom.doublespeakgames.com/?lang=ja)
[Korean](http://adarkroom.doublespeakgames.com/?lang=ko) | [Norwegian](http://adarkroom.doublespeakgames.com/?lang=nb)
[Polish](http://adarkroom.doublespeakgames.com/?lang=pl) | [Portuguese](http://adarkroom.doublespeakgames.com/?lang=pt)
[Russian](http://adarkroom.doublespeakgames.com/?lang=ru) | [Spanish](http://adarkroom.doublespeakgames.com/?lang=es)
[Swedish](http://adarkroom.doublespeakgames.com/?lang=sv) | [Turkish](http://adarkroom.doublespeakgames.com/?lang=tr)
[Ukrainian](http://adarkroom.doublespeakgames.com/?lang=uk) | [Vietnamese] (http://adarkroom.doublespeakgames.com/?lang=vi)
<table>
<tr>
<th colspan=2>Available Languages
<tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=zh_cn">Chinese</a>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=en">English</a>
<tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=fr">French</a>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=de">German</a>
<tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=it">Italian</a>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=ja">Japanese</a>
<tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=ko">Korean</a>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=nb">Norwegian</a>
<tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=pl">Polish</a>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=pt">Portuguese</a>
<tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=ru">Russian</a>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=es">Spanish</a>
<tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=sv">Swedish</a>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=tr">Turkish</a>
<tr>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=uk">Ukrainian</a>
<td><a href="http://adarkroom.doublespeakgames.com/?lang=vi">Vietnamese</a>
</table>
or play the latest on [GitHub](http://doublespeakgames.github.io/adarkroom)
+122 -3
View File
@@ -8,15 +8,15 @@ msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-02-07 20:22+0800\n"
"PO-Revision-Date: 2015-02-07 14:15-0500\n"
"PO-Revision-Date: 2015-05-01 00:21+0100\n"
"Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
"X-Generator: Poedit 1.5.4\n"
"X-Generator: Poedit 1.7.6\n"
"X-Poedit-Basepath: ../\n"
"Language-Team: \n"
#: script/dropbox.js:64
msgid "Dropbox connection"
@@ -26,10 +26,12 @@ msgstr ""
msgid "connect game to dropbox local storage"
msgstr ""
# command
#: script/dropbox.js:70
msgid "connect"
msgstr ""
# command
#: script/dropbox.js:77 script/dropbox.js:109 script/dropbox.js:136
#: script/dropbox.js:167 script/engine.js:278 script/engine.js:311
msgid "cancel"
@@ -47,14 +49,17 @@ msgstr ""
msgid "your are connected to dropbox with account / email "
msgstr ""
# command
#: script/dropbox.js:95
msgid "save"
msgstr ""
# command
#: script/dropbox.js:99
msgid "load"
msgstr ""
# command
#: script/dropbox.js:104
msgid "signout"
msgstr ""
@@ -251,18 +256,22 @@ msgstr ""
msgid "Export / Import"
msgstr ""
# line 1
#: script/engine.js:265
msgid "export or import save data, for backing up"
msgstr ""
# line 2
#: script/engine.js:266
msgid "or migrating computers"
msgstr ""
# command
#: script/engine.js:270
msgid "export"
msgstr ""
# command
#: script/engine.js:274 script/engine.js:306
msgid "import"
msgstr ""
@@ -279,10 +288,12 @@ msgstr ""
msgid "this is irreversible."
msgstr ""
# command
#: script/engine.js:291 script/engine.js:377
msgid "yes"
msgstr ""
# command
#: script/engine.js:296 script/engine.js:382
msgid "no"
msgstr ""
@@ -299,6 +310,7 @@ msgstr ""
msgid "save this."
msgstr ""
# command
#: script/engine.js:342
msgid "got it"
msgstr ""
@@ -343,14 +355,18 @@ msgstr ""
msgid "lights on."
msgstr ""
# {0}: production/consumption unit
# {1}: number of seconds
#: script/engine.js:584
msgid "{0} per {1}s"
msgstr ""
# command
#: script/events.js:142
msgid "eat meat"
msgstr ""
# command
#: script/events.js:162
msgid "use meds"
msgstr ""
@@ -363,6 +379,7 @@ msgstr ""
msgid "stunned"
msgstr ""
# command
#: script/events.js:494 script/events/global.js:42 script/events/global.js:59
#: script/events/room.js:142 script/events/room.js:162
#: script/events/room.js:182 script/events/setpieces.js:25
@@ -512,6 +529,7 @@ msgstr ""
msgid "steelworker"
msgstr ""
# use plural if your language admits it (like "teeth" and "scales")
#: script/localization.js:36
msgid "bait"
msgstr ""
@@ -632,14 +650,17 @@ msgstr ""
msgid "weapons"
msgstr ""
# introduces available buildings
#: script/localization.js:74
msgid "build:"
msgstr ""
# introduces items which can be crafted
#: script/localization.js:75
msgid "craft:"
msgstr ""
# introduces list of marketable items
#: script/localization.js:76
msgid "buy:"
msgstr ""
@@ -700,6 +721,7 @@ msgstr ""
msgid "A Silent Forest"
msgstr ""
# command
#: script/outside.js:170
msgid "gather wood"
msgstr ""
@@ -724,10 +746,13 @@ msgstr ""
msgid "the town's booming. word does get around."
msgstr ""
# short for population
# mind the whitespace at the end!
#: script/outside.js:426
msgid "pop "
msgstr ""
# command
#: script/outside.js:517
msgid "check traps"
msgstr ""
@@ -760,10 +785,13 @@ msgstr ""
msgid "dry brush and dead branches litter the forest floor"
msgstr ""
# mind the whitespace at the end!
#: script/outside.js:596
msgid "the traps contain "
msgstr ""
# separates the last object found in traps.
# mind the whitespaces at the beginning and end!
#: script/outside.js:603
msgid " and "
msgstr ""
@@ -772,6 +800,7 @@ msgstr ""
msgid "A Dusty Path"
msgstr ""
# command
#: script/path.js:50
msgid "embark"
msgstr ""
@@ -792,6 +821,7 @@ msgstr ""
msgid "water"
msgstr ""
# Legend for free space when embarking
#: script/path.js:243 script/world.js:306
msgid "free {0}/{1}"
msgstr ""
@@ -996,6 +1026,7 @@ msgstr ""
msgid "the convoy can haul mostly everything"
msgstr ""
# short for "leather armour"
#: script/room.js:268
msgid "l armour"
msgstr ""
@@ -1004,6 +1035,7 @@ msgstr ""
msgid "leather's not strong. better than rags, though."
msgstr ""
# short for "iron armour"
#: script/room.js:280
msgid "i armour"
msgstr ""
@@ -1012,6 +1044,7 @@ msgstr ""
msgid "iron's stronger than leather"
msgstr ""
# short for "steel armour"
#: script/room.js:292
msgid "s armour"
msgstr ""
@@ -1052,18 +1085,22 @@ msgstr ""
msgid "A Dark Room"
msgstr ""
# command
#: script/room.js:507
msgid "light fire"
msgstr ""
# command
#: script/room.js:518
msgid "stoke fire"
msgstr ""
# introduces "room state"
#: script/room.js:557 script/room.js:568 script/room.js:716 script/room.js:720
msgid "the room is {0}"
msgstr ""
# introduces "fire state"
#: script/room.js:558 script/room.js:567 script/room.js:685
msgid "the fire is {0}"
msgstr ""
@@ -1074,42 +1111,52 @@ msgid ""
"things."
msgstr ""
# room state
#: script/room.js:593
msgid "freezing"
msgstr ""
# room state
#: script/room.js:594
msgid "cold"
msgstr ""
# room state
#: script/room.js:595
msgid "mild"
msgstr ""
# room state
#: script/room.js:596
msgid "warm"
msgstr ""
# room state
#: script/room.js:597
msgid "hot"
msgstr ""
# fire state
#: script/room.js:609
msgid "dead"
msgstr ""
# fire state
#: script/room.js:610
msgid "smoldering"
msgstr ""
# fire state
#: script/room.js:611
msgid "flickering"
msgstr ""
# fire state
#: script/room.js:612
msgid "burning"
msgstr ""
# fire state
#: script/room.js:613
msgid "roaring"
msgstr ""
@@ -1179,14 +1226,17 @@ msgstr ""
msgid "engine:"
msgstr ""
# command
#: script/ship.js:56
msgid "reinforce hull"
msgstr ""
# command
#: script/ship.js:66
msgid "upgrade engine"
msgstr ""
# command
#: script/ship.js:76 script/ship.js:152
msgid "lift off"
msgstr ""
@@ -1209,10 +1259,12 @@ msgstr ""
msgid "time to get out of this place. won't be coming back."
msgstr ""
# command to cancel "lift off" action
#: script/ship.js:160
msgid "linger"
msgstr ""
# mind the whitespace at the end!
#: script/space.js:45
msgid "hull: "
msgstr ""
@@ -1253,86 +1305,107 @@ msgstr ""
msgid "punch"
msgstr ""
# command for bone spear attack
#: script/world.js:54
msgid "stab"
msgstr ""
# command for iron sword attack
#: script/world.js:60
msgid "swing"
msgstr ""
# command for steel sword attack
#: script/world.js:66
msgid "slash"
msgstr ""
# command for bayonet attack
#: script/world.js:72
msgid "thrust"
msgstr ""
# command for rifle attack
#: script/world.js:78
msgid "shoot"
msgstr ""
# command for laser rifle attack
#: script/world.js:85
msgid "blast"
msgstr ""
# command for grenade attack
#: script/world.js:92
msgid "lob"
msgstr ""
# command for bolas attack
#: script/world.js:99
msgid "tangle"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:124
msgid "An&nbsp;Outpost"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:125
msgid "Iron&nbsp;Mine"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:126
msgid "Coal&nbsp;Mine"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:127
msgid "Sulphur&nbsp;Mine"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:128
msgid "An&nbsp;Old&nbsp;House"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:129
msgid "A&nbsp;Damp&nbsp;Cave"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:130
msgid "An&nbsp;Abandoned&nbsp;Town"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:131
msgid "A&nbsp;Ruined&nbsp;City"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:132
msgid "A&nbsp;Crashed&nbsp;Starship"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:133
msgid "A&nbsp;Borehole"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:134
msgid "A&nbsp;Battlefield"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:135
msgid "A&nbsp;Murky&nbsp;Swamp"
msgstr ""
# leave &nbsp; as whitespace
#: script/world.js:140
msgid "A&nbsp;Destroyed&nbsp;Village"
msgstr ""
@@ -1345,10 +1418,12 @@ msgstr ""
msgid "pockets"
msgstr ""
# short for health points
#: script/world.js:323
msgid "hp: {0}/{1}"
msgstr ""
# item counter when finding supplies
#: script/world.js:330
msgid "{0}:{1}"
msgstr ""
@@ -1606,10 +1681,12 @@ msgstr ""
msgid "a thief is caught"
msgstr ""
# command
#: script/events/global.js:21
msgid "hang him"
msgstr ""
# command
#: script/events/global.js:25
msgid "spare him"
msgstr ""
@@ -1647,10 +1724,12 @@ msgstr ""
msgid "some traps have been destroyed"
msgstr ""
# command
#: script/events/outside.js:26
msgid "track them"
msgstr ""
# command
#: script/events/outside.js:30 script/events/room.js:71
#: script/events/room.js:122
msgid "ignore them"
@@ -1664,6 +1743,7 @@ msgstr ""
msgid "the forest is silent."
msgstr ""
# command
#: script/events/outside.js:42 script/events/outside.js:59
#: script/events/outside.js:98 script/events/outside.js:115
#: script/events/outside.js:166 script/events/outside.js:183
@@ -1691,10 +1771,12 @@ msgstr ""
msgid "medicine is needed immediately."
msgstr ""
# command
#: script/events/outside.js:82
msgid "1 medicine"
msgstr ""
# command
#: script/events/outside.js:87
msgid "ignore it"
msgstr ""
@@ -1723,14 +1805,17 @@ msgstr ""
msgid "a terrible plague is fast spreading through the village."
msgstr ""
# command
#: script/events/outside.js:138
msgid "buy medicine"
msgstr ""
# command
#: script/events/outside.js:144
msgid "5 medicine"
msgstr ""
# command
#: script/events/outside.js:149
msgid "do nothing"
msgstr ""
@@ -1804,14 +1889,17 @@ msgstr ""
msgid "a nomad arrives, looking to trade"
msgstr ""
# command
#: script/events/room.js:20
msgid "buy scales"
msgstr ""
# command
#: script/events/room.js:25
msgid "buy teeth"
msgstr ""
# command
#: script/events/room.js:30
msgid "buy bait"
msgstr ""
@@ -1820,6 +1908,7 @@ msgstr ""
msgid "traps are more effective with bait."
msgstr ""
# command
#: script/events/room.js:39
msgid "buy compass"
msgstr ""
@@ -1828,6 +1917,7 @@ msgstr ""
msgid "the old compass is dented and dusty, but it looks to work."
msgstr ""
# command
#: script/events/room.js:46 script/events/room.js:227
#: script/events/room.js:240 script/events/room.js:253
#: script/events/room.js:305 script/events/room.js:324
@@ -1854,6 +1944,7 @@ msgstr ""
msgid "strange noises can be heard through the walls"
msgstr ""
# command
#: script/events/room.js:67 script/events/room.js:118
#: script/events/setpieces.js:1663
msgid "investigate"
@@ -1867,6 +1958,7 @@ msgstr ""
msgid "the sounds stop."
msgstr ""
# command
#: script/events/room.js:83 script/events/room.js:96
msgid "go back inside"
msgstr ""
@@ -1925,15 +2017,18 @@ msgstr ""
msgid "a beggar arrives"
msgstr ""
# command
#: script/events/room.js:204
msgid "give 50"
msgstr ""
# command
#: script/events/room.js:209 script/events/room.js:276
#: script/events/room.js:347
msgid "give 100"
msgstr ""
# command
#: script/events/room.js:214 script/events/room.js:286
#: script/events/room.js:466
msgid "turn him away"
@@ -1956,6 +2051,7 @@ msgstr ""
msgid "leaves some scraps of cloth behind."
msgstr ""
# this refers to both male and female wanderer events
#: script/events/room.js:262 script/events/room.js:333
msgid "The Mysterious Wanderer"
msgstr ""
@@ -1970,10 +2066,12 @@ msgstr ""
msgid "builder's not sure he's to be trusted."
msgstr ""
# this refers to both male and female wanderer events
#: script/events/room.js:272 script/events/room.js:343
msgid "a mysterious wanderer arrives"
msgstr ""
# command
#: script/events/room.js:281 script/events/room.js:352
msgid "give 500"
msgstr ""
@@ -1996,6 +2094,7 @@ msgstr ""
msgid "builder's not sure she's to be trusted."
msgstr ""
# command
#: script/events/room.js:357
msgid "turn her away"
msgstr ""
@@ -2024,6 +2123,7 @@ msgstr ""
msgid "a scout stops for the night"
msgstr ""
# command
#: script/events/room.js:418
msgid "buy map"
msgstr ""
@@ -2032,6 +2132,7 @@ msgstr ""
msgid "the map uncovers a bit of the world"
msgstr ""
# command
#: script/events/room.js:424
msgid "learn scouting"
msgstr ""
@@ -2052,6 +2153,7 @@ msgstr ""
msgid "an old wanderer arrives"
msgstr ""
# command
#: script/events/room.js:457
msgid "agree"
msgstr ""
@@ -2092,6 +2194,7 @@ msgstr ""
msgid "a sick man hobbles up"
msgstr ""
# command
#: script/events/room.js:530
msgid "give 1 medicine"
msgstr ""
@@ -2100,6 +2203,7 @@ msgstr ""
msgid "the man swallows the medicine eagerly"
msgstr ""
# command
#: script/events/room.js:536
msgid "tell him to leave"
msgstr ""
@@ -2154,6 +2258,7 @@ msgstr ""
msgid "a swamp festers in the stagnant air."
msgstr ""
# command
#: script/events/setpieces.js:44 script/events/setpieces.js:550
#: script/events/setpieces.js:607 script/events/setpieces.js:889
#: script/events/setpieces.js:1314 script/events/setpieces.js:1332
@@ -2169,6 +2274,7 @@ msgstr ""
msgid "an old wanderer sits inside, in a seeming trance."
msgstr ""
# command
#: script/events/setpieces.js:61
msgid "talk"
msgstr ""
@@ -2205,6 +2311,7 @@ msgstr ""
msgid "the earth here is split, as if bearing an ancient wound"
msgstr ""
# command
#: script/events/setpieces.js:101 script/events/setpieces.js:2949
#: script/events/setpieces.js:3463
msgid "go inside"
@@ -2214,6 +2321,7 @@ msgstr ""
msgid "a startled beast defends its home"
msgstr ""
# command
#: script/events/setpieces.js:135 script/events/setpieces.js:186
#: script/events/setpieces.js:229 script/events/setpieces.js:248
#: script/events/setpieces.js:281 script/events/setpieces.js:315
@@ -2247,6 +2355,7 @@ msgstr ""
msgid "continue"
msgstr ""
# command
#: script/events/setpieces.js:140 script/events/setpieces.js:157
#: script/events/setpieces.js:191 script/events/setpieces.js:234
#: script/events/setpieces.js:253 script/events/setpieces.js:286
@@ -2264,6 +2373,7 @@ msgstr ""
msgid "the walls are moist and moss-covered"
msgstr ""
# command
#: script/events/setpieces.js:153
msgid "squeeze"
msgstr ""
@@ -2342,6 +2452,7 @@ msgstr ""
msgid "the town lies abandoned, its citizens long dead"
msgstr ""
# command
#: script/events/setpieces.js:533 script/events/setpieces.js:1251
msgid "explore"
msgstr ""
@@ -2356,6 +2467,7 @@ msgstr ""
msgid "the double doors creak endlessly in the wind."
msgstr ""
# command
#: script/events/setpieces.js:555 script/events/setpieces.js:594
#: script/events/setpieces.js:612 script/events/setpieces.js:650
#: script/events/setpieces.js:689 script/events/setpieces.js:723
@@ -2538,6 +2650,7 @@ msgstr ""
msgid "the air is filled with dust, driven relentlessly by the hard winds."
msgstr ""
# command
#: script/events/setpieces.js:1271 script/events/setpieces.js:1287
#: script/events/setpieces.js:1303 script/events/setpieces.js:1319
#: script/events/setpieces.js:1336 script/events/setpieces.js:1374
@@ -2602,6 +2715,7 @@ msgstr ""
msgid "a huge lizard scrambles up out of the darkness of an old metro station."
msgstr ""
# command
#: script/events/setpieces.js:1369
msgid "descend"
msgstr ""
@@ -2998,6 +3112,7 @@ msgstr ""
msgid "with a little effort, it might fly again."
msgstr ""
# command
#: script/events/setpieces.js:3153
msgid "salvage"
msgstr ""
@@ -3018,6 +3133,7 @@ msgstr ""
msgid "a military perimeter is set up around the mine."
msgstr ""
# command
#: script/events/setpieces.js:3171 script/events/setpieces.js:3320
msgid "attack"
msgstr ""
@@ -3026,6 +3142,7 @@ msgstr ""
msgid "a soldier, alerted, opens fire."
msgstr ""
# command
#: script/events/setpieces.js:3214 script/events/setpieces.js:3254
#: script/events/setpieces.js:3357 script/events/setpieces.js:3391
msgid "run"
@@ -3142,6 +3259,7 @@ msgstr ""
msgid "there are still supplies inside."
msgstr ""
# command
#: script/events/setpieces.js:3557
msgid "take"
msgstr ""
@@ -3166,6 +3284,7 @@ msgstr ""
msgid "a fire has started"
msgstr ""
# command
#: script/events/outside.js:87
msgid "mourn"
msgstr ""
+1 -1
View File
File diff suppressed because one or more lines are too long
+63 -43
View File
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-02-07 20:22+0800\n"
"PO-Revision-Date: 2015-04-27 16:48+0100\n"
"PO-Revision-Date: 2015-04-30 22:02+0100\n"
"Last-Translator: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -43,11 +43,11 @@ msgstr "Esporta in/Importa da Dropbox"
#: script/dropbox.js:91
msgid "export or import save data to dropbox datastorage"
msgstr "esporta/importa i dati di salvataggio dalla memoria dati di Dropbox"
msgstr "esporta i dati di gioco su dropbox o carica i dati salvati"
#: script/dropbox.js:92
msgid "your are connected to dropbox with account / email "
msgstr "sei connesso a Dropbox con l'account / indirizzo e-mail"
msgstr "sei connesso a dropbox con l'account / indirizzo e-mail"
#: script/dropbox.js:95
msgid "save"
@@ -71,15 +71,15 @@ msgstr "salva in questa posizione"
#: script/dropbox.js:144
msgid "choose one slot to load from"
msgstr "scegli un salvataggio da caricare"
msgstr "scegli una posizione da cui caricare"
#: script/dropbox.js:151
msgid "load from slot"
msgstr "carica dal salvataggio"
msgstr "carica da questa posizione"
#: script/dropbox.js:183
msgid "successfully saved to dropbox datastorage"
msgstr "salvato correttamente nella memoria dati in Dropbox"
msgstr "salvato correttamente nella memoria dati dropbox"
#: script/dropbox.js:184
msgid "error while saving to dropbox datastorage"
@@ -99,7 +99,7 @@ msgstr "i pugni causano più danni"
#: script/engine.js:20
msgid "learned to throw punches with purpose"
msgstr "hai appreso come tirare pugni in modo efficace"
msgstr "si è appreso come tirare pugni con determinazione"
#: script/engine.js:23
msgid "martial artist"
@@ -111,7 +111,7 @@ msgstr "i pugni causano ancora più danni"
#: script/engine.js:25
msgid "learned to fight quite effectively without weapons"
msgstr "puoi combattere in modo abbastanza efficace senza armi"
msgstr "si è appreso come combattere in modo efficace senza armi"
#: script/engine.js:30
msgid "unarmed master"
@@ -123,7 +123,7 @@ msgstr "la velocità dei pugni raddoppia, e la forza aumenta ancora"
#: script/engine.js:32
msgid "learned to strike faster without weapons"
msgstr "hai imparato a colpire più veloce senza armi"
msgstr "si è appreso come colpire più veloce senza armi"
#: script/engine.js:35
msgid "barbarian"
@@ -135,7 +135,7 @@ msgstr "le armi bianche causano maggiori danni"
#: script/engine.js:37
msgid "learned to swing weapons with force"
msgstr "hai imparato a brandire le armi con forza"
msgstr "si è appreso come brandire le armi con forza"
#: script/engine.js:40
msgid "slow metabolism"
@@ -143,11 +143,11 @@ msgstr "metabolismo lento"
#: script/engine.js:41
msgid "go twice as far without eating"
msgstr "percorri il doppio della distanza senza mangiare"
msgstr " raddoppia la distanza percorsa senza mangiare"
#: script/engine.js:42
msgid "learned how to ignore the hunger"
msgstr "hai imparato ad ignorare la fame"
msgstr "si è appreso come ignorare la fame"
#: script/engine.js:45
msgid "desert rat"
@@ -155,11 +155,11 @@ msgstr "volpe del deserto"
#: script/engine.js:46
msgid "go twice as far without drinking"
msgstr "percorri il doppio della distanza senza bere"
msgstr "raddoppia la distanza percorsa senza bere"
#: script/engine.js:47
msgid "learned to love the dry air"
msgstr "hai imparato ad apprezzare il clima arido"
msgstr "si è imparato ad apprezzare il clima arido"
#: script/engine.js:50
msgid "evasive"
@@ -167,11 +167,11 @@ msgstr "elusivo"
#: script/engine.js:51
msgid "dodge attacks more effectively"
msgstr "puoi schivare più facilmente gli attacchi"
msgstr "gli attacchi vengono schivati più facilmente"
#: script/engine.js:52
msgid "learned to be where they're not"
msgstr "hai imparato a non essere raggiunto"
msgstr "si è appreso come non essere raggiunti"
#: script/engine.js:55
msgid "precise"
@@ -183,7 +183,7 @@ msgstr "i colpi vanno a segno più spesso"
#: script/engine.js:57
msgid "learned to predict their movement"
msgstr "hai imparato a prevedere i loro movimenti"
msgstr "si è appreso come prevedere i loro movimenti"
#: script/engine.js:60
msgid "scout"
@@ -191,11 +191,11 @@ msgstr "sentinella"
#: script/engine.js:61
msgid "see farther"
msgstr "vedi più lontano"
msgstr "il raggio visivo si estende"
#: script/engine.js:62
msgid "learned to look ahead"
msgstr "hai imparato a guardare avanti"
msgstr "si è imparato a guardare avanti"
#: script/engine.js:65
msgid "stealthy"
@@ -203,11 +203,11 @@ msgstr "furtivo"
#: script/engine.js:66
msgid "better avoid conflict in the wild"
msgstr "puoi evitare i combattimenti durante le esplorazioni"
msgstr "in esplorazione i combattimenti sono meno frequenti"
#: script/engine.js:67
msgid "learned how not to be seen"
msgstr "hai imparato a non farti vedere"
msgstr "si è appreso come non essere visti"
#: script/engine.js:70
msgid "gastronome"
@@ -215,11 +215,11 @@ msgstr "buongustaio"
#: script/engine.js:71
msgid "restore more health when eating"
msgstr "ripristina più salute quando mangi"
msgstr "si ripristina più salute mangiando"
#: script/engine.js:72
msgid "learned to make the most of food"
msgstr "hai imparato a trarre il massimo dal cibo"
msgstr "si è imparato a trarre il massimo dal cibo"
#: script/engine.js:142 script/engine.js:481
msgid "lights off."
@@ -291,7 +291,7 @@ msgstr "no"
#: script/engine.js:302
msgid "put the save code here."
msgstr "inserisci qui il codice di salvataggio."
msgstr "inserisci qui il codice del salvataggio."
#: script/engine.js:334
msgid "Export"
@@ -355,7 +355,7 @@ msgstr "mangia carne"
#: script/events.js:162
msgid "use meds"
msgstr "usa medicine"
msgstr "usa medicina"
#: script/events.js:360 script/events.js:405
msgid "miss"
@@ -472,7 +472,7 @@ msgstr "granata"
#: script/localization.js:25
msgid "bolas"
msgstr "funi da cattura"
msgstr "laccio da cattura"
#: script/localization.js:26
msgid "bayonet"
@@ -516,7 +516,7 @@ msgstr "oper. acciaieria"
#: script/localization.js:36
msgid "bait"
msgstr "esca"
msgstr "esche"
#: script/localization.js:37 script/localization.js:44
msgid "cured meat"
@@ -884,7 +884,7 @@ msgstr "un mercato renderebbe gli scambi più facili"
msgid ""
"now the nomads have a place to set up shop, they might stick around a while"
msgstr ""
"ora che i nomadi hanno un posto dove esporre le loro merci, potrebbero "
"ora che i nomadi hanno un posto dove esporre le loro merci, potranno "
"fermarsi per un po'"
#: script/room.js:94
@@ -970,7 +970,7 @@ msgstr "otre"
#: script/room.js:183
msgid "this waterskin'll hold a bit of water, at least"
msgstr "l'otre può trasportare un po' d'acqua, almeno"
msgstr "l'otre basterà a trasportare un po' d'acqua"
#: script/room.js:191
msgid "cask"
@@ -986,7 +986,7 @@ msgstr "cisterna"
#: script/room.js:208
msgid "never go thirsty again"
msgstr "non soffrirai mai più la sete"
msgstr "non si soffrirà mai più la sete"
#: script/room.js:217
msgid "bone spear"
@@ -1123,7 +1123,7 @@ msgstr "calda"
#: script/room.js:609
msgid "dead"
msgstr "è estinto"
msgstr "è spento"
#: script/room.js:610
msgid "smoldering"
@@ -1156,7 +1156,7 @@ msgstr "il legname è finito"
#: script/room.js:688
msgid "the light from the fire spills from the windows, out into the dark"
msgstr ""
"la luce della fiamma si riversa dalla finestra, rischiarando l'oscurità "
"la luce della fiamma si riversa dalla finestra, rischiarando il buio "
"circostante"
#: script/room.js:701
@@ -1246,7 +1246,7 @@ msgstr "è giunto il tempo di lasciare questo posto. non ci sarà ritorno."
#: script/ship.js:160
msgid "linger"
msgstr "indugiare"
msgstr "indugia"
#: script/space.js:45
msgid "hull: "
@@ -1310,7 +1310,7 @@ msgstr "spara"
#: script/world.js:85
msgid "blast"
msgstr "laser"
msgstr "disintegra"
#: script/world.js:92
msgid "lob"
@@ -1897,7 +1897,7 @@ msgstr "la vecchia bussola appare ammaccata e polverosa, ma sembra funzionare."
#: script/events/room.js:568 script/events/room.js:584
#: script/events/room.js:595
msgid "say goodbye"
msgstr "digli addio"
msgstr "augura buon viaggio"
#: script/events/room.js:53 script/events/room.js:104
msgid "Noises"
@@ -1905,7 +1905,7 @@ msgstr "Rumori"
#: script/events/room.js:60
msgid "through the walls, shuffling noises can be heard."
msgstr "oltre i muri, si sente il rumore di qualcosa che viene spostato."
msgstr "oltre i muri, si sente rumore di qualcosa che viene spostato."
#: script/events/room.js:61
msgid "can't tell what they're up to."
@@ -1913,7 +1913,7 @@ msgstr "non si può dire a cosa sia dovuto."
#: script/events/room.js:63
msgid "strange noises can be heard through the walls"
msgstr "strani rumori si possono sentire oltre i muri"
msgstr "si sentono strani rumori oltre i muri"
#: script/events/room.js:67 script/events/room.js:118
#: script/events/setpieces.js:1663
@@ -2022,7 +2022,7 @@ msgstr "lascia in cambio alcuni scampoli di stoffa."
#: script/events/room.js:262 script/events/room.js:333
msgid "The Mysterious Wanderer"
msgstr "Il Ramingo Misterioso"
msgstr "Raminghi Misteriosi"
#: script/events/room.js:269
msgid ""
@@ -2038,7 +2038,7 @@ msgstr "la costruttrice non è sicura che costui sia degno di fiducia."
#: script/events/room.js:272 script/events/room.js:343
msgid "a mysterious wanderer arrives"
msgstr "arriva un ramingo misterioso"
msgstr "arrivano raminghi misteriosi"
#: script/events/room.js:281 script/events/room.js:352
msgid "give 500"
@@ -2078,11 +2078,11 @@ msgstr "la raminga misteriosa ritorna, il suo carretto trabocca di pellame."
#: script/events/room.js:404
msgid "The Scout"
msgstr "La Sentinella"
msgstr "L'Esploratrice"
#: script/events/room.js:411
msgid "the scout says she's been all over."
msgstr "la sentinella dice di essere stata ovunque"
msgstr "l'esploratrice dice di essere stata ovunque"
#: script/events/room.js:412
msgid "willing to talk about it, for a price."
@@ -2090,7 +2090,7 @@ msgstr "ha voglia di parlarne, per il giusto prezzo."
#: script/events/room.js:414
msgid "a scout stops for the night"
msgstr "una sentinella si ferma per la notte"
msgstr "un'esploratrice si ferma per la notte"
#: script/events/room.js:418
msgid "buy map"
@@ -2158,7 +2158,7 @@ msgstr "implora che gli si dia una medicina."
#: script/events/room.js:526
msgid "a sick man hobbles up"
msgstr "un ammalato arriva zoppicando"
msgstr "un uomo malato arriva zoppicando"
#: script/events/room.js:530
msgid "give 1 medicine"
@@ -3282,3 +3282,23 @@ msgstr "tutto il lavoro della generazione passata è ancora qui."
#: script/events/setpieces.js:3565
msgid "ripe for the picking."
msgstr "pronto per essere raccolto."
#: script/events/outside.js:74
msgid "a fire rampages through one of the huts, destroying it."
msgstr "un incendio divampa in una delle capanne, distruggendola."
#: script/events/outside.js:75
msgid "all residents in the hut perished in the fire."
msgstr "tutti quelli che vivevano nella capanna sono morti nell'incendio"
#: script/events/outside.js:77
msgid "a fire has started"
msgstr "è scoppiato un incendio"
#: script/events/outside.js:87
msgid "mourn"
msgstr "piangi i defunti"
#: script/events/outside.js:88
msgid "some villagers have died"
msgstr "alcuni paesani sono morti"
+85 -70
View File
@@ -1,15 +1,15 @@
(function() {
var Engine = window.Engine = {
SITE_URL: encodeURIComponent("http://adarkroom.doublespeakgames.com"),
VERSION: 1.3,
MAX_STORE: 99999999999999,
SAVE_DISPLAY: 30 * 1000,
GAME_OVER: false,
//object event types
topics: {},
Perks: {
'boxer': {
name: _('boxer'),
@@ -69,7 +69,7 @@
notify: _('learned to make the most of food')
}
},
options: {
state: null,
debug: false,
@@ -77,7 +77,7 @@
dropbox: false,
doubleTime: false
},
init: function(options) {
this.options = $.extend(
this.options,
@@ -85,31 +85,31 @@
);
this._debug = this.options.debug;
this._log = this.options.log;
// Check for HTML5 support
if(!Engine.browserValid()) {
window.location = 'browserWarning.html';
}
// Check for mobile
if(Engine.isMobile()) {
window.location = 'mobileWarning.html';
}
Engine.disableSelection();
if(this.options.state != null) {
window.State = this.options.state;
} else {
Engine.loadGame();
}
$('<div>').attr('id', 'locationSlider').appendTo('#main');
var menu = $('<div>')
.addClass('menu')
.appendTo('body');
if(typeof langs != 'undefined'){
var customSelect = $('<span>')
.addClass('customSelect')
@@ -123,7 +123,7 @@
$('<li>')
.text("language.")
.appendTo(optionsList);
$.each(langs, function(name,display){
$('<li>')
.text(display)
@@ -140,15 +140,9 @@
.appendTo(menu);
$('<span>')
.addClass('menuBtn')
.addClass('hyper menuBtn')
.text(_('hyper.'))
.click(function(){
Engine.options.doubleTime = !Engine.options.doubleTime;
if(Engine.options.doubleTime)
$(this).text(_('classic.'));
else
$(this).text(_('hyper.'));
})
.click(Engine.triggerHyperMode)
.appendTo(menu);
$('<span>')
@@ -156,7 +150,7 @@
.text(_('restart.'))
.click(Engine.confirmDelete)
.appendTo(menu);
$('<span>')
.addClass('menuBtn')
.text(_('share.'))
@@ -178,7 +172,7 @@
.click(Engine.Dropbox.startDropbox)
.appendTo(menu);
}
$('<span>')
.addClass('menuBtn')
.text(_('app store.'))
@@ -190,7 +184,7 @@
.text(_('github.'))
.click(function() { window.open('https://github.com/doublespeakgames/adarkroom'); })
.appendTo(menu);
// Register keypress handlers
$('body').off('keydown').keydown(Engine.keyDown);
$('body').off('keyup').keyup(Engine.keyUp);
@@ -201,7 +195,7 @@
swipeElement.on('swiperight', Engine.swipeRight);
swipeElement.on('swipeup', Engine.swipeUp);
swipeElement.on('swipedown', Engine.swipeDown);
// subscribe to stateUpdates
$.Dispatch('stateUpdate').subscribe(Engine.handleStateUpdates);
@@ -209,7 +203,7 @@
Notifications.init();
Events.init();
Room.init();
if(typeof $SM.get('stores.wood') != 'undefined') {
Outside.init();
}
@@ -219,20 +213,28 @@
if($SM.get('features.location.spaceShip')) {
Ship.init();
}
if($SM.get('config.lightsOff', true)){
Engine.turnLightsOff();
}
if($SM.get('config.hyperMode', true)){
Engine.triggerHyperMode();
}
Engine.saveLanguage();
Engine.travelTo(Room);
},
browserValid: function() {
return ( location.search.indexOf( 'ignorebrowser=true' ) >= 0 || ( typeof Storage != 'undefined' && !oldIE ) );
},
isMobile: function() {
return ( location.search.indexOf( 'ignorebrowser=true' ) < 0 && /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test( navigator.userAgent ) );
},
saveGame: function() {
if(typeof Storage != 'undefined' && localStorage) {
if(Engine._saveTimer != null) {
@@ -245,7 +247,7 @@
localStorage.gameState = JSON.stringify(State);
}
},
loadGame: function() {
try {
var savedState = JSON.parse(localStorage.gameState);
@@ -260,7 +262,7 @@
Engine.event('progress', 'new game');
}
},
exportImport: function() {
Events.startEvent({
title: _('Export / Import'),
@@ -370,7 +372,7 @@
ga('send', 'event', cat, act);
}
},
confirmDelete: function() {
Events.startEvent({
title: _('Restart?'),
@@ -392,7 +394,7 @@
}
});
},
deleteSave: function(noReload) {
if(typeof Storage != 'undefined' && localStorage) {
var prestige = Prestige.get();
@@ -404,7 +406,7 @@
location.reload();
}
},
share: function() {
Events.startEvent({
title: _('Share'),
@@ -470,22 +472,35 @@
}
return false;
},
turnLightsOff: function() {
var darkCss = Engine.findStylesheet('darkenLights');
if (darkCss == null) {
$('head').append('<link rel="stylesheet" href="css/dark.css" type="text/css" title="darkenLights" />');
$('.lightsOff').text(_('lights on.'));
$SM.set('config.lightsOff', true, true);
} else if (darkCss.disabled) {
darkCss.disabled = false;
$('.lightsOff').text(_('lights on.'));
$SM.set('config.lightsOff', true,true);
} else {
$("#darkenLights").attr("disabled", "disabled");
darkCss.disabled = true;
$('.lightsOff').text(_('lights off.'));
$SM.set('config.lightsOff', false, true);
}
},
triggerHyperMode: function(){
Engine.options.doubleTime = !Engine.options.doubleTime;
if(Engine.options.doubleTime)
$('.hyper').text(_('classic.'));
else
$('.hyper').text(_('hyper.'));
$SM.set('config.hyperMode', Engine.options.doubleTime, false);
},
// Gets a guid
getGuid: function() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
@@ -493,9 +508,9 @@
return v.toString(16);
});
},
activeModule: null,
travelTo: function(module) {
if(Engine.activeModule != module) {
var currentIndex = Engine.activeModule ? $('.location').index(Engine.activeModule.panel) : 1;
@@ -512,7 +527,7 @@
// FIXME Why does this work if there's an animation queue...?
stores.animate({right: -(panelIndex * 700) + 'px'}, 300 * diff);
}
Engine.activeModule = module;
module.onArrival(diff);
@@ -530,7 +545,7 @@
}
Notifications.printQueue(module);
}
},
@@ -557,33 +572,33 @@
top: top_container.height() + 26 + 'px'
},
{
queue: false,
queue: false,
duration: 300 * transition_diff
});
}
},
log: function(msg) {
if(this._log) {
console.log(msg);
}
},
updateSlider: function() {
var slider = $('#locationSlider');
slider.width((slider.children().length * 700) + 'px');
},
updateOuterSlider: function() {
var slider = $('#outerSlider');
slider.width((slider.children().length * 700) + 'px');
},
getIncomeMsg: function(num, delay) {
return _("{0} per {1}s", (num > 0 ? "+" : "") + num, delay);
//return (num > 0 ? "+" : "") + num + " per " + delay + "s";
},
keyDown: function(e) {
e = e || window.event;
if(!Engine.keyPressed && !Engine.keyLock) {
@@ -594,7 +609,7 @@
}
return jQuery.inArray(e.keycode, [37,38,39,40]) < 0;
},
keyUp: function(e) {
Engine.pressed = false;
if(Engine.activeModule.keyUp) {
@@ -645,7 +660,7 @@
break;
}
}
return false;
},
@@ -682,15 +697,15 @@
document.onselectstart = eventPassthrough;
document.onmousedown = eventPassthrough;
},
autoSelect: function(selector) {
$(selector).focus().select();
},
handleStateUpdates: function(e){
},
switchLanguage: function(dom){
var lang = $(dom).data("language");
if(document.location.href.search(/[\?\&]lang=[a-z_]+/) != -1){
@@ -699,9 +714,9 @@
document.location.href = document.location.href + ( (document.location.href.search(/\?/) != -1 )?"&":"?") + "lang="+lang;
}
},
saveLanguage: function(){
var lang = decodeURIComponent((new RegExp('[?|&]lang=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
var lang = decodeURIComponent((new RegExp('[?|&]lang=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
if(lang && typeof Storage != 'undefined' && localStorage) {
localStorage.lang = lang;
}
@@ -732,32 +747,32 @@
function inView(dir, elem){
var scTop = $('#main').offset().top;
var scBot = scTop + $('#main').height();
var scTop = $('#main').offset().top;
var scBot = scTop + $('#main').height();
var elTop = elem.offset().top;
var elBot = elTop + elem.height();
var elTop = elem.offset().top;
var elBot = elTop + elem.height();
if( dir == 'up' ){
// STOP MOVING IF BOTTOM OF ELEMENT IS VISIBLE IN SCREEN
return ( elBot < scBot );
}else if( dir == 'down' ){
return ( elTop > scTop );
}else{
return ( ( elBot <= scBot ) && ( elTop >= scTop ) );
}
if( dir == 'up' ){
// STOP MOVING IF BOTTOM OF ELEMENT IS VISIBLE IN SCREEN
return ( elBot < scBot );
}else if( dir == 'down' ){
return ( elTop > scTop );
}else{
return ( ( elBot <= scBot ) && ( elTop >= scTop ) );
}
}
function scrollByX(elem, x){
var elTop = parseInt( elem.css('top'), 10 );
elem.css( 'top', ( elTop + x ) + "px" );
var elTop = parseInt( elem.css('top'), 10 );
elem.css( 'top', ( elTop + x ) + "px" );
}
//create jQuery Callbacks() to handle object events
//create jQuery Callbacks() to handle object events
$.Dispatch = function( id ) {
var callbacks, topic = id && Engine.topics[ id ];
if ( !topic ) {
+66 -65
View File
@@ -1,52 +1,53 @@
/*
* Module for handling States
*
*
* All states should be get and set through the StateManager ($SM).
*
*
* The manager is intended to handle all needed checks and error catching.
* This includes creating the parents of layered/deep states so undefined states
* do not need to be tested for and created beforehand.
*
*
* When a state is changed, an update event is sent out containing the name of the state
* changed or in the case of multiple changes (.setM, .addM) the parent class changed.
* Event: type: 'stateUpdate', stateName: <path of state or parent state>
*
*
* Original file created by: Michael Galusha
*/
var StateManager = {
MAX_STORE: 99999999999999,
options: {},
init: function(options) {
this.options = $.extend(
this.options,
options
);
//create categories
var cats = [
'features', //big features like buildings, location availability, unlocks, etc
'stores', //little stuff, items, weapons, etc
'character', //this is for player's character stats such as perks
'features', //big features like buildings, location availability, unlocks, etc
'stores', //little stuff, items, weapons, etc
'character', //this is for player's character stats such as perks
'income',
'timers',
'game', //mostly location related: fire temp, workers, population, world map, etc
'playStats', //anything play related: play time, loads, etc
'previous', // prestige, score, trophies (in future), achievements (again, not yet), etc
'outfit' // used to temporarily store the items to be taken on the path
'game', //mostly location related: fire temp, workers, population, world map, etc
'playStats', //anything play related: play time, loads, etc
'previous', // prestige, score, trophies (in future), achievements (again, not yet), etc
'outfit', // used to temporarily store the items to be taken on the path
'config'
];
for(var which in cats) {
if(!$SM.get(cats[which])) $SM.set(cats[which], {});
if(!$SM.get(cats[which])) $SM.set(cats[which], {});
}
//subscribe to stateUpdates
$.Dispatch('stateUpdate').subscribe($SM.handleStateUpdates);
},
//create all parents and then set state
createState: function(stateName, value) {
var words = stateName.split(/[.\[\]'"]+/);
@@ -67,51 +68,51 @@ var StateManager = {
obj[words[i]] = value;
return obj;
},
//set single state
//if noEvent is true, the update event won't trigger, useful for setting multiple states first
set: function(stateName, value, noEvent) {
var fullPath = $SM.buildPath(stateName);
//make sure the value isn't over the engine maximum
if(typeof value == 'number' && value > $SM.MAX_STORE) value = $SM.MAX_STORE;
try{
eval('('+fullPath+') = value');
} catch (e) {
//parent doesn't exist, so make parent
$SM.createState(stateName, value);
}
//stores values can not be negative
if(stateName.indexOf('stores') === 0 && $SM.get(stateName, true) < 0) {
eval('('+fullPath+') = 0');
Engine.log('WARNING: state:' + stateName + ' can not be a negative value. Set to 0 instead.');
}
if(!noEvent) {
Engine.saveGame();
$SM.fireUpdate(stateName);
}
}
},
//sets a list of states
setM: function(parentName, list, noEvent) {
$SM.buildPath(parentName);
//make sure the state exists to avoid errors,
if($SM.get(parentName) === undefined) $SM.set(parentName, {}, true);
for(var k in list){
$SM.set(parentName+'["'+k+'"]', list[k], true);
}
if(!noEvent) {
Engine.saveGame();
$SM.fireUpdate(parentName);
}
},
//shortcut for altering number values, return 1 if state wasn't a number
add: function(stateName, value, noEvent) {
var err = 0;
@@ -119,7 +120,7 @@ var StateManager = {
//could also add in a true = 1 thing, to have something go from existing (true)
//to be a count, but that might be unwanted behavior (add with loose eval probably will happen anyways)
var old = $SM.get(stateName, true);
//check for NaN (old != old) and non number values
if(old != old){
Engine.log('WARNING: '+stateName+' was corrupted (NaN). Resetting to 0.');
@@ -131,52 +132,52 @@ var StateManager = {
} else {
$SM.set(stateName, old + value, noEvent); //setState handles event and save
}
return err;
},
//alters multiple number values, return number of fails
addM: function(parentName, list, noEvent) {
var err = 0;
//make sure the parent exists to avoid errors
if($SM.get(parentName) === undefined) $SM.set(parentName, {}, true);
for(var k in list){
if($SM.add(parentName+'["'+k+'"]', list[k], true)) err++;
}
if(!noEvent) {
Engine.saveGame();
$SM.fireUpdate(parentName);
}
return err;
},
//return state, undefined or 0
get: function(stateName, requestZero) {
var whichState = null;
var fullPath = $SM.buildPath(stateName);
//catch errors if parent of state doesn't exist
try{
eval('whichState = ('+fullPath+')');
} catch (e) {
whichState = undefined;
}
//prevents repeated if undefined, null, false or {}, then x = 0 situations
if((!whichState || whichState == {}) && requestZero) return 0;
else return whichState;
},
//mainly for local copy use, add(M) can fail so we can't shortcut them
//since set does not fail, we know state exists and can simply return the object
setget: function(stateName, value, noEvent){
$SM.set(stateName, value, noEvent);
return eval('('+$SM.buildPath(stateName)+')');
},
remove: function(stateName, noEvent) {
var whichState = $SM.buildPath(stateName);
try{
@@ -190,21 +191,21 @@ var StateManager = {
$SM.fireUpdate(stateName);
}
},
//creates full reference from input
//hopefully this won't ever need to be more complicated
buildPath: function(input){
var dot = (input.charAt(0) == '[')? '' : '.'; //if it starts with [foo] no dot to join
return 'State' + dot + input;
},
fireUpdate: function(stateName, save){
var category = $SM.getCategory(stateName);
if(stateName == undefined) stateName = category = 'all'; //best if this doesn't happen as it will trigger more stuff
$.Dispatch('stateUpdate').publish({'category': category, 'stateName':stateName});
if(save) Engine.saveGame();
},
getCategory: function(stateName){
var firstOB = stateName.indexOf('[');
var firstDot = stateName.indexOf('.');
@@ -220,7 +221,7 @@ var StateManager = {
return stateName.substr(0,cutoff);
}
},
//Use this function to make old save games compatible with new version
updateOldState: function(){
var version = $SM.get('version');
@@ -299,7 +300,7 @@ var StateManager = {
$SM.set('version', 1.3);
}
},
/******************************************************************
* Start of specific state functions
******************************************************************/
@@ -308,11 +309,11 @@ var StateManager = {
$SM.set('character.perks["'+name+'"]', true);
Notifications.notify(null, Engine.Perks[name].notify);
},
hasPerk: function(name) {
return $SM.get('character.perks["'+name+'"]');
},
//INCOME
setIncome: function(source, options) {
var existing = $SM.get('income["'+source+'"]');
@@ -321,7 +322,7 @@ var StateManager = {
}
$SM.set('income["'+source+'"]', options);
},
getIncome: function(source) {
var existing = $SM.get('income["'+source+'"]');
if(typeof existing != 'undefined') {
@@ -329,7 +330,7 @@ var StateManager = {
}
return {};
},
collectIncome: function() {
var changed = false;
if(typeof $SM.get('income') != 'undefined' && Engine.activeModule != Space) {
@@ -340,21 +341,21 @@ var StateManager = {
income.timeLeft = 0;
}
income.timeLeft--;
if(income.timeLeft <= 0) {
Engine.log('collection income from ' + source);
if(source == 'thieves') $SM.addStolen(income.stores);
if(source == 'thieves') $SM.addStolen(income.stores);
var cost = income.stores;
var ok = true;
if (source != 'thieves') {
for (var k in cost) {
var have = $SM.get('stores["' + k + '"]', true);
if (have + cost[k] < 0) {
ok = false;
break;
}
}
for (var k in cost) {
var have = $SM.get('stores["' + k + '"]', true);
if (have + cost[k] < 0) {
ok = false;
break;
}
}
}
if(ok){
@@ -372,7 +373,7 @@ var StateManager = {
}
Engine._incomeTimeout = setTimeout($SM.collectIncome, 1000);
},
//Thieves
addStolen: function(stores) {
for(var k in stores) {
@@ -386,7 +387,7 @@ var StateManager = {
}
}
},
startThieves: function() {
$SM.set('game.thieves', 1);
$SM.setIncome('thieves', {
@@ -398,7 +399,7 @@ var StateManager = {
}
});
},
//Misc
num: function(name, craftable) {
switch(craftable.type) {
@@ -411,10 +412,10 @@ var StateManager = {
return $SM.get('game.buildings["'+name+'"]', true);
}
},
handleStateUpdates: function(e){
}
}
};
//alias