-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathutil-fire-stickers.lua
More file actions
169 lines (151 loc) · 4.21 KB
/
util-fire-stickers.lua
File metadata and controls
169 lines (151 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
local firestickerutil = {}
local fireutil = require("__base__.prototypes.fire-util")
local math3d = require "math3d"
-- FLAME WEAPON UTILITIES
-- Create a custom fire sticker
-- Stickersize = size of the flame
-- dps = damage over time
-- burntime = How long it lasts
-- movementrate = How much it slows the player if any
-- color = Color tint if needed.
--[[
function firestickerutil.makefire(firename)
--"mortar-ground-fire-flame"
local firename = firename
local newfire = fireutil.add_basic_fire_graphics_and_effects_definitions
{
type = "fire",
name = firename,
flags = {"placeable-off-grid", "not-on-map"},
damage_per_tick = {amount = 13 / 60, type = "fire"},
maximum_damage_multiplier = 6,
damage_multiplier_increase_per_added_fuel = 1,
damage_multiplier_decrease_per_tick = 0.005,
spawn_entity = "fire-flame-on-tree",
spread_delay = 300,
spread_delay_deviation = 180,
maximum_spread_count = 100,
emissions_per_second = 0.005,
initial_lifetime = 60 * 10,
lifetime_increase_by = 150,
lifetime_increase_cooldown = 4,
maximum_lifetime = 60 * 30,
delay_between_initial_flames = 10,
--initial_flame_count = 1,
}
return newfire
end
]]--
function make_fire_bomblet_projectile(data)
return
{
type = "projectile",
name = data.name,
flags = {"not-on-map"},
acceleration = 0.00,
action =
{
{
type = "area",
radius = data.bomblet_radius,
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-sticker",
sticker = data.bomblet_sticker,
show_in_tooltip = true
},
{
type = "damage",
damage = { amount = data.bomblet_damage, type = data.bomblet_damage_type },
apply_damage_to_trees = false
}
}
}
},
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-fire",
entity_name = data.bomblet_groundfire,
show_in_tooltip = true,
initial_ground_flame_count = 10
}
}
}
}
},
-- light = {intensity = 0.5, size = 4},
-- animation =
-- {
-- filename = "__base__/graphics/entity/grenade/grenade.png",
-- frame_count = 16,
-- line_length = 8,
-- animation_speed = 0.250,
-- width = 26,
-- height = 28,
-- shift = util.by_pixel(1, 1),
-- priority = "high",
-- scale = 0.3,
-- },
-- shadow =
-- {
-- filename = "__base__/graphics/entity/grenade/grenade-shadow.png",
-- frame_count = 16,
-- line_length = 8,
-- animation_speed = 0.250,
-- width = 26,
-- height = 20,
-- shift = util.by_pixel(2, 6),
-- priority = "high",
-- draw_as_shadow = true,
-- },
}
end
function firestickerutil.makefiresticker(stickername, areaapplication, dps, burntime, movementrate, fireentity, color)
local stickername = stickername
local damage_interval = 10
local dps = ((dps / 60) * damage_interval) or 0
local burntime = burntime or 30
local movementrate = movementrate or 1.0
local spread_fire_entity = fireentity or "fire-flame-on-tree"
local fire_spread_radius = areaapplication or 1.0
local color = color or { r = 0.5, g = 0.5, b = 0.5, a = 0.18 }
return
{
name = stickername,
type = "sticker",
flags = {"not-on-map"},
animation =
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-01.png",
line_length = 10,
width = 84,
height = 130,
frame_count = 90,
blend_mode = "normal",
animation_speed = 1,
scale = 0.4,
tint = { r = 0.5, g = 0.5, b = 0.5, a = 0.18 },
shift = math3d.vector2.mul({-0.078125, -1.8125}, 0.1),
draw_as_glow = true
},
duration_in_ticks = burntime * 60,
damage_interval = damage_interval,
target_movement_modifier = movementrate,
damage_per_tick = { amount = dps, type = "fire" },
spread_fire_entity = spread_fire_entity,
fire_spread_cooldown = 30,
fire_spread_radius = fire_spread_radius,
stickers_per_square_meter = 10,
}
end
return firestickerutil