Skip to content

Commit

Permalink
add drops to turrets/nonmilitary robots (#32544)
Browse files Browse the repository at this point in the history
  • Loading branch information
misterprimus authored and ZhilkinSerg committed Aug 3, 2019
1 parent 502e75a commit 141974c
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 19 deletions.
61 changes: 61 additions & 0 deletions data/json/items/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -2975,6 +2975,67 @@
"weight": 11339,
"volume": 12
},
{
"type": "GENERIC",
"id": "broken_turret",
"symbol": ",",
"color": "green",
"name": "broken turret",
"category": "other",
"description": "A broken turret. Much less threatening now that it's laid limp on solid ground. Could be gutted for parts.",
"price": 1000,
"material": [ "steel", "plastic" ],
"weight": 62650,
"volume": "30 L",
"bashing": 4,
"cutting": 4,
"to_hit": -3,
"flags": [ "TRADER_AVOID", "NO_REPAIR" ]
},
{
"type": "GENERIC",
"id": "broken_turret_rifle",
"symbol": ",",
"color": "green",
"name": "broken milspec turret",
"weight": 70000,
"copy-from": "broken_turret"
},
{
"type": "GENERIC",
"id": "broken_turret_bmg",
"symbol": ",",
"color": "green",
"name": "broken antimateriel turret",
"weight": 100000,
"copy-from": "broken_turret"
},
{
"type": "GENERIC",
"id": "broken_laserturret",
"symbol": ",",
"color": "green",
"name": "broken laser turret",
"weight": 110000,
"copy-from": "broken_turret"
},
{
"type": "GENERIC",
"id": "broken_secubot",
"symbol": ",",
"color": "green",
"name": "broken secubot",
"category": "other",
"description": "A broken secubot, with its casing broken and fluid drained. Could be gutted for parts.",
"price": 1000,
"material": [ "steel", "plastic" ],
"weight": 100000,
"volume": "65000 ml",
"bashing": 4,
"cutting": 4,
"to_hit": -3,
"flags": [ "TRADER_AVOID", "NO_REPAIR" ]
},
{
"type": "GENERIC",
"id": "fire_brick",
Expand Down
28 changes: 19 additions & 9 deletions data/json/monsters/defense_bot.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"revert_to_itype": "bot_secubot",
"starting_ammo": { "9mm": 100 },
"special_attacks": [ { "type": "gun", "cooldown": 2, "gun_type": "hk_mp5", "ranges": [ [ 0, 6, "AUTO" ], [ 7, 12, "DEFAULT" ] ] } ],
"death_drops": { "groups": [ [ "robots", 4 ], [ "secubot", 1 ] ] },
"death_function": [ "EXPLODE" ],
"flags": [ "SEES", "HEARS", "BASHES", "ELECTRONIC", "NO_BREATHE", "PATH_AVOID_DANGER_1", "LOUDMOVES" ]
"death_drops": { },
"death_function": [ "BROKEN" ],
"flags": [ "SEES", "HEARS", "BASHES", "ELECTRONIC", "NO_BREATHE", "PATH_AVOID_DANGER_1", "LOUDMOVES", "DROPS_AMMO" ]
},
{
"id": "mon_turret",
Expand Down Expand Up @@ -52,9 +52,9 @@
{ "type": "gun", "cooldown": 1, "gun_type": "hk_mp5", "ranges": [ [ 0, 6, "AUTO" ], [ 7, 12, "DEFAULT" ] ] },
[ "PARROT", 40 ]
],
"death_drops": { "groups": [ [ "robots", 10 ], [ "turret", 1 ] ] },
"death_function": [ "EXPLODE" ],
"flags": [ "SEES", "NOHEAD", "ELECTRONIC", "IMMOBILE", "NO_BREATHE" ]
"death_drops": { },
"death_function": [ "BROKEN" ],
"flags": [ "SEES", "NOHEAD", "ELECTRONIC", "IMMOBILE", "NO_BREATHE", "DROPS_AMMO" ]
},
{
"id": "mon_skitterbot",
Expand Down Expand Up @@ -116,7 +116,17 @@
"special_attacks": [ [ "SCIENCE", 16 ], [ "TAZER", 10 ] ],
"death_drops": { "groups": [ [ "robots", 4 ], [ "skitterbot", 1 ] ] },
"death_function": [ "BROKEN" ],
"flags": [ "SEES", "HEARS", "BASHES", "GOODHEARING", "ELECTRONIC", "NO_BREATHE", "PRIORITIZE_TARGETS", "PATH_AVOID_DANGER_2" ]
"flags": [
"SEES",
"HEARS",
"BASHES",
"GOODHEARING",
"ELECTRONIC",
"NO_BREATHE",
"PRIORITIZE_TARGETS",
"PATH_AVOID_DANGER_2",
"DROPS_AMMO"
]
},
{
"id": "mon_robofac_prototype",
Expand Down Expand Up @@ -189,7 +199,7 @@
"special_attacks": [ [ "GRENADIER", 10 ] ],
"death_drops": { "groups": [ [ "robots", 1 ] ] },
"death_function": [ "BROKEN" ],
"flags": [ "SEES", "HEARS", "ELECTRONIC", "NO_BREATHE", "PRIORITIZE_TARGETS", "PATH_AVOID_DANGER_2", "LOUDMOVES" ]
"flags": [ "SEES", "HEARS", "ELECTRONIC", "NO_BREATHE", "PRIORITIZE_TARGETS", "PATH_AVOID_DANGER_2", "LOUDMOVES", "DROPS_AMMO" ]
},
{
"id": "mon_dispatch_military",
Expand Down Expand Up @@ -222,6 +232,6 @@
"special_attacks": [ [ "GRENADIER_ELITE", 10 ] ],
"death_drops": { "groups": [ [ "robots", 1 ] ] },
"death_function": [ "BROKEN" ],
"flags": [ "SEES", "HEARS", "ELECTRONIC", "NO_BREATHE", "PRIORITIZE_TARGETS", "PATH_AVOID_DANGER_2", "LOUDMOVES" ]
"flags": [ "SEES", "HEARS", "ELECTRONIC", "NO_BREATHE", "PRIORITIZE_TARGETS", "PATH_AVOID_DANGER_2", "LOUDMOVES", "DROPS_AMMO" ]
}
]
16 changes: 8 additions & 8 deletions data/json/monsters/military.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"require_sunlight": true
}
],
"death_drops": { "groups": [ [ "robots", 10 ], [ "laserturret", 1 ] ] },
"death_function": [ "EXPLODE" ],
"death_drops": { },
"death_function": [ "BROKEN" ],
"flags": [ "SEES", "NOHEAD", "ELECTRONIC", "IMMOBILE", "NO_BREATHE" ]
},
{
Expand Down Expand Up @@ -77,9 +77,9 @@
"no_ammo_sound": "a chk!"
}
],
"death_drops": { "groups": [ [ "robots", 9 ], [ "turret_bmg", 2 ] ] },
"death_function": [ "EXPLODE" ],
"flags": [ "SEES", "NOHEAD", "ELECTRONIC", "IMMOBILE", "NO_BREATHE" ]
"death_drops": { },
"death_function": [ "BROKEN" ],
"flags": [ "SEES", "NOHEAD", "ELECTRONIC", "IMMOBILE", "NO_BREATHE", "DROPS_AMMO" ]
},
{
"id": "mon_turret_rifle",
Expand Down Expand Up @@ -115,8 +115,8 @@
"ranges": [ [ 0, 8, "AUTO" ], [ 9, 16, "DEFAULT" ] ]
}
],
"death_drops": { "groups": [ [ "robots", 9 ], [ "turret_rifle", 2 ] ] },
"death_function": [ "EXPLODE" ],
"flags": [ "SEES", "NOHEAD", "ELECTRONIC", "IMMOBILE", "NO_BREATHE" ]
"death_drops": { },
"death_function": [ "BROKEN" ],
"flags": [ "SEES", "NOHEAD", "ELECTRONIC", "IMMOBILE", "NO_BREATHE", "DROPS_AMMO" ]
}
]
104 changes: 104 additions & 0 deletions data/json/recipes/recipe_deconstruction.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,29 @@
[ [ "canister_empty", 1 ] ]
]
},
{
"result": "broken_secubot",
"type": "uncraft",
"skill_used": "electronics",
"difficulty": 6,
"time": "120 m",
"using": [ [ "soldering_standard", 20 ], [ "welding_standard", 5 ] ],
"qualities": [ { "id": "SCREW", "level": 1 }, { "id": "SAW_M", "level": 1 } ],
"components": [
[ [ "ai_module", 1 ] ],
[ [ "sensor_module", 1 ] ],
[ [ "memory_module", 1 ] ],
[ [ "pathfinding_module", 1 ] ],
[ [ "identification_module", 1 ] ],
[ [ "omni_wheel", 1 ] ],
[ [ "copbot_chassis", 1 ] ],
[ [ "android_arms", 1 ] ],
[ [ "power_supply", 4 ] ],
[ [ "solar_cell", 2 ] ],
[ [ "hk_mp5", 1 ] ],
[ [ "canister_empty", 1 ] ]
]
},
{
"result": "broken_skitterbot",
"type": "uncraft",
Expand All @@ -421,6 +444,87 @@
[ [ "scrap", 4 ] ]
]
},
{
"result": "broken_turret",
"type": "uncraft",
"skill_used": "electronics",
"difficulty": 3,
"time": "60 m",
"using": [ [ "soldering_standard", 10 ] ],
"qualities": [ { "id": "SCREW", "level": 1 } ],
"components": [
[ [ "ai_module", 1 ] ],
[ [ "RAM", 1 ] ],
[ [ "gun_module", 2 ] ],
[ [ "hk_mp5", 2 ] ],
[ [ "small_storage_battery", 1 ] ],
[ [ "sensor_module", 1 ] ],
[ [ "identification_module", 1 ] ],
[ [ "power_supply", 1 ] ],
[ [ "turret_chassis", 1 ] ]
]
},
{
"result": "broken_turret_rifle",
"type": "uncraft",
"skill_used": "electronics",
"difficulty": 3,
"time": "60 m",
"using": [ [ "soldering_standard", 10 ] ],
"qualities": [ { "id": "SCREW", "level": 1 } ],
"components": [
[ [ "ai_module", 1 ] ],
[ [ "RAM", 1 ] ],
[ [ "gun_module", 1 ] ],
[ [ "m4a1", 1 ] ],
[ [ "small_storage_battery", 1 ] ],
[ [ "sensor_module", 1 ] ],
[ [ "identification_module", 1 ] ],
[ [ "power_supply", 1 ] ],
[ [ "turret_chassis", 1 ] ]
]
},
{
"result": "broken_turret_bmg",
"type": "uncraft",
"skill_used": "electronics",
"difficulty": 3,
"time": "60 m",
"using": [ [ "soldering_standard", 10 ] ],
"qualities": [ { "id": "SCREW", "level": 1 } ],
"components": [
[ [ "ai_module", 1 ] ],
[ [ "RAM", 1 ] ],
[ [ "gun_module", 1 ] ],
[ [ "m107a1", 1 ] ],
[ [ "small_storage_battery", 1 ] ],
[ [ "sensor_module", 1 ] ],
[ [ "identification_module", 1 ] ],
[ [ "power_supply", 1 ] ],
[ [ "turret_chassis", 1 ] ]
]
},
{
"result": "broken_laserturret",
"type": "uncraft",
"skill_used": "electronics",
"difficulty": 3,
"time": "60 m",
"using": [ [ "soldering_standard", 10 ] ],
"qualities": [ { "id": "SCREW", "level": 1 } ],
"components": [
[ [ "ai_module", 1 ] ],
[ [ "RAM", 1 ] ],
[ [ "gun_module", 1 ] ],
[ [ "laser_cannon", 1 ] ],
[ [ "medium_storage_battery", 1 ] ],
[ [ "sensor_module", 1 ] ],
[ [ "identification_module", 1 ] ],
[ [ "solar_cell", 4 ] ],
[ [ "power_supply", 1 ] ],
[ [ "turret_chassis", 1 ] ]
]
},
{
"result": "broken_science_bot",
"type": "uncraft",
Expand Down
12 changes: 11 additions & 1 deletion src/mondeath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,6 @@ void mdeath::broken( monster &z )
}
// make "broken_manhack", or "broken_eyebot", ...
item_id.insert( 0, "broken_" );

