Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add artillery zones to maps #337

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions resolvers/traderResolver.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ export default {
return context.data.worker.item.getItem(context, info, data.currencyItem);
},
taskUnlock(data, args, context, info) {
if (data.vendor.taskUnlock) return context.data.worker.task.get(context, info, data.vendor.taskUnlock);
return null;
if (!data.vendor.taskUnlock) {
return null;
}
return context.data.worker.task.get(context, info, data.vendor.taskUnlock);
},
buyLimit(data) {
return data.vendor.buyLimit;
Expand All @@ -60,14 +62,17 @@ export default {
return context.data.worker.trader.getLocale(trader.name, context, info);
},
async normalizedName(data, args, context, info) {
return (await context.data.worker.trader.get(context, info, data.trader_id)).normalizedName;
const trader = await context.data.worker.trader.get(context, info, data.trader_id);
return trader.normalizedName;
},
trader(data, args, context, info) {
return context.data.worker.trader.get(context, info, data.trader_id);
},
taskUnlock(data, args, context, info) {
if (data.taskUnlock) return context.data.worker.task.get(context, info, data.taskUnlock);
return null;
if (!data.taskUnlock) {
return null;
}
return context.data.worker.task.get(context, info, data.taskUnlock);
},
},
TraderPrice: {
Expand Down
13 changes: 13 additions & 0 deletions schema-static.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,22 @@ type Map {
hazards: [MapHazard]
lootContainers: [LootContainerPosition]
stationaryWeapons: [StationaryWeaponPosition]
artillery: MapArtillerySettings
#svg: MapSvg
}

type MapArtillerySettings {
zones: [MapArtilleryZone]
}

type MapArtilleryZone {
position: MapPosition
outline: [MapPosition]
top: Float
bottom: Float
radius: Float @deprecated(reason: "Use outline instead.")
}

type MapExtract {
id: ID!
name: String
Expand Down
Loading