commit
b07d4d2fa5
5 changed files with 46 additions and 42 deletions
|
@ -8,7 +8,7 @@ The game, of course
|
|||
Additional Contributors, in no particular order:
|
||||
- Kiocifer (Icons!)
|
||||
- IncinerateMe (helping transition to 1.20.3 / CI helper)
|
||||
- puppy (wynn2 ability tree help)
|
||||
- dog (wynn2 ability tree help)
|
||||
- SockMower (ability tree encode/decode optimization)
|
||||
- ITechnically (coding emotional support / misc)
|
||||
- touhoku (best IM)
|
||||
|
|
27
js/atree.js
27
js/atree.js
|
@ -451,22 +451,24 @@ const atree_collect_spells = new (class extends ComputeNode {
|
|||
let ret_spells = new Map();
|
||||
for (const [abil_id, abil] of atree_merged.entries()) {
|
||||
// TODO: Possibly, make a better way for detecting "spell abilities"?
|
||||
if (abil.effects.length == 0) { continue; }
|
||||
|
||||
let ret_spell = deepcopy(abil.effects[0]); // NOTE: do not mutate results of previous steps!
|
||||
let has_spell_def = false;
|
||||
for (const effect of abil.effects) {
|
||||
if (effect.type === 'replace_spell') {
|
||||
has_spell_def = true;
|
||||
// replace_spell just replaces all (defined) aspects.
|
||||
for (const key in effect) {
|
||||
ret_spell[key] = deepcopy(effect[key]);
|
||||
const ret_spell = ret_spells.get(effect.base_spell);
|
||||
if (ret_spell) {
|
||||
// NOTE: do not mutate results of previous steps!
|
||||
for (const key in effect) {
|
||||
ret_spell[key] = deepcopy(effect[key]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ret_spells.set(effect.base_spell, deepcopy(effect));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!has_spell_def) { continue; }
|
||||
}
|
||||
|
||||
const base_spell_id = ret_spell.base_spell;
|
||||
for (const [abil_id, abil] of atree_merged.entries()) {
|
||||
for (const effect of abil.effects) {
|
||||
switch (effect.type) {
|
||||
case 'replace_spell':
|
||||
|
@ -474,7 +476,7 @@ const atree_collect_spells = new (class extends ComputeNode {
|
|||
continue;
|
||||
case 'add_spell_prop': {
|
||||
const { base_spell, target_part = null, cost = 0, behavior = 'merge'} = effect;
|
||||
if (base_spell !== base_spell_id) { continue; } // TODO: redundant? if we assume abils only affect one spell
|
||||
const ret_spell = ret_spells.get(base_spell);
|
||||
// TODO: unjankify this... if ('cost' in ret_spell) { ret_spell.cost += cost; }
|
||||
|
||||
if (target_part === null) {
|
||||
|
@ -496,7 +498,7 @@ const atree_collect_spells = new (class extends ComputeNode {
|
|||
for (const [idx, v] of Object.entries(effect.hits)) { // looks kinda similar to multipliers case... hmm... can we unify all of these three? (make healpower a list)
|
||||
if (idx in part.hits) { part.hits[idx] += v; }
|
||||
else { part.hits[idx] = v; }
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw "uhh invalid spell add effect";
|
||||
|
@ -517,7 +519,7 @@ const atree_collect_spells = new (class extends ComputeNode {
|
|||
}
|
||||
case 'convert_spell_conv':
|
||||
const { base_spell, target_part, conversion } = effect;
|
||||
if (base_spell !== base_spell_id) { continue; } // TODO: redundant? if we assume abils only affect one spell
|
||||
const ret_spell = ret_spells.get(base_spell);
|
||||
const elem_idx = damageClasses.indexOf(conversion);
|
||||
let filter = target_part === 'all';
|
||||
for (let part of ret_spell.parts) { // TODO: replace with Map? to avoid this linear search... idk prolly good since its not more verbose to type in json
|
||||
|
@ -536,7 +538,6 @@ const atree_collect_spells = new (class extends ComputeNode {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
ret_spells.set(base_spell_id, ret_spell);
|
||||
}
|
||||
return ret_spells;
|
||||
}
|
||||
|
|
|
@ -341,7 +341,6 @@ const atrees = {
|
|||
"desc": "When you hit the ground with Arrow Bomb, leave a Trap that damages enemies. (Max 2 Traps)",
|
||||
"archetype": "Trapper",
|
||||
"archetype_req": 2,
|
||||
"base_abil": "Arrow Bomb",
|
||||
"parents": ["Bryophyte Roots"],
|
||||
"dependencies": [],
|
||||
"blockers": [],
|
||||
|
@ -357,10 +356,17 @@ const atrees = {
|
|||
},
|
||||
"effects": [
|
||||
{
|
||||
"type": "add_spell_prop",
|
||||
"base_spell": 3,
|
||||
"target_part": "Basaltic Trap",
|
||||
"multipliers": [140, 30, 0, 0, 30, 0]
|
||||
"type": "replace_spell",
|
||||
"name": "Basaltic Trap",
|
||||
"base_spell": 7,
|
||||
"display": "Trap Damage",
|
||||
"parts": [
|
||||
{
|
||||
"name": "Trap Damage",
|
||||
"type": "damage",
|
||||
"multipliers": [140, 30, 0, 0, 30, 0]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -581,7 +587,7 @@ const atrees = {
|
|||
"desc": "Your Traps will give you 2.85 Mana per second when you stay close to them.",
|
||||
"archetype": "Trapper",
|
||||
"archetype_req": 5,
|
||||
"base_abil": "Arrow Bomb",
|
||||
"base_abil": "Basaltic Trap",
|
||||
"parents": ["More Traps", "Better Arrow Shield"],
|
||||
"dependencies": [],
|
||||
"blockers": [],
|
||||
|
@ -794,6 +800,7 @@ const atrees = {
|
|||
"desc": "Your Traps will be connected by a rope that deals damage to enemies every 0.2s.",
|
||||
"archetype": "Trapper",
|
||||
"archetype_req": 0,
|
||||
"base_abil": "Basaltic Trap",
|
||||
"parents": ["Grape Bomb"],
|
||||
"dependencies": ["Basaltic Trap"],
|
||||
"blockers": [],
|
||||
|
@ -804,20 +811,16 @@ const atrees = {
|
|||
},
|
||||
"effects": [
|
||||
{
|
||||
"type": "replace_spell",
|
||||
"name": "Tangled Traps",
|
||||
"type": "add_spell_prop",
|
||||
"base_spell": 7,
|
||||
"display": "DPS",
|
||||
"parts": [
|
||||
{
|
||||
"name": "Damage Tick",
|
||||
"multipliers": [20, 0, 0, 0, 0, 20]
|
||||
},
|
||||
{
|
||||
"name": "DPS",
|
||||
"hits": { "Damage Tick": 5 }
|
||||
}
|
||||
]
|
||||
"target_part": "Line Damage Tick",
|
||||
"multipliers": [20, 0, 0, 0, 0, 20]
|
||||
},
|
||||
{
|
||||
"type": "add_spell_prop",
|
||||
"base_spell": 7,
|
||||
"target_part": "DPS",
|
||||
"hits": { "Line Damage Tick": 5 }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -874,7 +877,7 @@ const atrees = {
|
|||
"desc": "Allow you to place +6 Traps, but with reduced damage and range.",
|
||||
"archetype": "Trapper",
|
||||
"archetype_req": 10,
|
||||
"base_abil": "Arrow Bomb",
|
||||
"base_abil": "Basaltic Trap",
|
||||
"parents": ["Grape Bomb", "Cheaper Arrow Bomb (2)"],
|
||||
"dependencies": ["Basaltic Trap"],
|
||||
"blockers": [],
|
||||
|
@ -884,8 +887,8 @@ const atrees = {
|
|||
"effects": [
|
||||
{
|
||||
"type": "add_spell_prop",
|
||||
"base_spell": 3,
|
||||
"target_part": "Basaltic Trap",
|
||||
"base_spell": 8,
|
||||
"target_part": "Trap Damage",
|
||||
"cost": 0,
|
||||
"multipliers": [-80, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
@ -1262,7 +1265,7 @@ const atrees = {
|
|||
"desc": "Increase the maximum amount of active Traps you can have by +2.",
|
||||
"archetype": "Trapper",
|
||||
"archetype_req": 0,
|
||||
"base_abil": "Arrow Bomb",
|
||||
"base_abil": "Basaltic Trap",
|
||||
"parents": ["Bouncing Bomb"],
|
||||
"dependencies": ["Basaltic Trap"],
|
||||
"blockers": [],
|
||||
|
@ -1781,7 +1784,7 @@ const atrees = {
|
|||
"desc": "Your Traps will deal +20% more damage for every second they are active (Max +80%)",
|
||||
"archetype": "Trapper",
|
||||
"archetype_req": 0,
|
||||
"base_abil": "Arrow Bomb",
|
||||
"base_abil": "Basaltic Trap",
|
||||
"parents": ["More Shields"],
|
||||
"dependencies": ["Basaltic Trap"],
|
||||
"blockers": [],
|
||||
|
@ -1812,7 +1815,7 @@ const atrees = {
|
|||
"desc": "Add +80% Max Damage to Patient Hunter",
|
||||
"archetype": "Trapper",
|
||||
"archetype_req": 0,
|
||||
"base_abil": "Arrow Bomb",
|
||||
"base_abil": "Basaltic Trap",
|
||||
"parents": ["Grape Bomb"],
|
||||
"dependencies": ["Patient Hunter"],
|
||||
"blockers": [],
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -976,7 +976,7 @@ class SkillPointSetterNode extends ComputeNode {
|
|||
class SumNumberInputNode extends InputNode {
|
||||
compute_func(input_map) {
|
||||
let value = this.input_field.value;
|
||||
if (value === "") { value = 0; }
|
||||
if (value === "") { value = "0"; }
|
||||
|
||||
let input_num = 0;
|
||||
if (value.includes("+")) {
|
||||
|
|
Loading…
Reference in a new issue