forked from Acamaeda/The-Modding-Tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.js
81 lines (62 loc) · 2.09 KB
/
mod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
let modInfo = {
name: "Virus Idle",
id: "virus",
author: "saverofthewo",
pointsName: "Viruses",
modFiles: ["layers.js", "tree.js"],
discordName: "",
discordLink: "",
initialStartPoints: new Decimal (10), // Used for hard resets and new players
offlineLimit: 1, // In hours
}
// Set your version in num and name
let VERSION = {
num: "1.0",
name: "The Start of Virus",
}
let changelog = `<h1>Changelog:</h1><br>
<h3>v0.0</h3><br>
- Made the game<br>`
let winText = `ok so uh im uh you kinda won already so uh update? soon. Yay!`
// If you add new functions anywhere inside of a layer, and those functions have an effect when called, add them here.
// (The ones here are examples, all official functions are already taken care of)
var doNotCallTheseFunctionsEveryTick = ["blowUpEverything"]
function getStartPoints(){
return new Decimal(modInfo.initialStartPoints)
}
// Determines if it should show points/sec
function canGenPoints(){
return true
}
// Calculate points/sec!
function getPointGen() {
if(!canGenPoints())
return new Decimal(0)
let gain = new Decimal(1)
if (hasUpgrade('rat', 11)) gain = gain.times(2);
if (hasUpgrade('rat', 12)) gain = gain.times(2);
if (hasUpgrade("rat", 13)) gain = gain.times(upgradeEffect("rat", 13));
return gain
}
// You can add non-layer related variables that should to into "player" and be saved here, along with default values
function addedPlayerData() { return {
}}
// Display extra things at the top of the page
var displayThings = [
]
// Determines when the game "ends"
function isEndgame() {
return player.points.gte(new Decimal("e308"))
}
// Less important things beyond this point!
// Style for the background, can be a function
var backgroundStyle = {
}
// You can change this if you have things that can be messed up by long tick lengths
function maxTickLength() {
return(3600) // Default is 1 hour which is just arbitrarily large
}
// Use this if you need to undo inflation from an older version. If the version is older than the version that fixed the issue,
// you can cap their current resources with this.
function fixOldSave(oldVersion){
}