Skip to content

Use accessors for mob/player stats #210

@Volte6

Description

@Volte6

Currently stats are structure properties. This makes it hard to change or add new stats.

  • Refactor character.Stats into a custom type of map[string]stats.StatInfo
  • Create character.Stats.Get("strength")
    • Should return 0 (zero) if stat does not exist.
    • Consider a stat definition datafile that can define supported stats and their behaviors such as:
      • Min/Max ranges, including negative numbers
      • Whether value returned by Get() is calculated logarithmically or linearly.
  • Create character.Stats.Set("strength", 1)
    • This will overwrite and set the value of the stat to this value.
  • Create character.Stats.Modify("strength", 2)
    • This will adjust the stat by the provided int

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions