Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update room.js #677

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions script/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ var Room = {
maxMsg: _("more traps won't help now"),
type: 'building',
cost: function () {
var n = $SM.get('game.buildings["trap"]', true);
var n = $SM.get('
buildings["trap"]', true);
return {
'wood': 10 + (n * 10)
};
Expand Down Expand Up @@ -511,7 +512,7 @@ var Room = {
$SM.set('game.builder.level', -1);
}

// If this is the first time playing, the fire is dead and it's freezing.
// If this is the first time playing, the fire is dead and it's frigid.
// Otherwise grab past save state temp and fire level.
$SM.set('game.temperature', $SM.get('game.temperature.value') === undefined ? this.TempEnum.Freezing : $SM.get('game.temperature'));
$SM.set('game.fire', $SM.get('game.fire.value') === undefined ? this.FireEnum.Dead : $SM.get('game.fire'));
Expand Down Expand Up @@ -564,6 +565,7 @@ var Room = {
/*
* Builder states:
* 0 - Approaching
* 0.5 - Dead
* 1 - Collapsed
* 2 - Shivering
* 3 - Sleeping
Expand All @@ -577,17 +579,17 @@ var Room = {
}
Engine.setTimeout($SM.collectIncome, 1000);

Notifications.notify(Room, _("the room is {0}", Room.TempEnum.fromInt($SM.get('game.temperature.value')).text));
Notifications.notify(Room, _("the fire is {0}", Room.FireEnum.fromInt($SM.get('game.fire.value')).text));
Notifications.notify(Room, _("The room is {0}", Room.TempEnum.fromInt($SM.get('game.temperature.value')).text));
Notifications.notify(Room, _("The fire is {0}", Room.FireEnum.fromInt($SM.get('game.fire.value')).text));
},

options: {}, // Nothing for now

onArrival: function (transition_diff) {
Room.setTitle();
if (Room.changed) {
Notifications.notify(Room, _("the fire is {0}", Room.FireEnum.fromInt($SM.get('game.fire.value')).text));
Notifications.notify(Room, _("the room is {0}", Room.TempEnum.fromInt($SM.get('game.temperature.value')).text));
Notifications.notify(Room, _("The fire is {0}", Room.FireEnum.fromInt($SM.get('game.fire.value')).text));
Notifications.notify(Room, _("The room is {0}", Room.TempEnum.fromInt($SM.get('game.temperature.value')).text));
Room.changed = false;
}
if ($SM.get('game.builder.level') == 3) {
Expand All @@ -597,7 +599,7 @@ var Room = {
stores: { 'wood': 2 }
});
Room.updateIncomeView();
Notifications.notify(Room, _("the stranger is standing by the fire. she says she can help. says she builds things."));
Notifications.notify(Room, _("The stranger is standing by the fire. She says she can help. Says she builds things."));
}

Engine.moveStoresView(null, transition_diff);
Expand All @@ -614,11 +616,14 @@ var Room = {
}
return null;
},
Freezing: { value: 0, text: _('freezing') },
Cold: { value: 1, text: _('cold') },
Mild: { value: 2, text: _('mild') },
Warm: { value: 3, text: _('warm') },
Hot: { value: 4, text: _('hot') }
Frigid: { value: 0, text: _('frigid') },
Freezing: { value: 1, text: _('freezing') },
Cold: { value: 2, text: _('cold') },
Mild: { value: 3, text: _('mild') },
Warm: { value: 4, text: _('warm') },
Hot: { value: 5, text: _('hot') },
Sweating: { value: 6, text: _('sweating') },
Overheating: { value: 7, text: _('overheating') }
},

FireEnum: {
Expand All @@ -631,10 +636,11 @@ var Room = {
return null;
},
Dead: { value: 0, text: _('dead') },
Smoldering: { value: 1, text: _('smoldering') },
Flickering: { value: 2, text: _('flickering') },
Burning: { value: 3, text: _('burning') },
Roaring: { value: 4, text: _('roaring') }
Dying: { valu: 1, text: _('dying') },
Smoldering: { value: 2, text: _('smoldering') },
Flickering: { value: 3, text: _('flickering') },
Burning: { value: 4, text: _('burning') },
Roaring: { value: 5, text: _('roaring') }
},

setTitle: function () {
Expand Down