Skip to content

Commit

Permalink
Merged in dev/alpha (pull request #1239)
Browse files Browse the repository at this point in the history
Dev/beta -> Dev/alpha with a merge conflict fix

* fix unit test

* reducing spaceport effect even further

* Merged in spaceportBalancing (pull request #1233)

Increased Spaceport effect, decreased power consumption

* Increased Spaceport effect, decreased power consumption


Approved-by: Arima B.
* fix siphoning not using necrocornsNaiveFastForward
fix bug where corruption is multiplied by days and divided by ticks per day for comparison of necrocorn per day values in necrocornFastForward

* Merged in master (pull request #1234)

Redshift pacts logic bugfixes

* fix siphoning not using necrocornsNaiveFastForward
fix bug where corruption is multiplied by days and divided by ticks per day for comparison of necrocorn per day values in necrocornFastForward
* Merged in Ziggurat/set-queue_redshift-flag-to-true-on-main-1698452752943 (pull request #1237)

set QUEUE_REDSHIFT flag to true on main
* Merged bloodrizer/kitten-game:master into AZiggurat/kitten-game-ziggurats-fork:master
* Merged bloodrizer/kitten-game:dev/beta into AZiggurat/kitten-game-ziggurats-fork:dev/beta
* Merge branch 'master' into dev/beta

# Conflicts:
#	game.js

* Merge branch 'dev/beta' into dev/alpha

# Conflicts:
#	test/game.test.js
  • Loading branch information
ZigguratV committed Oct 28, 2023
1 parent 5271439 commit 50315c7
Show file tree
Hide file tree
Showing 16 changed files with 426 additions and 445 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v 1.4.9.3
Major:
* Spaceport

v 1.4.9.2
Major:
* Queue
Expand Down
120 changes: 80 additions & 40 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,8 @@ dojo.declare("com.nuclearunicorn.game.ui.Button", com.nuclearunicorn.core.Contro
style: {
position: "relative",
display: this.model.visible ? "block" : "none"
}
},
tabIndex: 0
}, btnContainer);

if (this.model.twoRow) {
Expand Down Expand Up @@ -879,6 +880,7 @@ dojo.declare("com.nuclearunicorn.game.ui.Button", com.nuclearunicorn.core.Contro
this.updateVisible();

dojo.connect(this.domNode, "onclick", this, "onClick");
dojo.connect(this.domNode, "onkeypress", this, "onKeyPress");

this.afterRender();
},
Expand Down Expand Up @@ -906,6 +908,12 @@ dojo.declare("com.nuclearunicorn.game.ui.Button", com.nuclearunicorn.core.Contro

},

onKeyPress: function(event){
if (event.key == "Enter"){
this.onClick(event);
}
},

afterRender: function(){

var prices = this.model.prices;
Expand Down Expand Up @@ -1275,12 +1283,12 @@ ButtonModernHelper = {

// description
var descDiv = dojo.create("div", {
innerHTML: model.description,
innerHTML: controller.getDescription(model),
className: "desc"
}, tooltip);


if (model.metadata && model.metadata.isAutomationEnabled !== undefined){ //TODO: use proper metadata flag
if (model.metadata && typeof(model.metadata.isAutomationEnabled) == "boolean"){ //undefined or null don't count here
dojo.create("div", {
innerHTML: model.metadata.isAutomationEnabled ? $I("btn.aon.tooltip") : $I("btn.aoff.tooltip"),
className: "desc small" + (model.metadata.isAutomationEnabled ? " auto-on" : " auto-off")
Expand Down Expand Up @@ -1461,6 +1469,10 @@ dojo.declare("com.nuclearunicorn.game.ui.ButtonModern", com.nuclearunicorn.game.

updateLink: function(buttonLink, modelLink) {
if (buttonLink) {
if (!modelLink) { //This only ever happens if I mess around with console commands
dojo.destroy(buttonLink.link);
return;
}
buttonLink.link.textContent = modelLink.title;
if (modelLink.cssClass) {buttonLink.link.className = modelLink.cssClass;}
if (modelLink.tooltip) {buttonLink.link.title = modelLink.tooltip;}
Expand Down Expand Up @@ -1499,7 +1511,7 @@ dojo.declare("com.nuclearunicorn.game.ui.BuildingBtnController", com.nuclearunic
}
};
}
if (typeof(model.metadata.isAutomationEnabled) != "undefined" && model.metadata.isAutomationEnabled !== null) {
if (typeof(model.metadata.isAutomationEnabled) == "boolean") {
model.toggleAutomationLink = {
title: model.metadata.isAutomationEnabled ? "A" : "*",
tooltip: model.metadata.isAutomationEnabled ? $I("btn.aon.tooltip") : $I("btn.aoff.tooltip"),
Expand Down Expand Up @@ -1566,8 +1578,14 @@ dojo.declare("com.nuclearunicorn.game.ui.BuildingBtnController", com.nuclearunic
return false;
},

//Called whenever we turn the building on or off.
//The function was previously empty, so I repurposed it for possible non-proportional calculations.
metadataHasChanged: function(model) {
// do nothing
var meta = model.metadata;
if (meta.calculateEffects){
meta.calculateEffects(meta, this.game);
this.game.calendar.cycleEffectsBasics(meta.effects, meta.name); //(Only relevant for space buildings)
}
},

off: function(model, amt) {
Expand Down Expand Up @@ -1978,55 +1996,68 @@ dojo.declare("com.nuclearunicorn.game.ui.BuildingStackableBtnController", com.nu
}
},

/**
* Ultimate entry point to building construction
* @param {*} model
* @param {*} maxBld
*
*/
build: function(model, maxBld){
var meta = model.metadata;
var counter = 0;
if (typeof meta.limitBuild == "number" && meta.limitBuild - meta.val < maxBld){
maxBld = meta.limitBuild - meta.val;
}

if (model.enabled && this.hasResources(model) || this.game.devMode ){
while (this.hasResources(model) && maxBld > 0){
this.incrementValue(model);
this.payPrice(model);

if (!model.enabled && !this.game.devMode){
return 0;
}

while ((this.game.devMode || this.hasResources(model)) && maxBld > 0){
this.incrementValue(model);
this.payPrice(model);

counter++;
maxBld--;
}
counter++;
maxBld--;
}

if (!counter){
return 0;
}

if (counter > 1) {
this.game.msg($I("construct.all.msg", [meta.label, counter]), "notice");
}
if (counter > 1) {
this.game.msg($I("construct.all.msg", [meta.label, counter]), "notice");
}

if (meta.breakIronWill) {
this.game.ironWill = false;
var liberty = this.game.science.getPolicy("liberty");
liberty.calculateEffects(liberty, this.game);
var zebraOutpostMeta = this.game.bld.getBuildingExt("zebraOutpost").meta;
zebraOutpostMeta.calculateEffects(zebraOutpostMeta, this.game);
zebraOutpostMeta.jammed = false;
this.game.diplomacy.onLeavingIW();
}
if (meta.breakIronWill) {
this.game.ironWill = false;
var liberty = this.game.science.getPolicy("liberty");
liberty.calculateEffects(liberty, this.game);
var zebraOutpostMeta = this.game.bld.getBuildingExt("zebraOutpost").meta;
zebraOutpostMeta.calculateEffects(zebraOutpostMeta, this.game);
zebraOutpostMeta.jammed = false;
this.game.diplomacy.onLeavingIW();
}

if (meta.unlocks) {
this.game.unlock(meta.unlocks);
}
if (meta.unlocks) {
this.game.unlock(meta.unlocks);
}

if (meta.calculateEffects){
meta.calculateEffects(meta, this.game);
this.game.calendar.cycleEffectsBasics(meta.effects, meta.name); //(Only relevant for space buildings)
}
if (meta.unlockScheme && meta.val >= meta.unlockScheme.threshold) {
this.game.ui.unlockScheme(meta.unlockScheme.name);
}
if (meta.calculateEffects){
meta.calculateEffects(meta, this.game);
this.game.calendar.cycleEffectsBasics(meta.effects, meta.name); //(Only relevant for space buildings)
}
if (meta.unlockScheme && meta.val >= meta.unlockScheme.threshold) {
this.game.ui.unlockScheme(meta.unlockScheme.name);
}

if (meta.upgrades) {
if (meta.updateEffects) {
meta.updateEffects(meta, this.game);
}
this.game.upgrade(meta.upgrades);
if (meta.upgrades) {
if (meta.updateEffects) {
meta.updateEffects(meta, this.game);
}
}
this.game.upgrade(meta.upgrades);
}

return counter;
},
Expand Down Expand Up @@ -2243,6 +2274,7 @@ dojo.declare("com.nuclearunicorn.game.ui.Panel", [com.nuclearunicorn.game.ui.Con

this.toggle = dojo.create("div", {
innerHTML: this.collapsed ? "+" : "-",
tabIndex: 0,
className: "toggle" + (this.collapsed ? " collapsed" : ""),
style: {
float: "right"
Expand All @@ -2264,6 +2296,7 @@ dojo.declare("com.nuclearunicorn.game.ui.Panel", [com.nuclearunicorn.game.ui.Con
dojo.connect(this.toggle, "onclick", this, function(){
this.collapse(!this.collapsed);
});
dojo.connect(this.toggle, "onkeypress", this, "onKeyPress");

this.panelDiv = panel;

Expand All @@ -2275,6 +2308,13 @@ dojo.declare("com.nuclearunicorn.game.ui.Panel", [com.nuclearunicorn.game.ui.Con
return this.contentDiv;
},


onKeyPress: function(event){
if (event.key == "Enter"){
this.collapse(!this.collapsed);
}
},

collapse: function(isCollapsed){
this.collapsed = isCollapsed;

Expand Down
53 changes: 42 additions & 11 deletions game.js
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,19 @@ dojo.declare("com.nuclearunicorn.game.EffectsManager", null, {
title: $I("effectsMgr.statics.queueCap"),
type: "fixed"
},
//Spaceports
"moonBaseStorageBonus": {
title: $I( "effectsMgr.statics.moonBaseStorageBonus.title" ),
type: "ratio"
},
"planetCrackerStorageBonus": {
title: $I( "effectsMgr.statics.planetCrackerStorageBonus.title" ),
type: "ratio"
},
"cryostationStorageBonus": {
title: $I( "effectsMgr.statics.cryostationStorageBonus.title" ),
type: "ratio"
},
// cycleEffects
"spaceElevator-prodTransferBonus": {
title: $I("effectsMgr.statics.spaceElevator-prodTransferBonus.title"),
Expand Down Expand Up @@ -1795,23 +1808,28 @@ dojo.declare("com.nuclearunicorn.game.ui.GamePage", null, {
featureFlags: {
VILLAGE_MAP: {
beta: true,
main: false
main: false,
mobile: false
},
SPACE_EXPL: {
beta: true,
main: false
main: false,
mobile: false
},
MAUSOLEUM_PACTS:{
beta: true,
main: true
main: true,
mobile: true
},
QUEUE:{
beta: true,
main: true
main: true,
mobile: true
},
QUEUE_REDSHIFT: {
beta: true,
main: false
main: true,
mobile: true
}
},

Expand Down Expand Up @@ -3573,11 +3591,19 @@ dojo.declare("com.nuclearunicorn.game.ui.GamePage", null, {
//console.error("Unable to fetch resource stack for resName '" + resName + "'");
return;
}
stack.push({
name: $I("res.stack.buildings"),
type: "perDay",
value: this.getEffect(res.name + "PerDay")
});
if (resName == "necrocorn"){
stack.push({
name: $I("res.stack.buildings"),
type: "perDay",
value: this.getEffect("necrocornPerDay") + this.religion.pactsManager.getSiphonedCorruption(1)
});
}else{
stack.push({
name: $I("res.stack.buildings"),
type: "perDay",
value: this.getEffect(res.name + "PerDay")
});
}
if(resName == "necrocorn"){
var corruptionStack = [];
corruptionStack.push({
Expand Down Expand Up @@ -3963,9 +3989,13 @@ dojo.declare("com.nuclearunicorn.game.ui.GamePage", null, {
resStringDay = this.processResourcePerTickStack(resStackDay, res, 0), //processResourcePerTickStack can work with perDay stack
resPerDay = this.getResourcePerDay(res.name);
if (this.opts.usePercentageResourceValues){
resStringDay = "<br>" + resStringDay;
resStringDay += "<br> " + $I("res.netGain") + ": " + this.getDisplayValueExt(resPerDay, true, true);
}
return resString + resStringDay;
var totalPerDayDelta = "<br>" + $I("res.netGainPerDay") + ": " +
this.getDisplayValueExt(resPerTick * this.calendar.ticksPerDay + this.getEffect("alicornPerDay"))
;
return resString + resStringDay + totalPerDayDelta;
}
return resString;
},
Expand Down Expand Up @@ -4961,6 +4991,7 @@ dojo.declare("com.nuclearunicorn.game.ui.GamePage", null, {
pacts: this.religion.pactsManager.pacts.map(getName),
challenges: this.challenges.challenges.map(getName)
};
this.upgrade({ buildings: ["warehouse"]});
this.upgrade(metaKeys);
this.upgrade({policies: ["authocracy"]});
},
Expand Down
11 changes: 5 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

<script type="text/javascript">

var version = "1492";
var version = "1493";
var buildRevision = 0;

var loadingProgress = 0,
Expand Down Expand Up @@ -140,7 +140,6 @@
"js/jsx/mid.jsx",
"js/jsx/toolbar.jsx",
"js/jsx/chiral.jsx",
"js/jsx/map.jsx",
"js/jsx/queue.jsx",

//required for defining IReactAware, will be relied upon by js/space
Expand Down Expand Up @@ -319,7 +318,7 @@
<div style="padding-left: 10px; min-width: 0px; max-width: 400px; overflow: hidden; text-overflow: ellipsis;">
<span class="gameTitle">Kittens Game </span>
<span style="font-size: small;">
by <a href="http://kittensgame.com/" class="copyright" target="_blank">bloodrizer</a>
by <a href="http://kittensgame.com/" class="copyright" target="_blank" tabindex="-1">bloodrizer</a>
</span>
<!--- a Dark Souls of incremental gaming -->

Expand All @@ -332,9 +331,9 @@
</span>

<span style="font-size: small;">
<a href="http://kittensgame.com/alpha" title="experimental, unstable" target="_blank" style="opacity:0.6;">&alpha;</a>
<a href="http://kittensgame.com/beta" title="experimental, stable" target="_blank">&beta;</a>
<a href="http://kittensgame.com/web" title="RC, nighty build" target="_blank">ML</a>
<a href="http://kittensgame.com/alpha" tabindex="0" title="experimental, unstable" target="_blank" style="opacity:0.6;">&alpha;</a>
<a href="http://kittensgame.com/beta" tabindex="0" title="experimental, stable" target="_blank">&beta;</a>
<a href="http://kittensgame.com/web" tabindex="0" title="RC, nighty build" target="_blank">ML</a>
</span>
</div>

Expand Down
Loading

0 comments on commit 50315c7

Please sign in to comment.