Skip to content

Commit

Permalink
Redo tutorial techs
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwiHawk committed Sep 9, 2024
1 parent d783f54 commit cb6fbe7
Show file tree
Hide file tree
Showing 17 changed files with 227 additions and 197 deletions.
29 changes: 20 additions & 9 deletions SeaBlock/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ require("starting-items")
require("remote")

function seablock.give_research(force)
if not force.technologies["sb-startup1"].researched then
force.add_research("sb-startup1")
if not force.technologies["sb-checkpoint-mud"].researched then
force.add_research("sb-checkpoint-mud")
end
end

Expand Down Expand Up @@ -58,13 +58,23 @@ local function init()
end
end
global.unlocks = {
["angels-ore3-crushed"] = { "sb-startup1", "bio-wood-processing" },
["basic-circuit-board"] = { "sb-startup3", "sct-lab-t1" },
["solid-mud"] = { "sb-checkpoint-mud", "automation", "logistics-0", "landfill" },
["landfill-dirt-4"] = { "sb-checkpoint-landfill", "basic-chemistry", "bio-processing-brown", "bio-wood-processing" },
["landfill-dry-dirt"] = { "sb-checkpoint-landfill", "basic-chemistry", "bio-processing-brown", "bio-wood-processing" },
["landfill-grass-1"] = { "sb-checkpoint-landfill", "basic-chemistry", "bio-processing-brown", "bio-wood-processing" },
["landfill"] = { "sb-checkpoint-landfill", "basic-chemistry", "bio-processing-brown", "bio-wood-processing" },
["landfill-red-desert-1"] = { "sb-checkpoint-landfill", "basic-chemistry", "bio-processing-brown", "bio-wood-processing" },
["landfill-sand-3"] = { "sb-checkpoint-landfill", "basic-chemistry", "bio-processing-brown", "bio-wood-processing" },
["wood-charcoal"] = { "sb-checkpoint-charcoal", "steam-power", "slag-processing-1", "angels-sulfur-processing-1", "ore-crushing", "water-treatment" },
["iron-plate"] = { "sb-checkpoint-iron-plate", "angels-composting" },
["solid-soil"] = { "sb-checkpoint-soil", "bio-arboretum-1" },
["wood"] = { "sb-checkpoint-wood", "bio-wood-processing-2" },
["basic-circuit-board"] = { "sb-checkpoint-basic-circuit", "sct-lab-t1" },
}
if game.technology_prototypes["sct-automation-science-pack"] then
global.unlocks["lab"] = { "sct-automation-science-pack" }
global.unlocks["lab"] = { "sb-checkpoint-lab", "sct-automation-science-pack" }
else
global.unlocks["lab"] = { "sb-startup4" }
global.unlocks["lab"] = { "sb-startup-lab" }
end

