Skip to content

Commit

Permalink
v2.1 here you go!
Browse files Browse the repository at this point in the history
  • Loading branch information
MikuAuahDark committed Mar 6, 2018
1 parent be0900c commit c66b3e3
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 434 deletions.
48 changes: 25 additions & 23 deletions AquaShine/TempDirectory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
-- standard Lua io.* and (FILE*):* methods

local AquaShine = ...
local has_ffi, ffi = pcall(require, "ffi")
local love = require("love")
local ffi = require("ffi")
local temp_dir

if AquaShine.OperatingSystem == "iOS" then
Expand All @@ -26,31 +27,32 @@ if AquaShine.OperatingSystem == "iOS" then
end
elseif AquaShine.OperatingSystem == "Windows" then
-- Two techniques (the former is more reliable)
if has_ffi then
ffi.cdef "uint32_t __stdcall GetTempPathA(uint32_t, char*);"

local buf = ffi.new("char[260]")
local size = ffi.C.GetTempPathA(259, buf)
assert(size > 0, "GetTempPathA fail")

for i = 0, size - 1 do
if buf[i] == 92 then
buf[i] = 47
end
end

if buf[size - 1] == 47 then
buf[size - 1] = 0
size = size - 1
ffi.cdef "uint32_t __stdcall GetTempPathA(uint32_t, char*);"

local buf = ffi.new("char[260]")
local size = ffi.C.GetTempPathA(259, buf)
assert(size > 0, "GetTempPathA fail")

for i = 0, size - 1 do
if buf[i] == 92 then
buf[i] = 47
end

temp_dir = ffi.string(buf, size)
else
temp_dir = os.getenv("TMP") or os.getenv("TEMP") or os.getenv("SYSTEMDRIVE").."/Windows/temp"
end

if buf[size - 1] == 47 then
buf[size - 1] = 0
size = size - 1
end

temp_dir = ffi.string(buf, size)
elseif AquaShine.OperatingSystem == "Android" then
-- Make sure to load FFmpegExt at first
temp_dir = AquaShine._AndroidAppDir.."/cache"
-- Just read /proc/self/cmdline then construct /data/data/package/cache
-- FIXME: Probably not work in Android 6.0 or later!
local f = io.open("/proc/self/cmdline", "r")
local package = f:read("*a")

