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

No lit cigs in inventory anymore, only in hands or in mouth #77834

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

Conversation

Night-Pryanik
Copy link
Contributor

Summary

Features "No lit cigs in inventory anymore, only in hands or in mouth"

Purpose of change

Describe the solution

  1. On activating (=lighting) the cig, automatically wear it (=put it in mouth).
  2. Cigs can be held only in hands (=wielded) or in mouth (=worn).
  3. If taking the cig off or unwielding it, automatically extinguish it first.

Also some infrastructure work: simplified and updated "cig dies out" event by removing explicit item conversions (e.g. cig_lit to cig_butt). Instead, add revert_to field to cigar, cigarette, and joint. If "cig dies out" event happens, convert cig to its revert_to. If no revert_to is defined, check for target in transform use_action and convert to that target. This allows processing other smokable items which may be added in the future to vanilla or mods.

Also changed displaying of interactions with cigs from You take a puff of your cigarette (lit) (active). to You take a puff of your cigarette.

Describe alternatives you've considered

Instead of auto-extinguishing the cig when put into some container in inventory, make the cig react to that: add some chance for extinguish, some chance to set container (if flammable) and character on fire.

Testing

Got unlit cigarette in inventory. Activated it. My character automatically wore it.
Got unlit cigarette in hands. Activated it. My character automatically wore it.
Wielded worn lit cigarette. Cigarette was still lit.
Worn wielded lit cigarette. Cigarette was still lit.
Took off worn lit cigarette. My character automatically extinguished it and put in inventory.
Unwieded lit cigarette. My character automatically extinguished it and put in inventory.

Just in case: threw and dropped worn/wielded lit cigarettes to the ground. Cigarette was still lit.

Additional context

None.

Also changed displaying of interactions with cigs as `You take a puff of your cigarette.` rather than `You take a puff of your cigarette (lit) (active).`
…depending on itype_id

Instead, add `revert_to` field to cigar, cigarette, and joint. If "cig dies out" event happens, convert cig to its `revert_to`. If no `revert_to` is defined, check for `target` in `transform` use_action and convert to that `target`. This allows processing other cig items which may be added in the future to vanilla or mods.
@Night-Pryanik Night-Pryanik added [JSON] Changes (can be) made in JSON [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) Mechanics: Character / Player Character / Player mechanics labels Nov 14, 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 labels Nov 14, 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 <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Items / Item Actions / Item Qualities Items and how they work and interact [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Mechanics: Character / Player Character / Player mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dropping items while smoking results in self-ignition
1 participant