Skip to content

Commit

Permalink
Moved the shady builder to the room module
Browse files Browse the repository at this point in the history
  • Loading branch information
BAirborne committed May 18, 2017
1 parent 1156df4 commit f0edb8f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 63 deletions.
56 changes: 0 additions & 56 deletions script/events/outside.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
70 changes: 63 additions & 7 deletions script/events/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ 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'
}
}
}
}
},
},
{ /* Noises Outside -- gain wood/fur */
title: _('Noises'),
isAvailable: function() {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -336,7 +392,7 @@ Events.Room = [
}
}
},

{ /* Mysterious Wanderer -- fur gambling */
title: _('The Mysterious Wanderer'),
isAvailable: function() {
Expand Down Expand Up @@ -415,7 +471,7 @@ Events.Room = [
}
}
},

{ /* The Scout -- Map Merchant */
title: _('The Scout'),
isAvailable: function() {
Expand Down Expand Up @@ -457,7 +513,7 @@ Events.Room = [
}
}
},

{ /* The Wandering Master */
title: _('The Master'),
isAvailable: function() {
Expand Down Expand Up @@ -530,7 +586,7 @@ Events.Room = [
}
}
},

{ /* The Sick Man */
title: _('The Sick Man'),
isAvailable: function() {
Expand Down

0 comments on commit f0edb8f

Please sign in to comment.