Who knows what
This commit is contained in:
parent
0fe23420ab
commit
9214d13054
422 changed files with 1412 additions and 4783 deletions
|
|
@ -1,8 +1,24 @@
|
|||
class_name TickProcess
|
||||
extends Node
|
||||
|
||||
# Dependency injection - can be overridden for simulation
|
||||
var unlocks_provider: Node = null
|
||||
var inventory_provider: Node = null
|
||||
|
||||
func _ready():
|
||||
# Default to singletons if not explicitly set
|
||||
if unlocks_provider == null:
|
||||
unlocks_provider = Unlocks
|
||||
if inventory_provider == null:
|
||||
inventory_provider = Inventory
|
||||
|
||||
func set_providers(unlocks, inventory):
|
||||
"""Set custom providers for simulation (bypasses singletons)"""
|
||||
unlocks_provider = unlocks
|
||||
inventory_provider = inventory
|
||||
|
||||
func tick():
|
||||
Log.pr("Tick Process Ticking...")
|
||||
# Log.pr("Tick Process Ticking...")
|
||||
do_autowood()
|
||||
do_whittling()
|
||||
do_selling()
|
||||
|
|
@ -11,10 +27,10 @@ func do_autowood():
|
|||
# If the autowood unlock is unlocked then automatically gain wood based on the modifier
|
||||
var autowood_unlock = Unlocks.get_unlock_by_id(Global.autowood_unlock_id)
|
||||
if autowood_unlock and autowood_unlock.is_unlocked:
|
||||
Log.pr("Autowood modifier", str(Unlocks.get_modifier_value("autowood_modifier")))
|
||||
# Log.pr("Autowood modifier", str(Unlocks.get_modifier_value("autowood_modifier")))
|
||||
var wood_to_gather = max(Unlocks.get_wood_per_click() * Unlocks.get_modifier_value("autowood_modifier"), 1)
|
||||
Inventory.add_wood(wood_to_gather)
|
||||
Log.pr("Auto-gathered", str(wood_to_gather), "wood via autowood unlock.")
|
||||
# Log.pr("Auto-gathered", str(wood_to_gather), "wood via autowood unlock.")
|
||||
|
||||
func do_whittling():
|
||||
# If there's more than 1 whole wood available, then whittle based on the efficiency modifier
|
||||
|
|
@ -39,7 +55,7 @@ func do_selling():
|
|||
Inventory.spend_stock(Global.wholesale_bundle_size)
|
||||
var currency_earned = Global.wholesale_bundle_size * Unlocks.get_sale_price_per_item() * Global.wholesale_discount_multiplier
|
||||
Inventory.add_currency(currency_earned)
|
||||
Log.pr("Sold 100 whittled wood for", str(currency_earned), "currency via wholesale unlock.")
|
||||
# Log.pr("Sold 100 whittled wood for", str(currency_earned), "currency via wholesale unlock.")
|
||||
|
||||
|
||||
# If there's whittled wood available to sell, sell it for currency
|
||||
|
|
@ -61,7 +77,7 @@ func do_selling():
|
|||
func whittle_max_wood_possible():
|
||||
# Get the items that can be produced per tick
|
||||
var items_produced_per_tick = Unlocks.get_items_produced_per_tick()
|
||||
Log.pr("Items produced per tick:", str(items_produced_per_tick))
|
||||
# Log.pr("Items produced per tick:", str(items_produced_per_tick))
|
||||
var wood_needed = ceil(items_produced_per_tick)
|
||||
|
||||
# Whittle as much wood as possible this tick, up to the max allowed by efficiency
|
||||
|
|
@ -70,4 +86,4 @@ func whittle_max_wood_possible():
|
|||
|
||||
Inventory.spend_wood(wood_to_whittle)
|
||||
Inventory.add_stock(actual_items_produced)
|
||||
Log.pr("Whittled", str(wood_to_whittle), "wood into", str(actual_items_produced), "whittle wood.")
|
||||
# Log.pr("Whittled", str(wood_to_whittle), "wood into", str(actual_items_produced), "whittle wood.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue