Skip to content

Commit

Permalink
Linter rules (terrain and furniture) #2
Browse files Browse the repository at this point in the history
Updated rules and examples for `terrain` and `furniture` with `harvest_by_season`.
  • Loading branch information
ZhilkinSerg committed Aug 9, 2017
1 parent 7997b09 commit 1a5592b
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 6 deletions.
120 changes: 114 additions & 6 deletions tools/format/examples/terrain.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[
{
"id": "t_oil_circ_brkr_l",
"type": "terrain",
"name": "HV oil circuit breaker",
"symbol": "B",
"color": [ "ltgray" ],
"type": "terrain",
"id": "t_oil_circ_brkr_l",
"symbol": "B",
"move_cost": 0,
"bash": {
"str_min": 20,
Expand Down Expand Up @@ -34,12 +34,12 @@
"flags": [ "TRANSPARENT", "FLAMMABLE", "NOITEM", "WALL", "PERMEABLE" ]
},
{
"id": "t_tree_hickory",
"type": "terrain",
"name": "hickory tree",
"color": [ "light_green", "light_green", "brown_green", "brown" ],
"type": "terrain",
"//": "barren in winter, harvestable in autum",
"id": "t_tree_hickory",
"symbol": "7",
"color": [ "light_green", "light_green", "brown_green", "brown" ],
"move_cost": 0,
"harvest_season": "AUTUMN",
"harvestable": "hickory_nut",
Expand All @@ -57,5 +57,113 @@
]
},
"flags": [ "FLAMMABLE_ASH", "NOITEM", "SUPPORTS_ROOF", "TREE", "REDUCE_SCENT" ]
},
{
"name": "apple tree",
"color": [ "light_green", "light_green", "red_green", "brown" ],
"harvest_by_season": [
{
"seasons": [ "autumn" ],
"entries": [
{ "drop": "apple", "base_num": [ 2, 5 ], "scaled_num": [ 0, 0.5 ] }
]
}
],
"type": "terrain",
"//": "barren in winter, fruits in autum",
"id": "t_tree_apple",
"symbol": "7",
"move_cost": 0,
"transforms_into": "t_tree_apple_harvested",
"examine_action": "harvest_ter_nectar",
"bash": {
"str_min": 80,
"str_max": 180,
"ter_set": "t_dirt",
"sound": "crunch!",
"sound_fail": "whack!",
"items": [
{ "item": "stick", "count": [ 3, 10 ] },
{ "item": "splinter", "count": [ 10, 25 ] }
]
},
"flags": [ "FLAMMABLE_ASH", "NOITEM", "SUPPORTS_ROOF", "TREE", "REDUCE_SCENT" ]
},
{
"name": "apple tree",
"color": [ "light_green", "light_green", "light_green", "brown" ],
"type": "terrain",
"//": "barren in winter, no fruits anymore",
"id": "t_tree_apple_harvested",
"symbol": "7",
"move_cost": 0,
"transforms_into": "t_tree_apple",
"examine_action": "harvested_plant",
"bash": {
"str_min": 80,
"str_max": 180,
"ter_set": "t_dirt",
"sound": "crunch!",
"sound_fail": "whack!",
"items": [
{ "item": "stick", "count": [ 3, 10 ] },
{ "item": "splinter", "count": [ 10, 25 ] }
]
},
"flags": [ "FLAMMABLE_ASH", "NOITEM", "SUPPORTS_ROOF", "TREE", "REDUCE_SCENT", "HARVESTED" ]
},
{
"name": "pear tree",
"color": [ "light_green", "light_green", "ltgreen_green", "brown" ],
"harvest_by_season": [
{
"seasons": [ "autumn" ],
"entries": [
{ "drop": "pear", "base_num": [ 2, 5 ], "scaled_num": [ 0, 0.5 ] }
]
}
],
"type": "terrain",
"//": "barren in winter, fruits in autum",
"id": "t_tree_pear",
"symbol": "7",
"move_cost": 0,
"transforms_into": "t_tree_pear_harvested",
"examine_action": "harvest_ter_nectar",
"bash": {
"str_min": 80,
"str_max": 180,
"ter_set": "t_dirt",
"sound": "crunch!",
"sound_fail": "whack!",
"items": [
{ "item": "stick", "count": [ 3, 10 ] },
{ "item": "splinter", "count": [ 10, 25 ] }
]
},
"flags": [ "FLAMMABLE_ASH", "NOITEM", "SUPPORTS_ROOF", "TREE", "REDUCE_SCENT" ]
},
{
"name": "pear tree",
"color": [ "light_green", "light_green", "light_green", "brown" ],
"type": "terrain",
"//": "barren in winter, no fruits anymore",
"id": "t_tree_pear_harvested",
"symbol": "7",
"move_cost": 0,
"transforms_into": "t_tree_pear",
"examine_action": "harvested_plant",
"bash": {
"str_min": 80,
"str_max": 180,
"ter_set": "t_dirt",
"sound": "crunch!",
"sound_fail": "whack!",
"items": [
{ "item": "stick", "count": [ 3, 10 ] },
{ "item": "splinter", "count": [ 10, 25 ] }
]
},
"flags": [ "FLAMMABLE_ASH", "NOITEM", "SUPPORTS_ROOF", "TREE", "REDUCE_SCENT", "HARVESTED" ]
}
]
7 changes: 7 additions & 0 deletions tools/format/format.conf
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@
^(terrain|furniture):aliases=ARRAY,NOWRAP
^(terrain|furniture):color=ARRAY,NOWRAP
^(terrain|furniture):bgcolor=ARRAY,NOWRAP
^(terrain|furniture):harvest_by_season=ARRAY,WRAP
^(terrain|furniture):harvest_by_season:@
^(terrain|furniture):harvest_by_season:@:seasons=ARRAY,NOWRAP
^(terrain|furniture):harvest_by_season:@:entries=ARRAY,WRAP
^(terrain|furniture):harvest_by_season:@:entries:@=NOWRAP
^(terrain|furniture):harvest_by_season:@:entries:@:drop
^(terrain|furniture):harvest_by_season:@:entries:@:(base_|scaled_)num=ARRAY,NOWRAP

^(terrain|furniture|gate|trap)
^(terrain|furniture|gate|trap):type
Expand Down

0 comments on commit 1a5592b

Please sign in to comment.