Skip to content

Commit

Permalink
Add custom speed modifier to Painted concrete - Fixes jpanther#91
Browse files Browse the repository at this point in the history
  • Loading branch information
jpanther committed Mar 19, 2019
1 parent 3861bd1 commit 56aa735
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Version: 0.9.8
Date: 19. 03. 2019
Added:
- Lawnmower can now be used to remove corpses by invoking alternate selection mode (by default, by holding down SHIFT key when selecting an area)
- New setting to adjust walking and vehicle speeds of Painted concrete by a custom amount, allowing concrete to be used as a safety barrier around hazards (by default, this option is off)
---------------------------------------------------------------------------------------------------
Version: 0.9.7
Date: 14. 03. 2019
Expand Down
1 change: 1 addition & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ DECT.ITEM_GROUP = DECT.ENABLED["item-group"] and "dectorio" or "logistics"
DECT.CONFIG.SETTINGS = {
["decorative_removal_probability"] = settings.startup["dectorio-decorative-removal-probability"].value,
["vanilla_hazard_concrete"] = settings.startup["dectorio-vanilla-hazard-concrete-style"].value,
["painted_concrete_speed_modifier"] = settings.startup["dectorio-painted-concrete-speed-modifier"].value,
["landscaping_blueprintable"] = settings.startup["dectorio-landscaping-blueprintable"].value,
["flooring_stack_size"] = settings.startup["dectorio-flooring-stack-size"].value,
["landscaping_stack_size"] = settings.startup["dectorio-landscaping-stack-size"].value,
Expand Down
2 changes: 2 additions & 0 deletions locale/en/dectorio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dectorio-decoratives=Enable Decoratives
dectorio-item-group=Separate Crafting Tab
dectorio-vanilla-hazard-concrete-style=Use default Factorio Hazard concrete style
dectorio-landscaping-blueprintable=Landscaping items are blueprintable
dectorio-painted-concrete-speed-modifier=Painted concrete speed modifier
dectorio-decorative-removal-probability=Decoration removal probability
dectorio-flooring-stack-size=Flooring items stack size
dectorio-landscaping-stack-size=Landscaping items stack size
Expand All @@ -35,6 +36,7 @@ dectorio-decoratives=Enables the ability to craft decorative items for your fact
dectorio-item-group=Moves all decorative items into a dedicated crafting tab in the inventory
dectorio-vanilla-hazard-concrete-style=When enabled, Painted Hazard concrete will look like the default Factorio Hazard concrete when placed (requires Painted Concrete to be enabled)
dectorio-landscaping-blueprintable=When enabled, blueprints will include landscaping features as tiles
dectorio-painted-concrete-speed-modifier=Modifies the default walking and vehicle speed for Painted concrete by this amount (1 = no change to speed (default), 0.75 = 75% of default speed, 0.5 = 50% of default speed)
dectorio-decorative-removal-probability=The probability that decorations, such as bushes and grasses, are removed when flooring tiles are placed (1 = 100% are removed (default), 0.5 = 50%, 0 = none are removed)
dectorio-flooring-stack-size=The number of flooring items that can be stacked in one inventory slot (default = 500)
dectorio-landscaping-stack-size=The number of landscaping items that can be stacked in one inventory slot (default = 500)
Expand Down
20 changes: 16 additions & 4 deletions prototypes/tile/tiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ end

if DECT.ENABLED["painted-concrete"] then

local set_modifier = DECT.CONFIG.SETTINGS["painted_concrete_speed_modifier"]

local directions = {
{this="left", next="right"},
{this="right", next="left"}
Expand All @@ -215,14 +217,14 @@ if DECT.ENABLED["painted-concrete"] then
minable = { hardness = 0.2, mining_time = 0.5, result = "dect-paint-"..variant.name },
mined_sound = base_concrete.mined_sound,
collision_mask = { "ground-tile" },
walking_speed_modifier = base_concrete.walking_speed_modifier,
walking_speed_modifier = base_concrete.walking_speed_modifier * set_modifier,
layer = tile_layer.paint,
decorative_removal_probability = decorative_removal_probability,
variants = tile_variants_material("concrete", variant.name.."-"..direction.this),
walking_sound = base_concrete.walking_sound,
map_color = variant.color,
ageing = 0,
vehicle_friction_modifier = base_concrete.vehicle_friction_modifier
vehicle_friction_modifier = base_concrete.vehicle_friction_modifier * set_modifier
}
})

Expand All @@ -237,19 +239,29 @@ if DECT.ENABLED["painted-concrete"] then
minable = { hardness = 0.2, mining_time = 0.5, result = "dect-paint-refined-"..variant.name },
mined_sound = base_refined_concrete.mined_sound,
collision_mask = { "ground-tile" },
walking_speed_modifier = base_refined_concrete.walking_speed_modifier,
walking_speed_modifier = base_refined_concrete.walking_speed_modifier * set_modifier,
layer = tile_layer.refined_paint,
decorative_removal_probability = decorative_removal_probability,
variants = tile_variants_material("refined-concrete", variant.name.."-"..direction.this),
walking_sound = base_refined_concrete.walking_sound,
map_color = variant.color,
ageing = 0,
vehicle_friction_modifier = base_refined_concrete.vehicle_friction_modifier
vehicle_friction_modifier = base_refined_concrete.vehicle_friction_modifier * set_modifier
}
})
end
end

-- Adjust walking speeds on base hazard tiles
base_hazard_left.walking_speed_modifier = base_concrete.walking_speed_modifier * set_modifier
base_hazard_left.vehicle_friction_modifier = base_concrete.vehicle_friction_modifier * set_modifier
base_hazard_right.walking_speed_modifier = base_concrete.walking_speed_modifier * set_modifier
base_hazard_right.vehicle_friction_modifier = base_concrete.vehicle_friction_modifier * set_modifier
base_refined_hazard_left.walking_speed_modifier = base_refined_concrete.walking_speed_modifier * set_modifier
base_refined_hazard_left.vehicle_friction_modifier = base_refined_concrete.vehicle_friction_modifier * set_modifier
base_refined_hazard_right.walking_speed_modifier = base_refined_concrete.walking_speed_modifier * set_modifier
base_refined_hazard_right.vehicle_friction_modifier = base_refined_concrete.vehicle_friction_modifier * set_modifier

-- Move all the base concretes up a layer so it sits atop stone path
base_concrete.layer = tile_layer.concrete
base_hazard_left.layer = tile_layer.paint
Expand Down
9 changes: 9 additions & 0 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ data:extend({
default_value = false,
order = "c-b"
},
{
type = "double-setting",
name = "dectorio-painted-concrete-speed-modifier",
setting_type = "startup",
default_value = 1,
minimum_value = 0.1,
maximum_value = 1,
order = "c-c"
},
{
type = "double-setting",
name = "dectorio-decorative-removal-probability",
Expand Down

0 comments on commit 56aa735

Please sign in to comment.