Skip to content

Commit

Permalink
🐛 (fix) Wallstreet: economy model was not scalable
Browse files Browse the repository at this point in the history
  • Loading branch information
VForiel committed Jan 4, 2024
1 parent a82cc1c commit 4b8100d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 41 deletions.
10 changes: 5 additions & 5 deletions minigames/data/wallstreet/functions/config.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ scoreboard players set #wallstreet.villager.interaction_time data 440
scoreboard players set #wallstreet.model.starting_money data 5000
scoreboard players set #wallstreet.model.buy_power data 500

scoreboard players set #wallstreet.model.wood.global_stock data 1500
scoreboard players set #wallstreet.model.stone.global_stock data 1000
scoreboard players set #wallstreet.model.leather.global_stock data 525
scoreboard players set #wallstreet.model.iron.global_stock data 250
scoreboard players set #wallstreet.model.diamond.global_stock data 50
scoreboard players set #wallstreet.model.wood.ideal_stock data 300
scoreboard players set #wallstreet.model.stone.ideal_stock data 200
scoreboard players set #wallstreet.model.leather.ideal_stock data 100
scoreboard players set #wallstreet.model.iron.ideal_stock data 50
scoreboard players set #wallstreet.model.diamond.ideal_stock data 10
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@

# Variation of the global resource stock
scoreboard players operation #mean input = #wallstreet.model.wood.global_stock data
scoreboard players operation #std input = #wallstreet.model.wood.global_stock data
scoreboard players operation #mean input = #wallstreet.model.wood.ideal_stock data
scoreboard players operation #std input = #wallstreet.model.wood.ideal_stock data
scoreboard players operation #std input /= 10 const
function #lib:random_normal
scoreboard players operation #wallstreet.model.wood.global_stock data = #x output
scoreboard players operation #wallstreet.model.wood.ideal_stock data = #x output

scoreboard players operation #mean input = #wallstreet.model.stone.global_stock data
scoreboard players operation #std input = #wallstreet.model.stone.global_stock data
scoreboard players operation #mean input = #wallstreet.model.stone.ideal_stock data
scoreboard players operation #std input = #wallstreet.model.stone.ideal_stock data
scoreboard players operation #std input /= 10 const
function #lib:random_normal
scoreboard players operation #wallstreet.model.stone.global_stock data = #x output
scoreboard players operation #wallstreet.model.stone.ideal_stock data = #x output

scoreboard players operation #mean input = #wallstreet.model.leather.global_stock data
scoreboard players operation #std input = #wallstreet.model.leather.global_stock data
scoreboard players operation #mean input = #wallstreet.model.leather.ideal_stock data
scoreboard players operation #std input = #wallstreet.model.leather.ideal_stock data
scoreboard players operation #std input /= 10 const
function #lib:random_normal
scoreboard players operation #wallstreet.model.leather.global_stock data = #x output
scoreboard players operation #wallstreet.model.leather.ideal_stock data = #x output

scoreboard players operation #mean input = #wallstreet.model.iron.global_stock data
scoreboard players operation #std input = #wallstreet.model.iron.global_stock data
scoreboard players operation #mean input = #wallstreet.model.iron.ideal_stock data
scoreboard players operation #std input = #wallstreet.model.iron.ideal_stock data
scoreboard players operation #std input /= 10 const
function #lib:random_normal
scoreboard players operation #wallstreet.model.iron.global_stock data = #x output
scoreboard players operation #wallstreet.model.iron.ideal_stock data = #x output

scoreboard players operation #mean input = #wallstreet.model.diamond.global_stock data
scoreboard players operation #std input = #wallstreet.model.diamond.global_stock data
scoreboard players operation #mean input = #wallstreet.model.diamond.ideal_stock data
scoreboard players operation #std input = #wallstreet.model.diamond.ideal_stock data
scoreboard players operation #std input /= 10 const
function #lib:random_normal
scoreboard players operation #wallstreet.model.diamond.global_stock data = #x output
scoreboard players operation #wallstreet.model.diamond.ideal_stock data = #x output

# ---

scoreboard players operation #wallstreet.model.total_resource_stock data = #wallstreet.model.wood.global_stock data
scoreboard players operation #wallstreet.model.total_resource_stock data += #wallstreet.model.stone.global_stock data
scoreboard players operation #wallstreet.model.total_resource_stock data += #wallstreet.model.leather.global_stock data
scoreboard players operation #wallstreet.model.total_resource_stock data += #wallstreet.model.iron.global_stock data
scoreboard players operation #wallstreet.model.total_resource_stock data += #wallstreet.model.diamond.global_stock data

