Proposal for new Item system

Avatar

By xirsoi 14 Feb 2020 00:53

Champion · 85 comments

I've got a proposal based on the current event subsystem. ItemEffect and ItemCondition classes which would be called like EventActions and EventConditions. New Effects and Condtions would be implemented as a new class, just like with Events. Here's a breakdown.

ItemEffect
- target                 Who the effect will be used on. Monster or NPC object.
- effect                  Name of the effect.
- params               Optional list of comma delimited parameters.

A template and example:
    "effects" : [
      "effect param1(, param2(, param3...))"
    ]

    "effects" : [
      "learn avalanche",
      "learn snowball,blizzard"
    ]

Existing Effects: heal, capture

Potential Effects:
learn            :    accepts one or more techniques and adds them to the target's move list.
                                        if 4 moves are already known, the 4th is replaced
add_status             :     put the given status effect on the target
remove_status     :     remove the given status effect from the target
cure             :     remove all negative status effects (this assumes effects being more complicated)
debuff                     :        remove all positive status effects

ItemCondition
- user            The user of the item, probably an NPC object.
- target                The target of the item, Monster or NPC object.
- context                The "context" what we will be checking against, usually the user or target,
                                but there's room for other things like requiring something in the story.
- condition             The name of the condition, these are listed below.
- params                The values to check the condition with.
                                Passing multiple values (csv) will cause this to be treated as an OR operation.

Here is a template for a condition and an example:
    "conditions" : [
        "context condition param1(,param2(, param3...))"
    ]

    "conditions" : [
        "user badges 4",
        "target type Earth,Water"
    ]

Potential Conditions:
type : will check that the monster's type1 OR type2 is equal to one of the given values
        to require that a monster be, for example, both Earth and Water type, you would do
        two conditions, one for each type.

shape : checks against the monster's body type; e.g. landrace, aquatic, blob, etc.

level_<above/below/equal> : check against the monster's level

badges : theoretical check against the number of "badges" the player has accumulated.
          An example of a story-based check, but it could be there is a better implementation of this idea.

Feedback would be appreciated.

Last edited by xirsoi (14 Feb 2020 00:59)


Avatar

By Sanglorian 14 Feb 2020 02:39

Champion · 543 comments

Thanks xirsoi!

xirsoi wrote

badges : theoretical check against the number of "badges" the player has accumulated.
          An example of a story-based check, but it could be there is a better implementation of this idea.

Could it check an in-game variable instead? Map makers can set those, and they would almost certainly include number of "badges" along with lots of other story-based elements.

Avatar

By xirsoi 14 Feb 2020 03:25

Champion · 85 comments
Sanglorian wrote

Thanks xirsoi!

xirsoi wrote

badges : theoretical check against the number of "badges" the player has accumulated.
          An example of a story-based check, but it could be there is a better implementation of this idea.

Could it check an in-game variable instead? Map makers can set those, and they would almost certainly include number of "badges" along with lots of other story-based elements.

Excellent idea!