diff --git a/data/json/emit.json b/data/json/emit.json index 42db5caf96584..37ca4db7efdb1 100644 --- a/data/json/emit.json +++ b/data/json/emit.json @@ -4,7 +4,7 @@ "type": "emit", "//": "Intermittent cigarette smoke (example: lit cigarette)", "field": "fd_cigsmoke", - "density": 2, + "intensity": 2, "chance": 50 }, { diff --git a/data/json/items/tools.json b/data/json/items/tools.json index dae7f53310152..a929f1c1d0039 100644 --- a/data/json/items/tools.json +++ b/data/json/items/tools.json @@ -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." @@ -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." @@ -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.", @@ -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!", diff --git a/data/json/mapgen/basement/basement_meth.json b/data/json/mapgen/basement/basement_meth.json index d2a7309b6e2aa..93a3658e68354 100644 --- a/data/json/mapgen/basement/basement_meth.json +++ b/data/json/mapgen/basement/basement_meth.json @@ -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 } ] } }, diff --git a/data/json/mapgen/irradiator_1.json b/data/json/mapgen/irradiator_1.json index dfc9a8a891edf..f006889b5781c 100644 --- a/data/json/mapgen/irradiator_1.json +++ b/data/json/mapgen/irradiator_1.json @@ -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 }, diff --git a/data/json/mapgen/mapgen-test.json b/data/json/mapgen/mapgen-test.json index e5b7772083c91..ffa3f3da92313 100644 --- a/data/json/mapgen/mapgen-test.json +++ b/data/json/mapgen/mapgen-test.json @@ -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": " owned at ", "x": 7, "y": 2 }, diff --git a/data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_shopkeep.json b/data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_shopkeep.json index 562047bf466bc..f16d0b53d05e7 100644 --- a/data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_shopkeep.json +++ b/data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_shopkeep.json @@ -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 }, diff --git a/data/json/npcs/robofac/NPC_ROBOFAC_INTERCOM.json b/data/json/npcs/robofac/NPC_ROBOFAC_INTERCOM.json index 5bdd965db0861..43b050594b4bc 100644 --- a/data/json/npcs/robofac/NPC_ROBOFAC_INTERCOM.json +++ b/data/json/npcs/robofac/NPC_ROBOFAC_INTERCOM.json @@ -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" } } diff --git a/data/json/overmap/overmap_terrain/overmap_terrain_abstract.json b/data/json/overmap/overmap_terrain/overmap_terrain_abstract.json index 8204e99c57ea2..5af142174dfeb 100644 --- a/data/json/overmap/overmap_terrain/overmap_terrain_abstract.json +++ b/data/json/overmap/overmap_terrain/overmap_terrain_abstract.json @@ -164,7 +164,7 @@ "color": "white", "extras": "field", "see_cost": 5, - "monster_density": 2 + "mondensity": 2 }, { "type": "overmap_terrain", diff --git a/data/mods/Fuji_Structures/worldgen/gas/s_gas_b20.json b/data/mods/Fuji_Structures/worldgen/gas/s_gas_b20.json index 15bb4e3f4d220..ecb8f61dadbbe 100644 --- a/data/mods/Fuji_Structures/worldgen/gas/s_gas_b20.json +++ b/data/mods/Fuji_Structures/worldgen/gas/s_gas_b20.json @@ -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 } } } } ] diff --git a/data/mods/More_Locations/military_outpost/mil_outpost_1brc_01.json b/data/mods/More_Locations/military_outpost/mil_outpost_1brc_01.json index ed7da991b290b..b5af534107f77 100644 --- a/data/mods/More_Locations/military_outpost/mil_outpost_1brc_01.json +++ b/data/mods/More_Locations/military_outpost/mil_outpost_1brc_01.json @@ -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 } ] } } ] diff --git a/data/mods/More_Locations/military_outpost/mil_outpost_ublc_03.json b/data/mods/More_Locations/military_outpost/mil_outpost_ublc_03.json index 38e23008f25a9..80b6fb9016fab 100644 --- a/data/mods/More_Locations/military_outpost/mil_outpost_ublc_03.json +++ b/data/mods/More_Locations/military_outpost/mil_outpost_ublc_03.json @@ -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 } ] } } ] diff --git a/data/mods/National_Guard_Camp/national_guard_camp/national_guard_camp_b1.json b/data/mods/National_Guard_Camp/national_guard_camp/national_guard_camp_b1.json index 671dfc5bdf774..031be5313a459 100644 --- a/data/mods/National_Guard_Camp/national_guard_camp/national_guard_camp_b1.json +++ b/data/mods/National_Guard_Camp/national_guard_camp/national_guard_camp_b1.json @@ -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 }, @@ -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 }, @@ -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 }, @@ -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" ], @@ -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" ], @@ -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 }, @@ -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": [ @@ -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" ], @@ -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 }, @@ -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 }, @@ -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": [ diff --git a/data/mods/mapspecials_demo/missile_silo/silo_fblc_01.json b/data/mods/mapspecials_demo/missile_silo/silo_fblc_01.json index f4e92de0649ec..4f02bff5cacf9 100644 --- a/data/mods/mapspecials_demo/missile_silo/silo_fblc_01.json +++ b/data/mods/mapspecials_demo/missile_silo/silo_fblc_01.json @@ -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" } } } } diff --git a/data/mods/mapspecials_demo/missile_silo/silo_fbrc_01.json b/data/mods/mapspecials_demo/missile_silo/silo_fbrc_01.json index 53f1e0042176b..cda1b55a6cf05 100644 --- a/data/mods/mapspecials_demo/missile_silo/silo_fbrc_01.json +++ b/data/mods/mapspecials_demo/missile_silo/silo_fbrc_01.json @@ -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" } } } } diff --git a/data/mods/mapspecials_demo/missile_silo/silo_ftlc_01.json b/data/mods/mapspecials_demo/missile_silo/silo_ftlc_01.json index 79b6e07dfcbe7..fb77de4ce59fc 100644 --- a/data/mods/mapspecials_demo/missile_silo/silo_ftlc_01.json +++ b/data/mods/mapspecials_demo/missile_silo/silo_ftlc_01.json @@ -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" } } } } diff --git a/data/mods/mapspecials_demo/missile_silo/silo_ftrc_01.json b/data/mods/mapspecials_demo/missile_silo/silo_ftrc_01.json index c5c71b7c7f8f8..132bf9d937ba5 100644 --- a/data/mods/mapspecials_demo/missile_silo/silo_ftrc_01.json +++ b/data/mods/mapspecials_demo/missile_silo/silo_ftrc_01.json @@ -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" } } } } diff --git a/src/cata_tiles.cpp b/src/cata_tiles.cpp index 6dfe9962c51c4..368350618adbb 100644 --- a/src/cata_tiles.cpp +++ b/src/cata_tiles.cpp @@ -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 ); diff --git a/src/creature.h b/src/creature.h index a6c73607fb926..5ae96b78e72df 100644 --- a/src/creature.h +++ b/src/creature.h @@ -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; diff --git a/src/editmap.cpp b/src/editmap.cpp index 7a013679cfd24..8827fb6488c00 100644 --- a/src/editmap.cpp +++ b/src/editmap.cpp @@ -196,7 +196,7 @@ editmap::editmap() cur_field = 0; cur_trap = tr_null; sel_field = -1; - sel_fdensity = -1; + sel_field_intensity = -1; sel_trap = undefined_trap_id; fsel = undefined_furn_id; @@ -648,7 +648,7 @@ void editmap::update_view( bool update_info ) for( auto &fld : *cur_field ) { const field_entry &cur = fld.second; mvwprintz( w_info, off, 1, cur.color(), - _( "field: %s (%d) density %d age %d" ), + _( "field: %s (%d) intensity %d age %d" ), cur.name(), cur.get_field_type(), cur.get_field_intensity(), to_turns( cur.get_field_age() ) ); @@ -1059,18 +1059,18 @@ int editmap::edit_ter() void editmap::update_fmenu_entry( uilist &fmenu, field &field, const field_id idx ) { - int fdens = 1; + int fintensity = 1; const field_t &ftype = all_field_types_enum_list[idx]; field_entry *fld = field.find_field( idx ); if( fld != nullptr ) { - fdens = fld->get_field_intensity(); + fintensity = fld->get_field_intensity(); } - fmenu.entries[idx].txt = ftype.name( fdens - 1 ); + fmenu.entries[idx].txt = ftype.name( fintensity - 1 ); if( fld != nullptr ) { - fmenu.entries[idx].txt += " " + std::string( fdens, '*' ); + fmenu.entries[idx].txt += " " + std::string( fintensity, '*' ); } fmenu.entries[idx].text_color = ( fld != nullptr ? c_cyan : fmenu.text_color ); - fmenu.entries[idx].extratxt.color = ftype.color[fdens - 1]; + fmenu.entries[idx].extratxt.color = ftype.color[fintensity - 1]; } void editmap::setup_fmenu( uilist &fmenu ) @@ -1079,8 +1079,8 @@ void editmap::setup_fmenu( uilist &fmenu ) for( int i = 0; i < num_fields; i++ ) { const field_id fid = static_cast( i ); const field_t &ftype = all_field_types_enum_list[fid]; - int fdens = 1; - std::string fname = ftype.name( fdens - 1 ); + int fintensity = 1; + std::string fname = ftype.name( fintensity - 1 ); fmenu.addentry( fid, true, -2, fname ); fmenu.entries[fid].extratxt.left = 1; fmenu.entries[fid].extratxt.txt = string_format( "%c", ftype.sym ); @@ -1104,7 +1104,7 @@ int editmap::edit_fld() do { uphelp( pgettext( "Map editor: Field effects shortkeys", - "[s/tab] shape select, [m]ove, [<,>] density" ), + "[s/tab] shape select, [m]ove, [<,>] intensity" ), pgettext( "Map editor: Field effects shortkeys", "[enter] edit, [q]uit, [v] showall" ), pgettext( "Map editor: Editing field effects", "Field effects" ) ); @@ -1112,13 +1112,13 @@ int editmap::edit_fld() if( fmenu.selected > 0 && fmenu.selected < num_fields && ( fmenu.ret > 0 || fmenu.keypress == KEY_LEFT || fmenu.keypress == KEY_RIGHT ) ) { - int fdens = 0; + int fintensity = 0; const field_id idx = static_cast( fmenu.selected ); field_entry *fld = cur_field->find_field( idx ); if( fld != nullptr ) { - fdens = fld->get_field_intensity(); + fintensity = fld->get_field_intensity(); } - int fsel_dens = fdens; + int fsel_intensity = fintensity; if( fmenu.ret > 0 ) { uilist femenu; femenu.w_width = width; @@ -1127,49 +1127,49 @@ int editmap::edit_fld() femenu.w_x = offsetX; const field_t &ftype = all_field_types_enum_list[idx]; - femenu.text = ftype.name( fdens == 0 ? 0 : fdens - 1 ); + femenu.text = ftype.name( fintensity == 0 ? 0 : fintensity - 1 ); femenu.addentry( pgettext( "map editor: used to describe a clean field (e.g. without blood)", "-clear-" ) ); femenu.addentry( string_format( "1: %s", ftype.name( 0 ) ) ); femenu.addentry( string_format( "2: %s", ftype.name( 1 ) ) ); femenu.addentry( string_format( "3: %s", ftype.name( 2 ) ) ); - femenu.entries[fdens].text_color = c_cyan; - femenu.selected = ( sel_fdensity > 0 ? sel_fdensity : fdens ); + femenu.entries[fintensity].text_color = c_cyan; + femenu.selected = ( sel_field_intensity > 0 ? sel_field_intensity : fintensity ); femenu.query(); if( femenu.ret >= 0 ) { - fsel_dens = femenu.ret; + fsel_intensity = femenu.ret; } - } else if( fmenu.keypress == KEY_RIGHT && fdens < 3 ) { - fsel_dens++; - } else if( fmenu.keypress == KEY_LEFT && fdens > 0 ) { - fsel_dens--; + } else if( fmenu.keypress == KEY_RIGHT && fintensity < 3 ) { + fsel_intensity++; + } else if( fmenu.keypress == KEY_LEFT && fintensity > 0 ) { + fsel_intensity--; } - if( fdens != fsel_dens || target_list.size() > 1 ) { + if( fintensity != fsel_intensity || target_list.size() > 1 ) { for( auto &elem : target_list ) { const auto fid = static_cast( idx ); field &t_field = g->m.get_field( elem ); field_entry *t_fld = t_field.find_field( fid ); - int t_dens = 0; + int t_intensity = 0; if( t_fld != nullptr ) { - t_dens = t_fld->get_field_intensity(); + t_intensity = t_fld->get_field_intensity(); } - if( fsel_dens != 0 ) { - if( t_dens != 0 ) { - g->m.set_field_strength( elem, fid, fsel_dens ); + if( fsel_intensity != 0 ) { + if( t_intensity != 0 ) { + g->m.set_field_intensity( elem, fid, fsel_intensity ); } else { - g->m.add_field( elem, fid, fsel_dens ); + g->m.add_field( elem, fid, fsel_intensity ); } } else { - if( t_dens != 0 ) { + if( t_intensity != 0 ) { g->m.remove_field( elem, fid ); } } } update_fmenu_entry( fmenu, *cur_field, idx ); sel_field = fmenu.selected; - sel_fdensity = fsel_dens; + sel_field_intensity = fsel_intensity; } update_view( true ); } else if( fmenu.ret == 0 ) { @@ -1185,7 +1185,7 @@ int editmap::edit_fld() } update_view( true ); sel_field = fmenu.selected; - sel_fdensity = 0; + sel_field_intensity = 0; } else if( fmenu.keypress == 's' || fmenu.keypress == '\t' || fmenu.keypress == 'm' ) { int sel_tmp = fmenu.selected; int ret = select_shape( editshape, ( fmenu.keypress == 'm' ? 1 : 0 ) ); diff --git a/src/editmap.h b/src/editmap.h index f81b188d6285a..34d98415c944c 100644 --- a/src/editmap.h +++ b/src/editmap.h @@ -94,7 +94,7 @@ class editmap trap_id cur_trap; int sel_field; - int sel_fdensity; + int sel_field_intensity; trap_id sel_trap; diff --git a/src/emit.cpp b/src/emit.cpp index f372b73fdb7e3..11277d3540d5d 100644 --- a/src/emit.cpp +++ b/src/emit.cpp @@ -47,7 +47,7 @@ void emit::load_emit( JsonObject &jo ) et.id_ = emit_id( jo.get_string( "id" ) ); et.field_name = jo.get_string( "field" ); - jo.read( "density", et.density_ ); + jo.read( "intensity", et.intensity_ ); jo.read( "qty", et.qty_ ); jo.read( "chance", et.chance_ ); @@ -64,15 +64,15 @@ void emit::check_consistency() for( auto &e : emits_all ) { e.second.field_ = field_from_ident( e.second.field_name ); - if( e.second.density_ > MAX_FIELD_DENSITY || e.second.density_ < 1 ) { - debugmsg( "emission density of %s out of range", e.second.id_.c_str() ); - e.second.density_ = std::max( std::min( e.second.density_, MAX_FIELD_DENSITY ), 1 ); + if( e.second.intensity_ > MAX_FIELD_INTENSITY || e.second.intensity_ < 1 ) { + debugmsg( "emission intensity of %s out of range", e.second.id_.c_str() ); + e.second.intensity_ = std::max( std::min( e.second.intensity_, MAX_FIELD_INTENSITY ), 1 ); } if( e.second.qty_ <= 0 ) { debugmsg( "emission qty of %s out of range", e.second.id_.c_str() ); } if( e.second.chance_ > 100 || e.second.chance_ <= 0 ) { - e.second.density_ = std::max( std::min( e.second.chance_, 100 ), 1 ); + e.second.intensity_ = std::max( std::min( e.second.chance_, 100 ), 1 ); debugmsg( "emission chance of %s out of range", e.second.id_.c_str() ); } } diff --git a/src/emit.h b/src/emit.h index d9b83bac25a3f..3942d173d2043 100644 --- a/src/emit.h +++ b/src/emit.h @@ -32,9 +32,9 @@ class emit return field_; } - /** Density of output fields, range [1..MAX_FIELD_DENSITY] */ - int density() const { - return density_; + /** Intensity of output fields, range [1..MAX_FIELD_INTENSITY] */ + int intensity() const { + return intensity_; } /** Units of field to generate per turn subject to @ref chance */ @@ -62,7 +62,7 @@ class emit private: emit_id id_; field_id field_ = fd_null; - int density_ = MAX_FIELD_DENSITY; + int intensity_ = MAX_FIELD_INTENSITY; int qty_ = 1; int chance_ = 100; diff --git a/src/explosion.cpp b/src/explosion.cpp index abb8f260e8a1e..0ccd8e48ecede 100644 --- a/src/explosion.cpp +++ b/src/explosion.cpp @@ -251,18 +251,18 @@ static void do_blast( const tripoint &p, const float power, g->m.smash_items( pt, force ); if( fire ) { - int density = ( force > 50.0f ) + ( force > 100.0f ); + int intensity = ( force > 50.0f ) + ( force > 100.0f ); if( force > 10.0f || x_in_y( force, 10.0f ) ) { - density++; + intensity++; } - if( !g->m.has_zlevels() && g->m.is_outside( pt ) && density == 2 ) { + if( !g->m.has_zlevels() && g->m.is_outside( pt ) && intensity == 2 ) { // In 3D mode, it would have fire fields above, which would then fall // and fuel the fire on this tile - density++; + intensity++; } - g->m.add_field( pt, fd_fire, density ); + g->m.add_field( pt, fd_fire, intensity ); } if( const optional_vpart_position vp = g->m.veh_at( pt ) ) { diff --git a/src/field.cpp b/src/field.cpp index 3e6b9a7d98339..846a80bda4457 100644 --- a/src/field.cpp +++ b/src/field.cpp @@ -484,7 +484,7 @@ int field_entry::move_cost() const nc_color field_entry::color() const { - return all_field_types_enum_list[type].color[density - 1]; + return all_field_types_enum_list[type].color[intensity - 1]; } char field_entry::symbol() const @@ -499,7 +499,7 @@ field_id field_entry::get_field_type() const int field_entry::get_field_intensity() const { - return density; + return intensity; } time_duration field_entry::get_field_age() const @@ -521,10 +521,10 @@ field_id field_entry::set_field_type( const field_id new_field_id ) } -int field_entry::set_field_density( const int new_density ) +int field_entry::set_field_intensity( const int new_intensity ) { - is_alive = new_density > 0; - return density = std::max( std::min( new_density, MAX_FIELD_DENSITY ), 1 ); + is_alive = new_intensity > 0; + return intensity = std::max( std::min( new_intensity, MAX_FIELD_INTENSITY ), 1 ); } time_duration field_entry::set_field_age( const time_duration &new_age ) @@ -569,11 +569,11 @@ const field_entry *field::find_field( const field_id field_to_find ) const Function: addfield Inserts the given field_id into the field list for a given tile if it does not already exist. Returns false if the field_id already exists, true otherwise. -If the field already exists, it will return false BUT it will add the density/age to the current values for upkeep. +If the field already exists, it will return false BUT it will add the intensity/age to the current values for upkeep. If you wish to modify an already existing field use find_field and modify the result. -Density defaults to 1, and age to 0 (permanent) if not specified. +Intensity defaults to 1, and age to 0 (permanent) if not specified. */ -bool field::add_field( const field_id field_to_add, const int new_density, +bool field::add_field( const field_id field_to_add, const int new_intensity, const time_duration &new_age ) { auto it = field_list.find( field_to_add ); @@ -583,10 +583,10 @@ bool field::add_field( const field_id field_to_add, const int new_density, } if( it != field_list.end() ) { //Already exists, but lets update it. This is tentative. - it->second.set_field_density( it->second.get_field_intensity() + new_density ); + it->second.set_field_intensity( it->second.get_field_intensity() + new_intensity ); return false; } - field_list[field_to_add] = field_entry( field_to_add, new_density, new_age ); + field_list[field_to_add] = field_entry( field_to_add, new_intensity, new_age ); return true; } @@ -645,9 +645,10 @@ std::map::const_iterator field::end() const return field_list.end(); } -std::string field_t::name( const int density ) const +std::string field_t::name( const int intensity ) const { - const std::string &n = untranslated_name[std::min( std::max( 0, density ), MAX_FIELD_DENSITY - 1 )]; + const std::string &n = untranslated_name[std::min( std::max( 0, intensity ), + MAX_FIELD_INTENSITY - 1 )]; return n.empty() ? n : _( n ); } diff --git a/src/field.h b/src/field.h index f9949dca528ea..3ea2883940f30 100644 --- a/src/field.h +++ b/src/field.h @@ -26,32 +26,32 @@ struct field_t { // should be the same as the entry in field_id below (e.g. "fd_fire"). std::string id; - /** Display name for field at given density (e.g. light smoke, smoke, heavy smoke) */ - std::string untranslated_name[ MAX_FIELD_DENSITY ]; - /// Can be empty! \p density must be in the range [0, MAX_FIELD_DENSITY - 1]. - std::string name( int density ) const; + /** Display name for field at given intensity (e.g. light smoke, smoke, heavy smoke) */ + std::string untranslated_name[ MAX_FIELD_INTENSITY ]; + /// Can be empty! \p intensity must be in the range [0, MAX_FIELD_INTENSITY - 1]. + std::string name( int intensity ) const; char sym; //The symbol to draw for this field. Note that some are reserved like * and %. You will have to check the draw function for specifics. int priority; //Inferior numbers have lower priority. 0 is "ground" (splatter), 2 is "on the ground", 4 is "above the ground" (fire), 6 is reserved for furniture, and 8 is "in the air" (smoke). - /** Color the field will be drawn as on the screen at a given density */ - deferred_color color[ MAX_FIELD_DENSITY ]; + /** Color the field will be drawn as on the screen at a given intensity */ + deferred_color color[ MAX_FIELD_INTENSITY ]; /** * If false this field may block line of sight. * @warning this does nothing by itself. You must go to the code block in lightmap.cpp and modify * transparancy code there with a case statement as well! **/ - bool transparent[ MAX_FIELD_DENSITY ]; + bool transparent[ MAX_FIELD_INTENSITY ]; - /** Where tile is dangerous (prompt before moving into) at given density */ - bool dangerous[ MAX_FIELD_DENSITY ]; + /** Where tile is dangerous (prompt before moving into) at given intensity */ + bool dangerous[ MAX_FIELD_INTENSITY ]; - //Controls, albeit randomly, how long a field of a given type will last before going down in density. + //Controls, albeit randomly, how long a field of a given type will last before going down in intensity. time_duration halflife; - /** cost of moving into and out of this field at given density */ - int move_cost[ MAX_FIELD_DENSITY ]; + /** cost of moving into and out of this field at given intensity */ + int move_cost[ MAX_FIELD_INTENSITY ]; /** Does it penetrate obstacles like gas, spread like liquid or just lie there like solid? */ phase_id phase; @@ -134,13 +134,13 @@ bool field_type_dangerous( field_id id ); /** * An active or passive effect existing on a tile. - * Each effect can vary in intensity (density) and age (usually used as a time to live). + * Each effect can vary in intensity and age (usually used as a time to live). */ class field_entry { public: - field_entry() : type( fd_null ), density( 1 ), age( 0_turns ), is_alive( false ) { } - field_entry( const field_id t, const int d, const time_duration &a ) : type( t ), density( d ), + field_entry() : type( fd_null ), intensity( 1 ), age( 0_turns ), is_alive( false ) { } + field_entry( const field_id t, const int i, const time_duration &a ) : type( t ), intensity( i ), age( a ), is_alive( true ) { } nc_color color() const; @@ -153,7 +153,7 @@ class field_entry //Returns the field_id of the current field entry. field_id get_field_type() const; - //Returns the current density (aka intensity) of the current field entry. + //Returns the current intensity of the current field entry. int get_field_intensity() const; //Allows you to modify the field_id of the current field entry. @@ -161,8 +161,8 @@ class field_entry //breaks the field drawing code and field lookup field_id set_field_type( const field_id new_field_id ); - //Allows you to modify the density of the current field entry. - int set_field_density( const int new_density ); + //Allows you to modify the intensity of the current field entry. + int set_field_intensity( const int new_intensity ); /// @returns @ref age. time_duration get_field_age() const; @@ -177,13 +177,13 @@ class field_entry //Returns if the current field is dangerous or not. bool is_dangerous() const { - return all_field_types_enum_list[type].dangerous[density - 1]; + return all_field_types_enum_list[type].dangerous[intensity - 1]; } - //Returns the display name of the current field given its current density. + //Returns the display name of the current field given its current intensity. //IE: light smoke, smoke, heavy smoke std::string name() const { - return all_field_types_enum_list[type].name( density - 1 ); + return all_field_types_enum_list[type].name( intensity - 1 ); } //Returns true if this is an active field, false if it should be removed. @@ -197,7 +197,7 @@ class field_entry private: field_id type; //The field identifier. - int density; //The density, or intensity (higher is stronger), of the field entry. + int intensity; //The intensity (higher is stronger), of the field entry. time_duration age; //The age, of the field effect. 0 is permanent. bool is_alive; //True if this is an active field, false if it should be destroyed next check. }; @@ -234,11 +234,11 @@ class field /** * Inserts the given field_id into the field list for a given tile if it does not already exist. * If you wish to modify an already existing field use find_field and modify the result. - * Density defaults to 1, and age to 0 (permanent) if not specified. - * The density is added to an existing field entry, but the age is only used for newly added entries. + * Intensity defaults to 1, and age to 0 (permanent) if not specified. + * The intensity is added to an existing field entry, but the age is only used for newly added entries. * @return false if the field_id already exists, true otherwise. */ - bool add_field( field_id field_to_add, int new_density = 1, + bool add_field( field_id field_to_add, int new_intensity = 1, const time_duration &new_age = 0_turns ); /** diff --git a/src/fungal_effects.cpp b/src/fungal_effects.cpp index a93f891a5313c..5675af8711169 100644 --- a/src/fungal_effects.cpp +++ b/src/fungal_effects.cpp @@ -150,7 +150,7 @@ void fungal_effects::spread_fungus_one_tile( const tripoint &p, const int growth } } else if( m.has_flag( "YOUNG", p ) ) { if( x_in_y( growth * 10, 500 ) ) { - if( m.get_field_strength( p, fd_fungal_haze ) != 0 ) { + if( m.get_field_intensity( p, fd_fungal_haze ) != 0 ) { if( x_in_y( growth * 10, 800 ) ) { // young trees are vulnerable m.ter_set( p, t_fungus ); gm.summon_mon( mon_fungal_blossom, p ); @@ -167,7 +167,7 @@ void fungal_effects::spread_fungus_one_tile( const tripoint &p, const int growth } } else if( m.has_flag( "TREE", p ) ) { if( one_in( 10 ) ) { - if( m.get_field_strength( p, fd_fungal_haze ) != 0 ) { + if( m.get_field_intensity( p, fd_fungal_haze ) != 0 ) { if( x_in_y( growth * 10, 100 ) ) { m.ter_set( p, t_fungus ); gm.summon_mon( mon_fungal_blossom, p ); diff --git a/src/game.cpp b/src/game.cpp index 8fbd1c6887293..4b4970a372b0d 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1711,7 +1711,7 @@ int get_heat_radiation( const tripoint &location, bool direct ) } int heat_intensity = 0; - int ffire = g->m.get_field_strength( dest, fd_fire ); + int ffire = g->m.get_field_intensity( dest, fd_fire ); if( ffire > 0 ) { heat_intensity = ffire; } else if( g->m.tr_at( dest ).loadid == tr_lava ) { @@ -1747,26 +1747,26 @@ int get_convection_temperature( const tripoint &location ) int temp_mod = 0; const trap &trap_at_pos = g->m.tr_at( location ); // directly on fire/lava tiles - int tile_strength = g->m.get_field_strength( location, fd_fire ); - if( tile_strength > 0 || trap_at_pos.loadid == tr_lava ) { + int tile_intensity = g->m.get_field_intensity( location, fd_fire ); + if( tile_intensity > 0 || trap_at_pos.loadid == tr_lava ) { temp_mod += 300; } // hot air of a fire/lava - auto tile_strength_mod = []( const tripoint & loc, field_id fld, int case_1, int case_2, + auto tile_intensity_mod = []( const tripoint & loc, field_id fld, int case_1, int case_2, int case_3 ) { - int strength = g->m.get_field_strength( loc, fld ); + int intensity = g->m.get_field_intensity( loc, fld ); int cases[3] = { case_1, case_2, case_3 }; - return ( strength > 0 && strength < 4 ) ? cases[ strength - 1 ] : 0; + return ( intensity > 0 && intensity < 4 ) ? cases[ intensity - 1 ] : 0; }; - temp_mod += tile_strength_mod( location, fd_hot_air1, 2, 6, 10 ); - temp_mod += tile_strength_mod( location, fd_hot_air2, 6, 16, 20 ); - temp_mod += tile_strength_mod( location, fd_hot_air3, 16, 40, 70 ); - temp_mod += tile_strength_mod( location, fd_hot_air4, 70, 100, 160 ); - temp_mod -= tile_strength_mod( location, fd_cold_air1, 2, 6, 10 ); - temp_mod -= tile_strength_mod( location, fd_cold_air2, 6, 16, 20 ); - temp_mod -= tile_strength_mod( location, fd_cold_air3, 16, 40, 70 ); - temp_mod -= tile_strength_mod( location, fd_cold_air4, 70, 100, 160 ); + temp_mod += tile_intensity_mod( location, fd_hot_air1, 2, 6, 10 ); + temp_mod += tile_intensity_mod( location, fd_hot_air2, 6, 16, 20 ); + temp_mod += tile_intensity_mod( location, fd_hot_air3, 16, 40, 70 ); + temp_mod += tile_intensity_mod( location, fd_hot_air4, 70, 100, 160 ); + temp_mod -= tile_intensity_mod( location, fd_cold_air1, 2, 6, 10 ); + temp_mod -= tile_intensity_mod( location, fd_cold_air2, 6, 16, 20 ); + temp_mod -= tile_intensity_mod( location, fd_cold_air3, 16, 40, 70 ); + temp_mod -= tile_intensity_mod( location, fd_cold_air4, 70, 100, 160 ); return temp_mod; } @@ -8981,9 +8981,9 @@ bool game::walk_move( const tripoint &dest_loc ) const tripoint shifted_furn_dest = tripoint( furn_dest.x - submap_shift.x * SEEX, furn_dest.y - submap_shift.y * SEEY, furn_dest.z ); const time_duration fire_age = m.get_field_age( shifted_furn_pos, fd_fire ); - const int fire_str = m.get_field_strength( shifted_furn_pos, fd_fire ); + const int fire_intensity = m.get_field_intensity( shifted_furn_pos, fd_fire ); m.remove_field( shifted_furn_pos, fd_fire ); - m.set_field_strength( shifted_furn_dest, fd_fire, fire_str ); + m.set_field_intensity( shifted_furn_dest, fd_fire, fire_intensity ); m.set_field_age( shifted_furn_dest, fd_fire, fire_age ); } @@ -9478,7 +9478,7 @@ bool game::grabbed_furn_move( const tripoint &dp ) m.furn( fpos ).obj().has_flag( "FIRE_CONTAINER" ) || m.furn( fpos ).obj().has_flag( "SEALED" ); - const int fire_str = m.get_field_strength( fpos, fd_fire ); + const int fire_intensity = m.get_field_intensity( fpos, fd_fire ); time_duration fire_age = m.get_field_age( fpos, fd_fire ); int str_req = furntype.move_str_req; @@ -9538,9 +9538,9 @@ bool game::grabbed_furn_move( const tripoint &dp ) m.furn_set( fdest, m.furn( fpos ) ); m.furn_set( fpos, f_null ); - if( fire_str == 1 && !pulling_furniture ) { + if( fire_intensity == 1 && !pulling_furniture ) { m.remove_field( fpos, fd_fire ); - m.set_field_strength( fdest, fd_fire, fire_str ); + m.set_field_intensity( fdest, fd_fire, fire_intensity ); m.set_field_age( fdest, fd_fire, fire_age ); } diff --git a/src/game_constants.h b/src/game_constants.h index 98f09d76b37a4..966c27fd4bed5 100644 --- a/src/game_constants.h +++ b/src/game_constants.h @@ -107,8 +107,8 @@ constexpr time_duration CORPSE_ROT_TIME = 24_hours; /** Cap JACK requirements to support arbitrarily large vehicles */ #define JACK_LIMIT 8500_kilogram // 8500kg ( 8.5 metric tonnes ) -/** Maximum density of a map field */ -#define MAX_FIELD_DENSITY 3 +/** Maximum intensity of a map field */ +#define MAX_FIELD_INTENSITY 3 /** Slowest speed at which a gun can be aimed */ #define MAX_AIM_COST 10 diff --git a/src/iuse.cpp b/src/iuse.cpp index 8b8989f5051e8..3410ea78de91b 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -2036,7 +2036,7 @@ int iuse::extinguisher( player *p, item *it, bool, const tripoint & ) p->moves -= to_moves( 2_seconds ); // Reduce the strength of fire (if any) in the target tile. - g->m.adjust_field_strength( dest, fd_fire, 0 - rng( 2, 3 ) ); + g->m.adjust_field_intensity( dest, fd_fire, 0 - rng( 2, 3 ) ); // Also spray monsters in that tile. if( monster *const mon_ptr = g->critter_at( dest, true ) ) { @@ -2067,7 +2067,7 @@ int iuse::extinguisher( player *p, item *it, bool, const tripoint & ) dest.x += ( dest.x - p->posx() ); dest.y += ( dest.y - p->posy() ); - g->m.adjust_field_strength( dest, fd_fire, std::min( 0 - rng( 0, 1 ) + rng( 0, 1 ), 0 ) ); + g->m.adjust_field_intensity( dest, fd_fire, std::min( 0 - rng( 0, 1 ) + rng( 0, 1 ), 0 ) ); } return it->type->charges_to_use(); @@ -3483,11 +3483,11 @@ int iuse::throwable_extinguisher_act( player *, item *it, bool, const tripoint & } if( g->m.get_field( pos, fd_fire ) != nullptr ) { // Reduce the strength of fire (if any) in the target tile. - g->m.adjust_field_strength( pos, fd_fire, 0 - 1 ); + g->m.adjust_field_intensity( pos, fd_fire, 0 - 1 ); // Slightly reduce the strength of fire around and in the target tile. for( const tripoint &dest : g->m.points_in_radius( pos, 1 ) ) { if( g->m.passable( dest ) && dest != pos ) { - g->m.adjust_field_strength( dest, fd_fire, 0 - rng( 0, 1 ) ); + g->m.adjust_field_intensity( dest, fd_fire, 0 - rng( 0, 1 ) ); } } return 1; @@ -3737,8 +3737,8 @@ int iuse::molotov_lit( player *p, item *it, bool t, const tripoint &pos ) } else { if( !t ) { for( auto &pt : g->m.points_in_radius( pos, 1, 0 ) ) { - const int density = 1 + one_in( 3 ) + one_in( 5 ); - g->m.add_field( pt, fd_fire, density ); + const int intensity = 1 + one_in( 3 ) + one_in( 5 ); + g->m.add_field( pt, fd_fire, intensity ); } } } diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index 61f8c125d3c39..c0919a9e87e41 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -424,8 +424,8 @@ void explosion_iuse::load( JsonObject &obj ) if( obj.has_member( "fields_type" ) || fields_radius > 0 ) { fields_type = field_from_ident( obj.get_string( "fields_type" ) ); } - obj.read( "fields_min_density", fields_min_density ); - obj.read( "fields_max_density", fields_max_density ); + obj.read( "fields_min_intensity", fields_min_intensity ); + obj.read( "fields_max_intensity", fields_max_intensity ); obj.read( "emp_blast_radius", emp_blast_radius ); obj.read( "scrambler_blast_radius", scrambler_blast_radius ); obj.read( "sound_volume", sound_volume ); @@ -467,8 +467,8 @@ int explosion_iuse::use( player &p, item &it, bool t, const tripoint &pos ) cons if( fields_radius >= 0 && fields_type != fd_null ) { std::vector gas_sources = points_for_gas_cloud( pos, fields_radius ); for( auto &gas_source : gas_sources ) { - const int dens = rng( fields_min_density, fields_max_density ); - g->m.add_field( gas_source, fields_type, dens, 1_turns ); + const int intens = rng( fields_min_intensity, fields_max_intensity ); + g->m.add_field( gas_source, fields_type, intens, 1_turns ); } } if( scrambler_blast_radius >= 0 ) { diff --git a/src/iuse_actor.h b/src/iuse_actor.h index 305aac2e44aef..62f7de2da3ed2 100644 --- a/src/iuse_actor.h +++ b/src/iuse_actor.h @@ -152,8 +152,8 @@ class explosion_iuse : public iuse_actor /** Create fields of this type around the center of the explosion */ int fields_radius = -1; field_id fields_type; - int fields_min_density = 1; - int fields_max_density = MAX_FIELD_DENSITY; + int fields_min_intensity = 1; + int fields_max_intensity = MAX_FIELD_INTENSITY; /** Calls game::emp_blast if >= 0 */ int emp_blast_radius = -1; /** Calls game::scrambler_blast if >= 0 */ diff --git a/src/lightmap.cpp b/src/lightmap.cpp index 4bf3ea4e2210c..054be89de451f 100644 --- a/src/lightmap.cpp +++ b/src/lightmap.cpp @@ -125,9 +125,9 @@ bool map::build_transparency_cache( const int zlev ) for( const auto &fld : cur_submap->fld[sx][sy] ) { const field_entry &cur = fld.second; const field_id type = cur.get_field_type(); - const int density = cur.get_field_intensity(); + const int intensity = cur.get_field_intensity(); - if( all_field_types_enum_list[type].transparent[density - 1] ) { + if( all_field_types_enum_list[type].transparent[intensity - 1] ) { continue; } @@ -144,9 +144,9 @@ bool map::build_transparency_cache( const int zlev ) case fd_incendiary: case fd_toxic_gas: case fd_tear_gas: - if( density == 3 ) { + if( intensity == 3 ) { value = LIGHT_TRANSPARENCY_SOLID; - } else if( density == 2 ) { + } else if( intensity == 2 ) { value *= 10; } break; @@ -154,7 +154,7 @@ bool map::build_transparency_cache( const int zlev ) value *= 10; break; case fd_fire: - value *= 1.0 - ( density * 0.3 ); + value *= 1.0 - ( intensity * 0.3 ); break; default: value = LIGHT_TRANSPARENCY_SOLID; @@ -1440,7 +1440,7 @@ void map::apply_light_arc( const tripoint &p, int angle, float luminance, int wi return; } - // attempt to determine beam density required to cover all squares + // attempt to determine beam intensity required to cover all squares const double wstep = ( wangle / ( wdist * SQRT_2 ) ); // NOLINTNEXTLINE(clang-analyzer-security.FloatLoopCounter) diff --git a/src/map.cpp b/src/map.cpp index caa29bb3f416b..2c523a0bfe91d 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2673,7 +2673,7 @@ bool map::is_flammable( const tripoint &p ) return true; } - if( get_field_strength( p, fd_web ) > 0 ) { + if( get_field_intensity( p, fd_web ) > 0 ) { return true; } @@ -5328,9 +5328,9 @@ time_duration map::adjust_field_age( const tripoint &p, const field_id type, return set_field_age( p, type, offset, true ); } -int map::adjust_field_strength( const tripoint &p, const field_id type, const int offset ) +int map::adjust_field_intensity( const tripoint &p, const field_id type, const int offset ) { - return set_field_strength( p, type, offset, true ); + return set_field_intensity( p, type, offset, true ); } time_duration map::set_field_age( const tripoint &p, const field_id type, const time_duration &age, @@ -5346,13 +5346,13 @@ time_duration map::set_field_age( const tripoint &p, const field_id type, const * set strength of field type at point, creating if not present, removing if strength is 0 * returns resulting strength, or 0 for not present */ -int map::set_field_strength( const tripoint &p, const field_id type, const int str, bool isoffset ) +int map::set_field_intensity( const tripoint &p, const field_id type, const int str, bool isoffset ) { field_entry *field_ptr = get_field( p, type ); if( field_ptr != nullptr ) { int adj = ( isoffset ? field_ptr->get_field_intensity() : 0 ) + str; if( adj > 0 ) { - field_ptr->set_field_density( adj ); + field_ptr->set_field_intensity( adj ); return adj; } else { remove_field( p, type ); @@ -5371,7 +5371,7 @@ time_duration map::get_field_age( const tripoint &p, const field_id type ) const return field_ptr == nullptr ? -1_turns : field_ptr->get_field_age(); } -int map::get_field_strength( const tripoint &p, const field_id type ) const +int map::get_field_intensity( const tripoint &p, const field_id type ) const { auto field_ptr = field_at( p ).find_field( type ); return ( field_ptr == nullptr ? 0 : field_ptr->get_field_intensity() ); @@ -5389,14 +5389,15 @@ field_entry *map::get_field( const tripoint &p, const field_id type ) return current_submap->fld[l.x][l.y].find_field( type ); } -bool map::add_field( const tripoint &p, const field_id type, int density, const time_duration &age ) +bool map::add_field( const tripoint &p, const field_id type, int intensity, + const time_duration &age ) { if( !inbounds( p ) ) { return false; } - density = std::min( density, MAX_FIELD_DENSITY ); - if( density <= 0 ) { + intensity = std::min( intensity, MAX_FIELD_INTENSITY ); + if( intensity <= 0 ) { return false; } @@ -5408,7 +5409,7 @@ bool map::add_field( const tripoint &p, const field_id type, int density, const submap *const current_submap = get_submap_at( p, l ); current_submap->is_uniform = false; - if( current_submap->fld[l.x][l.y].add_field( type, density, age ) ) { + if( current_submap->fld[l.x][l.y].add_field( type, intensity, age ) ) { //Only adding it to the count if it doesn't exist. current_submap->field_count++; } @@ -5479,7 +5480,7 @@ void map::add_splatter( const field_id type, const tripoint &where, int intensit } } } - adjust_field_strength( where, type, intensity ); + adjust_field_intensity( where, type, intensity ); } void map::add_splatter_trail( const field_id type, const tripoint &from, const tripoint &to ) @@ -5499,14 +5500,14 @@ void map::add_splatter_trail( const field_id type, const tripoint &from, const t } } -void map::add_splash( const field_id type, const tripoint ¢er, int radius, int density ) +void map::add_splash( const field_id type, const tripoint ¢er, int radius, int intensity ) { if( type == fd_null ) { return; } // TODO: use Bresenham here and take obstacles into account for( const tripoint &pnt : points_in_radius( center, radius ) ) { - if( trig_dist( pnt, center ) <= radius && !one_in( density ) ) { + if( trig_dist( pnt, center ) <= radius && !one_in( intensity ) ) { add_splatter( type, pnt ); } } @@ -7159,10 +7160,10 @@ void map::decay_cosmetic_fields( const tripoint &p, const time_duration &time_si const time_duration added_age = 2 * time_since_last_actualize / rng( 2, 4 ); fd.mod_age( added_age ); const time_duration hl = all_field_types_enum_list[ fd.get_field_type() ].halflife; - const int density_drop = fd.get_field_age() / hl; - if( density_drop > 0 ) { - fd.set_field_density( fd.get_field_intensity() - density_drop ); - fd.mod_age( -hl * density_drop ); + const int intensity_drop = fd.get_field_age() / hl; + if( intensity_drop > 0 ) { + fd.set_field_intensity( fd.get_field_intensity() - intensity_drop ); + fd.mod_age( -hl * intensity_drop ); } } } @@ -8540,8 +8541,8 @@ void map::update_pathfinding_cache( int zlev ) const for( const auto &fld : tile.get_field() ) { const field_entry &cur = fld.second; const field_id type = cur.get_field_type(); - const int density = cur.get_field_intensity(); - if( all_field_types_enum_list[type].dangerous[density - 1] ) { + const int intensity = cur.get_field_intensity(); + if( all_field_types_enum_list[type].dangerous[intensity - 1] ) { cur_value |= PF_FIELD; } } diff --git a/src/map.h b/src/map.h index 42cde8184d698..b3346c96ef60e 100644 --- a/src/map.h +++ b/src/map.h @@ -1071,10 +1071,10 @@ class map */ time_duration get_field_age( const tripoint &p, const field_id type ) const; /** - * Get the density of a field entry (@ref field_entry::density), + * Get the intensity of a field entry (@ref field_entry::intensity), * if there is no field of that type, returns 0. */ - int get_field_strength( const tripoint &p, const field_id type ) const; + int get_field_intensity( const tripoint &p, const field_id type ) const; /** * Increment/decrement age of field entry at point. * @return resulting age or `-1_turns` if not present (does *not* create a new field). @@ -1082,11 +1082,11 @@ class map time_duration adjust_field_age( const tripoint &p, const field_id type, const time_duration &offset ); /** - * Increment/decrement density of field entry at point, creating if not present, - * removing if density becomes 0. - * @return resulting density, or 0 for not present (either removed or not created at all). + * Increment/decrement intensity of field entry at point, creating if not present, + * removing if intensity becomes 0. + * @return resulting intensity, or 0 for not present (either removed or not created at all). */ - int adjust_field_strength( const tripoint &p, const field_id type, const int offset ); + int adjust_field_intensity( const tripoint &p, const field_id type, const int offset ); /** * Set age of field entry at point. * @param p Location of field @@ -1099,27 +1099,27 @@ class map time_duration set_field_age( const tripoint &p, const field_id type, const time_duration &age, bool isoffset = false ); /** - * Set density of field entry at point, creating if not present, - * removing if density becomes 0. + * Set intensity of field entry at point, creating if not present, + * removing if intensity becomes 0. * @param p Location of field * @param type ID of field * @param str New strength of field * @param isoffset If true, the given str value is added to the existing value, - * if false, the existing density is ignored and overridden. - * @return resulting density, or 0 for not present (either removed or not created at all). + * if false, the existing intensity is ignored and overridden. + * @return resulting intensity, or 0 for not present (either removed or not created at all). */ - int set_field_strength( const tripoint &p, const field_id type, const int str, - bool isoffset = false ); + int set_field_intensity( const tripoint &p, const field_id type, const int str, + bool isoffset = false ); /** * Get field of specific type at point. * @return NULL if there is no such field entry at that place. */ field_entry *get_field( const tripoint &p, const field_id type ); /** - * Add field entry at point, or set density if present + * Add field entry at point, or set intensity if present * @return false if the field could not be created (out of bounds), otherwise true. */ - bool add_field( const tripoint &p, const field_id type, int density, + bool add_field( const tripoint &p, const field_id type, int intensity, const time_duration &age = 0_turns ); /** * Remove field entry at xy, ignored if the field entry is not present. @@ -1127,12 +1127,12 @@ class map void remove_field( const tripoint &p, const field_id field_to_remove ); // Splatters of various kind - void add_splatter( const field_id type, const tripoint &where, int density = 1 ); + void add_splatter( const field_id type, const tripoint &where, int intensity = 1 ); void add_splatter_trail( const field_id type, const tripoint &from, const tripoint &to ); void add_splash( const field_id type, const tripoint ¢er, int radius, int density ); void propagate_field( const tripoint ¢er, const field_id type, - int amount, int max_density = MAX_FIELD_DENSITY ); + int amount, int max_intensity = MAX_FIELD_INTENSITY ); /** * Runs one cycle of emission @ref src which **may** result in propagation of fields diff --git a/src/map_field.cpp b/src/map_field.cpp index 1c187fe035c05..9029fab300bf1 100644 --- a/src/map_field.cpp +++ b/src/map_field.cpp @@ -202,15 +202,15 @@ bool map::process_fields_in_submap( submap *const current_submap, g->scent.set( tmp, 0 ); } - const int current_density = cur.get_field_intensity(); + const int current_intensity = cur.get_field_intensity(); const time_duration current_age = cur.get_field_age(); // Dissipate faster outdoors. if( is_outside( p ) ) { cur.set_field_age( current_age + outdoor_age_speedup ); } - // Bail out if we don't meet the spread chance or required density. - if( current_density <= 1 || rng( 1, ( 100 - windpower ) ) > percent_spread ) { + // Bail out if we don't meet the spread chance or required intensity. + if( current_intensity <= 1 || rng( 1, ( 100 - windpower ) ) > percent_spread ) { return; } @@ -226,16 +226,16 @@ bool map::process_fields_in_submap( submap *const current_submap, const auto spread_to = [&]( maptile & dst ) { field_entry *candidate_field = dst.find_field( curtype ); // Nearby gas grows thicker, and ages are shared. - const time_duration age_fraction = current_age / current_density ; + const time_duration age_fraction = current_age / current_intensity ; if( candidate_field != nullptr ) { - candidate_field->set_field_density( candidate_field->get_field_intensity() + 1 ); - cur.set_field_density( current_density - 1 ); + candidate_field->set_field_intensity( candidate_field->get_field_intensity() + 1 ); + cur.set_field_intensity( current_intensity - 1 ); candidate_field->set_field_age( candidate_field->get_field_age() + age_fraction ); cur.set_field_age( current_age - age_fraction ); // Or, just create a new field. } else if( dst.add_field( curtype, 1, 0_turns ) ) { dst.find_field( curtype )->set_field_age( age_fraction ); - cur.set_field_density( current_density - 1 ); + cur.set_field_intensity( current_intensity - 1 ); cur.set_field_age( current_age - age_fraction ); } }; @@ -308,9 +308,9 @@ bool map::process_fields_in_submap( submap *const current_submap, Function: create_hot_air Helper function that encapsulates the logic involved in creating hot air. */ - const auto create_hot_air = [this]( const tripoint & p, int density ) { + const auto create_hot_air = [this]( const tripoint & p, int intensity ) { field_id hot_air; - switch( density ) { + switch( intensity ) { case 1: hot_air = fd_hot_air1; break; @@ -324,7 +324,7 @@ bool map::process_fields_in_submap( submap *const current_submap, hot_air = fd_hot_air4; break; default: - debugmsg( "Tried to spread hot air with density %d", density ); + debugmsg( "Tried to spread hot air with intensity %d", intensity ); return; } @@ -376,9 +376,9 @@ bool map::process_fields_in_submap( submap *const current_submap, //Holds cur.get_field_type() as that is what the old system used before rewrite. field_id curtype = cur.get_field_type(); - // Again, legacy support in the event someone Mods set_field_density to allow more values. + // Again, legacy support in the event someone Mods set_field_intensity to allow more values. if( cur.get_field_intensity() > 3 || cur.get_field_intensity() < 1 ) { - debugmsg( "Whoooooa density of %d", cur.get_field_intensity() ); + debugmsg( "Whoooooa intensity of %d", cur.get_field_intensity() ); } // Don't process "newborn" fields. This gives the player time to run if they need to. @@ -428,20 +428,20 @@ bool map::process_fields_in_submap( submap *const current_submap, // Math can be a bit off, // but "boiling" falling acid can be allowed to be stronger // than acid that just lies there - const int sum_density = cur.get_field_intensity() + acid_there->get_field_intensity(); - const int new_density = std::min( 3, sum_density ); + const int sum_intensity = cur.get_field_intensity() + acid_there->get_field_intensity(); + const int new_intensity = std::min( 3, sum_intensity ); // No way to get precise elapsed time, let's always reset // Allow falling acid to last longer than regular acid to show it off - const time_duration new_age = -1_minutes * ( sum_density - new_density ); - acid_there->set_field_density( new_density ); + const time_duration new_age = -1_minutes * ( sum_intensity - new_intensity ); + acid_there->set_field_intensity( new_intensity ); acid_there->set_field_age( new_age ); } // Set ourselves up for removal - cur.set_field_density( 0 ); + cur.set_field_intensity( 0 ); } - // TODO: Allow spreading to the sides if age < 0 && density == 3 + // TODO: Allow spreading to the sides if age < 0 && intensity == 3 } break; @@ -556,7 +556,7 @@ bool map::process_fields_in_submap( submap *const current_submap, // Consume the terrain we're on if( ter_furn_has_flag( ter, frn, TFLAG_FLAMMABLE ) ) { - // The fire feeds on the ground itself until max density. + // The fire feeds on the ground itself until max intensity. time_added += 1_turns * ( 5 - cur.get_field_intensity() ); smoke += 2; smoke += static_cast( windpower / 5 ); @@ -567,7 +567,7 @@ bool map::process_fields_in_submap( submap *const current_submap, } else if( ter_furn_has_flag( ter, frn, TFLAG_FLAMMABLE_HARD ) && one_in( 3 ) ) { - // The fire feeds on the ground itself until max density. + // The fire feeds on the ground itself until max intensity. time_added += 1_turns * ( 4 - cur.get_field_intensity() ); smoke += 2; smoke += static_cast( windpower / 5 ); @@ -577,7 +577,7 @@ bool map::process_fields_in_submap( submap *const current_submap, } } else if( ter.has_flag( TFLAG_FLAMMABLE_ASH ) ) { - // The fire feeds on the ground itself until max density. + // The fire feeds on the ground itself until max intensity. time_added += 1_turns * ( 5 - cur.get_field_intensity() ); smoke += 2; smoke += static_cast( windpower / 5 ); @@ -592,7 +592,7 @@ bool map::process_fields_in_submap( submap *const current_submap, } } else if( frn.has_flag( TFLAG_FLAMMABLE_ASH ) ) { - // The fire feeds on the ground itself until max density. + // The fire feeds on the ground itself until max intensity. time_added += 1_turns * ( 5 - cur.get_field_intensity() ); smoke += 2; smoke += static_cast( windpower / 5 ); @@ -610,22 +610,22 @@ bool map::process_fields_in_submap( submap *const current_submap, field_entry *fire_there = dst_tile.find_field( fd_fire ); if( fire_there == nullptr ) { dst_tile.add_field( fd_fire, 1, 0_turns ); - cur.set_field_density( cur.get_field_intensity() - 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); } else { // Don't fuel raging fires or they'll burn forever // as they can produce small fires above themselves - int new_density = std::max( cur.get_field_intensity(), - fire_there->get_field_intensity() ); + int new_intensity = std::max( cur.get_field_intensity(), + fire_there->get_field_intensity() ); // Allow smaller fires to combine - if( new_density < 3 && + if( new_intensity < 3 && cur.get_field_intensity() == fire_there->get_field_intensity() ) { - new_density++; + new_intensity++; } - fire_there->set_field_density( new_density ); + fire_there->set_field_intensity( new_intensity ); // A raging fire below us can support us for a while // Otherwise decay and decay fast - if( new_density < 3 || one_in( 10 ) ) { - cur.set_field_density( cur.get_field_intensity() - 1 ); + if( new_intensity < 3 || one_in( 10 ) ) { + cur.set_field_intensity( cur.get_field_intensity() - 1 ); } } @@ -692,7 +692,7 @@ bool map::process_fields_in_submap( submap *const current_submap, dstfld->get_field_age() > cur.get_field_age() ) && ( in_pit == ( dst.get_ter() == t_pit ) ) ) { if( dstfld->get_field_intensity() < 2 ) { - dstfld->set_field_density( dstfld->get_field_intensity() + 1 ); + dstfld->set_field_intensity( dstfld->get_field_intensity() + 1 ); } dstfld->set_field_age( dstfld->get_field_age() - 5_minutes ); @@ -716,7 +716,7 @@ bool map::process_fields_in_submap( submap *const current_submap, dstfld->get_field_age() > cur.get_field_age() ) && ( in_pit == ( dst.get_ter() == t_pit ) ) ) { if( dstfld->get_field_intensity() < 2 ) { - dstfld->set_field_density( dstfld->get_field_intensity() + 1 ); + dstfld->set_field_intensity( dstfld->get_field_intensity() + 1 ); } dstfld->set_field_age( dstfld->get_field_age() - 5_minutes ); @@ -733,34 +733,34 @@ bool map::process_fields_in_submap( submap *const current_submap, // burning neighbors are necessary in addition to // field age < 0, or alternatively, a LOT of fuel. - // The maximum fire density is 1 for a lone fire, 2 for at least 1 neighbor, + // The maximum fire intensity is 1 for a lone fire, 2 for at least 1 neighbor, // 3 for at least 2 neighbors. - int maximum_density = 1; + int maximum_intensity = 1; // The following logic looks a bit complex due to optimization concerns, so here are the semantics: - // 1. Calculate maximum field density based on fuel, -50 minutes is 2(medium), -500 minutes is 3(raging) - // 2. Calculate maximum field density based on neighbors, 3 neighbors is 2(medium), 7 or more neighbors is 3(raging) + // 1. Calculate maximum field intensity based on fuel, -50 minutes is 2(medium), -500 minutes is 3(raging) + // 2. Calculate maximum field intensity based on neighbors, 3 neighbors is 2(medium), 7 or more neighbors is 3(raging) // 3. Pick the higher maximum between 1. and 2. if( cur.get_field_age() < -500_minutes ) { - maximum_density = 3; + maximum_intensity = 3; } else { for( auto &neigh : neighs ) { if( neigh.get_field().find_field( fd_fire ) != nullptr ) { adjacent_fires++; } } - maximum_density = 1 + ( adjacent_fires >= 3 ) + ( adjacent_fires >= 7 ); + maximum_intensity = 1 + ( adjacent_fires >= 3 ) + ( adjacent_fires >= 7 ); - if( maximum_density < 2 && cur.get_field_age() < -50_minutes ) { - maximum_density = 2; + if( maximum_intensity < 2 && cur.get_field_age() < -50_minutes ) { + maximum_intensity = 2; } } // If we consumed a lot, the flames grow higher - if( cur.get_field_intensity() < maximum_density && cur.get_field_age() < 0_turns ) { + if( cur.get_field_intensity() < maximum_intensity && cur.get_field_age() < 0_turns ) { // Fires under 0 age grow in size. Level 3 fires under 0 spread later on. // Weaken the newly-grown fire - cur.set_field_density( cur.get_field_intensity() + 1 ); + cur.set_field_intensity( cur.get_field_intensity() + 1 ); cur.set_field_age( cur.get_field_age() + 10_minutes * cur.get_field_intensity() ); } } @@ -839,7 +839,7 @@ bool map::process_fields_in_submap( submap *const current_submap, cur.set_field_age( cur.get_field_age() + 1_minutes ); } if( nearwebfld ) { - nearwebfld->set_field_density( 0 ); + nearwebfld->set_field_intensity( 0 ); } } } @@ -899,7 +899,7 @@ bool map::process_fields_in_submap( submap *const current_submap, cur.set_field_age( cur.get_field_age() + 1_minutes ); } if( nearwebfld ) { - nearwebfld->set_field_density( 0 ); + nearwebfld->set_field_intensity( 0 ); } } } @@ -1031,7 +1031,7 @@ bool map::process_fields_in_submap( submap *const current_submap, field &wandering_field = get_field( pnt ); tmpfld = wandering_field.find_field( fd_toxic_gas ); if( tmpfld && tmpfld->get_field_intensity() < cur.get_field_intensity() ) { - tmpfld->set_field_density( tmpfld->get_field_intensity() + 1 ); + tmpfld->set_field_intensity( tmpfld->get_field_intensity() + 1 ); } else { add_field( pnt, fd_toxic_gas, cur.get_field_intensity() ); } @@ -1045,7 +1045,7 @@ bool map::process_fields_in_submap( submap *const current_submap, field &wandering_field = get_field( pnt ); tmpfld = wandering_field.find_field( fd_smoke ); if( tmpfld && tmpfld->get_field_intensity() < cur.get_field_intensity() ) { - tmpfld->set_field_density( tmpfld->get_field_intensity() + 1 ); + tmpfld->set_field_intensity( tmpfld->get_field_intensity() + 1 ); } else { add_field( pnt, fd_smoke, cur.get_field_intensity() ); } @@ -1056,24 +1056,24 @@ bool map::process_fields_in_submap( submap *const current_submap, case fd_fire_vent: if( cur.get_field_intensity() > 1 ) { if( one_in( 3 ) ) { - cur.set_field_density( cur.get_field_intensity() - 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); } create_hot_air( p, cur.get_field_intensity() ); } else { dirty_transparency_cache = true; add_field( p, fd_flame_burst, 3, cur.get_field_age() ); - cur.set_field_density( 0 ); + cur.set_field_intensity( 0 ); } break; case fd_flame_burst: if( cur.get_field_intensity() > 1 ) { - cur.set_field_density( cur.get_field_intensity() - 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); create_hot_air( p, cur.get_field_intensity() ); } else { dirty_transparency_cache = true; add_field( p, fd_fire_vent, 3, cur.get_field_age() ); - cur.set_field_density( 0 ); + cur.set_field_intensity( 0 ); } break; @@ -1089,7 +1089,7 @@ bool map::process_fields_in_submap( submap *const current_submap, pnt.y = p.y + rng( -1, 1 ); if( passable( pnt ) ) { add_field( pnt, fd_electricity, 1, cur.get_field_age() + 1_turns ); - cur.set_field_density( cur.get_field_intensity() - 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); tries = 0; } else { tries++; @@ -1106,17 +1106,17 @@ bool map::process_fields_in_submap( submap *const current_submap, field_entry *elec = get_field( dst ).find_field( fd_electricity ); if( passable( dst ) && elec != nullptr && elec->get_field_intensity() < 3 ) { - elec->set_field_density( elec->get_field_intensity() + 1 ); - cur.set_field_density( cur.get_field_intensity() - 1 ); + elec->set_field_intensity( elec->get_field_intensity() + 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); } else if( passable( dst ) ) { add_field( dst, fd_electricity, 1, cur.get_field_age() + 1_turns ); } - cur.set_field_density( cur.get_field_intensity() - 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); } while( !valid.empty() && cur.get_field_intensity() > 1 ) { const tripoint target = random_entry_removed( valid ); add_field( target, fd_electricity, 1, cur.get_field_age() + 1_turns ); - cur.set_field_density( cur.get_field_intensity() - 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); } } } @@ -1131,7 +1131,7 @@ bool map::process_fields_in_submap( submap *const current_submap, } }; if( cur.get_field_intensity() < 3 && calendar::once_every( 6_hours ) && one_in( 10 ) ) { - cur.set_field_density( cur.get_field_intensity() + 1 ); + cur.set_field_intensity( cur.get_field_intensity() + 1 ); } else if( cur.get_field_intensity() == 3 && one_in( 600 ) ) { // Spawn nether creature! g->summon_mon( random_entry( monids ), p ); } @@ -1188,10 +1188,10 @@ bool map::process_fields_in_submap( submap *const current_submap, case fd_shock_vent: if( cur.get_field_intensity() > 1 ) { if( one_in( 5 ) ) { - cur.set_field_density( cur.get_field_intensity() - 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); } } else { - cur.set_field_density( 3 ); + cur.set_field_intensity( 3 ); int num_bolts = rng( 3, 6 ); for( int i = 0; i < num_bolts; i++ ) { int xdir = 0; @@ -1229,20 +1229,20 @@ bool map::process_fields_in_submap( submap *const current_submap, case fd_acid_vent: if( cur.get_field_intensity() > 1 ) { if( cur.get_field_age() >= 1_minutes ) { - cur.set_field_density( cur.get_field_intensity() - 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); cur.set_field_age( 0_turns ); } } else { - cur.set_field_density( 3 ); + cur.set_field_intensity( 3 ); for( const tripoint &t : points_in_radius( p, 5 ) ) { const field_entry *acid = get_field( t, fd_acid ); if( acid != nullptr && acid->get_field_intensity() == 0 ) { - int newdens = 3 - ( rl_dist( p, t ) / 2 ) + ( one_in( 3 ) ? 1 : 0 ); - if( newdens > 3 ) { - newdens = 3; + int new_intensity = 3 - ( rl_dist( p, t ) / 2 ) + ( one_in( 3 ) ? 1 : 0 ); + if( new_intensity > 3 ) { + new_intensity = 3; } - if( newdens > 0 ) { - add_field( t, fd_acid, newdens ); + if( new_intensity > 0 ) { + add_field( t, fd_acid, new_intensity ); } } } @@ -1274,7 +1274,7 @@ bool map::process_fields_in_submap( submap *const current_submap, curfield.find_field( fd_electricity ) || curfield.find_field( fd_incendiary ) ) { // Kill them at the end of processing. - cur.set_field_density( 0 ); + cur.set_field_intensity( 0 ); } else { // Bees chase the player if in range, wander randomly otherwise. if( !g->u.is_underwater() && @@ -1293,7 +1293,7 @@ bool map::process_fields_in_submap( submap *const current_submap, if( !target_field.find_field( fd_bees ) ) { add_field( tripoint( candidate_position, p.z ), fd_bees, cur.get_field_intensity(), cur.get_field_age() ); - cur.set_field_density( 0 ); + cur.set_field_intensity( 0 ); break; } } @@ -1334,11 +1334,11 @@ bool map::process_fields_in_submap( submap *const current_submap, //check the terrain and replace it accordingly to simulate the fungus dieing off const auto &ter = map_tile.get_ter_t(); const auto &frn = map_tile.get_furn_t(); - const int density = cur.get_field_intensity(); - if( ter.has_flag( "FUNGUS" ) && one_in( 10 / density ) ) { + const int intensity = cur.get_field_intensity(); + if( ter.has_flag( "FUNGUS" ) && one_in( 10 / intensity ) ) { ter_set( p, t_dirt ); } - if( frn.has_flag( "FUNGUS" ) && one_in( 10 / density ) ) { + if( frn.has_flag( "FUNGUS" ) && one_in( 10 / intensity ) ) { furn_set( p, f_null ); } } @@ -1355,7 +1355,7 @@ bool map::process_fields_in_submap( submap *const current_submap, if( fdata.halflife > 0_turns && cur.get_field_age() > 0_turns && dice( 2, to_turns( cur.get_field_age() ) ) > to_turns( fdata.halflife ) ) { cur.set_field_age( 0_turns ); - cur.set_field_density( cur.get_field_intensity() - 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); } if( !cur.is_field_alive() ) { current_submap->field_count--; @@ -1394,7 +1394,7 @@ void map::player_in_field( player &u ) } // Iterate through all field effects on this tile. - // Do not remove the field with remove_field, instead set it's density to 0. It will be removed + // Do not remove the field with remove_field, instead set it's intensity to 0. It will be removed // later by the field processing, which will also adjust field_count accordingly. for( auto &field_list_it : curfield ) { field_entry &cur = field_list_it.second; @@ -1421,12 +1421,12 @@ void map::player_in_field( player &u ) if( !u.has_trait( trait_id( "WEB_WALKER" ) ) && !u.in_vehicle ) { //between 5 and 15 minus your current web level. u.add_effect( effect_webbed, 1_turns, num_bp, true, cur.get_field_intensity() ); - cur.set_field_density( 0 ); //Its spent. + cur.set_field_intensity( 0 ); //Its spent. continue; //If you are in a vehicle destroy the web. //It should of been destroyed when you ran over it anyway. } else if( u.in_vehicle ) { - cur.set_field_density( 0 ); + cur.set_field_intensity( 0 ); continue; } } @@ -1444,27 +1444,27 @@ void map::player_in_field( player &u ) break; } - const int density = cur.get_field_intensity(); + const int intensity = cur.get_field_intensity(); int total_damage = 0; // Use a helper for a bit less boilerplate const auto burn_part = [&]( body_part bp, const int scale ) { - const int damage = rng( 1, scale + density ); + const int damage = rng( 1, scale + intensity ); // A bit ugly, but better than being annoyed by acid when in hazmat if( u.get_armor_type( DT_ACID, bp ) < damage ) { auto ddi = u.deal_damage( nullptr, bp, damage_instance( DT_ACID, damage ) ); total_damage += ddi.total_damage(); } // Represents acid seeping in rather than being splashed on - u.add_env_effect( effect_corroding, bp, 2 + density, time_duration::from_turns( rng( 2, - 1 + density ) ), bp, false, 0 ); + u.add_env_effect( effect_corroding, bp, 2 + intensity, time_duration::from_turns( rng( 2, + 1 + intensity ) ), bp, false, 0 ); }; - // 1-3 at density, 1-4 at 2, 1-5 at 3 + // 1-3 at intensity, 1-4 at 2, 1-5 at 3 burn_part( bp_foot_l, 2 ); burn_part( bp_foot_r, 2 ); - // 1 dmg at 1 density, 1-3 at 2, 1-5 at 3 - burn_part( bp_leg_l, density - 1 ); - burn_part( bp_leg_r, density - 1 ); + // 1 dmg at 1 intensity, 1-3 at 2, 1-5 at 3 + burn_part( bp_leg_l, intensity - 1 ); + burn_part( bp_leg_r, intensity - 1 ); const bool on_ground = u.is_on_ground(); if( on_ground ) { // Before, it would just break the legs and leave the survivor alone @@ -1503,7 +1503,7 @@ void map::player_in_field( player &u ) u.add_msg_player_or_npc( m_bad, _( "The sap sticks to you!" ), _( "The sap sticks to !" ) ); u.add_effect( effect_sap, cur.get_field_intensity() * 2_turns ); - cur.set_field_density( cur.get_field_intensity() - 1 ); //Use up sap. + cur.set_field_intensity( cur.get_field_intensity() - 1 ); //Use up sap. break; case fd_sludge: @@ -1511,7 +1511,7 @@ void map::player_in_field( player &u ) if( !u.in_vehicle ) { u.add_msg_if_player( m_bad, _( "The sludge is thick and sticky. You struggle to pull free." ) ); u.moves -= cur.get_field_intensity() * 300; - cur.set_field_density( 0 ); + cur.set_field_intensity( 0 ); } break; @@ -1602,16 +1602,16 @@ void map::player_in_field( player &u ) case fd_smoke: { if( !inside ) { //Get smoke disease from standing in smoke. - int density = cur.get_field_intensity(); + int intensity = cur.get_field_intensity(); int coughStr; time_duration coughDur = 0_turns; - if( density >= 3 ) { // thick smoke + if( intensity >= 3 ) { // thick smoke coughStr = 4; coughDur = 15_turns; - } else if( density == 2 ) { // smoke + } else if( intensity == 2 ) { // smoke coughStr = 2; coughDur = 7_turns; - } else { // density 1, thin smoke + } else { // intensity 1, thin smoke coughStr = 1; coughDur = 2_turns; } @@ -1673,7 +1673,7 @@ void map::player_in_field( player &u ) case fd_nuke_gas: { // Get irradiated by the nuclear fallout. - // Changed to min of density, not 0. + // Changed to min of intensity, not 0. float rads = rng( cur.get_field_intensity(), cur.get_field_intensity() * ( cur.get_field_intensity() + 1 ) ); bool rad_proof = !u.irradiate( rads ); @@ -1705,7 +1705,7 @@ void map::player_in_field( player &u ) break; case fd_electricity: { - // Small universal damage based on density, only if not electroproofed. + // Small universal damage based on intensity, only if not electroproofed. if( u.is_elec_immune() ) { break; } @@ -1747,32 +1747,32 @@ void map::player_in_field( player &u ) case fd_shock_vent: // Stepping on an acid vent shuts it down. case fd_acid_vent: - cur.set_field_density( 0 ); + cur.set_field_intensity( 0 ); continue; case fd_bees: // Player is immune to bees while underwater. if( !u.is_underwater() ) { int times_stung = 0; - int density = cur.get_field_intensity(); + int intensity = cur.get_field_intensity(); // If the bees can get at you, they cause steadily increasing pain. // TODO: Specific stinging messages. times_stung += one_in( 4 ) && - u.add_env_effect( effect_stung, bp_torso, density, 9_minutes ); + u.add_env_effect( effect_stung, bp_torso, intensity, 9_minutes ); times_stung += one_in( 4 ) && - u.add_env_effect( effect_stung, bp_torso, density, 9_minutes ); + u.add_env_effect( effect_stung, bp_torso, intensity, 9_minutes ); times_stung += one_in( 4 ) && - u.add_env_effect( effect_stung, bp_torso, density, 9_minutes ); + u.add_env_effect( effect_stung, bp_torso, intensity, 9_minutes ); times_stung += one_in( 4 ) && - u.add_env_effect( effect_stung, bp_torso, density, 9_minutes ); + u.add_env_effect( effect_stung, bp_torso, intensity, 9_minutes ); times_stung += one_in( 4 ) && - u.add_env_effect( effect_stung, bp_torso, density, 9_minutes ); + u.add_env_effect( effect_stung, bp_torso, intensity, 9_minutes ); times_stung += one_in( 4 ) && - u.add_env_effect( effect_stung, bp_torso, density, 9_minutes ); + u.add_env_effect( effect_stung, bp_torso, intensity, 9_minutes ); times_stung += one_in( 4 ) && - u.add_env_effect( effect_stung, bp_torso, density, 9_minutes ); + u.add_env_effect( effect_stung, bp_torso, intensity, 9_minutes ); times_stung += one_in( 4 ) && - u.add_env_effect( effect_stung, bp_torso, density, 9_minutes ); + u.add_env_effect( effect_stung, bp_torso, intensity, 9_minutes ); switch( times_stung ) { case 0: // Woo, unscathed! @@ -1827,11 +1827,11 @@ void map::player_in_field( player &u ) break; } bool inhaled = false; - const int density = cur.get_field_intensity(); - inhaled = u.add_env_effect( effect_poison, bp_mouth, 5, density * 1_minutes ); + const int intensity = cur.get_field_intensity(); + inhaled = u.add_env_effect( effect_poison, bp_mouth, 5, intensity * 1_minutes ); if( u.has_trait( trait_id( "THRESH_MYCUS" ) ) || u.has_trait( trait_id( "THRESH_MARLOSS" ) ) ) { - inhaled |= u.add_env_effect( effect_badpoison, bp_mouth, 5, density * 1_minutes ); - u.hurtall( rng( density, density * 2 ), nullptr ); + inhaled |= u.add_env_effect( effect_badpoison, bp_mouth, 5, intensity * 1_minutes ); + u.hurtall( rng( intensity, intensity * 2 ), nullptr ); u.add_msg_if_player( m_bad, _( "The %s burns your skin." ), cur.name() ); } @@ -1869,7 +1869,7 @@ void map::monster_in_field( monster &z ) int dam = 0; // Iterate through all field effects on this tile. - // Do not remove the field with remove_field, instead set it's density to 0. It will be removed + // Do not remove the field with remove_field, instead set it's intensity to 0. It will be removed // later by the field processing, which will also adjust field_count accordingly. for( auto &field_list_it : curfield ) { field_entry &cur = field_list_it.second; @@ -1886,7 +1886,7 @@ void map::monster_in_field( monster &z ) case fd_web: if( !z.has_flag( MF_WEBWALK ) ) { z.add_effect( effect_webbed, 1_turns, num_bp, true, cur.get_field_intensity() ); - cur.set_field_density( 0 ); + cur.set_field_intensity( 0 ); } break; @@ -1900,14 +1900,14 @@ void map::monster_in_field( monster &z ) case fd_sap: z.moves -= cur.get_field_intensity() * 5; - cur.set_field_density( cur.get_field_intensity() - 1 ); + cur.set_field_intensity( cur.get_field_intensity() - 1 ); break; case fd_sludge: if( !z.has_flag( MF_DIGS ) && !z.has_flag( MF_FLIES ) && !z.has_flag( MF_SLUDGEPROOF ) ) { z.moves -= cur.get_field_intensity() * 300; - cur.set_field_density( 0 ); + cur.set_field_intensity( 0 ); } break; @@ -2121,17 +2121,17 @@ void map::monster_in_field( monster &z ) !z.type->has_flag( MF_NO_BREATHE ) && !z.make_fungus() ) { // Don't insta-kill jabberwocks, that's silly - const int density = cur.get_field_intensity(); - z.moves -= rng( 10 * density, 30 * density ); - dam += rng( 0, 10 * density ); + const int intensity = cur.get_field_intensity(); + z.moves -= rng( 10 * intensity, 30 * intensity ); + dam += rng( 0, 10 * intensity ); } break; case fd_fungicidal_gas: if( z.type->in_species( FUNGUS ) ) { - const int density = cur.get_field_intensity(); - z.moves -= rng( 10 * density, 30 * density ); - dam += rng( 4, 7 * density ); + const int intensity = cur.get_field_intensity(); + z.moves -= rng( 10 * intensity, 30 * intensity ); + dam += rng( 4, 7 * intensity ); } break; @@ -2206,12 +2206,12 @@ void map::emit_field( const tripoint &pos, const emit_id &src, float mul ) float chance = src->chance() * mul; if( src.is_valid() && x_in_y( chance, 100 ) ) { int qty = chance > 100.0f ? roll_remainder( src->qty() * chance / 100.0f ) : src->qty(); - propagate_field( pos, src->field(), qty, src->density() ); + propagate_field( pos, src->field(), qty, src->intensity() ); } } void map::propagate_field( const tripoint ¢er, const field_id type, int amount, - int max_density ) + int max_intensity ) { using gas_blast = std::pair; std::priority_queue, pair_greater_cmp_first> open; @@ -2226,12 +2226,12 @@ void map::propagate_field( const tripoint ¢er, const field_id type, int amou continue; } - // All points with equal gas density should propagate at the same time + // All points with equal gas intensity should propagate at the same time std::list gas_front; gas_front.push_back( open.top() ); - int cur_intensity = get_field_strength( open.top().second, type ); + int cur_intensity = get_field_intensity( open.top().second, type ); open.pop(); - while( !open.empty() && get_field_strength( open.top().second, type ) == cur_intensity ) { + while( !open.empty() && get_field_intensity( open.top().second, type ) == cur_intensity ) { if( closed.count( open.top().second ) == 0 ) { gas_front.push_back( open.top() ); } @@ -2244,10 +2244,10 @@ void map::propagate_field( const tripoint ¢er, const field_id type, int amou while( amount > 0 && !gas_front.empty() ) { auto gp = random_entry_removed( gas_front ); closed.insert( gp.second ); - int cur_strength = get_field_strength( gp.second, type ); - if( cur_strength < max_density ) { - int bonus = std::min( max_density - cur_strength, increment ); - adjust_field_strength( gp.second, type, bonus ); + int cur_intensity = get_field_intensity( gp.second, type ); + if( cur_intensity < max_intensity ) { + int bonus = std::min( max_intensity - cur_intensity, increment ); + adjust_field_intensity( gp.second, type, bonus ); amount -= bonus; } else { amount--; diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 797a21ec2c95a..b67e1f26f766f 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -739,18 +739,18 @@ class jmapgen_alternativly : public jmapgen_piece /** * Places fields on the map. * "field": field type ident. - * "density": initial field density. + * "intensity": initial field intensity. * "age": initial field age. */ class jmapgen_field : public jmapgen_piece { public: field_id ftype; - int density; + int intensity; time_duration age; jmapgen_field( JsonObject &jsi ) : jmapgen_piece() , ftype( field_from_ident( jsi.get_string( "field" ) ) ) - , density( jsi.get_int( "density", 1 ) ) + , intensity( jsi.get_int( "intensity", 1 ) ) , age( time_duration::from_turns( jsi.get_int( "age", 0 ) ) ) { if( ftype == fd_null ) { set_mapgen_defer( jsi, "field", "invalid field type" ); @@ -758,7 +758,7 @@ class jmapgen_field : public jmapgen_piece } void apply( const mapgendata &dat, const jmapgen_int &x, const jmapgen_int &y, const float /*mon_density*/, mission * /*miss*/ ) const override { - dat.m.add_field( tripoint( x.get(), y.get(), dat.m.get_abs_sub().z ), ftype, density, age ); + dat.m.add_field( tripoint( x.get(), y.get(), dat.m.get_abs_sub().z ), ftype, intensity, age ); } }; /** diff --git a/src/mapgen_functions.cpp b/src/mapgen_functions.cpp index 2b7ec0c4235d8..8097137742211 100644 --- a/src/mapgen_functions.cpp +++ b/src/mapgen_functions.cpp @@ -4552,10 +4552,10 @@ void mtrap_set( map *m, int x, int y, trap_id type ) m->trap_set( actual_location, type ); } -void madd_field( map *m, int x, int y, field_id type, int density ) +void madd_field( map *m, int x, int y, field_id type, int intensity ) { tripoint actual_location( x, y, m->get_abs_sub().z ); - m->add_field( actual_location, type, density, 0_turns ); + m->add_field( actual_location, type, intensity, 0_turns ); } static bool is_suitable_for_stairs( const map *const m, const tripoint &p ) diff --git a/src/mapgen_functions.h b/src/mapgen_functions.h index a2c1fea2404c9..d3ddca14a6eb8 100644 --- a/src/mapgen_functions.h +++ b/src/mapgen_functions.h @@ -209,7 +209,7 @@ void mapgen_lake_shore( map *m, oter_id terrain_type, mapgendata dat, const time // Temporary wrappers void mremove_trap( map *m, int x, int y ); void mtrap_set( map *m, int x, int y, trap_id type ); -void madd_field( map *m, int x, int y, field_id type, int density ); +void madd_field( map *m, int x, int y, field_id type, int intensity ); void place_stairs( map *m, oter_id terrain_type, mapgendata dat ); @@ -217,7 +217,7 @@ mapgen_update_func add_mapgen_update_func( JsonObject &jo, bool &defer ); bool run_mapgen_update_func( const std::string &update_mapgen_id, const tripoint &omt_pos, mission *miss = nullptr, bool cancel_on_collision = true ); bool run_mapgen_func( const std::string &mapgen_id, map *m, oter_id terrain_type, mapgendata dat, - const time_point &turn, float density ); + const time_point &turn, float intensity ); std::pair, std::map> get_changed_ids_from_update( const std::string &update_mapgen_id ); #endif diff --git a/src/material.cpp b/src/material.cpp index 23384a3f47dc1..e7d48f22e9526 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -94,7 +94,7 @@ void material_type::load( JsonObject &jsobj, const std::string & ) } JsonArray burn_data_array = jsobj.get_array( "burn_data" ); - for( size_t intensity = 0; intensity < MAX_FIELD_DENSITY; intensity++ ) { + for( size_t intensity = 0; intensity < MAX_FIELD_INTENSITY; intensity++ ) { if( burn_data_array.has_more() ) { JsonObject brn = burn_data_array.next_object(); _burn_data[ intensity ] = load_mat_burn_data( brn ); @@ -287,7 +287,7 @@ bool material_type::reinforces() const const mat_burn_data &material_type::burn_data( size_t intensity ) const { - return _burn_data[ std::min( intensity, MAX_FIELD_DENSITY ) - 1 ]; + return _burn_data[ std::min( intensity, MAX_FIELD_INTENSITY ) - 1 ]; } const mat_burn_products &material_type::burn_products() const diff --git a/src/material.h b/src/material.h index 4cd682da5ece5..c4ed8ad6ce66b 100644 --- a/src/material.h +++ b/src/material.h @@ -59,7 +59,7 @@ class material_type std::map _vitamins; - std::array _burn_data; + std::array _burn_data; //Burn products defined in JSON as "burn_products": [ [ "X", float efficiency ], [ "Y", float efficiency ] ] mat_burn_products _burn_products; diff --git a/src/monattack.cpp b/src/monattack.cpp index 7469b78ab93f3..48c2978610017 100644 --- a/src/monattack.cpp +++ b/src/monattack.cpp @@ -853,7 +853,7 @@ bool mattack::resurrect( monster *z ) bool found_eligible_corpse = false; int lowest_raise_score = INT_MAX; for( const tripoint &p : g->m.points_in_radius( z->pos(), range ) ) { - if( !g->is_empty( p ) || g->m.get_field_strength( p, fd_fire ) > 1 || + if( !g->is_empty( p ) || g->m.get_field_intensity( p, fd_fire ) > 1 || !g->m.sees( z->pos(), p, -1 ) ) { continue; } @@ -1099,7 +1099,7 @@ bool mattack::science( monster *const z ) // I said SCIENCE again! constexpr int att_rad_dose_max = 50; // max radiation // acid attack behavior - constexpr int att_acid_density = 3; + constexpr int att_acid_intensity = 3; // flavor messages static const std::array m_flavor = {{ @@ -1245,7 +1245,7 @@ bool mattack::science( monster *const z ) // I said SCIENCE again! // fill empty tiles with acid for( size_t i = 0; i < empty_neighbor_count; ++i ) { const tripoint &p = empty_neighbors.first[i]; - g->m.add_field( p, fd_acid, att_acid_density ); + g->m.add_field( p, fd_acid, att_acid_intensity ); } break; @@ -1641,7 +1641,7 @@ bool mattack::fungus_big_blossom( monster *z ) const auto u_see = g->u.sees( *z ); // Fungal fire-suppressor! >:D for( const tripoint &dest : g->m.points_in_radius( z->pos(), 6 ) ) { - if( g->m.get_field_strength( dest, fd_fire ) != 0 ) { + if( g->m.get_field_intensity( dest, fd_fire ) != 0 ) { firealarm = true; } if( firealarm ) { diff --git a/src/mondeath.cpp b/src/mondeath.cpp index 01d5d827f0ed8..ab235fa840c53 100644 --- a/src/mondeath.cpp +++ b/src/mondeath.cpp @@ -357,7 +357,7 @@ void mdeath::triffid_heart( monster &z ) void mdeath::fungus( monster &z ) { // If the fungus died from anti-fungal poison, don't pouf - if( g->m.get_field_strength( z.pos(), fd_fungicidal_gas ) ) { + if( g->m.get_field_intensity( z.pos(), fd_fungicidal_gas ) ) { return; } diff --git a/src/monster.cpp b/src/monster.cpp index bc847592d9938..7ffe28e80c08e 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1047,7 +1047,7 @@ void monster::process_triggers() process_trigger( mon_trigger::FIRE, [this]() { int ret = 0; for( const auto &p : g->m.points_in_radius( pos(), 3 ) ) { - ret += 5 * g->m.get_field_strength( p, fd_fire ); + ret += 5 * g->m.get_field_intensity( p, fd_fire ); } return ret; } ); diff --git a/src/player.cpp b/src/player.cpp index 4c841e4d4f564..1e74ed11b77c6 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -5862,7 +5862,8 @@ void player::suffer() } //Web Weavers...weave web if( has_active_mutation( trait_WEB_WEAVER ) && !in_vehicle ) { - g->m.add_field( pos(), fd_web, 1 ); //this adds density to if its not already there. + // this adds intensity to if its not already there. + g->m.add_field( pos(), fd_web, 1 ); } @@ -5886,7 +5887,8 @@ void player::suffer() } if( has_trait( trait_WEB_SPINNER ) && !in_vehicle && one_in( 3 ) ) { - g->m.add_field( pos(), fd_web, 1 ); //this adds density to if its not already there. + // this adds intensity to if its not already there. + g->m.add_field( pos(), fd_web, 1 ); } if( has_trait( trait_UNSTABLE ) && !has_trait( trait_CHAOTIC_BAD ) && one_turn_in( 48_hours ) ) { @@ -9572,7 +9574,7 @@ void player::try_to_sleep( const time_duration &dur ) webforce = true; } if( websleep || webforce ) { - int web = g->m.get_field_strength( pos(), fd_web ); + int web = g->m.get_field_intensity( pos(), fd_web ); if( !webforce ) { // At this point, it's kinda weird, but surprisingly comfy... if( web >= 3 ) { @@ -9659,7 +9661,7 @@ comfort_level player::base_comfort_value( const tripoint &p ) const const ter_id ter_at_pos = tile.get_ter(); const furn_id furn_at_pos = tile.get_furn(); - int web = g->m.get_field_strength( p, fd_web ); + int web = g->m.get_field_intensity( p, fd_web ); // Some mutants have different comfort needs if( !plantsleep && !webforce ) { diff --git a/src/projectile.cpp b/src/projectile.cpp index a7b08eed0222b..c842d498e5912 100644 --- a/src/projectile.cpp +++ b/src/projectile.cpp @@ -160,12 +160,12 @@ void apply_ammo_effects( const tripoint &p, const std::set &effects } if( effects.count( "SMOKE" ) > 0 ) { for( auto &pt : g->m.points_in_radius( p, 1, 0 ) ) { - g->m.add_field( pt, fd_smoke, MAX_FIELD_DENSITY ); + g->m.add_field( pt, fd_smoke, MAX_FIELD_INTENSITY ); } } if( effects.count( "SMOKE_BIG" ) > 0 ) { for( auto &pt : g->m.points_in_radius( p, 6, 0 ) ) { - g->m.add_field( pt, fd_smoke, MAX_FIELD_DENSITY ); + g->m.add_field( pt, fd_smoke, MAX_FIELD_INTENSITY ); } } diff --git a/src/savegame_json.cpp b/src/savegame_json.cpp index 5d57203d016dd..c8687ea3ab030 100644 --- a/src/savegame_json.cpp +++ b/src/savegame_json.cpp @@ -3525,12 +3525,12 @@ void submap::load( JsonIn &jsin, const std::string &member_name, bool rubpow_upd jsin.start_array(); while( !jsin.end_array() ) { int type = jsin.get_int(); - int density = jsin.get_int(); + int intensity = jsin.get_int(); int age = jsin.get_int(); if( fld[i][j].find_field( field_id( type ) ) == nullptr ) { field_count++; } - fld[i][j].add_field( field_id( type ), density, time_duration::from_turns( age ) ); + fld[i][j].add_field( field_id( type ), intensity, time_duration::from_turns( age ) ); } } } else if( member_name == "graffiti" ) { diff --git a/src/submap.h b/src/submap.h index effaffdcd0c7a..3b999410956be 100644 --- a/src/submap.h +++ b/src/submap.h @@ -255,8 +255,9 @@ struct maptile { return sm->fld[x][y].find_field( field_to_find ); } - bool add_field( const field_id field_to_add, const int new_density, const time_duration &new_age ) { - const bool ret = sm->fld[x][y].add_field( field_to_add, new_density, new_age ); + bool add_field( const field_id field_to_add, const int new_intensity, + const time_duration &new_age ) { + const bool ret = sm->fld[x][y].add_field( field_to_add, new_intensity, new_age ); if( ret ) { sm->field_count++; } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 424644da275d7..75803e94fbb12 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -3244,20 +3244,20 @@ bool vehicle::do_environmental_effects() return needed; } -void vehicle::spew_smoke( double joules, int part, int density ) +void vehicle::spew_smoke( double joules, int part, int intensity ) { if( rng( 1, 10000 ) > joules ) { return; } point p = parts[part].mount; - density = std::max( joules / 10000, static_cast( density ) ); + intensity = std::max( joules / 10000, static_cast( intensity ) ); // Move back from engine/muffler until we find an open space while( relative_parts.find( p ) != relative_parts.end() ) { p.x += ( velocity < 0 ? 1 : -1 ); } point q = coord_translate( p ); const tripoint dest = global_pos3() + tripoint( q.x, q.y, 0 ); - g->m.adjust_field_strength( dest, fd_smoke, density ); + g->m.adjust_field_intensity( dest, fd_smoke, intensity ); } /** @@ -3319,7 +3319,7 @@ void vehicle::noise_and_smoke( int load, time_duration time ) } if( ( exhaust_part == -1 ) && engine_on ) { - spew_smoke( j, p, bad_filter ? MAX_FIELD_DENSITY : 1 ); + spew_smoke( j, p, bad_filter ? MAX_FIELD_INTENSITY : 1 ); } else { mufflesmoke += j; } @@ -3331,7 +3331,7 @@ void vehicle::noise_and_smoke( int load, time_duration time ) } if( ( exhaust_part != -1 ) && engine_on && has_engine_type_not( fuel_type_muscle, true ) ) { // No engine, no smoke - spew_smoke( mufflesmoke, exhaust_part, bad_filter ? MAX_FIELD_DENSITY : 1 ); + spew_smoke( mufflesmoke, exhaust_part, bad_filter ? MAX_FIELD_INTENSITY : 1 ); } // Cap engine noise to avoid deafening. noise = std::min( noise, 100.0 ); @@ -5514,8 +5514,8 @@ void vehicle::update_time( const time_point &update_to ) if( pt.is_unavailable() || ( !pt.enabled ) ) { continue; } - int density = abs( pt.info().epower ) * 2; - g->m.adjust_field_strength( global_part_pos3( pt ), fd_hot_air3, density ); + int intensity = abs( pt.info().epower ) * 2; + g->m.adjust_field_intensity( global_part_pos3( pt ), fd_hot_air3, intensity ); discharge_battery( pt.info().epower ); } // coolers emitting cold air @@ -5524,8 +5524,8 @@ void vehicle::update_time( const time_point &update_to ) if( pt.is_unavailable() || ( !pt.enabled ) ) { continue; } - int density = abs( pt.info().epower ) * 5; - g->m.adjust_field_strength( global_part_pos3( pt ), fd_cold_air3, density ); + int intensity = abs( pt.info().epower ) * 5; + g->m.adjust_field_intensity( global_part_pos3( pt ), fd_cold_air3, intensity ); discharge_battery( pt.info().epower ); } // Get one weather data set per vehicle, they don't differ much across vehicle area diff --git a/src/vehicle.h b/src/vehicle.h index 6326b84d6dacd..60de5643ffab0 100644 --- a/src/vehicle.h +++ b/src/vehicle.h @@ -1109,7 +1109,7 @@ class vehicle int safe_velocity( bool fueled = true ) const; // Generate smoke from a part, either at front or back of vehicle depending on velocity. - void spew_smoke( double joules, int part, int density = 1 ); + void spew_smoke( double joules, int part, int intensity = 1 ); // Loop through engines and generate noise and smoke for each one void noise_and_smoke( int load, time_duration time = 1_turns ); diff --git a/tests/npc_test.cpp b/tests/npc_test.cpp index 175acb24f617c..02265af1d050f 100644 --- a/tests/npc_test.cpp +++ b/tests/npc_test.cpp @@ -337,7 +337,7 @@ TEST_CASE( "npc-movement" ) if( type == 'A' || type == 'R' || type == 'W' || type == 'M' || type == 'B' || type == 'C' ) { - g->m.add_field( p, fd_acid, MAX_FIELD_DENSITY ); + g->m.add_field( p, fd_acid, MAX_FIELD_INTENSITY ); } // spawn rubbles if( type == 'R' ) {