GithubHelp home page GithubHelp logo

Comments (3)

dominicrusso avatar dominicrusso commented on June 18, 2024

In talking to one other developer, they suggested the intent may have been to make it 0, 4k, 10k, Max. if that's the case, we should probably just make it a static point instead of a calculated midpoint.

from servuo.

dominicrusso avatar dominicrusso commented on June 18, 2024

Also in a related note, it looks like the Virtue gump uses hardcoded values instead of GetMaxAmount(...)

private int GetHueFor(int index)
        {
            if (m_Beheld.Virtues.GetValue(index) == 0)
                return 2402;

            int value = m_Beheld.Virtues.GetValue(index);

            if (value < 4000)
                return 2402;

            if (value >= 30000)
                value = 30000; //Sanity

            int vl;

            if (value < 10000)
                vl = 0;
            else if (value >= 20000 && index == 5)
                vl = 2;
            else if (value >= 21000 && index != 1)
                vl = 2;
            else if (value >= 22000 && index == 1)
                vl = 2;
            else
                vl = 1;

            return m_Table[(index * 3) + vl];
        }

from servuo.

kamronbatman avatar kamronbatman commented on June 18, 2024

The calculation is wrong because the value was changed from 9999 to 10000. The original RunUO calculation is a hack that actually works, albeit virtually unreadable.

If your value is 20,000, and you use the SUO calculation:
(v + 10000) / 10000 -> (20000 + 10000) / 10000 -> 3 - which is wrong.
But if you use the RunUO calculation:
(v + 9999) / 10000 -> (20000 + 9999) / 10000 -> 2.99 -> 2 - which is correct, because the max value check was done before this one.

So the code simply needs to be reverted back to what RunUO had.

from servuo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.