Sign in to follow this  
Ostentatio

[Fixed] Planting flowers/sprouts only reduces stamina at 90+ skill (cause included)

Recommended Posts

Situation: Planting flowers and sprouts.

 

Expected behavior: Stamina loss from planting doesn't mysteriously get worse at 90+ skill.

 

Actual behavior: Stamina loss from planting mysteriously gets worse at 90+ skill. There is no stamina loss at less than 90 skill, but after reaching 90, there is some loss.

 

Steps to reproduce: Plant flowers or sprouts with a character who has less than 90 gardening skill, and note stamina loss (none). Then, plant them with a character who you've gotten 90+ skill with because you're dead inside and this is all you have in life, and note stamina loss (some, about 1.5% stamina loss on a character with no body stamina).

 

Cause of bug: The code responsible for the cute "plants thanking you" messages in Terraforming.java put the stamina loss code in the wrong place. Example from decompiled WU code:

if (gard > 60.0 && flower.getTemplate().isFlower()) {
                        if (gard < 70.0) {
                            tosend = "You plant the " + flower.getName() + ", and you can almost feel them start sucking nutrition from the earth.";
                        }
                        else if (gard < 80.0) {
                            tosend = "You plant the " + flower.getName() + ", and you get a weird feeling that they thank you.";
                        }
                        else if (gard < 90.0) {
                            tosend = "You plant the " + flower.getName() + ", and you see them perform an almost unnoticable bow. Or was it the wind?";
                        }
                        else if (gard < 100.0) {
                            tosend = "You plant the " + flower.getName() + ". As you see them bow you hear their thankful tiny voices in your head.";
                            performer.getStatus().modifyStamina(-1000.0f);
                        }
                    }
                    else {
                        tosend = "You plant the " + flower.getName();
                        performer.getStatus().modifyStamina(-1000.0f);
                    }

 

In this case, you lose stamina if you have less than 60 skill and if you have greater than 90 skill, but not if your skill is anywhere in between.

 

For some other cases, like planting flowerbeds, sprouts, or hedges, you only lose stamina if you have at least 90 skill, otherwise you lose no stamina.

 

 

Solution: Move calls to modifyStamina() in Terraforming.java's various planting-related functions to the appropriate spot, presumably after skill checks, depending on what the intended behavior is.

  • Like 3

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this