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

TRADER_AVOID flag is applied inconsistently #22743

Closed
Night-Pryanik opened this issue Jan 13, 2018 · 2 comments
Closed

TRADER_AVOID flag is applied inconsistently #22743

Night-Pryanik opened this issue Jan 13, 2018 · 2 comments
Labels
Items / Item Actions / Item Qualities Items and how they work and interact NPC / Factions NPCs, AI, Speech, Factions, Ownership

Comments

@Night-Pryanik
Copy link
Contributor

Game version: 0.C-7052

Operating system: Windows XP SP3 x86

Tiles or curses: tiles

Mods active: default only

Expected behavior

Items with TRADER_AVOID flag shouldn't appear as a viable option in player inventory when trading with NPCs.

Actual behavior

Sometimes items with TRADER_AVOID flag indeed doesn't appear as a possible trade item, sometimes they do. One can't choose tinfoil hat to trade, but can choose heavy crossbow, both have the aforementioned flag.

Steps to reproduce the behavior

Wish for some items with the flag (tinfoil hat and heavy crossbow, or active emp grenade and lit Louisville Slaughterer, for example) and try to trade them with some NPC.

@Night-Pryanik Night-Pryanik added NPC / Factions NPCs, AI, Speech, Factions, Ownership Items / Item Actions / Item Qualities Items and how they work and interact labels Jan 13, 2018
@BevapDin
Copy link
Contributor

TRADER_AVOID is supposed to prevent that item from appearing in the generated inventory of any NPC. It does not mean the NPC can't/won't/shouldn't take that item. From the documentation in "doc/JSON_FLAGS.md": "NPCs will not start with this item."

It's implied by the NPC_THROW_NOW (which is not actually coded that way) and PSEUDO flag. The PSEUDO and the DANGEROUS flag imply TRADER_AVOID according to the code.

NPCs flat out don't want to buy anything that has a price below 80 (in cent, I believe), except when they are your friend. I just tested this: the tinfoil hat does not appear when trading with a neutral NCP, but appears (with price 0.21) when the NPC is a friend.

The flag works as intended, but it might have a slightly misleading name. But the documentation clearly states what it does.

@Night-Pryanik
Copy link
Contributor Author

Ok, I got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Items / Item Actions / Item Qualities Items and how they work and interact NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

No branches or pull requests

2 participants