mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-09 22:17:14 +08:00
Fixed whitespace conformity in room.js
This commit is contained in:
+275
-275
@@ -106,8 +106,8 @@ Events.Room = [
|
|||||||
scenes: {
|
scenes: {
|
||||||
start: {
|
start: {
|
||||||
text: [
|
text: [
|
||||||
_('scratching noises can be heard from the store room.'),
|
_('scratching noises can be heard from the store room.'),
|
||||||
_('something\'s in there.')
|
_('something\'s in there.')
|
||||||
],
|
],
|
||||||
notification: _('something\'s in the store room'),
|
notification: _('something\'s in the store room'),
|
||||||
buttons: {
|
buttons: {
|
||||||
@@ -123,63 +123,63 @@ Events.Room = [
|
|||||||
},
|
},
|
||||||
scales: {
|
scales: {
|
||||||
text: [
|
text: [
|
||||||
_('some wood is missing.'),
|
_('some wood is missing.'),
|
||||||
_('the ground is littered with small scales')
|
_('the ground is littered with small scales')
|
||||||
],
|
],
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
var numWood = $SM.get('stores.wood', true);
|
var numWood = $SM.get('stores.wood', true);
|
||||||
numWood = Math.floor(numWood * 0.1);
|
numWood = Math.floor(numWood * 0.1);
|
||||||
if(numWood == 0) numWood = 1;
|
if(numWood == 0) numWood = 1;
|
||||||
var numScales = Math.floor(numWood / 5);
|
var numScales = Math.floor(numWood / 5);
|
||||||
if(numScales == 0) numScales = 1;
|
if(numScales == 0) numScales = 1;
|
||||||
$SM.addM('stores', {'wood': -numWood, 'scales': numScales});
|
$SM.addM('stores', {'wood': -numWood, 'scales': numScales});
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('leave'),
|
text: _('leave'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
teeth: {
|
teeth: {
|
||||||
text: [
|
text: [
|
||||||
_('some wood is missing.'),
|
_('some wood is missing.'),
|
||||||
_('the ground is littered with small teeth')
|
_('the ground is littered with small teeth')
|
||||||
],
|
],
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
var numWood = $SM.get('stores.wood', true);
|
var numWood = $SM.get('stores.wood', true);
|
||||||
numWood = Math.floor(numWood * 0.1);
|
numWood = Math.floor(numWood * 0.1);
|
||||||
if(numWood == 0) numWood = 1;
|
if(numWood == 0) numWood = 1;
|
||||||
var numTeeth = Math.floor(numWood / 5);
|
var numTeeth = Math.floor(numWood / 5);
|
||||||
if(numTeeth == 0) numTeeth = 1;
|
if(numTeeth == 0) numTeeth = 1;
|
||||||
$SM.addM('stores', {'wood': -numWood, 'teeth': numTeeth});
|
$SM.addM('stores', {'wood': -numWood, 'teeth': numTeeth});
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('leave'),
|
text: _('leave'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cloth: {
|
cloth: {
|
||||||
text: [
|
text: [
|
||||||
_('some wood is missing.'),
|
_('some wood is missing.'),
|
||||||
_('the ground is littered with scraps of cloth')
|
_('the ground is littered with scraps of cloth')
|
||||||
],
|
],
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
var numWood = $SM.get('stores.wood', true);
|
var numWood = $SM.get('stores.wood', true);
|
||||||
numWood = Math.floor(numWood * 0.1);
|
numWood = Math.floor(numWood * 0.1);
|
||||||
if(numWood == 0) numWood = 1;
|
if(numWood == 0) numWood = 1;
|
||||||
var numCloth = Math.floor(numWood / 5);
|
var numCloth = Math.floor(numWood / 5);
|
||||||
if(numCloth == 0) numCloth = 1;
|
if(numCloth == 0) numCloth = 1;
|
||||||
$SM.addM('stores', {'wood': -numWood, 'cloth': numCloth});
|
$SM.addM('stores', {'wood': -numWood, 'cloth': numCloth});
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('leave'),
|
text: _('leave'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -191,8 +191,8 @@ Events.Room = [
|
|||||||
scenes: {
|
scenes: {
|
||||||
start: {
|
start: {
|
||||||
text: [
|
text: [
|
||||||
_('a beggar arrives.'),
|
_('a beggar arrives.'),
|
||||||
_('asks for any spare furs to keep him warm at night.')
|
_('asks for any spare furs to keep him warm at night.')
|
||||||
],
|
],
|
||||||
notification: _('a beggar arrives'),
|
notification: _('a beggar arrives'),
|
||||||
buttons: {
|
buttons: {
|
||||||
@@ -215,41 +215,41 @@ Events.Room = [
|
|||||||
scales: {
|
scales: {
|
||||||
reward: { scales: 20 },
|
reward: { scales: 20 },
|
||||||
text: [
|
text: [
|
||||||
_('the beggar expresses his thanks.'),
|
_('the beggar expresses his thanks.'),
|
||||||
_('leaves a pile of small scales behind.')
|
_('leaves a pile of small scales behind.')
|
||||||
],
|
],
|
||||||
buttons: {
|
buttons: {
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
teeth: {
|
teeth: {
|
||||||
reward: { teeth: 20 },
|
reward: { teeth: 20 },
|
||||||
text: [
|
text: [
|
||||||
_('the beggar expresses his thanks.'),
|
_('the beggar expresses his thanks.'),
|
||||||
_('leaves a pile of small teeth behind.')
|
_('leaves a pile of small teeth behind.')
|
||||||
],
|
],
|
||||||
buttons: {
|
buttons: {
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cloth: {
|
cloth: {
|
||||||
reward: { cloth: 20 },
|
reward: { cloth: 20 },
|
||||||
text: [
|
text: [
|
||||||
_('the beggar expresses his thanks.'),
|
_('the beggar expresses his thanks.'),
|
||||||
_('leaves some scraps of cloth behind.')
|
_('leaves some scraps of cloth behind.')
|
||||||
],
|
],
|
||||||
buttons: {
|
buttons: {
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -262,8 +262,8 @@ Events.Room = [
|
|||||||
scenes: {
|
scenes: {
|
||||||
start: {
|
start: {
|
||||||
text: [
|
text: [
|
||||||
_('a wanderer arrives with an empty cart. says if he leaves with wood, he\'ll be back with more.'),
|
_('a wanderer arrives with an empty cart. says if he leaves with wood, he\'ll be back with more.'),
|
||||||
_("builder's not sure he's to be trusted.")
|
_("builder's not sure he's to be trusted.")
|
||||||
],
|
],
|
||||||
notification: _('a mysterious wanderer arrives'),
|
notification: _('a mysterious wanderer arrives'),
|
||||||
buttons: {
|
buttons: {
|
||||||
@@ -285,41 +285,41 @@ Events.Room = [
|
|||||||
},
|
},
|
||||||
'100wood': {
|
'100wood': {
|
||||||
text: [
|
text: [
|
||||||
_('the wanderer leaves, cart loaded with wood')
|
_('the wanderer leaves, cart loaded with wood')
|
||||||
],
|
],
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
if(Math.random() < 0.5) {
|
if(Math.random() < 0.5) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$SM.add('stores.wood', 300);
|
$SM.add('stores.wood', 300);
|
||||||
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with wood.'));
|
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with wood.'));
|
||||||
}, 60 * 1000);
|
}, 60 * 1000);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'500wood': {
|
'500wood': {
|
||||||
text: [
|
text: [
|
||||||
_('the wanderer leaves, cart loaded with wood')
|
_('the wanderer leaves, cart loaded with wood')
|
||||||
],
|
],
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
if(Math.random() < 0.3) {
|
if(Math.random() < 0.3) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$SM.add('stores.wood', 1500);
|
$SM.add('stores.wood', 1500);
|
||||||
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with wood.'));
|
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with wood.'));
|
||||||
}, 60 * 1000);
|
}, 60 * 1000);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -332,8 +332,8 @@ Events.Room = [
|
|||||||
scenes: {
|
scenes: {
|
||||||
start: {
|
start: {
|
||||||
text: [
|
text: [
|
||||||
_('a wanderer arrives with an empty cart. says if she leaves with furs, she\'ll be back with more.'),
|
_('a wanderer arrives with an empty cart. says if she leaves with furs, she\'ll be back with more.'),
|
||||||
_("builder's not sure she's to be trusted.")
|
_("builder's not sure she's to be trusted.")
|
||||||
],
|
],
|
||||||
notification: _('a mysterious wanderer arrives'),
|
notification: _('a mysterious wanderer arrives'),
|
||||||
buttons: {
|
buttons: {
|
||||||
@@ -355,41 +355,41 @@ Events.Room = [
|
|||||||
},
|
},
|
||||||
'100fur': {
|
'100fur': {
|
||||||
text: [
|
text: [
|
||||||
_('the wanderer leaves, cart loaded with furs')
|
_('the wanderer leaves, cart loaded with furs')
|
||||||
],
|
],
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
if(Math.random() < 0.5) {
|
if(Math.random() < 0.5) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$SM.add('stores.fur', 300);
|
$SM.add('stores.fur', 300);
|
||||||
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with furs.'));
|
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with furs.'));
|
||||||
}, 60 * 1000);
|
}, 60 * 1000);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'500fur': {
|
'500fur': {
|
||||||
text: [
|
text: [
|
||||||
_('the wanderer leaves, cart loaded with furs')
|
_('the wanderer leaves, cart loaded with furs')
|
||||||
],
|
],
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
if(Math.random() < 0.3) {
|
if(Math.random() < 0.3) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$SM.add('stores.fur', 1500);
|
$SM.add('stores.fur', 1500);
|
||||||
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with furs.'));
|
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with furs.'));
|
||||||
}, 60 * 1000);
|
}, 60 * 1000);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -424,9 +424,9 @@ Events.Room = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'leave': {
|
'leave': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -462,132 +462,132 @@ Events.Room = [
|
|||||||
},
|
},
|
||||||
'agree': {
|
'agree': {
|
||||||
text: [
|
text: [
|
||||||
_('in exchange, the wanderer offers his wisdom.')
|
_('in exchange, the wanderer offers his wisdom.')
|
||||||
],
|
],
|
||||||
buttons: {
|
buttons: {
|
||||||
'evasion': {
|
'evasion': {
|
||||||
text: _('evasion'),
|
text: _('evasion'),
|
||||||
available: function() {
|
available: function() {
|
||||||
return !$SM.hasPerk('evasive');
|
return !$SM.hasPerk('evasive');
|
||||||
},
|
},
|
||||||
onChoose: function() {
|
onChoose: function() {
|
||||||
$SM.addPerk('evasive');
|
$SM.addPerk('evasive');
|
||||||
},
|
},
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
},
|
},
|
||||||
'precision': {
|
'precision': {
|
||||||
text: _('precision'),
|
text: _('precision'),
|
||||||
available: function() {
|
available: function() {
|
||||||
return !$SM.hasPerk('precise');
|
return !$SM.hasPerk('precise');
|
||||||
},
|
},
|
||||||
onChoose: function() {
|
onChoose: function() {
|
||||||
$SM.addPerk('precise');
|
$SM.addPerk('precise');
|
||||||
},
|
},
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
},
|
},
|
||||||
'force': {
|
'force': {
|
||||||
text: _('force'),
|
text: _('force'),
|
||||||
available: function() {
|
available: function() {
|
||||||
return !$SM.hasPerk('barbarian');
|
return !$SM.hasPerk('barbarian');
|
||||||
},
|
},
|
||||||
onChoose: function() {
|
onChoose: function() {
|
||||||
$SM.addPerk('barbarian');
|
$SM.addPerk('barbarian');
|
||||||
},
|
},
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
},
|
},
|
||||||
'nothing': {
|
'nothing': {
|
||||||
text: _('nothing'),
|
text: _('nothing'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{ /* The Sick Man */
|
{ /* The Sick Man */
|
||||||
title: _('The Sick Man'),
|
title: _('The Sick Man'),
|
||||||
isAvailable: function() {
|
isAvailable: function() {
|
||||||
return Engine.activeModule == Room && $SM.get('stores.medicine', true) > 0;
|
return Engine.activeModule == Room && $SM.get('stores.medicine', true) > 0;
|
||||||
},
|
},
|
||||||
scenes: {
|
scenes: {
|
||||||
'start': {
|
'start': {
|
||||||
text: [
|
text: [
|
||||||
_("a man hobbles up, coughing."),
|
_("a man hobbles up, coughing."),
|
||||||
_("he begs for medicine.")
|
_("he begs for medicine.")
|
||||||
],
|
],
|
||||||
notification: _('a sick man hobbles up'),
|
notification: _('a sick man hobbles up'),
|
||||||
buttons: {
|
buttons: {
|
||||||
'help': {
|
'help': {
|
||||||
text: _('give 1 medicine'),
|
text: _('give 1 medicine'),
|
||||||
cost: { 'medicine': 1 },
|
cost: { 'medicine': 1 },
|
||||||
notification: _('the man swallows the medicine eagerly'),
|
notification: _('the man swallows the medicine eagerly'),
|
||||||
nextScene: { 0.1: 'alloy', 0.3: 'cells', 0.5: 'scales', 1.0: 'nothing' }
|
nextScene: { 0.1: 'alloy', 0.3: 'cells', 0.5: 'scales', 1.0: 'nothing' }
|
||||||
},
|
},
|
||||||
'ignore': {
|
'ignore': {
|
||||||
text: _('tell him to leave'),
|
text: _('tell him to leave'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'alloy': {
|
'alloy': {
|
||||||
text: [
|
text: [
|
||||||
_("the man is thankful."),
|
_("the man is thankful."),
|
||||||
_('he leaves a reward.'),
|
_('he leaves a reward.'),
|
||||||
_('some weird metal he picked up on his travels.')
|
_('some weird metal he picked up on his travels.')
|
||||||
],
|
],
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
$SM.add('stores["alien alloy"]', 1);
|
$SM.add('stores["alien alloy"]', 1);
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
'bye': {
|
'bye': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'cells': {
|
'cells': {
|
||||||
text: [
|
text: [
|
||||||
_("the man is thankful."),
|
_("the man is thankful."),
|
||||||
_('he leaves a reward.'),
|
_('he leaves a reward.'),
|
||||||
_('some weird glowing boxes he picked up on his travels.')
|
_('some weird glowing boxes he picked up on his travels.')
|
||||||
],
|
],
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
$SM.add('stores["energy cell"]', 3);
|
$SM.add('stores["energy cell"]', 3);
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
'bye': {
|
'bye': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'scales': {
|
'scales': {
|
||||||
text: [
|
text: [
|
||||||
_("the man is thankful."),
|
_("the man is thankful."),
|
||||||
_('he leaves a reward.'),
|
_('he leaves a reward.'),
|
||||||
_('all he has are some scales.')
|
_('all he has are some scales.')
|
||||||
],
|
],
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
$SM.add('stores.scales', 5);
|
$SM.add('stores.scales', 5);
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
'bye': {
|
'bye': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'nothing': {
|
'nothing': {
|
||||||
text: [
|
text: [
|
||||||
_("the man expresses his thanks and hobbles off.")
|
_("the man expresses his thanks and hobbles off.")
|
||||||
],
|
],
|
||||||
buttons: {
|
buttons: {
|
||||||
'bye': {
|
'bye': {
|
||||||
text: _('say goodbye'),
|
text: _('say goodbye'),
|
||||||
nextScene: 'end'
|
nextScene: 'end'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user