benjaminjackman / looty

Looty! A tool for Path of Exile that makes inventory searching fun!
GNU General Public License v2.0
60 stars 21 forks source link

lireg Stat does not seem to be working. #41

Closed synicasm closed 3 years ago

synicasm commented 4 years ago

Life Regen can be represented 2 ways

Regenerate % of Life per Second Regenerate X life per second.

Neither appear to be showing up under this category.

Regen1 Regen2

AnnanFay commented 4 years ago

I noticed this today so just posting to confirm it. JSON Example:

{
        [...]
        "name": "Araku Tiki",
        "typeLine": "Coral Amulet",
        "identified": true,
        "ilvl": 9,
        "implicitMods": [
            "Regenerate 2.2 Life per second"
        ],
        "explicitMods": [
            "+100 to Evasion Rating while on Low Life", 
            "+32 to maximum Life", 
            "+27% to Fire Resistance", 
            "Regenerate 1% of Life per second while on Low Life"
        ],
        [...]
    }

I don't know scala so having trouble figuring out where in the code even handles this. I think this is the current code. It's using the parser:

P.simple1("", s"Life Regenerated per second")(_.other.lifeRegeneratedPerSecond)```

This compiles to the expression: `^([.+-\\d]+)%* Life Regenerated per second$`

I think the fix needed is to replace the above with: ```scala
P.simple1("Regenerate", s"Life per second")(_.other.lifeRegeneratedPerSecond)

For the original code just adds together all life regeneration mods but having them separate seems like a good idea. Something like:

    addMod("% Life regeneration",
      "Percent Life Regeneration Rate Per Second",
      P.simple1("Regenerate", s"of Life per second.*")(_.other.lifePercentRegeneratedPerSecond))

Then lifePercentRegeneratedPerSecond would need to be added to the other files.

piotrszymaniec commented 4 years ago

I think I got it right. @AnnanFay you are on the right track. As far as I was able to deduce, adding parsing for affix is done in 3 files:

  1. ComputedItem.scala where you set how it's referenced in next 2 files, also variable with which JSON data will be mached (im not sure how to call it, see for yourself)
  2. ComputedItemProps.scala where you choose name for button/column, and description (and if you wonder the ?= are for setting default columns on, so !?= sets them off)
  3. and ofc AffixesParser.scala where you make regex for affix