Skip to content

Commit

Permalink
Add upgrade tab
Browse files Browse the repository at this point in the history
  • Loading branch information
NewfolderGames committed May 28, 2021
1 parent 4326bd0 commit fc54b10
Show file tree
Hide file tree
Showing 22 changed files with 670 additions and 66 deletions.
17 changes: 17 additions & 0 deletions src/assets/building.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ pub fn load(stuff_manager: &mut StuffManager) {
1.15f64
));

stuff_manager.load_building(BuildingAsset::new(
"building_workbench",
"mana",
Box::new(|_, _| {
vec![
("modifier_resource_knowledge_capacity_base", 10f64),
]
}),
Box::new(|_, _| {
vec![
("resource_stone", 25f64),
("resource_wood", 25f64),
]
}),
1.15f64
));

// Housing.

stuff_manager.load_building(BuildingAsset::new(
Expand Down
1 change: 1 addition & 0 deletions src/assets/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub fn load(stuff_manager: &mut StuffManager) {
stuff_manager.load_feature(FeatureAsset::new("feature_tab_lighthouse"));
stuff_manager.load_feature(FeatureAsset::new("feature_tab_stats"));
stuff_manager.load_feature(FeatureAsset::new("feature_tab_technology"));
stuff_manager.load_feature(FeatureAsset::new("feature_tab_upgrade"));

stuff_manager.load_feature(FeatureAsset::new("feature_lighthouse_examine"));
stuff_manager.load_feature(FeatureAsset::new("feature_lighthouse_gather"));
Expand Down
16 changes: 11 additions & 5 deletions src/assets/modifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,46 @@ pub fn load(stuff_manager: &mut StuffManager) {
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_copper_consumption_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_copper_capacity_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_copper_capacity_multiplier"));

stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_food_production_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_food_production_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_food_consumption_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_food_consumption_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_food_capacity_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_food_capacity_multiplier"));

stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_iron_production_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_iron_production_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_iron_consumption_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_iron_consumption_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_iron_capacity_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_iron_capacity_multiplier"));

stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_knowledge_production_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_knowledge_production_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_knowledge_consumption_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_knowledge_consumption_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_knowledge_capacity_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_knowledge_capacity_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_science_production_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_science_production_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_science_consumption_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_science_consumption_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_science_capacity_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_science_capacity_multiplier"));

stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_stone_production_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_stone_production_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_stone_consumption_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_stone_consumption_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_stone_capacity_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_stone_capacity_multiplier"));

stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_wood_production_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_wood_production_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_wood_consumption_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_wood_consumption_multiplier"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_wood_capacity_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_resource_wood_capacity_multiplier"));

// Lighthouse

stuff_manager.load_modifier(ModifierAsset::new("modifier_lighthouse_examine_base"));
stuff_manager.load_modifier(ModifierAsset::new("modifier_lighthouse_gather_base"));

}
11 changes: 11 additions & 0 deletions src/assets/technology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ pub fn load(stuff_manager: &mut StuffManager) {
})
));

stuff_manager.load_technology(TechnologyAsset::new(
"technology_workbench",
Box::new(|_| {
vec![
("resource_science", 45f64),
("resource_stone", 20f64),
("resource_wood", 20f64),
]
})
));

