밴딧 카드 공용 효과 확장
This commit is contained in:
@@ -44,15 +44,29 @@ end
|
||||
if self:CanPlayCardNow(c) ~= true then
|
||||
return
|
||||
end
|
||||
if self.Energy < c.cost then
|
||||
local cost = c.cost or 0
|
||||
local skillFree = false
|
||||
if c.kind == "Skill" and self.NextSkillCostZero == true then
|
||||
cost = 0
|
||||
skillFree = true
|
||||
end
|
||||
if c.kind == "Skill" and self.SkillCostReductionThisTurn ~= nil and self.SkillCostReductionThisTurn > 0 then
|
||||
cost = math.max(0, cost - self.SkillCostReductionThisTurn)
|
||||
end
|
||||
if self.Energy < cost then
|
||||
self:Toast("에너지가 부족합니다")
|
||||
return
|
||||
end
|
||||
self.Energy = self.Energy - c.cost
|
||||
self.Energy = self.Energy - cost
|
||||
self:ResolveCardEffects(cardId, slot, c, false)
|
||||
if c.kind == "Attack" then
|
||||
self.TurnAttackCardsPlayed = (self.TurnAttackCardsPlayed or 0) + 1
|
||||
end
|
||||
if skillFree == true then
|
||||
if c.nextSkillCostZero ~= true then
|
||||
self.NextSkillCostZero = false
|
||||
end
|
||||
end
|
||||
if self:HasPowerField("cardPlayedBlock") == true then
|
||||
self:AddCardBlock(self:AddPowerFieldTotal("cardPlayedBlock"))
|
||||
end
|
||||
|
||||
@@ -230,8 +230,10 @@ self.TurnAttackCardsPlayed = 0
|
||||
self.TurnDiscardedCards = 0
|
||||
self.NextTurnSelectCopies = 0
|
||||
self.NextTurnSelectPrompt = ""
|
||||
self.SkillCostReductionThisTurn = 0
|
||||
self:UpdateDiscardPrompt()
|
||||
self.Energy = self.MaxEnergy
|
||||
self.BlockGainMultiplier = 1
|
||||
self:ApplyRelics("turnStart")
|
||||
if self.NextTurnKeepBlock == true then
|
||||
self.NextTurnKeepBlock = false
|
||||
|
||||
@@ -269,6 +269,9 @@ end, 1 / 60)`, [
|
||||
if amount > 0 and self.PlayerDex ~= nil then
|
||||
amount = amount + self.PlayerDex
|
||||
end
|
||||
if self.BlockGainMultiplier ~= nil and self.BlockGainMultiplier > 1 then
|
||||
amount = amount * self.BlockGainMultiplier
|
||||
end
|
||||
if amount < 0 then
|
||||
amount = 0
|
||||
end
|
||||
@@ -367,9 +370,18 @@ 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
|
||||
method('ResolveCardEffects', `if c == nil then
|
||||
return
|
||||
end
|
||||
if c.blockGainMultiplier ~= nil and c.blockGainMultiplier > 0 then
|
||||
self.BlockGainMultiplier = (self.BlockGainMultiplier or 1) * c.blockGainMultiplier
|
||||
end
|
||||
if c.nextSkillCostZero == true then
|
||||
self.NextSkillCostZero = true
|
||||
end
|
||||
if c.skillCostReductionThisTurn ~= nil and c.skillCostReductionThisTurn > 0 then
|
||||
self.SkillCostReductionThisTurn = (self.SkillCostReductionThisTurn or 0) + c.skillCostReductionThisTurn
|
||||
end
|
||||
if c.kind == "Attack" then
|
||||
if c.damage ~= nil then
|
||||
self:PlayerAttackMotion()
|
||||
|
||||
@@ -67,6 +67,9 @@ self:SetText("/ui/RunUIGroup/CombatHud/PlayerPanel/Name", self:JobLabel())
|
||||
self.MaxEnergy = 3
|
||||
self.Turn = 0
|
||||
self.PlayerBlock = 0
|
||||
self.BlockGainMultiplier = 1
|
||||
self.NextSkillCostZero = false
|
||||
self.SkillCostReductionThisTurn = 0
|
||||
self.PlayerStr = 0
|
||||
self.PlayerDex = 0
|
||||
self.PlayerThorns = 0
|
||||
|
||||
@@ -81,6 +81,7 @@ function writeCodeblocks() {
|
||||
prop('number', 'PlayerHp', '0'),
|
||||
prop('number', 'PlayerMaxHp', '80'),
|
||||
prop('number', 'PlayerBlock', '0'),
|
||||
prop('number', 'BlockGainMultiplier', '1'),
|
||||
prop('number', 'PlayerDex', '0'),
|
||||
prop('number', 'PlayerThorns', '0'),
|
||||
prop('boolean', 'CombatOver', 'false'),
|
||||
@@ -141,6 +142,8 @@ function writeCodeblocks() {
|
||||
prop('number', 'TurnAttackMultiplier', '1'),
|
||||
prop('string', 'NextTurnSelectPrompt', '""'),
|
||||
prop('number', 'NextTurnSelectCopies', '0'),
|
||||
prop('boolean', 'NextSkillCostZero', 'false'),
|
||||
prop('number', 'SkillCostReductionThisTurn', '0'),
|
||||
prop('any', 'NextTurnAddCards'),
|
||||
], [
|
||||
...bootMethods,
|
||||
|
||||
@@ -165,6 +165,7 @@ function luaCardsTable(cards) {
|
||||
if (c.otherHandAtLeast != null) fields.push(`otherHandAtLeast = ${c.otherHandAtLeast}`);
|
||||
if (c.bonusHitsWhenOtherHandAtLeast != null) fields.push(`bonusHitsWhenOtherHandAtLeast = ${c.bonusHitsWhenOtherHandAtLeast}`);
|
||||
if (c.block != null) fields.push(`block = ${c.block}`);
|
||||
if (c.blockGainMultiplier != null) fields.push(`blockGainMultiplier = ${c.blockGainMultiplier}`);
|
||||
if (c.strength != null) fields.push(`strength = ${c.strength}`);
|
||||
if (c.dex != null) fields.push(`dex = ${c.dex}`);
|
||||
if (c.thorns != null) fields.push(`thorns = ${c.thorns}`);
|
||||
@@ -199,6 +200,8 @@ function luaCardsTable(cards) {
|
||||
if (c.nextTurnCopies != null) fields.push(`nextTurnCopies = ${c.nextTurnCopies}`);
|
||||
if (c.nextTurnSelectHandCard === true) fields.push('nextTurnSelectHandCard = true');
|
||||
if (c.nextTurnSelectPrompt != null) fields.push(`nextTurnSelectPrompt = ${luaStr(c.nextTurnSelectPrompt)}`);
|
||||
if (c.nextSkillCostZero === true) fields.push('nextSkillCostZero = true');
|
||||
if (c.skillCostReductionThisTurn != null) fields.push(`skillCostReductionThisTurn = ${c.skillCostReductionThisTurn}`);
|
||||
if (c.innate === true) fields.push('innate = true');
|
||||
if (c.playableWhenDrawPileEmpty === true) fields.push('playableWhenDrawPileEmpty = true');
|
||||
if (c.sly === true) fields.push('sly = true');
|
||||
|
||||
Reference in New Issue
Block a user