From 8786ce9f003483d4664881ab964e8aa745e12a70 Mon Sep 17 00:00:00 2001 From: David Skrundz Date: Sat, 16 Jan 2021 15:18:36 -0700 Subject: [PATCH] Lua formatting --- .vscode/.lua-format | 26 +++++++++++++++++++ .vscode/settings.json | 3 ++- prototypes/constructors.lua | 4 +-- .../{ => EntityWithHealth}/SpiderLeg.lua | 6 ++--- .../Vehicle}/SpiderVehicle.lua | 10 +++---- 5 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 .vscode/.lua-format rename prototypes/constructors/Entity/{ => EntityWithHealth}/SpiderLeg.lua (79%) rename prototypes/constructors/Entity/{ => EntityWithHealth/Vehicle}/SpiderVehicle.lua (100%) diff --git a/.vscode/.lua-format b/.vscode/.lua-format new file mode 100644 index 0000000..6f82cce --- /dev/null +++ b/.vscode/.lua-format @@ -0,0 +1,26 @@ +column_limit: 100 +indent_width: 2 +use_tab: false +tab_width: 4 +continuation_indent_width: 4 +spaces_before_call: 1 +keep_simple_control_block_one_line: false +keep_simple_function_one_line: false +align_args: true +break_after_functioncall_lp: true +break_before_functioncall_rp: true +align_parameter: true +chop_down_parameter: true +break_after_functiondef_lp: true +break_before_functiondef_rp: true +align_table_field: true +break_after_table_lb: true +break_before_table_rb: true +chop_down_table: true +chop_down_kv_table: true +table_sep: "," +column_table_limit: column_limit +extra_sep_at_table_end: true +break_after_operator: true +double_quote_to_single_quote: false +single_quote_to_double_quote: false diff --git a/.vscode/settings.json b/.vscode/settings.json index 6c2c830..3a7a685 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,6 @@ "editor.detectIndentation": false, "editor.tabSize": 2, "editor.insertSpaces": true, - } + }, + "vscode-lua-format.configPath": ".vscode/.lua-format" } diff --git a/prototypes/constructors.lua b/prototypes/constructors.lua index 1d6af57..4271285 100644 --- a/prototypes/constructors.lua +++ b/prototypes/constructors.lua @@ -40,8 +40,6 @@ require("prototypes.constructors.Entity.RocketSiloRocket") require("prototypes.constructors.Entity.RocketSiloRocketShadow") require("prototypes.constructors.Entity.Smoke") require("prototypes.constructors.Entity.SpeechBubble") -require("prototypes.constructors.Entity.SpiderLeg") -require("prototypes.constructors.Entity.SpiderVehicle") require("prototypes.constructors.Entity.Sticker") require("prototypes.constructors.Entity.TileGhost") require("prototypes.constructors.Entity.Corpse.RailRemnants") @@ -86,6 +84,7 @@ require("prototypes.constructors.Entity.EntityWithHealth.SimpleEntity") require("prototypes.constructors.Entity.EntityWithHealth.SimpleEntityWithForce") require("prototypes.constructors.Entity.EntityWithHealth.SimpleEntityWithOwner") require("prototypes.constructors.Entity.EntityWithHealth.SolarPanel") +require("prototypes.constructors.Entity.EntityWithHealth.SpiderLeg") require("prototypes.constructors.Entity.EntityWithHealth.StorageTank") require("prototypes.constructors.Entity.EntityWithHealth.TrainStop") require("prototypes.constructors.Entity.EntityWithHealth.TransportBeltConnectable") @@ -120,6 +119,7 @@ require("prototypes.constructors.Entity.EntityWithHealth.Turret.ElectricTurret") require("prototypes.constructors.Entity.EntityWithHealth.Turret.FluidTurret") require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.Car") require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.RollingStock") +require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.SpiderVehicle") require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.RollingStock.ArtilleryWagon") require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.RollingStock.CargoWagon") require("prototypes.constructors.Entity.EntityWithHealth.Vehicle.RollingStock.FluidWagon") diff --git a/prototypes/constructors/Entity/SpiderLeg.lua b/prototypes/constructors/Entity/EntityWithHealth/SpiderLeg.lua similarity index 79% rename from prototypes/constructors/Entity/SpiderLeg.lua rename to prototypes/constructors/Entity/EntityWithHealth/SpiderLeg.lua index 94fae60..ccbb4cf 100644 --- a/prototypes/constructors/Entity/SpiderLeg.lua +++ b/prototypes/constructors/Entity/EntityWithHealth/SpiderLeg.lua @@ -1,11 +1,11 @@ Baseless.Make.SpiderLeg = function (name, prototype) - return Baseless.Make.Entity("spider-leg", name, Merge( + return Baseless.Make.EntityWithHealth("spider-leg", name, Merge( { - part_length = 1, + graphics_set = {}, initial_movement_speed = 0, movement_acceleration = 0, movement_based_position_selection_distance = 0, - graphics_set = {}, + part_length = 1, }, prototype )) diff --git a/prototypes/constructors/Entity/SpiderVehicle.lua b/prototypes/constructors/Entity/EntityWithHealth/Vehicle/SpiderVehicle.lua similarity index 100% rename from prototypes/constructors/Entity/SpiderVehicle.lua rename to prototypes/constructors/Entity/EntityWithHealth/Vehicle/SpiderVehicle.lua index d476b54..dde8100 100644 --- a/prototypes/constructors/Entity/SpiderVehicle.lua +++ b/prototypes/constructors/Entity/EntityWithHealth/Vehicle/SpiderVehicle.lua @@ -1,14 +1,14 @@ Baseless.Make.SpiderVehicle = function (name, prototype) return Baseless.Make.Vehicle("spider-vehicle", name, Merge( { - energy_source = Baseless.Data.EnergySource.Burner, - inventory_size = 0, - height = 1, - chunk_exploration_radius = 1, - movement_energy_consumption = Baseless.Data.Energy, automatic_weapon_cycling = false, + energy_source = Baseless.Data.EnergySource.Burner, chain_shooting_cooldown_modifier = 1, + chunk_exploration_radius = 1, graphics_set = {}, + height = 1, + inventory_size = 0, + movement_energy_consumption = Baseless.Data.Energy, spider_engine = { military_target = Baseless.Data.SimpleEntityWithForce, legs = {