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 u_buy_monster talk effect #33446

Merged
merged 2 commits into from
Aug 23, 2019

Conversation

ralreegorganon
Copy link
Contributor

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:

Effect Description
u_buy_monster: monster_type_string, (optional cost: cost_num, optional count: count_num, optional name: name_string, optional pacified: pacified_bool) The NPC will give your character count_num (default 1) instances of the monster as pets and will subtract cost_num from op_of_u.owed if specified. If the op_o_u.owed is less than cost_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 unless cost_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. If pacified_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

image
image

@ralreegorganon ralreegorganon added <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership Missions Quests and missions [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs labels Aug 21, 2019
src/npctalk.cpp Outdated Show resolved Hide resolved
@ZhilkinSerg ZhilkinSerg merged commit 156c7a6 into CleverRaven:master Aug 23, 2019
misterprimus pushed a commit to misterprimus/Cataclysm-DDA that referenced this pull request Sep 21, 2019
* Add u_buy_monster talk effect

* Update u_buy_monster name to be translatable
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` <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs Missions Quests and missions NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants