Skip to content

Commit

Permalink
Update Search components primarily consumables
Browse files Browse the repository at this point in the history
  • Loading branch information
romaniac01 committed May 7, 2024
1 parent fcd184a commit d5aae15
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 9 deletions.
2 changes: 1 addition & 1 deletion db/advisors/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function buildSearchString(apiAdvisor: APIAdvisor, advisor: Advisor

Object.keys(advisor.rarities).forEach(rarity => {
builder.add(rarity)
builder.addStrict(advisor.rarities[rarity].description)
builder.addStrict(`${advisor.rarities[rarity].description.replace(/\s/g, "")}`)
})

return builder.build()
Expand Down
7 changes: 3 additions & 4 deletions db/consumables/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ import { searchByVendor } from "../shared/search-tags"
export async function buildSearchString(consumable: Consumable, apiConsumable: ApiConsumable): Promise<string> {
const builder = new SearchBuilder()

builder.add("consumables")

builder.addStrict(consumable.id)
builder.add(consumable.name)

Object.keys(consumable.rarities).forEach(rarity => {
builder.add(rarity)
builder.addStrict(consumable.rarities[rarity].description)
builder.addStrict(`${consumable.rarities[rarity].description.replace(/\s/g, "")}`)
builder.addStrict(consumable.rarities[rarity].id)
builder.addStrict(consumable.rarities[rarity].createdUnits)
/*builder.addStrict(consumable.rarities[rarity].createdUnits)*/
builder.addStrict(`age${consumable.rarities[rarity].requiredage}`)
})

if (isSummer2020Consumable(apiConsumable)) {
Expand Down
2 changes: 1 addition & 1 deletion db/interfaces/Consumable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface ConsumableRarity {
cooldowntime: number | undefined
activetime: number | undefined
radius: number | undefined
requiredage: number | undefined
requiredage: number
placement: string | undefined
cooldownstackingclass: number | undefined
design: string | undefined
Expand Down
48 changes: 48 additions & 0 deletions src/app/help/help.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,52 @@
</div>
</details>

<details>
<summary>Consumables — Properties</summary>

<div class="__grid">
<span>Name</span>
<span>Labor of the Empire</span>

<span>Rarity</span>
<span>"Common"</span>

<span>Age</span>
<span>Age 1</span>

<span>Description</span>
<span>Summons 12 Villagers</span>

<span>Vendor ID</span>
<span>"A02_Cap_BasicStore01"</span>

<span>Vendor Name</span>
<span>"Farafra General Store"</span>

<span>Vendor Location</span>
<span>"Farafra Oasis"</span>
</div>
</details>

<details>
<summary>Consumables — Keywords</summary>

<div class="__grid">

<span>Event</span>
<span>halloween, winter, reward, summer</span>

<span>Usable in or outside of Quest</span>
<span>quest</span>

<span>Sold</span>
<span>buyable, purchaseable, shop, store, vendor, sold</span>

<span>Currency</span>
<span>coins, money, gold, points, tokens, coin, empire, sparta,
crete, halloween, winter, summer</span>
</div>
</details>


</div>
2 changes: 1 addition & 1 deletion src/app/interfaces/Consumable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface ConsumableRarity {
cooldowntime: number | undefined
activetime: number | undefined
radius: number | undefined
requiredage: number | undefined
requiredage: number
placement: string | undefined
cooldownstackingclass: number | undefined
design: string | undefined
Expand Down
2 changes: 1 addition & 1 deletion src/assets/db/advisors.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/db/consumables.json

Large diffs are not rendered by default.

0 comments on commit d5aae15

Please sign in to comment.