Skip to content

Commit

Permalink
Update Gatherer and capacity and fix generate gold
Browse files Browse the repository at this point in the history
  • Loading branch information
romaniac01 committed Nov 1, 2024
1 parent 990c7d2 commit 6001494
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 9 deletions.
28 changes: 24 additions & 4 deletions db/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ export function addEffect(name) {
if ((name.startsWith("Convert")) && name !== "ConvertResist" && name !== "ConvertConvertableBuilding" && name !== "Convert2ConvertableBuilding") {
addEffect(name.replace("Convert", "Chaos"))
}
if (name == "AutoGatherGold") {
/*if (name == "AutoGatherGold") {
addEffect(name.replace("AutoGatherGold", "AutoGatherGoldIndia"))
}
}*/
/*
if (name.startsWith("Chaos")) {
console.log(name)
Expand Down Expand Up @@ -554,7 +554,7 @@ const templates = {
},
AutoGatherFood: { name: "Generating Food", icon: "GatherFood", sort: 10 },
AutoGatherGold: { name: "Generating Gold", icon: "GatherGold", sort: 12 },
AutoGatherGoldIndia: { name: "Generating Gold (only India)", icon: "GatherGold", sort: 12 },
//AutoGatherGoldIndia: { name: "Generating Gold (only India)", icon: "GatherGold", sort: 12 },
AutoGatherShrineGather: { name: "Generating Extra Gold at Indian Shrine", icon: "GatherGold", sort: 13 },
AutoGatherTree: { name: "Generating Wood", icon: "GatherTree", sort: 11 },
AutoGatherStone: { name: "Generating Stone", icon: "GatherStone", sort: 13 },
Expand Down Expand Up @@ -1482,7 +1482,27 @@ const templates = {
GathererLimit: {
name: "Gatherer Limit",
icon: "PopulationCount",
sort: 209
sort: 210
},
InitialResourceFood: {
name: "Food Contained",
icon: "CostFood",
sort: 210
},
InitialResourceWood: {
name: "Wood Contained",
icon: "CostWood",
sort: 210
},
InitialResourceGold: {
name: "Gold Contained",
icon: "CostGold",
sort: 210
},
InitialResourceStone: {
name: "Stone Contained",
icon: "CostStone",
sort: 210
}
}

Expand Down
12 changes: 10 additions & 2 deletions db/units/convert-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ export async function convertUnitStats(unit) {
if (unit.GathererLimit) {
stats["GathererLimit"] = unit.GathererLimit
}
if (unit.InitialResource) {
stats["InitialResource" + unit.InitialResource["resourcetype"]] = unit.InitialResource["quantity"]
}

if (unit.Tactics) {
const tactics = await getTactics(unit.Tactics)
Expand Down Expand Up @@ -232,9 +235,14 @@ export async function convertUnitStats(unit) {
if (unit.UnitType.includes("AbstractWall")) {
stats["Hitpoints"] = stats["Hitpoints"] * 1.77
}

if (unit.UnitType.includes("Herdable")) {
stats.AutoGatherGoldIndia = stats.AutoGatherGold
for (let i = 0; i < inactiveActions.length; i++) {
if (inactiveActions[i] === "AutoGatherGold") {
inactiveActions.splice(i)
}
}
// stats.AutoGatherGoldIndia = stats.AutoGatherGold
}


Expand Down
2 changes: 1 addition & 1 deletion public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>https://unitstats.projectceleste.com</loc><lastmod>2024-11-01T12:23:17.714Z</lastmod><changefreq>weekly</changefreq><priority>1.0</priority></url></urlset>
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>https://unitstats.projectceleste.com</loc><lastmod>2024-11-01T20:20:38.510Z</lastmod><changefreq>weekly</changefreq><priority>1.0</priority></url></urlset>
15 changes: 15 additions & 0 deletions src/components/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ export default {
if (stats["ConvertResist"] === 1000) {
stats["ConvertResist"] = Infinity
}
if (stats["InitialResourceFood"] === 999) {
stats["InitialResourceFood"] = Infinity
}
if (stats["InitialResourceWood"] === 999) {
stats["InitialResourceWood"] = Infinity
}
if (stats["InitialResourceGold"] === 999) {
stats["InitialResourceGold"] = Infinity
}
if (stats["InitialResourceStone"] === 999) {
stats["InitialResourceStone"] = Infinity
}
// Remove stats from inactive actions
this.unit.inactiveActions.forEach(a => {
for (let key in stats) {
Expand Down Expand Up @@ -257,6 +269,9 @@ export default {
) {
e = "Pierce DPS per unit"
}
if (this.unit.types.includes("Herdable") && name === "AutoGatherGold") {
e = "Generating Gold (Indian Civ only)"
}
/* Enneris only has Bonus vs Buildings from the RangedAttack2*/
/*if (this.unit.id === "Ro_Shp_Enneris" && name === "DamageBonusBuilding") {
e = "Special Attack Bonus vs Buildings"
Expand Down
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/units.json

Large diffs are not rendered by default.

0 comments on commit 6001494

Please sign in to comment.