Merge remote-tracking branch 'origin/main' into feature/maker-ui-edit
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -928,8 +928,8 @@
|
|||||||
"class": "bandit",
|
"class": "bandit",
|
||||||
"rarity": "unique",
|
"rarity": "unique",
|
||||||
"desc": "내 턴 종료 시, 카드를 최대 1장까지 보존합니다.",
|
"desc": "내 턴 종료 시, 카드를 최대 1장까지 보존합니다.",
|
||||||
"powerEffect": "blockPerTurn",
|
"powerEffect": "retainOne",
|
||||||
"value": 2,
|
"value": 1,
|
||||||
"image": "c1e19219745e44c39ae6ac2f77e347d9"
|
"image": "c1e19219745e44c39ae6ac2f77e347d9"
|
||||||
},
|
},
|
||||||
"InfiniteBlades": {
|
"InfiniteBlades": {
|
||||||
@@ -1307,27 +1307,6 @@
|
|||||||
"powerEffect": "blockPerTurn",
|
"powerEffect": "blockPerTurn",
|
||||||
"value": 8,
|
"value": 8,
|
||||||
"image": "0946f69d84464df29b24b94c744c868d"
|
"image": "0946f69d84464df29b24b94c744c868d"
|
||||||
},
|
|
||||||
"Flanking": {
|
|
||||||
"name": "측면 공격",
|
|
||||||
"cost": 2,
|
|
||||||
"kind": "Skill",
|
|
||||||
"class": "bandit",
|
|
||||||
"rarity": "legend",
|
|
||||||
"desc": "이번 턴에 대상 적이 다른 플레이어에게 받는 피해량이 2배가 됩니다.",
|
|
||||||
"draw": 1,
|
|
||||||
"image": "b1360ed0c4b942309d240634b8f36872"
|
|
||||||
},
|
|
||||||
"Sneaky": {
|
|
||||||
"name": "비열함",
|
|
||||||
"cost": 2,
|
|
||||||
"kind": "Skill",
|
|
||||||
"class": "bandit",
|
|
||||||
"rarity": "legend",
|
|
||||||
"desc": "교활. 다른 플레이어가 적을 공격할 때마다, 방어도를 1 얻습니다.",
|
|
||||||
"block": 1,
|
|
||||||
"sly": true,
|
|
||||||
"image": "0946f69d84464df29b24b94c744c868d"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"starterDecks": {
|
"starterDecks": {
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ _InputService:ConnectEvent(KeyDownEvent, function(e)
|
|||||||
if self.DebugCtrlDown == true and self.DebugShiftDown == true then
|
if self.DebugCtrlDown == true and self.DebugShiftDown == true then
|
||||||
self:OpenDebugCardPicker()
|
self:OpenDebugCardPicker()
|
||||||
end
|
end
|
||||||
|
elseif e.key == KeyboardKey.E then
|
||||||
|
if self.DebugCtrlDown == true and self.DebugShiftDown == true then
|
||||||
|
self:CheatFillEnergy()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
_InputService:ConnectEvent(KeyUpEvent, function(e)
|
_InputService:ConnectEvent(KeyUpEvent, function(e)
|
||||||
@@ -49,6 +53,12 @@ _InputService:ConnectEvent(KeyUpEvent, function(e)
|
|||||||
self.DebugShiftDown = false
|
self.DebugShiftDown = false
|
||||||
end
|
end
|
||||||
end)`),
|
end)`),
|
||||||
|
method('CheatFillEnergy', `if self.RunActive ~= true or self.CombatOver == true then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.Energy = self.MaxEnergy
|
||||||
|
self:RenderPiles()
|
||||||
|
self:Toast("치트: 에너지 회복")`),
|
||||||
method('ReqLoadAscension', `local ds = _DataStorageService:GetUserDataStorage(userId)
|
method('ReqLoadAscension', `local ds = _DataStorageService:GetUserDataStorage(userId)
|
||||||
local errCode, value = ds:GetAndWait("ascensionUnlocked")
|
local errCode, value = ds:GetAndWait("ascensionUnlocked")
|
||||||
local n = 0
|
local n = 0
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ export const combatMethods = [
|
|||||||
self:SelectDiscardSlot(slot)
|
self:SelectDiscardSlot(slot)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if self:IsRetainSelecting() == true then
|
||||||
|
self:SelectRetainSlot(slot)
|
||||||
|
return
|
||||||
|
end
|
||||||
if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then
|
if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -50,6 +54,8 @@ self:RenderCombat()
|
|||||||
self:CheckCombatEnd()`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }]),
|
self:CheckCombatEnd()`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }]),
|
||||||
method('OnCardButton', `if self:IsDiscardSelecting() == true then
|
method('OnCardButton', `if self:IsDiscardSelecting() == true then
|
||||||
self:SelectDiscardSlot(slot)
|
self:SelectDiscardSlot(slot)
|
||||||
|
elseif self:IsRetainSelecting() == true then
|
||||||
|
self:SelectRetainSlot(slot)
|
||||||
end`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }]),
|
end`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }]),
|
||||||
method('FindMonsterAtTouch', `local best = 0
|
method('FindMonsterAtTouch', `local best = 0
|
||||||
local bestDist = 200
|
local bestDist = 200
|
||||||
@@ -136,6 +142,10 @@ self:ResolveCardDrop(slot, touchPoint)`, [
|
|||||||
self:SelectDiscardSlot(slot)
|
self:SelectDiscardSlot(slot)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if self:IsRetainSelecting() == true then
|
||||||
|
self:SelectRetainSlot(slot)
|
||||||
|
return
|
||||||
|
end
|
||||||
if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then
|
if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -416,6 +426,7 @@ self.DiscardSelectRemaining = 0
|
|||||||
self.DiscardSelectTotal = 0
|
self.DiscardSelectTotal = 0
|
||||||
self.DiscardPostShiv = 0
|
self.DiscardPostShiv = 0
|
||||||
self.DiscardShivPerPick = 0
|
self.DiscardShivPerPick = 0
|
||||||
|
self.RetainSelectActive = false
|
||||||
self:UpdateDiscardPrompt()
|
self:UpdateDiscardPrompt()
|
||||||
self:RenderHand(false)
|
self:RenderHand(false)
|
||||||
self:RenderPiles()`),
|
self:RenderPiles()`),
|
||||||
|
|||||||
@@ -221,6 +221,8 @@ for i = 1, 3 do
|
|||||||
end
|
end
|
||||||
end`),
|
end`),
|
||||||
method('StartPlayerTurn', `self.Turn = self.Turn + 1
|
method('StartPlayerTurn', `self.Turn = self.Turn + 1
|
||||||
|
self.RetainSelectActive = false
|
||||||
|
self:UpdateDiscardPrompt()
|
||||||
self.Energy = self.MaxEnergy
|
self.Energy = self.MaxEnergy
|
||||||
self:ApplyRelics("turnStart")
|
self:ApplyRelics("turnStart")
|
||||||
self.PlayerBlock = 0
|
self.PlayerBlock = 0
|
||||||
@@ -248,6 +250,33 @@ end
|
|||||||
self:DrawCards(5)
|
self:DrawCards(5)
|
||||||
self:RenderHand(true)
|
self:RenderHand(true)
|
||||||
self:RenderCombat()`),
|
self:RenderCombat()`),
|
||||||
|
method('HasPowerEffect', `if self.PlayerPowers == nil then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
for i = 1, #self.PlayerPowers do
|
||||||
|
local pc = self.Cards[self.PlayerPowers[i]]
|
||||||
|
if pc ~= nil and pc.powerEffect == effect then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false`, [{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'effect' }], 0, 'boolean'),
|
||||||
|
method('ShouldOfferRetain', `if self:HasPowerEffect("retainOne") ~= true then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if self.Hand == nil or #self.Hand <= 0 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
for i = 1, #self.Hand do
|
||||||
|
local c = self.Cards[self.Hand[i]]
|
||||||
|
if c ~= nil and c.retain ~= true then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false`, [], 0, 'boolean'),
|
||||||
|
method('BeginRetainSelection', `self.RetainSelectActive = true
|
||||||
|
self:UpdateDiscardPrompt()
|
||||||
|
self:Toast("보존할 카드를 선택하세요")
|
||||||
|
self:RenderHand(false)`, []),
|
||||||
method('EndPlayerTurn', `if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then
|
method('EndPlayerTurn', `if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -255,6 +284,17 @@ if self:IsDiscardSelecting() == true then
|
|||||||
self:Toast("버릴 카드를 먼저 선택하세요")
|
self:Toast("버릴 카드를 먼저 선택하세요")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if self:IsRetainSelecting() == true then
|
||||||
|
self:FinishPlayerTurn(0)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if self:ShouldOfferRetain() == true then
|
||||||
|
self:BeginRetainSelection()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self:FinishPlayerTurn(0)`),
|
||||||
|
method('FinishPlayerTurn', `self.RetainSelectActive = false
|
||||||
|
self:UpdateDiscardPrompt()
|
||||||
local burn = 0
|
local burn = 0
|
||||||
for bi = 1, #self.Hand do
|
for bi = 1, #self.Hand do
|
||||||
\tlocal hc = self.Cards[self.Hand[bi]]
|
\tlocal hc = self.Cards[self.Hand[bi]]
|
||||||
@@ -270,7 +310,7 @@ local kept = {}
|
|||||||
for i = 1, #self.Hand do
|
for i = 1, #self.Hand do
|
||||||
\tlocal cardId = self.Hand[i]
|
\tlocal cardId = self.Hand[i]
|
||||||
\tlocal c = self.Cards[cardId]
|
\tlocal c = self.Cards[cardId]
|
||||||
\tif c ~= nil and c.retain == true then
|
\tif c ~= nil and (c.retain == true or i == retainSlot) then
|
||||||
\t\ttable.insert(kept, cardId)
|
\t\ttable.insert(kept, cardId)
|
||||||
\telse
|
\telse
|
||||||
\t\ttable.insert(self.DiscardPile, cardId)
|
\t\ttable.insert(self.DiscardPile, cardId)
|
||||||
@@ -281,8 +321,9 @@ if self.PlayerWeak > 0 then self.PlayerWeak = self.PlayerWeak - 1 end
|
|||||||
if self.PlayerVuln > 0 then self.PlayerVuln = self.PlayerVuln - 1 end
|
if self.PlayerVuln > 0 then self.PlayerVuln = self.PlayerVuln - 1 end
|
||||||
self:RenderHand(false)
|
self:RenderHand(false)
|
||||||
self:RenderPiles()
|
self:RenderPiles()
|
||||||
self:EnemyTurn()`),
|
self:EnemyTurn()`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'retainSlot' }]),
|
||||||
method('DrawCards', `local drawnSlots = {}
|
method('DrawCards', `local drawnSlots = {}
|
||||||
|
local drewAny = false
|
||||||
for i = 1, amount do
|
for i = 1, amount do
|
||||||
\tif #self.DrawPile <= 0 then
|
\tif #self.DrawPile <= 0 then
|
||||||
\t\tself:RecycleDiscardIntoDraw()
|
\t\tself:RecycleDiscardIntoDraw()
|
||||||
@@ -296,14 +337,15 @@ for i = 1, amount do
|
|||||||
\t\tself:TriggerSly(cardId)
|
\t\tself:TriggerSly(cardId)
|
||||||
\telse
|
\telse
|
||||||
\t\ttable.insert(self.Hand, cardId)
|
\t\ttable.insert(self.Hand, cardId)
|
||||||
\t\tif #self.Hand <= 5 then
|
\t\tdrewAny = true
|
||||||
\t\t\ttable.insert(drawnSlots, #self.Hand)
|
\t\ttable.insert(drawnSlots, #self.Hand)
|
||||||
\t\tend
|
|
||||||
\tend
|
\tend
|
||||||
end
|
end
|
||||||
self:RenderPiles()
|
self:RenderPiles()
|
||||||
if animate == true and #drawnSlots > 0 then
|
if drewAny == true then
|
||||||
\tself:RenderHand(false)
|
\tself:RenderHand(false)
|
||||||
|
end
|
||||||
|
if animate == true and #drawnSlots > 0 then
|
||||||
\tlocal drawStart = Vector2(-590, 8)
|
\tlocal drawStart = Vector2(-590, 8)
|
||||||
\tfor i = 1, #drawnSlots do
|
\tfor i = 1, #drawnSlots do
|
||||||
\t\tlocal slot = drawnSlots[i]
|
\t\tlocal slot = drawnSlots[i]
|
||||||
|
|||||||
@@ -203,6 +203,68 @@ end, 1 / 60)`, [
|
|||||||
{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'toPos' },
|
{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'toPos' },
|
||||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'duration' },
|
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'duration' },
|
||||||
]),
|
]),
|
||||||
|
method('AnimateDiscardCards', `if cardIds == nil or slots == nil then
|
||||||
|
\treturn
|
||||||
|
end
|
||||||
|
local target = Vector2(590, 8)
|
||||||
|
local duration = 0.18
|
||||||
|
for i = 1, #cardIds do
|
||||||
|
\tlocal slot = slots[i] or i
|
||||||
|
\tlocal e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(slot))
|
||||||
|
\tif e ~= nil then
|
||||||
|
\t\te.Enable = true
|
||||||
|
\t\tself:ApplyCardFace("/ui/RunUIGroup/CardHand/Card" .. tostring(slot), cardIds[i])
|
||||||
|
\t\tif e.UITransformComponent ~= nil then
|
||||||
|
\t\t\tlocal sx = 0
|
||||||
|
\t\t\tif startXs ~= nil and startXs[i] ~= nil then sx = startXs[i] else sx = self:GetHandSlotX(slot) end
|
||||||
|
\t\t\te.UITransformComponent.anchoredPosition = Vector2(sx, 0)
|
||||||
|
\t\t\te.UITransformComponent.UIScale = Vector3(1, 1, 1)
|
||||||
|
\t\tend
|
||||||
|
\tend
|
||||||
|
end
|
||||||
|
local elapsed = 0
|
||||||
|
local eventId = 0
|
||||||
|
eventId = _TimerService:SetTimerRepeat(function()
|
||||||
|
\telapsed = elapsed + 1 / 60
|
||||||
|
\tlocal t = math.min(elapsed / duration, 1)
|
||||||
|
\tlocal eased = _TweenLogic:Ease(0, 1, 1, EaseType.SineEaseIn, t)
|
||||||
|
\tfor i = 1, #cardIds do
|
||||||
|
\t\tlocal slot = slots[i] or i
|
||||||
|
\t\tlocal e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(slot))
|
||||||
|
\t\tif e ~= nil and e.UITransformComponent ~= nil then
|
||||||
|
\t\t\tlocal sx = 0
|
||||||
|
\t\t\tif startXs ~= nil and startXs[i] ~= nil then sx = startXs[i] else sx = self:GetHandSlotX(slot) end
|
||||||
|
\t\t\tlocal x = sx + (target.x - sx) * eased
|
||||||
|
\t\t\tlocal y = 0 + (target.y - 0) * eased
|
||||||
|
\t\t\tlocal s = 1 - 0.25 * eased
|
||||||
|
\t\t\te.UITransformComponent.anchoredPosition = Vector2(x, y)
|
||||||
|
\t\t\te.UITransformComponent.UIScale = Vector3(s, s, 1)
|
||||||
|
\t\tend
|
||||||
|
\tend
|
||||||
|
\tif t >= 1 then
|
||||||
|
\t\t_TimerService:ClearTimer(eventId)
|
||||||
|
\t\tfor i = 1, #cardIds do
|
||||||
|
\t\t\tlocal slot = slots[i] or i
|
||||||
|
\t\t\tlocal e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(slot))
|
||||||
|
\t\t\tif e ~= nil then
|
||||||
|
\t\t\t\tif self.Hand ~= nil and self.Hand[slot] ~= nil then
|
||||||
|
\t\t\t\t\te.Enable = true
|
||||||
|
\t\t\t\t\tself:ApplyCardVisual(slot, self.Hand[slot])
|
||||||
|
\t\t\t\t\tif e.UITransformComponent ~= nil then
|
||||||
|
\t\t\t\t\t\te.UITransformComponent.anchoredPosition = Vector2(self:GetHandSlotX(slot), 0)
|
||||||
|
\t\t\t\t\t\te.UITransformComponent.UIScale = Vector3(1, 1, 1)
|
||||||
|
\t\t\t\t\tend
|
||||||
|
\t\t\t\telse
|
||||||
|
\t\t\t\t\te.Enable = false
|
||||||
|
\t\t\t\tend
|
||||||
|
\t\t\tend
|
||||||
|
\t\tend
|
||||||
|
\tend
|
||||||
|
end, 1 / 60)`, [
|
||||||
|
{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'cardIds' },
|
||||||
|
{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'startXs' },
|
||||||
|
{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slots' },
|
||||||
|
]),
|
||||||
method('AddCardBlock', `local amount = base or 0
|
method('AddCardBlock', `local amount = base or 0
|
||||||
if amount > 0 and self.PlayerDex ~= nil then
|
if amount > 0 and self.PlayerDex ~= nil then
|
||||||
amount = amount + self.PlayerDex
|
amount = amount + self.PlayerDex
|
||||||
@@ -319,15 +381,21 @@ local cardId = self.Hand[slot]
|
|||||||
if cardId == nil then
|
if cardId == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local startX = self:GetHandSlotX(slot)
|
||||||
table.remove(self.Hand, slot)
|
table.remove(self.Hand, slot)
|
||||||
table.insert(self.DiscardPile, cardId)
|
table.insert(self.DiscardPile, cardId)
|
||||||
if triggerSly == true then
|
if triggerSly == true then
|
||||||
self:TriggerSly(cardId)
|
self:TriggerSly(cardId)
|
||||||
|
end
|
||||||
|
if animate == true then
|
||||||
|
self:AnimateDiscardCards({ cardId }, { startX }, { slot })
|
||||||
end`, [
|
end`, [
|
||||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' },
|
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' },
|
||||||
{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'triggerSly' },
|
{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'triggerSly' },
|
||||||
|
{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'animate' },
|
||||||
]),
|
]),
|
||||||
method('IsDiscardSelecting', `return self.DiscardSelectRemaining ~= nil and self.DiscardSelectRemaining > 0`, [], 0, 'boolean'),
|
method('IsDiscardSelecting', `return self.DiscardSelectRemaining ~= nil and self.DiscardSelectRemaining > 0`, [], 0, 'boolean'),
|
||||||
|
method('IsRetainSelecting', `return self.RetainSelectActive == true`, [], 0, 'boolean'),
|
||||||
method('UpdateDiscardPrompt', `local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/DiscardPrompt")
|
method('UpdateDiscardPrompt', `local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/DiscardPrompt")
|
||||||
if e == nil then
|
if e == nil then
|
||||||
return
|
return
|
||||||
@@ -336,16 +404,20 @@ if self:IsDiscardSelecting() == true then
|
|||||||
local picked = self.DiscardSelectTotal - self.DiscardSelectRemaining
|
local picked = self.DiscardSelectTotal - self.DiscardSelectRemaining
|
||||||
self:SetText("/ui/RunUIGroup/CombatHud/DiscardPrompt", "버릴 카드 선택 " .. self:FormatNumber(picked + 1) .. "/" .. self:FormatNumber(self.DiscardSelectTotal))
|
self:SetText("/ui/RunUIGroup/CombatHud/DiscardPrompt", "버릴 카드 선택 " .. self:FormatNumber(picked + 1) .. "/" .. self:FormatNumber(self.DiscardSelectTotal))
|
||||||
e.Enable = true
|
e.Enable = true
|
||||||
|
elseif self:IsRetainSelecting() == true then
|
||||||
|
self:SetText("/ui/RunUIGroup/CombatHud/DiscardPrompt", "보존할 카드 선택 (턴 종료: 건너뛰기)")
|
||||||
|
e.Enable = true
|
||||||
else
|
else
|
||||||
e.Enable = false
|
e.Enable = false
|
||||||
end`),
|
end`),
|
||||||
method('BeginDiscardSelection', `if c == nil or self.Hand == nil then
|
method('BeginDiscardSelection', `if c == nil or self.Hand == nil then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local n = 0
|
|
||||||
if c.discardAll == true then
|
if c.discardAll == true then
|
||||||
n = #self.Hand
|
return self:AutoDiscardHand(c)
|
||||||
elseif c.discard ~= nil then
|
end
|
||||||
|
local n = 0
|
||||||
|
if c.discard ~= nil then
|
||||||
n = math.min(c.discard, #self.Hand)
|
n = math.min(c.discard, #self.Hand)
|
||||||
end
|
end
|
||||||
if n <= 0 then
|
if n <= 0 then
|
||||||
@@ -363,6 +435,54 @@ if c.addShivPerDiscard == true then
|
|||||||
end
|
end
|
||||||
self:UpdateDiscardPrompt()
|
self:UpdateDiscardPrompt()
|
||||||
self:Toast("버릴 카드를 선택하세요")
|
self:Toast("버릴 카드를 선택하세요")
|
||||||
|
return true`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'c' }], 0, 'boolean'),
|
||||||
|
method('SelectRetainSlot', `if self:IsRetainSelecting() ~= true then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if self.Hand == nil or self.Hand[slot] == nil then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
self:FinishPlayerTurn(slot)
|
||||||
|
return true`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }], 0, 'boolean'),
|
||||||
|
method('AutoDiscardHand', `if c == nil or self.Hand == nil or #self.Hand <= 0 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local cardIds = {}
|
||||||
|
local startXs = {}
|
||||||
|
local slots = {}
|
||||||
|
local n = #self.Hand
|
||||||
|
for i = 1, n do
|
||||||
|
local cardId = self.Hand[i]
|
||||||
|
table.insert(cardIds, cardId)
|
||||||
|
table.insert(startXs, self:GetHandSlotX(i))
|
||||||
|
table.insert(slots, i)
|
||||||
|
table.insert(self.DiscardPile, cardId)
|
||||||
|
end
|
||||||
|
self.Hand = {}
|
||||||
|
local shivCount = 0
|
||||||
|
if c.addShiv ~= nil then shivCount = shivCount + c.addShiv end
|
||||||
|
if c.addShivPerDiscard == true then shivCount = shivCount + n end
|
||||||
|
self.DiscardSelectRemaining = 0
|
||||||
|
self.DiscardSelectTotal = 0
|
||||||
|
self.DiscardPostShiv = 0
|
||||||
|
self.DiscardShivPerPick = 0
|
||||||
|
self:UpdateDiscardPrompt()
|
||||||
|
self:AnimateDiscardCards(cardIds, startXs, slots)
|
||||||
|
for i = 1, #cardIds do
|
||||||
|
self:TriggerSly(cardIds[i])
|
||||||
|
end
|
||||||
|
self:RenderPiles()
|
||||||
|
self:RenderCombat()
|
||||||
|
_TimerService:SetTimerOnce(function()
|
||||||
|
if shivCount > 0 then
|
||||||
|
self:AddCardsToHand("Shiv", shivCount)
|
||||||
|
else
|
||||||
|
self:RenderHand(false)
|
||||||
|
self:RenderPiles()
|
||||||
|
end
|
||||||
|
self:RenderCombat()
|
||||||
|
self:CheckCombatEnd()
|
||||||
|
end, 0.22)
|
||||||
return true`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'c' }], 0, 'boolean'),
|
return true`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'c' }], 0, 'boolean'),
|
||||||
method('FinishDiscardSelection', `self.DiscardSelectRemaining = 0
|
method('FinishDiscardSelection', `self.DiscardSelectRemaining = 0
|
||||||
self.DiscardSelectTotal = 0
|
self.DiscardSelectTotal = 0
|
||||||
@@ -370,13 +490,21 @@ local shivCount = self.DiscardPostShiv or 0
|
|||||||
self.DiscardPostShiv = 0
|
self.DiscardPostShiv = 0
|
||||||
self.DiscardShivPerPick = 0
|
self.DiscardShivPerPick = 0
|
||||||
self:UpdateDiscardPrompt()
|
self:UpdateDiscardPrompt()
|
||||||
if shivCount > 0 then
|
local finish = function()
|
||||||
self:AddCardsToHand("Shiv", shivCount)
|
if shivCount > 0 then
|
||||||
|
self:AddCardsToHand("Shiv", shivCount)
|
||||||
|
else
|
||||||
|
self:RenderHand(false)
|
||||||
|
self:RenderPiles()
|
||||||
|
end
|
||||||
|
self:RenderCombat()
|
||||||
|
self:CheckCombatEnd()
|
||||||
end
|
end
|
||||||
self:RenderHand(false)
|
if delayRender == true then
|
||||||
self:RenderPiles()
|
_TimerService:SetTimerOnce(finish, 0.22)
|
||||||
self:RenderCombat()
|
else
|
||||||
self:CheckCombatEnd()`),
|
finish()
|
||||||
|
end`, [{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'delayRender' }]),
|
||||||
method('SelectDiscardSlot', `if self:IsDiscardSelecting() ~= true then
|
method('SelectDiscardSlot', `if self:IsDiscardSelecting() ~= true then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -384,18 +512,18 @@ if self.Hand == nil or self.Hand[slot] == nil then
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
local discarded = self.Hand[slot]
|
local discarded = self.Hand[slot]
|
||||||
self:DiscardHandCard(slot, true)
|
self:DiscardHandCard(slot, true, true)
|
||||||
if discarded ~= nil and self.DiscardShivPerPick ~= nil and self.DiscardShivPerPick > 0 then
|
if discarded ~= nil and self.DiscardShivPerPick ~= nil and self.DiscardShivPerPick > 0 then
|
||||||
self.DiscardPostShiv = (self.DiscardPostShiv or 0) + self.DiscardShivPerPick
|
self.DiscardPostShiv = (self.DiscardPostShiv or 0) + self.DiscardShivPerPick
|
||||||
end
|
end
|
||||||
self.DiscardSelectRemaining = self.DiscardSelectRemaining - 1
|
self.DiscardSelectRemaining = self.DiscardSelectRemaining - 1
|
||||||
if self.DiscardSelectRemaining <= 0 or #self.Hand <= 0 then
|
if self.DiscardSelectRemaining <= 0 or #self.Hand <= 0 then
|
||||||
self:FinishDiscardSelection()
|
self:FinishDiscardSelection(true)
|
||||||
else
|
else
|
||||||
self:UpdateDiscardPrompt()
|
self:UpdateDiscardPrompt()
|
||||||
self:RenderHand(false)
|
|
||||||
self:RenderPiles()
|
self:RenderPiles()
|
||||||
self:RenderCombat()
|
self:RenderCombat()
|
||||||
|
_TimerService:SetTimerOnce(function() self:RenderHand(false) end, 0.22)
|
||||||
end
|
end
|
||||||
return true`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }], 0, 'boolean'),
|
return true`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }], 0, 'boolean'),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ self.DiscardSelectRemaining = 0
|
|||||||
self.DiscardSelectTotal = 0
|
self.DiscardSelectTotal = 0
|
||||||
self.DiscardPostShiv = 0
|
self.DiscardPostShiv = 0
|
||||||
self.DiscardShivPerPick = 0
|
self.DiscardShivPerPick = 0
|
||||||
|
self.RetainSelectActive = false
|
||||||
self.CombatOver = false
|
self.CombatOver = false
|
||||||
self.DiscardPile = {}
|
self.DiscardPile = {}
|
||||||
self.ExhaustPile = {}
|
self.ExhaustPile = {}
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ function writeCodeblocks() {
|
|||||||
prop('number', 'DiscardSelectTotal', '0'),
|
prop('number', 'DiscardSelectTotal', '0'),
|
||||||
prop('number', 'DiscardPostShiv', '0'),
|
prop('number', 'DiscardPostShiv', '0'),
|
||||||
prop('number', 'DiscardShivPerPick', '0'),
|
prop('number', 'DiscardShivPerPick', '0'),
|
||||||
|
prop('boolean', 'RetainSelectActive', 'false'),
|
||||||
], [
|
], [
|
||||||
...bootMethods,
|
...bootMethods,
|
||||||
...stateMethods,
|
...stateMethods,
|
||||||
|
|||||||
Reference in New Issue
Block a user