-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Weakpoints (Part 7): Add monster defenses #51979
Merged
I-am-Erk
merged 11 commits into
CleverRaven:master
from
Joshua-Chin:weakpoints-difficulty
Oct 2, 2021
Merged
Weakpoints (Part 7): Add monster defenses #51979
I-am-Erk
merged 11 commits into
CleverRaven:master
from
Joshua-Chin:weakpoints-difficulty
Oct 2, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Joshua-Chin
added
<Enhancement / Feature>
New features, or enhancements on existing
Game: Mechanics Change
Code that changes how major features work
[C++]
Changes (can be) made in C++. Previously named `Code`
Monsters
Monsters both friendly and unfriendly.
labels
Sep 30, 2021
Joshua-Chin
changed the title
Weakpoints (Part 6): Add monster defenses
Weakpoints (Part 7): Add monster defenses
Sep 30, 2021
This pull request fixes 1 alert when merging d58892b into e379588 - view on LGTM.com fixed alerts:
|
@I-am-Erk FYI, this PR updates |
Arright looks like I gotta do some refinement of weakpoint JSON now |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
<Enhancement / Feature>
New features, or enhancements on existing
Game: Mechanics Change
Code that changes how major features work
Monsters
Monsters both friendly and unfriendly.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Features "Let monster defend their weak points"
Purpose of change
Monster should be able to defend their weak points. For example, a zombie bio-operator might raise its hands to protect its eyes, or a turtle might retract it head into its shell. In addition, these defenses may vary based on the type of attack.
Describe the solution
Interface
Add support for the following weakpoint fields
coverage_mult
field is a constant multiplier on the base coverage.difficulty
field acts as a soft gating function on the attacker's skill. It multiplies the coverage by the probability that a sample from a normal distribution, centered on the attacker's skill with standard deviation 2, exceeds the difficulty.Contributors will be able to specify different values for
coverage_mult
anddifficulty
depending on the attack type. The following types of attacks are supported:The shorthands
all
,melee
,point
, andbroad
are also support. SeeMONSTER.md
for more information.Implementation
weakpoint_difficulty
struct toweakpoint.h
, and implement the JSON parsing.attack_type
enum to theweakpoint_attack
data struct.weakpoint_attack
as late as possible. This reduces the level of code duplication. (e.g. setting the source for projectiles, melee attacks, and melee techniques, when it could be set just once.)weakpoint::hit_chance
.Describe alternatives you've considered
See #51915 for discussion and alternatives.
Testing
Manual testing with
weakpoint_mon
Additional context
Closes #51915