item broken_mon( item_id, calendar::turn );
const int max_hp = std::max( z.get_hp_max(), 1 );
const float overflow_damage = std::max( -z.get_hp(), 0 );
Expand All @@ -652,6 +651,17 @@ void mdeath::broken( monster &z )

g->m.add_item_or_charges( z.pos(), broken_mon );


// adds ammo drop
if( z.type->has_flag( MF_DROPS_AMMO ) ) {
for( const std::pair<std::string, int> &ammo_entry : z.type->starting_ammo ) {
if( z.ammo[ammo_entry.first] > 0 ) {
g->m.spawn_item( z.pos(), ammo_entry.first, z.ammo[ammo_entry.first], 1,
calendar::turn );
}
}
}
// end adds ammo drop
//TODO: make mdeath::splatter work for robots
if( ( broken_mon.damage() >= broken_mon.max_damage() ) && g->u.sees( z.pos() ) ) {
add_msg( m_good, _( "The %s is destroyed!" ), z.name() );
Expand Down
3 changes: 2 additions & 1 deletion src/monstergenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ const std::map<std::string, m_flag> flag_map = {
{ "DRIPS_GASOLINE", MF_DRIPS_GASOLINE },
{ "ELECTRIC_FIELD", MF_ELECTRIC_FIELD },
{ "STUN_IMMUNE", MF_STUN_IMMUNE },
{ "LOUDMOVES", MF_LOUDMOVES }
{ "LOUDMOVES", MF_LOUDMOVES },
{ "DROPS_AMMO", MF_DROPS_AMMO }
};

} // namespace
Expand Down
1 change: 1 addition & 0 deletions src/mtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ enum m_flag : int {
MF_LOUDMOVES, // This monster makes move noises as if ~2 sizes louder, even if flying.
MF_CAN_OPEN_DOORS, // This monster can open doors.
MF_STUN_IMMUNE, // This monster is immune to the stun effect
MF_DROPS_AMMO, // This monster drops ammo. Check to make sure starting_ammo paramter is present for this monster type!
MF_MAX // Sets the length of the flags - obviously must be LAST
};

Expand Down

0 comments on commit 141974c

Please sign in to comment.