Skip to content

Commit

Permalink
Improve commodity descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincollins committed Oct 4, 2024
1 parent 8ac103c commit 428ea56
Show file tree
Hide file tree
Showing 8 changed files with 430 additions and 388 deletions.
2 changes: 1 addition & 1 deletion resources/data/edcd/fdevids/commodity.csv
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ id,symbol,category,name
128924329,Benitoite,Minerals,Benitoite
128924330,Grandidierite,Minerals,Grandidierite
128924331,Alexandrite,Minerals,Alexandrite
128924332,Opal,Minerals,Void Opal
128924332,Opal,Minerals,Void Opals
128924333,RockforthFertiliser,Chemicals,Rockforth Fertiliser
128924334,AgronomicTreatment,Chemicals,Agronomic Treatment
128961249,Tritium,Chemicals,Tritium
Expand Down
4 changes: 2 additions & 2 deletions resources/data/edcd/fdevids/rare_commodity.csv
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ id,symbol,market_id,category,name
128667082,RusaniOldSmokey,3229255680,Legal Drugs,Rusani Old Smokey
128667083,YasoKondiLeaf,3223088640,Legal Drugs,Yaso Kondi Leaf
128667084,ChateauDeAegaeon,3228416768,Legal Drugs,Chateau De Aegaeon
128667085,WatersOfShintara,128666762,Medicines,The Waters of Shintara
128667085,WatersOfShintara,128666762,Medicines,Waters of Shintara
128667668,OphiuchiExinoArtefacts,3228939264,Consumer Items,Ophiuch Exino Artefacts
128667669,BakedGreebles,3229378560,Foods,Baked Greebles
128667670,CetiAepyornisEgg,3222560256,Foods,Aepyornis Egg
Expand All @@ -84,7 +84,7 @@ id,symbol,market_id,category,name
128667681,BurnhamBileDistillate,3230224384,Legal Drugs,Burnham Bile Distillate
128667682,HIPOrganophosphates,3227036160,Chemicals,HIP Organophosphates
128667683,JaradharrePuzzlebox,3230754816,Consumer Items,Jaradharre Puzzle Box
128667684,KorroKungPellets,3228726272,Chemicals,Koro Kung Pellets
128667684,KorroKungPellets,3228726272,Chemicals,Korro Kung Pellets
128667685,LFTVoidExtractCoffee,3229028864,Foods,Void Extract Coffee
128667686,HonestyPills,3229561344,Medicines,Honesty Pills
128667687,NonEuclidianExotanks,3224135424,Machinery,Non Euclidian Exotanks
Expand Down
4 changes: 2 additions & 2 deletions resources/data/rare-commodities-with-count.json
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@
"symbol": "WatersOfShintara",
"market_id": "128666762",
"category": "Medicines",
"name": "The Waters of Shintara",
"name": "Waters of Shintara",
"limit": 12
},
{
Expand Down Expand Up @@ -684,7 +684,7 @@
"symbol": "KorroKungPellets",
"market_id": "3228726272",
"category": "Chemicals",
"name": "Koro Kung Pellets",
"name": "Korro Kung Pellets",
"limit": 20
},
{
Expand Down
22 changes: 18 additions & 4 deletions scripts/build-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,23 +274,37 @@ async function codexArticles () {
codexPages.forEach(codexPage => {
if (!codexPage?.quote) return

// These are names that are different in the wiki to how they are listed in the fdevids file
// (even after attempting to clean up errors in the file, not 100% sure which name is
// canonical for these cases)
if (codexPage.title == 'Galactic Travel Guides') codexPage.title = 'Galactic Travel Guide'
if (codexPage.title == 'Political Prisoner') codexPage.title = 'Political Prisoners'
if (codexPage.title == 'Hostage') codexPage.title = 'Hostages'
if (codexPage.title == 'Auto Fabricators') codexPage.title = 'Auto-Fabricators'

commodities.map(commodity => {
if (commodity.name === codexPage.title) {
if (commodity.name.replace(/ /img, '').toLowerCase() === codexPage.title.replace(/ /img, '').toLowerCase()) {
commodity.description = codexPage.quote
commodityDescriptions[codexPage.title] = codexPage.quote
commodityDescriptions[commodity.symbol.toLowerCase()] = codexPage.quote
}
allCommodities[commodity.symbol.toLowerCase()] = commodity
})

rareCommodities.map(rareCommodity => {
if (rareCommodity.name === codexPage.title) {
if (rareCommodity.name.replace(/ /img, '').toLowerCase() === codexPage.title.replace(/ /img, '').toLowerCase()) {
rareCommodity.description = codexPage.quote
commodityDescriptions[codexPage.title] = codexPage.quote
commodityDescriptions[rareCommodity.symbol.toLowerCase()] = codexPage.quote
}
rareCommodity.rare = true
allCommodities[rareCommodity.symbol.toLowerCase()] = rareCommodity
})
})

Object.keys(allCommodities).forEach(name => {
const commodity = allCommodities[name]
if (!commodity.description || commodity.description == '') console.warn(`Warning: Commodity "${commodity.symbol}" has no description`)
})

const allCommoditiesSortedList = {}
Object.keys(allCommodities).sort().forEach(k => allCommoditiesSortedList[k] = allCommodities[k])

Expand Down
46 changes: 30 additions & 16 deletions src/service/data/all-commodites.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"category": "Foods",
"name": "Eden Apples of Aerial",
"limit": 15,
"rare": true
"rare": true,
"description": "A native plant that bears fruit resembling an apple with a silver lustre. Originally inedible, but through genetic modification the neurotoxins have been stripped away leaving what is now seen as a delicacy."
},
"aganipperush": {
"id": "128667068",
Expand Down Expand Up @@ -300,7 +301,8 @@
"id": "128049228",
"symbol": "AutoFabricators",
"category": "Technology",
"name": "Auto-Fabricators"
"name": "Auto-Fabricators",
"description": "High speed, low cost fabricators that can build almost any design out of basic resources."
},
"azcancriformula42": {
"id": "128667080",
Expand All @@ -309,7 +311,8 @@
"category": "Technology",
"name": "Az Cancri Formula 42",
"limit": 9,
"rare": true
"rare": true,
"description": "Formula 42 achieves incredible results, transforming even the most arid of desert worlds into fertile utopias. Beyond its name, all aspects of this product are kept under the highest secrecy. However, people don't ask questions when it delivers time and again."
},
"bakedgreebles": {
"id": "128667669",
Expand Down Expand Up @@ -479,7 +482,8 @@
"category": "Consumer Items",
"name": "Buckyball Beer Mats",
"limit": 25,
"rare": true
"rare": true,
"description": "Double-sided drinks mats originally commissioned in 3302. One side bears the Buckyball Racing Club logo with the slogan \"Win it or bin it\" while the other reads \"Celebrating 10000 rescues\" and depicts the mascot of the Fuel Rats."
},
"buildingfabricators": {
"id": "128672309",
Expand Down Expand Up @@ -685,7 +689,8 @@
"id": "128673857",
"symbol": "CoolingHoses",
"category": "Industrial Materials",
"name": "Micro-weave Cooling Hoses"
"name": "Micro-weave Cooling Hoses",
"description": "High specification cooling hoses used as conduits for fluid or gas based thermal management systems."
},
"copper": {
"id": "128049175",
Expand Down Expand Up @@ -962,7 +967,8 @@
"market_id": "128673074",
"category": "Salvage",
"name": "Galactic Travel Guide",
"rare": true
"rare": true,
"description": "A where's where and a what's what of the Milky Way. This guide highlights the galaxy's top destinations and hot spots."
},
"gallite": {
"id": "128049158",
Expand Down Expand Up @@ -1226,7 +1232,8 @@
"id": "128672135",
"symbol": "Hostage",
"category": "Salvage",
"name": "Hostages"
"name": "Hostages",
"description": "Sometimes criminal gangs hide their hostages in cargo pods fitted with rudimentary life support."
},
"hr7221wheat": {
"id": "128667059",
Expand Down Expand Up @@ -1419,9 +1426,10 @@
"symbol": "KorroKungPellets",
"market_id": "3228726272",
"category": "Chemicals",
"name": "Koro Kung Pellets",
"name": "Korro Kung Pellets",
"limit": 20,
"rare": true
"rare": true,
"description": "This exotic fertiliser is made from the crushed bodies of the native life forms siphoned from the nearby gas giants vast ammonia oceans in unsustainable quantities. It is reported to have invigorated even the most barren and arid of soils, but has also proved to be lethal to some crops."
},
"landmines": {
"id": "128672312",
Expand Down Expand Up @@ -1492,7 +1500,8 @@
"id": "128673851",
"symbol": "LiquidOxygen",
"category": "Chemicals",
"name": "Liquid oxygen"
"name": "Liquid oxygen",
"description": "Oxygen that has been cooled to the point of condensation. Useful in cryogenics or to oxidise other substances."
},
"liquor": {
"id": "128049216",
Expand Down Expand Up @@ -1759,7 +1768,8 @@
"category": "Foods",
"name": "Mukusubii Chitin-os",
"limit": 15,
"rare": true
"rare": true,
"description": "The chitinous native insects of nearby worlds are processed using industrial mining equipment, then re-constituted into convenient circles. Marketed as a food for those who like a little crunch."
},
"mulachigiantfungus": {
"id": "128667693",
Expand Down Expand Up @@ -1945,7 +1955,8 @@
"id": "128924332",
"symbol": "Opal",
"category": "Minerals",
"name": "Void Opal"
"name": "Void Opals",
"description": "Void opals are a mineraloid prized by various cultures. Their lack of reflectivity means that they seem almost to absorb light, hence their name."
},
"ophiuchiexinoartefacts": {
"id": "128667668",
Expand Down Expand Up @@ -2074,7 +2085,8 @@
"id": "128672134",
"symbol": "PoliticalPrisoner",
"category": "Salvage",
"name": "Political Prisoners"
"name": "Political Prisoners",
"description": "Political prisoners are sometimes transported in cargo pods to help disguise their movement."
},
"polymers": {
"id": "128049197",
Expand Down Expand Up @@ -2636,7 +2648,8 @@
"category": "Textiles",
"name": "Tiegfries Synth Silk",
"limit": 30,
"rare": true
"rare": true,
"description": "Spun from atoms, using a number of interconnected particle colliders, this silk is almost indistinguishable from the real thing."
},
"timecapsule": {
"id": "128672163",
Expand Down Expand Up @@ -2935,9 +2948,10 @@
"symbol": "WatersOfShintara",
"market_id": "128666762",
"category": "Medicines",
"name": "The Waters of Shintara",
"name": "Waters of Shintara",
"limit": 12,
"rare": true
"rare": true,
"description": "The medical qualities of the mineral waters of Shintara are decried by many in the scientific community as nonsense. This has not stopped widespread rumours that water from the planet can cure almost any ailment, and even reverse the ageing process. The company that controls the source of this water are happy to allow the rumours to continue, and people all over the galaxy are willing to pay a small fortune for the real thing."
},
"wheemetewheatcakes": {
"id": "128667698",
Expand Down
Loading

0 comments on commit 428ea56

Please sign in to comment.