Skip to content

Commit b1f0049

Browse files
committed
update Majority of advisor updated, set, attack and dmg, and waiting for 3 changes from PF2K
1 parent 1d10b7c commit b1f0049

20 files changed

Lines changed: 486 additions & 309 deletions

db/advisors/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async function convertAdvisor(a) {
8686
*/
8787

8888
advisor.rarities.push({
89-
description: findLang(stringtablex, a.displaydescriptionid).replace(/\\n/g," "),
89+
description: findLang(stringtablex, a.displaydescriptionid) ? findLang(stringtablex, a.displaydescriptionid).replace(/\\n/g," ") : undefined,
9090
rarity: convertRarity(a.rarity),
9191
effects: effects.filter(duplicateEffects)
9292
})

db/effects.js

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -445,22 +445,22 @@ const templates = {
445445
sort: 0
446446
},
447447
ActionEnableServilia_C: {
448-
name: "Increase Villagers and Caravan Speed by 4%",
448+
name: "Increase Villagers and Caravan Speed Common",
449449
icon: "NONE",
450450
sort: 0
451451
},
452452
ActionEnableServilia_U: {
453-
name: "Increase Villagers and Caravan Speed by 6%",
453+
name: "Increase Villagers and Caravan Speed Uncommon",
454454
icon: "NONE",
455455
sort: 0
456456
},
457457
ActionEnableServilia_R: {
458-
name: "Increase Villagers and Caravan Speed by 8%",
458+
name: "Increase Villagers and Caravan Speed Rare",
459459
icon: "NONE",
460460
sort: 0
461461
},
462462
ActionEnableServilia_E: {
463-
name: "Increase Villagers and Caravan Speed by 10%",
463+
name: "Increase Villagers and Caravan Speed Epic",
464464
icon: "NONE",
465465
sort: 0
466466
},
@@ -735,6 +735,16 @@ const templates = {
735735
icon: "MaximumRange",
736736
sort: 140
737737
},
738+
ConvertAOE: {
739+
name: "Convert in AOE flag",
740+
icon: "NONE",
741+
sort: 141
742+
},
743+
ChaosAOE: {
744+
name: "Convert in AOE flag",
745+
icon: "MaximumRange",
746+
sort: 131
747+
},
738748
MaximumRangeChaos: {
739749
name: "Maximum Chaos Range",
740750
icon: "MaximumRange",
@@ -1321,7 +1331,7 @@ const templates = {
13211331
},
13221332
HealthAuraMaxHP: {
13231333
name: "HP Aura Buff",
1324-
icon: "DamageArea",
1334+
icon: "Hitpoints",
13251335
sort: 116
13261336
},
13271337
Theode_CMaxHPRange: {
@@ -1331,7 +1341,7 @@ const templates = {
13311341
},
13321342
Theode_CMaxHP: {
13331343
name: "HP Aura Buff",
1334-
icon: "DamageArea",
1344+
icon: "Hitpoints",
13351345
sort: 116
13361346
},
13371347
Theode_UMaxHPRange: {
@@ -1341,7 +1351,7 @@ const templates = {
13411351
},
13421352
Theode_UMaxHP: {
13431353
name: "HP Aura Buff",
1344-
icon: "DamageArea",
1354+
icon: "Hitpoints",
13451355
sort: 116
13461356
},
13471357
Theode_RMaxHPRange: {
@@ -1351,7 +1361,7 @@ const templates = {
13511361
},
13521362
Theode_RMaxHP: {
13531363
name: "HP Aura Buff",
1354-
icon: "DamageArea",
1364+
icon: "Hitpoints",
13551365
sort: 116
13561366
},
13571367
Theode_EMaxHPRange: {
@@ -1361,7 +1371,7 @@ const templates = {
13611371
},
13621372
Theode_EMaxHP: {
13631373
name: "HP Aura Buff",
1364-
icon: "DamageArea",
1374+
icon: "Hitpoints",
13651375
sort: 116
13661376
},
13671377
DebuffAuraDamageRange: {
@@ -1376,12 +1386,12 @@ const templates = {
13761386
},
13771387
PerfectAccuracy: {
13781388
name: "Ranged Attack Tracks Target",
1379-
icon: "DamageRanged",
1389+
icon: "NONE",
13801390
sort: 83
13811391
},
13821392
AttackIfContainsUnitsRangedAttack: {
13831393
name: "Only Attack with units inside",
1384-
icon: "DamageRanged",
1394+
icon: "NONE",
13851395
sort: 84
13861396
},
13871397
AttackCooldownRangedAttack: {
@@ -1391,12 +1401,12 @@ const templates = {
13911401
},
13921402
ScaleByContainedUnitsRangedAttack: {
13931403
name: "Damage scales with units inside",
1394-
icon: "DamageRanged",
1404+
icon: "NONE",
13951405
sort: 84
13961406
},
13971407
MaxDmgMaxContained: {
13981408
name: "Damage at max Capacity",
1399-
icon: "BuildPoints",
1409+
icon: "DamageRanged",
14001410
sort: 187
14011411
},
14021412
Training_Garden4Age2: {
@@ -1566,6 +1576,11 @@ const templates = {
15661576
name: "Maximum Monkey Heal Range",
15671577
icon: "MaximumRange",
15681578
sort: 150
1579+
},
1580+
AllowedAge: {
1581+
name: "Allowed Age",
1582+
icon: "NONE",
1583+
sort: 215
15691584
}
15701585
}
15711586

db/units/convert-stats.js

Lines changed: 107 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,26 @@ function convertTactic(tactic, stats, inactiveActions) {
671671
}
672672
}
673673
if (tactic.name.text === "Heal") {
674+
if (tactic.affectsTargetsInCombat === "") {
675+
const healType = "Rate" + tactic.name.text
676+
if (tactic.active === "0") {
677+
inactiveActions.push(healType + "InCombat")
678+
inactiveActions.push("MaximumRange" + tactic.name.text)
679+
}
680+
if (!stats[healType]) {
681+
stats[healType] = parseFloat(tactic.rate[0].text)
682+
stats[healType + "InCombat"] = parseFloat(tactic.rate[0].text)
683+
stats["MaximumRange" + tactic.name.text] = parseFloat(tactic.maxRange)
684+
}
685+
stats[healType + "InCombat"] = stats[healType]
686+
delete stats[healType]
687+
}
688+
if (tactic.aoeHealRadius) {
689+
stats[tactic.name.text + "Area"] = parseFloat(tactic.aoeHealRadius)
690+
}
691+
if (tactic.damageBonus) {
692+
stats["HealdamageBonus" + tactic.damageBonus.type] = parseFloat(tactic.damageBonus.text)
693+
}
674694
if (tactic.active !== "1") {
675695
break
676696
}
@@ -697,63 +717,106 @@ function convertTactic(tactic, stats, inactiveActions) {
697717
}
698718
}
699719
}
700-
if (tactic.affectsTargetsInCombat === "") {
701-
const healType = "Rate" + tactic.name.text
702-
if (tactic.active === "0") {
703-
inactiveActions.push(healType + "InCombat")
704-
inactiveActions.push("MaximumRange" + tactic.name.text)
705-
}
706-
if (!stats[healType]) {
707-
stats[healType] = parseFloat(tactic.rate[0].text)
708-
stats[healType + "InCombat"] = parseFloat(tactic.rate[0].text)
709-
stats["MaximumRange" + tactic.name.text] = parseFloat(tactic.maxRange)
710-
}
711-
stats[healType + "InCombat"] = stats[healType]
712-
delete stats[healType]
713-
}
714-
if (tactic.aoeHealRadius) {
715-
stats[tactic.name.text + "Area"] = parseFloat(tactic.aoeHealRadius)
716-
}
717-
if (tactic.damageBonus) {
718-
stats["HealdamageBonus" + tactic.damageBonus.type] = parseFloat(tactic.damageBonus.text)
719-
}
720720
break
721721
case "Convert": {
722-
if (tactic.anim === "Chaos") {
723-
stats.ChaosStandardConvertable = stats.ConvertStandardConvertable
724-
/*delete stats.ConvertStandardConvertable*/
725-
if (stats.ConvertConvertableCavalry !== undefined) {
726-
stats.ChaosConvertableCavalry = stats.ConvertConvertableCavalry
727-
delete stats.ConvertConvertableCavalry
728-
}
729-
if (stats.ConvertConvertableSiege !== undefined) {
730-
stats.ChaosConvertableSiege = stats.ConvertConvertableSiege
731-
delete stats.ConvertConvertableSiege
732-
}
733-
if (stats.ConvertConvertableInfantry !== undefined) {
734-
stats.ChaosConvertableInfantry = stats.ConvertConvertableInfantry
735-
delete stats.ConvertConvertableInfantry
736-
}
737-
if (stats.MaximumRangeConvert !== undefined) {
738-
stats.MaximumRangeChaos = stats.MaximumRangeConvert
739-
delete stats.MaximumRangeConvert
722+
if (tactic.aoe === "") {
723+
stats.ConvertAOE = 1
724+
if(tactic.active === "0"){
725+
inactiveActions.push("ConvertAOE")
740726
}
741727
}
728+
if (tactic.name.text === "Convert") {
729+
if (tactic.anim === "Chaos") {
730+
stats.ChaosStandardConvertable = stats.ConvertStandardConvertable
731+
/*delete stats.ConvertStandardConvertable*/
732+
if (stats.ConvertConvertableCavalry !== undefined) {
733+
stats.ChaosConvertableCavalry = stats.ConvertConvertableCavalry
734+
delete stats.ConvertConvertableCavalry
735+
}
736+
if (stats.ConvertConvertableSiege !== undefined) {
737+
stats.ChaosConvertableSiege = stats.ConvertConvertableSiege
738+
delete stats.ConvertConvertableSiege
739+
}
740+
if (stats.ConvertConvertableInfantry !== undefined) {
741+
stats.ChaosConvertableInfantry = stats.ConvertConvertableInfantry
742+
delete stats.ConvertConvertableInfantry
743+
}
744+
if (stats.MaximumRangeConvert !== undefined) {
745+
stats.MaximumRangeChaos = stats.MaximumRangeConvert
746+
delete stats.MaximumRangeConvert
747+
}
748+
}
742749

743-
else {
744-
if (Array.isArray(tactic.rate)) {
745-
for (let i = 0; i < tactic.rate.length; i++) {
746-
const rate = tactic.rate[i]
750+
else {
751+
if (Array.isArray(tactic.rate)) {
752+
for (let i = 0; i < tactic.rate.length; i++) {
753+
const rate = tactic.rate[i]
747754

748-
if(tactic.active !== "0"){
749755
if (!stats[tactic.type + rate.type]){
750756
stats[tactic.type + rate.type] = parseFloat(rate.text)
757+
if(tactic.active === "0"){
758+
inactiveActions.push(tactic.type + rate.type)
759+
}
751760
}
752761
}
753762
}
754763
}
764+
765+
break
766+
}
767+
if (tactic.name.text === "Convert2") {
768+
if (tactic.anim === "Chaos") {
769+
stats.Chaos2StandardConvertable = stats.Convert2StandardConvertable
770+
if(tactic.active === "0"){
771+
inactiveActions.push("Chaos2StandardConvertable")
772+
}
773+
/*delete stats.Convert2StandardConvertable*/
774+
if (stats.Convert2ConvertableCavalry !== undefined) {
775+
stats.Chaos2ConvertableCavalry = stats.Convert2ConvertableCavalry
776+
delete stats.Convert2ConvertableCavalry
777+
if(tactic.active === "0"){
778+
inactiveActions.push("Chaos2ConvertableCavalry")
779+
}
780+
}
781+
if (stats.Convert2ConvertableSiege !== undefined) {
782+
stats.Chaos2ConvertableSiege = stats.Convert2ConvertableSiege
783+
delete stats.Convert2ConvertableSiege
784+
if(tactic.active === "0"){
785+
inactiveActions.push("Chaos2ConvertableSiege")
786+
}
787+
}
788+
if (stats.ConvertConvertableInfantry !== undefined) {
789+
stats.Chaos2ConvertableInfantry = stats.Convert2ConvertableInfantry
790+
delete stats.Convert2ConvertableInfantry
791+
if(tactic.active === "0"){
792+
inactiveActions.push("Chaos2ConvertableInfantry")
793+
}
794+
}
795+
if (stats.MaximumRangeConvert !== undefined) {
796+
stats.MaximumRangeChaos2 = stats.MaximumRangeConvert2
797+
delete stats.MaximumRangeConvert2
798+
if(tactic.active === "0"){
799+
inactiveActions.push("MaximumRangeChaos2")
800+
}
801+
}
802+
}
803+
804+
else {
805+
if (Array.isArray(tactic.rate)) {
806+
for (let i = 0; i < tactic.rate.length; i++) {
807+
const rate = tactic.rate[i]
808+
809+
if (!stats["Convert2" + rate.type]){
810+
stats["Convert2" + rate.type] = parseFloat(rate.text)
811+
if(tactic.active === "0"){
812+
inactiveActions.push("Convert2" + rate.type)
813+
}
814+
}
815+
}
816+
}
817+
}
818+
break
755819
}
756-
break
757820
}
758821
}
759822
}

0 commit comments

Comments
 (0)