Commit Graph

50 Commits

Author SHA1 Message Date
jorsi 17b21bec08 add rough songs for outside 2020-05-31 23:29:53 -04:00
jorsi 18e8af9809 refactor audio-related code to use AudioLibrary module 2020-05-30 23:33:10 -04:00
jorsi a340584136 create AudioLibrary module to consolidate audio 2020-05-30 23:03:46 -04:00
jorsi 1d84e5f85c connect majority actions to sound effects;add more placeholder loops and effects 2020-05-30 19:48:44 -04:00
jorsi 7df62849ea add outline of outside audio 2020-05-29 18:12:40 -04:00
jorsi 12c6559802 add basic outline of audio for room 2020-05-29 17:53:18 -04:00
jorsi 978f53d40b rough implementation for changing background music 2020-05-29 13:59:58 -04:00
Lucas Lois a903a1c9fe Made outside.js jshint compliant 2016-10-02 17:45:09 -03:00
Andrea Rendine 65d7cfd784 Hyper-proof cooldown state
Kept the distinction between "argument" time and script time. I called the latter "time" instead of "milliseconds" because, well, it's just tenth of seconds.
Residual timeout is always stored in "nominal" time, not adjusted by hyper. I.e. if a button has a nominal timeout of 60 seconds and half cooldown had expired on reload, residual is stored as 300. In cooldown, Engine.setInterval makes the time flow with double speed
2015-06-29 12:49:57 -04:00
Andrea Rendine cb717b41d0 function for fire hut event and more
Effect of hut fire is associated with new Outside method .destroyHuts().
2015-06-27 00:44:26 -04:00
Andrea Rendine c4535c029a Alphabetical order for workers
I had missed this completely. Workers are listed in alphabetical order in English. Now they are ordered in other languages too.

Alphabetical order for outfit
2015-06-26 23:42:11 -04:00
Andrea Rendine 92f7cf683e Unified legend
Legends on boxes and lists are currently added via CSS and as stylesheets cannot be localised, translated strings rely upon an additional inline CSS.
This commit inserts localised legends as "data-legend" attributes on proper elements, and then this attribute is shown by stylesheet rule content: attr(data-legend). No need of localisation script and more compact CSS rules.
2015-06-26 22:10:02 -04:00
Andrea Rendine 93649307f6 Non-overlapping up/down buttons
Fixed dimensions and margins for up/down arrows.
2015-06-26 21:54:41 -04:00
Andrea Rendine ebf5e6934e Correct DOM positions for village, store, perks box
I noticed a minor glitch with the Village box position in the DOM. As it is appended to the Outside panel, it can end up after the Wood gather button or after the Traps check. It depends on whether the latter exists or not.
I changed it a little. Now it is "prepended" (thanks jQuery!), so it's always before any other content in the panel.
It would mind e.g. for CSS consistency, as you could decide to use a style for sibling buttons and it wouldn't work unless the box is placed before or after (not between) them.

For consistency with Outside box placement issue, stores are prepended to the Room panel, as first content in the DOM tree.

