Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add drops to turrets/nonmilitary robots #32544

Merged
merged 64 commits into from
Aug 3, 2019
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
7f0a765
Update military.json
misterprimus Jul 22, 2019
d4177f1
Update defense_bot.json
misterprimus Jul 22, 2019
3a6056b
Update generic.json
misterprimus Jul 22, 2019
1cfc92d
Update recipe_deconstruction.json
misterprimus Jul 22, 2019
d0f2f4c
Update monstergenerator.cpp
misterprimus Jul 22, 2019
7a8eaf8
Update mtype.h
misterprimus Jul 22, 2019
41f440c
Update mondeath.cpp
misterprimus Jul 22, 2019
e9e1e0a
Update data/json/items/generic.json
misterprimus Jul 22, 2019
7eda425
Update data/json/items/generic.json
misterprimus Jul 22, 2019
a534c77
Update data/json/items/generic.json
misterprimus Jul 22, 2019
064e51f
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
5241ab4
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
9948d17
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
0d489e5
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
15a9982
Update src/mondeath.cpp
misterprimus Jul 22, 2019
d399b1b
Update src/monstergenerator.cpp
misterprimus Jul 22, 2019
80c4ed5
Update src/mondeath.cpp
misterprimus Jul 22, 2019
d94706d
Update data/json/items/generic.json
misterprimus Jul 22, 2019
40b643c
Update data/json/items/generic.json
misterprimus Jul 22, 2019
0667e0f
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
a5e2f3a
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
4607c7c
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
7eb7655
Update src/mtype.h
misterprimus Jul 22, 2019
b35930f
Update src/mondeath.cpp
misterprimus Jul 22, 2019
db94001
Update data/json/items/generic.json
misterprimus Jul 22, 2019
76d4ff1
Update data/json/items/generic.json
misterprimus Jul 22, 2019
4d8d6e8
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
f39a0cf
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
0548b3c
Update src/mondeath.cpp
misterprimus Jul 22, 2019
831dde5
Update src/mondeath.cpp
misterprimus Jul 22, 2019
197b8f2
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
35ee6b8
Update src/mondeath.cpp
misterprimus Jul 22, 2019
8fe4969
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
0e36911
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
ca8062f
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
20f6922
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
373d376
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
ec4074f
Update src/monstergenerator.cpp
misterprimus Jul 22, 2019
6154128
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
440d8ca
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
08c98d5
Update src/mtype.h
misterprimus Jul 22, 2019
40849ec
Update src/mtype.h
misterprimus Jul 22, 2019
52b1e36
Update src/monstergenerator.cpp
misterprimus Jul 22, 2019
0b843eb
Update data/json/recipes/recipe_deconstruction.json
misterprimus Jul 22, 2019
181c1d8
Update mondeath.cpp
misterprimus Jul 23, 2019
683bb9f
Update recipe_deconstruction.json
misterprimus Jul 23, 2019
7a32800
Merge branch 'master' into master
misterprimus Jul 23, 2019
d1fd87f
Update recipe_deconstruction.json
misterprimus Jul 23, 2019
6911bba
Update recipe_deconstruction.json
misterprimus Jul 23, 2019
12feb8d
Update military.json
misterprimus Jul 23, 2019
209229d
Update defense_bot.json
misterprimus Jul 23, 2019
a13a5d5
Update mondeath.cpp
misterprimus Jul 23, 2019
81c442d
Update mondeath.cpp
misterprimus Jul 23, 2019
b5b1a58
Update mondeath.cpp
misterprimus Jul 23, 2019
1acc735
Update mondeath.cpp
misterprimus Jul 23, 2019
ab80519
Update data/json/items/generic.json
misterprimus Jul 28, 2019
264f731
Update data/json/items/generic.json
misterprimus Jul 28, 2019
f2a46e9
Update data/json/items/generic.json
misterprimus Jul 28, 2019
c8559a9
Update data/json/items/generic.json
misterprimus Jul 28, 2019
1d6b736
Merge branch 'master' into master
misterprimus Jul 28, 2019
702651c
Update generic.json
misterprimus Jul 28, 2019
c40b5cc
Update generic.json
misterprimus Jul 28, 2019
6b99810
Update src/mondeath.cpp
misterprimus Jul 29, 2019
1408a8b
Update mondeath.cpp
misterprimus Jul 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions data/json/items/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -2910,5 +2910,90 @@
"material": [ "steel", "plastic", "wood" ],
"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": 120,
misterprimus marked this conversation as resolved.
Show resolved Hide resolved
"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",
"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": 120,
misterprimus marked this conversation as resolved.
Show resolved Hide resolved
"bashing": 4,
"cutting": 4,
"to_hit": -3,
"flags": [ "TRADER_AVOID", "NO_REPAIR" ]
},
{
"type": "GENERIC",
"id": "broken_turret_bmg",
"symbol": ",",
"color": "green",
"name": "broken antimateriel 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": 120,
misterprimus marked this conversation as resolved.
Show resolved Hide resolved
"bashing": 4,
"cutting": 4,
"to_hit": -3,
"flags": [ "TRADER_AVOID", "NO_REPAIR" ]
},
{
"type": "GENERIC",
"id": "broken_laserturret",
"symbol": ",",
"color": "green",
"name": "broken laser 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": 120,
misterprimus marked this conversation as resolved.
Show resolved Hide resolved
"bashing": 4,
"cutting": 4,
"to_hit": -3,
"flags": [ "TRADER_AVOID", "NO_REPAIR" ]
},
{
"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" ]
}
]
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
13 changes: 12 additions & 1 deletion src/mondeath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,6 @@ void mdeath::broken( monster &z )
}
// make "broken_manhack", or "broken_eyebot", ...
item_id.insert( 0, "broken_" );

misterprimus marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -657,6 +656,18 @@ void mdeath::broken( monster &z )

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


// adds ammo drop
const bool drops_ammo = z.type->has_flag( MF_DROPS_AMMO );
misterprimus marked this conversation as resolved.
Show resolved Hide resolved
if( 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 @@ -148,7 +148,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 @@ -165,6 +165,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