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

Teleglow can cause permanent irreversible fungal infections #52040

Closed
jim-huynh opened this issue Oct 2, 2021 · 4 comments
Closed

Teleglow can cause permanent irreversible fungal infections #52040

jim-huynh opened this issue Oct 2, 2021 · 4 comments
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@jim-huynh
Copy link
Contributor

jim-huynh commented Oct 2, 2021

Describe the bug

Teleglow can cause permanent irreversible fungal infections due to antifungals now working over time #42388

Steps To Reproduce

Step into a portal and hope for the 1/10,000 chance that you get the fungal result.

Expected behavior

This used to be a curable condition when antifungals were instant and removed the fungal infection directly. Since teleglow is not coded to specifically make you a Mycus, it should still be curable.

if( one_in( 10000 ) ) {
        if( !u.has_trait( trait_M_IMMUNE ) ) {
            u.add_effect( effect_fungus, 1_turns, true );
        } else {
            u.add_msg_if_player( m_info, _( "We have many colonists awaiting passage." ) );
        }
        // Set ourselves up for removal
        it.set_duration( 0_turns );
    }

The duration should probably be changed to something relatively long, but the permanent flag should be set to false.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0 2009
  • Game Version: 0.F-3138-g6457789afd-dirty [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Bionic Professions [package_bionic_professions],
    Bionic Slots [cbm_slots]
    ]

(This is my own build with very minor bug fixes that don't touch player_hardcoded_effects.cpp)

Additional context

No response

@Kribylet
Copy link
Contributor

Kribylet commented Oct 2, 2021

What makes you sure that #42388 is to blame? Is there something that makes you sure this case is different from #51939?

(This is my own build with very minor bug fixes that don't touch player_hardcoded_effects.cpp)

Does your build revert #51827?

@jim-huynh
Copy link
Contributor Author

jim-huynh commented Oct 2, 2021

@Kribylet #51939 is caused by a different snippet of code in player_hardcoded_effects.cpp which has basically the same problem - it adds the fungal effect with a 1 turn duration and the permanent flag is set to true. It should be something like u.add_effect( effect_fungus, 4_hours, false ); <--- time depending on how intense we want it to be on initial infection.

static void eff_fun_spores( Character &u, effect &it )
{
    // Equivalent to X in 150000 + health * 100
    const int intense = it.get_intensity();
    if( ( !u.has_trait( trait_M_IMMUNE ) ) && ( one_in( 100 ) &&
            x_in_y( intense, 900 + u.get_healthy() * 0.6 ) ) ) {
        u.add_effect( effect_fungus, 1_turns, true );
    }
}

image

Previously, the antifungal drug would directly remove the effect of a fungus infection.
The underlying cause is due to this change specifically:
image

image

@Maleclypse Maleclypse added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Oct 2, 2021
@Kribylet
Copy link
Contributor

Kribylet commented Oct 2, 2021

@Kribylet #51939 is caused by a different snippet of code in player_hardcoded_effects.cpp which has basically the same problem - it adds the fungal effect with a 1 turn duration and the permanent flag is set to true. It should be something like u.add_effect( effect_fungus, 4_hours, false ); <--- time depending on how intense we want it to be on initial infection.

If the permanent flag is the issue, why does reverting #51827 also fix the issue (for #51939)?

@jim-huynh
Copy link
Contributor Author

Yeah ok, I see what you're talking about in your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants