밴딧 공용 효과와 문서 정리
This commit is contained in:
@@ -274,6 +274,44 @@ if amount < 0 then
|
||||
end
|
||||
self.PlayerBlock = self.PlayerBlock + amount
|
||||
return amount`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'base' }], 0, 'number'),
|
||||
method('CountOtherHandSkills', `if self.Hand == nil then
|
||||
return 0
|
||||
end
|
||||
local n = 0
|
||||
for i = 1, #self.Hand do
|
||||
if i ~= slot then
|
||||
local hc = self.Cards[self.Hand[i]]
|
||||
if hc ~= nil and hc.kind == "Skill" then
|
||||
n = n + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
return n`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }], 0, 'number'),
|
||||
method('AttackBaseForCard', `local base2 = c.damage or 0
|
||||
local otherHand = 0
|
||||
if self.Hand ~= nil then
|
||||
otherHand = #self.Hand - 1
|
||||
if otherHand < 0 then otherHand = 0 end
|
||||
end
|
||||
if c.damagePerOtherHandCard ~= nil then
|
||||
base2 = base2 + otherHand * c.damagePerOtherHandCard
|
||||
end
|
||||
if c.damagePerAttackPlayedThisTurn ~= nil then
|
||||
base2 = base2 + (self.TurnAttackCardsPlayed or 0) * c.damagePerAttackPlayedThisTurn
|
||||
end
|
||||
if c.damagePerDiscardedThisTurn ~= nil then
|
||||
base2 = base2 + (self.TurnDiscardedCards or 0) * c.damagePerDiscardedThisTurn
|
||||
end
|
||||
if c.damagePerSkillInHand ~= nil then
|
||||
base2 = base2 + self:CountOtherHandSkills(slot) * c.damagePerSkillInHand
|
||||
end
|
||||
if base2 < 0 then
|
||||
base2 = 0
|
||||
end
|
||||
return base2`, [
|
||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' },
|
||||
{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'c' },
|
||||
], 0, 'number'),
|
||||
method('CalcPlayerAttack', `local base2 = base
|
||||
self.FightAttackCount = self.FightAttackCount + 1
|
||||
if self.FightAttackCount == 1 and self:HasRelic("akabeko") then
|
||||
@@ -286,6 +324,9 @@ end
|
||||
if self.PlayerWeak > 0 then
|
||||
dmg = math.floor(dmg * 0.75)
|
||||
end
|
||||
if self.TurnAttackMultiplier ~= nil and self.TurnAttackMultiplier > 1 then
|
||||
dmg = dmg * self.TurnAttackMultiplier
|
||||
end
|
||||
if dmg > 0 and dmg < 5 and self:HasRelic("boot") then
|
||||
dmg = 5
|
||||
end
|
||||
@@ -293,16 +334,60 @@ if dmg < 0 then
|
||||
dmg = 0
|
||||
end
|
||||
return dmg`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'base' }], 0, 'number'),
|
||||
method('QueueNextTurnAddCard', `if cardId == nil or cardId == "" or amount == nil or amount <= 0 then
|
||||
return
|
||||
end
|
||||
if self.NextTurnAddCards == nil then
|
||||
self.NextTurnAddCards = {}
|
||||
end
|
||||
for i = 1, #self.NextTurnAddCards do
|
||||
local entry = self.NextTurnAddCards[i]
|
||||
if entry ~= nil and entry.cardId == cardId then
|
||||
entry.amount = (entry.amount or 0) + amount
|
||||
return
|
||||
end
|
||||
end
|
||||
table.insert(self.NextTurnAddCards, { cardId = cardId, amount = amount })`, [
|
||||
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'cardId' },
|
||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'amount' },
|
||||
]),
|
||||
method('QueueNextTurnEffects', `if c == nil then
|
||||
return
|
||||
end
|
||||
if c.nextTurnBlock ~= nil then
|
||||
self.NextTurnBlock = (self.NextTurnBlock or 0) + c.nextTurnBlock
|
||||
end
|
||||
if c.nextTurnDraw ~= nil then
|
||||
self.NextTurnDraw = (self.NextTurnDraw or 0) + c.nextTurnDraw
|
||||
end
|
||||
if c.nextTurnKeepBlock == true then
|
||||
self.NextTurnKeepBlock = true
|
||||
end
|
||||
if c.nextTurnAttackMultiplier ~= nil and c.nextTurnAttackMultiplier > 0 then
|
||||
local cur = self.NextTurnAttackMultiplier or 1
|
||||
self.NextTurnAttackMultiplier = cur * c.nextTurnAttackMultiplier
|
||||
end`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'c' }]),
|
||||
method('ResolveCardEffects', `if c == nil then
|
||||
return
|
||||
end
|
||||
if c.kind == "Attack" then
|
||||
if c.damage ~= nil then
|
||||
self:PlayerAttackMotion()
|
||||
local baseDmg = self:AttackBaseForCard(slot, c)
|
||||
local total = 0
|
||||
local hitN = c.hits or 1
|
||||
if c.otherHandAtLeast ~= nil and c.bonusHitsWhenOtherHandAtLeast ~= nil then
|
||||
local otherHand = 0
|
||||
if self.Hand ~= nil then
|
||||
otherHand = #self.Hand - 1
|
||||
if otherHand < 0 then otherHand = 0 end
|
||||
end
|
||||
if otherHand >= c.otherHandAtLeast then
|
||||
hitN = hitN + c.bonusHitsWhenOtherHandAtLeast
|
||||
end
|
||||
end
|
||||
for h = 1, hitN do
|
||||
total = total + self:CalcPlayerAttack(c.damage)
|
||||
total = total + self:CalcPlayerAttack(baseDmg)
|
||||
end
|
||||
if c.aoe == true then
|
||||
self:PlayAoeFx(c.fx or c.image, total)
|
||||
@@ -340,6 +425,10 @@ end
|
||||
if c.heal ~= nil then
|
||||
self.PlayerHp = math.min(self.PlayerHp + c.heal, self.PlayerMaxHp)
|
||||
end
|
||||
if c.gainEnergy ~= nil and c.gainEnergy ~= 0 then
|
||||
self.Energy = self.Energy + c.gainEnergy
|
||||
end
|
||||
self:QueueNextTurnEffects(c)
|
||||
if c.weak ~= nil or c.vuln ~= nil or c.poison ~= nil then
|
||||
local tm = self.Monsters[self.TargetIndex]
|
||||
if tm == nil or tm.alive ~= true then
|
||||
@@ -361,10 +450,24 @@ end
|
||||
if c.draw ~= nil then
|
||||
self:DrawCards(c.draw, true)
|
||||
end
|
||||
if c.drawUntilHandSize ~= nil and c.drawUntilHandSize > 0 then
|
||||
local currentHand = 0
|
||||
if self.Hand ~= nil then
|
||||
currentHand = #self.Hand
|
||||
if slot ~= nil and slot > 0 and self.Hand[slot] == cardId then
|
||||
currentHand = currentHand - 1
|
||||
end
|
||||
end
|
||||
local need = c.drawUntilHandSize - currentHand
|
||||
if need > 0 then
|
||||
self:DrawCards(need, true)
|
||||
end
|
||||
end
|
||||
if c.addShiv ~= nil and c.discard == nil and c.discardAll ~= true then
|
||||
self:AddCardsToHand("Shiv", c.addShiv)
|
||||
end`, [
|
||||
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'cardId' },
|
||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' },
|
||||
{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'c' },
|
||||
{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'free' },
|
||||
]),
|
||||
@@ -373,7 +476,7 @@ if c == nil or c.sly ~= true then
|
||||
return
|
||||
end
|
||||
self:Toast("교활 발동: " .. c.name)
|
||||
self:ResolveCardEffects(cardId, c, true)`, [{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'cardId' }]),
|
||||
self:ResolveCardEffects(cardId, 0, c, true)`, [{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'cardId' }]),
|
||||
method('DiscardHandCard', `if self.Hand == nil then
|
||||
return
|
||||
end
|
||||
@@ -384,6 +487,7 @@ end
|
||||
local startX = self:GetHandSlotX(slot)
|
||||
table.remove(self.Hand, slot)
|
||||
table.insert(self.DiscardPile, cardId)
|
||||
self.TurnDiscardedCards = (self.TurnDiscardedCards or 0) + 1
|
||||
if triggerSly == true then
|
||||
self:TriggerSly(cardId)
|
||||
end
|
||||
@@ -396,6 +500,7 @@ end`, [
|
||||
]),
|
||||
method('IsDiscardSelecting', `return self.DiscardSelectRemaining ~= nil and self.DiscardSelectRemaining > 0`, [], 0, 'boolean'),
|
||||
method('IsRetainSelecting', `return self.RetainSelectActive == true`, [], 0, 'boolean'),
|
||||
method('IsReserveSelecting', `return self.ReserveSelectActive == true`, [], 0, 'boolean'),
|
||||
method('UpdateDiscardPrompt', `local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/DiscardPrompt")
|
||||
if e == nil then
|
||||
return
|
||||
@@ -407,6 +512,13 @@ if self:IsDiscardSelecting() == true then
|
||||
elseif self:IsRetainSelecting() == true then
|
||||
self:SetText("/ui/RunUIGroup/CombatHud/DiscardPrompt", "보존할 카드 선택 (턴 종료: 건너뛰기)")
|
||||
e.Enable = true
|
||||
elseif self:IsReserveSelecting() == true then
|
||||
local msg = self.NextTurnSelectPrompt or ""
|
||||
if msg == "" then
|
||||
msg = "다음 턴에 예약할 카드를 선택하세요"
|
||||
end
|
||||
self:SetText("/ui/RunUIGroup/CombatHud/DiscardPrompt", msg)
|
||||
e.Enable = true
|
||||
else
|
||||
e.Enable = false
|
||||
end`),
|
||||
@@ -427,15 +539,56 @@ self.DiscardSelectRemaining = n
|
||||
self.DiscardSelectTotal = n
|
||||
self.DiscardPostShiv = 0
|
||||
self.DiscardShivPerPick = 0
|
||||
self.DiscardPostDraw = 0
|
||||
self.DiscardDrawPerPick = 0
|
||||
if c.addShiv ~= nil then
|
||||
self.DiscardPostShiv = c.addShiv
|
||||
end
|
||||
if c.addShivPerDiscard == true then
|
||||
self.DiscardShivPerPick = 1
|
||||
end
|
||||
if c.drawPerDiscarded ~= nil and c.drawPerDiscarded > 0 then
|
||||
self.DiscardDrawPerPick = c.drawPerDiscarded
|
||||
end
|
||||
self:UpdateDiscardPrompt()
|
||||
self:Toast("버릴 카드를 선택하세요")
|
||||
return true`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'c' }], 0, 'boolean'),
|
||||
method('BeginReserveSelection', `if c == nil or c.nextTurnSelectHandCard ~= true or c.nextTurnCopies == nil or c.nextTurnCopies <= 0 then
|
||||
return false
|
||||
end
|
||||
if self.Hand == nil or #self.Hand <= 0 then
|
||||
return false
|
||||
end
|
||||
self.ReserveSelectActive = true
|
||||
self.NextTurnSelectCopies = c.nextTurnCopies
|
||||
self.NextTurnSelectPrompt = c.nextTurnSelectPrompt or ""
|
||||
self:UpdateDiscardPrompt()
|
||||
self:Toast("예약할 카드를 선택하세요")
|
||||
self:RenderHand(false)
|
||||
return true`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'c' }], 0, 'boolean'),
|
||||
method('SelectReserveSlot', `if self:IsReserveSelecting() ~= true then
|
||||
return false
|
||||
end
|
||||
if self.Hand == nil or self.Hand[slot] == nil then
|
||||
return true
|
||||
end
|
||||
local cardId = self.Hand[slot]
|
||||
local amount = self.NextTurnSelectCopies or 0
|
||||
self.ReserveSelectActive = false
|
||||
self.NextTurnSelectCopies = 0
|
||||
self.NextTurnSelectPrompt = ""
|
||||
self:UpdateDiscardPrompt()
|
||||
if amount > 0 and cardId ~= nil then
|
||||
self:QueueNextTurnAddCard(cardId, amount)
|
||||
local label = cardId
|
||||
if self.Cards[cardId] ~= nil and self.Cards[cardId].name ~= nil then
|
||||
label = self.Cards[cardId].name
|
||||
end
|
||||
self:Toast("다음 턴 예약: " .. label .. " " .. self:FormatNumber(amount) .. "장")
|
||||
end
|
||||
self:RenderPiles()
|
||||
self:RenderCombat()
|
||||
return true`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }], 0, 'boolean'),
|
||||
method('SelectRetainSlot', `if self:IsRetainSelecting() ~= true then
|
||||
return false
|
||||
end
|
||||
@@ -457,6 +610,7 @@ for i = 1, n do
|
||||
table.insert(startXs, self:GetHandSlotX(i))
|
||||
table.insert(slots, i)
|
||||
table.insert(self.DiscardPile, cardId)
|
||||
self.TurnDiscardedCards = (self.TurnDiscardedCards or 0) + 1
|
||||
end
|
||||
self.Hand = {}
|
||||
local shivCount = 0
|
||||
@@ -466,6 +620,8 @@ self.DiscardSelectRemaining = 0
|
||||
self.DiscardSelectTotal = 0
|
||||
self.DiscardPostShiv = 0
|
||||
self.DiscardShivPerPick = 0
|
||||
self.DiscardPostDraw = 0
|
||||
self.DiscardDrawPerPick = 0
|
||||
self:UpdateDiscardPrompt()
|
||||
self:AnimateDiscardCards(cardIds, startXs, slots)
|
||||
for i = 1, #cardIds do
|
||||
@@ -480,6 +636,9 @@ _TimerService:SetTimerOnce(function()
|
||||
self:RenderHand(false)
|
||||
self:RenderPiles()
|
||||
end
|
||||
if c.drawPerDiscarded ~= nil and c.drawPerDiscarded > 0 then
|
||||
self:DrawCards(n * c.drawPerDiscarded, true)
|
||||
end
|
||||
self:RenderCombat()
|
||||
self:CheckCombatEnd()
|
||||
end, 0.22)
|
||||
@@ -487,8 +646,11 @@ return true`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes:
|
||||
method('FinishDiscardSelection', `self.DiscardSelectRemaining = 0
|
||||
self.DiscardSelectTotal = 0
|
||||
local shivCount = self.DiscardPostShiv or 0
|
||||
local drawCount = self.DiscardPostDraw or 0
|
||||
self.DiscardPostShiv = 0
|
||||
self.DiscardPostDraw = 0
|
||||
self.DiscardShivPerPick = 0
|
||||
self.DiscardDrawPerPick = 0
|
||||
self:UpdateDiscardPrompt()
|
||||
local finish = function()
|
||||
if shivCount > 0 then
|
||||
@@ -497,6 +659,9 @@ local finish = function()
|
||||
self:RenderHand(false)
|
||||
self:RenderPiles()
|
||||
end
|
||||
if drawCount > 0 then
|
||||
self:DrawCards(drawCount, true)
|
||||
end
|
||||
self:RenderCombat()
|
||||
self:CheckCombatEnd()
|
||||
end
|
||||
@@ -516,6 +681,9 @@ self:DiscardHandCard(slot, true, true)
|
||||
if discarded ~= nil and self.DiscardShivPerPick ~= nil and self.DiscardShivPerPick > 0 then
|
||||
self.DiscardPostShiv = (self.DiscardPostShiv or 0) + self.DiscardShivPerPick
|
||||
end
|
||||
if discarded ~= nil and self.DiscardDrawPerPick ~= nil and self.DiscardDrawPerPick > 0 then
|
||||
self.DiscardPostDraw = (self.DiscardPostDraw or 0) + self.DiscardDrawPerPick
|
||||
end
|
||||
self.DiscardSelectRemaining = self.DiscardSelectRemaining - 1
|
||||
if self.DiscardSelectRemaining <= 0 or #self.Hand <= 0 then
|
||||
self:FinishDiscardSelection(true)
|
||||
|
||||
Reference in New Issue
Block a user