From 59c79b686d39d54ac264e24143a8a233c4175cbb Mon Sep 17 00:00:00 2001 From: Chris Farrow Date: Fri, 12 May 2017 16:23:15 -0500 Subject: [PATCH 1/4] Made an event where a shady builder would enter the village and either build a house or steal some wood --- script/events/outside.js | 63 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/script/events/outside.js b/script/events/outside.js index 71d7790..b318e03 100644 --- a/script/events/outside.js +++ b/script/events/outside.js @@ -91,6 +91,62 @@ Events.Outside = [ } } }, + {/* Shady Builder */ + title: _('Shady Builder'), + isAvailable: function() { + return Engine.activeModule == Outside && $SM.get('game.buildings["hut"]', true) >= 5 && $SM.get('game.buildings["hut"]', true) < 20; + }, + scenes: { + 'start':{ + text: [ + _('a shady builder passes through'), + _('says he can build you a cheaper hut') + ], + notification: _('a shady builder passes through'), + buttons: { + 'build': { + text: _('300 wood'), + cost: { 'wood': 200 }, + nextScene: {0.6: 'steal', 1: 'build'} + }, + 'deny': { + text: _('say goodbye'), + nextScene: 'end' + } + } + }, + 'steal': { + text:[ + _("the shady builder steals your wood") + ], + notification: _('the shady builder steals your wood'), + buttons: { + 'end': { + text: _('go home'), + nextScene: 'end' + } + } + }, + 'build': { + text:[ + _("the shady builder builds a hut") + ], + notification: _('the shady builder builds a hut'), + onLoad: function() { + var n = $SM.get('game.buildings["hut"]', true); + if(n < 20){ + $SM.set('game.buildings["hut"]',n+1); + } + }, + buttons: { + 'end': { + text: _('go home'), + nextScene: 'end' + } + } + } + } + }, { /* Sickness */ title: _('Sickness'), isAvailable: function() { @@ -148,7 +204,7 @@ Events.Outside = [ } } }, - + { /* Plague */ title: _('Plague'), isAvailable: function() { @@ -275,7 +331,7 @@ Events.Outside = [ bullets: 10, 'cured meat': 50 }, - + blink: true, buttons: { 'end': { @@ -286,5 +342,6 @@ Events.Outside = [ } } } - } + }, + ]; From 878e83d6317390aca50ef4b297377aa80e82e998 Mon Sep 17 00:00:00 2001 From: Chris Farrow Date: Sat, 13 May 2017 15:11:36 -0500 Subject: [PATCH 2/4] adjusted some of the text for the shady builder event --- script/events/outside.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script/events/outside.js b/script/events/outside.js index b318e03..43569aa 100644 --- a/script/events/outside.js +++ b/script/events/outside.js @@ -91,8 +91,8 @@ Events.Outside = [ } } }, - {/* Shady Builder */ - title: _('Shady Builder'), + {/* The Shady Builder */ + title: _('The Shady Builder'), isAvailable: function() { return Engine.activeModule == Outside && $SM.get('game.buildings["hut"]', true) >= 5 && $SM.get('game.buildings["hut"]', true) < 20; }, @@ -100,13 +100,13 @@ Events.Outside = [ 'start':{ text: [ _('a shady builder passes through'), - _('says he can build you a cheaper hut') + _('says he can build you a hut for less wood') ], notification: _('a shady builder passes through'), buttons: { 'build': { text: _('300 wood'), - cost: { 'wood': 200 }, + cost: { 'wood' : 300 }, nextScene: {0.6: 'steal', 1: 'build'} }, 'deny': { @@ -117,9 +117,9 @@ Events.Outside = [ }, 'steal': { text:[ - _("the shady builder steals your wood") + _("the shady builder has made off with your wood") ], - notification: _('the shady builder steals your wood'), + notification: _('the shady builder has made off with your wood'), buttons: { 'end': { text: _('go home'), From 1156df469380229330ba113f382dd6a94262b1ec Mon Sep 17 00:00:00 2001 From: Chris Farrow Date: Sat, 13 May 2017 15:15:31 -0500 Subject: [PATCH 3/4] got rid of an accidental comma --- script/events/outside.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/events/outside.js b/script/events/outside.js index 43569aa..ca87019 100644 --- a/script/events/outside.js +++ b/script/events/outside.js @@ -342,6 +342,6 @@ Events.Outside = [ } } } - }, + } ]; From f0edb8f6d51355a71797eba778e61f966c6f9ba3 Mon Sep 17 00:00:00 2001 From: Chris Farrow Date: Thu, 18 May 2017 10:11:18 -0500 Subject: [PATCH 4/4] Moved the shady builder to the room module --- script/events/outside.js | 56 -------------------------------- script/events/room.js | 70 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/script/events/outside.js b/script/events/outside.js index ca87019..1a6e763 100644 --- a/script/events/outside.js +++ b/script/events/outside.js @@ -91,62 +91,6 @@ Events.Outside = [ } } }, - {/* The Shady Builder */ - title: _('The Shady Builder'), - isAvailable: function() { - return Engine.activeModule == Outside && $SM.get('game.buildings["hut"]', true) >= 5 && $SM.get('game.buildings["hut"]', true) < 20; - }, - scenes: { - 'start':{ - text: [ - _('a shady builder passes through'), - _('says he can build you a hut for less wood') - ], - notification: _('a shady builder passes through'), - buttons: { - 'build': { - text: _('300 wood'), - cost: { 'wood' : 300 }, - nextScene: {0.6: 'steal', 1: 'build'} - }, - 'deny': { - text: _('say goodbye'), - nextScene: 'end' - } - } - }, - 'steal': { - text:[ - _("the shady builder has made off with your wood") - ], - notification: _('the shady builder has made off with your wood'), - buttons: { - 'end': { - text: _('go home'), - nextScene: 'end' - } - } - }, - 'build': { - text:[ - _("the shady builder builds a hut") - ], - notification: _('the shady builder builds a hut'), - onLoad: function() { - var n = $SM.get('game.buildings["hut"]', true); - if(n < 20){ - $SM.set('game.buildings["hut"]',n+1); - } - }, - buttons: { - 'end': { - text: _('go home'), - nextScene: 'end' - } - } - } - } - }, { /* Sickness */ title: _('Sickness'), isAvailable: function() { diff --git a/script/events/room.js b/script/events/room.js index 64f4937..1e70a3e 100644 --- a/script/events/room.js +++ b/script/events/room.js @@ -40,7 +40,7 @@ Events.Room = [ cost: { fur: 300, scales: 15, teeth: 5 }, reward: { 'compass': 1 }, notification: _('the old compass is dented and dusty, but it looks to work.') - }, + }, 'goodbye': { text: _('say goodbye'), nextScene: 'end' @@ -48,7 +48,7 @@ Events.Room = [ } } } - }, + }, { /* Noises Outside -- gain wood/fur */ title: _('Noises'), isAvailable: function() { @@ -257,7 +257,63 @@ Events.Room = [ } } }, - + {/* The Shady Builder */ + title: _('The Shady Builder'), + isAvailable: function() { + return Engine.activeModule == Room && $SM.get('game.buildings["hut"]', true) >= 5 && $SM.get('game.buildings["hut"]', true) < 20; + }, + scenes: { + 'start':{ + text: [ + _('a shady builder passes through'), + _('says he can build you a hut for less wood') + ], + notification: _('a shady builder passes through'), + buttons: { + 'build': { + text: _('300 wood'), + cost: { 'wood' : 300 }, + nextScene: {0.6: 'steal', 1: 'build'} + }, + 'deny': { + text: _('say goodbye'), + nextScene: 'end' + } + } + }, + 'steal': { + text:[ + _("the shady builder has made off with your wood") + ], + notification: _('the shady builder has made off with your wood'), + buttons: { + 'end': { + text: _('go home'), + nextScene: 'end' + } + } + }, + 'build': { + text:[ + _("the shady builder builds a hut") + ], + notification: _('the shady builder builds a hut'), + onLoad: function() { + var n = $SM.get('game.buildings["hut"]', true); + if(n < 20){ + $SM.set('game.buildings["hut"]',n+1); + } + }, + buttons: { + 'end': { + text: _('go home'), + nextScene: 'end' + } + } + } + } + }, + { /* Mysterious Wanderer -- wood gambling */ title: _('The Mysterious Wanderer'), isAvailable: function() { @@ -336,7 +392,7 @@ Events.Room = [ } } }, - + { /* Mysterious Wanderer -- fur gambling */ title: _('The Mysterious Wanderer'), isAvailable: function() { @@ -415,7 +471,7 @@ Events.Room = [ } } }, - + { /* The Scout -- Map Merchant */ title: _('The Scout'), isAvailable: function() { @@ -457,7 +513,7 @@ Events.Room = [ } } }, - + { /* The Wandering Master */ title: _('The Master'), isAvailable: function() { @@ -530,7 +586,7 @@ Events.Room = [ } } }, - + { /* The Sick Man */ title: _('The Sick Man'), isAvailable: function() {