Skip to content

Commit

Permalink
Adds Elder Dragon Region
Browse files Browse the repository at this point in the history
  • Loading branch information
painttist committed Dec 13, 2023
1 parent 5eaeff9 commit ab51a3a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
9 changes: 6 additions & 3 deletions UI/src/modules/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export const regionRefID = {
Aatrox: 19,
Ryze: 20,
Neeko: 21,
PoroKing: 22
PoroKing: 22,
ElderDragon: 23,
}

export const regionNames = {
Expand All @@ -43,7 +44,8 @@ export const regionNames = {
19: "faction_Aatrox_Name",
20: "faction_Ryze_Name",
21: "faction_Neeko_Name",
22: "faction_PoroKing_Name"
22: "faction_PoroKing_Name",
23: "card_08RU014_Name", // Official name seems to be card_08RU014_Name
}

export const factionNames = {
Expand All @@ -67,5 +69,6 @@ export const factionNames = {
19: "Aatrox",
20: "Ryze",
21: "Neeko",
22: "Poro King"
22: "Poro King",
23: "Elder Dragon",
}
24 changes: 24 additions & 0 deletions UI/src/modules/getFactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const getFactions = (code) => {
regionID = regionRefID.Neeko
} else if (card.name == "The Poro King") {
regionID = regionRefID.PoroKing
} else if (card.name == "Elder Dragon") {
regionID = regionRefID.ElderDragon
}

if (champFactions.indexOf(regionID) == -1) {
Expand Down Expand Up @@ -254,6 +256,26 @@ const getFactions = (code) => {
}
}

const getFollowerFactionsElderDragon = () => {
for (var j in cards) {
// Second loop to get followerFactions
var card = baseStore.sets_en[cards[j].code]
if (
card &&
card.rarityRef != "Champion" &&
card.regions &&
card.regions.length == 1 &&
!(card.cost >= 6) && // Filter out all cards that cost 6+
card.collectible
) {
var regionID = regionRefID[card.regionRefs[0]]
if (factionIDs.indexOf(regionID) == -1) {
factionIDs.push(regionID)
}
}
}
}

if (factionIDs.includes(regionRefID.Bard)) {
getFollowerFactionsBard()
} else if (factionIDs.includes(regionRefID.Jhin)) {
Expand All @@ -274,6 +296,8 @@ const getFactions = (code) => {
getFollowerFactionsPoroKing()
} else if (factionIDs.includes(regionRefID.Neeko)) {
getFollowerFactionsNeeko()
} else if (factionIDs.includes(regionRefID.ElderDragon)) {
getFollowerFactionsElderDragon()
}
else {
for (var j in cards) {
Expand Down

0 comments on commit ab51a3a

Please sign in to comment.