Skip to content

Commit

Permalink
Use new play_sound() function rather than "explosion"s
Browse files Browse the repository at this point in the history
  • Loading branch information
Suprcheese committed Jan 17, 2018
1 parent e194c78 commit c90b003
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 254 deletions.
6 changes: 4 additions & 2 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ end

function playSoundForPlayer(sound, player)
local voice = settings.get_player_settings(player)["ion-cannon-voice-style"].value
player.surface.create_entity({name = sound .. "-" .. voice, position = player.position})
-- player.surface.create_entity({name = sound .. "-" .. voice, position = player.position})
player.play_sound({path = sound .. "-" .. voice})
end

function isHolding(stack, player)
Expand Down Expand Up @@ -390,7 +391,8 @@ function targetIonCannon(force, position, surface, player)
for i, player in pairs(game.connected_players) do
if settings.get_player_settings(player)["ion-cannon-play-klaxon"].value and global.klaxonTick < current_tick then
global.klaxonTick = current_tick + 60
player.surface.create_entity({name = "klaxon", position = player.position})
-- player.surface.create_entity({name = "klaxon", position = player.position})
player.play_sound({path = "ion-cannon-klaxon"})
end
end
if not player or not player.cheat_mode then
Expand Down
264 changes: 48 additions & 216 deletions prototypes/announcers.lua
Original file line number Diff line number Diff line change
@@ -1,308 +1,140 @@
data:extend({
{
type = "explosion",
type = "sound",
name = "ion-cannon-ready-CommandAndConquer",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/CommandAndConquer/IonCannonReady.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/CommandAndConquer/IonCannonReady.ogg",
volume = 0.75
},
},
},
{
type = "explosion",
type = "sound",
name = "ion-cannon-charging-CommandAndConquer",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/CommandAndConquer/IonCannonCharging.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/CommandAndConquer/IonCannonCharging.ogg",
volume = 0.75
},
},
},
{
type = "explosion",
type = "sound",
name = "select-target-CommandAndConquer",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/CommandAndConquer/SelectTarget.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/CommandAndConquer/SelectTarget.ogg",
volume = 0.75
},
},
},
{
type = "explosion",
type = "sound",
name = "unable-to-comply-CommandAndConquer",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/CommandAndConquer/UnableToComply.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/CommandAndConquer/UnableToComply.ogg",
volume = 0.75
},
},
},
})

data:extend({
{
type = "explosion",
type = "sound",
name = "ion-cannon-ready-TiberianSunCABAL",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/TiberianSunCABAL/IonCannonReady.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/TiberianSunCABAL/IonCannonReady.ogg",
volume = 0.75
},
},
},
{
type = "explosion",
type = "sound",
name = "ion-cannon-charging-TiberianSunCABAL",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/TiberianSunCABAL/IonCannonCharging.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/TiberianSunCABAL/IonCannonCharging.ogg",
volume = 0.75
},
},
},
{
type = "explosion",
type = "sound",
name = "select-target-TiberianSunCABAL",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/TiberianSunCABAL/SelectTarget.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/TiberianSunCABAL/SelectTarget.ogg",
volume = 0.75
},
},
},
{
type = "explosion",
type = "sound",
name = "unable-to-comply-TiberianSunCABAL",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/TiberianSunCABAL/UnableToComply.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/TiberianSunCABAL/UnableToComply.ogg",
volume = 0.75
},
},
},
})

data:extend({
{
type = "explosion",
type = "sound",
name = "ion-cannon-ready-TiberianSunEVA",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/TiberianSunEVA/IonCannonReady.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/TiberianSunEVA/IonCannonReady.ogg",
volume = 0.75
},
},
},
{
type = "explosion",
type = "sound",
name = "ion-cannon-charging-TiberianSunEVA",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/TiberianSunEVA/IonCannonCharging.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/TiberianSunEVA/IonCannonCharging.ogg",
volume = 0.75
},
},
},
{
type = "explosion",
type = "sound",
name = "select-target-TiberianSunEVA",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/TiberianSunEVA/SelectTarget.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/TiberianSunEVA/SelectTarget.ogg",
volume = 0.75
},
},
},
{
type = "explosion",
type = "sound",
name = "unable-to-comply-TiberianSunEVA",
flags = {"not-on-map"},
animations =
variations =
{
{
filename = "__Orbital Ion Cannon__/graphics/null.png",
priority = "low",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
animation_speed = 1
filename = "__Orbital Ion Cannon__/sound/TiberianSunEVA/UnableToComply.ogg",
volume = 0.75
},
},
light = {intensity = 0, size = 0},
sound =
{
{
filename = "__Orbital Ion Cannon__/sound/TiberianSunEVA/UnableToComply.ogg",
volume = 0.75
},
},
},
})
Loading

0 comments on commit c90b003

Please sign in to comment.