Skip to content

Commit

Permalink
fix recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriopass committed Jan 19, 2024
1 parent c6c0773 commit 932a02c
Show file tree
Hide file tree
Showing 20 changed files with 145 additions and 120 deletions.
54 changes: 27 additions & 27 deletions base_mod/companies.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:extend {
recipe = {
consumption = {{"flour", 1}},
production = {{"bread", 1}},
complexity = "100s",
duration = "100m",
storage_multiplier = 5,
},
n_workers = 3,
Expand All @@ -35,7 +35,7 @@ data:extend {
recipe = {
consumption = {{"cereal", 1}},
production = {{"flour", 10}},
complexity = 200,
duration = "200m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -55,7 +55,7 @@ data:extend {
recipe = {
consumption = {},
production = {{"cereal", 1}},
complexity = 40,
duration = "40m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -74,7 +74,7 @@ data:extend {
type = "solar-panel",
order = "b-1",
name = "solar-panel",
label = "Solar Panels",
label = "Solar Panelm",
max_power = "1kW",
bgen = {
kind = "centered_door",
Expand Down Expand Up @@ -105,7 +105,7 @@ data:extend {
recipe = {
consumption = {{"coal", 1}},
production = {},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -127,7 +127,7 @@ data:extend {
recipe = {
consumption = {{"meat", 1}, {"vegetable", 1}, {"cereal", 1}},
production = {},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -149,7 +149,7 @@ data:extend {
recipe = {
consumption = {{"cloth", 1}},
production = {},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -172,7 +172,7 @@ data:extend {
recipe = {
consumption = {{"polyester", 1}, {"wool", 1}},
production = {{"cloth", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -195,7 +195,7 @@ data:extend {
recipe = {
consumption = {{"wool", 1}},
production = {{"cloth", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -218,7 +218,7 @@ data:extend {
recipe = {
consumption = {{"oil", 1}},
production = {{"polyester", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 5,
Expand All @@ -241,7 +241,7 @@ data:extend {
recipe = {
consumption = {},
production = {{"oil", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 5,
Expand All @@ -264,7 +264,7 @@ data:extend {
recipe = {
consumption = {},
production = {{"coal", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 5,
Expand All @@ -286,7 +286,7 @@ data:extend {
recipe = {
consumption = {},
production = {{"wool", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -308,7 +308,7 @@ data:extend {
recipe = {
consumption = {{"flower", 1}},
production = {},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -331,7 +331,7 @@ data:extend {
recipe = {
consumption = {},
production = {{"flower", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 5,
Expand All @@ -353,7 +353,7 @@ data:extend {
recipe = {
consumption = {{"high-tech-product", 1}},
production = {},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -376,7 +376,7 @@ data:extend {
recipe = {
consumption = {{"gold", 1}, {"metal", 1}},
production = {{"high-tech-product", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -399,7 +399,7 @@ data:extend {
recipe = {
consumption = {},
production = {{"iron-ore", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -422,7 +422,7 @@ data:extend {
recipe = {
consumption = {},
production = {{"gold", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -442,7 +442,7 @@ data:extend {
recipe = {
consumption = {},
production = {{"tree-log", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -465,7 +465,7 @@ data:extend {
recipe = {
consumption = {{"tree-log", 1}},
production = {{"wood-plank", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -487,7 +487,7 @@ data:extend {
recipe = {
consumption = {{"metal", 1}, {"wood-plank", 1}},
production = {{"furniture", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -510,7 +510,7 @@ data:extend {
recipe = {
consumption = {{"iron-ore", 1}},
production = {{"metal", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -533,7 +533,7 @@ data:extend {
recipe = {
consumption = {{"carcass", 1}},
production = {{"raw-meat", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 5,
Expand All @@ -553,7 +553,7 @@ data:extend {
recipe = {
consumption = {{"cereal", 1}},
production = {{"carcass", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 5,
Expand All @@ -576,7 +576,7 @@ data:extend {
recipe = {
consumption = {{"raw-meat", 1}},
production = {{"meat", 1}},
complexity = 100,
duration = "100m",
storage_multiplier = 5,
},
n_workers = 10,
Expand All @@ -596,7 +596,7 @@ data:extend {
recipe = {
consumption = {},
production = {{"vegetable", 2}},
complexity = 2,
duration = "2m",
storage_multiplier = 5,
},
n_workers = 10,
Expand Down
2 changes: 0 additions & 2 deletions geom/src/heightmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,6 @@ mod erosion {
let mut sediment = 0.0;

for _ in 0..MAX_DROPLET_LIFETIME {
//dbg!((pos, dir, speed, water, sediment,));
//unsafe {
// let size = 10.0 * (MAX_DROPLET_LIFETIME as f32 - i as f32)
// / MAX_DROPLET_LIFETIME as f32;
Expand Down Expand Up @@ -790,7 +789,6 @@ mod erosion {
{ *v -= delta_sediment * Self::CELL_SIZE }


//dbg!(delta_sediment, weighed_erode_amount, amount_to_erode);
sediment += delta_sediment;
}
}
Expand Down
12 changes: 6 additions & 6 deletions native_app/src/gui/inspect/inspect_building.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use egui::{Context, Ui, Widget};

use egui_inspect::{Inspect, InspectArgs, InspectVec2Rotation};
use prototypes::{ItemID, Power, Recipe};
use prototypes::{ItemID, Recipe};
use simulation::economy::Market;
use simulation::map::{Building, BuildingID, BuildingKind, Zone, MAX_ZONE_AREA};
use simulation::map_dynamic::{BuildingInfos, ElectricityFlow};
Expand Down Expand Up @@ -172,21 +172,21 @@ fn render_goodscompany(ui: &mut Ui, uiworld: &mut UiWorld, sim: &Simulation, b:
if let Some(net_id) = map.electricity.net_id(b.id) {
let elec_productivity = elec_flow.productivity(net_id);

if proto.power_consumption > Power::ZERO {
if let Some(power_c) = proto.power_consumption {
egui::ProgressBar::new(productivity * elec_productivity)
.text(format!(
"power: {}/{}",
(productivity * elec_productivity) as f64 * proto.power_consumption,
proto.power_consumption
(productivity * elec_productivity) as f64 * power_c,
power_c
))
.desired_width(200.0)
.ui(ui);
}

if proto.power_production > Power::ZERO {
if let Some(power_prod) = proto.power_production {
ui.label(format!(
"producing power: {}",
proto.power_production * productivity as f64
power_prod * productivity as f64
));

let stats = elec_flow.network_stats(net_id);
Expand Down
48 changes: 24 additions & 24 deletions native_app/src/gui/topgui.rs
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
use crate::gui::bulldozer::BulldozerState;
use crate::gui::chat::chat;
use crate::gui::inspect::inspector;
use crate::gui::lotbrush::LotBrushResource;
use crate::gui::roadeditor::RoadEditorResource;
use crate::gui::specialbuilding::{SpecialBuildKind, SpecialBuildingResource};
use crate::gui::terraforming::TerraformingResource;
use crate::gui::windows::settings::Settings;
use crate::gui::windows::GUIWindows;
use crate::gui::{ErrorTooltip, PotentialCommands, RoadBuildResource, Tool, UiTextures};
use crate::inputmap::{InputAction, InputMap};
use crate::uiworld::{SaveLoadState, UiWorld};
use common::saveload::Encoder;
use std::sync::atomic::Ordering;
use std::time::{Duration, Instant};

use egui::load::SizedTexture;
use egui::{
Align2, Color32, Context, Frame, Id, LayerId, Response, RichText, Rounding, Stroke, Style, Ui,
Widget, Window,
};
use serde::{Deserialize, Serialize};

use common::saveload::Encoder;
use egui_inspect::{Inspect, InspectArgs};
use geom::{Polygon, Vec2};
use prototypes::{
prototypes_iter, BuildingGen, FreightStationPrototype, GameTime, GoodsCompanyPrototype, ItemID,
Money, Power,
Money,
};
use serde::{Deserialize, Serialize};
use simulation::economy::Government;
use simulation::map::{
BuildingKind, LanePatternBuilder, LightPolicy, MapProject, TerraformKind, TurnPolicy, Zone,
};
use simulation::world_command::WorldCommand;
use simulation::Simulation;
use std::sync::atomic::Ordering;
use std::time::{Duration, Instant};

use crate::gui::bulldozer::BulldozerState;
use crate::gui::chat::chat;
use crate::gui::inspect::inspector;
use crate::gui::lotbrush::LotBrushResource;
use crate::gui::roadeditor::RoadEditorResource;
use crate::gui::specialbuilding::{SpecialBuildKind, SpecialBuildingResource};
use crate::gui::terraforming::TerraformingResource;
use crate::gui::windows::settings::Settings;
use crate::gui::windows::GUIWindows;
use crate::gui::{ErrorTooltip, PotentialCommands, RoadBuildResource, Tool, UiTextures};
use crate::inputmap::{InputAction, InputMap};
use crate::uiworld::{SaveLoadState, UiWorld};

#[derive(Serialize, Deserialize)]
#[serde(default)]
Expand Down Expand Up @@ -644,16 +647,13 @@ impl Gui {
));
}

if descr.power_consumption > Power::ZERO {
if let Some(p) = descr.power_consumption {
ui.add_space(10.0);
ui.label(format!("Power: {}", descr.power_consumption));
ui.label(format!("Power: {}", p));
}
if descr.power_production > Power::ZERO {
if let Some(p) = descr.power_production {
ui.add_space(10.0);
ui.label(format!(
"Power production: {}",
descr.power_production
));
ui.label(format!("Power production: {}", p));
}
});
}
Expand Down
Loading

0 comments on commit 932a02c

Please sign in to comment.