Skip to content

Commit

Permalink
Nuclear power! Also icon fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
euigrp committed Nov 25, 2017
1 parent cfcd5dc commit 15b9b09
Show file tree
Hide file tree
Showing 9 changed files with 197 additions and 19 deletions.
45 changes: 38 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
BLENDER_PATH?=~/Downloads/blender/blender

MODNAME=BasicSeaBlock
MODVERS=0.1.1
MODVERS=0.1.2

OUTPATH=./$(MODNAME)_$(MODVERS)
ZIPPATH=$(OUTPATH).zip

$(OUTPATH):
mkdir -p $(OUTPATH)
rsync -av ./src/static/* $(OUTPATH)/
rsync -av ./src/static/* $(OUTPATH)/ --delete

.PHONY: clean $(OUTPATH) blender
.SECONDARY:
Expand Down Expand Up @@ -63,6 +63,15 @@ pf-anim-options= -x 384 -y 384 --samples 512 $(DEVSAMPLES)
pf-direction-frames= -s 21 -e 24
pf-direction-options= -x 384 -y 384 --samples 512 $(DEVSAMPLES)

bm-anim-frames= -s 1 -e 16
bm-anim-options= -x 384 -y 384 --samples 128 $(DEVSAMPLES)

bm-shadow-frames= -s 17 -e 17
bm-shadow-options= -x 384 -y 384 --samples 128 $(DEVSAMPLES)

bm-direction-frames= -s 18 -e 18
bm-direction-options= -x 384 -y 384 --samples 128 $(DEVSAMPLES)

./render/%-shadow/.content ./render/%-anim/.content ./render/%-direction/.content: ./src/assets/models/%.blend
mkdir -p $(dir $@)
$(BLENDER_PATH) -b $< -o "$(dir $@)/##.png" $($(notdir $(abspath $@/..))-frames) -P 'src/build_scripts/size.py' -- $($(notdir $(abspath $@/..))-options)
Expand All @@ -79,6 +88,10 @@ af-shadow-sheet-width=4
pf-anim-sheet-width=5
pf-direction-sheet-width=4

bm-anim-sheet-width=5
bm-shadow-sheet-width=1
bm-direction-sheet-width=1

./sheets/%.png: ./render/%/.content
mkdir -p ./sheets/
./src/build_scripts/sheetify.py $($(basename $(notdir $@))-sheet-width) $@ $(dir $<)/*.png
Expand All @@ -99,18 +112,27 @@ pin-pf-direction='{"x":0.5, "y":5, "dx":16, "cx":2}'
./sheets/pf.png: sheets/pf-anim.png sheets/pin-pf-direction.png
./src/build_scripts/compose.py ./sheets/pf.png 1920x1920 0x0:sheets/pf-anim.png 0x1536:sheets/pin-pf-direction.png

./sheets/bm.png: sheets/bm-anim.png sheets/bm-shadow.png sheets/bm-direction.png
./src/build_scripts/compose.py ./sheets/bm.png 1920x1536 0x0:sheets/bm-anim.png 384x1152:sheets/bm-direction.png 768x1152:sheets/bm-shadow.png

./icons/pf.png: ./src/assets/models/pf.blend
rm -f ./icons/pf.png
mkdir -p ./icons/
$(BLENDER_PATH) -b './src/assets/models/pf.blend' -o './icons/pf.png' -P './src/build_scripts/size.py' -f 24 -- -x 32 -y 32 --samples 32 --obj-prop Camera.data.ortho_scale=1.1 --no-anim
$(BLENDER_PATH) -b './src/assets/models/pf.blend' -o './icons/pf.png' -P './src/build_scripts/size.py' -f 24 -- \
-x 32 -y 32 --samples 32 --obj-prop Camera.data.ortho_scale=1.1 --no-anim \
--obj-prop Camera.location='(0,-4,1)' \
--obj-prop Camera.rotation_euler='(1.35263, 0, 0)'

mv ./icons/pf.png* ./icons/pf.png

./icons/af.png: ./src/assets/models/pf.blend
./icons/af.png: ./src/assets/models/af.blend
rm -f ./icons/af.png
mkdir -p ./icons/
$(BLENDER_PATH) -b './src/assets/models/af.blend' -o './icons/af.png' -P './src/build_scripts/size.py' -f 1 -- \
$(BLENDER_PATH) -b './src/assets/models/af.blend' -o './icons/af.png' -P './src/build_scripts/size.py' -f 40 -- \
-x 32 -y 32 --samples 256 \
--obj-prop Camera.data.ortho_scale=1.2 \
--obj-prop Camera.location='(0,4,2.6)' \
--obj-prop Camera.rotation_euler='(1, 0, 3.14159)' \
--obj-prop Lamp.data.cycles.cast_shadow=False \
--scene-prop 'world.horizon_color=(0.5,0.5,0.5)' \
--no-anim
Expand All @@ -123,6 +145,13 @@ pin-pf-direction='{"x":0.5, "y":5, "dx":16, "cx":2}'
-x 32 -y 32 --samples 256 --obj-prop Camera.data.ortho_scale=1.0 --no-anim
mv ./icons/fm.png* ./icons/fm.png

./icons/bm.png: ./src/assets/models/bm.blend
rm -f ./icons/bm.png
mkdir -p ./icons/
$(BLENDER_PATH) -b './src/assets/models/bm.blend' -o './icons/bm.png' -P './src/build_scripts/size.py' -f 0 -- \
-x 32 -y 32 --samples 256 --no-anim
mv ./icons/bm.png* ./icons/bm.png

./icons/filter.png: ./src/assets/models/filter-icon.blend
rm -f ./icons/filter.png
mkdir -p icons
Expand All @@ -137,14 +166,15 @@ pin-pf-direction='{"x":0.5, "y":5, "dx":16, "cx":2}'
-x 32 -y 32 --samples 128 --no-anim
mv ./icons/filter-empty.png* ./icons/filter-empty.png


./icons/%-border.png: ./icons/%.png
./src/build_scripts/dark_border.py $< $@

render_list=fm-anim fm-direction fm-shadow af-anim af-shadow af-direction pf-anim pf-direction
render_files=$(addsuffix /.content,$(addprefix ./render/,$(render_list)))
sheet_list=fm af pf
sheet_list=fm af pf bm
sheet_files=$(addsuffix .png,$(addprefix ./sheets/,$(sheet_list)))
icon_list=af-border fm-border pf-border filter filter-empty
icon_list=af fm pf bm filter filter-empty
icon_files=$(addsuffix .png,$(addprefix ./icons/,$(icon_list)))

ICONPATH=$(OUTPATH)/graphics/icons/
Expand All @@ -162,6 +192,7 @@ ENTITYPATH=$(OUTPATH)/graphics/entity/
./src/build_scripts/shrink.py sr- 2 $(ENTITYPATH)/*

$(ZIPPATH): $(OUTPATH) .templated .install-graphics-icons .install-graphics-entity
rm -f $(ZIPPATH)
zip -r $(ZIPPATH) $(OUTPATH)

mod: $(ZIPPATH)
Expand Down
Binary file added src/assets/models/bm.blend
Binary file not shown.
8 changes: 3 additions & 5 deletions src/static/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ data:extend({
},
{
type = "recipe-category",
name = "water-pumping"
},
{
type = "resource-category",
name = "sludge"
name = "borehole-mine"
},
{
type = "item-subgroup",
Expand Down Expand Up @@ -146,3 +142,5 @@ data.raw.tile['deepwater'].autoplace = {

table.insert(data.raw["technology"]["oil-processing"].effects, {type = "unlock-recipe", recipe = "pressure-furnace"})
table.insert(data.raw["technology"]["oil-processing"].effects, {type = "unlock-recipe", recipe = "pressure-pulp"})
table.insert(data.raw["technology"]["nuclear-power"].effects, {type = "unlock-recipe", recipe = "mine-uranium"})
table.insert(data.raw["technology"]["nuclear-power"].effects, {type = "unlock-recipe", recipe = "borehole-mine"})
Binary file added src/static/graphics/icons/mine-uranium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/static/locale/en/config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ mineral-sludge=Mineral rich goop extracted from the ocean
algae-farm=Algae Pit
filtration-plant=Filtration Plant
pressure-furnace=Pressure Furnace
borehole-mine=Borehole Mine

[entity-description]
algae-farm=Harvest, breed or process algae
filtration-plant=Filter minerals from the water
pressure-furnace=Millions of years of pressure and heat in seconds
borehole-mine=Send robots beneath the surface to gather ore. Some of the bots won't make it.
[item-name]
algae-farm=Algae Pit
Expand All @@ -23,6 +25,7 @@ spent-filter=Empty Filter
pulp=Algae Pulp
pressure-furnace=Pressure Furnace
filtration-plant=Filtration Plant
borehole-mine=Borehole Mine
[item-description]
algae-farm=Harvest, breed or process algae
Expand All @@ -31,8 +34,10 @@ spent-filter=This filter needs to be loaded with more charcoal before it can be
pulp=Dried out algae
pressure-furnace=Millions of years of pressure and heat in seconds
filtration-plant=Filter minerals from the water
borehole-mine=Send robots beneath the surface to gather ore. Some of the bots won't make it.

[recipe-name]
filter-water=Mineral Extraction
pressure-pulp=Pressure Cook Algae
press-algae=Dehydrate Algae
mine-uranium=Mine Uranium
10 changes: 10 additions & 0 deletions src/static/migrations/recipe-unlock.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
for index, force in pairs(game.forces) do
local technologies = force.technologies
local recipes = force.recipes

recipes["pressure-furnace"].enabled = technologies["oil-processing"].researched
recipes["pressure-pulp"].enabled = technologies["oil-processing"].researched
recipes["mine-uranium"].enabled = technologies["nuclear-power"].researched
recipes["borehole-mine"].enabled = technologies["nuclear-power"].researched
recipes["mine-uranium"].reload()
end
91 changes: 91 additions & 0 deletions src/static/prototypes/entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -351,5 +351,96 @@ data:extend({
ingredient_count = 1,
crafting_categories = {"pressure-furnace"},
},
{
type = "assembling-machine",
name = "borehole-mine",
icon = "__BasicSeaBlock__/graphics/icons/bm.png",
flags = {"placeable-neutral","placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "borehole-mine"},
max_health = 300,
corpse = "big-remnants",
dying_explosion = "medium-explosion",
collision_box = {{-2.3, -2.3}, {2.3, 2.3}},
selection_box = {{-2.5, -2.5}, {2.5, 2.5}},
order = "s-e-w-f",
module_specification = {
module_slots = 3
},
allowed_effects = {"consumption", "speed", "productivity", "pollution"},
animation = (function()
local directions= {"north", "east", "south", "west"}
local ret = {}
for i,dir in ipairs(directions) do
ret[dir] = {
layers = {
entlayer({
priority = "extra-high",
width = 384,
height = 384,
line_length = 1,
shift = util.by_pixel(0, 0),
name = "bm",
frame_count = 1,
scale=0.5,
y=1152, x=384,
}),
entlayer({
draw_as_shadow=true,
priority = "high",
width = 384,
height = 384,
line_length = 1,
shift = util.by_pixel(0, 0),
name = "bm",
frame_count = 1,
scale=0.5,
y=1152, x=768,
}),
}
}
end
return ret
end)(),
working_visualisations =
{
{
animation = entlayer({
x = 0,
y = 0,
width = 384,
height = 384,
line_length = 5,
shift = util.by_pixel(0, 0),
name = "bm",
frame_count = 16,
animation_speed = 0.25,
scale=0.5
}),
}
},
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
working_sound = {
sound = {
{
filename = "__base__/sound/assembling-machine-t2-1.ogg",
volume = 0.8
},
{
filename = "__base__/sound/assembling-machine-t2-2.ogg",
volume = 0.8
},
},
idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
apparent_volume = 1.5,
},
crafting_speed = 1.00,
energy_source = {
type = "electric",
usage_priority = "secondary-input",
},
energy_usage = "200KW",
ingredient_count = 1,
crafting_categories = {"borehole-mine"},
},

})
18 changes: 14 additions & 4 deletions src/static/prototypes/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ data:extend{
{
type = "item",
name = "algae-farm",
icon = "__BasicSeaBlock__/graphics/icons/algae-farm.png",
icon = "__BasicSeaBlock__/graphics/icons/af.png",
flags = {"goes-to-quickbar"},
subgroup = "extraction-machine",
order = "a[algae]-a[algae-farm]",
Expand All @@ -14,7 +14,7 @@ data:extend{
{
type = "item",
name = "filtration-plant",
icon = "__BasicSeaBlock__/graphics/icons/filtration-plant.png",
icon = "__BasicSeaBlock__/graphics/icons/fm.png",
flags = {"goes-to-quickbar"},
subgroup = "extraction-machine",
order = "a[algae]-b[filtration-machine]",
Expand All @@ -24,13 +24,23 @@ data:extend{
{
type = "item",
name = "pressure-furnace",
icon = "__BasicSeaBlock__/graphics/icons/pressure-furnace.png",
icon = "__BasicSeaBlock__/graphics/icons/pf.png",
flags = {"goes-to-quickbar"},
subgroup = "extraction-machine",
order = "a[algae]-c[pressure-furnace]",
place_result = "pressure-furnace",
stack_size = 10
},
{
type = "item",
name = "borehole-mine",
icon = "__BasicSeaBlock__/graphics/icons/bm.png",
flags = {"goes-to-quickbar"},
subgroup = "extraction-machine",
order = "a[items]-c[borehole-mine]",
place_result = "borehole-mine",
stack_size = 10
},
{
type = "item",
name = "pulp",
Expand All @@ -43,7 +53,7 @@ data:extend{
{
type = "item",
name = "spent-filter",
icon = "__BasicSeaBlock__/graphics/icons/filter-spent.png",
icon = "__BasicSeaBlock__/graphics/icons/filter-empty.png",
flags = {},
subgroup = "intermediate-product",
order = "b[filter]-a[empty]",
Expand Down
39 changes: 36 additions & 3 deletions src/static/prototypes/recipe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ data:extend({
results = {
{type="item", name="algae-farm", amount=1},
},
icon="__BasicSeaBlock__/graphics/icons/algae-farm.png",
icon="__BasicSeaBlock__/graphics/icons/af.png",
subgroup = "extraction-machine"
},
{
Expand All @@ -30,7 +30,7 @@ data:extend({
results = {
{type="item", name="filtration-plant", amount=1},
},
icon = "__BasicSeaBlock__/graphics/icons/filtration-plant.png",
icon = "__BasicSeaBlock__/graphics/icons/fm.png",
subgroup = "extraction-machine"
},
{
Expand All @@ -48,7 +48,24 @@ data:extend({
results = {
{type="item", name="pressure-furnace", amount=1},
},
icon = "__BasicSeaBlock__/graphics/icons/pressure-furnace.png",
icon = "__BasicSeaBlock__/graphics/icons/pf.png",
subgroup = "extraction-machine"
},
{
type = "recipe",
name = "borehole-mine",
energy_required = 0.25,
enabled = false,
ingredients = {
{"steel-plate", 40},
{"concrete", 150},
{"advanced-circuit", 50},
{"electric-engine-unit", 2},
},
results = {
{type="item", name="borehole-mine", amount=1},
},
icon = "__BasicSeaBlock__/graphics/icons/bm.png",
subgroup = "extraction-machine"
},
{
Expand Down Expand Up @@ -237,4 +254,20 @@ data:extend({
category = "pressure-furnace",
order = "z",
},
{
type = "recipe",
name = "mine-uranium",
energy_required = 5,
enabled = false,
ingredients = {
{type="item", name="construction-robot", amount=1},
},
results = {
{type="item", name="construction-robot", amount_min=0, amount_max=1, probability=0.95},
{type="item", name="uranium-ore", amount=10},
},
icon="__BasicSeaBlock__/graphics/icons/mine-uranium.png",
subgroup = "filter-group",
category = "borehole-mine",
},
})

0 comments on commit 15b9b09

Please sign in to comment.