整理代码,增强hpc攻击力(2→4)

This commit is contained in:
MrZ626
2021-04-14 14:23:11 +08:00
parent 3c39c8a788
commit 41d85e1f36
3 changed files with 73 additions and 64 deletions

View File

@@ -33,7 +33,7 @@ Attack system:
Special line clears will the increase B2B gauge, making later special line clears have either a B2B or B2B2B bonus (see below) Special line clears will the increase B2B gauge, making later special line clears have either a B2B or B2B2B bonus (see below)
Half Perfect Clear (a P.C. "with blocks left below". If it's an I clearing 1 line, the remaining blocks must not be player-placed): Half Perfect Clear (a P.C. "with blocks left below". If it's an I clearing 1 line, the remaining blocks must not be player-placed):
Attack +2, Extra Blocking +2 Attack +4, Extra Blocking +2
Perfect Clear (aka All Clear): Perfect Clear (aka All Clear):
Sends 8 to 16 (increments within a game by 2 for every PC) OR every other damage above, whichever is higher, Sends 8 to 16 (increments within a game by 2 for every PC) OR every other damage above, whichever is higher,

View File

@@ -27,7 +27,7 @@ spin判定:
B2B攻击+1 B2B攻击+1
B3B攻击+50%,+1额外抵挡 B3B攻击+50%,+1额外抵挡
特殊消除会增加B2B点数,让之后的特殊消除获得B2B(B3B)增益(详细说明见下文) 特殊消除会增加B2B点数,让之后的特殊消除获得B2B(B3B)增益(详细说明见下文)
半全消("下方有剩余方块"的全消,如果是I消1行则必须不剩余玩家放置的方块):伤害+2,额外抵挡+2 半全消("下方有剩余方块"的全消,如果是I消1行则必须不剩余玩家放置的方块):伤害+4,额外抵挡+2
全消:全消伤害为8~16(本局内递增2),和上述其他伤害取大,然后+2额外抵挡(注:本局消行数>4时会将B2B点数拉满) 全消:全消伤害为8~16(本局内递增2),和上述其他伤害取大,然后+2额外抵挡(注:本局消行数>4时会将B2B点数拉满)
连击:每次连击给予上述攻击[连击数*25%(上限12连)(如果只消一行就是15%)]的加成,>=3次时再额外加1攻击 连击:每次连击给予上述攻击[连击数*25%(上限12连)(如果只消一行就是15%)]的加成,>=3次时再额外加1攻击
根据上述规则计算后,向下取整,攻击打出 根据上述规则计算后,向下取整,攻击打出

View File

