Jump to content

Weak Stomach make food illness last shorter?


Champygnakx

Recommended Posts

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.

Link to comment
Share on other sites

  • 8 months later...

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

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. 

Link to comment
Share on other sites

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

   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

  • 1 year later...
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...