Commit Graph

354 Commits

Author SHA1 Message Date
Andrea Rendine def892953a Cooldown time from graphics
Not a problem of precision, but a width measurement issue. Fixed and restored to previous precision level.
2016-02-16 00:27:44 +01:00
Andrea Rendine 091929cf90 Cleanup
Events.damage method now groups all common lines for Events.animateRanged and Events.animateMelee.
Balance between success and failure is now determined by Events.lost. It is set to "true" when the player is killed and prevents Events.winFight() altogether.
Events.endFight() groups the 2 consistent actions in winFight and loseFight, i.e., pause unsetting and stopping the enemy.
Completely renewed trap method: instead of relying on a separate counter, enemy.data('stunned') now returns the number of remaining seconds of stunning. Enemy's timed attack decreases this value by the attack delay time (the enemy fights for its freedom).
2016-02-16 00:26:23 +01:00
AndySky21 6ace681a91 Pause during fight
This commit adds a pause button during the fight. It relies upon the new
Events.paused property: when set to true, no buttons will work except
the pause button itself, and cooldown on attack/healing buttons is
interrupted.
This commit also groups event buttons in different groups (attack,
healing, scene), so that the position of "eat meat" and "use meds" does
not depend on how many scene buttons are present (sometimes 1, other
times 2)
2016-02-15 21:04:02 +01: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 4bd00fa328 No check on null stores
Unlike other stuff, stores in the side box never disappear during the game when they reach 0, once they've been "seen" (i.e., once State stores[store] has been set). But on reload they appear only if the quantity is positive.
For the sake of consistency, now null stores are visible on load (see what you're missing, bro).
2016-02-14 21:24:43 +01:00
Andrea Rendine d295ca9aa5 Take all and what?
The change is somehow linguistic, rather than anything else.
"Take everything and leave" changes name and becomes "Take everything and X", where X is the verb of the command it impersonates.
This way after completing mines e.g. it is "Take everything and continue", acting like "continue" button.
It now also cools down if it impersonates a "leave" button (leave buttons cool down. IDK why).
2016-02-14 21:00:04 +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 3b66f5cad5 Buy map when needed
Buy map button availability depends on the fact that there are still unexplored parts of the map.
2016-02-14 15:54:59 +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 f1656f9a4f Buy map when needed
Maps cost! And casual gamers could possibly forget whether they've explored everything.
The Buy map button is now disabled if the whole map has been seen (yes, even a single uncovered tile is enough).
2016-02-14 13:46:26 +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 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 4032738d57 Code style
Tab in place.
2016-02-14 02:31:41 +01:00
Blake Grotewold 9943c4c568 add confirm hyper
lets the user know what hyper mode is, and confirms turning it on.
Updates .pot to match current source.
2015-12-22 16:41:10 -06:00
Michael Townsend c66d484627 Added import/export tracking 2015-12-04 10:57:16 -05:00
Continuities fba203cea1 conversion tweaks 2015-11-09 18:36:55 -05:00
Akai Alonkai 95057c9704 Made fur gambling return fur.
Function was paying out in wood, not fur, contrary to notification text.
2015-09-20 16:32:54 -04:00
Continuities a0b343246c Code style 2015-08-02 11:40:27 -04:00
Sebring 1e37f45530 Display time delay on total row in tooltip 2015-07-29 20:08:09 +02:00
Sebring fea54cd97f Add total to tooltip 2015-07-29 16:57:26 +02:00
Blake Grotewold 95cf44c2f2 Fix removeBranch function definition 2015-07-25 20:23:35 -04: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 7208b845b1 Take all, take everything, leave if possible
Multiple fixes:
1. take all of a kind
2. take everything
3. if possible, leave
4. drop menu on hover
5. Same item not shown as drop option
2015-06-27 02:13:14 -04:00
Andrea Rendine da0d39b579 Check for delayed events
This triggers onload for all those events whose (possible) reward is registered with a time delay.
2015-06-27 01:43:09 -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 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
wmassingham f94cfe2590 disable tab navigation during events (fixes #403) depends on @AndySky21's branch world-to-path 2015-06-27 00:26:40 -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
SVS 1d2f95b561 Change the enemy labels 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
Andrea Rendine 64a02c162c Modified command destination for save
Export dialog replaces selection dialog, rather than overlapping it.
Closing it exits the panel and returns to current game.
Aborting Import dialog returns the player to the selection screen, so that s/he can save before trying to load.
2015-06-26 23:49:30 -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 8306f155f1 Notifications for outside events
As said in #363, there are almost no notifications for outside events.
I took a little liberty to suggest new sentences. Inspired by the game atmosphere and the double notification for Hut Fire, wrote lines for events and possible outcomes.
they're associated to buttons where there are no outcome scenes.
2015-06-26 21:31:20 -04:00
John Redford ee591ca218 Update outside.js
Changed sickness event to kill up to half of the villagers instead of up to 20.
2015-06-14 00:47:08 -05:00
Blake Grotewold 84577047a6 Merge pull request #391 from AndySky21/ship-title
Ship tab title
2015-05-29 10:12:08 -04:00
Andrea Rendine f219b3288f 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-05-27 14:28:12 -04:00
SVS 8d3b313e9c Change the enemy labels 2015-05-27 14:25:21 -04:00
Andrea Rendine acca5806b5 Ship title
Browser "title" is not translated when Ship tab is active.
2015-05-18 23:15:18 +02:00
Andrea Rendine de705e4a5e Load event before anything else
An event could produce different notifications or rewards according to different outcomes of the event itself (e.g. a negative event impacting on buildings and/or villagers, or a wanderer leaving items of some specific kind), but the notification is generated before the onLoad() call.
I'd say that this is the best action order:
1. event action
2. event notification
3. event reward (and possible additional notifications due to that)
2015-05-13 12:08:00 -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
Travis Weston 8c368d363a Add take all button 2015-05-13 11:35:25 -04:00
Andrea Rendine fb13f6e808 Notification before reward
Noticed when buying the compass.
I found it weird that *first* the compass points and *then* it appears in good condition.
Now event notification precedes event reward, and it should be corrected.
2015-05-11 10:16:43 -04:00
Blake Grotewold 7fd474d3c0 Add missing Hyper Mode pieces
Some code was missing from the Hyper Mode feature addition. This
completes the use of `Engine.setTimeout` and adds doubleTime check in
button cooldowns.

Closes #374
2015-05-10 18:14:13 -04:00
nicholas_pellizer 8320156f42 Hyper mode and LightsOff is now stored in the State 2015-05-03 22:09:49 -04:00
Michael Townsend f85b8fdf7e Merge pull request #349 from AndySky21/patch-1
Fixed variable name
2015-04-30 11:38:42 -04:00
Michael Townsend d2bd08dcb1 Merge pull request #345 from AndySky21/stores-az-sorting
Stores alphabetical sorting
2015-04-30 11:38:12 -04:00