For consistency with Outside box placement issue, perks are prepended to the Path panel, as first content in the DOM tree.
2015-05-13 12:01:32 -04:00
Andrea Rendine f0e0548116 Var
Working ina hurry is bad.
2015-04-30 17:27:50 +02:00
Andrea Rendine 4efb22b890 Fixed variable name
Actually in this case "name" is used in a function and is not necessary for lookups, but I think that if future changes to both room.js and outside.js occur, authors will appreciate consistency in scripts (also fixes indentation in comments).
2015-04-30 17:11:24 +02:00
Michael Townsend 5c37074c2d Merge pull request #346 from AndySky21/buildings-az-sorting
Buildings alphabetical sorting
2015-04-30 09:45:26 -04:00
Andrea Rendine c2f8ac89fa Correct jobs incomes on load
Currently, when a game is loaded, job production/consumption rates in tooltips are shown based on the unit, rather than multiplied by the employed village number. Incomes are then corrected when the numbers change.
With the initial call of updateVillageIncome() function, the correct numbers are displayed when the game is opened and loaded.
2015-04-30 00:01:36 +02:00
Andrea Rendine 9c1ebecda7 Buildings alphabetical sorting
The bulk of this small change was to sort buildings by alphabetical order according to translated names, instead of english strings.
This meant removing the ID splitting as well as hyphen/space replacing, as the ID is not considered for the test.
Also changed:
1. line 366: as the original english string is no longer necessary in the iteration, "name" takes the value of translated string. "name" is then used for alphabetical comparison (as before) with the right value.
2. line 378: removed the test on curPrev variable. Items already listed have been placed in alphabetical order, so there is no need to check whether each item actually follows value of control variable.
2015-04-29 23:52:58 +02:00
Blake Grotewold f998c270da Merge anubisthejackle:issue115
Closes #115
Closes #224
2015-02-14 17:14:22 -05:00
Travis Weston 6ee6470972 Merging updates 2015-02-11 18:55:27 -05:00
Travis Weston f2b8ad6268 Merge remote-tracking branch 'upstream/master' into issue115
Conflicts:
	script/outside.js
	script/path.js
2015-02-10 07:11:10 -05:00
Blake Grotewold c87541b8b9 Merge pull request #222 from anubisthejackle/issue80 2015-02-09 19:37:10 -05:00
Travis Weston 6e044292ae Add in doubleTime capabilities
Add hyper / classic to menu
2015-02-09 19:31:24 -05:00
Robert Gravina 67b3c7fb7e Low-risk fixes suggested by JSHint. 2015-02-09 19:20:29 -05:00
Travis Weston 2d3daa572d Move movement functions to Engine. Create scrollable Path sidebar 2015-02-07 14:00:32 -05:00
Travis Weston 3d00ed3c40 Add scrolling via keyboard 2015-02-07 11:19:37 -05:00
Michael Townsend 64e193666d Merge pull request #177 from ThiloVoigt555/german_translation_update
German translation update
2014-11-10 13:28:49 -05:00
ThiloVoigt555 ba5bb193aa Added some new translator comments about whitespaces 2014-11-06 16:07:59 +01:00
ThiloVoigt555 b512153d73 Add TRANSLATORS comments
This will better help the translators as they complete the difficult task
of taking one language and finding commonality in another.

Closes #165
Closes #161
2014-10-28 10:15:09 -04:00
Travis Weston d351e4c815 Merge remote-tracking branch 'upstream/master'
Conflicts:
	script/engine.js
	script/localization.js
2014-07-13 12:52:29 -04:00
Travis Weston 53c9dc715b Fixed whitespace conformity in outside.js 2014-07-13 11:18:33 -04:00
Olexandr Nesterenko 7fb0ae8f02 Fix string 2014-06-19 10:18:56 +03:00
Vanadar c7ad5384f4 suite des trads 2014-02-07 18:26:03 +01:00
Vanadar 7ac28eeb1a suites des trads 2014-02-05 17:06:30 +01:00
vanadar f986e0323e Start trad fr 2014-02-04 22:27:00 +01:00
Michael a24d492681 Fixed a bug with the page title. 2013-10-29 18:39:00 -04:00
Michael dde477aade Some general code cleanup. 2013-10-10 20:53:53 -04:00
LucidCrux 99800f1abd refactor Outside to use $SM + Room bugfix, \' to "
Refactoring of Outside.js to take better advantage of $SM and simplify
the code.

Includes a small bug fix to Room update handler

