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

Query the player on whether he really want to cut other people's stuff #77932

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Night-Pryanik
Copy link
Contributor

Summary

Features "Query the player on whether he really want to cut other people's stuff"

Purpose of change

  1. Disassembling other people's stuff used almost exact copy of code for witness check from query_consume_ownership.
  2. Witness check triggered only when you tried to disassemble stuff belonging to NPCs from some faction, so you could safely disassemble stuff belonging to factionless NPCs.
  3. You could safely cut (salvage) other people's stuff.

Describe the solution

  1. Extracted "witnessed thievery" function from query_consume_ownership and applied it to disassembling check to eliminate duplicating the code.
  2. In "witness check" added check for factionless NPC, so they make angry at you when you start disassembling their stuff.
  3. Added "witness check" to salvage_actor::use.

Describe alternatives you've considered

None.

Testing

Tried to disassemble prisoners' stuff at island prison type B. Got a prompt. Answered no, answered yes.
Tried to cut prisoners' stuff at island prison type B. Got a prompt. Answered no, answered yes.
Tried to disassemble veterinarian's stuff at animal shelter. Got a prompt. Answered no, answered yes.
Tried to cut veterinarian's stuff at animal shelter. Got a prompt. Answered no, answered yes.

Additional context

I also wanted to mention that trying to disassemble/cut factionless NPC's stuff triggers immediate hostile attitude from that NPC, contrary to trying to disassemble/cut faction stuff, which allows you to do it three (!) times before they turn hostile towards you. Their faction opinion towards you will lower every time, but still. I personally find immediate reaction much more "natural", and I wanted to change faction reaction to be immediate too, but I wanted to hear other opinions too, or maybe even open an issue regarding that.

@Night-Pryanik Night-Pryanik added NPC / Factions NPCs, AI, Speech, Factions, Ownership Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact <Bugfix> This is a fix for a bug (or closes open issue) Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Nov 17, 2024
@github-actions github-actions bot added <Enhancement / Feature> New features, or enhancements on existing astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Enhancement / Feature> New features, or enhancements on existing Items / Item Actions / Item Qualities Items and how they work and interact json-styled JSON lint passed, label assigned by github actions NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant