postc5 and kong shop

This commit is contained in:
IvarK 2017-10-04 06:55:27 +03:00
parent 7d5673e3ae
commit edf03e0a10
4 changed files with 182 additions and 34 deletions

View File

@ -55,18 +55,33 @@
<button id="bigcrunch" style="font-family: Typewriter; font-size: 50px; width: 360px; height: 100px;" class="tabbtn">Big Crunch</button>
</div>
<div>
<button id="dimensionsbtn" style="font-family: Typewriter; font-size: 25px" class="tabbtn">Dimensions</button>
<button id="optionsbtn" style="font-family: Typewriter; font-size: 25px" class="tabbtn">Options</button>
<button id="statisticsbtn" style="font-family: Typewriter; font-size: 25px" class="tabbtn">Statistics</button>
<button id="achievementsbtn" style="font-family: Typewriter; font-size: 25px" class="tabbtn">Achievements</button>
<button id="challengesbtn" style="font-family: Typewriter; font-size: 25px" class="tabbtn">Challenges</button>
<button id="infinitybtn" style="font-family: Typewriter; font-size: 25px" class="infinitybtn">Infinity</button>
<button id="dimensionsbtn" style="font-family: Typewriter; font-size: 24px" class="tabbtn">Dimensions</button>
<button id="optionsbtn" style="font-family: Typewriter; font-size: 24px" class="tabbtn">Options</button>
<button id="statisticsbtn" style="font-family: Typewriter; font-size: 24px" class="tabbtn">Statistics</button>
<button id="achievementsbtn" style="font-family: Typewriter; font-size: 24px" class="tabbtn">Achievements</button>
<button id="challengesbtn" style="font-family: Typewriter; font-size: 24px" class="tabbtn">Challenges</button>
<button id="infinitybtn" style="font-family: Typewriter; font-size: 24px" class="infinitybtn">Infinity</button>
<button id="shopbtn" style="font-family: Typewriter; font-size: 24px" class="tabbtn" onclick="showTab('shop')">Shop</button>
</div>
<div id="emptiness" class="tab" style="font-size: 150%">
<br> The world has collapsed on itself due to excess of antimatter.
<br>
<br>
</div>
<div id="shop" class="tab" style="font-size: 15px" >
<div align="center">
<br>
<span> Double your IP gain from all sources. Forever. </span><br>
<button class="greedbtn" onclick="kongregate.mtx.purchaseItems(['doubleip'], onPurchase())">50 Kreds</button>
<br><br><br>
<span> Double all your dimension multipliers (dimensions 1-8). Forever. </span><br>
<button class="greedbtn" onclick="kongregate.mtx.purchaseItems(['doublemult'], onPurchase())">30 Kreds</button>
<br><br><br>
<span>Get 6 hours worth of offline production. (Doesn't work for autobuyers)</span><br>
<button class="greedbtn" onclick="kongregate.mtx.purchaseItems(['timeskip'], onPurchaseTimeSkip())">10 Kreds</button>
<br>
</div>
</div>
<div id="dimensions" class="tab">
<table class="table" align="center" style="margin: auto" id="dimTabButtons">
<tr>
@ -834,6 +849,34 @@
</div>
</td>
</tr>
<tr>
<td>
<div class="challengediv" id="postc5div" style="height: 125px; display: none">
<span>When buying dimensions 1-4 or tickspeed, everything with costs bigger or equal increases. When buying dimensions 5-8, everything with costs smaller or equal increases</span>
<br>
<br>
<div class="outer">
<button id="postc5" class="challengesbtn" onclick="startChallenge('postc5', new Decimal('1e10000'))">Start</button>
<br>
<span>Goal: (temp) 1e10000</span><br>
<span>Reward: You will want to kill yourself</span>
</div>
</div>
</td>
<td>
<div class="challengediv" id="postc6div" style="height: 125px; display: none">
<span>There's an exponentially rising matter that divides the multiplier on all of your dimensions.</span>
<br>
<br>
<div class="outer">
<button id="postc6" class="challengesbtn" onclick="startChallenge('postc6', new Decimal('1e13000'))">Start</button>
<br>
<span>Goal: 1e13000</span><br>
<span>Reward: All normal dimension multipliers become multiplier^1.2</span>
</div>
</div>
</td>
</tr>
</table>
</div>

View File

@ -27,7 +27,7 @@
NUMERALS = '0123456789abcdef',
// The natural logarithm of 10 (1025 digits).
LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',
LN10 = '2.30258509299404568401799145468436420760110148862877297603332790096757260967735248023599',
// Pi (1025 digits).
PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',
@ -41,7 +41,7 @@
// The maximum number of significant digits of the result of a calculation or base conversion.
// E.g. `Decimal.config({ precision: 20 });`
precision: 20, // 1 to MAX_DIGITS
precision: 5, // 1 to MAX_DIGITS
// The rounding mode used when rounding to `precision`.
//

View File

@ -164,6 +164,9 @@ function get_cookie(cookie_name) {
}
let kongIPMult = 1
let kongDimMult = 1
@ -324,12 +327,12 @@ function onLoad() {
loadAutoBuyerSettings();
updateLastTenRuns()
if (player.currentChallenge == "challenge12" || player.currentChallenge == "challenge9" || player.currentChallenge == "challenge5" || player.currentChallenge == "postc1" || player.currentChallenge == "postc4") document.getElementById("quickReset").style.display = "inline-block";
if (player.currentChallenge == "challenge12" || player.currentChallenge == "challenge9" || player.currentChallenge == "challenge5" || player.currentChallenge == "postc1" || player.currentChallenge == "postc4" || player.currentChallenge == "postc5") document.getElementById("quickReset").style.display = "inline-block";
else document.getElementById("quickReset").style.display = "none";
if (player.break == true) document.getElementById("break").innerHTML = "FIX INFINITY"
document.getElementById("infiMult").innerHTML = "Multiply infinity points from all sources by 2 <br>currently: "+shortenDimensions(player.infMult) +"x<br>Cost: "+shortenCosts(player.infMultCost)+" IP"
document.getElementById("infiMult").innerHTML = "Multiply infinity points from all sources by 2 <br>currently: "+shortenDimensions(player.infMult * kongIPMult) +"x<br>Cost: "+shortenCosts(player.infMultCost)+" IP"
document.getElementById("notation").innerHTML = "Notation: " + player.options.notation
@ -646,6 +649,8 @@ function getDimensionFinalMultiplier(tier) {
if (tier == 2) multiplier = multiplier.pow(1.7)
}
multiplier = multiplier.times(player.achPow);
multiplier = multiplier.times(kongDimMult)
multiplier = multiplier.times(Decimal.max(Decimal.pow(player.infinityPower, 7), 1))
@ -869,7 +874,7 @@ function updateDimensions() {
document.getElementById("infi23").innerHTML = "Fourth and Fifth Dimension power <br>" + formatValue(player.options.notation, dimMults(), 1, 1) + "x<br>Cost: 1 IP"
document.getElementById("infi31").innerHTML = "Production increase over time in current infinity<br>Currently: " + Decimal.max(Math.pow(player.thisInfinityTime / 2400, 0.25), 1).toFixed(2) + "x<br>Cost: 3 IP"
document.getElementById("infi32").innerHTML = "Bonus for unspent Infinity Points on 1st Dimension<br>(Currently " + formatValue(player.options.notation, Decimal.pow(player.infinityPoints/2,1.5).plus(1), 2, 2) + "x)<br>Cost: 5 IP"
document.getElementById("infi34").innerHTML = "Infinity Point generation (based on fastest infinity) <br>(Currently "+shortenDimensions(player.infMult)+" every " + timeDisplay(player.bestInfinityTime*10) + ")<br>Cost: 10 IP"
document.getElementById("infi34").innerHTML = "Infinity Point generation (based on fastest infinity) <br>(Currently "+shortenDimensions(player.infMult * kongIPMult)+" every " + timeDisplay(player.bestInfinityTime*10) + ")<br>Cost: 10 IP"
document.getElementById("postinfi11").innerHTML = "Power up all dimensions based on total antimatter produced<br>Currently: "+ Math.pow(player.totalmoney.e+1, 0.5).toFixed(2)+"x<br>Cost: "+shortenCosts(1e4)+" IP"
document.getElementById("postinfi21").innerHTML = "Power up all dimensions based on current antimatter<br>Currently: "+ Math.pow(player.money.e+1, 0.5).toFixed(2)+"x<br>Cost: "+shortenCosts(5e4)+" IP"
document.getElementById("postinfi31").innerHTML = "Tickspeed cost multiplier increase <br>"+player.tickSpeedMultDecrease+"x -> "+(player.tickSpeedMultDecrease-1)+"x<br>Cost: "+shortenCosts(player.tickSpeedMultDecreaseCost) +" IP"
@ -1258,7 +1263,8 @@ function buyTickSpeed() {
}
player.money = player.money.minus(player.tickSpeedCost);
if (player.currentChallenge != "challenge5") player.tickSpeedCost = player.tickSpeedCost.times(player.tickspeedMultiplier);
if (player.currentChallenge != "challenge5" && player.currentChallenge != "postc5") player.tickSpeedCost = player.tickSpeedCost.times(player.tickspeedMultiplier);
else if (player.currentChallenge == "postc5") multiplyPC5Costs(player.tickSpeedCost, 0)
else multiplySameCosts(player.tickSpeedCost)
if (player.tickSpeedCost.gte(Number.MAX_VALUE)) player.tickspeedMultiplier = player.tickspeedMultiplier.times(player.tickSpeedMultDecrease);
if (player.currentChallenge == "challenge2" || player.currentChallenge == "postc1") player.chall2Pow = 0
@ -1278,7 +1284,8 @@ function buyMaxTickSpeed() {
if (!canBuyTickSpeed()) return false
while (player.money.gt(player.tickSpeedCost)) {
player.money = player.money.minus(player.tickSpeedCost);
if (player.currentChallenge != "challenge5") player.tickSpeedCost = player.tickSpeedCost.times(player.tickspeedMultiplier);
if (player.currentChallenge != "challenge5" && player.currentChallenge != "postc5") player.tickSpeedCost = player.tickSpeedCost.times(player.tickspeedMultiplier);
else if (player.currentChallenge == "postc5") multiplyPC5Costs(player.tickSpeedCost, 0)
else multiplySameCosts(player.tickSpeedCost)
if (player.tickSpeedCost.gte(Number.MAX_VALUE)) player.tickspeedMultiplier = player.tickspeedMultiplier.times(player.tickSpeedMultDecrease);
player.tickspeed = player.tickspeed.times(getTickSpeedMultiplier());
@ -1359,6 +1366,23 @@ function multiplySameCosts(cost) {
}
function multiplyPC5Costs(cost, tier) {
const tiers = [ null, "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eight" ];
if (tier < 5) {
for (var i = 1; i<9; i++) {
if (player[tiers[i] + "Cost"].e <= cost.e) player[tiers[i] + "Cost"] = player[tiers[i] + "Cost"].times(player.costMultipliers[i-1])
}
if (player.tickSpeedCost.e >= cost.e) player.tickSpeedCost = player.tickSpeedCost.times(player.tickspeedMultiplier)
} else {
for (var i = 1; i<9; i++) {
if (player[tiers[i] + "Cost"].e >= cost.e) player[tiers[i] + "Cost"] = player[tiers[i] + "Cost"].times(player.costMultipliers[i-1])
}
if (player.tickSpeedCost.e <= cost.e) player.tickSpeedCost = player.tickSpeedCost.times(player.tickspeedMultiplier)
}
}
function canBuyDimension(tier) {
if (tier == 9 ) {
if (player.secondAmount.equals(0)) return false
@ -1471,8 +1495,8 @@ function buyOneDimension(tier) {
if (player[name + 'Bought'] === 10) {
player[name + 'Bought'] = 0;
player[name + 'Pow'] = player[name + 'Pow'].times(getDimensionPowerMultiplier(tier));
if (player.currentChallenge != "challenge5") player[name + 'Cost'] = player[name + 'Cost'].times((getDimensionCostMultiplier(tier)));
if (player.currentChallenge != "challenge5" && player.currentChallenge != "postc5") player[name + 'Cost'] = player[name + 'Cost'].times((getDimensionCostMultiplier(tier)));
else if (player.currentChallenge == "postc5") multiplyPC5Costs(player[name + 'Cost'], tier)
else multiplySameCosts(cost);
if (player[name + 'Cost'].gte(Number.MAX_VALUE)) player.costMultipliers[tier-1] = player.costMultipliers[tier-1].times(player.dimensionMultDecrease)
@ -1524,8 +1548,9 @@ function buyManyDimension(tier) {
player[name + 'Amount'] = player[name + 'Amount'].plus(10 - player[name + 'Bought']);
player[name + 'Bought'] = 0;
player[name + 'Pow'] = player[name + 'Pow'].times(getDimensionPowerMultiplier(tier));
if (player.currentChallenge != "challenge5" ) player[name + 'Cost'] = player[name + 'Cost'].times((getDimensionCostMultiplier(tier)));
else multiplySameCosts(player[name + 'Cost']);
if (player.currentChallenge != "challenge5" && player.currentChallenge != "postc5" ) player[name + 'Cost'] = player[name + 'Cost'].times((getDimensionCostMultiplier(tier)));
else if (player.currentChallenge == "postc5") multiplyPC5Costs(player[name + 'Cost'], tier)
else multiplySameCosts(player[name + 'Cost']);
if (player[name + 'Cost'].gte(Number.MAX_VALUE)) player.costMultipliers[tier-1] = player.costMultipliers[tier-1].times(player.dimensionMultDecrease)
if (player.currentChallenge == "challenge2" || player.currentChallenge == "postc1") player.chall2Pow = 0;
if (player.currentChallenge == "challenge8" || player.currentChallenge == "postc1") clearDimensions(tier-1);
@ -1576,7 +1601,8 @@ function buyManyDimensionAutobuyer(tier, bulk) {
var x = bulk
while (player.money.gte(player[name + "Cost"].times(10)) && x > 0) {
player.money = player.money.minus(player[name + "Cost"].times(10))
if (player.currentChallenge != "challenge5") player[name + "Cost"] = player[name + "Cost"].times(getDimensionCostMultiplier(tier))
if (player.currentChallenge != "challenge5" && player.currentChallenge != "postc5") player[name + "Cost"] = player[name + "Cost"].times(getDimensionCostMultiplier(tier))
else if (player.currentChallenge == "postc5") multiplyPC5Costs(player[name + 'Cost'], tier)
else multiplySameCosts(player[name + 'Cost'])
player[name + "Amount"] = player[name + "Amount"].plus(10)
player[name + "Pow"] = player[name + "Pow"].times(getDimensionPowerMultiplier(tier))
@ -1798,7 +1824,8 @@ document.getElementById("maxall").onclick = function () {
if ((player.currentChallenge == "challenge12" || player.currentChallenge == "postc1") && player.matter.equals(0)) player.matter = new Decimal(1);
if (player.currentChallenge == "challenge2" || player.currentChallenge == "postc1") player.chall2Pow = 0;
player.money = player.money.minus(player[name + "Cost"].times(10))
if (player.currentChallenge != "challenge5") player[name + "Cost"] = player[name + "Cost"].times(getDimensionCostMultiplier(tier))
if (player.currentChallenge != "challenge5" && player.currentChallenge != "postc5") player[name + "Cost"] = player[name + "Cost"].times(getDimensionCostMultiplier(tier))
else if (player.currentChallenge == "postc5") multiplyPC5Costs(player[name + 'Cost'], tier)
else multiplySameCosts(player[name + 'Cost'])
player[name + "Amount"] = player[name + "Amount"].plus(10)
player[name + "Pow"] = player[name + "Pow"].times(getDimensionPowerMultiplier(tier))
@ -1855,7 +1882,7 @@ document.getElementById("infiMult").onclick = function() {
player.infinityPoints = player.infinityPoints.minus(player.infMultCost)
player.infMult *= 2
player.infMultCost *= 10
document.getElementById("infiMult").innerHTML = "Multiply infinity points from all sources by 2 <br>currently: "+player.infMult +"x<br>Cost: "+shortenCosts(player.infMultCost)+" IP"
document.getElementById("infiMult").innerHTML = "Multiply infinity points from all sources by 2 <br>currently: "+shorten(player.infMult * kongIPMult) +"x<br>Cost: "+shortenCosts(player.infMultCost)+" IP"
}
}
@ -2476,7 +2503,7 @@ function breakInfinity() {
}
function gainedInfinityPoints() {
return Decimal.floor(Decimal.pow(10, Decimal.log10(player.money).dividedBy(308).minus(0.75)).times(player.infMult))
return Decimal.floor(Decimal.pow(10, Decimal.log10(player.money).dividedBy(308).minus(0.75)).times(player.infMult * kongIPMult))
}
@ -2962,8 +2989,8 @@ document.getElementById("bigcrunch").onclick = function () {
player.challenges.push(player.currentChallenge);
}
if (!player.break || player.currentChallenge != "") {
player.infinityPoints = player.infinityPoints.plus(player.infMult);
addTime(player.thisInfinityTime, player.infMult)
player.infinityPoints = player.infinityPoints.plus(player.infMult * kongIPMult);
addTime(player.thisInfinityTime, player.infMult * kongIPMult)
}
else {
player.infinityPoints = player.infinityPoints.plus(gainedInfinityPoints())
@ -3278,7 +3305,7 @@ function startChallenge(name, target) {
document.getElementById("eightRow").style.display= "none";
if (name == "challenge12" || player.currentChallenge == "postc1") document.getElementById("matter").style.display = "block";
else document.getElementById("matter").style.display = "none";
if (name == "challenge12" || name == "challenge9" || name == "challenge5" || player.currentChallenge == "postc1" || player.currentChallenge == "postc4") document.getElementById("quickReset").style.display = "inline-block";
if (name == "challenge12" || name == "challenge9" || name == "challenge5" || player.currentChallenge == "postc1" || player.currentChallenge == "postc4" || player.currentChallenge == "postc5") document.getElementById("quickReset").style.display = "inline-block";
else document.getElementById("quickReset").style.display = "none";
updateTickSpeed();
showTab('dimensions');
@ -3402,7 +3429,7 @@ setInterval(function() {
} catch (err) {console.log("Couldn't load Kongregate API")}
}, 10000)
const nextAt = [new Decimal("1e2000"), new Decimal("1e5000"), new Decimal("1e10000"), new Decimal("1e14000"), new Decimal("1e3000003")]
const nextAt = [new Decimal("1e2000"), new Decimal("1e5000"), new Decimal("1e10000"), new Decimal("1e14000"), new Decimal("1e16000"), new Decimal("1e18000"), new Decimal("1e9999999")]
setInterval(function() {
if (getDimensionFinalMultiplier(1).gte(new Decimal("1e308")) &&
@ -3437,10 +3464,11 @@ setInterval(function() {
player.postChallUnlocked += 1
updateChallenges()
}
infDimPow = 1
let temp = 1
for (var i=0; i < player.challenges.length; i++) {
if (player.challenges[i].includes("post")) infDimPow *= 1.5
if (player.challenges[i].includes("post")) temp *= 1.5
}
infDimPow = temp
}, 1000)
@ -3472,7 +3500,7 @@ setInterval(function () {
if (player.infinityUpgrades.includes("passiveGen")) player.partInfinityPoint += diff / player.bestInfinityTime;
if (player.partInfinityPoint >= 10) {
player.partInfinityPoint -= 10;
player.infinityPoints = player.infinityPoints.plus(player.infMult);
player.infinityPoints = player.infinityPoints.plus(player.infMult * kongIPMult);
}
if (player.infinityUpgrades.includes("infinitiedGeneration")) player.partInfinitied += diff / player.bestInfinityTime;
@ -4260,11 +4288,72 @@ function init() {
kongregateAPI.loadAPI(function () {
window.kongregate = kongregateAPI.getAPI();
});
updateKongPurchases()
} catch (err) {console.log("Couldn't load Kongregate API")}
//if (typeof kongregate === 'undefined') document.getElementById("shopbtn").style.display = "none"
}
//kongregate purchases
function updateKongPurchases() {
console.log("updating kong purchases")
kongregate.mtx.requestItemList(["ip"], ipItems())
function ipItems(result) {
console.log("checking for ip mult")
let mult = 1
for(var i = 0; i < result.data.length; i++) {
var item = result.data[i];
console.log((i+1) + ". " + item.identifier + ", " +
item.id + "," + item.name);
if (item.identifier == "doubleip") mult *= 2
}
kongIPMult = mult
}
kongregate.mtx.requestItemList(["dim"], dimItems())
function dimItems(result) {
console.log("checking for dim mult")
let mult = 1
for(var i = 0; i < result.data.length; i++) {
var item = result.data[i];
console.log((i+1) + ". " + item.identifier + ", " +
item.id + "," + item.name);
if (item.identifier == "doublemult") mult *= 2
}
kongDimMult = mult
}
}
function onPurchase(result) {
console.log("purchasing...")
if (result.success) {
console.log("purchase successfull!")
updateKongPurchases()
}
}
function onPurchaseTimeSkip(result) {
if (result.success) {
player.lastUpdate -= 21600000
}
}
//Playfab stuff
@ -4476,12 +4565,12 @@ window.onload = function() {
init();
var totalMult = Math.pow(player.totalmoney.e+1, 0.5)
var currentMult = Math.pow(player.money.e+1, 0.5)
var infinitiedMult = Math.log10(player.infinitied)*10
var achievementMult = Math.max(Math.pow((player.achievements.length-30), 3)/40,1)
var challengeMult = Decimal.max(10*3000/worstChallengeTime, 1)
var unspentBonus = Decimal.pow(player.infinityPoints.dividedBy(2),1.5).plus(1)
var totalMult = 1
var currentMult = 1
var infinitiedMult = 1
var achievementMult = 1
var challengeMult = 1
var unspentBonus = 1
setInterval( function() {
totalMult = Math.pow(player.totalmoney.e+1, 0.5)
currentMult = Math.pow(player.money.e+1, 0.5)

View File

@ -557,6 +557,22 @@
border-radius: 5px;
}
.greedbtn {
height: 40px;
width: 100px;
background-color: #f2d729;
border: 1px solid red;
border-radius: 5px;
font-family: TypeWriter;
transition-duration: 0.2s;
}
.greedbtn:hover {
cursor: pointer;
background-color: #9E913A;
}
@keyframes glow {