z_mirror/dancing-miku

git clone https://git.raiguard.me/z_mirror/dancing-miku

Caleb HeuerAllow miku to go to spaced5a5b6d

main
1.3 KiB42 linesraw
1local sprite_frames = 30
2local sound_frames = 145
3local sprite_fps = 30 -- If this is 60 then it doesn't work... WTF?
4local overall_frames = sprite_fps * sound_frames
5
6local overall_frame = 0
7
8for sound_frame = 1, sound_frames do
9  for sprite_frame = 1, sprite_fps do
10    overall_frame = overall_frame + 1
11    local item = {
12      type = "item",
13      name = "miku-" .. overall_frame,
14      localised_name = { "item-name.miku" },
15      icon = "__dancing-miku__/graphics/items/miku/" .. ((sprite_frame % sprite_frames) + 1) .. ".png",
16      icon_size = 252,
17      hidden = true,
18      stack_size = 1,
19      flags = { "not-stackable" },
20      spoil_ticks = 1,
21      spoil_result = "miku-" .. ((overall_frame % overall_frames) + 1),
22      auto_recycle = false,
23      send_to_orbit_mode = "automated",
24    }
25    if sprite_frame == 1 then
26      item.spoil_to_trigger_result = {
27        trigger = {
28          type = "direct",
29          action_delivery = {
30            type = "instant",
31            source_effects = {
32              type = "play-sound",
33              sound = { filename = "__dancing-miku__/sounds/ievan-polkka/" .. sound_frame .. ".ogg", volume = 0.5 },
34            },
35          },
36        },
37        items_per_trigger = 1,
38      }
39    end
40    data:extend({ item })
41  end
42end