From a3302ab2bc22180a0a92157c69e5f8c4ed9150ce Mon Sep 17 00:00:00 2001 From: MrZ_26 Date: Wed, 8 Jul 2020 20:26:28 +0800 Subject: [PATCH] Zframework finished --- ...at kind of feeling.ogg => how feeling.ogg} | Bin {modules => Zframework}/bg.lua | 0 {modules => Zframework}/bgm.lua | 12 +- {parts => Zframework}/color.lua | 0 {modules => Zframework}/file.lua | 2 +- {modules => Zframework}/img.lua | 0 modules/callback.lua => Zframework/init.lua | 24 +- {modules => Zframework}/languages.lua | 0 {modules => Zframework}/light.lua | 0 {modules => Zframework}/paint.lua | 0 {modules => Zframework}/scene.lua | 0 {modules => Zframework}/sfx.lua | 0 {modules => Zframework}/shader.lua | 0 {modules => Zframework}/sysFX.lua | 0 {modules => Zframework}/task.lua | 9 +- {modules => Zframework}/text.lua | 0 {modules => Zframework}/timer.lua | 0 {modules => Zframework}/toolfunc.lua | 4 +- {modules => Zframework}/vib.lua | 2 +- {modules => Zframework}/voice.lua | 0 {modules => Zframework}/widget.lua | 0 {modules => Zframework}/widgetList.lua | 0 conf.lua | 6 +- document.txt | 72 ++--- main.lua | 48 +--- modes/attacker_hard.lua | 5 +- modes/attacker_ultimate.lua | 31 +-- modes/c4wtrain_lunatic.lua | 2 +- modes/c4wtrain_normal.lua | 2 +- modes/pctrain_lunatic.lua | 2 +- modes/pctrain_normal.lua | 2 +- modes/sprint_100.lua | 4 +- modes/sprint_1000.lua | 4 +- modes/sprint_400.lua | 4 +- modes/tech_hard+.lua | 3 + modes/tech_hard.lua | 3 + modes/tech_lunatic+.lua | 3 + modes/tech_lunatic.lua | 3 + modes/tech_normal+.lua | 3 + modes/tech_normal.lua | 3 + modes/tech_ultimate+.lua | 3 + modes/tech_ultimate.lua | 1 + parts/freeRow.lua | 6 +- parts/gametoolfunc.lua | 4 +- parts/getTip.lua | 262 +++++++++--------- parts/player.lua | 42 ++- parts/updateLog.lua | 12 +- 47 files changed, 308 insertions(+), 275 deletions(-) rename BGM/{hay what kind of feeling.ogg => how feeling.ogg} (100%) rename {modules => Zframework}/bg.lua (100%) rename {modules => Zframework}/bgm.lua (89%) rename {parts => Zframework}/color.lua (100%) rename {modules => Zframework}/file.lua (99%) rename {modules => Zframework}/img.lua (100%) rename modules/callback.lua => Zframework/init.lua (97%) rename {modules => Zframework}/languages.lua (100%) rename {modules => Zframework}/light.lua (100%) rename {modules => Zframework}/paint.lua (100%) rename {modules => Zframework}/scene.lua (100%) rename {modules => Zframework}/sfx.lua (100%) rename {modules => Zframework}/shader.lua (100%) rename {modules => Zframework}/sysFX.lua (100%) rename {modules => Zframework}/task.lua (88%) rename {modules => Zframework}/text.lua (100%) rename {modules => Zframework}/timer.lua (100%) rename {modules => Zframework}/toolfunc.lua (100%) rename {modules => Zframework}/vib.lua (84%) rename {modules => Zframework}/voice.lua (100%) rename {modules => Zframework}/widget.lua (100%) rename {modules => Zframework}/widgetList.lua (100%) diff --git a/BGM/hay what kind of feeling.ogg b/BGM/how feeling.ogg similarity index 100% rename from BGM/hay what kind of feeling.ogg rename to BGM/how feeling.ogg diff --git a/modules/bg.lua b/Zframework/bg.lua similarity index 100% rename from modules/bg.lua rename to Zframework/bg.lua diff --git a/modules/bgm.lua b/Zframework/bgm.lua similarity index 89% rename from modules/bgm.lua rename to Zframework/bgm.lua index a2a3439b..d5fc4807 100644 --- a/modules/bgm.lua +++ b/Zframework/bgm.lua @@ -1,7 +1,7 @@ local min=math.min local rem=table.remove -local function fadeOut(_,id) +local function fadeOut(id) local src=BGM.list[id] local v=src:getVolume()-.025*setting.bgm*.1 src:setVolume(v>0 and v or 0) @@ -10,7 +10,7 @@ local function fadeOut(_,id) return true end end -local function fadeIn(_,id) +local function fadeIn(id) local src=BGM.list[id] local v=min(src:getVolume()+.025*setting.bgm*.1,setting.bgm*.1) src:setVolume(v) @@ -27,7 +27,7 @@ BGM.list={ "secret7th","secret8th", "shining terminal","oxygen","distortion","far", "rockblock","cruelty","final","8-bit happiness","end", - "hay what kind of feeling", + "how feeling", } BGM.len=#BGM.list function BGM.loadOne(N) @@ -53,12 +53,12 @@ function BGM.play(s) return end if BGM.nowPlay~=s then - if BGM.nowPlay then TASK.new(fadeOut,nil,BGM.nowPlay)end + if BGM.nowPlay then TASK.new(fadeOut,BGM.nowPlay)end TASK.changeCode(fadeIn,fadeOut) TASK.removeTask_data(s) BGM.nowPlay,BGM.suspend=s - TASK.new(fadeIn,nil,s) + TASK.new(fadeIn,s) BGM.playing=BGM.list[s] BGM.playing:play() end @@ -81,7 +81,7 @@ function BGM.freshVolume() end function BGM.stop() if BGM.nowPlay then - TASK.new(fadeOut,nil,BGM.nowPlay) + TASK.new(fadeOut,BGM.nowPlay) end TASK.changeCode(fadeIn,fadeOut) BGM.playing,BGM.nowPlay=nil diff --git a/parts/color.lua b/Zframework/color.lua similarity index 100% rename from parts/color.lua rename to Zframework/color.lua diff --git a/modules/file.lua b/Zframework/file.lua similarity index 99% rename from modules/file.lua rename to Zframework/file.lua index db59d820..dd1a318c 100644 --- a/modules/file.lua +++ b/Zframework/file.lua @@ -15,7 +15,7 @@ local function splitS(s,sep) return t end local tabs={ - [0]="", + [0]="", "\t", "\t\t", "\t\t\t", diff --git a/modules/img.lua b/Zframework/img.lua similarity index 100% rename from modules/img.lua rename to Zframework/img.lua diff --git a/modules/callback.lua b/Zframework/init.lua similarity index 97% rename from modules/callback.lua rename to Zframework/init.lua index 1e4ebb2d..54064fd6 100644 --- a/modules/callback.lua +++ b/Zframework/init.lua @@ -1,3 +1,24 @@ +require("Zframework/toolfunc") +color= require("Zframework/color") +SHADER= require("Zframework/shader") +VIB= require("Zframework/vib") +SFX= require("Zframework/sfx") +sysFX= require("Zframework/sysFX") +BG= require("Zframework/bg") +BGM= require("Zframework/bgm") +VOC= require("Zframework/voice") +LANG= require("Zframework/languages") +FILE= require("Zframework/file") +TEXT= require("Zframework/text") +TASK= require("Zframework/task") +IMG= require("Zframework/img") +WIDGET= require("Zframework/widget") +Widgets=require("Zframework/widgetList") +LIGHT= require("Zframework/light") +SCN= require("Zframework/scene") +local Tmr=require("Zframework/timer") +local Pnt=require("Zframework/paint") + local ms,kb,tc=love.mouse,love.keyboard,love.touch local gc,sys=love.graphics,love.system local Timer=love.timer.getTime @@ -14,9 +35,6 @@ joysticks={} local devMode -local Tmr=require("timer") -local Pnt=require("paint") - local infoCanvas=gc.newCanvas(108,27) local function updatePowerInfo() local state,pow=sys.getPowerInfo() diff --git a/modules/languages.lua b/Zframework/languages.lua similarity index 100% rename from modules/languages.lua rename to Zframework/languages.lua diff --git a/modules/light.lua b/Zframework/light.lua similarity index 100% rename from modules/light.lua rename to Zframework/light.lua diff --git a/modules/paint.lua b/Zframework/paint.lua similarity index 100% rename from modules/paint.lua rename to Zframework/paint.lua diff --git a/modules/scene.lua b/Zframework/scene.lua similarity index 100% rename from modules/scene.lua rename to Zframework/scene.lua diff --git a/modules/sfx.lua b/Zframework/sfx.lua similarity index 100% rename from modules/sfx.lua rename to Zframework/sfx.lua diff --git a/modules/shader.lua b/Zframework/shader.lua similarity index 100% rename from modules/shader.lua rename to Zframework/shader.lua diff --git a/modules/sysFX.lua b/Zframework/sysFX.lua similarity index 100% rename from modules/sysFX.lua rename to Zframework/sysFX.lua diff --git a/modules/task.lua b/Zframework/task.lua similarity index 88% rename from modules/task.lua rename to Zframework/task.lua index 548b2083..4c15738c 100644 --- a/modules/task.lua +++ b/Zframework/task.lua @@ -9,17 +9,14 @@ end function TASK.update() for i=#tasks,1,-1 do local T=tasks[i] - if T.code(T.P,T.data)then - for i=i,#tasks do - tasks[i]=tasks[i+1] - end + if T.code(T.data)then + rem(tasks,i) end end end -function TASK.new(code,P,data) +function TASK.new(code,data) tasks[#tasks+1]={ code=code, - P=P, data=data, } end diff --git a/modules/text.lua b/Zframework/text.lua similarity index 100% rename from modules/text.lua rename to Zframework/text.lua diff --git a/modules/timer.lua b/Zframework/timer.lua similarity index 100% rename from modules/timer.lua rename to Zframework/timer.lua diff --git a/modules/toolfunc.lua b/Zframework/toolfunc.lua similarity index 100% rename from modules/toolfunc.lua rename to Zframework/toolfunc.lua index 94616aa4..d6072679 100644 --- a/modules/toolfunc.lua +++ b/Zframework/toolfunc.lua @@ -1,4 +1,6 @@ local gc=love.graphics +local int=math.floor +local format=string.format local fontData=love.filesystem.newFile("font.ttf") local newFont=gc.setNewFont @@ -19,8 +21,6 @@ function setFont(s) return f end -local int=math.floor -local format=string.format function toTime(s) if s<60 then return format("%.3fs",s) diff --git a/modules/vib.lua b/Zframework/vib.lua similarity index 84% rename from modules/vib.lua rename to Zframework/vib.lua index 7668ee0a..7e49cc1d 100644 --- a/modules/vib.lua +++ b/Zframework/vib.lua @@ -1,7 +1,7 @@ local level={0,0,.015,.02,.03,.04,.05,.06,.07,.08} local _=love.system.vibrate return function(t) - local L=setting.vib + local L=setting.vib if L>0 then _(level[L+t]) end diff --git a/modules/voice.lua b/Zframework/voice.lua similarity index 100% rename from modules/voice.lua rename to Zframework/voice.lua diff --git a/modules/widget.lua b/Zframework/widget.lua similarity index 100% rename from modules/widget.lua rename to Zframework/widget.lua diff --git a/modules/widgetList.lua b/Zframework/widgetList.lua similarity index 100% rename from modules/widgetList.lua rename to Zframework/widgetList.lua diff --git a/conf.lua b/conf.lua index db5418f7..f7111e45 100644 --- a/conf.lua +++ b/conf.lua @@ -1,10 +1,10 @@ -gameVersion="Alpha V0.8.24" +gameVersion="Alpha V0.9.0" function love.conf(t) - t.identity="Techmino"--folder name + t.identity="Techmino"--saving folder t.version="11.1" t.console=false t.gammacorrect=false - t.appendidentity=true--search files in source before save directory + t.appendidentity=true--search files in source then in save directory t.accelerometerjoystick=false--accelerometer=joystick on ios/android if t.audio then t.audio.mixwithsystem=true end diff --git a/document.txt b/document.txt index c85ff371..6b6b0923 100644 --- a/document.txt +++ b/document.txt @@ -56,60 +56,60 @@ back to back(B2B)点数说明: 在拼图模式下,按功能键切换是否展示提示.其中打"X"的格子不允许有方块,空的格子可以是任何状态,普通的七种彩色方块必须颜色对应,垃圾行方块的为止只要有方块就可以,但是不能是空气,玩家拼出自己画的图后就会判定胜利. Gameplay: - System will offer a series of tetrominoes ("Pieces". There are 7 types), and the player needs to control [them] (move left and right, rotate 90, 180 or 270 degrees), filling a row on the play field will clear it, attack will be sent depending on the type of the line clear (if there is an opponent) - Survive till the last or complete the level's goal to win. + System will offer a series of tetrominoes ("Pieces". There are 7 types), and the player needs to control [them] (move left and right, rotate 90, 180 or 270 degrees), filling a row on the play field will clear it, attack will be sent depending on the type of the line clear (if there is an opponent) + Survive till the last or complete the level's goal to win. Rotation system: - Uses Techmino's custom rotation system. Too lazy to write the details + Uses Techmino's custom rotation system. Too lazy to write the details Spin detection: - Combines immobile and 3-corner detection, and whether a spin is mini also depends on the data used for detection. Also too lazy to write the details + Combines immobile and 3-corner detection, and whether a spin is mini also depends on the data used for detection. Also too lazy to write the details Attack system: - Regular line clears: - Single/Double/Triple/Techrash sends 0.25/1.25/2.25/4 - Special line clears: - Spin Single/Double/Triple sends 2/4/6, half if Mini - B2B: +1 (Techrash/Spin Single/Spin Double) or +2 (Spin Triple) - B2B2B/B3B: In addition to B2B, +1 if Techrash, +(0.5 * lines cleared) if Spin, and in both cases +1 additional blocking - Wide Combo: 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 3, then 2 afterwards - Dig Combo: 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, then 5 afterwards - Special line clears will increase B2B gauge, making later special line clears have B2B or B2B2B bonus (see below) - Half Perfect Clear (a Perfect Clear "with blocks left below". If it's an I clearing 1 line, then the remaining blocks must not be player-placed): Attack +2, Extra Blocking +2 - Perfect Clear: square root all damage above, then +6 to +12 attack (increases within a round) and +2 extra blocking. (note: if lines cleared in this round >4, then B2B gauge will be filled) - After calculating all above, the damage value will be rounded down then sent + Regular line clears: + Single/Double/Triple/Techrash sends 0.25/1.25/2.25/4 + Special line clears: + Spin Single/Double/Triple sends 2/4/6, half if Mini + B2B: +1 (Techrash/Spin Single/Spin Double) or +2 (Spin Triple) + B2B2B/B3B: In addition to B2B, +1 if Techrash, +(0.5 * lines cleared) if Spin, and in both cases +1 additional blocking + Wide Combo: 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 3, then 2 afterwards + Dig Combo: 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, then 5 afterwards + Special line clears will increase B2B gauge, making later special line clears have B2B or B2B2B bonus (see below) + Half Perfect Clear (a Perfect Clear "with blocks left below". If it's an I clearing 1 line, then the remaining blocks must not be player-placed): Attack +2, Extra Blocking +2 + Perfect Clear: square root all damage above, then +6 to +12 attack (increases within a round) and +2 extra blocking. (note: if lines cleared in this round >4, then B2B gauge will be filled) + After calculating all above, the damage value will be rounded down then sent Score system: - The more impressive you play, the more score you get + The more impressive you play, the more score you get Attack delay: - Attack from Doubles/Triples take effect the faster, then Techrash, Spins send rather slow attack, and high combos will send the slowest - B2B or B2B2B, while they increase lines sent, they also increase the attack delay. Minis will greatly increase delay. + Attack from Doubles/Triples take effect the faster, then Techrash, Spins send rather slow attack, and high combos will send the slowest + B2B or B2B2B, while they increase lines sent, they also increase the attack delay. Minis will greatly increase delay. Countering: - When you send attack, if there is garbage in queue, extra blocking will be used first, then attack, countering the earliest attack at a 1:1 ratio. - Unused extra blocking will be discarded, then remaining attack will be sent to your opponent. + When you send attack, if there is garbage in queue, extra blocking will be used first, then attack, countering the earliest attack at a 1:1 ratio. + Unused extra blocking will be discarded, then remaining attack will be sent to your opponent. Back to Back (B2B) gauge: - The B2B gauge ranges from 0 to 1,200. Special line clears are B2B if the gauge is >=40, B2B2B if >1,000. - A regular line clear -250 - Spin Single/Double/Triple +50/100/180 (x40% if Mini) - Techrash +100 - Spin without clearing lines +20, but gauge cannot exceed 1,000 with this method - When gauge is above 1,000, a drop without clearing lines -40 (cannot drop below 1,000 with this method) + The B2B gauge ranges from 0 to 1,200. Special line clears are B2B if the gauge is >=40, B2B2B if >1,000. + A regular line clear -250 + Spin Single/Double/Triple +50/100/180 (x40% if Mini) + Techrash +100 + Spin without clearing lines +20, but gauge cannot exceed 1,000 with this method + When gauge is above 1,000, a drop without clearing lines -40 (cannot drop below 1,000 with this method) Battle Royale modes: - Many players play within one game (all opponents are bots, not real players). As players get eliminated, blocks fall faster, and garbage take effect faster, as well as rise faster. KO-ing another player grants you one badge plus all badge that player has, increasing your attack power. - Players can select one of 4 attack modes: - 1. Random: Every time you attack, 10% chance to lock onto a random player. - 2. Badges: After you attack or when your target dies, lock onto the player with the most badges. - 3. KOs: After you attack or when your target dies, lock onto the player with the highest field. (This refreshes every second) - 4. Counter: attack all players locking onto yourself. Your attack will be sent to all of them. If you are not targetted, you attack a random player (not locking). - The last survivor wins. + Many players play within one game (all opponents are bots, not real players). As players get eliminated, blocks fall faster, and garbage take effect faster, as well as rise faster. KO-ing another player grants you one badge plus all badge that player has, increasing your attack power. + Players can select one of 4 attack modes: + 1. Random: Every time you attack, 10% chance to lock onto a random player. + 2. Badges: After you attack or when your target dies, lock onto the player with the most badges. + 3. KOs: After you attack or when your target dies, lock onto the player with the highest field. (This refreshes every second) + 4. Counter: attack all players locking onto yourself. Your attack will be sent to all of them. If you are not targetted, you attack a random player (not locking). + The last survivor wins. Custom mode: - You can freely adjust most parameters (not including special effects of other game modes), and you can also draw a field to clear or make a template to build. - In build (puzzle) mode, you can toggle template display with Function key. Cells with a X cannot have blocks; empty cells can be in any state; regular colored cells have to be made of the corresponding block; garbage-colored cells can be any block but not air. Once you make the shape, you will win. + You can freely adjust most parameters (not including special effects of other game modes), and you can also draw a field to clear or make a template to build. + In build (puzzle) mode, you can toggle template display with Function key. Cells with a X cannot have blocks; empty cells can be in any state; regular colored cells have to be made of the corresponding block; garbage-colored cells can be any block but not air. Once you make the shape, you will win. 附录Appendix: ZXC's cool O-spin map:XY0BCgAwCAIR7v9vHtUSt8AS0xKqgpnNGyXkrmFNePf6qi3BbQPrHT2Owxe6D66NeKi86dwB \ No newline at end of file diff --git a/main.lua b/main.lua index 6df49ba6..eb910d24 100644 --- a/main.lua +++ b/main.lua @@ -4,7 +4,6 @@ ]] --Global Setting & Vars -package.path="./?.lua;./parts/?.lua;./modules/?.lua" math.randomseed(os.time()*626) love.keyboard.setKeyRepeat(true) love.keyboard.setTextInput(false) @@ -32,41 +31,23 @@ preField={h=20}for i=1,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end players={alive={},human=0} --blockSkin,blockSkinMini={},{}--redefined in SKIN.change +require("Zframework")--load Zframework + --Load modules -color= require("color") -blocks= require("mino") -AITemplate= require("AITemplate") -freeRow= require("freeRow") +blocks= require("parts/mino") +AITemplate= require("parts/AITemplate") +freeRow= require("parts/freeRow") -require("toolfunc") -require("list") -require("gametoolfunc") -require("texture") -require("default_data") +require("parts/list") +require("parts/gametoolfunc") +require("parts/texture") +require("parts/default_data") -SKIN= require("skin") -PLY= require("player") -AIfunc= require("ai") -Modes= require("modes") +SKIN= require("parts/skin") +PLY= require("parts/player") +AIfunc= require("parts/ai") +Modes= require("parts/modes") ---load Z's Framework -SHADER= require("shader") -VIB= require("vib") -SFX= require("sfx") -sysFX= require("sysFX") -BG= require("bg") -BGM= require("bgm") -VOC= require("voice") -LANG= require("languages") -FILE= require("file") -TEXT= require("text") -TASK= require("task") -IMG= require("img") -WIDGET= require("widget") -Widgets=require("widgetList") -LIGHT= require("light") -SCN= require("scene") -require("callback") --load files & settings modeRanks={}for i=1,#Modes do modeRanks[i]=false assert(i==Modes[i].id,"ModeID error:"..i)end @@ -76,7 +57,8 @@ local fs=love.filesystem if fs.getInfo("keymap.dat")then fs.remove("keymap.dat")end if fs.getInfo("setting.dat")then fs.remove("setting.dat")end -if fs.getInfo("settings.dat")then FILE.loadSetting() +if fs.getInfo("settings.dat")then + FILE.loadSetting() else -- firstRun=true if system=="Android"or system=="iOS" then diff --git a/modes/attacker_hard.lua b/modes/attacker_hard.lua index fd1e22a5..c3ac0359 100644 --- a/modes/attacker_hard.lua +++ b/modes/attacker_hard.lua @@ -23,9 +23,8 @@ return{ end B.sum=B.sum+22 P.stat.recv=P.stat.recv+22 - if D.event<50 then - D.event=D.event+1 - D.point=int(72e4/t)*.1 + D.event=D.event+1 + if D.event%10==0 then if D.event==20 then P:showTextF(text.great,0,-140,100,"appear",.6) P.gameEnv.pushSpeed=3 diff --git a/modes/attacker_ultimate.lua b/modes/attacker_ultimate.lua index b84a3ffd..049fcef9 100644 --- a/modes/attacker_ultimate.lua +++ b/modes/attacker_ultimate.lua @@ -1,4 +1,4 @@ -local int,rnd=math.floor,math.random +local int,rnd,min=math.floor,math.random,math.min return{ color=color.lightYellow, env={ @@ -7,32 +7,31 @@ return{ freshLimit=15, task=function(P) if not(P.control and SCN.cur=="play")then return end - if P.atkBuffer.sum<2 then + if P.atkBuffer.sum<4 then local p=#P.atkBuffer+1 local B,D=P.atkBuffer,P.modeData local s,t if D.event<10 then - t=1000-20*D.event--1000~800 - B[p]= {pos=rnd(5,6),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=3} - B[p+1]= {pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=4} - s=22 + t=800-10*D.event--800~700 + B[p]= {pos=rnd(5,6),amount=9,countdown=t,cd0=t,time=0,sent=false,lv=3} + B[p+1]= {pos=rnd(4,7),amount=11,countdown=t,cd0=t+62,time=0,sent=false,lv=4} + s=20 elseif D.event<20 then - t=800-20*(D.event-15)--800~600 + t=800-10*D.event--700~600 B[p]= {pos=rnd(3,8),amount=11,countdown=t,cd0=t,time=0,sent=false,lv=4} - B[p+1]= {pos=rnd(4,7),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=5} - s=25 + B[p+1]= {pos=rnd(4,7),amount=13,countdown=t,cd0=t+62,time=0,sent=false,lv=5} + s=24 else - t=600-15*(D.event-30)--600~450 - B[p]= {pos=rnd(2)*9-8,amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5} - B[p+1]= {pos=rnd(3,8),amount=16,countdown=t,cd0=t,time=0,sent=false,lv=5} + t=600-15*(min(D.event-20,10))--600~450 + B[p]= {pos=rnd(2)*9-8,amount=14,countdown=t,cd0=t,time=0,sent=false,lv=5} + B[p+1]= {pos=rnd(3,8),amount=14,countdown=t+62,cd0=t,time=0,sent=false,lv=5} s=28 end B.sum=B.sum+s P.stat.recv=P.stat.recv+s - if D.event<45 then - D.event=D.event+1 - D.point=int(s*36e3/t)*.1 - if D.event==10 then + D.event=D.event+1 + if D.event%10==0 then + if D.event==10 then P:showTextF(text.great,0,-140,100,"appear",.6) P.gameEnv.pushSpeed=4 elseif D.event==20 then diff --git a/modes/c4wtrain_lunatic.lua b/modes/c4wtrain_lunatic.lua index 67b245ed..b7b647ed 100644 --- a/modes/c4wtrain_lunatic.lua +++ b/modes/c4wtrain_lunatic.lua @@ -59,7 +59,7 @@ return{ if L==100 then local T=P.stat.time return - T<=40 and 5 or + T<=36 and 5 or T<=60 and 4 or 3 else diff --git a/modes/c4wtrain_normal.lua b/modes/c4wtrain_normal.lua index 35514093..0db467be 100644 --- a/modes/c4wtrain_normal.lua +++ b/modes/c4wtrain_normal.lua @@ -57,7 +57,7 @@ return{ if L==100 then local T=P.stat.time return - T<=30 and 5 or + T<=32 and 5 or T<=50 and 4 or T<=80 and 3 or 2 diff --git a/modes/pctrain_lunatic.lua b/modes/pctrain_lunatic.lua index 5bffdd0e..f91c5fc3 100644 --- a/modes/pctrain_lunatic.lua +++ b/modes/pctrain_lunatic.lua @@ -31,7 +31,7 @@ local function newPC(P) P.modeData.symmetry=symmetry P:pushNext(L,symmetry) P.modeData.counter=P.stat.piece==0 and 20 or 0 - TASK.new(task_PC,P) + P:newTask(task_PC) local s=P.stat.pc*.25 if int(s)==s and s>0 then diff --git a/modes/pctrain_normal.lua b/modes/pctrain_normal.lua index dd2ed1f0..876a921e 100644 --- a/modes/pctrain_normal.lua +++ b/modes/pctrain_normal.lua @@ -37,7 +37,7 @@ local function newPC(P) P.modeData.symmetry=symmetry P:pushNext(L,symmetry) P.modeData.counter=P.stat.piece==0 and 20 or 0 - TASK.new(task_PC,P) + P:newTask(task_PC) end end return{ diff --git a/modes/sprint_100.lua b/modes/sprint_100.lua index 2d78b02b..b832335e 100644 --- a/modes/sprint_100.lua +++ b/modes/sprint_100.lua @@ -32,8 +32,8 @@ return{ T<=62 and 5 or T<=90 and 4 or T<=130 and 3 or - T<=200 and 2 or - T<=360 and 1 or + T<=196 and 2 or + T<=260 and 1 or 0 end, } \ No newline at end of file diff --git a/modes/sprint_1000.lua b/modes/sprint_1000.lua index 40d14155..0874d17e 100644 --- a/modes/sprint_1000.lua +++ b/modes/sprint_1000.lua @@ -32,8 +32,8 @@ return{ T<=626 and 5 or T<=1000 and 4 or T<=1400 and 3 or - T<=2260 and 2 or - T<=3260 and 1 or + T<=2060 and 2 or + T<=2600 and 1 or 0 end, } \ No newline at end of file diff --git a/modes/sprint_400.lua b/modes/sprint_400.lua index e5003102..8b554069 100644 --- a/modes/sprint_400.lua +++ b/modes/sprint_400.lua @@ -32,8 +32,8 @@ return{ T<=255 and 5 or T<=326 and 4 or T<=462 and 3 or - T<=626 and 2 or - T<=1260 and 1 or + T<=555 and 2 or + T<=626 and 1 or 0 end, } \ No newline at end of file diff --git a/modes/tech_hard+.lua b/modes/tech_hard+.lua index 3783fc77..fcb0f0b2 100644 --- a/modes/tech_hard+.lua +++ b/modes/tech_hard+.lua @@ -3,6 +3,9 @@ local function tech_check_hard(P) if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then P:lose() end + if P.stat.row>=200 then + P:win("finish") + end end return{ diff --git a/modes/tech_hard.lua b/modes/tech_hard.lua index 58d3a80f..667e4d02 100644 --- a/modes/tech_hard.lua +++ b/modes/tech_hard.lua @@ -3,6 +3,9 @@ local function tech_check_easy(P) if #P.clearedRow>0 and P.b2b<40 then P:lose() end + if P.stat.row>=200 then + P:win("finish") + end end return{ diff --git a/modes/tech_lunatic+.lua b/modes/tech_lunatic+.lua index 13101048..e69a720b 100644 --- a/modes/tech_lunatic+.lua +++ b/modes/tech_lunatic+.lua @@ -3,6 +3,9 @@ local function tech_check_hard(P) if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then P:lose() end + if P.stat.row>=200 then + P:win("finish") + end end return{ diff --git a/modes/tech_lunatic.lua b/modes/tech_lunatic.lua index 9a8de439..0a279044 100644 --- a/modes/tech_lunatic.lua +++ b/modes/tech_lunatic.lua @@ -3,6 +3,9 @@ local function tech_check_easy(P) if #P.clearedRow>0 and P.b2b<40 then P:lose() end + if P.stat.row>=200 then + P:win("finish") + end end return{ diff --git a/modes/tech_normal+.lua b/modes/tech_normal+.lua index 640fe8c7..905431d0 100644 --- a/modes/tech_normal+.lua +++ b/modes/tech_normal+.lua @@ -3,6 +3,9 @@ local function tech_check_hard(P) if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then P:lose() end + if P.stat.row>=200 then + P:win("finish") + end end return{ diff --git a/modes/tech_normal.lua b/modes/tech_normal.lua index f667980e..120e9dd1 100644 --- a/modes/tech_normal.lua +++ b/modes/tech_normal.lua @@ -3,6 +3,9 @@ local function tech_check_easy(P) if #P.clearedRow>0 and P.b2b<40 then P:lose() end + if P.stat.row>=200 then + P:win("finish") + end end return{ diff --git a/modes/tech_ultimate+.lua b/modes/tech_ultimate+.lua index b25ca7a0..90edcd9a 100644 --- a/modes/tech_ultimate+.lua +++ b/modes/tech_ultimate+.lua @@ -3,6 +3,9 @@ local function tech_check_hard(P) if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then P:lose() end + if P.stat.row>=200 then + P:win("finish") + end end return{ diff --git a/modes/tech_ultimate.lua b/modes/tech_ultimate.lua index 73b9bde5..257f38e6 100644 --- a/modes/tech_ultimate.lua +++ b/modes/tech_ultimate.lua @@ -7,6 +7,7 @@ return{ drop=1e99,lock=60, freshLimit=15, target=200, + dropPiece=PLY.reach_winCheck, fineKill=true, bg="flink",bgm="infinite", }, diff --git a/parts/freeRow.lua b/parts/freeRow.lua index 2e77a2e8..a6d1b04c 100644 --- a/parts/freeRow.lua +++ b/parts/freeRow.lua @@ -20,9 +20,9 @@ function freeRow.get(val) end _=_+10 end - local t=L[_] + local t=L[_] for i=1,10 do t[i]=val end - L[_]=nil + L[_]=nil _=_-1 return t end @@ -31,6 +31,6 @@ function freeRow.discard(t) L[_]=t end function freeRow.getCount() - return _ + return _ end return freeRow \ No newline at end of file diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index 6cd3551e..7bbb1043 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -236,7 +236,7 @@ function resetPartGameData() TEXT.clear() if modeEnv.task then for i=1,#players do - players[i].newTask(modeEnv.task) + players[i]:newTask(modeEnv.task) end end if modeEnv.royaleMode then @@ -271,7 +271,7 @@ function resetGameData() curMode.load()--bg/bgm need redefine in custom,so up here if modeEnv.task then for i=1,#players do - players[i].newTask(modeEnv.task) + players[i]:newTask(modeEnv.task) end end BG.set(modeEnv.bg) diff --git a/parts/getTip.lua b/parts/getTip.lua index b4d79a81..689914c6 100644 --- a/parts/getTip.lua +++ b/parts/getTip.lua @@ -1,155 +1,151 @@ local L -if setting.lang==1 then +if setting.lang==1 or setting.lang==2 then L={ - "不是动画,真的在加载!", - "大满贯10连击消四全清!", - "<方块研究所>有一个Nspire-CX版本!", - "B2B2B???", - "B2B2B2B存在吗?", - "MEGACMB!", - "ALLSPIN!", - "O型回旋三清!", + "ZS JL T O I", + "tetr.js 也很好玩!", + "tetr.io 也很好玩!", + "Techminohaowan", + "Techmino 好玩!", + "S T S D 必 死", + "REGRET!!", + "osu好玩!", + "O spin Triple!", + "nullpomino 也很好玩!", "Miya:喵!", - "2+2=Miya", - "225238922 哔哩哔哩 干杯~", - "适度游戏益脑,沉迷游戏伤身,合理安排时间,享受健康生活", - "合群了就会消失, 但是消失不代表没有意义", - "学会使用两个旋转键, 三个更好", - "更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)", - "注意到\"旋转\"到底对方块做了些什么吗?", - "20G本质是一套全新的游戏规则", - "不要在上课时玩游戏!", - "本游戏难度上限很高, 做好心理准备", - "本游戏可不是休闲游戏", - "调到特殊的日期也不会发生什么的", - "3.1415926535897932384", - "2.7182818284590452353", + "LrL RlR LLr RRl RRR LLL FFF RfR RRf rFF", "Let-The-Bass-Kick!", - "使用love2d引擎制作", + "l-=-1", + "jstris 也很好玩!", + "iced,永远的神", + "DT炮=TSD+TST炮", + "COOL!!", + "CLASSIC SEXY RUSSIAN BLOCKS", + "BT炮=beta炮", + "bdg tql wsl", + "B2B2B2B存在吗?", + "B2B2B???", + "Am G F G", + "ALLSPIN!", + "注意到\"旋转\"到底对方块做了些什么吗?", "有疑问? 先看设置有没有你想要的", "有建议的话可以把信息反馈给作者~", - "不要按F10", - "秘密数字:626", - "CLASSIC SEXY RUSSIAN BLOCKS", - "戴上耳机以获得最佳体验", - "少女祈祷中", - "LrL RlR LLr RRl RRR LLL FFF RfR RRf rFF", - "(RUR'U')R'FR2U'R'U'(RUR'F')", - "Am G F G", - "联网还没做呢, 别急", - "\"免费吃鸡方块\"", - "Techminohaowan", - "Techmino 好玩!", - "tetr.js 也很好玩!", - "jstris 也很好玩!", - "tetr.io 也很好玩!", - "nullpomino 也很好玩!", - "↑↑↓↓←→←→BABA", - "草(日本语)", - "dym,永远的神", - "iced,永远的神", - } -elseif setting.lang==2 then - L={ - "不是动画,真的在加载!", - "大满贯10连击消四全清!", - "<方块研究所>有一个Nspire-CX版本!", - "B2B2B???", - "B2B2B2B存在吗?", - "MEGACMB!", - "ALLSPIN!", - "O spin triple!", - "Miya:喵!", - "2*2=Miya", - "225238922 哔哩哔哩 干杯~", + "学会使用两个旋转键, 三个更好", + "享受特色旋转系统!", + "我的世界好玩!", + "提前旋转等设置可以用来救命", + "泰拉瑞亚好玩!", "适度游戏益脑,沉迷游戏伤身,合理安排时间,享受健康生活", - "合群了就会消失,但是消失不代表没有意义", - "学会使用两个旋转键,三个更好", - "更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)", - "注意到\"旋转\"到底对方块做了些什么吗?", - "20G本质是一套全新的游戏规则", - "不要在上课时玩游戏!", - "本游戏难度上限很高,做好心理准备", - "本游戏可不是休闲游戏", - "调到特殊的日期也不会发生什么的", - "3.1415926535897932384", - "2.7182818284590452353", - "Let-The-Bass-Kick!", "使用love2d引擎制作", - "有疑问?先看设置有没有你想要的", - "有建议的话可以把信息反馈给作者~", - "不要按F10", - "秘密数字:626", - "CLASSIC SEXY RUSSIAN BLOCKS", - "戴上耳机以获得最佳体验", "少女祈祷中", - "LrL RlR LLr RRl RRR LLL FFF RfR RRf rFF", - "(RUR'U')R'FR2U'R'U'(RUR'F')", - "Am G F G", + "扫雷好玩!", + "你可以从统计页面打开游戏存档目录", + "你好 世界!", + "魔方好玩!", + "秘密数字:626", + "每个虚拟按键都可以隐藏/显示", "联网还没做呢, 别急", - "\"免费吃鸡方块\"", - "Techminohaowan", - "Techmino 好玩!", - "tetr.js 也很好玩!", - "jstris 也很好玩!", - "tetr.io 也很好玩!", - "nullpomino 也很好玩!", - "↑↑↓↓←→←→BABA", + "键位是可以自定义的", + "合群了就会消失, 但是消失不代表没有意义", + "更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)", + "俄罗斯方块环游记也不错!", + "调到特殊的日期也不会发生什么的", + "低帧率会降低游戏体验", + "戴上耳机以获得最佳体验", + "大满贯10连击消四全清!", "草(日本语)", - "dym,永远的神", - "iced,永远的神", + "不要在上课时玩游戏!", + "不要盯着bug不放", + "不要按F10", + "不是动画,真的在加载!", + "本游戏难度上限很高, 做好心理准备", + "本游戏可不是休闲游戏", + "3.1415926535897932384", + "26连T2来一个?", + "225238922 哔哩哔哩 干杯~", + "20G本质是一套全新的游戏规则", + "20连PC来一个?", + "2+2=Miya", + "2.7182818284590452353", + "15puzzle好玩!", + "11renPC!", + "<方块研究所>有一个Nspire-CX版本!", + "↑↑↓↓←→←→BABA", + "\"免费吃鸡方块\"", + "(RUR'U')R'FR2U'R'U'(RUR'F')", } elseif setting.lang==3 then L={ - "Not animation,real loading!", - "Back to Back 10 combo Techrash PC!", - "Techmino has a Nspire-CX edition!", - "B2B2B???", - "Is B2B2B2B possible?", - "MEGACMB!", - "ALLSPIN!", - "O spin triple!", - "Miya:Nya!", - "2^2=Miya", - "225238922 Bilibili cheers!", - "Playing too much = taking drugs", - "Disappearing doesn't mean useless", - "Try to use two rotate button,three better", - "Small DAS&ARR can make you faster,if you can control block correctly", - "Have you noticed what does \"rotating\" do to block?", - "20G actually is a brand new game rule", - "Do not play game in class!", - "This game can be very hard,be mentally perpared", - "This in not a casual game", - "Nothing will happen when some special day come", - "3.1415926535897932384", - "2.7182818284590452353", - "Let-The-Bass-Kick!", - "Powered by love2d", - "Find out what's in the setting!", - "Any suggestions to author!", - "DO NOT PRESS F10", - "Secret num:626", - "Techmino=Technique+Tetromino", - "CLASSIC SEXY RUSSIAN BLOCKS", - "Headphones for better experience", - "少女祈禱中", - "(RUR'U')R'FR2U'R'U'(RUR'F')", - "Am G F G", - "LrL RlR LLr RRl RRR LLL FFF RfR RRf rFF", - "Only offline game now", - "\"Free block game with royale-mode\"", - "Techmino is so fun!", + "ZS JL T O I", + "You can open saving directory from stat. page", + "wwwwww", "Who is diao", + "What about 26 TSDs?", + "What about 20 PCs?", + "Try to use two rotate button,three better", + "This in not a casual game", + "This game can be very hard,be mentally perpared", + "Tetris journey has network battle!", + "Terraria is fun!", + "Techmino=Technique+Tetromino", + "Techmino is so fun!", + "Techmino has a Nspire-CX edition!", + "Small DAS&ARR can make you faster,if you can control block correctly", + "Secret num:626", + "Rubik's cube is fun!", + "REGRET!!", + "Powered by love2d", + "Playing too much = taking drugs", + "osu is fun!", + "Only offline game now", + "OHHHHHHHHHHHHHH", + "O spin triple!", + "Nothing will happen when some special day come", + "Not animation,real loading!", + "Miya:Nya!", + "Minesweeper is fun!", + "Minecraft is fun!", + "LrL RlR LLr RRl RRR LLL FFF RfR RRf rFF", + "lower fps causes lower game experience", + "Let-The-Bass-Kick!", + "l-=-1", + "Is B2B2B2B possible?", + "Initial Rotation etc. can save your life", + "iced so bully", + "Hello world!", + "Headphones for better experience", + "Have you noticed what does \"rotating\" do to block?", + "Find out what's in the setting!", + "Enjoy Tech. Rotation System!", + "DT cannon=TSD+TST", + "Don't look directly at the bugs!", + "DO NOT PRESS F10", + "Do not play game in class!", + "Disappearing doesn't mean useless", + "diaoyoumei so bully", + "diao so bully", + "COOL!!", + "CLASSIC SEXY RUSSIAN BLOCKS", + "BT cannon=beta", + "Back to Back 10 combo Techrash PC!", + "B2B2B???", + "Any suggestions to author!", + "Am G F G", "Also try tetr.js!", - "Also try jstris!", "Also try tetr.io!", "Also try nullpomino!", + "Also try jstris!", + "ALLSPIN!", + "少女祈禱中", + "3.1415926535897932384", + "225238922 Bilibili cheers!", + "20G actually is a brand new game rule", + "2^2=Miya", + "2.7182818284590452353", + "15puzzle is fun!", + "11renPC!", "↑↑↓↓←→←→BABA", - "wwwwww", - "diaoyoumei so bully", - "iced so bully", - "diao so bully", + "\"Free block game with royale mode\"", + "(RUR'U')R'FR2U'R'U'(RUR'F')", } elseif setting.lang==4 then L={'!','@','#','$','%','^','&','*','(',')','-','=','_','+','[',']','{','}','\\','|',';',':','\'','"',',','<','.','>','/','?'} diff --git a/parts/player.lua b/parts/player.lua index 2ecb413d..2dd61335 100644 --- a/parts/player.lua +++ b/parts/player.lua @@ -153,8 +153,8 @@ local ren_n={}for i=1,11 do ren_n[i]="ren_"..i end ---------------------------------------------------- ---------------------------------------------------- -local player={} -local PLY={} +local player={}--player object +local PLY={}--lib ---------------------------------------------------- ---------------------------------------------------- @@ -217,6 +217,12 @@ local function updateFXs(P,dt) end if P.fieldBeneath>0 then P.fieldBeneath=max(P.fieldBeneath-P.gameEnv.pushSpeed,0)end end +local function updateTasks(P) + local L=P.tasks + for i=#L,1,-1 do + if L[i].code(P,L[i].data)then end + end +end local function Pupdate_alive(P,dt) if P.timing then P.stat.time=P.stat.time+dt end if P.keyRec then @@ -393,6 +399,7 @@ local function Pupdate_alive(P,dt) P.b2b1=max(P.b2b1*.95+P.b2b*.05-.6,P.b2b) end updateFXs(P,dt) + updateTasks(P) end local function Pupdate_dead(P,dt) if P.timing then P.stat.time=P.stat.time+dt end @@ -422,6 +429,7 @@ local function Pupdate_dead(P,dt) end if P.b2b1>0 then P.b2b1=max(0,P.b2b1*.92-1)end updateFXs(P,dt) + updateTasks(P) end ---------------------------------------------------- @@ -950,6 +958,13 @@ function player.createBeam(P,R,send,time,target,color,clear,spin,mini,combo) drag={},--Afterimage coordinate list } end +function player.newTask(P,code,data) + local L=P.tasks + L[#L+1]={ + code=code, + data=data, + } +end ---------------------------------------------------- ---------------------------------------------------- @@ -1801,10 +1816,10 @@ function tick.lose(P) end end end -function tick.throwBadge(A,data) - data[2]=data[2]-1 - if data[2]%4==0 then - local S,R=data[1],data[1].lastRecv +function tick.throwBadge(data)--{ifAI,Sender,timer} + data[3]=data[3]-1 + if data[3]%4==0 then + local S,R=data[2],data[2].lastRecv local x1,y1,x2,y2 if S.small then x1,y1=S.centerX,S.centerY @@ -1819,11 +1834,11 @@ function tick.throwBadge(A,data) FX_badge[#FX_badge+1]={x1,y1,x2,y2,t=0} --generate badge object - if not A.ai and data[2]%8==0 then + if not data[1]and data[3]%8==0 then SFX.play("collect") end end - if data[2]<=0 then return true end + if data[3]<=0 then return true end end local function gameOver() @@ -1872,7 +1887,7 @@ local function gameOver() end end--Save record -function player.die(P)--Same thing when win/lose,not really die! +function player.die(P)--Called when win/lose,not really die! P.alive=false P.timing=false P.control=false @@ -1913,7 +1928,7 @@ function player.win(P,result) if P.human then gameOver() end - TASK.new(tick.finish,P) + P:newTask(tick.finish) end function player.lose(P) if P.life>0 then @@ -1957,7 +1972,7 @@ function player.lose(P) end P.lastRecv=A if P.id==1 or A.id==1 then - TASK.new(tick.throwBadge,A,{P,max(3,P.badge)*4}) + TASK.new(tick.throwBadge,{A.ai,P,max(3,P.badge)*4}) end freshMostBadge() end @@ -1990,9 +2005,9 @@ function player.lose(P) end end gameOver() - TASK.new(#players>1 and tick.lose or tick.finish,P) + P:newTask(#players>1 and tick.lose or tick.finish) else - TASK.new(tick.lose,P) + P:newTask(tick.lose) end if #players.alive==1 then players.alive[1]:win() @@ -2337,6 +2352,7 @@ local function newEmptyPlayer(id,x,y,size) P.score1,P.b2b1=0,0 P.dropFX,P.lockFX,P.clearFX={},{},{} + P.tasks={}--tasks P.bonus={}--texts P.endCounter=0--used after gameover diff --git a/parts/updateLog.lua b/parts/updateLog.lua index 87984537..0d95626e 100644 --- a/parts/updateLog.lua +++ b/parts/updateLog.lua @@ -19,7 +19,7 @@ local S=[=[ PCX kagura77 呆喂 GlowingEmbers 轩辕辚 HimuroAki TCV100 tech有养成系统了@7065 HAGE KANOBU 闪电和拐棍 葡萄味的曼妥思 世界沃德 - 蓝绿 天生的魔法师 saki 琳雨空 + 蓝绿 天生的魔法师 saki 琳雨空 T8779.易缄 Thanks!!! @@ -55,9 +55,9 @@ Future outlook: field flip(LR/UD) no fail(∞ lives) mini games: - 15 puzzle + 15 puzzle (with hidden mode) + 2048 (with next (with deadly mode)) mine sweeper - 2048 tank battle time-based-rank for master advanced mode(1:58/2:28/3:03/300P/100P) 简易防沉迷系统 @@ -82,11 +82,15 @@ Future outlook: 0.8.25: Custom Sequence Update new: --TODO: custom sequence + many new tips changed: + faster&harder attacker-ultimate little easier to get S in PC challenge (easy mode) - easier to get S in infinite mode + easier to get S in infinite mode, c4w, PC + harder to unlock sprint 400/1000 code: file sorted + task system rewrited, now perfect fixed: hard move won't deactive "spin" do not clear dead enemies' field