if remote.interfaces["freeplay"] then
Expand Down Expand Up @@ -168,9 +178,10 @@ script.on_configuration_changed(function(cfg)
end

if
force.technologies["sct-automation-science-pack"]
and force.technologies["sb-startup4"]
and force.technologies["sb-startup4"].researched
force.technologies["sct-lab-t1"]
and force.technologies["sct-automation-science-pack"]
and force.technologies["sb-checkpoint-lab"]
and force.technologies["sb-checkpoint-lab"].researched
then
force.technologies["sct-lab-t1"].researched = true
force.technologies["sct-automation-science-pack"].researched = true
Expand Down
2 changes: 0 additions & 2 deletions SeaBlock/data-updates/algae.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ bobmods.lib.recipe.set_category("algae-green", "bio-processing")

-- Improved algae processing
bobmods.lib.tech.remove_prerequisite("bio-processing-green", "water-treatment")
bobmods.lib.tech.add_prerequisite("bio-processing-green", "bio-wood-processing-2")
bobmods.lib.tech.add_prerequisite("bio-processing-green", "water-washing-1")
data.raw.technology["bio-processing-green"].localised_name = { "technology-name.sb-bio-processing-green" }

-- Move Lithia Salt to Thermal Water Extraction
Expand Down
14 changes: 5 additions & 9 deletions SeaBlock/data-updates/landfill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ else
bobmods.lib.tech.remove_recipe_unlock("water-washing-2", "solid-mud-landfill")
end

-- Make landfill a red science tech
data.raw.technology["landfill"].prerequisites = { "water-washing-1" }
data.raw.technology["landfill"].unit = {
count = 10,
ingredients = { { type = "item", name = "automation-science-pack", amount = 1 } },
time = 15,
}
bobmods.lib.tech.remove_prerequisite("water-washing-2", "landfill")
bobmods.lib.tech.ignore_tech_cost_multiplier("landfill", true)
-- Remove empty tech Washing 1
bobmods.lib.tech.remove_prerequisite("angels-stone-smelting-1", "water-washing-1")
bobmods.lib.tech.remove_prerequisite("bio-processing-green", "water-washing-1")
bobmods.lib.tech.remove_prerequisite("water-washing-2", "water-washing-1")
seablock.lib.hide_technology("water-washing-1")
4 changes: 1 addition & 3 deletions SeaBlock/data-updates/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ for k, v in pairs(data.raw["resource"]) do
end

-- Add prerequisite for Tin and Lead
if settings.startup["bobmods-logistics-beltoverhaul"].value then
bobmods.lib.tech.add_prerequisite("logistics", "ore-crushing")
end
--bobmods.lib.tech.add_prerequisite("logistics", "ore-crushing")

-- Tidy prerequisite for Brass
bobmods.lib.tech.remove_prerequisite("zinc-processing", "electrolysis-1")
Expand Down
8 changes: 6 additions & 2 deletions SeaBlock/data-updates/science-cost-tweaker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ if mods["ScienceCostTweakerM"] then
end

-- Change tech to use lab icon from SCT
data.raw.tool["sb-lab-tool"].icon = "__ScienceCostTweakerM__/graphics/sct-lab-t1/icon-64.png"
data.raw.tool["sb-lab-tool"].icon_mipmaps = 0
data.raw.technology["sb-checkpoint-lab"].icon = "__ScienceCostTweakerM__/graphics/sct-lab-t1/icon-64.png"
data.raw.technology["sb-checkpoint-lab"].icon_size = 64
data.raw.technology["sb-checkpoint-lab"].icon_mipmaps = 0

-- Reduce processing unit cost of S.C.T. high-tech science
seablock.lib.substingredient("sct-htech-injector", "processing-unit", nil, 3)

-- Hide empty tech (Lab 2 will have been moved to it's own tech sct-lab-lab2
seablock.lib.hide_technology("advanced-research")

-- Hide lab / red science tech
seablock.lib.hide_technology("sb-startup-lab")

-- Yellow science now requires Purple science
-- Adjust any techs that needed Yellow but not Purple

Expand Down
61 changes: 38 additions & 23 deletions SeaBlock/data-updates/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,12 @@ end

-- unlock lab and optional components with Basic Circuit Board
if data.raw.technology["sct-lab-t1"] then
bobmods.lib.tech.add_prerequisite("sct-lab-t1", "sb-startup3")
bobmods.lib.tech.add_prerequisite("sct-lab-t1", "sb-checkpoint-basic-circuit")
else
bobmods.lib.tech.add_recipe_unlock("sb-startup3", "lab")
bobmods.lib.recipe.enabled("lab", false)
end

if data.raw.technology["sct-automation-science-pack"] then
bobmods.lib.tech.add_prerequisite("sct-automation-science-pack", "sct-lab-t1")
data.raw.technology["sct-automation-science-pack"].unit = {
count = 1,
ingredients = { { "sb-lab-tool", 1 } },
time = 1,
}
data.raw.technology["sct-lab-t1"].unit = {
count = 1,
ingredients = {},
time = 1,
}
seablock.lib.hide_technology("sb-startup4")
end

local movedrecipes = table.deepcopy(seablock.startup_recipes)
for k, v in pairs(seablock.scripted_techs) do
if data.raw.technology[k] then
Expand Down Expand Up @@ -214,10 +199,40 @@ for k, v in pairs(seablock.startup_techs) do
end
end

-- Make bio-wood-processing a startup tutorial tech
data.raw.technology["bio-wood-processing"].prerequisites = { "sb-startup1" }
data.raw.technology["bio-wood-processing"].unit = {
count = 1,
ingredients = {},
time = 1,
}
-- Make startup tutorial techs
for tech_name, prerequisites in pairs(seablock.scripted_techs) do
local tech = data.raw.technology[tech_name]
if tech then
if not seablock.checkpoint_techs[tech_name] then
tech.unit = {
count = 1,
ingredients = {},
time = 1,
}
end
tech.prerequisites = prerequisites
end
end

-- Remove prerequisites on tutorial techs
for tech_name, tech in pairs(data.raw.technology) do
if not seablock.scripted_techs[tech_name] then
if tech.prerequisites then
local to_remove = {}
for _, prerequisite in pairs(tech.prerequisites) do
if seablock.scripted_techs[prerequisite] and prerequisite ~= seablock.final_scripted_tech then
table.insert(to_remove, prerequisite)
end
end
for _, prerequisite in pairs(to_remove) do
bobmods.lib.tech.remove_prerequisite(tech_name, prerequisite)
end

if #tech.prerequisites == 0 then
bobmods.lib.tech.add_prerequisite(tech_name, seablock.final_scripted_tech)
end
else
tech.prerequisites = { seablock.final_scripted_tech }
end
end
end
1 change: 0 additions & 1 deletion SeaBlock/data-updates/thermal-extractor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,3 @@ if data.raw.technology["bio-pressing-fish"] then
else
bobmods.lib.tech.add_prerequisite("bio-pressing-fish-1", "thermal-water-extraction")
end
bobmods.lib.tech.add_prerequisite("thermal-water-extraction", "bio-processing-brown")
3 changes: 0 additions & 3 deletions SeaBlock/data-updates/wood.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ bobmods.lib.tech.add_recipe_unlock("bio-wood-processing", "wooden-chest")
bobmods.lib.tech.add_recipe_unlock("bio-wood-processing", "wooden-board")
bobmods.lib.tech.add_recipe_unlock("bio-wood-processing", "basic-circuit-board")

bobmods.lib.tech.remove_prerequisite("bio-wood-processing-2", "bio-farm-1")
bobmods.lib.tech.remove_prerequisite("bio-wood-processing-2", "bio-wood-processing")
bobmods.lib.tech.add_prerequisite("bio-wood-processing-2", "bio-processing-brown")
bobmods.lib.tech.remove_recipe_unlock("bio-wood-processing-2", "wood-charcoal")
bobmods.lib.tech.remove_recipe_unlock("bio-wood-processing-2", "bio-resin-wood-reprocessing")
bobmods.lib.tech.remove_recipe_unlock("bio-wood-processing-2", "bob-rubber")
Expand Down
92 changes: 49 additions & 43 deletions SeaBlock/data/tables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,84 @@
-- Techs here are expected to be unlocked by the tutorial system
-- They will not have prerequisites added
seablock.scripted_techs = {
["sb-startup1"] = true,
["sb-startup2"] = true,
["bio-wood-processing"] = true,
["sb-startup3"] = true,
["sb-startup4"] = true,
["sb-checkpoint-mud"] = {},
["automation"] = { "sb-checkpoint-mud" },
["landfill"] = { "sb-checkpoint-mud" },
["logistics-0"] = { "sb-checkpoint-mud" },
["sb-checkpoint-landfill"] = { "automation", "landfill", "logistics-0" },
["basic-chemistry"] = { "sb-checkpoint-landfill" },
["bio-processing-brown"] = { "sb-checkpoint-landfill" },
["bio-wood-processing"] = { "sb-checkpoint-landfill" },
["sb-checkpoint-charcoal"] = { "basic-chemistry", "bio-processing-brown", "bio-wood-processing" },
["steam-power"] = { "sb-checkpoint-charcoal" },
["water-treatment"] = { "steam-power" },
["angels-sulfur-processing-1"] = { "steam-power" },
["slag-processing-1"] = { "steam-power" },
["ore-crushing"] = { "steam-power" },
["sb-checkpoint-iron-plate"] = { "steam-power", "water-treatment", "angels-sulfur-processing-1", "slag-processing-1", "ore-crushing" },
["angels-composting"] = { "sb-checkpoint-iron-plate" },
["sb-checkpoint-soil"] = { "angels-composting" },
["bio-arboretum-1"] = { "sb-checkpoint-soil" },
["sb-checkpoint-wood"] = { "bio-arboretum-1" },
["bio-wood-processing-2"] = { "sb-checkpoint-wood" },
["sb-checkpoint-basic-circuit"] = { "bio-wood-processing-2" },
}

if data.raw.technology["sct-lab-t1"] then
seablock.scripted_techs["sct-lab-t1"] = true
seablock.scripted_techs["sct-lab-t1"] = { "sb-checkpoint-basic-circuit" }
seablock.scripted_techs["sb-checkpoint-lab"] = { "sct-lab-t1" }
else
seablock.scripted_techs["sb-startup-lab"] = { "sb-checkpoint-basic-circuit" }
seablock.scripted_techs["sb-checkpoint-lab"] = { "sb-startup-lab" }
end
if data.raw.technology["sct-automation-science-pack"] then
seablock.scripted_techs["sct-automation-science-pack"] = true
seablock.scripted_techs["sct-automation-science-pack"] = { "sb-checkpoint-lab" }
end

seablock.checkpoint_techs = {
["sb-checkpoint-mud"] = true,
["sb-checkpoint-landfill"] = true,
["sb-checkpoint-charcoal"] = true,
["sb-checkpoint-iron-plate"] = true,
["sb-checkpoint-soil"] = true,
["sb-checkpoint-wood"] = true,
["sb-checkpoint-basic-circuit"] = true,
["sb-checkpoint-lab"] = true,
}

-- seablock.startup_techs
-- These techs will depend on the final startup tech
-- Their time will be standardized to 15 and they will ignore tech cost modifier
-- If {true} then their cost will be set to 20 red science
-- Any other tech with no prerequisites will depend on Slag Processing 1
seablock.startup_techs = {
["angels-fluid-control"] = { true },
["angels-sulfur-processing-1"] = { true },
["automation"] = { true },
["basic-chemistry"] = { true },
-- Don't reduce the science pack cost of green algae
["bio-processing-green"] = { false },
["bio-wood-processing-2"] = { true },
["long-inserters-1"] = { true },
["military"] = { true },
["optics"] = { true },
["slag-processing-1"] = { true },
["steam-power"] = { true },
["water-washing-1"] = { true },
}

if data.raw.technology["logistics-0"] then
seablock.startup_techs["logistics-0"] = { true }
else
seablock.startup_techs["logistics"] = { true }
end

-- seablock.startup_recipes
-- These recipes will be available at the start of the game
seablock.startup_recipes = {
["angels-electrolyser"] = true,
["angels-flare-stack"] = true,
["burner-ore-crusher"] = true,
["crystallizer"] = true,
["dirt-water-separation"] = true,
["liquifier"] = true,
["clarifier"] = true,
["offshore-pump"] = true,
["sb-water-mineralized-crystallization"] = true,
["slag-processing-stone"] = true,
["stone-pipe"] = true,
["stone-pipe-to-ground"] = true,
["stone-brick"] = true,
["stone-crushed"] = true,
["water-mineralized"] = true,
["seafloor-pump"] = true,
["washing-1"] = true,
["washing-2"] = true,
["washing-3"] = true,
["washing-4"] = true,
["washing-5"] = true,
["washing-plant"] = true,
}

if
settings.startup["bobmods-assembly-multipurposefurnaces"]
and settings.startup["bobmods-assembly-multipurposefurnaces"].value
then
seablock.startup_recipes["stone-mixing-furnace"] = true
end

-- seablock.final_scripted_tech
-- Startup techs will depend on this tech
seablock.final_scripted_tech = "sb-startup4"
if data.raw.technology["sct-automation-science-pack"] then
seablock.final_scripted_tech = "sct-automation-science-pack"
else
seablock.final_scripted_tech = "sb-startup-lab"
end

seablock.final_startup_tech = "slag-processing-1"
seablock.final_startup_tech = seablock.final_scripted_tech
8 changes: 0 additions & 8 deletions SeaBlock/data/tech-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,6 @@ bobmods.lib.tech.add_prerequisite("gun-turret", "military")
bobmods.lib.tech.add_prerequisite("stone-wall", "military")
bobmods.lib.tech.add_prerequisite("space-science-pack", "military")

-- Steam power
bobmods.lib.tech.add_prerequisite("automation", "steam-power")
bobmods.lib.tech.add_prerequisite("optics", "steam-power")
if data.raw.technology["bob-greenhouse"] then
bobmods.lib.tech.add_prerequisite("bob-greenhouse", "steam-power")
end
bobmods.lib.tech.add_prerequisite("angels-coal-processing", "steam-power")

-- Gems are needed to make higher tier modules
if data.raw.technology["gem-processing-3"] then
--Module with 2 dots has the tech name of 3
Expand Down
13 changes: 8 additions & 5 deletions SeaBlock/locale/en/SeaBlock.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ silo-coal=Charcoal silo
silo-coal=Silo with a "Charcoal" aesthetic.

[technology-name]
sb-startup1=Crush stiratite
sb-startup3=Basic circuit board
sb-startup4=Laboratory
sb-checkpoint-mud=Checkpoint: Mud
sb-checkpoint-landfill=Checkpoint: Landfill
sb-checkpoint-charcoal=Checkpoint: Charcoal
sb-checkpoint-iron-plate=Checkpoint: Iron Plate
sb-checkpoint-soil=Checkpoint: Soil
sb-checkpoint-wood=Checkpoint: Wood
sb-checkpoint-basic-circuit=Checkpoint: Basic circuit
sb-checkpoint-lab=Checkpoint: Laboratory
sb-bio-processing-green=Improved algae processing
steam-power=Steam power
sct-lab-lab2=Exoplanetary Studies Lab
Expand All @@ -40,8 +45,6 @@ ftl-theory-D=Faster than light theory D2
ftl-theory-D2=Faster than light theory E

[technology-description]
sb-startup1=Crushed saphirite can be smelted to iron plates. Crushed stiratite can be smelted to copper plates.
sb-startup3=Craft a basic circuit board. Basic circuit boards are required to craft most machines.
sct-lab-lab2=Exoplanetary Studies Lab
ftl-theory-D=Theoretical faster than light travel part D2 - logistics bias
ftl-theory-D2=Theoretical faster than light travel part E
Expand Down
8 changes: 0 additions & 8 deletions SeaBlock/migrations/SeaBlock_0.5.1.lua

This file was deleted.

14 changes: 0 additions & 14 deletions SeaBlock/migrations/SeaBlock_0.5.2.lua

This file was deleted.

Loading

0 comments on commit cb6fbe7

Please sign in to comment.