Skip to content

Commit

Permalink
vessel graphics part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Dec 8, 2023
1 parent 460949c commit a9edb38
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 43 deletions.
71 changes: 29 additions & 42 deletions prototypes/biofluid/vessel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,49 +71,37 @@ ITEM {
stack_size = 100
}

local pipe = table.deepcopy(data.raw['heat-pipe']['heat-pipe'])
pipe.name = 'vessel'
pipe.minable = {mining_time = 0.2, result = 'vessel'}
pipe.fast_replaceable_group = 'vessel'
pipe.next_upgrade = nil
pipe.heat_buffer = {
max_temperature = 0,
default_temperature = 0,
min_working_temperature = 0,
max_transfer = '1W',
specific_heat = '1W',
connections = {
{
direction = 0,
position = {
0,
0
}
},
{
direction = 2,
position = {
0,
0
}
},
{
direction = 4,
position = {
0,
0
}
},
{
direction = 6,
position = {
0,
0
data:extend{{
name = 'vessel',
type = 'simple-entity-with-owner',
icons = data.raw.item['vessel'].icons,
icon_size = 64,
flags = {'placeable-neutral', 'player-creation'},
minable = {mining_time = 0.2, result = 'vessel'},
max_health = 100,
corpse = 'small-remnants',
collision_box = table.deepcopy(data.raw['pipe']['pipe'].collision_box),
selection_box = table.deepcopy(data.raw['pipe']['pipe'].selection_box),
collision_mask = {vessel_collision_mask},
animations = {
layers = {
{
filename = '__pyalienlifegraphics2__/graphics/entity/vessel/vessel-straight-horizontal.png',
priority = 'high',
width = 640/5,
height = 768/6,
frame_count = 5*6,
line_length = 5,
shift = {0, 0},
scale = 0.35,
animation_speed = 0.3
}
}
},
}
pipe.collision_mask = {vessel_collision_mask}
fast_replaceable_group = 'vessel',
next_upgrade = nil,
vehicle_impact_sound = {filename = '__base__/sound/car-metal-impact.ogg', volume = 0.65},
}}

local underground_pipe = table.deepcopy(data.raw['pipe-to-ground']['pipe-to-ground'])
underground_pipe.name = 'vessel-to-ground'
Expand All @@ -134,8 +122,7 @@ underground_pipe.fluid_box = {
}
}
underground_pipe.collision_mask = {vessel_collision_mask}

data:extend{pipe, underground_pipe}
data:extend{underground_pipe}

data:extend{{
name = 'vessel-to-ground-heat-connection',
Expand Down
36 changes: 35 additions & 1 deletion scripts/biofluid/network-builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@ local TO_GROUND_CONNECTION = {{
direction = defines.direction.north
}}

local VESSEL = 'vessel'
local VESSEL_CONNECTION = {
{
direction = 0,
position = {
0,
0
}
},
{
direction = 2,
position = {
0,
0
}
},
{
direction = 4,
position = {
0,
0
}
},
{
direction = 6,
position = {
0,
0
}
}
}

function Biofluid.network_positions(surface_index)
local network_positions = global.network_positions[surface_index]
if not network_positions then
Expand All @@ -28,7 +60,9 @@ end

function Biofluid.find_heat_connections(entity)
local heat_prototype
if entity.type == TO_GROUND then
if entity.name == VESSEL then
heat_prototype = VESSEL_CONNECTION
elseif entity.type == TO_GROUND then
heat_prototype = TO_GROUND_CONNECTION
else
local buffer = entity.prototype.heat_buffer_prototype or entity.prototype.heat_energy_source_prototype
Expand Down

0 comments on commit a9edb38

Please sign in to comment.