numeric mods
This commit is contained in:
parent
eaa487f16a
commit
5246d8481d
11 changed files with 185 additions and 0 deletions
21
addons/numeric-modifiers/numeric_modifiers.gd
Normal file
21
addons/numeric-modifiers/numeric_modifiers.gd
Normal file
|
@ -0,0 +1,21 @@
|
|||
extends Resource
|
||||
|
||||
class_name NumericModifiers
|
||||
|
||||
@export var flat_value : float
|
||||
@export var percentage_value : float
|
||||
@export var mult_value : float
|
||||
|
||||
var value:
|
||||
get():
|
||||
return get_value()
|
||||
|
||||
func _init(flat : float = 0, per : float = 0, mult : float = 1) -> void:
|
||||
flat_value = flat
|
||||
percentage_value = per
|
||||
mult_value = mult
|
||||
|
||||
resource_local_to_scene = true
|
||||
|
||||
func get_value() -> float:
|
||||
return flat_value * mult_value * (1.0 + percentage_value)
|
Loading…
Add table
Add a link
Reference in a new issue