Giter Site home page Giter Site logo

improve set item detection about riiablo HOT 3 OPEN

collinsmith avatar collinsmith commented on May 9, 2024
improve set item detection

from riiablo.

Comments (3)

collinsmith avatar collinsmith commented on May 9, 2024

SetItems excel will now generate a mapping from set name to items belonging to set. This will work fine in the meantime, but ideally this responsibility should belong with the eventual Set excel, but I'll need to guarantee that they are loaded in the correct order, as one will be tightly coupled with the excel reference in Riiablo.files. As for updates (adding/removing items during runtime) -- I'm not sure yet how I want to implement that.

I would like the API calls to work something like this in item details creation -- this pseudocode assumes that the d2s has already loaded the items:

if (quality == SET) {
  add().height(font.getLineHeight()).space(SPACING).row();
  Sets.Entry set = Riiablo.files.SetItems.get(qualityId).getSet();
  add(new Label(Riiablo.string.lookup(set.index), font, Riiablo.colors.gold)).space(SPACING).row();
  for (SetItems.Entry item : set.getItems()) {
    Color color = (gameScreen.player.setFlags.get(set.index) & item.flag) == 0
        ? Riiablo.colors.red
        : Riiablo.colors.green;
    add(new Label(Riiablo.string.lookup(item.index), font, color)).space(SPACING).row();
  }
}

item.flag will be the flag assigned when the SetItem.Entry is created (1 << size) at time of adding. When the items are loaded, if it's a set item, bitwise or the set's items with the new item. The issue I am going to run into though is removal of the items (multiple copies of the same set item, so I can't just unset the flag if the user still has one, unless I iterate through the items to check).

from riiablo.

collinsmith avatar collinsmith commented on May 9, 2024

I decided for the first iteration to create a function in Sets which indexes a SetItems reference and assigned forward and backwards references between sets and their items. As far as set bonuses and keep track of sets, there isn't any kind of support for this right now, at least as far as Item ownership is concerned. I think I'm going to make set ownership tied to Player references.

I am considering how viewing other players items or viewing items referenced in chat (like in D3) might work and what bonuses to show (I'd like to show the owner's bonuses maybe), and also what player stats are based from (e.g., stat / level properties, the viewer's level or owner's level)

from riiablo.

collinsmith avatar collinsmith commented on May 9, 2024

bdfbb5c added support for updating set and set item counters at run time. Once I configure the item details and attributes updating I'll close this issue.

from riiablo.

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.