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
SUMMARY: Features "Add u_buy_monster talk effect"
Purpose of change
Provides the ability for the player to get pets via dialogue and missions.
Describe the solution
Implement a new talk effect following the pattern of
u_buy_item
but for monsters instead. It has some additional attributes that made sense to me, namely the ability to provide a name for the monster (e.g. to get a horse with a unique name) and the ability to have the pacified effect applied.The monster will always be added as a pet--in the context of buying/receiving the creature I didn't see a compelling reason to have it be less friendly or not a pet, but if there is one, it's easy to do.
Relevant new section from the docs:
u_buy_monster: monster_type_string
, (optionalcost: cost_num
, optionalcount: count_num
, optionalname: name_string
, optionalpacified: pacified_bool
)count_num
(default 1) instances of the monster as pets and will subtractcost_num
fromop_of_u.owed
if specified. If theop_o_u.owed
is less thancost_num
, the trade window will open and the player will have to trade to make up the difference; the NPC will not give the player the item unlesscost_num
is satisfied.If cost isn't present, the NPC gives your character the item at no charge.
If
name_string
is specified the monster(s) will have the specified name. Ifpacified_bool
is set to true, the monster will have the pacified effect applied.Describe alternatives you've considered
Right now this will spawn your monster into existence. In the future once we've implemented faction ownership of monsters, we will probably want to revisit this implementation--in some cases it'll still make sense to just warp the monster into existence, but in others I think we want it to actually just change the faction ownership of an existing monster from the faction you're buying it from to your faction. This is also why I didn't implement the parallel
u_sell_monster
--it also needs faction ownership first in my opinion.Additional context