Balancing
This commit is contained in:
parent
90d6c5c926
commit
22d7326565
6 changed files with 116 additions and 105 deletions
|
|
@ -10,7 +10,9 @@ var base_modifiers: Dictionary = {
|
|||
"wood_respawn_modifier": 1.0,
|
||||
"wood_per_click_modifier": 1.0,
|
||||
"purchase_rate_modifier": 1.0,
|
||||
"autowood_modifier": 1.0
|
||||
"autowood_modifier": 1.0,
|
||||
"premium_price_modifier": 1.0,
|
||||
"reputation_income": 0.0
|
||||
}
|
||||
|
||||
var current_modifiers: Dictionary = base_modifiers.duplicate()
|
||||
|
|
@ -31,7 +33,11 @@ func apply_modifiers():
|
|||
for key in apply_unlock_modifiers.keys():
|
||||
if current_modifiers.has(key):
|
||||
Log.pr(" - Current", key, "modifier before:", current_modifiers[key])
|
||||
current_modifiers[key] *= apply_unlock_modifiers[key]
|
||||
# Reputation income is additive, not multiplicative
|
||||
if key == "reputation_income":
|
||||
current_modifiers[key] = apply_unlock_modifiers[key]
|
||||
else:
|
||||
current_modifiers[key] *= apply_unlock_modifiers[key]
|
||||
Log.pr(" - Applied", key, "modifier:", apply_unlock_modifiers[key], "New value:", current_modifiers[key])
|
||||
else:
|
||||
Log.pr(" - Warning: Unknown modifier key:", key)
|
||||
|
|
@ -88,7 +94,7 @@ func unlock_item(unlock_id: int) -> bool:
|
|||
return false
|
||||
|
||||
func get_sale_price_per_item():
|
||||
return Global.base_sale_price * get_modifier_value("sale_price_modifier")
|
||||
return Global.base_sale_price * get_modifier_value("sale_price_modifier") * get_modifier_value("premium_price_modifier")
|
||||
|
||||
func get_wood_per_click():
|
||||
return Global.wood_per_click * get_modifier_value("wood_per_click_modifier")
|
||||
|
|
@ -102,5 +108,8 @@ func get_items_produced_per_tick():
|
|||
func get_sale_demand():
|
||||
return Global.base_purchase_rate * get_modifier_value("purchase_rate_modifier")
|
||||
|
||||
func get_reputation_income():
|
||||
return get_modifier_value("reputation_income")
|
||||
|
||||
func _refresh_ui():
|
||||
item_unlocked.emit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue