mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-04 05:13:19 +00:00
initial commit. This is icculus version 5542b94cae02a6333845854bbbd1abe0a259f1a4
This commit is contained in:
commit
3096eaf5e2
2519 changed files with 816064 additions and 0 deletions
130
game_scripts/_mods/jukebox/scripts/jukeboxinclude.lua
Normal file
130
game_scripts/_mods/jukebox/scripts/jukeboxinclude.lua
Normal file
|
@ -0,0 +1,130 @@
|
|||
-- Copyright (C) 2007, 2010 - Bit-Blot
|
||||
--
|
||||
-- This file is part of Aquaria.
|
||||
--
|
||||
-- Aquaria is free software; you can redistribute it and/or
|
||||
-- modify it under the terms of the GNU General Public License
|
||||
-- as published by the Free Software Foundation; either version 2
|
||||
-- of the License, or (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
--
|
||||
-- See the GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
if not v then v = {} end
|
||||
|
||||
SONG_LIST = {
|
||||
"abyss",
|
||||
"ancienttest",
|
||||
"arboreal",
|
||||
"archaic",
|
||||
"bblogo",
|
||||
"bigboss",
|
||||
"brightwaters",
|
||||
"cathedral",
|
||||
"cave",
|
||||
"druniaddance",
|
||||
"endingpart1",
|
||||
"fallenbreed",
|
||||
"fallofmithalas",
|
||||
"flyaway",
|
||||
"forestgod",
|
||||
"gullet",
|
||||
"hopeofwinter",
|
||||
"icywaters",
|
||||
"inevitable",
|
||||
"licave",
|
||||
"light",
|
||||
"losttothewaves",
|
||||
"lucien",
|
||||
"marchofthekrotites",
|
||||
"miniboss",
|
||||
"mithala",
|
||||
"mithalaanger",
|
||||
"mithalaend",
|
||||
"mithalapeace",
|
||||
"moment",
|
||||
"mystery",
|
||||
"openwaters",
|
||||
"openwaters2",
|
||||
"openwaters3",
|
||||
"prelude",
|
||||
"prometheus",
|
||||
"remains",
|
||||
"seahorse",
|
||||
"sunken",
|
||||
"sunkencity",
|
||||
"suntemple",
|
||||
"sunworm",
|
||||
"sunwormcave",
|
||||
"superflyremix",
|
||||
"test",
|
||||
"thebody",
|
||||
"theend",
|
||||
"title",
|
||||
"veil",
|
||||
"worship1",
|
||||
"worship2",
|
||||
"worship3",
|
||||
"worship4",
|
||||
"worship5",
|
||||
"youth",
|
||||
}
|
||||
|
||||
--[[
|
||||
DEFAULT_WATERLEVEL = 0
|
||||
|
||||
OVERRIDE_WATERLEVEL = {
|
||||
["ancienttest"] = -2700,
|
||||
}
|
||||
--]]
|
||||
|
||||
function jukebox_initButton(me)
|
||||
node_setCursorActivation(me, true)
|
||||
node_setCatchActions(me, true)
|
||||
end
|
||||
|
||||
function jukebox_doButtonAction(me, action, state, transitions, isdefault)
|
||||
if isNestedMain() then return end
|
||||
if getNodeToActivate() == me and state == 1 then
|
||||
local name = transitions[action]
|
||||
if name then
|
||||
debugLog("jukebox_doButtonAction : "..node_getName(me).." -- "..action.." -> "..name)
|
||||
local node = getNode(name)
|
||||
setNodeToActivate(node)
|
||||
setMousePos(toWindowFromWorld(node_x(node), node_y(node)-20))
|
||||
end
|
||||
return false
|
||||
end
|
||||
if getNodeToActivate() == 0 and state == 1 and isdefault then
|
||||
if action == ACTION_MENURIGHT or action == ACTION_MENULEFT or action == ACTION_MENUUP or action == ACTION_MENUDOWN then
|
||||
setNodeToActivate(me)
|
||||
setMousePos(toWindowFromWorld(node_x(me), node_y(me)-20))
|
||||
end
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function jukebox_getSong()
|
||||
return getStory()
|
||||
end
|
||||
|
||||
function jukebox_playSong(index)
|
||||
setStory(index)
|
||||
local songName = SONG_LIST[index]
|
||||
setControlHint("Now playing: "..songName)
|
||||
playMusic(songName)
|
||||
|
||||
--[[
|
||||
local waterLevel = getWaterLevel()
|
||||
local newWaterLevel = OVERRIDE_WATERLEVEL[songName] or DEFAULT_WATERLEVEL
|
||||
if newWaterLevel ~= waterLevel then setWaterLevel(newWaterLevel) end
|
||||
--]]
|
||||
end
|
62
game_scripts/_mods/jukebox/scripts/node_jukebox-next.lua
Normal file
62
game_scripts/_mods/jukebox/scripts/node_jukebox-next.lua
Normal file
|
@ -0,0 +1,62 @@
|
|||
-- Copyright (C) 2007, 2010 - Bit-Blot
|
||||
--
|
||||
-- This file is part of Aquaria.
|
||||
--
|
||||
-- Aquaria is free software; you can redistribute it and/or
|
||||
-- modify it under the terms of the GNU General Public License
|
||||
-- as published by the Free Software Foundation; either version 2
|
||||
-- of the License, or (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
--
|
||||
-- See the GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
if not v then v = {} end
|
||||
if not AQUARIA_VERSION then dofile("scripts/entities/entityinclude.lua") end
|
||||
|
||||
dofile(appendUserDataPath("_mods/jukebox/scripts/jukeboxinclude.lua"))
|
||||
|
||||
--[[
|
||||
Button layout on screen:
|
||||
|
||||
RAND
|
||||
PREV *NEXT*
|
||||
|
||||
EXIT
|
||||
--]]
|
||||
|
||||
local navmap = {
|
||||
[ACTION_MENUUP] = "jukebox-random",
|
||||
[ACTION_MENULEFT] = "jukebox-previous",
|
||||
[ACTION_MENUDOWN] = "jukebox-quit"
|
||||
}
|
||||
|
||||
function init(me)
|
||||
jukebox_initButton(me)
|
||||
end
|
||||
|
||||
function action(me, action, state)
|
||||
if isNestedMain() then return end
|
||||
return jukebox_doButtonAction(me, action, state, navmap)
|
||||
end
|
||||
|
||||
function activate(me)
|
||||
if isNestedMain() then return end
|
||||
|
||||
--playSfx("TitleAction")
|
||||
spawnParticleEffect("TitleEffect1", node_x(me), node_y(me))
|
||||
watch(0.5)
|
||||
|
||||
local n = jukebox_getSong()
|
||||
if n < #SONG_LIST then n = n + 1 else n = 1 end
|
||||
jukebox_playSong(n)
|
||||
end
|
||||
|
||||
function update(me, dt)
|
||||
end
|
62
game_scripts/_mods/jukebox/scripts/node_jukebox-previous.lua
Normal file
62
game_scripts/_mods/jukebox/scripts/node_jukebox-previous.lua
Normal file
|
@ -0,0 +1,62 @@
|
|||
-- Copyright (C) 2007, 2010 - Bit-Blot
|
||||
--
|
||||
-- This file is part of Aquaria.
|
||||
--
|
||||
-- Aquaria is free software; you can redistribute it and/or
|
||||
-- modify it under the terms of the GNU General Public License
|
||||
-- as published by the Free Software Foundation; either version 2
|
||||
-- of the License, or (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
--
|
||||
-- See the GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
if not v then v = {} end
|
||||
if not AQUARIA_VERSION then dofile("scripts/entities/entityinclude.lua") end
|
||||
|
||||
dofile(appendUserDataPath("_mods/jukebox/scripts/jukeboxinclude.lua"))
|
||||
|
||||
--[[
|
||||
Button layout on screen:
|
||||
|
||||
RAND
|
||||
*PREV* NEXT
|
||||
|
||||
EXIT
|
||||
--]]
|
||||
|
||||
local navmap = {
|
||||
[ACTION_MENUUP] = "jukebox-random",
|
||||
[ACTION_MENURIGHT] = "jukebox-next",
|
||||
[ACTION_MENUDOWN] = "jukebox-quit"
|
||||
}
|
||||
|
||||
function init(me)
|
||||
jukebox_initButton(me)
|
||||
end
|
||||
|
||||
function action(me, action, state)
|
||||
if isNestedMain() then return end
|
||||
return jukebox_doButtonAction(me, action, state, navmap)
|
||||
end
|
||||
|
||||
function activate(me)
|
||||
if isNestedMain() then return end
|
||||
|
||||
--playSfx("TitleAction")
|
||||
spawnParticleEffect("TitleEffect1", node_x(me), node_y(me))
|
||||
watch(0.5)
|
||||
|
||||
local n = jukebox_getSong()
|
||||
if n > 1 then n = n - 1 else n = #SONG_LIST end
|
||||
jukebox_playSong(n)
|
||||
end
|
||||
|
||||
function update(me, dt)
|
||||
end
|
76
game_scripts/_mods/jukebox/scripts/node_jukebox-quit.lua
Normal file
76
game_scripts/_mods/jukebox/scripts/node_jukebox-quit.lua
Normal file
|
@ -0,0 +1,76 @@
|
|||
-- Copyright (C) 2007, 2010 - Bit-Blot
|
||||
--
|
||||
-- This file is part of Aquaria.
|
||||
--
|
||||
-- Aquaria is free software; you can redistribute it and/or
|
||||
-- modify it under the terms of the GNU General Public License
|
||||
-- as published by the Free Software Foundation; either version 2
|
||||
-- of the License, or (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
--
|
||||
-- See the GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
if not v then v = {} end
|
||||
if not AQUARIA_VERSION then dofile("scripts/entities/entityinclude.lua") end
|
||||
|
||||
dofile(appendUserDataPath("_mods/jukebox/scripts/jukeboxinclude.lua"))
|
||||
|
||||
--[[
|
||||
Button layout on screen:
|
||||
|
||||
RAND
|
||||
PREV NEXT
|
||||
|
||||
*EXIT*
|
||||
--]]
|
||||
|
||||
local navmap = {
|
||||
[ACTION_MENUUP] = "jukebox-random",
|
||||
[ACTION_MENULEFT] = "jukebox-previous",
|
||||
[ACTION_MENURIGHT] = "jukebox-next"
|
||||
}
|
||||
|
||||
function init(me)
|
||||
node_setCursorActivation(me, true)
|
||||
node_setCatchActions(me, true)
|
||||
end
|
||||
|
||||
function action(me, action, state)
|
||||
if isNestedMain() then return end
|
||||
return jukebox_doButtonAction(me, action, state, navmap)
|
||||
end
|
||||
|
||||
function activate(me)
|
||||
if isNestedMain() then return end
|
||||
|
||||
playSfx("TitleAction")
|
||||
spawnParticleEffect("TitleEffect1", node_x(me), node_y(me))
|
||||
watch(0.5)
|
||||
|
||||
local doQuit = false
|
||||
|
||||
if confirm("", "exit") then
|
||||
doQuit = true
|
||||
end
|
||||
|
||||
setNodeToActivate(0)
|
||||
|
||||
if doQuit then
|
||||
fadeOutMusic(2)
|
||||
toggleCursor(false)
|
||||
fade(1, 2, 0, 0, 0)
|
||||
watch(2)
|
||||
watch(0.5)
|
||||
goToTitle()
|
||||
end
|
||||
end
|
||||
|
||||
function update(me, dt)
|
||||
end
|
67
game_scripts/_mods/jukebox/scripts/node_jukebox-random.lua
Normal file
67
game_scripts/_mods/jukebox/scripts/node_jukebox-random.lua
Normal file
|
@ -0,0 +1,67 @@
|
|||
-- Copyright (C) 2007, 2010 - Bit-Blot
|
||||
--
|
||||
-- This file is part of Aquaria.
|
||||
--
|
||||
-- Aquaria is free software; you can redistribute it and/or
|
||||
-- modify it under the terms of the GNU General Public License
|
||||
-- as published by the Free Software Foundation; either version 2
|
||||
-- of the License, or (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
--
|
||||
-- See the GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
if not v then v = {} end
|
||||
if not AQUARIA_VERSION then dofile("scripts/entities/entityinclude.lua") end
|
||||
|
||||
dofile(appendUserDataPath("_mods/jukebox/scripts/jukeboxinclude.lua"))
|
||||
|
||||
--[[
|
||||
Button layout on screen:
|
||||
|
||||
*RAND*
|
||||
PREV NEXT
|
||||
|
||||
EXIT
|
||||
--]]
|
||||
|
||||
local navmap = {
|
||||
[ACTION_MENULEFT] = "jukebox-previous",
|
||||
[ACTION_MENURIGHT] = "jukebox-next",
|
||||
[ACTION_MENUDOWN] = "jukebox-quit"
|
||||
}
|
||||
|
||||
function init(me)
|
||||
jukebox_initButton(me)
|
||||
end
|
||||
|
||||
function action(me, action, state)
|
||||
if isNestedMain() then return end
|
||||
return jukebox_doButtonAction(me, action, state, navmap, true)
|
||||
end
|
||||
|
||||
function activate(me)
|
||||
if isNestedMain() then return end
|
||||
|
||||
--playSfx("TitleAction")
|
||||
spawnParticleEffect("TitleEffect1", node_x(me), node_y(me))
|
||||
watch(0.5)
|
||||
|
||||
local n = jukebox_getSong()
|
||||
local count = #SONG_LIST
|
||||
if count > 1 then
|
||||
local n2 = math.random(count-1)
|
||||
if n2 >= n then n2 = n2 + 1 end
|
||||
n = n2
|
||||
end
|
||||
jukebox_playSong(n)
|
||||
end
|
||||
|
||||
function update(me, dt)
|
||||
end
|
84
game_scripts/_mods/jukebox/scripts/node_jukebox.lua
Normal file
84
game_scripts/_mods/jukebox/scripts/node_jukebox.lua
Normal file
|
@ -0,0 +1,84 @@
|
|||
-- Copyright (C) 2007, 2010 - Bit-Blot
|
||||
--
|
||||
-- This file is part of Aquaria.
|
||||
--
|
||||
-- Aquaria is free software; you can redistribute it and/or
|
||||
-- modify it under the terms of the GNU General Public License
|
||||
-- as published by the Free Software Foundation; either version 2
|
||||
-- of the License, or (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
--
|
||||
-- See the GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
if not v then v = {} end
|
||||
if not AQUARIA_VERSION then dofile("scripts/entities/entityinclude.lua") end
|
||||
|
||||
dofile(appendUserDataPath("_mods/jukebox/scripts/jukeboxinclude.lua"))
|
||||
|
||||
v.naija = 0
|
||||
v.mbDown = false
|
||||
|
||||
function init(me)
|
||||
resetContinuity()
|
||||
setOverrideMusic("")
|
||||
|
||||
v.naija = getNaija()
|
||||
|
||||
entity_heal(v.naija, 999)
|
||||
cam_toNode(me)
|
||||
cam_setPosition(node_x(me), node_y(me))
|
||||
entity_setInvincible(v.naija, true)
|
||||
entity_setState(v.naija, STATE_TITLE)
|
||||
|
||||
|
||||
setMousePos(400, 550)
|
||||
|
||||
disableInput()
|
||||
toggleCursor(true, 0.1)
|
||||
overrideZoom(1.0)
|
||||
|
||||
resetTimer()
|
||||
|
||||
local throne = getNode("naija")
|
||||
avatar_toggleCape(false)
|
||||
entity_animate(v.naija, "sitthrone", -1, 4)
|
||||
entity_setPosition(v.naija, node_x(throne), node_y(throne))
|
||||
|
||||
setMousePos(400, 550)
|
||||
|
||||
fade(1, 0)
|
||||
fade(0, 1)
|
||||
fade2(0, 2, 1, 1, 1)
|
||||
|
||||
jukebox_playSong(math.random(#SONG_LIST))
|
||||
end
|
||||
|
||||
function update(me, dt)
|
||||
cam_setPosition(node_x(me), node_y(me))
|
||||
if isInputEnabled() then
|
||||
disableInput()
|
||||
toggleCursor(true, 0.1)
|
||||
end
|
||||
|
||||
local scale = 800.0/1024.0 + 0.01
|
||||
|
||||
overrideZoom(scale, 0)
|
||||
|
||||
if (isLeftMouse() or isRightMouse()) and not v.mbDown then
|
||||
v.mbDown = true
|
||||
elseif (not isLeftMouse() and not isRightMouse()) and v.mbDown then
|
||||
v.mbDown = false
|
||||
local node = getNodeToActivate()
|
||||
setNodeToActivate(0)
|
||||
if node ~= 0 then
|
||||
node_activate(node, 0)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue