Skip to content

Commit

Permalink
Correct Attack speed
Browse files Browse the repository at this point in the history
Correct Attack speed
  • Loading branch information
romaniac01 committed May 31, 2023
1 parent 40a1239 commit adc1f5f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
22 changes: 19 additions & 3 deletions db/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,22 @@ export async function convertEffects(effects, civ, isAdvisor) {
} else if (type === "Armor") {
type += e.damagetype
} else if (type === "Haste") {
type = "AttackSpeed"
/*type = "AttackSpeed"*/
switch (e.action) {
case "RangedAttack":
type += "DamageRanged"
type = "AttackSpeedDamageRanged"
break
case "BurningAttack":
type = "AttackSpeedDamageRanged"
break
case "RangedAttack2":
type += "DamageRanged"
type = "AttackSpeedDamageRanged"
break
case "MeleeAttack":
type = "AttackSpeedDamageMelee"
break
case "BuildingAttack":
type = "AttackSpeedDamageBuilding"
break
}
} else if (type === "DamageBonusReduction") {
Expand Down Expand Up @@ -1059,6 +1065,16 @@ const templates = {
sort: 36
},
AttackSpeed: { name: "Attack Rate", icon: "DamageOverTime", sort: 0 },
AttackSpeedDamageBuilding: {
name: "Attack Rate",
icon: "DamageOverTime",
sort: 0
},
AttackSpeedDamageMelee: {
name: "Attack Rate",
icon: "DamageOverTime",
sort: 0
},
AttackSpeedDamageRanged: {
name: "Attack Rate",
icon: "DamageOverTime",
Expand Down
15 changes: 14 additions & 1 deletion src/components/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ export default {
switch (effect.type) {
case "Damage":
case "AttackSpeed":
// If type is Damage, apply to all damage subtypes
for (let keyDmg in stats) {
if (
Expand All @@ -398,6 +397,20 @@ export default {
}
}
break
case "AttackSpeedDamageBuilding":
break
case "AttackSpeedDamageMelee":
for (let keyDmg in stats) {
if (
keyDmg === "DamageHand" ||
keyDmg === "DamageCavalry" ||
keyDmg === "DamageSiegeMeleeAttack"
) {
this.setBaseStat(stats, keyDmg)
stats[keyDmg] *= mod
}
}
break
case "AttackSpeedDamageRanged":
;[
"DamageRanged",
Expand Down
2 changes: 1 addition & 1 deletion src/data/advisors.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/data/effects.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/data/milestones.json

Large diffs are not rendered by default.

0 comments on commit adc1f5f

Please sign in to comment.