-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mirin Template Version 5.0.0 New Features: * Everything is in real lua files. * No need to download specialized plugins to get syntax highlighting. * Use `require` to load more .lua files. * There are `outIn` eases now. * Clearer function names: * `func` is now three functions: `func`, `perframe`, and `func_ease` * New `blendease` function! * It's kind of like `flip`, but takes two eases and combines them smoothly! (the precise definition is `blendease(a, b)(t) = smoothstep(t, a(t), b(t))`) * Ease params are coded better internally, but it means you have to call them with a `:` now. (`outBack:param(1.1)` instead of `outBack.param(1.1)`) * Testing! * Versions in the future should be much less likely to break stuff, because I have code to test the mirin template using `busted`. Bug Fixes: * No more `ScreenReadyCommand` * Files will work in Marathon Mode, and with `ctrl+r` * Probably more. I wasn't keeping track.
- Loading branch information
Showing
37 changed files
with
3,608 additions
and
1,932 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
modules = { | ||
["template.template"] = "./template/template.lua", | ||
["template.ease"] = "./template/ease.lua", | ||
["template.std"] = "./template/std.lua", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", | ||
"Lua.diagnostics.disable": [ | ||
"ambiguity-1" | ||
], | ||
"Lua.diagnostics.globals": [ | ||
"xero" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
VER=$1 | ||
if [[ -z "$VER" ]] | ||
then | ||
VER="unknown" | ||
fi | ||
FILENAME=mirin-template-"$VER" | ||
|
||
mkdir "$FILENAME" | ||
cp -r Song.ogg Song.sm lua template "$FILENAME" | ||
cd "$FILENAME" | ||
|
||
sed 's/$VERSION/'"$VER"'/' template/main.xml -i | ||
|
||
cd .. | ||
zip "$FILENAME".zip "$FILENAME" -r | ||
rm "$FILENAME" -rf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if busted --coverage --suppress-pending; | ||
then | ||
luacov | ||
awk 't&&(--l<0){print}/Summary/{t=1;l=1}' luacov.report.out | ||
rm luacov.report.out | ||
fi | ||
rm luacov.stats.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Layer Type = "ActorFrame"><children> | ||
<Layer Type = "ActorProxy" Name = "PC[1]" /> | ||
<Layer Type = "ActorProxy" Name = "PC[2]" /> | ||
<Layer Type = "ActorProxy" Name = "PJ[1]" /> | ||
<Layer Type = "ActorProxy" Name = "PJ[2]" /> | ||
<Layer Type = "ActorProxy" Name = "PP[1]" /> | ||
<Layer Type = "ActorProxy" Name = "PP[2]" /> | ||
</children></Layer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
if not P1 or not P2 then | ||
backToSongWheel('Two Player Mode Required') | ||
return | ||
end | ||
|
||
-- judgment / combo proxies | ||
for pn = 1, 2 do | ||
setupJudgeProxy(PJ[pn], P[pn]:GetChild('Judgment'), pn) | ||
setupJudgeProxy(PC[pn], P[pn]:GetChild('Combo'), pn) | ||
end | ||
-- player proxies | ||
for pn = 1, #PP do | ||
PP[pn]:SetTarget(P[pn]) | ||
P[pn]:hidden(1) | ||
end | ||
-- your code goes here here: | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
---@diagnostic disable: undefined-global | ||
local helper = require('spec.helper') | ||
local update = helper.update | ||
|
||
describe('acc', function() | ||
|
||
before_each(function() | ||
helper.reset() | ||
helper.init() | ||
end) | ||
|
||
after_each(function() | ||
xero = nil | ||
end) | ||
|
||
it('sets values at the right time', function() | ||
xero.acc{1, 100, 'bumpy'} | ||
update(0.5) | ||
assert.equal(nil, helper.get_mod('bumpy')) | ||
update(1) | ||
assert.equal('100', helper.get_mod('bumpy')) | ||
end) | ||
|
||
it('adds when called multiple times', function() | ||
xero.acc{1, 100, 'bumpy'} | ||
xero.acc{1, 100, 'bumpy'} | ||
xero.acc{1, 100, 'bumpy'} | ||
xero.acc{1, 100, 'bumpy'} | ||
xero.acc{1, 100, 'bumpy'} | ||
update(0.5) | ||
assert.equal(nil, helper.get_mod('bumpy')) | ||
update(1) | ||
assert.equal('500', helper.get_mod('bumpy')) | ||
end) | ||
|
||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
---@diagnostic disable: undefined-global | ||
local helper = require 'spec.helper' | ||
local update = helper.update | ||
|
||
describe('add', function() | ||
|
||
before_each(function() helper.reset(); helper.init() end) | ||
after_each(function() xero = nil end) | ||
|
||
it('should add to the amount', function() | ||
xero.add {0, 4, xero.inOutExpo, 100, 'bumpyx'} | ||
xero.add {0, 4, xero.inOutExpo, 100, 'bumpyx'} | ||
xero.add {0, 4, xero.inOutExpo, 100, 'bumpyx'} | ||
update(4) | ||
assert.equal('300', helper.get_mod('bumpyx')) | ||
end) | ||
it('should be player specific', function() | ||
xero.add {0, 1, xero.outExpo, 100, 'dizzy'} | ||
xero.add {0, 1, xero.outExpo, 100, 'dizzy', plr = 1} | ||
xero.add {0, 1, xero.outExpo, 100, 'dizzy', plr = {1, 2}} | ||
xero.add {0, 1, xero.outExpo, -100, 'dizzy', plr = 2} | ||
update(1) | ||
assert.equal('300', helper.get_mod('dizzy', 1)) | ||
assert.equal('100', helper.get_mod('dizzy', 2)) | ||
end) | ||
it('should detect missing beats', function() | ||
assert.errors(function() xero.add {nil, 4, xero.inOutExpo, 100, 'bumpyx'} end) | ||
end) | ||
it('should detect missing lengths', function() | ||
assert.errors(function() xero.add {0, nil, xero.inOutExpo, 100, 'bumpyx'} end) | ||
end) | ||
it('should detect missing eases', function() | ||
assert.errors(function() xero.add {0, 4, nil, 100, 'bumpyx'} end) | ||
end) | ||
it('should detect missing mod percents', function() | ||
assert.errors(function() xero.add {0, 4, xero.inOutExpo, nil, 'bumpyx'} end) | ||
end) | ||
it('should detect missing mod names', function() | ||
assert.errors(function() xero.add {0, 4, xero.inOutExpo, 0, nil} end) | ||
end) | ||
it('should detect malformed mod names', function() | ||
assert.errors(function() | ||
xero.add {0, 4, xero.inOutExpo, 0, 'bumpyx,'} | ||
update() | ||
end) | ||
end) | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
---@diagnostic disable: undefined-global | ||
local helper = require('spec.helper') | ||
local update = helper.update | ||
|
||
describe('alias', function() | ||
|
||
before_each(function() | ||
helper.reset() | ||
helper.init() | ||
end) | ||
|
||
after_each(function() | ||
xero = nil | ||
end) | ||
|
||
it('should work with ease', function() | ||
xero.alias{'a', 'b'} | ||
xero.ease {0, 100, xero.outExpo, 100, 'a'} | ||
update(100) | ||
assert.equal(helper.get_mod('b'), '100') | ||
end) | ||
|
||
it('should work with perframes', function() | ||
local success = false | ||
|
||
xero.alias{'a', 'b'} | ||
xero.setdefault {100, 'a'} | ||
xero.perframe {1, 5, function(beat, mods) | ||
success = mods[1].a == 100 and mods[1].b == 100 | ||
end} | ||
update(3) | ||
assert(success, 'mod aliases worked properly') | ||
end) | ||
|
||
it('should work with definemod (simple case)', function() | ||
xero.definemod{'a', function() | ||
return 100 | ||
end, 'b'} | ||
xero.definemod{'c', function(input) | ||
return input + 50 | ||
end, 'd'} | ||
xero.definemod{'e', function(input) | ||
return input + 25 | ||
end, 'f'} | ||
|
||
xero.alias {'b', 'c'} | ||
xero.alias {'e', 'd'} | ||
xero.alias {'f', 'g'} | ||
|
||
xero.set {0, 0, 'a'} | ||
|
||
update(1) | ||
assert.equal(helper.get_mod('g'), '175') | ||
end) | ||
|
||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
---@diagnostic disable: undefined-global | ||
local helper = require('spec.helper') | ||
local update = helper.update | ||
|
||
describe('aux', function() | ||
|
||
before_each(function() | ||
helper.reset() | ||
helper.init() | ||
end) | ||
|
||
after_each(function() | ||
xero = nil | ||
end) | ||
|
||
it('prevents mods from being applied to the game', function() | ||
xero.aux {'funny'} | ||
xero.set {0, 100, 'funny', 100, 'funny2'} | ||
|
||
local funny_observed | ||
local funny2_observed | ||
|
||
xero.perframe {0, 2, function(_, poptions) | ||
funny_observed = poptions[1].funny | ||
funny2_observed = poptions[1].funny2 | ||
end} | ||
|
||
update(1) | ||
|
||
-- funny should show up in a func, but not in the helper's mods model | ||
assert.equals(nil, helper.get_mod('funny')) | ||
assert.equals(100, funny_observed) | ||
|
||
-- funny2, having not been auxed, should appear in both | ||
assert.equals('100', helper.get_mod('funny2')) | ||
assert.equals(100, funny2_observed) | ||
end) | ||
|
||
it('works with setdefault', function() | ||
xero.aux {'funny'} | ||
xero.setdefault {100, 'funny', 100, 'funny2'} | ||
|
||
update(1) | ||
|
||
assert.equals(nil, helper.get_mod('funny')) | ||
assert.equals('100', helper.get_mod('funny2')) | ||
end) | ||
|
||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
---@diagnostic disable: undefined-global | ||
local helper = require('spec.helper') | ||
local update = helper.update | ||
|
||
describe('definemod', function() | ||
|
||
before_each(function() | ||
helper.reset() | ||
helper.init() | ||
end) | ||
|
||
after_each(function() | ||
xero = nil | ||
end) | ||
|
||
-- TODO | ||
|
||
end) |
Oops, something went wrong.