From 4b8100d8d384f008946ec0388ef368a673a6a2ea Mon Sep 17 00:00:00 2001 From: Vincent Foriel Date: Thu, 4 Jan 2024 14:16:08 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(fix)=20Wallstreet:=20economy=20?= =?UTF-8?q?model=20was=20not=20scalable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wallstreet/functions/config.mcfunction | 10 ++-- .../economy_model/get_global_data.mcfunction | 52 +++++++++---------- .../initial_resources_supply.mcfunction | 15 ++---- 3 files changed, 36 insertions(+), 41 deletions(-) diff --git a/minigames/data/wallstreet/functions/config.mcfunction b/minigames/data/wallstreet/functions/config.mcfunction index d4a940a..6613ab9 100644 --- a/minigames/data/wallstreet/functions/config.mcfunction +++ b/minigames/data/wallstreet/functions/config.mcfunction @@ -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 \ No newline at end of file +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 \ No newline at end of file diff --git a/minigames/data/wallstreet/functions/economy_model/get_global_data.mcfunction b/minigames/data/wallstreet/functions/economy_model/get_global_data.mcfunction index 6fc327d..f1a1cac 100644 --- a/minigames/data/wallstreet/functions/economy_model/get_global_data.mcfunction +++ b/minigames/data/wallstreet/functions/economy_model/get_global_data.mcfunction @@ -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 diff --git a/minigames/data/wallstreet/functions/economy_model/initial_resources_supply.mcfunction b/minigames/data/wallstreet/functions/economy_model/initial_resources_supply.mcfunction index 40956ef..4c41670 100644 --- a/minigames/data/wallstreet/functions/economy_model/initial_resources_supply.mcfunction +++ b/minigames/data/wallstreet/functions/economy_model/initial_resources_supply.mcfunction @@ -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 @@ -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 @@ -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 @@ -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 @@ -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