Add generator buffs (additional test required)
This commit is contained in:
@@ -28,6 +28,22 @@ extends Resource
|
||||
@export var click_exponent: int = 0
|
||||
@export var click_cooldown_seconds: float = 0.2
|
||||
|
||||
## Data-driven buffs purchasable for this generator.
|
||||
@export var buffs: Array[GeneratorBuffData] = []
|
||||
|
||||
func find_buff(buff_id: StringName) -> GeneratorBuffData:
|
||||
var expected_id: String = String(buff_id).strip_edges()
|
||||
if expected_id.is_empty():
|
||||
return null
|
||||
|
||||
for buff in buffs:
|
||||
if buff == null:
|
||||
continue
|
||||
if String(buff.id) == expected_id:
|
||||
return buff
|
||||
|
||||
return null
|
||||
|
||||
## Returns cost of next generator
|
||||
func cost_next(owned: int) -> float:
|
||||
return cost_for_amount(owned, 1)
|
||||
|
||||
Reference in New Issue
Block a user