1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-02-16 09:41:41 +00:00
This commit is contained in:
Acamaeda 2020-10-19 19:52:52 -04:00
parent 1df3fac4b6
commit 7f1fbe058d
8 changed files with 23 additions and 5 deletions

View file

@ -1,5 +1,11 @@
# The Modding Tree changelog:
- Added buyUpgrade function (buyUpg still works though)
- Added author name to modInfo.
- Fixes to outdated information in docs.
- Improvements to Discord links.
- Thank you to thepaperpilot for contributing to this update!
### v2.1.1 - 10/17/20
- Added resource-display component, which displays the base currency for the prestige layer, as well as the best
and/or total of this layer's prestige currency.

View file

@ -43,7 +43,7 @@ The benefits of using Github:
2. To edit your project, click "open in VSCode" in Github Desktop.
3. Open game.js in VSCode, and look at the top part where it says "modInfo". On the lines below that, change
3. Open mod.js in VSCode, and look at the top part where it says "modInfo". On the lines below that, change
the mod's name to whatever you want, and change the id as well. (It can be any string value, and it's used to determine
where the savefile is. Make it something that's probably unique, and don't change it again later.)

View file

@ -178,7 +178,7 @@ Key:
- increaseUnlockOrder: **optional**, an array of layer ids. When this layer is unlocked for the first time, the unlockOrder value
for any not-yet-unlocked layers in this list increases. This can be used to make them harder to unlock.
- should_notify: **optional**, a function to return true if this layer should be highlighted in the tree.
- shouldNotify: **optional**, a function to return true if this layer should be highlighted in the tree.
The layer will automatically be highlighted if you can buy an upgrade whether you have this or not.
- componentStyles: **optional**, An object that contains a set of functions returning CSS objects.
@ -186,7 +186,7 @@ Key:
```js
componentStyles: {
"challenges"() {return {'height': '200px'}},
"challenge"() {return {'height': '200px'}},
"prestige-button"() {return {'color': '#AA66AA'}},
},
```

View file

@ -9,6 +9,7 @@ Here's a breakdown of what's in it:
- modInfo is where most of the basic configuration for the mod is. It contains:
- name: The name of your mod. (a string)
- id: The id for your mod, a unique string that is used to determine savefile location. Setting it is important!
- author: The name of the author, displayed in the info tab.
- pointsName: This changes what is displayed instead of "points" for the main currency. (It does not affect it in the code.)
- discordName, discordLink: If you have a Discord server or other discussion place, you can add a link to it.
"discordName" is the text on the link, and "discordLink" is the url of an invite.

View file

@ -4,6 +4,7 @@ Useful functions for dealing with Upgrades and implementing their effects:
- hasUpgrade(layer, id): determine if the player has the upgrade
- upgradeEffect(layer, id): Returns the current effects of the upgrade, if any
- buyUpgrade(layer, id): Buys an upgrade directly (if affordable)
Hint: Basic point gain is calculated in game.js's "getPointGain".

View file

@ -31,8 +31,9 @@
<br>
<button class="longUpg can" onclick="hardReset(true)">Play Again</button>&nbsp;&nbsp;&nbsp;&nbsp;<button class="longUpg can" onclick="keepGoing()">Keep Going</button>
<br><br><br>
<a class="link" href="https://discord.gg/F3xveHV" target="_blank">The Modding Tree Discord</a><br>
<a class="link" href="http://discord.gg/wwQfgPa" target="_blank">Main Prestige Tree Discord</a><br>
<span v-if="modInfo.discordLink"><a class="link" v-bind:href="modInfo.discordLink" target="_blank">{{modInfo.discordName}}</a><br></span>
<a class="link" href="https://discord.gg/F3xveHV" target="_blank" v-bind:style="modInfo.discordLink ? {'font-size': '16px'} : {}">The Modding Tree Discord</a><br>
<a class="link" href="http://discord.gg/wwQfgPa" target="_blank" v-bind:style="{'font-size': '16px'}">Main Prestige Tree server</a><br>
<br><br>
If you would like to speedrun this, press Play Again and record your attempt, then submit on the Discord Server in the channel #speedrun-submissions.
<br><br><br>
@ -48,6 +49,10 @@
<h2>{{modInfo.name}}</h2>
<br>
<h3>{{VERSION.withName}}</h3>
<span v-if="modInfo.author">
<br>
Made by {{modInfo.author}}
</span>
<br>
The Modding Tree {{TMT_VERSION.tmtNum}} by Acamaeda
<br>

View file

@ -1,6 +1,7 @@
let modInfo = {
name: "The ??? Tree",
id: "mymod",
author: "nobody",
pointsName: "points",
discordName: "",
discordLink: "",

View file

@ -447,6 +447,10 @@ function canAffordPurchase(layer, thing, cost) {
}
}
function buyUpgrade(layer, id) {
buyUpg(layer, id)
}
function buyUpg(layer, id) {
if (!player[layer].unlocked) return
if (!tmp[layer].upgrades[id].unlocked) return