Initial commit, working Titanium mod

This commit is contained in:
Brevven 2019-07-21 17:16:09 -07:00
commit 8508a04f51
46 changed files with 447 additions and 0 deletions

20
LICENSE.md Normal file
View file

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2013 Brevven
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

15
Makefile Normal file
View file

@ -0,0 +1,15 @@
.PHONY: zip install
v = bztitanium_$(shell jq -r .version info.json)
copy:
mkdir -p ../$(v)
cp -rf * ../$(v)
rm ../$(v).zip
cd ..; zip -9 -r -y $(v).zip $(v) -x "*.xcf" -x "*.git*"
install: copy
cp -f ../$(v).zip ../../mods/

10
README.md Normal file
View file

@ -0,0 +1,10 @@
# Titanium
Adds titanium ore and plates to the base game. It requires lubricant to mine.
Most recipes that should be lightweight that use steel now use titanium. Other minor recipe tweaks as well.
Not compatible with RSO yet.
## Version History
- 0.1.0 Initial version. No mod compatibility guarantees yet!

1
control.lua Normal file
View file

@ -0,0 +1 @@

1
data-final-fixes.lua Normal file
View file

@ -0,0 +1 @@
require("titanium-recipe-final")

1
data-updates.lua Normal file
View file

@ -0,0 +1 @@
require("titanium-recipe-updates")

25
data-util.lua Normal file
View file

@ -0,0 +1,25 @@
local data_util = {}
--- Add a given quantity of titanium plates to a given recipe
function data_util.add_titanium_ingredient(quantity, recipe)
table.insert(recipe.ingredients, {"titanium-plate", quantity})
end
--- Add titanium processing as a prerequisite to a given technology
function data_util.add_titanium_prerequisite(technology)
table.insert(technology.prerequisites, "titanium-processing")
end
--- Change all occurances of steel plates to titanium plates in a given recipe
function data_util.steel_to_titanium(recipe)
if recipe ~= nil and recipe.ingredients ~= nil then
for i, ingredient in pairs(recipe.ingredients) do
-- For final fixes
if ingredient.name == "steel-plate" then ingredient.name = "titanium-plate" end
-- For updates
if ingredient[1] == "steel-plate" then ingredient[1] = "titanium-plate" end
end
end
end
return data_util

4
data.lua Normal file
View file

@ -0,0 +1,4 @@
require("titanium-ore")
require("titanium-ore-particle")
require("titanium-recipe")

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 MiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

15
info.json Normal file
View file

@ -0,0 +1,15 @@
{
"name": "bztitanium",
"version": "0.1.0",
"factorio_version": "0.17",
"title": "Titanium",
"author": "Brevven",
"contact": "",
"homepage": "",
"dependencies": [
"base >= 0.17",
"? aai-industry",
"? space-exploration"
],
"description": "Adds titanium to the base game"
}

View file

@ -0,0 +1,19 @@
[entity-name]
titanium-ore=Titanium
[autoplace-control-names]
titanium-ore=Titanium Ore
[item-name]
titanium-ore=Titanium Ore
titanium-plate=Titanium Plate
[item-description]
titanium-ore=Can be smelted into titanium plates
[technology-name]
titanium-processing=Titanium Processing

BIN
thumbnail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

144
titanium-ore-particle.lua Normal file
View file

