Skip to content

Commit

Permalink
feat: migrate weapon stats to type string (#13)
Browse files Browse the repository at this point in the history
* feat: migrate weapon stats to type string to support D{n},-n, and n+ values

* fix: yaml formatting

---------

Co-authored-by: brittonhayes <[email protected]>
  • Loading branch information
brittonhayes and brittonhayes authored Jul 29, 2023
1 parent 38c1419 commit 392842d
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 71 deletions.
68 changes: 34 additions & 34 deletions api/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 7 additions & 20 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'

components:
schemas:
Health:
Expand Down Expand Up @@ -589,24 +588,19 @@ components:
bun: ',pk'
name:
type: string
example: "Lance and Sword"
range:
type: integer
format: int64
type: string
attacks:
type: integer
format: int64
type: string
to_hit:
type: integer
format: int64
type: string
to_wound:
type: integer
format: int64
type: string
rend:
type: integer
format: int64
type: string
damage:
type: integer
format: int64
type: string
GrandAlliance:
type: object
required:
Expand Down Expand Up @@ -696,20 +690,14 @@ components:
type: string
command_abilities:
type: array
# x-go-extra-tags:
# bun: "rel:has-many,join:id=unit_id"
items:
$ref: '#/components/schemas/Attribute'
magic:
type: array
# x-go-extra-tags:
# bun: "rel:has-many,join:id=unit_id"
items:
$ref: '#/components/schemas/Attribute'
damage_table:
type: array
# x-go-extra-tags:
# bun: "rel:has-many,join:id=unit_id"
items:
$ref: '#/components/schemas/DamageTable'
missile_weapons:
Expand All @@ -720,7 +708,6 @@ components:
type: array
items:
$ref: '#/components/schemas/Weapon'

Army:
type: object
required:
Expand Down
38 changes: 26 additions & 12 deletions fixtures/units.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,26 @@
min_wounds_suffered: 0
melee_weapons:
- name: Celestine Hammer
range: 1
attacks: 4
to_hit: 3
to_wound: 3
rend: -1
damage: 2
range: '1'
attacks: '4+'
to_hit: '3+'
to_wound: '3+'
rend: '-1'
damage: 'D3'
- name: Stormbound Blade
range: '1'
attacks: '1'
to_hit: '3+'
to_wound: '4+'
rend: '-1'
damage: '2'
- name: Great Claws
range: '1'
attacks: '2'
to_hit: '3+'
to_wound: '3+'
rend: '-1'
damage: '1'
missile_weapons: []
- id: liberators
name: Liberators
Expand Down Expand Up @@ -75,10 +89,10 @@
min_wounds_suffered: 0
melee_weapons:
- name: Warhammer
range: 1
attacks: 1
to_hit: 4
to_wound: 3
rend: -1
damage: 1
range: '1'
attacks: '1+'
to_hit: '4+'
to_wound: '3+'
rend: '-1'
damage: '1'
missile_weapons: []
Loading

0 comments on commit 392842d

Please sign in to comment.