Skip to content

ElfStats

Dominik Zawlocki edited this page Jun 19, 2019 · 2 revisions

ElfStats

ElfStats is a resource based on ElfStats.gd script. It holds every stats that Elf has. It using Stat class. Read about Stat class

Parameters:

Type Name Description
Array of Stat stats Array of all stats that Elf has, should not be modified

Methods:

Type Name Description
void restore_to_default() Resets every stats to they default value and removes every items
Stat get_stat(stat_name : String) Returns stat with given name or null, if that stat doesn't exist
float get_stat_value(stat_name : String) Return changed by items value from stat with given stat name or 0 if stat doesn't exist
float get_stat_unchanged_value(stat_name : String) Return unchanged value from stat with given stat name or 0 if stat doesn't exist
void add_item(item : Resource) Adds changers from given item to all stats, that are changed by this item
void set_stats Default stats setter, throws error when called
Clone this wiki locally