Comments (5)
To keep the top level clean, I think these should go under a top level section like shipMods
with children like addSlots
and removeSlots
. So Tie Shuttle would look like:
{
"text": "Your upgrade bar loses all [Torpedo], [Missile] and [Bomb] upgrade icons and gains 2 [Crew] upgrade icons. You cannot equip a [Crew] Upgrade card that costs more than 4 squad points.",
"name": "TIE Shuttle",
"points": 0,
"slot": "Title",
"ship": [
"TIE Bomber"
],
"id": 221,
"xws": "tieshuttle",
"image": "upgrades/Title/tie-shuttle.png",
"shipMods": {
"addSlots": [
"Crew",
"Crew"
],
"removeSlots": [
"Torpedo",
"Missile",
"Bomb"
]
}
}
Then you could add in additional upgrade effects like Adaptability's PS mod, making it look like:
{
"image": "upgrades/Elite/adaptability-decrease.png",
"text": "Decrease your pilot skill value by 1.",
"name": "Adaptability (-1)",
"xws": "adaptability",
"points": 0,
"slot": "Elite",
"id": 232,
"shipMods": {
"skill": -1
}
},
from xwing-data.
Personally, I prefer something general like grants
/revokes
as opposed to addSlots
/removeSlots
since these types of changes can apply to slots, actions and potentially other elements in the future.
I think the idea to nest grants
and revokes
beneath another key could work, but I don't think shipMods
is exactly the right terms, since this can modify either the ship or the pilot... Maybe changes
is a better term? Of course, one downside to moving grants
around is that it would introduce a breaking change to existing apps.
Those are just my thoughts on the topic.
from xwing-data.
I would think if a change is going to apply to a different attributes (slot, action, etc.) you would want to capture that somehow instead of shoving the a bunch of named items into a single field without annotating their differing types. After re-reading your initial post, I see you already accounted for type.
I agree shipMods
is the wrong top level name, especially considering they do, in fact, modify the pilot card in most cases. My initial thought on this was that modifications
was nice and vague but collided with the upgrade type of the same name. Maybe adjustments
?
However, given the fact that grants
and revokes
is already setup to handle many types among those two fields, it seems more logical to keep them at the top-level. Maybe adjustments
could be added to hold all of the number properties (pilot skill, hull, agility, etc.) since they're not really being granted or revoked per se.
from xwing-data.
Another option would be simply to stick with grants
and add a value
parameter to action and slot objects in exactly the same way that stats has, but then also allow negative integer values. This would standardise the usage and simplify the schema as a result, without adding any more clutter to the top level.
A couple of examples...
R2D2 would look like this:
{
"name": "R2-D6",
"id": 70,
"unique": true,
"slot": "Astromech",
"points": 1,
"text": "Your upgrade bar gains the [Elite] upgrade icon.<br /><br />You cannot equip this upgrade if you already have a [Elite] upgrade icon or if your pilot skill value is \"2\" or lower.",
"image": "upgrades/Astromech/r2-d6.png",
"xws": "r2d6",
"grants": [
{
"type": "slot",
"name": "Elite",
"value": 1
}
]
},
Adaptability (-1) would look like this:
{
"image": "upgrades/Elite/adaptability-decrease.png",
"text": "Decrease your pilot skill value by 1.",
"name": "Adaptability (-1)",
"xws": "adaptability",
"points": 0,
"slot": "Elite",
"id": 232,
"grants": [
{
"type": "stats",
"name": "skill",
"value": -1
}
]
},
I'm happy to have a stab at updating upgrades.js if we can agree an approach. I might need some pointers on how to do this the right way as I'm a novice when it comes to git and how pull requests work...
from xwing-data.
Okay, I've submitted a pull request to address this issue. There is an added complication in that slots can be granted by value (+ or - a specific value) or revoked altogether (i.e. remove all slots of a specified type). I believe this is fully covered and I've also amended the upgrades data for all impacted cards I can see.
Comments welcome...
from xwing-data.
Related Issues (20)
- Add Project X-Streamer HOT 2
- Add Project HOT 4
- Attack type field HOT 8
- Pulsed Ray Shield is Rebel and Scum only
- Huge ships xws
- Pilot Rey should be under Resistance HOT 1
- Black Market Slicer Tools upgrade image should be under Illicit HOT 1
- Dual-card pilot image storage is inconsistent HOT 2
- Kanan Jarrus crew image filename is misspelled HOT 3
- Wookie Commandos upgrade card requires multiple slots HOT 3
- Maul/Ezra crew exception HOT 1
- include the Aturi cluster (co-op mode) pilots
- TIE Aggressor data shouldn't have turret HOT 3
- Use typographically correct quotes HOT 2
- Vcx-100 special arc HOT 2
- Ship images
- Support for Second Edition? HOT 20
- Title for ship HOT 3
- Properly represent Dual Upgrade Cards HOT 1
- Add C-ROC cards
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xwing-data.