Also changed instances of escaped single quote (\') to double (") for
readability and simplicity.

====state changes====
//these were changed for the opposite reason the Room states were. These
seem like states that other locations and events may very well want to
interact with and possibly alter themselves
game.outside.buildings >> game.buildings 
game.outside.population >> game.population
game.outside.workders >> game.workers


====functions removed====
Outside.numBuilding // just a $SM.get, no shortcut really needed since
Outside.numBuilding is a pretty long name
Outside.getPopulation // same here
Outside.addBuilding // just an add
Outside.addBuildings // just addM, but wasn't even actually used


====functions refactored====
Outside.killVillagers //moved updates to handler
Outside.updateWorkersView //added local to reduce gets
Outside.increasePopulation //updates moved to handler
Outside.increaseWorker // updates moved to handler
Outside.decreaseWorkder // updates moved to handler
2013-07-26 19:21:12 -06:00
LucidCrux 99d57efdc1 bug fix Outside.init > set features.location.outside to true 2013-07-25 20:33:04 -06:00
LucidCrux f4520bce91 speed up and bug fix 2013-07-25 02:00:41 -06:00
LucidCrux 2018ca3ae8 create and configure callback handlers for state updates
add $.Dispatch to handle object events
add subscribe calls to files
update SM fireUpdate to use new Dispatch

There are some NaN issues right now, no time to bug hunt right now, it
does kind of function though
2013-07-24 18:33:06 -06:00
LucidCrux dee7cbb9b3 refactor Engine.js for use with $SM
====functions removed====
//I just removed these because most were simpler or at least equal as
	direct $SM get/set/add calls, I realize the store ones are kind of
	subjective since calls were about equal, but oh well. If someone
	really 	feels we need the shortcut/named functions for manipulating
	stores specifically, it shouldn't be crazy to reimplement in $SM 
Engine.setStore >> $SM.set
Engine.setStores >> $SM.setM
Engine.addStore >> $SM.add
Engine.addStores >> $SM.addM
Engine.getStore >> $SM.get(requestZero = true)
Engine.storeAvailable >> $SM.get;
Engine.removeIncome >> $SM.remove //updates moved to handler


====functions moved====
//Any moved function I felt was more directly related to States or
	didn't belong where it was
Engine.addPerk > $SM.addPerk //kept function for now because of notify
	call inside, 'deep' state
Engine.hasPerk > $SM.hasPerk //kept function because of 'deep' state
	name
Engine.setIncome > $SM.setIncome //kept because it has internal logic
**Engine.getIncome > $SM.getIncome //**easily removable with
	Outside.updateVillageIncome refactor
Engine.openPath > Path.openPath //Since I'm refactoring anyways
Engine.addStolen > $SM.addStolen //internal logic
Engine.startThieves > $SM.startThieves //not sure $SM is a better place,
	but Engine should be nice and clean by the end of this, handling
	only engine mechanics
Engine.num > $SM.num //after Outside refacter, this is basically just a
	fancy $SM.get
Engine.upgradeState > $SM.updateOldState


====functions refactored====
$SM.addPerk; //updates moved to event handler, no check/create new perk
$SM.hasPerk; //don't need to check exist and ==true
$SM.collectIncome //removed changed check, update calls now handled by
	'stateUpdate' event listening
$SM.addStolen //fix to set stolen items in case a partial steal happens
$SM.startThieves //updates in handler
$SM.updateOldState //use $SM calls, add placeholder for updating to post
$SM state when more finalized 


====functions affected (by removed)====
Engine.init (Engine.getStore, Engine.storeAvailable)
Engine.collectIncome (Engine.addStores)
Engine.num (Engine.getStore)
Engine.travelTo (Engine.storeAvailable)

Room.init (Engine.getStore)
Room.unlockForest (Engine.setStore)
Room.lightFire (Engine.setStore, Engine.getStore, Engine.storeAvailable)
Room.stokeFire (Engine.setStore, Engine.getStore, Engine.storeAvailable)
Room.coolFire (Engine.setStore)
Room.buy (Engine.setStores, Engine.addStore, Engine.getStore)
Room.build (Engine.setStores, Engine.getStore)
Room.craftUnlocked (Engine.getStore, Engine.storeAvailable)
Room.buyUnlocked (Engine.storeAvailable)
Room.updateButton (Engine.storeAvailable)

Outside.gatherWood (Engine.addStores)
Outside.checkTraps (Engine.addStores, Engine.getStore)
Outside.updateVillage (Engine.getStore)

Path.embark (Engine.addStore)
Path.getCapacity (Engine.getStore)
Path.updateOutfitting (Engine.getStore)
Path.createOutfittingRow (Engine.getStore)
Path.increaseSupply (Engine.getStore)

World.goHome (Engine.addStore)
World.updateSupplies (Engine.getStore)
World.checkDanger (Engine.getStore)
World.getMaxHealth (Engine.getStore)
World.getMaxWater (Engine.getStore)

Ship.reinforceHull (Engine.addStore, Engine.getStore)
Ship.upgradeEngine (Engine.addStore, Engine.getStore)

Events.loadScene (Engine.addStores)
Events.updateButtons (Engine.getStore)
Events.buttonClick (Engine.getStore)

Events.Global (Engine.addStores, Engine.removeIncome)
Events.Room (Engine.addStore, Engine.addStores, Engine.getStore,
Engine.storeAvailable)
2013-07-24 17:41:36 -06:00
LucidCrux db4a346d21 create StateManager, change all State calls to managed calls
Introduced state_manager.js almost all State gets/sets are now run
through the manager (alias $SM). For now it was a simple, mostly
straightforward replacement of calls. This means that there are
redundancies and a lot of now unneeded code for things the SM will
handle. However, since I had trouble with making those changes as well
as introducing the manager all at once my first attempt, I am taking the
wiser approach and making "one change" at a time like I should have
instead of being too sure of myself.

At this point, it seems to work, but there may be bugs I didn't catch.
There was also no attempt made to update old saves to work with this. In
theory, it shouldn't be too hard. (included is a list of all state
changes)