@@ -955,7 +955,7 @@ do--Player.drop(self)--Place piece
local CHN=VOC.getFreeChannel() local CHN=VOC.getFreeChannel()
self.dropTime[11]=ins(self.dropTime,1,GAME.frame)--Update speed dial self.dropTime[11]=ins(self.dropTime,1,GAME.frame)--Update speed dial
local ENV=self.gameEnv local ENV=self.gameEnv
local STAT=self.stat local Stat=self.stat
local piece=self.lastPiece local piece=self.lastPiece
local finish local finish
@@ -974,7 +974,7 @@ do--Player.drop(self)--Place piece
--Tri-corner spin check --Tri-corner spin check
if self.spinLast then if self.spinLast then
if C.id<6 then if C.id<6 then
local x,y=CX+self.cur.sc[2],CY+self.cur.sc[1] local x,y=CX+C.sc[2],CY+C.sc[1]
local c=0 local c=0
if self:solid(x-1,y+1)then c=c+1 end if self:solid(x-1,y+1)then c=c+1 end
if self:solid(x+1,y+1)then c=c+1 end if self:solid(x+1,y+1)then c=c+1 end
@@ -1100,15 +1100,17 @@ do--Player.drop(self)--Place piece
end end
end end
--Cancel no-sense clearing FX --Cancel top clearing FX
_=#self.clearingRow for i=#self.clearingRow,1,-1 do
while _>0 and self.clearingRow[_]>#self.field do if self.clearingRow[i]>#self.field then
self.clearingRow[_]=nil rem(self.clearingRow)
_=_-1 else
break
end
end end
if self.clearingRow[1]then if self.clearingRow[1]then
self.falling=ENV.fall self.falling=ENV.fall
elseif cc>=#C.bk then else
clear=true clear=true
end end
@@ -1117,16 +1119,16 @@ do--Player.drop(self)--Place piece
if not finesse then if not finesse then
if dospin then self.ctrlCount=self.ctrlCount-2 end--Allow 2 more step for roof-less spin if dospin then self.ctrlCount=self.ctrlCount-2 end--Allow 2 more step for roof-less spin
local id=C.id local id=C.id
local d=self.ctrlCount-finesseList[id][self.cur.dir+1][CX] local d=self.ctrlCount-finesseList[id][C.dir+1][CX]
finePts=d<=0 and 5 or max(3-d,0) finePts=d<=0 and 5 or max(3-d,0)
else else
finePts=5 finePts=5
end end
piece.finePts=finePts piece.finePts=finePts
STAT.finesseRate=STAT.finesseRate+finePts Stat.finesseRate=Stat.finesseRate+finePts
if finePts<5 then if finePts<5 then
STAT.extraPiece=STAT.extraPiece+1 Stat.extraPiece=Stat.extraPiece+1
if ENV.fineKill then if ENV.fineKill then
finish=true finish=true
end end
@@ -1164,7 +1166,7 @@ do--Player.drop(self)--Place piece
atk=b2bATK[cc]+cc*.5 atk=b2bATK[cc]+cc*.5
exblock=exblock+1 exblock=exblock+1
cscore=cscore*2 cscore=cscore*2
STAT.b3b=STAT.b3b+1 Stat.b3b=Stat.b3b+1
if self.sound then if self.sound then
VOC.play("b3b",CHN) VOC.play("b3b",CHN)
end end
@@ -1172,7 +1174,7 @@ do--Player.drop(self)--Place piece
self:showText(text.b2b..text.block[C.name]..text.spin.." "..text.clear[cc],0,-30,35,"spin") self:showText(text.b2b..text.block[C.name]..text.spin.." "..text.clear[cc],0,-30,35,"spin")
atk=b2bATK[cc] atk=b2bATK[cc]
cscore=cscore*1.2 cscore=cscore*1.2
STAT.b2b=STAT.b2b+1 Stat.b2b=Stat.b2b+1
if self.sound then if self.sound then
VOC.play("b2b",CHN) VOC.play("b2b",CHN)
end end
@@ -1207,7 +1209,7 @@ do--Player.drop(self)--Place piece
sendTime=100 sendTime=100
exblock=exblock+1 exblock=exblock+1
cscore=cscore*1.8 cscore=cscore*1.8
STAT.b3b=STAT.b3b+1 Stat.b3b=Stat.b3b+1
if self.sound then if self.sound then
VOC.play("b3b",CHN) VOC.play("b3b",CHN)
end end
@@ -1216,7 +1218,7 @@ do--Player.drop(self)--Place piece
sendTime=80 sendTime=80
atk=3*cc-7 atk=3*cc-7
cscore=cscore*1.3 cscore=cscore*1.3
STAT.b2b=STAT.b2b+1 Stat.b2b=Stat.b2b+1
if self.sound then if self.sound then
VOC.play("b2b",CHN) VOC.play("b2b",CHN)
end end
@@ -1258,37 +1260,39 @@ do--Player.drop(self)--Place piece
end end
--PC/HPC --PC/HPC
if clear and #self.field==0 then if clear then
self:showText(text.PC,0,-80,50,"flicker") if #self.field==0 then
atk=max(atk,min(8+STAT.pc*2,16)) self:showText(text.PC,0,-80,50,"flicker")
exblock=exblock+2 atk=max(atk,min(8+Stat.pc*2,16))
sendTime=sendTime+120 exblock=exblock+2
if STAT.row+cc>4 then sendTime=sendTime+120
self.b2b=1000 if Stat.row+cc>4 then
cscore=cscore+300*min(6+STAT.pc,10) self.b2b=1000
else cscore=cscore+300*min(6+Stat.pc,10)
else
cscore=cscore+626
end
Stat.pc=Stat.pc+1
if self.sound then
SFX.play("clear")
VOC.play("perfect_clear",CHN)
end
piece.pc=true
piece.special=true
elseif cc>=#C.bk and(cc>1 or #self.field==self.garbageBeneath)then
self:showText(text.HPC,0,-80,50,"fly")
atk=atk+4
exblock=exblock+2
sendTime=sendTime+60
cscore=cscore+626 cscore=cscore+626
Stat.hpc=Stat.hpc+1
if self.sound then
SFX.play("clear")
VOC.play("half_clear",CHN)
end
piece.hpc=true
piece.special=true
end end
STAT.pc=STAT.pc+1
if self.sound then
SFX.play("clear")
VOC.play("perfect_clear",CHN)
end
piece.pc=true
piece.special=true
elseif clear and(cc>1 or #self.field==self.garbageBeneath)then
self:showText(text.HPC,0,-80,50,"fly")
atk=atk+2
exblock=exblock+2
sendTime=sendTime+60
cscore=cscore+626
STAT.hpc=STAT.hpc+1
if self.sound then
SFX.play("clear")
VOC.play("half_clear",CHN)
end
piece.hpc=true
piece.special=true
end end
if self.b2b>1000 then self.b2b=1000 end if self.b2b>1000 then self.b2b=1000 end
@@ -1386,13 +1390,18 @@ do--Player.drop(self)--Place piece
end end
--Speed bonus --Speed bonus
if self.dropSpeed>60 then if self.dropSpeed>60 then cscore=cscore*(.9+self.dropSpeed/600)end
cscore=cscore*(.9+self.dropSpeed/600)
end
cscore=int(cscore) cscore=int(cscore)
if ENV.score then if ENV.score then
self:showText(cscore,(self.curX+self.cur.sc[2]-5.5)*30,(10-self.curY-self.cur.sc[1])*30+self.fieldBeneath+self.fieldUp,40-600/(cscore+20),"score",2) self:showText(
cscore,
(self.curX+C.sc[2]-5.5)*30,
(10-self.curY-C.sc[1])*30+self.fieldBeneath+self.fieldUp,
40-600/(cscore+20),
"score",
2
)
end end
piece.row,piece.dig=cc,gbcc piece.row,piece.dig=cc,gbcc
@@ -1436,33 +1445,33 @@ do--Player.drop(self)--Place piece
end end
--Update stat --Update stat
STAT.score=STAT.score+cscore Stat.score=Stat.score+cscore
STAT.piece=STAT.piece+1 Stat.piece=Stat.piece+1
STAT.row=STAT.row+cc Stat.row=Stat.row+cc
STAT.maxFinesseCombo=max(STAT.maxFinesseCombo,self.finesseCombo) Stat.maxFinesseCombo=max(Stat.maxFinesseCombo,self.finesseCombo)
STAT.maxCombo=max(STAT.maxCombo,self.combo) Stat.maxCombo=max(Stat.maxCombo,self.combo)
if atk>0 then if atk>0 then
STAT.atk=STAT.atk+atk Stat.atk=Stat.atk+atk
if send>0 then if send>0 then
STAT.send=STAT.send+int(send) Stat.send=Stat.send+int(send)
end end
if off>0 then if off>0 then
STAT.off=STAT.off+off Stat.off=Stat.off+off
end end
end end
if gbcc>0 then if gbcc>0 then
STAT.dig=STAT.dig+gbcc Stat.dig=Stat.dig+gbcc
if atk>0 then if atk>0 then
STAT.digatk=STAT.digatk+atk*gbcc/cc Stat.digatk=Stat.digatk+atk*gbcc/cc
end end
end end
local n=C.name local n=C.name
if dospin then if dospin then
_=STAT.spin[n] _[cc+1]=_[cc+1]+1--Spin[1~25][0~4] _=Stat.spin[n] _[cc+1]=_[cc+1]+1--Spin[1~25][0~4]
_=STAT.spins _[cc+1]=_[cc+1]+1--Spin[0~4] _=Stat.spins _[cc+1]=_[cc+1]+1--Spin[0~4]
elseif cc>0 then elseif cc>0 then
_=STAT.clear[n] _[cc]=_[cc]+1--Clear[1~25][1~5] _=Stat.clear[n] _[cc]=_[cc]+1--Clear[1~25][1~5]
_=STAT.clears _[cc]=_[cc]+1--Clear[1~5] _=Stat.clears _[cc]=_[cc]+1--Clear[1~5]
end end
if finish then if finish then