From cd402b46ac1492380849f164acabf6766da11202 Mon Sep 17 00:00:00 2001 From: Chaosvolt Date: Mon, 15 May 2023 19:30:35 -0500 Subject: [PATCH] Separate starting battery from mechs --- .../json/itemgroups/Weapons_Mods_Ammo/ammo.json | 5 +++++ data/json/mapgen/bunker.json | 17 ++++++++++++----- .../mapgen/lab/lab_floorplans_finale1level.json | 1 + data/mods/DinoMod/mapgen/DinoLabFinale.json | 1 + data/mods/No_Hope/Mapgen/bunker.json | 6 +----- src/monster.cpp | 7 ------- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/data/json/itemgroups/Weapons_Mods_Ammo/ammo.json b/data/json/itemgroups/Weapons_Mods_Ammo/ammo.json index 8c31ad9d3a19..f3c06cee8ffb 100644 --- a/data/json/itemgroups/Weapons_Mods_Ammo/ammo.json +++ b/data/json/itemgroups/Weapons_Mods_Ammo/ammo.json @@ -717,5 +717,10 @@ { "item": "medium_atomic_battery_cell", "prob": 2, "charges": 5000 }, { "item": "heavy_atomic_battery_cell", "prob": 1, "charges": 10000 } ] + }, + { + "id": "mech_power_cell_spawn", + "type": "item_group", + "items": [ { "item": "huge_atomic_battery_cell", "prob": 10, "charges": [ 0, 100000 ] } ] } ] diff --git a/data/json/mapgen/bunker.json b/data/json/mapgen/bunker.json index 6cfdb97c06bd..6410c2d441d2 100644 --- a/data/json/mapgen/bunker.json +++ b/data/json/mapgen/bunker.json @@ -102,11 +102,18 @@ }, "furniture": { "r": "f_rack" }, "items": { "r": { "item": "bunker_basement_loot", "chance": 15, "repeat": [ 2, 8 ] } }, - "place_monster": [ - { "monster": "mon_mech_combat", "x": 5, "y": 5, "chance": 2 }, - { "monster": "mon_mech_lifter", "x": 6, "y": 6, "chance": 5 }, - { "monster": "mon_mech_recon", "x": 7, "y": 6, "chance": 3 } - ] + "place_nested": [ { "chunks": [ [ "null", 9 ], "bunker_mech_spawn" ], "x": 5, "y": 5 } ] + } + }, + { + "type": "mapgen", + "method": "json", + "nested_mapgen_id": "bunker_mech_spawn", + "weight": 25, + "object": { + "mapgensize": [ 3, 3 ], + "place_loot": [ { "group": "mech_power_cell_spawn", "x": [ 0, 2 ], "y": 2 } ], + "place_monster": [ { "monster": [ "mon_mech_combat", "mon_mech_lifter", "mon_mech_recon" ], "x": [ 0, 1 ], "y": [ 0, 1 ] } ] } }, { diff --git a/data/json/mapgen/lab/lab_floorplans_finale1level.json b/data/json/mapgen/lab/lab_floorplans_finale1level.json index 7f1e008ed58a..97458e3db078 100644 --- a/data/json/mapgen/lab/lab_floorplans_finale1level.json +++ b/data/json/mapgen/lab/lab_floorplans_finale1level.json @@ -38,6 +38,7 @@ "terrain": { "?": "t_nanofab", "r": "t_metal_floor", "/": "t_nanofab_body" }, "mapping": { "r": { "item": { "item": "standard_template_construct" } }, "R": { "item": { "item": "nanomaterial" } } }, "place_nested": [ { "chunks": [ "lab_finale_loot" ], "x": 6, "y": 11 } ], + "place_loot": [ { "group": "mech_power_cell_spawn", "x": [ 4, 5 ], "y": [ 3, 5 ] } ], "place_monster": [ { "monster": "mon_secubot", "x": [ 1, 4 ], "y": [ 20, 22 ], "chance": 90 }, { "monster": "mon_secubot", "x": [ 19, 20 ], "y": [ 20, 22 ], "chance": 90 }, diff --git a/data/mods/DinoMod/mapgen/DinoLabFinale.json b/data/mods/DinoMod/mapgen/DinoLabFinale.json index 369fe09d61fd..831456d0e5a0 100644 --- a/data/mods/DinoMod/mapgen/DinoLabFinale.json +++ b/data/mods/DinoMod/mapgen/DinoLabFinale.json @@ -144,6 +144,7 @@ ] } }, + "place_loot": [ { "group": "mech_power_cell_spawn", "x": 1, "y": [ 1, 4 ] } ], "place_monster": [ { "monster": "mon_deinonychus", "x": [ 7, 8 ], "y": [ 17, 18 ], "chance": 90, "repeat": [ 1, 5 ] }, { "monster": "mon_deinonychus", "x": [ 16, 17 ], "y": [ 17, 18 ], "chance": 90, "repeat": [ 1, 5 ] }, diff --git a/data/mods/No_Hope/Mapgen/bunker.json b/data/mods/No_Hope/Mapgen/bunker.json index e873f443f0a5..50709edeaf62 100644 --- a/data/mods/No_Hope/Mapgen/bunker.json +++ b/data/mods/No_Hope/Mapgen/bunker.json @@ -102,11 +102,7 @@ }, "furniture": { "r": "f_rack" }, "items": { "r": { "item": "bunker_basement_loot", "chance": 15, "repeat": [ 2, 8 ] } }, - "place_monster": [ - { "monster": "mon_mech_combat", "x": 5, "y": 5, "chance": 2 }, - { "monster": "mon_mech_lifter", "x": 6, "y": 6, "chance": 5 }, - { "monster": "mon_mech_recon", "x": 7, "y": 6, "chance": 3 } - ] + "place_nested": [ { "chunks": [ [ "null", 9 ], "bunker_mech_spawn" ], "x": 5, "y": 5 } ] } }, { diff --git a/src/monster.cpp b/src/monster.cpp index 849b5a520d7d..0a779fe1c782 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -214,13 +214,6 @@ monster::monster( const mtype_id &id ) : monster() if( monster::has_flag( MF_AQUATIC ) ) { fish_population = dice( 1, 20 ); } - if( monster::has_flag( MF_RIDEABLE_MECH ) ) { - itype_id mech_bat = itype_id( type->mech_battery ); - int max_charge = mech_bat->magazine->capacity; - item mech_bat_item = item( mech_bat, calendar::start_of_cataclysm ); - mech_bat_item.ammo_consume( rng( 0, max_charge ), tripoint_zero ); - battery_item = cata::make_value( mech_bat_item ); - } } monster::monster( const mtype_id &id, const tripoint &p ) : monster( id )