TODO:
Save Update.
Refactor: a lot, many many redundancies now.
Refactor: "location centric" to "global centric".
Relocate all calls to different update functions to event listeners
where possible.

======================================================

The changes to State are as follows:

.room (exists) > features.location.room
.room > game.room
.room.builder > game.room.builder
.room.temperature > game.room.temperature
.room.fire > game.room.fire
.room.buttons > game.room.buttons

.outside (exists) > features.location.outside
.outside > game.outside
.outside.population > game.outside.population
.outside.buildings > game.outside.buildings
.outside.workers > game.outside.workers
.outside.seenForest > game.outside.seenForest

.world (exists) > features.location.world
.world > game.world
.world.map > game.world.map
.world.mask > game.world.mask
.starved > character.starved
.dehydrated > character.dehydrated

.ship (exists) > featuers.location.spaceShip
.ship > game.spaceShip
.ship.hull > game.spaceShip.hull
.ship.thrusters > game.spaceShip.thrusters
.ship.seenWarning > game.spaceShip.seenWarning
.ship.seenShip > game.spaceShip.seenShip

.punches > character.punches
.perks > character.perks

.thieves > game.thieves
.stolen > game.stolen
.cityCleared > game.cityCleared

.stores > stores
.income > income
2013-07-23 01:24:47 -06:00
Matt Rasmus 22b850f1c0 outside.js: Fix incorrect display of workers.
Fixed an issue where the workers view would break temporarily if all the villagers were killed.
2013-07-10 17:56:15 -07:00
Michael Townsend f56697d9d0 Merge pull request #25 from toofarapart/persistent_stores_view
Stores panel now persists on all non-world/non-space views.
2013-07-08 14:25:20 -07:00
Matt Rasmus 8dabee851d Stores panel now persists on all non-world/non-space views. 2013-07-06 14:56:27 -07:00
Zarkonnen ae044376db Converted min/max buttons to +-10 buttons. Also made code shorter. 2013-07-05 13:47:23 +02:00
Zarkonnen 6d99cb7c3a Added max/zero buttons to worker assignment and expedition supply packing to prevent eg having to click 50x to fill food supplies. 2013-07-04 16:15:29 +02:00
Michael Townsend 19abccfcc4 Adding ADR to Github 2013-07-03 07:56:13 -07:00