temp_dir = "/data/data/"..package.."/cache"
f:close()
else -- Linux & Mac OS X
temp_dir = (os.getenv("TMPDIR") or
os.getenv("TMP") or
Expand Down
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Live Simulator: 2 uses these external libraries to run:

Live Simulator: 2 uses these external libraries if available:

* [FFmpeg 3.2](http://ffmpeg.org/) (Windows & Android)
* [FFmpeg 3.x](http://ffmpeg.org/) (libavcodec 57) (always available in Windows)

Controls
========
Expand Down Expand Up @@ -69,19 +69,6 @@ Supported Beatmaps

* SIFTrain beatmap, both original one and "extended" one were supported.

Screenshots
===========

Beatmap: [Thrilling One Way Custom Beatmap](https://www.youtube.com/watch?v=xfWGjFo5dy8)

Note circle Pre-5.0

![Note circle Pre-5.0](http://i.imgur.com/qTe7zaW.png)

Note circle 5.0 style

![Note circle 5.0 style](http://i.imgur.com/6GbKrrw.png)

Disclaimer
==========

Expand All @@ -102,6 +89,6 @@ Motoya L Maru font license.

Live Simulator: 2 uses image asset from Love Live! School Idol Festival.

Live Simulator: 2 uses FFmpeg when available, and it's licensed under GNU GPLv3
Live Simulator: 2 uses FFmpeg when available, and it's licensed under GNU GPLv3 (or GNU LGPL, depending on used binaries). Windows version ships with FFmpeg 3.0 which is licensed under GNU LGPLv3 or later

Please see respective files (or website) for license of those libraries.
46 changes: 37 additions & 9 deletions note/note.lua → note.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
-- Part of Live Simulator: 2
-- See copyright notice in main.lua

local AquaShine = ...
local love = require("love")
local DEPLS, AquaShine = ...
local love = love
local EffectPlayer = require("effect_player")
local bit = require("bit")
local Yohane = require("Yohane")
local tween = require("tween")
local Note = {
Expand Down Expand Up @@ -36,7 +37,6 @@ local Note = {
},
TimingRotation = math.random(0, 11) -- Like clock
}
local NoteBombEffect = AquaShine.LoadModule("note.bomb", Note)

-- Import some data from DEPLS
local ScoreBase = DEPLS.ScoreBase
Expand All @@ -47,6 +47,7 @@ local distance = DEPLS.Distance
local angle_from = DEPLS.AngleFrom
local storyboard_callback = DEPLS.StoryboardCallback
local floor = math.floor
local notes_bomb = Yohane.newFlashFromFilename("flash/live_notes_bomb.flsh", "ef_317")
local hold_effect = Yohane.newFlashFromFilename("flash/live_notes_hold_effect.flsh", "ef_326_effect")

local NoteSoundAccumulation = AquaShine.LoadConfig("NS_ACCUMULATION", 0) == 1
Expand Down Expand Up @@ -77,10 +78,37 @@ local PredefinedLNEffectRotation = {
0
}

local NoteBombEffect = {}
NoteBombEffect._common_meta = {__index = NoteBombEffect}

function NoteBombEffect.Create(x, y)
local out = {}
out.flash = notes_bomb:clone()
out.x = x
out.y = y

out.flash:jumpToLabel("bomb")
return (setmetatable(out, NoteBombEffect._common_meta))
end

function NoteBombEffect:Update(deltaT)
if not(self.flash:isFrozen()) then
self.flash:update(deltaT)

return false
else
return true
end
end

function NoteBombEffect:Draw()
self.flash:draw(self.x, self.y)
end

local function internal_simulnote_check(timing_sec, i, is_swing)
local j = 1
local notedata = Note[i][j]

while notedata ~= nil do
if
floor(notedata.ZeroAccuracyTime) == floor(timing_sec) and
Expand All @@ -89,7 +117,7 @@ local function internal_simulnote_check(timing_sec, i, is_swing)
notedata.SimulNote = true
return true
end

j = j + 1
notedata = Note[i][j]
end
Expand All @@ -104,7 +132,7 @@ end
--! @param swing Is the note we're comparing to is swing note?
--! @returns `true` if there's one, false otherwise
--! @note This function modifies the note object that already queued if necessary
function Note.CheckSimulNote(timing_sec, swing)
local function CheckSimulNote(timing_sec, swing)
return
internal_simulnote_check(timing_sec, 1, swing) or
internal_simulnote_check(timing_sec, 2, swing) or
Expand Down Expand Up @@ -1009,11 +1037,11 @@ function Note.SetTouch(pos, touchid, release, previous)

if ElapsedTime >= noteobj.ZeroAccuracyTime - noteobj.NotesSpeed then
noteobj:SetTouchID(touchid)

if noteobj.Delete then
score = score + ScoreBase * noteobj.ScoreMultipler * noteobj.ScoreMultipler2 * (noteobj.SlideNote and 0.5 or 1)
table.remove(Note[pos], 1)

-- Update combo counter
if ComboCounter.Reset == true then
ComboCounter.CurrentCombo = 0
Expand All @@ -1023,7 +1051,7 @@ function Note.SetTouch(pos, touchid, release, previous)
end
Note.NoteRemaining = Note.NoteRemaining - 1
Note.HighestCombo = math.max(ComboCounter.CurrentCombo, Note.HighestCombo)

ComboCounter.Replay = true
end
end
Expand Down
36 changes: 0 additions & 36 deletions note/bomb.lua

This file was deleted.

Loading

0 comments on commit c66b3e3

Please sign in to comment.