scoreboard players operation #wallstreet.model.wood.abundance_ratio(pcm) data = #wallstreet.model.wood.global_stock data
scoreboard players operation #wallstreet.model.stone.abundance_ratio(pcm) data = #wallstreet.model.stone.global_stock data
scoreboard players operation #wallstreet.model.leather.abundance_ratio(pcm) data = #wallstreet.model.leather.global_stock data
scoreboard players operation #wallstreet.model.iron.abundance_ratio(pcm) data = #wallstreet.model.iron.global_stock data
scoreboard players operation #wallstreet.model.diamond.abundance_ratio(pcm) data = #wallstreet.model.diamond.global_stock data
scoreboard players operation #wallstreet.model.total_resource_stock data = #wallstreet.model.wood.ideal_stock data
scoreboard players operation #wallstreet.model.total_resource_stock data += #wallstreet.model.stone.ideal_stock data
scoreboard players operation #wallstreet.model.total_resource_stock data += #wallstreet.model.leather.ideal_stock data
scoreboard players operation #wallstreet.model.total_resource_stock data += #wallstreet.model.iron.ideal_stock data
scoreboard players operation #wallstreet.model.total_resource_stock data += #wallstreet.model.diamond.ideal_stock data

scoreboard players operation #wallstreet.model.wood.abundance_ratio(pcm) data = #wallstreet.model.wood.ideal_stock data
scoreboard players operation #wallstreet.model.stone.abundance_ratio(pcm) data = #wallstreet.model.stone.ideal_stock data
scoreboard players operation #wallstreet.model.leather.abundance_ratio(pcm) data = #wallstreet.model.leather.ideal_stock data
scoreboard players operation #wallstreet.model.iron.abundance_ratio(pcm) data = #wallstreet.model.iron.ideal_stock data
scoreboard players operation #wallstreet.model.diamond.abundance_ratio(pcm) data = #wallstreet.model.diamond.ideal_stock data

scoreboard players operation #wallstreet.model.wood.abundance_ratio(pcm) data *= 1000 const
scoreboard players operation #wallstreet.model.stone.abundance_ratio(pcm) data *= 1000 const
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Executed as & at villager marker

# Wood
scoreboard players operation #mean input = #wallstreet.model.wood.global_stock data
scoreboard players operation #mean input /= #wallstreet.villager_count data
scoreboard players operation #mean input = #wallstreet.model.wood.ideal_stock data
scoreboard players operation #std input = #mean input
scoreboard players operation #std input /= 10 const
function #lib:random_normal
Expand All @@ -14,8 +13,7 @@ scoreboard players operation @s wallstreet.wood_current_stock = #x output
scoreboard players operation @s wallstreet.wood_current_stock < @s wallstreet.wood_max_stock

# Stone
scoreboard players operation #mean input = #wallstreet.model.stone.global_stock data
scoreboard players operation #mean input /= #wallstreet.villager_count data
scoreboard players operation #mean input = #wallstreet.model.stone.ideal_stock data
scoreboard players operation #std input = #mean input
scoreboard players operation #std input /= 10 const
function #lib:random_normal
Expand All @@ -26,8 +24,7 @@ function #lib:random_normal
scoreboard players operation @s wallstreet.stone_current_stock = #x output
scoreboard players operation @s wallstreet.stone_current_stock < @s wallstreet.stone_max_stock
# Leather
scoreboard players operation #mean input = #wallstreet.model.leather.global_stock data
scoreboard players operation #mean input /= #wallstreet.villager_count data
scoreboard players operation #mean input = #wallstreet.model.leather.ideal_stock data
scoreboard players operation #std input = #mean input
scoreboard players operation #std input /= 10 const
function #lib:random_normal
Expand All @@ -39,8 +36,7 @@ scoreboard players operation @s wallstreet.leather_current_stock = #x output
scoreboard players operation @s wallstreet.leather_current_stock < @s wallstreet.leather_max_stock

# Iron
scoreboard players operation #mean input = #wallstreet.model.iron.global_stock data
scoreboard players operation #mean input /= #wallstreet.villager_count data
scoreboard players operation #mean input = #wallstreet.model.iron.ideal_stock data
scoreboard players operation #std input = #mean input
scoreboard players operation #std input /= 10 const
function #lib:random_normal
Expand All @@ -52,8 +48,7 @@ scoreboard players operation @s wallstreet.iron_current_stock = #x output
scoreboard players operation @s wallstreet.iron_current_stock < @s wallstreet.iron_max_stock

# Diamond
scoreboard players operation #mean input = #wallstreet.model.diamond.global_stock data
scoreboard players operation #mean input /= #wallstreet.villager_count data
scoreboard players operation #mean input = #wallstreet.model.diamond.ideal_stock data
scoreboard players operation #std input = #mean input
scoreboard players operation #std input /= 10 const
function #lib:random_normal
Expand Down

0 comments on commit 4b8100d

Please sign in to comment.