HOTFIX: patch atree json for charge, and display code

This commit is contained in:
hppeng 2022-06-30 21:21:25 -07:00
parent 53f502b96d
commit 4632bba69a
3 changed files with 5125 additions and 13 deletions

View file

@ -474,9 +474,6 @@ const atree_collect_spells = new (class extends ComputeNode {
let found_part = false; let found_part = false;
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 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
if (part.name === target_part) { if (part.name === target_part) {
if ('display' in effect) {
part.display = effect.display;
}
if ('multipliers' in effect) { if ('multipliers' in effect) {
for (const [idx, v] of effect.multipliers.entries()) { // python: enumerate() for (const [idx, v] of effect.multipliers.entries()) { // python: enumerate()
part.multipliers[idx] += v; part.multipliers[idx] += v;
@ -503,6 +500,9 @@ const atree_collect_spells = new (class extends ComputeNode {
spell_part.name = target_part; // has some extra fields but whatever spell_part.name = target_part; // has some extra fields but whatever
ret_spell.parts.push(spell_part); ret_spell.parts.push(spell_part);
} }
if ('display' in effect) {
ret_spell.display = effect.display;
}
continue; continue;
} }
case 'convert_spell_conv': case 'convert_spell_conv':

View file

@ -2158,19 +2158,15 @@ const atrees = {
"base_spell": 2, "base_spell": 2,
"spell_type": "damage", "spell_type": "damage",
"scaling": "spell", "scaling": "spell",
"display": "Total Damage", "display": "",
"parts": [ "parts": []
{
"name": "Total Damage",
"hits": {}
}
]
}] }]
}, },
{ {
"display_name": "Heavy Impact", "display_name": "Heavy Impact",
"desc": "After using Charge, violently crash down into the ground and deal damage", "desc": "After using Charge, violently crash down into the ground and deal damage",
"base_abil": "Charge",
"parents": ["Uppercut"], "parents": ["Uppercut"],
"dependencies": [], "dependencies": [],
"blockers": [], "blockers": [],
@ -2190,6 +2186,13 @@ const atrees = {
"target_part": "Heavy Impact", "target_part": "Heavy Impact",
"cost": 0, "cost": 0,
"multipliers": [100, 0, 0, 0, 0, 0] "multipliers": [100, 0, 0, 0, 0, 0]
},
{
"type": "add_spell_prop",
"base_spell": 2,
"target_part": "Contact Damage",
"display": "Contact Damage",
"hits": { "Heavy Impact": 1 }
} }
] ]
}, },
@ -2374,14 +2377,14 @@ const atrees = {
"base_spell": 4, "base_spell": 4,
"spell_type": "damage", "spell_type": "damage",
"scaling": "spell", "scaling": "spell",
"display": "Total Damage Average", "display": "Total Damage",
"parts": [ "parts": [
{ {
"name": "War Scream", "name": "War Scream",
"multipliers": [50, 0, 0, 0, 50, 0] "multipliers": [50, 0, 0, 0, 50, 0]
}, },
{ {
"name": "Total Damage Average", "name": "Total Damage",
"hits": { "War Scream": 1 } "hits": { "War Scream": 1 }
} }
] ]
@ -2656,6 +2659,13 @@ const atrees = {
"base_spell": 2, "base_spell": 2,
"target_part": "Flyby Jab", "target_part": "Flyby Jab",
"multipliers": [20, 0, 0, 0, 0, 40] "multipliers": [20, 0, 0, 0, 0, 40]
},
{
"type": "add_spell_prop",
"base_spell": 2,
"target_part": "Contact Damage",
"display": "Contact Damage",
"hits": { "Flyby Jab": 1 }
} }
] ]
}, },

File diff suppressed because one or more lines are too long