Skip to content

Commit

Permalink
Nothing to see here
Browse files Browse the repository at this point in the history
  • Loading branch information
Damgam committed Mar 19, 2024
1 parent 552639a commit 957817c
Show file tree
Hide file tree
Showing 13 changed files with 302 additions and 21 deletions.
31 changes: 31 additions & 0 deletions effects/custom_explosions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6117,6 +6117,37 @@ local definitions = {
},
},


boomboxboom = {
shockwave = {
air = false,
class = [[CBitmapMuzzleFlame]],
count = 1,
ground = true,
underwater = false,
water = true,
properties = {
colormap = [[0 0 0 0 1 0.95 0.9 0.09 0.6 0.55 0.35 0.25 0.18 0.11 0.07 0.008 0.10 0.08 0.04 0.006 0.06 0.04 0.02 0.005 0 0 0 0]],
dir = [[0, 1, 0]],
--gravity = [[0.0, 0.1, 0.0]],
frontoffset = 0,
fronttexture = [[explosionwave]],
length = 45,
sidetexture = [[none]],
rotParams = [[-250 r500, -80 r160, -180 r360]],
size = 3.6,
sizegrowth = [[3 r2]],
ttl = 5,
pos = [[0, 0, 0]],
drawOrder = 1,
},
},
}





}

local size = 0.7
Expand Down
4 changes: 4 additions & 0 deletions gamedata/icontypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3011,6 +3011,10 @@ local icontypes = {
bitmap = "icons/blank.png",
size = 1.04999995
},
boombox = {
bitmap = "icons/blank.png",
size = 1.0
},

blank = {
bitmap = "icons/blank.png",
Expand Down
6 changes: 4 additions & 2 deletions language/en/units.json
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,8 @@
"xmasball2_3": "Xmas ball",
"xmasball2_4": "Xmas ball",
"xmasball2_5": "Xmas ball",
"xmasball2_6": "Xmas ball"
"xmasball2_6": "Xmas ball",
"boombox": "Boombox"
},
"descriptions": {
"armaak": "Advanced Amphibious Anti-Air Bot",
Expand Down Expand Up @@ -1476,7 +1477,8 @@
"xmasball2_3": "Xmas ball",
"xmasball2_4": "Xmas ball",
"xmasball2_5": "Xmas ball",
"xmasball2_6": "Xmas ball"
"xmasball2_6": "Xmas ball",
"boombox": "Congratulations, you found an easter egg! Capture for a surprise!"
}
}
}
19 changes: 2 additions & 17 deletions license_music.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,9 @@ https://www.youtube.com/@matteodellacquamusic
Leon Devereux
https://soundcloud.com/leon-d-3

--------------------
-------------------
Music used in BAR with written permission composed by other artists.

