mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-01-29 14:51:40 +00:00
Rearranged files and made tweaks
This commit is contained in:
parent
9d060e1035
commit
4588cf24dc
7 changed files with 67 additions and 43 deletions
|
@ -1,5 +1,9 @@
|
|||
# The Modding Tree changelog:
|
||||
|
||||
- Moved most of the code users will want to edit to mod.js.
|
||||
- Added getStartPoints()
|
||||
- Fixed issues with version number
|
||||
|
||||
### v2.0.5 - 10/16/20
|
||||
- Made more features (including prestige parameters) able to be dynamic.
|
||||
- Layer nodes can be hidden but still take up space with "ghost" visibility
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<script type="text/javascript" src="js/break_eternity.js"></script>
|
||||
<script type="text/javascript" src="js/layerSupport.js"></script>
|
||||
<script type="text/javascript" src="js/layers.js"></script>
|
||||
<script type="text/javascript" src="js/mod.js"></script>
|
||||
<script type="text/javascript" src="js/temp.js"></script>
|
||||
<script type="text/javascript" src="js/game.js"></script>
|
||||
<script type="text/javascript" src="js/utils.js"></script>
|
||||
|
@ -48,7 +49,7 @@
|
|||
<br>
|
||||
<h3>{{VERSION.withName}}</h3>
|
||||
<br>
|
||||
The Modding Tree {{VERSION.tmtNum}} by Acamaeda
|
||||
The Modding Tree {{TMT_VERSION.tmtNum}} by Acamaeda
|
||||
<br>
|
||||
The Prestige Tree made by Jacorb and Aarex
|
||||
<br>
|
||||
|
@ -90,7 +91,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<div id="treeOverlay" class="treeOverlay" v-if="player.tab!='gameEnded'" onscroll="resizeCanvas()" v-bind:class="{ fullWidth: player.tab == 'tree', col: player.tab != 'tree', left: player.tab != 'tree'}">
|
||||
<div id="version" class="overlayThing" style="margin-right: 13px" onclick="showTab('changelog')">{{VERSION.withoutName}}</div>
|
||||
<div id="version" class="overlayThing" style="margin-right: 13px">{{VERSION.withoutName}}</div>
|
||||
<img id="optionWheel" class="overlayThing" v-if="player.tab!='options'" src="options_wheel.png" onclick="showTab('options')"></img>
|
||||
<div id="info" v-if="player.tab!='info'" class="overlayThing" onclick="showTab('info')"><br>i</div>
|
||||
<img id="discord" class="overlayThing" onclick="window.open((modInfo.discordLink ? modInfo.discordLink : 'https://discord.gg/F3xveHV'),'mywindow')" src="discord.png" target="_blank"></img>
|
||||
|
|
45
js/game.js
45
js/game.js
|
@ -3,43 +3,10 @@ var needCanvasUpdate = true;
|
|||
var NaNalert = false;
|
||||
var gameEnded = false;
|
||||
|
||||
|
||||
let modInfo = {
|
||||
name: "The Modding Tree",
|
||||
id: "modbase",
|
||||
pointsName: "points",
|
||||
discordName: "",
|
||||
discordLink: "",
|
||||
changelogLink: "https://github.com/Acamaeda/The-Modding-Tree/blob/master/changelog.md",
|
||||
offlineLimit: 1 // In hours
|
||||
}
|
||||
|
||||
// Set your version in num and name, but leave the tmt values so people know what version it is
|
||||
let VERSION = {
|
||||
num: "2.0.5.1",
|
||||
name: "Pinnacle of Achievement Mountain",
|
||||
tmtNum: "2.0.5.1",
|
||||
tmtName: "Pinnacle of Achievement Mountain"
|
||||
}
|
||||
|
||||
// Determines if it should show points/sec
|
||||
function canGenPoints(){
|
||||
return hasUpgrade("c", 11)
|
||||
}
|
||||
|
||||
// Calculate points/sec!
|
||||
function getPointGen() {
|
||||
if(!canGenPoints())
|
||||
return new Decimal(0)
|
||||
|
||||
let gain = new Decimal(1)
|
||||
if (hasUpgrade("c", 12)) gain = gain.times(upgradeEffect("c", 12))
|
||||
return gain
|
||||
}
|
||||
|
||||
// You can change this if you have things that can be messed up by long tick lengths
|
||||
function maxTickLength() {
|
||||
return(3600000) // Default is 1 hour which is just arbitrarily large
|
||||
// Don't change this
|
||||
const TMT_VERSION = {
|
||||
tmtNum: "2.1",
|
||||
tmtName: "Non-nonsensical"
|
||||
}
|
||||
|
||||
function getResetGain(layer, useType = null) {
|
||||
|
@ -214,7 +181,7 @@ function doReset(layer, force=false) {
|
|||
}
|
||||
|
||||
prevOnReset = {...player} //Deep Copy
|
||||
player.points = (row == 0 ? new Decimal(0) : new Decimal(10))
|
||||
player.points = (row == 0 ? new Decimal(0) : getStartPoints())
|
||||
|
||||
for (let x = row; x >= 0; x--) rowReset(x, layer)
|
||||
rowReset("side", layer)
|
||||
|
@ -235,7 +202,7 @@ function resetRow(row) {
|
|||
player[layer].unlocked = false
|
||||
if (player[layer].unlockOrder) player[layer].unlockOrder = 0
|
||||
}
|
||||
player.points = new Decimal(10)
|
||||
player.points = getStartPoints()
|
||||
updateTemp();
|
||||
resizeCanvas();
|
||||
}
|
||||
|
|
47
js/mod.js
Normal file
47
js/mod.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
let modInfo = {
|
||||
name: "The Modding Tree",
|
||||
id: "modbase",
|
||||
pointsName: "points",
|
||||
discordName: "",
|
||||
discordLink: "",
|
||||
changelogLink: "https://github.com/Acamaeda/The-Modding-Tree/blob/master/changelog.md",
|
||||
offlineLimit: 1, // In hours
|
||||
initialStartPoints: new Decimal (10) // Used for hard resets and new players
|
||||
}
|
||||
|
||||
// Set your version in num and name
|
||||
let VERSION = {
|
||||
num: "2.1",
|
||||
name: "Non-nonsensical!",
|
||||
}
|
||||
|
||||
// Add the names of functions that do something when you call them here. (The ones here are examples)
|
||||
var doNotCallTheseFunctionsEveryTick = ["doReset", "buy", "onPurchase", "blowUpEverything"]
|
||||
|
||||
function getStartPoints(){
|
||||
return new Decimal(modInfo.initialStartPoints)
|
||||
}
|
||||
|
||||
// Determines if it should show points/sec
|
||||
function canGenPoints(){
|
||||
return hasUpgrade("c", 11)
|
||||
}
|
||||
|
||||
// Calculate points/sec!
|
||||
function getPointGen() {
|
||||
if(!canGenPoints())
|
||||
return new Decimal(0)
|
||||
|
||||
let gain = new Decimal(1)
|
||||
if (hasUpgrade("c", 12)) gain = gain.times(upgradeEffect("c", 12))
|
||||
return gain
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Less important things beyond this point!
|
||||
|
||||
// You can change this if you have things that can be messed up by long tick lengths
|
||||
function maxTickLength() {
|
||||
return(3600000) // Default is 1 hour which is just arbitrarily large
|
||||
}
|
|
@ -6,6 +6,11 @@ var activeFunctions = [
|
|||
"buy", "buyMax", "respec", "onComplete", "onPurchase", "onPress", "onClick", "masterButtonPress"
|
||||
]
|
||||
|
||||
var noCall = doNotCallTheseFunctionsEveryTick
|
||||
for (item in noCall) {
|
||||
activeFunctions.push(noCall[item])
|
||||
}
|
||||
|
||||
function setupTemp() {
|
||||
tmp = {}
|
||||
setupTempData(layers, tmp)
|
||||
|
|
|
@ -79,7 +79,7 @@ function startPlayerBase() {
|
|||
keepGoing: false,
|
||||
hasNaN: false,
|
||||
hideChallenges: false,
|
||||
points: new Decimal(10),
|
||||
points: modInfo.initialStartPoints,
|
||||
subtabs: {},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -318,7 +318,7 @@ h1, h2, h3, b, input {
|
|||
}
|
||||
|
||||
#version:hover {
|
||||
transform: scale(1.2, 1.2);
|
||||
transform: scale(1.1, 1.1);
|
||||
right: 4.8px;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue