Skip to content

Commit

Permalink
加一个暂时触发不了的彩蛋
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Sep 7, 2024
1 parent 9ae1317 commit ee9d243
Show file tree
Hide file tree
Showing 5 changed files with 305 additions and 26 deletions.
1 change: 1 addition & 0 deletions assets/language/lang_en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ local L={
exterior_tspin_10TST="EZ.",
exterior_hypersonic_titanium_holdless="You can hold",
interior_console="What's this?",
language_japanese="あ?",
musicroom_recollection="Recollection is not a song",
dial_enter="Instrument?",
dial_password="Password correct",
Expand Down
1 change: 1 addition & 0 deletions assets/language/lang_zh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ local L={
exterior_tspin_10TST="轻松。",
exterior_hypersonic_titanium_holdless="你可以暂存的",
interior_console="这是什么?",
language_japanese="あ?",
musicroom_recollection="Recollection不是一首曲子",
dial_enter="乐器?",
dial_password="密码正确",
Expand Down
33 changes: 21 additions & 12 deletions assets/scene/lang_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ local languages={
local curLang=1
local changed

local jaClickCount

---@type Zenitha.Scene
local scene={}

function scene.load()
changed=false
jaClickCount=0
end

function scene.unload()
Expand Down Expand Up @@ -52,18 +55,24 @@ function scene.draw()
end

local function _setLang(lid)
TEXT:clear()
TEXT:add{
text=langList[lid],
x=800,y=500,k=2,
fontSize=50,
style='appear',
duration=1,inPoint=0,outPoint=0,
}
if SETTINGS.system.locale~=lid then
SETTINGS.system.locale=lid
changed=true
WIDGET._reset()
if lid=='ja' then jaClickCount=jaClickCount+1 end
if jaClickCount>=26 then
PROGRESS.setSecret('language_japanese')
SCN.go('goyin')
else
TEXT:clear()
TEXT:add{
text=langList[lid],
x=800,y=500,k=2,
fontSize=50,
style='appear',
duration=1,inPoint=0,outPoint=0,
}
if SETTINGS.system.locale~=lid then
SETTINGS.system.locale=lid
changed=true
WIDGET._reset()
end
end
end

Expand Down
38 changes: 24 additions & 14 deletions assets/scene/lang_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ local rec,recTimer
local dialMode,transTimer
local mode,instrument,octave_plus

local jaClickCount

---@type Zenitha.Scene
local scene={}

Expand Down Expand Up @@ -143,6 +145,8 @@ function scene.load()
BG.set('none')
changed=false
freshTexts()

jaClickCount=0
end
function scene.unload()
if changed and SCN.stackChange<0 then
Expand Down Expand Up @@ -204,20 +208,26 @@ function scene.draw()
end

local function _setLang(lid)
if transTimer then transTimer=26 end
SFX.play('check_on')
TEXT:clear()
TEXT:add{
text=langList[lid],
x=800,y=500,a=.626,k=2,
fontSize=50,
style='zoomout',
duration=1.26,
}
if SETTINGS.system.locale~=lid then
SETTINGS.system.locale=lid
changed=true
WIDGET._reset()
if lid=='ja' then jaClickCount=jaClickCount+1 end
if jaClickCount>=26 then
PROGRESS.setSecret('language_japanese')
SCN.go('goyin')
else
if transTimer then transTimer=26 end
SFX.play('check_on')
TEXT:clear()
TEXT:add{
text=langList[lid],
x=800,y=500,a=.626,k=2,
fontSize=50,
style='zoomout',
duration=1.26,
}
if SETTINGS.system.locale~=lid then
SETTINGS.system.locale=lid
changed=true
WIDGET._reset()
end
end
end

Expand Down
258 changes: 258 additions & 0 deletions assets/scene_app/goyin.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
local gc=love.graphics
local ins,rem=table.insert,table.remove

local map={
a ={'a','','','','',basic=true},
i ={'i','','','','',basic=true},
u ={'u','','','','',basic=true},
e ={'e','','','','',basic=true},
o ={'o','','','','',basic=true},
ka ={'ka','','','','',basic=true},
ki ={'ki','','','','',basic=true},
ku ={'ku','','','','',basic=true},
ke ={'ke','','','','',basic=true},
ko ={'ko','','','','',basic=true},
sa ={'sa','','','','',basic=true},
si ={'shi','','','','',basic=true},
su ={'su','','','','',basic=true},
se ={'se','','','','',basic=true},
so ={'so','','','','',basic=true},
ta ={'ta','','','','',basic=true},
ti ={'chi','','','','',basic=true},
tu ={'tsu','','','','',basic=true},
te ={'te','','','','',basic=true},
to ={'to','','','','',basic=true},
na ={'na','','','','',basic=true},
ni ={'ni','','','','',basic=true},
nu ={'nu','','','','',basic=true},
ne ={'ne','','','','',basic=true},
no ={'no','','','','',basic=true},
ha ={'ha','','','','',basic=true},
hi ={'hi','','','','',basic=true},
hu ={'fu','','','','',basic=true},
he ={'he','','','','',basic=true},
ho ={'ho','','','','',basic=true},
ma ={'ma','','','','',basic=true},
mi ={'mi','','','','',basic=true},
mu ={'mu','','','','',basic=true},
me ={'me','','','','',basic=true},
mo ={'mo','','','','',basic=true},
ya ={'ya','','','','',basic=true},
yi ={'i','','','','',basic=true,ignore=true},
yu ={'yu','','','','',basic=true},
ye ={'e','','','','',basic=true,ignore=true},
yo ={'yo','','','','',basic=true},
ra ={'ra','','','','',basic=true},
ri ={'ri','','','','',basic=true},
ru ={'ru','','','','',basic=true},
re ={'re','','','','',basic=true},
ro ={'ro','','','','',basic=true},
wa ={'wa','','','','',basic=true},
wi ={'wi','','','','',basic=true,ignore=true},
wu ={'u','','','','',basic=true,ignore=true},
we ={'we','','','','',basic=true,ignore=true},
wo ={'wo','','','','',basic=true},
n ={'n','','','','',basic=true},

ga ={'ga','','','',''},
gi ={'gi','','','',''},
gu ={'gu','','','',''},
ge ={'ge','','','',''},
go ={'go','','','',''},
za ={'za','','','',''},
zi ={'ji','','','',''},
zu ={'zu','','','',''},
ze ={'ze','','','',''},
zo ={'zo','','','',''},
da ={'da','','','',''},
di ={'di','','','',''},
du ={'du','','','',''},
de ={'de','','','',''},
['do']={'do','','','',''},
ba ={'ba','','','',''},
bi ={'bi','','','',''},
bu ={'bu','','','',''},
be ={'be','','','',''},
bo ={'bo','','','',''},
pa ={'pa','','','',''},
pi ={'pi','','','',''},
pu ={'pu','','','',''},
pe ={'pe','','','',''},
po ={'po','','','',''},
}
local remap={}
for id,c in next,map do
if not c.ignore then remap[c[1]]=id end
end

local list={basic={},full={}}
for id,char in next,map do
if not char.ignore then
ins(list.full,id)
if char.basic then ins(list.basic,id) end
end
end
local ___,____=false,false
local basicMap={
{'a','ka','sa','ta','na','ha','ma','ya','ra','wa'},
{'i','ki','si','ti','ni','hi','mi','yi','ri','wi'},
{'u','ku','su','tu','nu','hu','mu','yu','ru','wu'},
{'e','ke','se','te','ne','he','me','ye','re','we'},
{'o','ko','so','to','no','ho','mo','yo','ro','wo','n'},
{},
{___,'ga','za','da',____,'ba','pa'},
{___,'gi','zi','di',____,'bi','pi'},
{___,'gu','zu','du',____,'bu','pu'},
{___,'ge','ze','de',____,'be','pe'},
{___,'go','zo','do',____,'bo','po'},
}

---@type 'map'|'quest'
local mode
local basic=false
local cap=false
local questID
local input
local lockTimer
local judge
local weights

---@type Zenitha.Scene
local scene={}

function scene.load()
mode='map'
end

local function newQuest()
local old=questID
repeat
questID=MATH.randFreqAll(weights)
until questID~=old
input=""
lockTimer=false

for id in next,weights do
weights[id]=weights[id]+1
end
judge=false
end
local function newGame()
weights=TABLE.getValueSet(basic and list.basic or list.full,260)
newQuest()
end

function scene.keyDown(key,isRep)
if isRep then return true end
if mode=='map' then
if key=='tab' then
mode='quest'
basic,cap=true,false
newGame()
elseif key=='1' then
basic=not basic
elseif key=='2' then
cap=not cap
end
elseif mode=='quest' then
if key=='tab' then
mode='map'
basic,cap=true,false
lockTimer=false
elseif key=='1' then
basic=not basic
newGame()
elseif key=='2' then
cap=not cap
newGame()
elseif key=='backspace' or key=='space' or key=='delete' then
input=""
elseif #key==1 and key:find('[a-z]') and not lockTimer then
if key=='l' then key='r' end
if key=='v' then key='b' end
input=input..key
if input==map[questID][1] then
FMOD.effect('beep_rise')
lockTimer=0.26
judge='T'
weights[questID]=weights[questID]*.626
elseif remap[input] and input~='n' or #input>=3 then
FMOD.effect('beep_drop')
weights[questID]=weights[questID]+620
if weights[remap[input]] then weights[remap[input]]=weights[remap[input]]+620 end
lockTimer=0.626
judge='F'
end
elseif key=='/' then
if not lockTimer then
FMOD.effect('beep_notice')
input=map[questID][1]
lockTimer=0.626
judge='H'
weights[questID]=weights[questID]+2600
end
end
end
return true
end

function scene.update(dt)
if lockTimer then
lockTimer=lockTimer-dt
if lockTimer<=0 then
if judge=='F' then
input=""
judge=false
lockTimer=false
else
newQuest()
end
end
end
end

local gc_print=gc.print
local setFont=FONT.set
function scene.draw()
gc.replaceTransform(SCR.xOy_u)
gc.scale(2)
if mode=='map' then
local charIndex=cap and 4 or 2
for y=1,#basicMap do
for x=1,#basicMap[y] do
local c=map[basicMap[y][x]]
if c then
gc.setColor(c.ignore and COLOR.lD or COLOR.L)
setFont(30)
gc_print(c[charIndex],(x-6.3)*72,y*35)
setFont(15)
gc_print(c[1],(x-6.3)*72+30,y*35+15)
end
end
end
else
gc.setColor(COLOR.L)
FONT.set(20)
GC.mStr(basic and '基本' or '全部',-30,100)
GC.mStr(cap and '片假' or '平假',30,100)

FONT.set(80,'bold')
GC.mStr(map[questID][cap and 4 or 2],0,130)
gc.setColor(lockTimer and (judge=='T' and COLOR.G or judge=='H' and COLOR.Y or COLOR.R) or COLOR.L)
GC.mStr(input,0,220)

gc.setColor(COLOR.L)
FONT.set(10)
local l=basic and list.basic or list.full
for i=1,#l do
gc_print(map[l[i]][2],-400+10*i,420)
gc.rectangle('fill',-400+1+10*i,420,7,-weights[l[i]]*0.0626)
end
end
end

scene.widgetList={
WIDGET.new{type='button',pos={1,1},x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()},
}

return scene

0 comments on commit ee9d243

Please sign in to comment.