Commit Graph

50 Commits

Author SHA1 Message Date
Fakey McFakename 1fada4620b Update world.js (#739)
'disintigrate' -> 'disintegrate'
2025-05-23 11:33:06 -04:00
Michael Townsend 9c02581b15 bugs 2023-06-12 10:36:01 -04:00
Michael Townsend 7ee96fd108 Expansion (#707)
This additional content explores the aftermath of an event in The Ensign. A large dungeon, The Executioner, reveals the fate of one of the Wanderers’ most powerful weapons though multiple wings, each ending with a unique boss encounter. The fabricator allows the player to craft powerful items out of alien alloy, introducing new combat mechanics.
2023-06-09 12:38:16 -04:00
jorsi a601473645 We have audio! Thanks @orsi! 2020-09-10 12:45:10 -04:00
Roarez d498a13177 Fix buying maps causing crashes
Fixes the applyMap function that could not uncover single points of map on the top and left borders and thus was causing an infinite loop crash
2018-09-11 00:43:49 +01:00
hun0975 4e37103171 jshint warning ('cur' is already defined)
The "cur" variable is defined twice in each for loop.
So I pulled out the definition part of the "cur" variable.
2017-12-04 15:35:00 +09:00
Lucas Lois 36b01a78b6 Made scoring.js, space.js and world.js jshint compliant 2016-10-02 17:57:17 -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
Blake Grotewold 3d8e07510f Merge pull request #462 from AndySky21/mapBug
Map bug fix
2016-03-19 14:55:42 -04: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 a3b1fea424 Method and property fix
World.testMap() sets World.seenAll. The latter is true when the whole map has been explored.
World.testMap() is called:

* on world init
* on return home (when the map is updated)
* on applyMap() (when the map is bought from the scout)
2016-02-20 13:17:45 +01:00
Andrea Rendine 28cdca6003 Update world map on return
World.seenAll must be updated only when committing state changes (i.e., on return home safe), not during exploration.
2016-02-14 16:09:15 +01:00
Andrea Rendine bee221093e Apply useful maps
Maps cost! Let's apply them where necessary.
World.testMap() checks if there's still something to explore.
World.seenAll is true when everything has been seen. It is updated by uncoverMap().
World.applyMap() chooses a random center, with the conditions that 

1. there's still something to explore
1. the center itself is an undiscovered area.

Buy Map is active only when a map is still useful.
2016-02-14 15:47:38 +01:00
Andrea Rendine 3e51471b0b Remove State outfit on death
Supplies are not removed from state when embarking, so they remain in place in case the game is closed during exploration. So it now happens in case of death, along with Path.outfit reset.
2016-02-14 11:53:29 +01: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 03fae08ff2 Compass relocation
This commit carries some changes.
* the compass is now a "special" item, not "good". It allows a different placing
* Store block is now divided into 2 parts. All the script is adapted to make room for it, including empty block check and insert animation for the new #store children divs
** Above: stackable storable items (resources), whose tooltip shows updated income/consumption rates
** Below: special storable items. As of now, it only contains the compass. Special block has a special style, with some distance from resources block if that one exists.
* Compass row has an empty tooltip which is filled in by World
2015-06-28 14:27:37 -04:00
Andrea Rendine 358fe5fbcc Restore navigation property
Instead of a timed method to restore lx/rx navigation, a property will be set to true. In that case, the keyup method will not be executed, but it will restore navigation for further use.
2015-06-27 00:26:41 -04:00
Andrea Rendine 08bd1c7caf Single letter representations for enemies
R wild animals (beast, birds, lizards, rats)
T mutated creatures (includes giant lizards)
E human enemies (old men, scavengers, thugs and squatters)
D armed human enemies (includes vigilantes, soldiers, snipers, commandos, veterans and chiefs)
2015-06-27 00:26:40 -04:00
Andrea Rendine daf5de3973 Property for tab navigation
Added Engine.tabNavigation property. When true, it enables keyboard navigation to/from tabs. It is disabled on world and enabled some milliseconds after Path.onArrival(), so that when player returns s/he finds him/herself on Path tab instead of navigating.
2015-06-27 00:26:40 -04:00
Travis Weston 6ee6470972 Merging updates 2015-02-11 18:55:27 -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 4bb126c205 Fixing minor whitespace conformity in state_manager.js, fixed whitespace conformity in world.js 2014-07-13 11:26:21 -04:00
Vanadar c7ad5384f4 suite des trads 2014-02-07 18:26:03 +01:00
Michael b583721581 Actually fixed the bug I thought I fixed ages ago. Turns out saving at
outposts is a stupid idea!
2013-11-26 11:36:51 -05:00
Michael Townsend c738342bad Update world.js
Only add the cache if there is prestige data
2013-10-31 14:36:03 -04:00
Michael Townsend a96e9c55c2 Update world.js 2013-10-29 15:54:25 -04:00
Vermilingua 83bf266a29 prestige system now absolutely complete 2013-10-16 21:43:40 +11:00
Vermilingua acc04d0780 set down framework, storage/map gen/etc. 2013-10-16 21:41:47 +11:00
Vermilingua 36b9cf2142 made the forest suit more 2013-10-15 20:09:28 +11:00
Michael dde477aade Some general code cleanup. 2013-10-10 20:53:53 -04:00
LucidCrux a8c6790d84 bugfix set ship,world location to true on init 2013-07-27 12:25:15 -06: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
Michael Townsend 8cb64ad3d8 Merge pull request #29 from Cogito/roadDrawing
Road drawing improvements
2013-07-10 10:57:13 -07:00
Zarkonnen bb953de92b Finished first version of medicine feature. 2013-07-10 12:53:28 +02:00
Andrew Ardill 255bdd68fc world.js: Improve road drawing algorithm
Instead of drawing an 'L' shape road to the village, find the closest road,
outpost or village and draw the road to it. Care is taken to ensure that a
road is drawn if you are standing on top of an outpost, as the outpost may be
created before the tile it stands on is connected to the road network.
2013-07-10 20:52:18 +10:00
Andrew Ardill 26b955fee8 world.js: Increase functionality of getDistance
Allow passing 'from' and 'to' positions to getDistance to find the distance
between them.
2013-07-10 20:52:18 +10:00
Andrew Ardill c4afe143a9 world.js: Introduce World.VILLAGE_POS
This constant gets reused in a few places, so extract it out. Work will be
required to migrate existing code away from hard coding World.RADIUS in places
where we are talking about the village location.
2013-07-10 20:52:18 +10:00
Andrew Ardill b97f5d9914 world.js: Introduce function to copy positions 2013-07-10 20:52:17 +10:00
Zarkonnen 4641b0b145 Initial medicine implementation. Needs more events. 2013-07-08 19:16:16 +02:00
Matt Rasmus 8dabee851d Stores panel now persists on all non-world/non-space views. 2013-07-06 14:56:27 -07:00
David Clark e9679b3f26 Add swipe support. Modules can implement swipeLeft (etc). Swipes control movement in the World module (map). 2013-07-05 22:36:49 +10:00
Andrew Ardill 6fb7f248f7 world.js: Trigger movement with clicks on the map
Clicking on the map in different quadrants will move you in that direction.
Clicks are measured relative to the centre of the current location centre of
the map. Click above the player to move up, click below to move down etc.

This should enable better gameplay on touch devices.
2013-07-04 16:13:30 +10:00
Andrew Ardill d0a171e95b world.js: Refactor move commands out of keyDown
In order to better handle move commands, refactor them out of the keyDown
event handler. This will enable using other input methods to trigger a move
command, such as mouse clicks or touch events.
2013-07-04 14:49:21 +10:00
Michael Townsend 19abccfcc4 Adding ADR to Github 2013-07-03 07:56:13 -07:00