Skip to content

Commit

Permalink
Merge pull request #31712 from ZhilkinSerg/refactor-fields-rename-1
Browse files Browse the repository at this point in the history
Refactor fields (step 2.1 - rename)
  • Loading branch information
kevingranade authored Jun 22, 2019
2 parents 3f7bd6c + 83a8b63 commit da1f2ee
Show file tree
Hide file tree
Showing 50 changed files with 373 additions and 368 deletions.
2 changes: 1 addition & 1 deletion data/json/emit.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "emit",
"//": "Intermittent cigarette smoke (example: lit cigarette)",
"field": "fd_cigsmoke",
"density": 2,
"intensity": 2,
"chance": 50
},
{
Expand Down
16 changes: 8 additions & 8 deletions data/json/items/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3608,8 +3608,8 @@
"type": "explosion",
"fields_type": "fd_tear_gas",
"fields_radius": 3,
"fields_min_density": 1,
"fields_max_density": 3,
"fields_min_intensity": 1,
"fields_max_intensity": 3,
"sound_volume": 0,
"sound_msg": "Tick.",
"no_deactivate_msg": "You've already pulled the %s's pin, try throwing it instead."
Expand Down Expand Up @@ -3817,8 +3817,8 @@
"type": "explosion",
"fields_type": "fd_toxic_gas",
"fields_radius": 2,
"fields_min_density": 1,
"fields_max_density": 3,
"fields_min_intensity": 1,
"fields_max_intensity": 3,
"sound_volume": 0,
"sound_msg": "Hiss.",
"no_deactivate_msg": "You've already armed the %s, try throwing it instead."
Expand Down Expand Up @@ -5285,8 +5285,8 @@
"type": "explosion",
"fields_type": "fd_nuke_gas",
"fields_radius": 18,
"fields_min_density": 3,
"fields_max_density": 3,
"fields_min_intensity": 3,
"fields_max_intensity": 3,
"sound_volume": 2,
"sound_msg": "Tick.",
"no_deactivate_msg": "You've already set the %s's timer, you might want to get away from it.",
Expand Down Expand Up @@ -8129,8 +8129,8 @@
"type": "explosion",
"fields_type": "fd_smoke",
"fields_radius": 2,
"fields_min_density": 2,
"fields_max_density": 3,
"fields_min_intensity": 2,
"fields_max_intensity": 3,
"sound_volume": 5,
"sound_msg": "Hsssss.",
"no_deactivate_msg": "You've already lit the fuse - get rid of it immediately!",
Expand Down
14 changes: 7 additions & 7 deletions data/json/mapgen/basement/basement_meth.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@
{ "monster": "mon_zombie", "x": [ 13, 14 ], "y": [ 11, 17 ], "chance": 90, "repeat": [ 1, 3 ] }
],
"place_fields": [
{ "x": [ 15, 16 ], "y": [ 5, 6 ], "field": "fd_blood", "density": 3 },
{ "x": [ 15, 16 ], "y": [ 5, 6 ], "field": "fd_blood", "density": 2 },
{ "x": [ 14, 19 ], "y": [ 12, 13 ], "field": "fd_toxic_gas", "density": 3 },
{ "x": [ 14, 19 ], "y": [ 12, 13 ], "field": "fd_toxic_gas", "density": 3 },
{ "x": [ 14, 16 ], "y": [ 12, 13 ], "field": "fd_toxic_gas", "density": 3 },
{ "x": [ 14, 16 ], "y": [ 12, 13 ], "field": "fd_toxic_gas", "density": 3 },
{ "x": [ 14, 16 ], "y": [ 12, 13 ], "field": "fd_toxic_gas", "density": 3 }
{ "x": [ 15, 16 ], "y": [ 5, 6 ], "field": "fd_blood", "intensity": 3 },
{ "x": [ 15, 16 ], "y": [ 5, 6 ], "field": "fd_blood", "intensity": 2 },
{ "x": [ 14, 19 ], "y": [ 12, 13 ], "field": "fd_toxic_gas", "intensity": 3 },
{ "x": [ 14, 19 ], "y": [ 12, 13 ], "field": "fd_toxic_gas", "intensity": 3 },
{ "x": [ 14, 16 ], "y": [ 12, 13 ], "field": "fd_toxic_gas", "intensity": 3 },
{ "x": [ 14, 16 ], "y": [ 12, 13 ], "field": "fd_toxic_gas", "intensity": 3 },
{ "x": [ 14, 16 ], "y": [ 12, 13 ], "field": "fd_toxic_gas", "intensity": 3 }
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/irradiator_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
{ "group": "prison_armor", "x": 39, "y": 26, "prob": 50, "repeat": [ 1, 2 ] }
],
"liquids": { "T": { "liquid": "water_clean", "amount": [ 200, 600 ] } },
"fields": { "U": { "field": "fd_nuke_gas", "density": 3, "age": 990, "chance": 100 }, "/": { "field": "fd_shock_vent" } },
"fields": { "U": { "field": "fd_nuke_gas", "intensity": 3, "age": 990, "chance": 100 }, "/": { "field": "fd_shock_vent" } },
"monster": { "(": { "monster": "mon_turret" }, "!": { "monster": "mon_hazmatbot", "chance": 5 } },
"monsters": {
"h": { "monster": "GROUP_ZOMBIE", "chance": 50 },
Expand Down
4 changes: 2 additions & 2 deletions data/json/mapgen/mapgen-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"place_furniture": [ { "furn": "f_rack", "x": 9, "y": 3 } ],
"place_traps": [ { "trap": "tr_funnel", "x": 7, "y": 3 } ],
"traps": { "F": "tr_cot", "f": { "trap": "tr_funnel" }, "g": { "trap": "tr_funnel" } },
"fields": { "B": { "field": "fd_blood", "density": 1, "age": 10 } },
"place_fields": [ { "field": "fd_bile", "x": 5, "y": 1, "density": 2, "age": 20 } ],
"fields": { "B": { "field": "fd_blood", "intensity": 1, "age": 10 } },
"place_fields": [ { "field": "fd_bile", "x": 5, "y": 1, "intensity": 2, "age": 20 } ],
"place_signs": [
{ "signage": "it works again.", "x": 7, "y": 1 },
{ "signage": "<given_name> <family_name> owned <full_name> at <city>", "x": 7, "y": 2 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@
"terrain": { "g": "t_grass", ".": "t_dirt", "a": "t_dirt", "b": "t_dirt", "R": "t_dirt", "F": "t_dirt" },
"furniture": { "a": "f_ash" },
"traps": { "F": "tr_fur_rollmat", "R": "tr_rollmat" },
"fields": { "b": { "field": "fd_blood", "density": 1 } },
"fields": { "b": { "field": "fd_blood", "intensity": 1 } },
"place_loot": [
{ "group": "cannedfood", "x": [ 6, 18 ], "y": [ 3, 15 ], "chance": 100 },
{ "group": "alcohol_bottled_canned", "x": [ 6, 18 ], "y": [ 3, 15 ], "repeat": 2, "chance": 75 },
Expand Down
2 changes: 1 addition & 1 deletion data/json/npcs/robofac/NPC_ROBOFAC_INTERCOM.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
" "
],
"terrain": { "@": "t_grass", "b": "t_dirt", "M": "t_dirt" },
"fields": { "b": { "field": "fd_blood", "density": 1 } },
"fields": { "b": { "field": "fd_blood", "intensity": 1 } },
"items": { "@": { "item": "NC_ROBOFAC_FIELD_RESEARCHER_worn", "chance": 100 } },
"item": { "@": [ { "item": "EMPbomb", "amount": 2 }, { "item": "corpse" } ] },
"monster": { "M": { "monster": "mon_robofac_prototype" } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"color": "white",
"extras": "field",
"see_cost": 5,
"monster_density": 2
"mondensity": 2
},
{
"type": "overmap_terrain",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Fuji_Structures/worldgen/gas/s_gas_b20.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
{ "monster": "GROUP_BUNKER", "x": [ 1, 22 ], "y": [ 1, 22 ], "density": 0.8 },
{ "monster": "GROUP_SCI", "x": [ 1, 22 ], "y": [ 1, 22 ], "density": 0.5 }
],
"fields": { "l": { "field": "fd_nuke_gas", "density": 1, "age": 0 }, "L": { "field": "fd_nuke_gas", "density": 1, "age": 0 } }
"fields": { "l": { "field": "fd_nuke_gas", "intensity": 1, "age": 0 }, "L": { "field": "fd_nuke_gas", "intensity": 1, "age": 0 } }
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"X": [ { "item": "human_flesh", "amount": 12 }, { "item": "knife_butcher", "chance": 1 } ],
"x": { "item": "human_flesh", "amount": [ 10, 20 ] }
},
"place_fields": [ { "x": [ 7, 19 ], "y": [ 12, 19 ], "field": "fd_blood", "age": 2, "density": 2, "repeat": 60 } ]
"place_fields": [ { "x": [ 7, 19 ], "y": [ 12, 19 ], "field": "fd_blood", "age": 2, "intensity": 2, "repeat": 60 } ]
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"h": { "item": { "item": "corpse", "amount": [ 1, 4 ] }, "fields": { "field": "fd_blood" } },
"H": { "item": { "item": "corpse", "amount": [ 3, 9 ] }, "fields": { "field": "fd_blood" } }
},
"place_fields": [ { "x": [ 2, 12 ], "y": [ 17, 22 ], "field": "fd_blood", "age": 2, "density": 2, "repeat": 20 } ]
"place_fields": [ { "x": [ 2, 12 ], "y": [ 17, 22 ], "field": "fd_blood", "age": 2, "intensity": 2, "repeat": 20 } ]
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
],
"palettes": [ "national_guard_camp_b" ],
"place_fields": [
{ "field": "fd_blood", "x": [ 20, 22 ], "y": [ 24, 26 ], "age": 0, "density": 1, "repeat": 8 },
{ "field": "fd_blood", "x": [ 88, 90 ], "y": [ 24, 26 ], "age": 0, "density": 1, "repeat": 8 }
{ "field": "fd_blood", "x": [ 20, 22 ], "y": [ 24, 26 ], "age": 0, "intensity": 1, "repeat": 8 },
{ "field": "fd_blood", "x": [ 88, 90 ], "y": [ 24, 26 ], "age": 0, "intensity": 1, "repeat": 8 }
],
"place_monsters": [
{ "monster": "GROUP_WRAITHEON_INFANTRY", "x": [ 1, 22 ], "y": [ 25, 46 ], "density": 0.075 },
Expand Down Expand Up @@ -111,8 +111,8 @@
{ "monster": "GROUP_WRAITHEON_INFANTRY", "x": [ 73, 94 ], "y": [ 25, 46 ], "density": 0.075 }
],
"place_fields": [
{ "field": "fd_blood", "x": [ 44, 46 ], "y": [ 24, 26 ], "age": 0, "density": 1, "repeat": 8 },
{ "field": "fd_blood", "x": [ 88, 90 ], "y": [ 24, 26 ], "age": 0, "density": 1, "repeat": 8 }
{ "field": "fd_blood", "x": [ 44, 46 ], "y": [ 24, 26 ], "age": 0, "intensity": 1, "repeat": 8 },
{ "field": "fd_blood", "x": [ 88, 90 ], "y": [ 24, 26 ], "age": 0, "intensity": 1, "repeat": 8 }
],
"place_vehicles": [
{ "vehicle": "golf_cart", "x": 42, "y": 10, "chance": 25, "rotation": 270 },
Expand Down Expand Up @@ -257,7 +257,7 @@
"r": { "item": "chem_school", "chance": 45 }
},
"toilets": { "t": { } },
"fields": { "!": { "field": "fd_nuke_gas", "density": 1, "age": 0 } },
"fields": { "!": { "field": "fd_nuke_gas", "intensity": 1, "age": 0 } },
"place_monsters": [
{ "monster": "GROUP_WRAITHEON_INFANTRY", "x": [ 25, 46 ], "y": [ 1, 22 ], "density": 0.1 },
{ "monster": "GROUP_WRAITHEON_INFANTRY", "x": [ 49, 70 ], "y": [ 1, 22 ], "density": 0.1 },
Expand Down Expand Up @@ -556,7 +556,7 @@
{ "monster": "GROUP_WRAITHEON_CONSTRUCTION", "x": [ 49, 70 ], "y": [ 1, 22 ], "density": 0.075 },
{ "monster": "GROUP_WRAITHEON_INFANTRY", "x": [ 49, 70 ], "y": [ 25, 46 ], "density": 0.075 }
],
"place_fields": [ { "field": "fd_blood", "x": [ 56, 58 ], "y": [ 43, 45 ], "age": 0, "density": 1, "repeat": 8 } ]
"place_fields": [ { "field": "fd_blood", "x": [ 56, 58 ], "y": [ 43, 45 ], "age": 0, "intensity": 1, "repeat": 8 } ]
},
"om_terrain": [
[ "national_guard_camp_b1_48", "national_guard_camp_b1_49", "national_guard_camp_b1_50" ],
Expand Down Expand Up @@ -717,7 +717,7 @@
{ "vehicle": "golf_cart", "x": 42, "y": 8, "chance": 25, "rotation": 270 },
{ "vehicle": "golf_cart", "x": 42, "y": [ 30, 43 ], "chance": 25, "rotation": 90 }
],
"place_fields": [ { "field": "fd_blood", "x": [ 26, 28 ], "y": [ 21, 23 ], "age": 0, "density": 1, "repeat": 8 } ]
"place_fields": [ { "field": "fd_blood", "x": [ 26, 28 ], "y": [ 21, 23 ], "age": 0, "intensity": 1, "repeat": 8 } ]
},
"om_terrain": [
[ "national_guard_camp_b1_54", "national_guard_camp_b1_55", "national_guard_camp_b1_56" ],
Expand Down Expand Up @@ -782,7 +782,7 @@
],
"palettes": [ "national_guard_camp_b" ],
"terrain": { "=": [ "t_door_metal_c", "t_door_metal_locked", "t_door_metal_locked", "t_door_metal_locked" ] },
"fields": { "!": { "field": "fd_nuke_gas", "density": 1, "age": 0 } },
"fields": { "!": { "field": "fd_nuke_gas", "intensity": 1, "age": 0 } },
"items": { "r": { "item": "electronics", "chance": 30 }, "(": { "item": "sewer", "chance": 1 } },
"place_monsters": [
{ "monster": "GROUP_WRAITHEON_INFANTRY", "x": [ 1, 22 ], "y": [ 1, 22 ], "density": 0.075 },
Expand Down Expand Up @@ -853,7 +853,7 @@
" 884 e~~~~~~~~~~~~~~~~~~~~~~~~~e7777777777e Y Y e~"
],
"palettes": [ "national_guard_camp_b" ],
"fields": { "!": { "field": "fd_nuke_gas", "density": 1, "age": 0 } },
"fields": { "!": { "field": "fd_nuke_gas", "intensity": 1, "age": 0 } },
"items": { "L": { "item": "reactor_equipment", "chance": 30 }, "(": { "item": "sewer", "chance": 1 } },
"terrain": { "=": [ "t_door_metal_c", "t_door_metal_locked", "t_door_metal_locked", "t_door_metal_locked" ] },
"place_monsters": [
Expand Down Expand Up @@ -1299,7 +1299,7 @@
{ "monster": "GROUP_WRAITHEON_INFANTRY", "x": [ 25, 46 ], "y": [ 25, 46 ], "density": 0.075 },
{ "monster": "GROUP_WRAITHEON_INFANTRY", "x": [ 49, 70 ], "y": [ 25, 46 ], "density": 0.075 }
],
"place_fields": [ { "field": "fd_blood", "x": [ 65, 67 ], "y": [ 19, 21 ], "age": 0, "density": 1, "repeat": 8 } ]
"place_fields": [ { "field": "fd_blood", "x": [ 65, 67 ], "y": [ 19, 21 ], "age": 0, "intensity": 1, "repeat": 8 } ]
},
"om_terrain": [
[ "national_guard_camp_b1_98", "national_guard_camp_b1_99", "national_guard_camp_b1_100" ],
Expand Down Expand Up @@ -1366,8 +1366,8 @@
"terrain": { "=": [ "t_door_metal_c", "t_door_metal_locked", "t_door_metal_locked", "t_door_metal_locked" ] },
"items": { "d": { "item": "office", "chance": 40 }, "o": { "item": "radio", "chance": 40 } },
"place_fields": [
{ "field": "fd_blood", "x": [ 8, 11 ], "y": [ 2, 4 ], "age": 0, "density": 1, "repeat": 8 },
{ "field": "fd_blood", "x": [ 68, 70 ], "y": [ 18, 20 ], "age": 0, "density": 1, "repeat": 8 }
{ "field": "fd_blood", "x": [ 8, 11 ], "y": [ 2, 4 ], "age": 0, "intensity": 1, "repeat": 8 },
{ "field": "fd_blood", "x": [ 68, 70 ], "y": [ 18, 20 ], "age": 0, "intensity": 1, "repeat": 8 }
],
"place_monsters": [
{ "monster": "GROUP_WRAITHEON_INFANTRY", "x": [ 1, 22 ], "y": [ 1, 22 ], "density": 0.075 },
Expand Down Expand Up @@ -1443,8 +1443,8 @@
"items": { "r": { "item": "electronics", "chance": 40 }, "c": { "item": "robots", "chance": 25 } },
"toilets": { "t": { } },
"place_fields": [
{ "field": "fd_blood", "x": [ 8, 10 ], "y": [ 12, 14 ], "age": 0, "density": 1, "repeat": 8 },
{ "field": "fd_blood", "x": [ 67, 69 ], "y": [ 33, 35 ], "age": 0, "density": 1, "repeat": 8 }
{ "field": "fd_blood", "x": [ 8, 10 ], "y": [ 12, 14 ], "age": 0, "intensity": 1, "repeat": 8 },
{ "field": "fd_blood", "x": [ 67, 69 ], "y": [ 33, 35 ], "age": 0, "intensity": 1, "repeat": 8 }
],
"place_monsters": [
{ "monster": "GROUP_WRAITHEON_INFANTRY", "x": [ 1, 22 ], "y": [ 1, 22 ], "density": 0.075 },
Expand Down Expand Up @@ -2111,9 +2111,9 @@
],
"place_vehicles": [ { "vehicle": "golf_cart", "x": [ 4, 19 ], "y": 27, "chance": 25, "rotation": 0 } ],
"place_fields": [
{ "field": "fd_blood", "x": [ 43, 45 ], "y": [ 38, 40 ], "age": 0, "density": 1, "repeat": 8 },
{ "field": "fd_blood", "x": [ 31, 33 ], "y": [ 24, 25 ], "age": 0, "density": 1, "repeat": 6 },
{ "field": "fd_blood", "x": [ 50, 52 ], "y": [ 27, 29 ], "age": 0, "density": 1, "repeat": 8 }
{ "field": "fd_blood", "x": [ 43, 45 ], "y": [ 38, 40 ], "age": 0, "intensity": 1, "repeat": 8 },
{ "field": "fd_blood", "x": [ 31, 33 ], "y": [ 24, 25 ], "age": 0, "intensity": 1, "repeat": 6 },
{ "field": "fd_blood", "x": [ 50, 52 ], "y": [ 27, 29 ], "age": 0, "intensity": 1, "repeat": 8 }
]
},
"om_terrain": [
Expand Down
2 changes: 1 addition & 1 deletion data/mods/mapspecials_demo/missile_silo/silo_fblc_01.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"rotation": 3,
"palettes": [ "missile_silo" ],
"terrain": { "*": "t_metal_floor" },
"fields": { "*": { "field": "fd_nuke_gas", "chance": 3, "density": 2, "age": 0 } },
"fields": { "*": { "field": "fd_nuke_gas", "chance": 3, "intensity": 2, "age": 0 } },
"monster": { "Z": { "monster": "mon_turret_rifle" } }
}
}
Expand Down
2 changes: 1 addition & 1 deletion data/mods/mapspecials_demo/missile_silo/silo_fbrc_01.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"rotation": 2,
"palettes": [ "missile_silo" ],
"terrain": { "*": "t_metal_floor" },
"fields": { "*": { "field": "fd_nuke_gas", "chance": 3, "density": 2, "age": 0 } },
"fields": { "*": { "field": "fd_nuke_gas", "chance": 3, "intensity": 2, "age": 0 } },
"monster": { "Z": { "monster": "mon_turret_rifle" } }
}
}
Expand Down
2 changes: 1 addition & 1 deletion data/mods/mapspecials_demo/missile_silo/silo_ftlc_01.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"rotation": 0,
"palettes": [ "missile_silo" ],
"terrain": { "*": "t_metal_floor" },
"fields": { "*": { "field": "fd_nuke_gas", "chance": 3, "density": 2, "age": 0 } },
"fields": { "*": { "field": "fd_nuke_gas", "chance": 3, "intensity": 2, "age": 0 } },
"monster": { "z": { "monster": "mon_zombie_soldier" }, "Z": { "monster": "mon_zombie_bio_op" } }
}
}
Expand Down
2 changes: 1 addition & 1 deletion data/mods/mapspecials_demo/missile_silo/silo_ftrc_01.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"rotation": 1,
"palettes": [ "missile_silo" ],
"terrain": { "*": "t_metal_floor" },
"fields": { "*": { "field": "fd_nuke_gas", "chance": 3, "density": 2, "age": 0 } },
"fields": { "*": { "field": "fd_nuke_gas", "chance": 3, "intensity": 2, "age": 0 } },
"monster": { "z": { "monster": "mon_zombie_soldier" } }
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ bool cata_tiles::draw_from_id_string( std::string id, TILE_CATEGORY category,
} else if( category == C_FIELD ) {
const field_id fid = field_from_ident( id );
sym = all_field_types_enum_list[fid].sym;
// TODO: field density?
// TODO: field intensity?
col = all_field_types_enum_list[fid].color[0];
} else if( category == C_TRAP ) {
const trap_str_id tmp( id );
Expand Down
2 changes: 1 addition & 1 deletion src/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class Creature
/** Returns true if the given field entry is dangerous to us. */
bool is_dangerous_field( const field_entry &entry ) const;
/** Returns true if we are immune to the field type with the given fid. Does not
* handle density, so this function should only be called through is_dangerous_field().
* handle intensity, so this function should only be called through is_dangerous_field().
*/
virtual bool is_immune_field( const field_id ) const {
return false;
Expand Down
Loading

0 comments on commit da1f2ee

Please sign in to comment.