Skip to content

Commit

Permalink
A few bugfixes & Easter eggs (#45)
Browse files Browse the repository at this point in the history
* Prevent NULL year & season from showing in the log if you don't have Calendar

* Fix hash level not being properly reset at 0 hashes

* Easter egg will disappear on April 2

* Easter egg: pumpkin spice in October

* Hide redeemGiftBtn if elderBox resource is hidden from resource pane
  • Loading branch information
Brent-Call authored Apr 14, 2024
1 parent 1f259e8 commit ec4beed
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
8 changes: 8 additions & 0 deletions js/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,14 @@ dojo.declare("classes.managers.ResourceManager", com.nuclearunicorn.core.TabMana
res.value = Math.min(res.value, res.maxValue);
continue;
}
if (res.name == "spice") { //This is a hack, will probably have to come up with a better system for this later
var now = new Date();
if (now.getMonth() == 9 && game.colorScheme == "spooky" && i18nLang.getLanguage() == "en") {
res.title = $I("resources.spice.title.october");
} else {
res.title = $I("resources.spice.title");
}
}

if (res.unlocked == false && res.value > 0){
res.unlocked = true;
Expand Down
10 changes: 9 additions & 1 deletion js/space.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,14 @@ dojo.declare("classes.managers.SpaceManager", com.nuclearunicorn.core.TabManager
self.effects["hashRateLevel"] = 0;
}
self.effects["gflopsConsumption"] = 0.1;

//Hide all hash-related things from the tooltip if we don't have any hashes:
if (hr == 0) {
self.effects["hashrate"] = 0;
self.effects["nextHashLevelAt"] = 0;
self.effects["hrProgress"] = 0;
self.effects["hashRateLevel"] = 0;
}
}
}
]
Expand Down Expand Up @@ -1106,7 +1114,7 @@ dojo.declare("classes.managers.SpaceManager", com.nuclearunicorn.core.TabManager
}
}

if (bld.action && bld.val > 0){
if (bld.action && (bld.val > 0 || bld.name == "entangler")){ //Entanglers need to update hashrate level if we import a save that has 0 of them
var amt = bld.action(bld, this.game);
if (typeof(amt) != "undefined") {
bld.lackResConvert = amt != 1 && bld.on != 0;
Expand Down
8 changes: 6 additions & 2 deletions js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ dojo.declare("classes.ui.DesktopUI", classes.ui.UISystem, {
if (now.getDate() == 1 && now.getMonth() == 3) {
$(".console-intro").css("font-size", "300%").addClass("blaze").text($I("console.intro.zebra"));
} else {
$(".console-intro").text($I("console.intro"));
$(".console-intro").css("font-size", "100%").removeClass("blaze").text($I("console.intro"));
}

React.render($r(WLeftPanel, {
Expand Down Expand Up @@ -1079,7 +1079,11 @@ dojo.declare("classes.ui.DesktopUI", classes.ui.UISystem, {
}

if (insertDateHeader) {
this.game.console.msg($I("calendar.year.ext", [messageLatest.year, messageLatest.seasonTitle]), "date", null, false);
if (!messageLatest.year || !messageLatest.seasonTitle) {
this.game.console.msg($I("ui.log.link"), "date", null, false);
} else {
this.game.console.msg($I("calendar.year.ext", [messageLatest.year, messageLatest.seasonTitle]), "date", null, false);
}
}

if (messageLatest.type === "date") {
Expand Down
4 changes: 3 additions & 1 deletion js/village.js
Original file line number Diff line number Diff line change
Expand Up @@ -3372,7 +3372,8 @@ dojo.declare("com.nuclearunicorn.game.ui.tab.Village", com.nuclearunicorn.game.u
}),
controller: new classes.village.ui.VillageButtonController(this.game, {
updateVisible: function (model) {
model.visible = !this.game.isEldermass() && (this.game.resPool.get("elderBox").value > 0);
var elderBox = this.game.resPool.get("elderBox");
model.visible = !this.game.isEldermass() && (elderBox.value > 0) && !elderBox.isHidden;
}
})
}, this.game);
Expand Down Expand Up @@ -3415,6 +3416,7 @@ dojo.declare("com.nuclearunicorn.game.ui.tab.Village", com.nuclearunicorn.game.u

this.huntBtn && this.huntBtn.update();
this.festivalBtn && this.festivalBtn.update();
this.redeemGiftBtn && this.redeemGiftBtn.update();

this.mapPanel && this.mapPanel.update();
this.mapWgt && this.mapWgt.update();
Expand Down
1 change: 1 addition & 0 deletions res/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,7 @@
"resources.slab.title": "slab",
"resources.sorrow.title": "sorrow",
"resources.spice.title": "spice",
"resources.spice.title.october": "pumpkin spice",
"resources.starchart.title": "starchart",
"resources.steel.title": "steel",
"resources.tMythril.title": "T-Mythril",
Expand Down

0 comments on commit ec4beed

Please sign in to comment.