stuff_manager.load_technology(TechnologyAsset::new(
"technology_woodworking",
Box::new(|_| {
Expand Down
36 changes: 29 additions & 7 deletions src/assets/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ pub fn load(stuff_manager: &mut StuffManager) {
stuff_manager.load_text(TextAsset::new("building_hut_title", "Hut"));
stuff_manager.load_text(TextAsset::new("building_researchBench_title", "Research Bench"));
stuff_manager.load_text(TextAsset::new("building_stockpile_title", "Stockpile"));
stuff_manager.load_text(TextAsset::new("building_workbench_title", "Workbench"));

stuff_manager.load_text(TextAsset::new("building_hut_description", "A small hut that can house one person."));
stuff_manager.load_text(TextAsset::new("building_garden_description", "A tiny garden that uses lighthouse to grow some food."));
stuff_manager.load_text(TextAsset::new("building_researchBench_description", "A simple bench where you can store papers."));
stuff_manager.load_text(TextAsset::new("building_stockpile_description", "An area where you can put all sorts of stuffs."));
stuff_manager.load_text(TextAsset::new("building_workbench_description", "A simple bench where you can experiment."));

// Feature

Expand All @@ -29,6 +31,7 @@ pub fn load(stuff_manager: &mut StuffManager) {
stuff_manager.load_text(TextAsset::new("feature_tab_lighthouse", "Lighthouse tab"));
stuff_manager.load_text(TextAsset::new("feature_tab_stats", "Stats tab"));
stuff_manager.load_text(TextAsset::new("feature_tab_technology", "Technology tab"));
stuff_manager.load_text(TextAsset::new("feature_tab_upgrade", "Upgrade tab"));

// Log.

Expand All @@ -43,50 +46,53 @@ pub fn load(stuff_manager: &mut StuffManager) {
stuff_manager.load_text(TextAsset::new("log_tab_lighthouse_examine_3", "You have studied the lighthouse."));
stuff_manager.load_text(TextAsset::new("log_tab_lighthouse_gather_0", "You have gathered scraps lying around."));
stuff_manager.load_text(TextAsset::new("log_tab_lighthouse_gather_1", "You should build something with it."));

// Modifiers.

stuff_manager.load_text(TextAsset::new("modifier_lighthouse_examine_base", "Lighthouse examining base"));
stuff_manager.load_text(TextAsset::new("modifier_lighthouse_gather_base", "Lighthouse scrap gathering base"));

stuff_manager.load_text(TextAsset::new("modifier_resource_category_rawMaterial_capacity_base", "Raw material capacity base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_category_rawMaterial_capacity_multiplier", "Raw material capacity multiplier"));

stuff_manager.load_text(TextAsset::new("modifier_resource_category_mana_capacity_base", "Mana capacity base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_category_mana_capacity_multiplier", "Mana capacity multiplier"));

stuff_manager.load_text(TextAsset::new("modifier_resource_copper_production_base", "Copper production base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_copper_production_multiplier", "Copper production multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_copper_consumption_base", "Copper consumption base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_copper_consumption_multiplier", "Copper consumption multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_copper_capacity_base", "Copper capacity base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_copper_capacity_multiplier", "Copper capacity multiplier"));

stuff_manager.load_text(TextAsset::new("modifier_resource_food_production_base", "Food production base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_food_production_multiplier", "Food production multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_food_consumption_base", "Food consumption base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_food_consumption_multiplier", "Food consumption multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_food_capacity_base", "Food capacity base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_food_capacity_multiplier", "Food capacity multiplier"));

stuff_manager.load_text(TextAsset::new("modifier_resource_iron_production_base", "Iron production base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_iron_production_multiplier", "Iron production multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_iron_consumption_base", "Iron consumption base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_iron_consumption_multiplier", "Iron consumption multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_iron_capacity_base", "Iron capacity base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_iron_capacity_multiplier", "Iron capacity multiplier"));

stuff_manager.load_text(TextAsset::new("modifier_resource_knowledge_production_base", "Knowledge production base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_knowledge_production_multiplier", "Knowledge production multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_knowledge_consumption_base", "Knowledge consumption base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_knowledge_consumption_multiplier", "Knowledge consumption multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_knowledge_capacity_base", "Knowledge capacity base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_knowledge_capacity_multiplier", "Knowledge capacity multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_science_production_base", "Science production base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_science_production_multiplier", "Science production multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_science_consumption_base", "Science consumption base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_science_consumption_multiplier", "Science consumption multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_science_capacity_base", "Science capacity base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_science_capacity_multiplier", "Science capacity multiplier"));

stuff_manager.load_text(TextAsset::new("modifier_resource_stone_production_base", "Stone production base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_stone_production_multiplier", "Stone production multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_stone_consumption_base", "Stone consumption base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_stone_consumption_multiplier", "Stone consumption multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_stone_capacity_base", "Stone capacity base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_stone_capacity_multiplier", "Stone capacity multiplier"));

stuff_manager.load_text(TextAsset::new("modifier_resource_wood_production_base", "Wood production base"));
stuff_manager.load_text(TextAsset::new("modifier_resource_wood_production_multiplier", "Wood production multiplier"));
stuff_manager.load_text(TextAsset::new("modifier_resource_wood_consumption_base", "Wood consumption base"));
Expand Down Expand Up @@ -129,12 +135,26 @@ pub fn load(stuff_manager: &mut StuffManager) {
stuff_manager.load_text(TextAsset::new("technology_lighthouse_title", "Lighthouse"));
stuff_manager.load_text(TextAsset::new("technology_mining_title", "Mining"));
stuff_manager.load_text(TextAsset::new("technology_woodworking_title", "Woodworking"));
stuff_manager.load_text(TextAsset::new("technology_workbench_title", "Workbench"));

stuff_manager.load_text(TextAsset::new("technology_agriculture_description", "Develops a way to grow platns using the lighthouse."));
stuff_manager.load_text(TextAsset::new("technology_hut_description", "Allows constuction of hut to shelter people."));
stuff_manager.load_text(TextAsset::new("technology_lighthouse_description", "A structure that keeps the void away."));
stuff_manager.load_text(TextAsset::new("technology_mining_description", "Extracts minerals from the earth."));
stuff_manager.load_text(TextAsset::new("technology_woodworking_description", "Crafts various tools from wood."));
stuff_manager.load_text(TextAsset::new("technology_workbench_description", "Enables upgrades."));

// Upgrade.

stuff_manager.load_text(TextAsset::new("upgrade_lighthouse_examine_title", "Knowledge gathering"));
stuff_manager.load_text(TextAsset::new("upgrade_lighthouse_gather_title", "Efficient gathering"));
stuff_manager.load_text(TextAsset::new("upgrade_tool_axe_wood_title", "Wooden axe"));
stuff_manager.load_text(TextAsset::new("upgrade_tool_pickaxe_wood_title", "Wooden pickaxe"));

stuff_manager.load_text(TextAsset::new("upgrade_lighthouse_examine_description", "Gains knowledge and extra science from examining the lighthouse."));
stuff_manager.load_text(TextAsset::new("upgrade_lighthouse_gather_description", "Gains more stuffs from gathering scraps."));
stuff_manager.load_text(TextAsset::new("upgrade_tool_axe_wood_description", "Increases wood production by +10%."));
stuff_manager.load_text(TextAsset::new("upgrade_tool_pickaxe_wood_description", "Increases stone production by +10%."));

// UI.

Expand All @@ -149,4 +169,6 @@ pub fn load(stuff_manager: &mut StuffManager) {

stuff_manager.load_text(TextAsset::new("ui_tab_technology", "Technology"));

stuff_manager.load_text(TextAsset::new("ui_tab_upgrade", "Upgrade"));

}
12 changes: 8 additions & 4 deletions src/assets/unlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ pub fn load(stuff_manager: &mut StuffManager) {
Unlockable::Building("building_researchBench"),
Unlockable::Building("building_stockpile"),
Unlockable::Technology("technology_agriculture"),
Unlockable::Technology("technology_hut"),
]
));

Expand All @@ -45,22 +44,27 @@ pub fn load(stuff_manager: &mut StuffManager) {
vec![
Unlockable::Building("building_garden"),
Unlockable::Resource("resource_food"),
Unlockable::Technology("technology_workbench"),
Unlockable::Technology("technology_woodworking"),
Unlockable::Technology("technology_mining"),
]
));

stuff_manager.load_unlock(UnlockAsset::new(
"unlock_technology_hut",
"unlock_technology_workbench",
vec![
Unlockable::Building("building_hut"),
Unlockable::Building("building_workbench"),
Unlockable::Feature("feature_tab_upgrade"),
Unlockable::Resource("resource_knowledge"),
Unlockable::Upgrade("upgrade_lighthouse_examine"),
Unlockable::Upgrade("upgrade_lighthouse_gather"),
]
));

stuff_manager.load_unlock(UnlockAsset::new(
"unlock_technology_mining",
vec![
Unlockable::Technology("technology_copper"),
Unlockable::Technology("technology_smelting"),
Unlockable::Technology("technology_stoneCutting"),
]
));
Expand Down
41 changes: 35 additions & 6 deletions src/assets/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,45 @@ pub fn load(stuff_manager: &mut StuffManager) {
// ONLY VALUES SHOULD BE CHANGED.

stuff_manager.load_upgrade(UpgradeAsset::new(
"upgrade_tool_pickaxe_wood",
"upgrade_lighthouse_examine",
Box::new(|_| {
vec![
("modifier_lighthouse_examine_base", 1f64)
]
}),
Box::new(|_| {
vec![
("resource_science", 50f64),
]
})
));

stuff_manager.load_upgrade(UpgradeAsset::new(
"upgrade_lighthouse_gather",
Box::new(|_| {
vec![
("modifier_lighthouse_gather_base", 1f64)
]
}),
Box::new(|_| {
vec![
("resource_knowledge", 10f64),
("resource_wood", 50f64),
]
})
));

stuff_manager.load_upgrade(UpgradeAsset::new(
"upgrade_tool_pickaxe_wood",
Box::new(|_| {
vec![
("modifier_resource_stone_production_multiplier", 0.1)
]
}),
Box::new(|_| {
vec![
("resource_stone_production_multiplier", 0.1)
("resource_knowledge", 50f64),
("resource_wood", 50f64),
]
})
));
Expand All @@ -24,13 +53,13 @@ pub fn load(stuff_manager: &mut StuffManager) {
"upgrade_tool_axe_wood",
Box::new(|_| {
vec![
("resource_knowledge", 10f64),
("resource_wood", 50f64),
("modifier_resource_wood_production_multiplier", 0.1)
]
}),
Box::new(|_| {
Box::new(|_| {
vec![
("resource_wood_production_multiplier", 0.1)
("resource_knowledge", 50f64),
("resource_wood", 50f64),
]
})
));
Expand Down
Loading

0 comments on commit fc54b10

Please sign in to comment.