Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upFRAGILE_MELEE, continued. #24028
Conversation
NotFuji
added some commits
Jun 16, 2018
This comment has been minimized.
This comment has been minimized.
|
I suggest to think about possibility to use some of new behavoir by default. |
This comment has been minimized.
This comment has been minimized.
|
NOW THIS IS WHAT I'M TALKING ABOUT. |
This comment has been minimized.
This comment has been minimized.
|
I'll have to see how it works out ingame, but this seems like a far better solution, and should be able to work in many cases equally well. |
This comment has been minimized.
This comment has been minimized.
|
I think |
This comment has been minimized.
This comment has been minimized.
|
I tried playing with the half baked tag AlienZimogor hastly PRed, and the durability of the knife spear is on par with the extremely absurd weapon durability in BOTW, so I removed it from my JSON folder. |
This comment has been minimized.
This comment has been minimized.
victorsegall
commented
Jun 16, 2018
•
|
Quite sensible that a component is damaged and therefore is the part referenced for damage to cause the break. This will also support variant recipes that use more or improved materials. As-is it supports the fact that existing recipes have variable ingredients that can represent consequential choices. Reading thread for the PR #23963 shows its author being consistent (FRAGILE_MELEE because we already have DURABLE_MELEE) rather than opinionated like #24005 which simply uses the flag before it's ready to be used. #23963 was only using knife spear as an obvious example, which it is. The flag is appropriate and this PR improves it. #24018 will also improve it. It needs to be improved, as @kevingranade and others are clearly guiding @AlienZimogor to force the work to get done. Set Zimogor's misguided motivations and language aside, because we'll have to. Could mod it out, but shouldn't be forced to. Without looking, I'd take the bet that DURABLE_MELEE hasn't received this level of attention. It should. |
victorsegall
referenced this pull request
Jun 16, 2018
Merged
Time to use FRAGILE_MELEE: round two, SPEAR_FORKED #24014
ZhilkinSerg
added
Game: Balance
[JSON]
[C++]
Melee
labels
Jun 16, 2018
This comment has been minimized.
This comment has been minimized.
|
Looks much more well-thought out and put together. Extremely well done, Fuji. Like victor suggested, is DURABLE_MELEE in a suitable place or would it also benefit from some of your treatment, Fuji? |
This comment has been minimized.
This comment has been minimized.
|
DURABLE_MELEE probably works just find as-is. There's not much that can be done to make it more interesting without completely changing how item damage works. |
Coolthulhu
reviewed
Jun 17, 2018
| int weak_chip = INT_MAX; | ||
|
|
||
| // Items that should have no bearing on durability | ||
| const std::vector<itype_id> blacklist = { "rag", |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 17, 2018
Contributor
You want a std::set here. Then check it with blacklist.count( type_here ) > 0.
Coolthulhu
reviewed
Jun 17, 2018
| "leather", | ||
| "fur" }; | ||
|
|
||
| std::vector<item> valid_components; |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 17, 2018
Contributor
No need to make copies of the components. You can iterate over components themselves while they're still components - you don't alter them here and only take the type and chip resistance.
Coolthulhu
reviewed
Jun 17, 2018
| _( "<npcname>'s %s breaks apart!" ), | ||
| str.c_str() ); | ||
|
|
||
| std::vector<item> all_comps = temp.components; |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 17, 2018
Contributor
No need to copy the component vector here. Just iterate over the components themselves.
If you need to make a copy (for example, before wielding), it's better to explicitly copy it there.
Coolthulhu
reviewed
Jun 17, 2018
| std::vector<item> all_comps = temp.components; | ||
|
|
||
| for( auto &comp : all_comps ) { | ||
| int break_chance = comp.typeId() == weak_comp ? 2 : 8; |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 17, 2018
Contributor
I'm not sure what you're doing here.
weak_comp is the item with the highest chip_resistance. Why does this specific item get 4 times lower chance at avoiding destruction?
This comment has been minimized.
This comment has been minimized.
NotFuji
Jun 17, 2018
Author
Contributor
You have that backwards. weak_comp has the lowest chip resistance, and so is considered the "breaking point" of the weapon and has a lower chance of being recovered when the weapon falls apart.
Coolthulhu
reviewed
Jun 17, 2018
| continue; | ||
| } | ||
|
|
||
| if( comp.has_flag( "HANDLE" ) && !is_armed() ) { |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 17, 2018
Contributor
Rather than explicit HANDLE flag, which would require a lot of marking, you could default to the largest item.
It would be correct in majority of cases and the minority could be special cased.
This comment has been minimized.
This comment has been minimized.
|
ETA? (I'm going to stop asking because it might be annoying) |
ZhilkinSerg
self-assigned this
Jun 27, 2018
This comment has been minimized.
This comment has been minimized.
|
I've already broken 5 knife spears, but no components appeared yet. |
This comment has been minimized.
This comment has been minimized.
My bad. That only applies to debug spawned items - apparently they aren't crafted and have no components. Hand crafted spears are shattered fine. |
ZhilkinSerg
merged commit 3e28411
into
CleverRaven:master
Jun 27, 2018
ZhilkinSerg
removed their assignment
Jun 27, 2018
This comment has been minimized.
This comment has been minimized.
|
Yay! This makes it a compromise that's a lot less frustrating. Thank you! |
NotFuji commentedJun 16, 2018
•
edited
Continues the feature added in #23963
FRAGILE_MELEE now checks for the weakest component used to make the item for use in damage calculations. Crafting components now directly impact the durability of said weapons
Items commonly used as "handle wrappings" such as rags and leather are omitted.
Additional skill/stat modifiers are now correctly applied
Fragile items are given a further 6x bonus increase to damage chance to compensate for the apparently over-strong materials that are often weakpoints. ( Cotton, more specifically. If cotton were to have it's chip_resistance lowered to 1 from 6, function would be nearly identical as no bonus chance. ) Overall, items like the knife spear break approximately half as often as they do in mainline.
Upon breaking a fragile item has a chance to drop it's crafting components. Handles (the largest component by volume) are retained by the player, and the weakest item has a higher chance of being destroyed. Closes #24018
For fragile items with no specified crafting components, such as those naturally spawned into the world, damage chance is 6x the default value. Items are simply destroyed when broken. ( This should rarely happen if ever, FRAGILE_MELEE is meant for shoddy player-made weapons )