Champygnakx Posted December 21, 2021 Share Posted December 21, 2021 if (this.Traits.IronGut.isSet()) { this.effectiveEdibleBuffTimer = Rand.Next(80.0f, 150.0f); } else if (this.Traits.WeakStomach.isSet()) { this.effectiveEdibleBuffTimer = Rand.Next(120.0f, 230.0f); } else { this.effectiveEdibleBuffTimer = Rand.Next(200.0f, 280.0f); Is this intended or not? I'm not sure, I wanted to report it just in case. Tchernobill 1 Link to comment Share on other sites More sharing options...
Tchernobill Posted September 3, 2022 Share Posted September 3, 2022 This is still the case with B41.73 It looks A LOT like WeakStomach and default (no associated trait) cases have been swapped for duration. see IsoGameCharacter.java Eat( InventoryItem, float ) method. That said, the BodyDamage.java JustAteFood( Food, float ) is in the correct order for poison / dangerousuncooked / rotten effects amplitudes. Link to comment Share on other sites More sharing options...
EnigmaGrey Posted September 3, 2022 Share Posted September 3, 2022 13 minutes ago, Tchernobill said: This is still the case with B41.73 It looks A LOT like WeakStomach and default (no associated trait) cases have been swapped for duration. see IsoGameCharacter.java Eat( InventoryItem, float ) method. Doesn't look like it does anything / is used anywhere beyond the <= 0 check that's used to enter the block where it's set. I don't think this code is used anymore. Either that or my IDE is having a bad day and failing to find any references outside of IsoGameCharacter's eat function. Tchernobill 1 Link to comment Share on other sites More sharing options...
Tchernobill Posted September 3, 2022 Share Posted September 3, 2022 (edited) It looks a lot like a timer for the sickness duration, decreased in IsoGameCharacter updateInternal() method. Edited September 3, 2022 by Tchernobill I see The Indie Stone staff working in the WE. Feels bad to give you (potentially useless) work on saturday. Link to comment Share on other sites More sharing options...
EnigmaGrey Posted September 3, 2022 Share Posted September 3, 2022 6 minutes ago, Tchernobill said: It looks a lot like a timer for the sickness duration, decreased in IsoGameCharacter updateInternal() method All it's doing there is decreasing itself, weighed against the framerate. It doesn't seem to have any effect. if(effectiveEdibleBuffTimer > 0f) { effectiveEdibleBuffTimer -= GameTime.getInstance().getMultiplier() * 0.015f; if(effectiveEdibleBuffTimer < 0f) { effectiveEdibleBuffTimer = 0f; } } It doesn't cause or block any code from happening. Link to comment Share on other sites More sharing options...
Tchernobill Posted September 3, 2022 Share Posted September 3, 2022 public boolean Eat(InventoryItem var1, float var2) { Food var3 = (Food)Type.tryCastTo(var1, Food.class); //[..] //condition requiring the timer effectiveEdibleBuffTimer to be completed. if (this.BodyDamage.getFoodSicknessLevel() > 0.0F && (float)var3.getReduceFoodSickness() > 0.0F && this.effectiveEdibleBuffTimer <= 0.0F) { //here we decrease food sickness level var14 = this.BodyDamage.getFoodSicknessLevel(); this.BodyDamage.setFoodSicknessLevel(this.BodyDamage.getFoodSicknessLevel() - (float)var3.getReduceFoodSickness() * var2); if (this.BodyDamage.getFoodSicknessLevel() < 0.0F) { this.BodyDamage.setFoodSicknessLevel(0.0F); } //here we decrease poison level var7 = this.BodyDamage.getPoisonLevel(); this.BodyDamage.setPoisonLevel(this.BodyDamage.getPoisonLevel() - (float)var3.getReduceFoodSickness() * var2); if (this.BodyDamage.getPoisonLevel() < 0.0F) { this.BodyDamage.setPoisonLevel(0.0F); } //here we decide of the time taken until next check. from shorter to longer: IronGut < WeakStomach < NoTrait if (this.Traits.IronGut.isSet()) { this.effectiveEdibleBuffTimer = Rand.Next(80.0F, 150.0F); } else if (this.Traits.WeakStomach.isSet()) { this.effectiveEdibleBuffTimer = Rand.Next(120.0F, 230.0F); } else { this.effectiveEdibleBuffTimer = Rand.Next(200.0F, 280.0F); } } //[..] return true; } private void updateInternal() { //[..] //decrease timer over time as should be if (this.effectiveEdibleBuffTimer > 0.0F) { this.effectiveEdibleBuffTimer -= GameTime.getInstance().getMultiplier() * 0.015F; if (this.effectiveEdibleBuffTimer < 0.0F) { this.effectiveEdibleBuffTimer = 0.0F; } } //[..] } It also has impact on poison level decrease and food sickness level decrease. I do not understand how this is part of the "Eat" method though, but it may be unrelated. Link to comment Share on other sites More sharing options...
EnigmaGrey Posted September 3, 2022 Share Posted September 3, 2022 The code that checks if effective’s edibleTimer is greater than or equal to 0 is aways going to run because the default value is 0. Then update ticks it down to zero or until Eat is called. It’s, in other words, a timer without any purpose. Tchernobill 1 Link to comment Share on other sites More sharing options...
Tchernobill Posted September 3, 2022 Share Posted September 3, 2022 (edited) thanx for taking the time to pointing that out. Edited September 3, 2022 by Tchernobill But the sign is opposite: it is <= so only valid when == 0 when the timer expires. Link to comment Share on other sites More sharing options...
EnigmaGrey Posted September 4, 2022 Share Posted September 4, 2022 My mistake: Less than or equal to 0. So it'll run any time the value is over 0. So yes, it is gatekeeping the poison effects. Link to comment Share on other sites More sharing options...
Js-2nd Posted November 30, 2023 Share Posted November 30, 2023 effectiveEdibleBuffTimer is LemonGrass (or any food which has ReduceFoodSickness effect) cooldown timer. That means if the effectiveEdibleBuffTimer > 0, eat LemonGrass has no effect on reducing food sickness or poison level. But effectiveEdibleBuffTimer is not saved between sessions. Player can logout and login again to eat LemonGrass. And this code seems to apply different cooldown by traits. But I think the character with WeakStomach trait should have 200~280 cooldown instead of 120-230 (condition reversed) if (this.Traits.IronGut.isSet()) { this.effectiveEdibleBuffTimer = Rand.Next(80.0F, 150.0F); } else if (this.Traits.WeakStomach.isSet()) { // I think it's "if (!this.Traits.WeakStomach.isSet())" this.effectiveEdibleBuffTimer = Rand.Next(120.0F, 230.0F); } else { this.effectiveEdibleBuffTimer = Rand.Next(200.0F, 280.0F); } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now