Commit Graph

44 Commits

Author SHA1 Message Date
jorsi 3b43a2754a refactor audio engine: simplified gain channels, improve fading between audio, rename functions 2020-06-03 17:44:27 -04:00
jorsi 274f20e674 add rough outline of path and world' 2020-06-01 00:28:37 -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 9ae1ac06f5 add outline of Path sounds 2020-05-29 18:21:57 -04:00
Jeong YunWon 99f28877e8 Add missing messages to gettext 2018-06-09 23:47:04 +09:00
Lucas Lois fb9e39bbaf Merge branch 'master' into jshint-compliance 2017-01-25 11:44:18 -03:00
Blake Grotewold 1a6b41c2a1 Don't save carryables if they haven't been found yet. 2016-10-11 02:29:41 -04:00
Lucas Lois 05edb2a98a Made path.js jshint compliant 2016-10-02 17:52:22 -03:00
Blake Grotewold 9438d2c30b Merge pull request #471 from code-kit/master
More Weapons/Tools Information on Path Tab
2016-03-19 15:01:01 -04:00
Elizabeth Donohew 41293d48a8 Rewrote a couple of the descriptions that I added before for the tools. 2016-02-24 00:03:28 -06:00
Elizabeth Donohew 9083a9582c Hovering over a tool on the path tab now gives a small description on how the tool can be used. 2016-02-23 22:40:04 -06:00
Elizabeth Donohew 4d9890f2ef Renamed total to currentBagCapacity in the updateOutfitting method and extracted some functionality into a method called updateBagSpace. 2016-02-23 21:07:21 -06:00
Elizabeth Donohew 7efe142637 Shows the damage that a weapon deals only when hovering over a weapon on the path tab. 2016-02-23 20:46:19 -06:00
Andrea Rendine 59e71232d4 Minor fixes
For code consistency: in updateSupplies, num is forced to never be greater than have, so the "greater or equal" comparison is pointless
Increase buttons reactivate when total store quantity is greater than supplies.
Also, removed useless nesting of Math.min.
2016-02-15 10:41:42 +01:00
Andrea Rendine 2c2490290c Leave outfit in place
It seems counterintuitive for players that, if the game is closed while exploring, everything remains unchanged but supplies are lost. I had to choose between cooling down Embark, thus making it explicit that it's as if the player had died, or leave supplies in place. I chose the latter.
2016-02-14 11:48:27 +01:00
Andrea Rendine 0f8a2ccfb6 Outfit update on Income
A very easy fix indeed. When Path is active, the outfit is updated on Income event. This way the "available" tooltip is reliable, increment/decrement buttons are activated/deactivated correctly and there is no risk of phantom resources.
2016-02-14 02:39:49 +01: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 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
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
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
Robert Gravina 72a83d48dd Save the state of the path outfit in the State object.
Load the state when initialising the path screen. When embarking, make sure to clear the state. On arrival, update the saved state.

This enables save/load of the path state in the save game if it occurs before leaving.
2014-12-25 00:06:37 +09:00
Dan Apczynski 41592e79c7 Fixed bug where player could take unavailable items onto dusty path 2014-08-03 01:49:49 -07:00
Travis Weston d164d1d466 Merge branch 'master' into whitespace-fixes 2014-07-16 23:32:13 -04:00
Travis Weston da53de1ed2 Fixed issue where path stores animation would not run. 2014-07-16 21:53:11 -04:00
Travis Weston b402008769 Fixed whitespace conformity in path.js 2014-07-13 11:20:17 -04:00
Vanadar c7ad5384f4 suite des trads 2014-02-07 18:26:03 +01: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 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
Michael Townsend 93f8e52e1f Merge pull request #30 from Zarkonnen/medicine
Medicine
2013-07-10 12:07:05 -07:00
Zarkonnen bb953de92b Finished first version of medicine feature. 2013-07-10 12:53:28 +02: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