@ -0,0 +1,144 @@
data:extend(
{
{
type = "particle",
name = "titanium-ore-particle",
flags = {"not-on-map"},
life_time = 180,
pictures =
{
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/titanium-ore-particle-1.png",
priority = "extra-high",
width = 16,
height = 16,
frame_count = 1,
hr_version =
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/hr-titanium-ore-particle-1.png",
priority = "extra-high",
width = 32,
height = 32,
frame_count = 1,
scale = 0.5
}
},
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/titanium-ore-particle-2.png",
priority = "extra-high",
width = 16,
height = 16,
frame_count = 1,
hr_version =
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/hr-titanium-ore-particle-2.png",
priority = "extra-high",
width = 32,
height = 32,
frame_count = 1,
scale = 0.5
}
},
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/titanium-ore-particle-3.png",
priority = "extra-high",
width = 16,
height = 16,
frame_count = 1,
hr_version =
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/hr-titanium-ore-particle-3.png",
priority = "extra-high",
width = 32,
height = 32,
frame_count = 1,
scale = 0.5
}
},
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/titanium-ore-particle-4.png",
priority = "extra-high",
width = 16,
height = 16,
frame_count = 1,
hr_version =
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/hr-titanium-ore-particle-4.png",
priority = "extra-high",
width = 32,
height = 32,
frame_count = 1,
scale = 0.5
}
}
},
shadows =
{
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/titanium-ore-particle-shadow-1.png",
priority = "extra-high",
width = 16,
height = 16,
frame_count = 1,
hr_version =
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/hr-titanium-ore-particle-shadow-1.png",
priority = "extra-high",
width = 32,
height = 32,
frame_count = 1,
scale = 0.5
}
},
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/titanium-ore-particle-shadow-2.png",
priority = "extra-high",
width = 16,
height = 16,
frame_count = 1,
hr_version =
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/hr-titanium-ore-particle-shadow-2.png",
priority = "extra-high",
width = 32,
height = 32,
frame_count = 1,
scale = 0.5
}
},
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/titanium-ore-particle-shadow-3.png",
priority = "extra-high",
width = 16,
height = 16,
frame_count = 1,
hr_version =
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/hr-titanium-ore-particle-shadow-3.png",
priority = "extra-high",
width = 32,
height = 32,
frame_count = 1,
scale = 0.5
}
},
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/titanium-ore-particle-shadow-4.png",
priority = "extra-high",
width = 16,
height = 16,
frame_count = 1,
hr_version =
{
filename = "__bztitanium__/graphics/entity/titanium-ore-particle/hr-titanium-ore-particle-shadow-4.png",
priority = "extra-high",
width = 32,
height = 32,
frame_count = 1,
scale = 0.5
}
}
}
}
}
)

79
titanium-ore.lua Normal file
View file

@ -0,0 +1,79 @@
local resource_autoplace = require('resource-autoplace');
data:extend(
{
{
type = "autoplace-control",
category = "resource",
name = "titanium-ore",
richness = true,
order = "b-e"
},
{
type = "noise-layer",
name = "titanium-ore"
},
{
type = "resource",
icon_size = 32,
name = "titanium-ore",
icon = "__bztitanium__/graphics/icons/titanium-ore.png",
flags = {"placeable-neutral"},
order="a-b-a",
map_color = {r=0.65, g=0.80, b=0.80},
minable =
{
hardness = 1,
mining_particle = "titanium-ore-particle",
mining_time = 2,
fluid_amount=10,
required_fluid= "lubricant",
result = "titanium-ore"
},
collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
autoplace = resource_autoplace.resource_autoplace_settings{
name = "titanium-ore",
order = "b-z",
base_density = 6,
has_starting_area_placement = false,
random_spot_size_minimum = 1,
random_spot_size_maximum = 3,
regular_rq_factor_multiplier = 1
},
stage_counts = {15000, 9500, 5500, 2900, 1300, 400, 150, 80},
stages =
{
sheet =
{
filename = "__bztitanium__/graphics/entity/ores/titanium-ore.png",
priority = "extra-high",
size = 64,
frame_count = 8,
variation_count = 8,
hr_version =
{
filename = "__bztitanium__/graphics/entity/ores/hr-titanium-ore.png",
priority = "extra-high",
size = 128,
frame_count = 8,
variation_count = 8,
scale = 0.5
}
}
},
},
{
type = "item",
name = "titanium-ore",
icon_size = 32,
icon = "__bztitanium__/graphics/icons/titanium-ore.png",
subgroup = "raw-resource",
order = "t-c-a",
stack_size = 50
},
}
)

BIN
titanium-processing.xcf Normal file

Binary file not shown.

32
titanium-recipe-final.lua Normal file
View file