All files in /music/legacy/*.*

all music by 'THA' or 'hamsteralliance' and is licensed under CC-BY-NC-ND [[https://soundcloud.com/hamsteralliance]]

all music by 'Professor kliq' is licensed under CC BY-NC-SA 3.0 [[http://www.professorkliq.com/]]

all music by 'Szymon Matuszewski' is licensed under CC-BY 3.0 [[http://opengameart.org/content/freemusicpack-by-szymon-matuszewski]]

all music by 'ToneScape' is licensed under CC-BY 3.0 [[https://soundcloud.com/tonescape/tonescape-displexia]]

all music by 'Vicenzo Bosa' is licensed under CC-BY 3.0 [[https://soundcloud.com/vicenzobosa]]

all music by 'Nihilore' is licensed under CC Attribution 4.0 [[https://www.nihilore.com]]

all music by 'Mateusz Morawski' is licensed under CC Attribution 3.0 and CC BY-NC-ND 3.0[[https://soundcloud.com/mateuszmorawski]]

all music by 'LunyAlex" is licensed under [put license here] [[https://lunyalex.newgrounds.com/audio/ , https://soundcloud.com/lunyalex]]

all music by 'Xenogenocide/Xenogen' is licensed under [put license here] [[https://xenogenocide.newgrounds.com/audio/]]
75 changes: 75 additions & 0 deletions luarules/gadgets/game_boombox_spawner.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
function gadget:GetInfo()
return {
name = "Boombox Spawner",
desc = "Spawns Easter Egg Boomboxes on the map that play special music when captured",
author = "Damgam",
date = "2024",
license = "GNU GPL, v2 or later",
layer = 0,
enabled = true
}
end

return -- kill it for now

if not gadgetHandler:IsSyncedCode() then
return
end

local AliveBoomboxes = {}
local SelfDQueue = {}
local positionCheckLibrary = VFS.Include("luarules/utilities/damgam_lib/position_checks.lua")

for i = 1,100 do
if math.random(1,10) == 1 then -- April Fools odds
-- if math.random(1,2137) == 1 then -- Normal Day odds
for j = 1,1000 do
local posx = math.random(math.floor(Game.mapSizeX*0.1), math.ceil(Game.mapSizeX*0.9))
local posz = math.random(math.floor(Game.mapSizeX*0.1), math.ceil(Game.mapSizeX*0.9))
local posy = Spring.GetGroundHeight(posx, posz)
if posy > 0 and positionCheckLibrary.FlatAreaCheck(posx, posy, posz, 64, 25, true) then
local boomboxID = Spring.CreateUnit("boombox", posx, posy, posz, "west", Spring.GetGaiaTeamID())
if boomboxID then
AliveBoomboxes[boomboxID] = true
break
end
end
end

end
end

function gadget:GameFrame(frame)
if frame == 1 then
for unitID, _ in pairs(AliveBoomboxes) do
Spring.SetUnitNeutral(unitID, true)
Spring.SetUnitStealth(unitID, true)
Spring.SetUnitNoMinimap(unitID, true)
Spring.SetUnitMaxHealth(unitID, 1000)
Spring.SetUnitHealth(unitID, 1000)
Spring.SetUnitSensorRadius(unitID, 'los', 0)
Spring.SetUnitSensorRadius(unitID, 'airLos', 0)
Spring.SetUnitSensorRadius(unitID, 'radar', 0)
Spring.SetUnitSensorRadius(unitID, 'sonar', 0)
end
end
if frame%60 == 0 then
for unitID, _ in pairs(AliveBoomboxes) do
Spring.SetUnitHealth(unitID, 10000000)
end
for unitID, time in pairs(SelfDQueue) do
if Spring.GetGameFrame() > time then
Spring.DestroyUnit(unitID)
SelfDQueue[unitID] = nil
AliveBoomboxes[unitID] = nil
break
end
end
end
end

function gadget:UnitTaken(unitID, unitDefID, oldTeam, newTeam)
if UnitDefs[unitDefID].name == "boombox" then
SelfDQueue[unitID] = Spring.GetGameFrame()+90
end
end
42 changes: 40 additions & 2 deletions luaui/Widgets/gui_advplayerslist_music_new.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Spring.CreateDir("music/custom/war")
Spring.CreateDir("music/custom/bossfight")
Spring.CreateDir("music/custom/gameover")
Spring.CreateDir("music/custom/menu")
Spring.CreateDir("music/custom/boombox")

----------------------------------------------------------------------
-- CONFIG
Expand Down Expand Up @@ -51,12 +52,13 @@ local warhighTracks = {}
local warlowTracks = {}
local gameoverTracks = {}
local bossFightTracks = {}
local boomboxTracks = {}

local menuTracks = {}
local loadingTracks = {}

local currentTrack
local peaceTracksPlayCounter, warhighTracksPlayCounter, warlowTracksPlayCounter, bossFightTracksPlayCounter, gameoverTracksPlayCounter
local peaceTracksPlayCounter, warhighTracksPlayCounter, warlowTracksPlayCounter, bossFightTracksPlayCounter, gameoverTracksPlayCounter, boomboxTracksPlayCounter
local fadeOutSkipTrack = false
local interruptionEnabled
local silenceTimerEnabled
Expand All @@ -80,6 +82,7 @@ local function ReloadMusicPlaylists()
local bossFightTracksNew = VFS.DirList(musicDirNew..'/bossfight', allowedExtensions)
local menuTracksNew = VFS.DirList(musicDirNew..'/menu', allowedExtensions)
local loadingTracksNew = VFS.DirList(musicDirNew..'/loading', allowedExtensions)
local boomboxTracksNew = VFS.DirList(musicDirNew..'/boombox', allowedExtensions)

-- Custom Soundtrack List
local musicDirCustom = 'music/custom'
Expand All @@ -91,7 +94,7 @@ local function ReloadMusicPlaylists()
local bossFightTracksCustom = VFS.DirList(musicDirCustom..'/bossfight', allowedExtensions)
local menuTracksCustom = VFS.DirList(musicDirCustom..'/menu', allowedExtensions)
local loadingTracksCustom = VFS.DirList(musicDirCustom..'/loading', allowedExtensions)

local boomboxTracksCustom = VFS.DirList(musicDirCustom..'/boombox', allowedExtensions)
-----------------------------------SETTINGS---------------------------------------

interruptionEnabled = Spring.GetConfigInt('UseSoundtrackInterruption', 1) == 1
Expand Down Expand Up @@ -121,6 +124,7 @@ local function ReloadMusicPlaylists()
table.append(bossFightTracks, bossFightTracksNew)
table.append(menuTracks, menuTracksNew)
table.append(loadingTracks, loadingTracksNew)
table.append(boomboxTracks, boomboxTracksNew)
end

if customSoundtrackEnabled then
Expand All @@ -133,6 +137,7 @@ local function ReloadMusicPlaylists()
table.append(bossFightTracks, bossFightTracksCustom)
table.append(menuTracks, menuTracksCustom)
table.append(loadingTracks, loadingTracksCustom)
table.append(boomboxTracks, boomboxTracksCustom)
end

if #bossFightTracks == 0 then
Expand All @@ -150,6 +155,10 @@ local function ReloadMusicPlaylists()
if #menuTracks == 0 then
menuTracks = peaceTracks
end

if #boomboxTracks == 0 then
boomboxTracks = bossFightTracks
end
----------------------------------SHUFFLE--------------------------------------

local function shuffleMusic(playlist)
Expand All @@ -173,6 +182,7 @@ local function ReloadMusicPlaylists()
warlowTracks = shuffleMusic(warlowTracks)
gameoverTracks = shuffleMusic(gameoverTracks)
bossFightTracks = shuffleMusic(bossFightTracks)
boomboxTracks = shuffleMusic(boomboxTracks)

-- Spring.Echo("----- MUSIC PLAYER PLAYLIST -----")
-- Spring.Echo("----- peaceTracks -----")
Expand Down Expand Up @@ -225,6 +235,12 @@ local function ReloadMusicPlaylists()
else
gameoverTracksPlayCounter = 1
end

if #boomboxTracks > 1 then
boomboxTracksPlayCounter = math.random(#boomboxTracks)
else
boomboxTracksPlayCounter = 1
end
end

local currentTrackList = peaceTracks
Expand Down Expand Up @@ -1076,3 +1092,25 @@ function widget:UnitFinished()
silenceTimer = silenceTimer - 5
end
end

function widget:UnitDestroyed(unitID, unitDefID, unitTeam)
if unitTeam == Spring.GetMyTeamID() and UnitDefs[unitDefID].name == "boombox" then
currentTrack = boomboxTracks[boomboxTracksPlayCounter]
boomboxTracksPlayCounter = boomboxTracksPlayCounter + 1
if not boomboxTracks[boomboxTracksPlayCounter] then
boomboxTracksPlayCounter = 1
end
Spring.StopSoundStream()
Spring.PlaySoundStream(currentTrack, 1)
playing = true
Spring.SetConfigInt('music', (playing and 1 or 0))
local playedTime, totalTime = Spring.GetSoundStreamTime()
interruptionTime = totalTime + 2
if fadeDirection then
setMusicVolume(fadeLevel)
else
setMusicVolume(100)
end
createList()
end
end
Empty file.
3 changes: 3 additions & 0 deletions music/original/credits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ Matteo Dell'Acqua:
https://matteoh2o1999.github.io/music
https://www.youtube.com/@matteodellacquamusic

Leon Devereux
https://soundcloud.com/leon-d-3

Check license_music.txt in the root of this project for more information.
Binary file added objects3d/Units/boombox.s3o
Binary file not shown.
65 changes: 65 additions & 0 deletions scripts/Units/boombox.bos
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#define TA // This is a TA script

#include "sfxtype.h"
#include "exptype.h"

piece base, emitl, emitr;



Create()
{

while (TRUE) {

turn base to y-axis <1> speed <30>;
turn base to x-axis <2> speed <20>;
move base to y-axis [2] speed [20];
sleep 45;
turn base to y-axis <-2> speed <30>;
turn base to x-axis <-4> speed <20>;
move base to y-axis [0] speed [20];
sleep 45;

emit-sfx 1024+0 from emitl;
emit-sfx 1024+0 from emitr;

sleep 240;
}

return (0);
}

#define SMOKEPIECE base
#include "smokeunit_thread_nohit.h"

SweetSpot(piecenum)
{
piecenum = base;
return (0);
}

Killed(severity, corpsetype)
{
if( severity <= 25 )
{
corpsetype = 1 ;
explode base type BITMAPONLY | NOHEATCLOUD;
return(corpsetype);
}
if( severity <= 50 )
{
corpsetype = 2 ;
explode base type BITMAPONLY | NOHEATCLOUD;
return(corpsetype);
}
if( severity <= 99 )
{
corpsetype = 3 ;
explode base type BITMAPONLY | NOHEATCLOUD;
return(corpsetype);
}
corpsetype = 3 ;
explode base type BITMAPONLY | NOHEATCLOUD;
return corpsetype;
}
Binary file added scripts/Units/boombox.cob
Binary file not shown.
Binary file added unitpics/other/boombox.dds
Binary file not shown.
Loading

0 comments on commit 957817c

Please sign in to comment.