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

feat: allow installing non-sterile CBM when Infection Immune #2671

Merged
merged 4 commits into from
Apr 22, 2023

Conversation

scarf005
Copy link
Member

Summary

SUMMARY: Features "allow installing non-sterile CBM when Infection Immune"

Purpose of change

inspired by Cataclysm-TISH-team/Cataclysm-TISH#60

Describe the solution

Infection Immune(INFRESIST) trait will ignore checking for CBM sterileness.

Testing

Before Infection Immune After Infection Immune
Cataclysm: Bright Nights - cbn-experimental-2023-04-19-1517_06 Cataclysm: Bright Nights - cbn-experimental-2023-04-19-1517_07

@github-actions github-actions bot added the src PR changes related to source code. label Apr 20, 2023
@Night-Pryanik
Copy link
Contributor

I forgot to make it in my PR, but I recommend to update the bionic's description and mention that it will allow user to make intrusive surgery operations with non-sterile tools. Or maybe maximum directly: you can install non-sterile bionics.

@scarf005
Copy link
Member Author

scarf005 commented Apr 20, 2023

thanks for the suggestion. as CBM implements Non-Sterile using faults as in #1665, they will be displayed via this loop:

Cataclysm-BN/src/item.cpp

Lines 3818 to 3824 in 5343c28

if( parts->test( iteminfo_parts::DESCRIPTION_FAULTS ) ) {
for( const fault_id &e : faults ) {
//~ %1$s is the name of a fault and %2$s is the description of the fault
info.emplace_back( "DESCRIPTION", string_format( _( "* <bad>%1$s</bad>. %2$s" ),
e.obj().name(), e.obj().description() ) );
}
}

i think there's some possibilities to handling this situation:

  • jsonize fault negation. the problem with this approach is that infection immunity is likely the only trait that lets you skip mending. it'd be a code bloat to support only one instances of fault.
{
    "id": "fault_bionic_nonsterile",
    "type": "fault",
    "name": { "str": "Non-sterile" },
    "description": "This bionic needs to be sterilized before it can be installed.",
    "nagated_by": [ "INFRESIST" ] // <- case 1
	"nagated_by": [ { "type": "trait", "value": "INFRESIST" } ] // <- also check for types?
  }
  • add check for infection immune inside the loop. feels very hacky.

@github-actions github-actions bot added the data PRs related to datas. Won't crash game (probably) label Apr 20, 2023
@Coolthulhu
Copy link
Member

Nice idea.
In the future, the primary risk of zombie "filth" will probably be changed to semi-permanent (tied to the installed bionic) mutagenic, but that's distant future.

@scarf005 scarf005 requested a review from chaosvolt April 22, 2023 03:54
@chaosvolt
Copy link
Member

Almost everything works correctly: autodoc installs all function as expected (tested various combos of with and without Deadened and Infection Immune to ensure anesthesia interactions all still work) but attempting to activate a non-sterile CBM with Manaul Bionic Installation is still blocked even with Infection Immune.

Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks to be a dead-easy two line change in another file so instead of holding this up I'll implement the Manual Bionic Installation version of this in a follow-up PR.

@chaosvolt chaosvolt merged commit 3e03644 into cataclysmbnteam:upload Apr 22, 2023
18 checks passed
@scarf005 scarf005 deleted the infimmune-sterile branch April 22, 2023 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data PRs related to datas. Won't crash game (probably) src PR changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants