originalfoo / Proto

Like the Style mod, but for all other prototypes!
MIT License
0 stars 0 forks source link

`resistances` helper #24

Open originalfoo opened 8 years ago

originalfoo commented 8 years ago

Need a cleaner way to define resistances.

Raw data examples:

        {
          decrease = 3,
          percent = 20,
          type = "physical"
        },
        {
          decrease = 45,
          percent = 60,
          type = "impact"
        },
        {
          decrease = 10,
          percent = 30,
          type = "explosion"
        },
        {
          percent = 100,
          type = "fire"
        },
        {
          percent = 70,
          type = "laser"
        },
        {
          decrease = 10,
          percent = 20,
          type = "acid"
        }

Both the percent and the decrease seem optional (as long as one of them is used, the other can be omitted). They can also be negative values (eg. medium biters have -50% resistance to fire).

originalfoo commented 8 years ago

Explanation of percent and decrease values: https://forums.factorio.com/viewtopic.php?f=25&t=33575

originalfoo commented 8 years ago

Using a meta, semantic markup should be possible:

resist "<name>" -<absorption> %<percentage>

Where absorption equates to decrease.

The list helper could be modified so that it chooses different metatable depending on specifier, thus allowing bulk update of different types of list (not just item/fluid, but also sound, resist, etc).