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

Conversation

misterprimus
Copy link
Contributor

@misterprimus misterprimus commented Jul 22, 2019

Summary

SUMMARY: Features "Make secubots/turrets drop ammo and a salvageable robot carcass."

Purpose of change

Balance/realism

Describe the solution

Mostly changes secubots/turrets from “explode” to “broken.” Doesn’t make sense for turrets/civilian bots to come with self-destruct features like a tank or for rifle/pistol ammo to cook off from a shot. IRL a round would penetrate a power supply or circuit board and the robot would just shut down.
The biggest changes are the addition of a “drops_ammo” tag and the changes of the carcass generation script to check for that tag and then perform a loop to check for and generate the ammo drops alongside the carcass.

Describe alternatives you've considered

I considered putting the ammo into the carcass of the bot, to be disassembled later, but I don’t think there is any infrastructure for this. Any inactive bot only inherits amount of damage, not any specifics like unspent ammo, so it would be possible to recover 9mm rounds from an empty turret, which would have made no sense.

Additional context

You guys must have been messing around with STUN_IMMUNE, so I had to put it back into my code to make it compile, but omitted it from the stuff I am posting to make my changes more clear. Also some stuff with ceramic plates for dragon armor? Anyway, I didn't test every possible combination of enemy, but it seems to be working fine since the code is not really item-specific but pretty general and makes liberal use of tags/existing infrastructure.

Copy link
Member

@anothersimulacrum anothersimulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to lint and astyle your changes.

data/json/items/generic.json Outdated Show resolved Hide resolved
data/json/items/generic.json Outdated Show resolved Hide resolved
data/json/recipes/recipe_deconstruction.json Outdated Show resolved Hide resolved
data/json/recipes/recipe_deconstruction.json Outdated Show resolved Hide resolved
data/json/recipes/recipe_deconstruction.json Outdated Show resolved Hide resolved
src/mondeath.cpp Outdated Show resolved Hide resolved
src/mondeath.cpp Outdated Show resolved Hide resolved
src/mondeath.cpp Outdated Show resolved Hide resolved
src/monstergenerator.cpp Outdated Show resolved Hide resolved
src/mtype.h Outdated Show resolved Hide resolved
src/mondeath.cpp Outdated Show resolved Hide resolved
src/mondeath.cpp Outdated Show resolved Hide resolved
@misterprimus
Copy link
Contributor Author

Decontruction recipe for broken robot should be the same as the ones for inactive robot in recipe_electronic.
For exemple robots using guns should have gun_module and laser turret has laser_canon in it s recipe, so either change the recipe to use the rifle or change the broken robot to give the canon.

Yes, it should be consistent. I copied the components from the file you referenced.

@misterprimus
Copy link
Contributor Author

All references to volume, as I've just recently learned, should be strings in the form/conversion of 1 == 250 ml - so turrets ("volume": 120) should be "volume": "30 L" @anothersimulacrum can correct me if I'm wrong, but if 'xxxx ml' evenly divides by 1000, then use L, otherwise use ml (eg. "2500 ml" as opposed to "2.5 L")

Yeah, will keep in mind for future. Otherwise it would be easier to make the change en masse in a future PR.

@anothersimulacrum
Copy link
Member

anothersimulacrum commented Jul 23, 2019

Please make the change to the items in this PR, because you're introducing new items here.

@anothersimulacrum
Copy link
Member

Jenkins Rebuild

Copy link
Member

@anothersimulacrum anothersimulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The broken turret items are largely duplicates of eachother, you should clean them up with copy-from.

data/json/items/generic.json Outdated Show resolved Hide resolved
data/json/items/generic.json Outdated Show resolved Hide resolved
data/json/items/generic.json Outdated Show resolved Hide resolved
data/json/items/generic.json Outdated Show resolved Hide resolved
Copy link
Member

@anothersimulacrum anothersimulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, and works for me.
Compiled with make -j4 -s CCACHE=1 TILES=1 RELEASE=1 with gcc 9.1.0 on Arch Linux 5.2.2.
To test, I spawned in two turrets. With the debug invincibility mutation, I had one turret empty all its bullets into me, and one not. I then used the debug menu to kill both turrets. The turret that had not shot dropped 100 bullets, and the turret that had shot me dropped no bullets, but had already dropped 100 casings.
Then, I went and killed two security bots in a bank, after they had spent some bullets. They dropped ammo corresponding to how much they had left.
So, this seems to be working to me.

src/mondeath.cpp Outdated Show resolved Hide resolved
@ZhilkinSerg ZhilkinSerg self-assigned this Aug 1, 2019
@ZhilkinSerg ZhilkinSerg merged commit 141974c into CleverRaven:master Aug 3, 2019
@ZhilkinSerg ZhilkinSerg removed their assignment Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Game: Balance Balancing of (existing) in-game features. Items / Item Actions / Item Qualities Items and how they work and interact [JSON] Changes (can be) made in JSON Monsters Monsters both friendly and unfriendly. Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants