Skip to content

Commit ff49d06

Browse files
committed
Add radius visualization & tooltips to targeting device.
1 parent 829b7df commit ff49d06

File tree

1 file changed

+149
-11
lines changed

1 file changed

+149
-11
lines changed

prototypes/entities.lua

+149-11
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,101 @@ crosshairsPicture = {
88
frame_count = 1
99
}
1010

11-
data:extend({
11+
local ion_cannon_targeter = util.table.deepcopy(data.raw["ammo-turret"]["gun-turret"])
12+
13+
ion_cannon_targeter.name = "ion-cannon-targeter"
14+
ion_cannon_targeter.icon = "__Orbital Ion Cannon__/graphics/crosshairs.png"
15+
ion_cannon_targeter.flags = {"placeable-neutral", "player-creation","placeable-off-grid"}
16+
ion_cannon_targeter.collision_mask = {}
17+
ion_cannon_targeter.max_health = 0
18+
ion_cannon_targeter.inventory_size = 0
19+
ion_cannon_targeter.collision_box = {{ 0, 0}, {0, 0}}
20+
ion_cannon_targeter.selection_box = {{ 0, 0}, {0, 0}}
21+
ion_cannon_targeter.folded_animation =
22+
{
23+
layers =
24+
{
25+
{
26+
filename = "__Orbital Ion Cannon__/graphics/null.png",
27+
priority = "medium",
28+
width = 32,
29+
height = 32,
30+
frame_count = 1,
31+
line_length = 1,
32+
run_mode = "forward",
33+
axially_symmetrical = false,
34+
direction_count = 1,
35+
shift = {0, 0}
36+
}
37+
}
38+
}
39+
ion_cannon_targeter.base_picture =
40+
{
41+
layers =
1242
{
13-
type = "container",
14-
name = "ion-cannon-targeter",
15-
icon = "__Orbital Ion Cannon__/graphics/crosshairs.png",
16-
flags = {"placeable-neutral", "player-creation","placeable-off-grid"},
17-
collision_mask = {},
18-
max_health = 0,
19-
corpse = "small-remnants",
20-
inventory_size = 1,
21-
picture =
2243
{
2344
filename = "__Orbital Ion Cannon__/graphics/crosshairs64.png",
45+
line_length = 1,
2446
width = 64,
2547
height = 64,
48+
frame_count = 1,
49+
axially_symmetrical = false,
50+
direction_count = 1,
2651
shift = {0, 0}
2752
}
28-
},
53+
}
54+
}
55+
ion_cannon_targeter.attack_parameters =
56+
{
57+
type = "projectile",
58+
ammo_category = "melee",
59+
cooldown = 1,
60+
projectile_center = {0, 0},
61+
projectile_creation_distance = 1.4,
62+
range = ionCannonRadius,
63+
damage_modifier = 1,
64+
ammo_type =
65+
{
66+
type = "projectile",
67+
category = "melee",
68+
energy_consumption = "0J",
69+
action =
70+
{
71+
{
72+
type = "direct",
73+
action_delivery =
74+
{
75+
{
76+
type = "projectile",
77+
projectile = "dummy-crosshairs",
78+
starting_speed = 0.28
79+
}
80+
}
81+
}
82+
}
83+
}
84+
}
85+
86+
data:extend({ion_cannon_targeter})
87+
88+
data:extend({
89+
-- {
90+
-- type = "container",
91+
-- name = "ion-cannon-targeter",
92+
-- icon = "__Orbital Ion Cannon__/graphics/crosshairs.png",
93+
-- flags = {"placeable-neutral", "player-creation","placeable-off-grid"},
94+
-- collision_mask = {},
95+
-- max_health = 0,
96+
-- corpse = "small-remnants",
97+
-- inventory_size = 1,
98+
-- picture =
99+
-- {
100+
-- filename = "__Orbital Ion Cannon__/graphics/crosshairs64.png",
101+
-- width = 64,
102+
-- height = 64,
103+
-- shift = {0, 0}
104+
-- }
105+
-- },
29106

30107
{
31108
type = "projectile",
@@ -152,6 +229,67 @@ data:extend({
152229
}
153230
},
154231

232+
{
233+
type = "projectile",
234+
name = "dummy-crosshairs",
235+
flags = {"not-on-map"},
236+
acceleration = .0009 / (HeatupTimeMultiplier * HeatupTimeMultiplier),
237+
action =
238+
{
239+
{
240+
type = "area",
241+
perimeter = ionCannonRadius * 0.8,
242+
action_delivery =
243+
{
244+
type = "instant",
245+
target_effects =
246+
{
247+
{
248+
type = "damage",
249+
damage = {amount = ionCannonLaserDamage, type = "laser"}
250+
},
251+
{
252+
type = "damage",
253+
damage = {amount = ionCannonExplosionDamage, type = "explosion"}
254+
}
255+
}
256+
}
257+
},
258+
{
259+
type = "area",
260+
perimeter = ionCannonRadius,
261+
action_delivery =
262+
{
263+
type = "instant",
264+
target_effects =
265+
{
266+
{
267+
type = "create-fire",
268+
entity_name = "fire-flame"
269+
}
270+
}
271+
}
272+
}
273+
},
274+
light = {intensity = 0, size = 0},
275+
animation =
276+
{
277+
filename = "__Orbital Ion Cannon__/graphics/null.png",
278+
priority = "low",
279+
width = 32,
280+
height = 32,
281+
frame_count = 1
282+
},
283+
shadow =
284+
{
285+
filename = "__Orbital Ion Cannon__/graphics/null.png",
286+
priority = "low",
287+
width = 32,
288+
height = 32,
289+
frame_count = 1
290+
}
291+
},
292+
155293
{
156294
type = "explosion",
157295
name = "klaxon",

0 commit comments

Comments
 (0)