@ -0,0 +1,32 @@
-- Titanium recipe & tech changes
-- These are in "final" for compatibility with other mods such as Space Exploration and AAI
local util = require("__bztitanium__.data-util");
util.steel_to_titanium(data.raw.recipe["low-density-structure"])
util.steel_to_titanium(data.raw.recipe["low-density-structure"].normal)
util.steel_to_titanium(data.raw.recipe["low-density-structure"].expensive)
util.add_titanium_prerequisite(data.raw.technology["low-density-structure"])
util.steel_to_titanium(data.raw.recipe["flying-robot-frame"])
util.steel_to_titanium(data.raw.recipe["flying-robot-frame"].normal)
util.steel_to_titanium(data.raw.recipe["flying-robot-frame"].expensive)
util.add_titanium_prerequisite(data.raw.technology["robotics"])
-- Additions for Space Exploration mod.
if data.raw.recipe["se-space-pipe"] then
util.steel_to_titanium(data.raw.recipe["se-space-pipe"])
util.steel_to_titanium(data.raw.recipe["se-space-pipe"].normal)
util.steel_to_titanium(data.raw.recipe["se-space-pipe"].expensive)
util.steel_to_titanium(data.raw.recipe["se-space-transport-belt"])
util.steel_to_titanium(data.raw.recipe["se-space-transport-belt"].normal)
util.steel_to_titanium(data.raw.recipe["se-space-transport-belt"].expensive)
util.steel_to_titanium(data.raw.recipe["se-space-underground-belt"])
util.steel_to_titanium(data.raw.recipe["se-space-underground-belt"].normal)
util.steel_to_titanium(data.raw.recipe["se-space-underground-belt"].expensive)
util.steel_to_titanium(data.raw.recipe["se-space-splitter"])
util.steel_to_titanium(data.raw.recipe["se-space-splitter"].normal)
util.steel_to_titanium(data.raw.recipe["se-space-splitter"].expensive)
util.add_titanium_prerequisite(data.raw.technology["se-space-platform-scaffold"])
end

View file

@ -0,0 +1,21 @@
-- Titanium recipe & tech changes
--
local util = require("__bztitanium__.data-util");
util.steel_to_titanium(data.raw.recipe["power-armor"])
util.add_titanium_prerequisite(data.raw.technology["power-armor"])
-- All equipment that uses steel now uses titanium. Who wants to carry around steel!
for name, recipe in pairs(data.raw.recipe) do
if recipe.result ~= nil and recipe.result:find("equipment") then
util.steel_to_titanium(recipe)
end
end
-- Generally, steel-based equipment techs require solar panel tech, so only require
-- titanium processing for that.
util.add_titanium_prerequisite(data.raw.technology["solar-panel-equipment"])
-- Also add titanium to steam turbines
util.add_titanium_ingredient(20, data.raw.recipe["steam-turbine"])
util.add_titanium_prerequisite(data.raw.technology["nuclear-power"])

60
titanium-recipe.lua Normal file
View file

@ -0,0 +1,60 @@
-- Titanium smelting
data:extend(
{
{
type = "recipe",
name = "titanium-plate",
category = "smelting",
normal =
{
enabled = false,
energy_required = 8,
ingredients = {{"titanium-ore", 5}},
result = "titanium-plate"
},
expensive =
{
enabled = false,
energy_required = 16,
ingredients = {{"titanium-ore", 10}},
result = "titanium-plate"
}
},
{
type = "item",
name = "titanium-plate",
icon = "__bztitanium__/graphics/icons/titanium-plate.png",
icon_size = 32,
subgroup = "raw-material",
order = "b[titanium-plate]",
stack_size = 100
},
{
type = "technology",
name = "titanium-processing",
icon_size = 128,
icon = "__bztitanium__/graphics/icons/titanium-processing.png",
effects =
{
{
type = "unlock-recipe",
recipe = "titanium-plate"
}
},
unit =
{
count = 75,
ingredients =
{
{"automation-science-pack", 1},
{"logistic-science-pack", 1}
},
time = 30
},
prerequisites = {"lubricant"},
order = "b-b"
},
}
)

BIN
titanium-thumbnail.xcf Normal file

Binary file not shown.