Skip to content

Commit

Permalink
Merge pull request #12 from propfeds/dev
Browse files Browse the repository at this point in the history
v0.3.1
  • Loading branch information
propfeds authored May 21, 2023
2 parents ca1b0ee + 1a9777d commit 5c711d4
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 53 deletions.
5 changes: 5 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# To-do List

- 0.3.1
- [ ] Move 225 milestone to 250
- [ ] Increase c2 init cost to 1500 to line up with 4x c1
- [ ] Black hole reliance on activeness (gets weaker with offline progress)

## Balance

- 0.2.6 (dev)
Expand Down
146 changes: 93 additions & 53 deletions theory.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ In this theory, we will be examining the zeta function on the line ` +

return descs[language] || descs.en;
}
var authors = 'Martin_mc, Eylanding, propfeds\n\nThanks to:\nGlen Pugh, for ' +
'his implementation of the Riemann-Siegel formula\nSneaky, Gen & Gaunter, ' +
'for maths consultation\nXLII, for developing the sim and helping to create ' +
'sim strategies';
var version = 0.3;
var authors = 'Martin_mc, original theory idea\nEylanding, physicist with an ' +
'eye patch\npropfeds, mixing & mastering engineer\n\nThanks to:\nGlen Pugh, ' +
'for the Riemann-Siegel formula implementation\nXLII, for teaching the ' +
'ancient Sim language\nSneaky, Gen & Gaunter, for maths consultation';
var version = 0.31;

let gameOffline = false;
let pubTime = 0;
Expand Down Expand Up @@ -82,19 +82,18 @@ const c1ExpTable =
BigNumber.from(1.25)
];
const getc1Exp = (level) => c1ExpTable[level];
const c1Cost = new FirstFreeCost(new ExponentialCost(220, 0.7));
const c1Cost = new FirstFreeCost(new ExponentialCost(220, 0.699));
const getc1 = (level) => Utils.getStepwisePowerSum(level, 2, 8, 0);

const c2Cost = new ExponentialCost(1400, 2.8);
const c2Cost = new ExponentialCost(1400, 0.699 * 4);
const getc2 = (level) => BigNumber.TWO.pow(level);

const bMaxLevel = 12;
const bCost = new CompositeCost(4, new ExponentialCost(1e9, Math.log2(1e12)),
new CompositeCost(4,
new ExponentialCost(BigNumber.from('1e180'), BigNumber.from('1e60').log2()),
new ExponentialCost(BigNumber.from('1e900'), BigNumber.from('1e100').log2())));
const getb = (level) => BigNumber.ONE + level/4;
const bMaxLevel = 3;
const bCost = new CompositeCost(1, new ConstantCost(1e21),
new ExponentialCost(BigNumber.from('1e600'), BigNumber.from('1e300').log2()));
const getb = (level) => BigNumber.TWO.pow(level);
const getbMarginTerm = (level) => BigNumber.TEN.pow(-getb(level));
const bMarginTerm = BigNumber.from(1/100);

const w1Cost = new StepwiseCost(new ExponentialCost(120000, Math.log2(100)/3),
6);
Expand All @@ -103,23 +102,28 @@ const getw1 = (level) => Utils.getStepwisePowerSum(level, 2, 8, 1);
const w2Cost = new ExponentialCost(1e5, Math.log2(10));
const getw2 = (level) => BigNumber.TWO.pow(level);

const w3Cost = new ExponentialCost(BigNumber.TEN.sqrt() *
BigNumber.from('1e599'), BigNumber.from('1e30').log2());
const getw3 = (level) => BigNumber.TWO.pow(level);

const permaCosts =
[
BigNumber.TEN.pow(8),
BigNumber.TEN.pow(14),
BigNumber.TEN.pow(16)
BigNumber.from(1e8),
BigNumber.from(1e14),
BigNumber.from(1e21),
BigNumber.from('1e1000')
];

const tauRate = 0.1;
const pubExp = 2.1;
const pubMult = 2;
const pubExp = 2.102;
const pubMult = BigNumber.TWO;
var getPublicationMultiplier = (tau) => tau.pow(pubExp) * pubMult;
var getPublicationMultiplierFormula = (symbol) =>
`${pubMult}\\times{${symbol}}^{${pubExp}}`;
`${pubMult.toString(0)}\\times{${symbol}}^{${pubExp}}`;

const milestoneCost = new CustomCost((level) =>
{
if(level == 0) return BigNumber.from(21 * tauRate);
if(level == 0) return BigNumber.from(25 * tauRate);
if(level == 1) return BigNumber.from(50 * tauRate);
if(level == 2) return BigNumber.from(125 * tauRate);
if(level == 3) return BigNumber.from(225 * tauRate);
Expand All @@ -133,14 +137,16 @@ const locStrings =
{
en:
{
versionName: 'v0.3',
versionName: 'v0.3.1',
pubTime: 'Time: {0}',
speed: '\\text{speed}',
zExp: '{{{0}}}\\text{{ exponent}}',
half: '\\text{half}',
condition: '\\text{{if }}{{{0}}}',
blackhole: 'Unleash a black hole',
blackholeInfo: 'Decreases {0} as {1} gets closer to the origin'
blackholeInfo: 'Decreases {0} as {1} gets closer to the origin',
warpFive: 'Get 5 penny with consequences',
warpFiveInfo: 'Testing tool: {0}{1}\\ by {2}'
}
};

Expand Down Expand Up @@ -546,16 +552,18 @@ let getCoordString = (x) => x.toFixed(x >= -0.01 ?
(x < -9.99 ? (x < -99.9 ? 0 : 1) : 2)
);

var c1, c2, b, w1, w2, w3;
var c1ExpMs, derivMs, w2Ms, blackholeMs;
var w3Perma, warpFive;

var c1, c2, b, w1, w2;

var normCurrency, derivCurrency;

var init = () =>
{
normCurrency = theory.createCurrency();
derivCurrency = theory.createCurrency('δ', '\\delta');

/* c1
A sea one.
*/
Expand Down Expand Up @@ -586,18 +594,6 @@ var init = () =>
c2.getInfo = (amount) => Utils.getMathTo(getInfo(c2.level),
getInfo(c2.level + amount));
}
/* b
A bee.
*/
{
let getDesc = (level) => getInfo(level);
let getInfo = (level) => `b=${getb(level).toString()}`;
b = theory.createUpgrade(3, normCurrency, bCost);
b.getDescription = (_) => Utils.getMath(getDesc(b.level));
b.getInfo = (amount) => Utils.getMathTo(getInfo(b.level),
getInfo(b.level + amount));
b.maxLevel = bMaxLevel;
}
/* w1
A doublew 1.
*/
Expand All @@ -622,18 +618,58 @@ var init = () =>
getInfo(w2.level + amount));
w2.isAvailable = false;
}
/* w3
A doublew 3.
*/
{
let getDesc = (level) => `w_3=2^{${level}}`;
let getInfo = (level) => `w_3=${getw3(level).toString(0)}`;
w3 = theory.createUpgrade(6, derivCurrency, w3Cost);
w3.getDescription = (_) => Utils.getMath(getDesc(w3.level));
w3.getInfo = (amount) => Utils.getMathTo(getInfo(w3.level),
getInfo(w3.level + amount));
w3.isAvailable = false;
}
/* b
A bee.
*/
{
let getDesc = (level) => `b=2^{${level}}`;;
let getInfo = (level) => `b=${getb(level).toString(0)}`;
b = theory.createUpgrade(3, normCurrency, bCost);
b.getDescription = (_) => Utils.getMath(getDesc(b.level));
b.getInfo = (amount) => Utils.getMathTo(getInfo(b.level),
getInfo(b.level + amount));
b.maxLevel = bMaxLevel;
}

theory.createPublicationUpgrade(0, normCurrency, permaCosts[0]);
theory.createBuyAllUpgrade(1, normCurrency, permaCosts[1]);
theory.createAutoBuyerUpgrade(2, normCurrency, permaCosts[2]);
theory.createAutoBuyerUpgrade(1, normCurrency, permaCosts[1]);
theory.createBuyAllUpgrade(2, normCurrency, permaCosts[2]);
/* w3
Standard doubling.
*/
{
w3Perma = theory.createPermanentUpgrade(3, normCurrency,
new ConstantCost(permaCosts[3]));
w3Perma.description = Localization.getUpgradeAddTermDesc('w_3');
w3Perma.info = Localization.getUpgradeAddTermInfo('w_3');
w3Perma.boughtOrRefunded = (_) =>
{
theory.invalidatePrimaryEquation();
updateAvailability();
}
w3Perma.maxLevel = 1;
}
/* Free penny
For testing purposes
*/
{
let warpFive = theory.createPermanentUpgrade(9001, normCurrency,
warpFive = theory.createPermanentUpgrade(9001, normCurrency,
new FreeCost);
warpFive.description = 'Get 5 penny for free';
warpFive.info = 'Yields 5 penny';
warpFive.description = getLoc('warpFive');
warpFive.info = Localization.format(getLoc('warpFiveInfo'),
Utils.getMath('\\times'), Utils.getMath('\\rho'), Utils.getMath('1e5'));
warpFive.bought = (_) => normCurrency.value = BigNumber.from(1e5) *
(BigNumber.ONE + normCurrency.value);
}
Expand Down Expand Up @@ -662,9 +698,9 @@ var init = () =>
// {
// speedMs = theory.createMilestoneUpgrade(2, speedMaxLevel);
// speedMs.description = Localization.getUpgradeIncCustomDesc(
// getLoc('speed'), `\\times${getSpeed(1)}`);
// getLoc('speed'), `${getSpeed(1)}`);
// speedMs.info = Localization.getUpgradeIncCustomInfo(getLoc('speed'),
// `\\times${getSpeed(1)}`);
// `${getSpeed(1)}`);
// speedMs.isAvailable = false;
// }
/* Unlock delta
Expand Down Expand Up @@ -721,6 +757,7 @@ var updateAvailability = () =>
w1.isAvailable = derivMs.level > 0;
w2Ms.isAvailable = derivMs.level > 0;
w2.isAvailable = w2Ms.level > 0;
w3.isAvailable = w3Perma.level > 0;
blackholeMs.isAvailable = c1ExpMs.level == c1ExpMaxLevel &&
w2Ms.level > 0;
}
Expand All @@ -743,24 +780,26 @@ var tick = (elapsedTime, multiplier) =>
theory.publicationMultiplier;
let w1Term = derivMs.level ? getw1(w1.level) : BigNumber.ONE;
let w2Term = w2Ms.level ? getw2(w2.level) : BigNumber.ONE;
let w3Term = w2Ms.level ? getw3(w3.level) : BigNumber.ONE;
let c1Term = getc1(c1.level).pow(getc1Exp(c1ExpMs.level));
let c2Term = getc2(c2.level);
let bTerm = getb(b.level);
let z = zeta(t);
if(derivMs.level)
{
let dr = z[0] - rCoord;
let di = z[1] - iCoord;
derivTerm = BigNumber.from(Math.sqrt(dr*dr + di*di) / dt);
derivCurrency.value += derivTerm.pow(bTerm) * w1Term * w2Term * bonus;
let tmpZ = zeta(t + 0.0001);
let dr = tmpZ[0] - z[0];
let di = tmpZ[1] - z[1];
derivTerm = BigNumber.from(Math.sqrt(dr*dr + di*di) * 10000);
derivCurrency.value += derivTerm * BigNumber.TWO.pow(bTerm) * w1Term *
w2Term * w3Term * bonus;
}
rCoord = z[0];
iCoord = z[1];
zTerm = BigNumber.from(z[2]).abs();
let bMTerm = getbMarginTerm(b.level);

normCurrency.value += tTerm * c1Term * c2Term * w1Term * bonus /
(zTerm/bTerm + bMTerm);
(zTerm/bTerm + bMarginTerm);

theory.invalidateTertiaryEquation();
theory.invalidateQuaternaryValues();
Expand Down Expand Up @@ -817,17 +856,18 @@ var getEquationOverlay = () =>

var getPrimaryEquation = () =>
{
let rhoPart = `\\dot{\\rho}=\\frac{t\\times c_1
let rhoPart = `\\dot{\\rho}=\\frac{t{\\mkern 1mu}c_1
${c1ExpMs.level ? `^{${getc1Exp(c1ExpMs.level)}}`: ''}c_2
${derivMs.level ? `\\times w_1`: ''}}{|\\zeta(\\frac{1}{2}+it)|/b+10^{-b}}`;
${derivMs.level ? ` w_1`: ''}}{|\\zeta(\\frac{1}{2}+it)|/b+10^{-2}}`;
if(!derivMs.level)
{
theory.primaryEquationHeight = 66;
return rhoPart;
}
let omegaPart = `\\enspace\\dot{\\delta}=w_1${w2Ms.level ? 'w_2' : ''}
\\times|\\zeta '(s)|^b`;
theory.primaryEquationHeight = 72;
let omegaPart = `\\,\\dot{\\delta}=2^bw_1
${w2Ms.level ? 'w_2' : ''}${w3Perma.level ? 'w_3' : ''}\\times
|\\zeta '(\\textstyle\\frac{1}{2}+it)|`;
theory.primaryEquationHeight = 75;
return `\\begin{array}{c}${rhoPart}\\\\${omegaPart}\\end{array}`;
}

Expand Down

0 comments on commit 5c711d4

Please sign in to comment.