diff --git a/docs/buyables.md b/docs/buyables.md
index 592c9b1..49002a2 100644
--- a/docs/buyables.md
+++ b/docs/buyables.md
@@ -3,6 +3,8 @@
Buyables are things that can be bought multiple times with scaling costs. If you set a respec function,
the player can reset the purchases to get their currency back.
+You can use buyableEffect(layer, id) to get the current effects of a buyable.
+
Buyables should be formatted like this:
```js
diff --git a/docs/challenges.md b/docs/challenges.md
index 01de2b3..60fcbe3 100644
--- a/docs/challenges.md
+++ b/docs/challenges.md
@@ -1,5 +1,12 @@
# Challenges
+Useful functions for dealing with Challenges and implementing their effects:
+
+- inChall(layer, id): determine if the player is in a given challenge (or another challenge on the same layer that counts as this one)
+- hasChall(layer, id): determine if the player has completed the challenge
+- challEffect(layer, id): Returns the current effects of the challenge, if any
+
+
Challenges are stored in the following format:
```js
@@ -14,11 +21,8 @@ Challenges are stored in the following format:
}
```
-You can use inChall(layer, id) and hasChall(layer, id) to determine if the player is currently in a challenge,
-or has completed the challenge, respectively. These are useful for implementing effects.
-
Each challenge should have an id where the first digit is the row and the second digit is the column.
-Individual upgrades can have these features:
+Individual Challenges can have these features:
- name: Name of the challenge, can be a string or a function
diff --git a/docs/custom-tab-layouts.md b/docs/custom-tab-layouts.md
index 604c642..05472d7 100644
--- a/docs/custom-tab-layouts.md
+++ b/docs/custom-tab-layouts.md
@@ -38,6 +38,9 @@ These are the existing components, but you can create more in v.js:
- buyables: Display all of the buyables for this layer, as appropriate. The argument optional, and is the size of the
boxes in pixels.
+- upgrade, milestone, chall, buyable: An individual upgrade, challenge, etc. The argument is the id.
+ This can be used if you want to have upgrades split up across multiple subtabs, for example.
+
- toggle: A toggle button that toggles a bool value. The data is a pair that identifies what bool to toggle, [layer, id]
- row: Display a list of components horizontally. The argument is an array of components in the tab layout format.
diff --git a/docs/milestones.md b/docs/milestones.md
index 874c899..9af8fd2 100644
--- a/docs/milestones.md
+++ b/docs/milestones.md
@@ -11,7 +11,7 @@ Milestones should be formatted like this:
}
```
-You can use inChall(layer, id) and hasChall(layer, id) to determine if the player is currently in a challenge,
+You can use hasMilestone(layer, id) to determine if the player has a given milestone
Milestone features:
diff --git a/docs/upgrades.md b/docs/upgrades.md
index e58f347..9ee6675 100644
--- a/docs/upgrades.md
+++ b/docs/upgrades.md
@@ -2,21 +2,26 @@
Upgrades are stored in the following format:
+Useful functions for dealing with Upgrades and implementing their effects:
+
+- hasUpg(layer, id): determine if the player has the upgrade
+- ugpEffect(layer, id): Returns the current effects of the upgrade, if any
+
+Hint: Basic point gain is calculated in game.js's "getPointGain".
+
+
```js
upgrades: {
rows: # of rows
cols: # of columns
11: {
desc:() => "Blah",
- etc
+ more features
}
etc
}
```
-You can use hasUpg(layer, id) to determine if the player has an upgrade. This is useful for implementing bonuses.
-Hint: Basic point gain is calculated in game.js's "getPointGain".
-
Each upgrade should have an id where the first digit is the row and the second digit is the column.
Individual upgrades can have these features:
diff --git a/index.html b/index.html
index 39ce8a2..bc761c1 100644
--- a/index.html
+++ b/index.html
@@ -49,11 +49,12 @@
-
v1.3: Finally some real progress!
+
v1.3: Tabbing out
-
Added subtabs! And also a ???Component
-
Added ???Big component
-
Added h-line, v-line and image-display components.
+
Added subtabs! And also a Micro-tab component to let you make smaller subtab-esque areas anywhere.
+
Added points/sec display (can be disabled).
+
Added h-line, v-line and image-display components, plus components for individual upgrades, challenges, and milestones.
+
Added upgEffect, buyableEffect, and challEffect functions.
Added "hide completed challenges" setting.
Moved old changelogs to a separate place.
@@ -67,7 +68,7 @@
{{VERSION.withName}}
- The Modding Tree and code refactor by Acamaeda
+ The Modding Tree by Acamaeda
The Prestige Tree made by Jacorb and Aarex
@@ -125,7 +126,9 @@
You have
{{format(player.points)}}
{{modInfo.pointsName}}
-
+
+ ({{format(getPointGen())}}/sec)
+
diff --git a/js/game.js b/js/game.js
index 0a98de7..244722f 100644
--- a/js/game.js
+++ b/js/game.js
@@ -6,15 +6,21 @@ var gameEnded = false;
let VERSION = {
num: "1.3",
- name: "Finally some real progress!"
+ name: "Tabbing Out"
}
+// Calculate points/sec!
function getPointGen() {
let gain = new Decimal(1)
- if (hasUpg("c", 12)) gain = gain.times(layers.c.upgrades[12].effect())
+ if (hasUpg("c", 12)) gain = gain.times(upgEffect("c", 12))
return gain
}
+// Determines if it should show points/sec
+function showPointGen(){
+ return (true)
+}
+
// Function to determine if the player is in a challenge
function inChallenge(layer, id){
let chall = player[layer].active
@@ -206,6 +212,18 @@ function hasChall(layer, id){
return (player[layer].challs.includes(toNumber(id)))
}
+function upgEffect(layer, id){
+ return (tmp.upgrades[layer][id].effect)
+}
+
+function challEffect(layer, id){
+ return (tmp.challs[layer][id].effect)
+}
+
+function buyableEffect(layer, id){
+ return (tmp.buyables[layer][id].effect)
+}
+
function canAffordPurchase(layer, thing, cost) {
if (thing.currencyInternalName){
let name = thing.currencyInternalName
diff --git a/js/layers.js b/js/layers.js
index a85e698..dd06a60 100644
--- a/js/layers.js
+++ b/js/layers.js
@@ -21,7 +21,7 @@ addLayer("c", {
gainMult() { // Calculate the multiplier for main currency from bonuses
mult = new Decimal(1)
if (hasUpg(this.layer, 166)) mult = mult.times(2) // These upgrades don't exist
- if (hasUpg(this.layer, 120)) mult = mult.times(this.upgrades[12].effect())
+ if (hasUpg(this.layer, 120)) mult = mult.times(upgEffect(this.layer, 120))
return mult
},
gainExp() { // Calculate the exponent on main currency from bonuses
diff --git a/js/v.js b/js/v.js
index 9327cad..4206150 100644
--- a/js/v.js
+++ b/js/v.js
@@ -114,39 +114,43 @@ function loadVue() {
`
})
-
-
Vue.component('challs', {
props: ['layer'],
template: `