Add shared bandit effect hooks

This commit is contained in:
2026-06-22 16:08:05 +09:00
parent ba450f16b0
commit 24a79a309f
11 changed files with 343 additions and 158 deletions

View File

@@ -271,6 +271,9 @@ local dmg = amount
if m.vuln > 0 then
dmg = math.floor(dmg * 1.5)
end
if m.weak > 0 and self.ActiveAttackDamageVsWeakMultiplier ~= nil and self.ActiveAttackDamageVsWeakMultiplier > 1 then
dmg = math.floor(dmg * self.ActiveAttackDamageVsWeakMultiplier)
end
if m.block > 0 and pierce ~= true then
local absorbed = math.min(m.block, dmg)
m.block = m.block - absorbed
@@ -345,6 +348,7 @@ return killed`, [
method('PlayAttackFx', `local m = self.Monsters[targetIndex]
if m == nil or m.alive ~= true or m.entity == nil or not isvalid(m.entity) then
self:DealDamageToTarget(damage, pierce)
self.ActiveAttackDamageVsWeakMultiplier = 1
self:RenderCombat()
self:CheckCombatEnd()
return
@@ -370,11 +374,15 @@ _TimerService:SetTimerOnce(function()
if mt ~= nil and mt.alive == true and mt.vuln > 0 then
shown = math.floor(damage * 1.5)
end
if mt ~= nil and mt.alive == true and mt.weak > 0 and self.ActiveAttackDamageVsWeakMultiplier ~= nil and self.ActiveAttackDamageVsWeakMultiplier > 1 then
shown = math.floor(shown * self.ActiveAttackDamageVsWeakMultiplier)
end
local killed = self:DealDamageToTarget(damage, pierce)
if killed == true and self.ActiveKillReward ~= nil and self.ActiveKillReward > 0 then
self.BonusRewardScreens = (self.BonusRewardScreens or 0) + self.ActiveKillReward
end
self.ActiveKillReward = 0
self.ActiveAttackDamageVsWeakMultiplier = 1
self:ShowDmgPop(targetIndex, shown)
self:RenderCombat()
self:CheckCombatEnd()
@@ -406,6 +414,9 @@ _TimerService:SetTimerOnce(function()
if m.vuln > 0 then
dmg = math.floor(dmg * 1.5)
end
if m.weak > 0 and self.ActiveAttackDamageVsWeakMultiplier ~= nil and self.ActiveAttackDamageVsWeakMultiplier > 1 then
dmg = math.floor(dmg * self.ActiveAttackDamageVsWeakMultiplier)
end
if m.block > 0 then
local absorbed = math.min(m.block, dmg)
m.block = m.block - absorbed
@@ -431,6 +442,7 @@ _TimerService:SetTimerOnce(function()
self.BonusRewardScreens = (self.BonusRewardScreens or 0) + (killCount * self.ActiveKillReward)
end
self.ActiveKillReward = 0
self.ActiveAttackDamageVsWeakMultiplier = 1
self:RenderCombat()
self:CheckCombatEnd()
end, 0.35)`, [

View File

@@ -247,6 +247,11 @@ end
self.TurnAttackMultiplier = self.NextTurnAttackMultiplier or 1
self.NextTurnAttackMultiplier = 1
self.CardsDrawnThisCombat = self.CardsDrawnThisCombat or 0
self.ShivFirstDamageBonusUsed = false
self.ActiveAttackDamageVsWeakMultiplier = 1
self.DrawDamageThisTurn = 0
self.DrawPoisonThisTurn = 0
self.ShivAoeThisCombat = false
self.HandCostZeroThisTurn = false
self.DrawDisabledThisTurn = false
local powerTurnDraw = 0
@@ -419,7 +424,7 @@ local kept = {}
for i = 1, #self.Hand do
\tlocal cardId = self.Hand[i]
\tlocal c = self.Cards[cardId]
\tif c ~= nil and (c.retain == true or i == retainSlot) then
\tif c ~= nil and (c.retain == true or (c.class == "shiv" and self:HasPowerField("shivRetain") == true) or i == retainSlot) then
\t\ttable.insert(kept, cardId)
\telse
\t\ttable.insert(self.DiscardPile, cardId)

View File

@@ -311,6 +311,14 @@ end
if c.damagePerCardDrawnThisCombat ~= nil then
base2 = base2 + (self.CardsDrawnThisCombat or 0) * c.damagePerCardDrawnThisCombat
end
if c.class == "shiv" then
if self:HasPowerField("shivDamageBonus") == true then
base2 = base2 + self:AddPowerFieldTotal("shivDamageBonus")
end
if self.ShivFirstDamageBonusUsed ~= true and self:HasPowerField("firstShivDamageBonus") == true then
base2 = base2 + self:AddPowerFieldTotal("firstShivDamageBonus")
end
end
if base2 < 0 then
base2 = 0
end
@@ -394,6 +402,15 @@ end
if c.drawDisabledThisTurn == true then
self.DrawDisabledThisTurn = true
end
if c.drawDamage ~= nil and c.drawDamage > 0 and c.kind ~= "Power" then
self.DrawDamageThisTurn = (self.DrawDamageThisTurn or 0) + c.drawDamage
end
if c.drawPoison ~= nil and c.drawPoison > 0 and c.kind ~= "Power" then
self.DrawPoisonThisTurn = (self.DrawPoisonThisTurn or 0) + c.drawPoison
end
if c.shivAoe == true and c.kind ~= "Power" then
self.ShivAoeThisCombat = true
end
local xEnergy = energySpent or 0
local weakAmount = c.weak or 0
local vulnAmount = c.vuln or 0
@@ -405,6 +422,7 @@ if c.kind == "Attack" then
if c.damage ~= nil or c.xDamagePerEnergy ~= nil then
self:PlayerAttackMotion()
local baseDmg = self:AttackBaseForCard(slot, c)
self.ActiveAttackDamageVsWeakMultiplier = c.attackDamageVsWeakMultiplier or 1
if c.xDamagePerEnergy ~= nil and c.xDamagePerEnergy > 0 then
baseDmg = xEnergy * c.xDamagePerEnergy
end
@@ -423,7 +441,14 @@ if c.kind == "Attack" then
for h = 1, hitN do
total = total + self:CalcPlayerAttack(baseDmg)
end
if c.aoe == true then
local useAoe = c.aoe == true
if c.class == "shiv" and (self.ShivAoeThisCombat == true or self:HasPowerField("shivAoe") == true) then
useAoe = true
end
if c.class == "shiv" and self.ShivFirstDamageBonusUsed ~= true and self:HasPowerField("firstShivDamageBonus") == true then
self.ShivFirstDamageBonusUsed = true
end
if useAoe == true then
self:PlayAoeFx(c.fx or c.image, total)
else
self:PlayAttackFx(self.TargetIndex, c.fx or c.image, total, c.pierce == true)
@@ -475,7 +500,27 @@ if c.weak ~= nil or c.vuln ~= nil or c.poison ~= nil or c.xWeakPerEnergy ~= nil
end
if tm ~= nil and tm.alive == true then
if weakAmount ~= nil and weakAmount > 0 then tm.weak = tm.weak + weakAmount end
if poisonAmount ~= nil and poisonAmount > 0 then tm.poison = (tm.poison or 0) + poisonAmount end
if poisonAmount ~= nil and poisonAmount > 0 then
local poisonHits = c.poisonHits or 1
for pi = 1, poisonHits do
local target = tm
if c.poisonRandomTargets == true and self.Monsters ~= nil then
local alive = {}
for mi = 1, #self.Monsters do
local om = self.Monsters[mi]
if om ~= nil and om.alive == true then
table.insert(alive, om)
end
end
if #alive > 0 then
target = alive[math.random(#alive)]
end
end
if target ~= nil and target.alive == true then
target.poison = (target.poison or 0) + poisonAmount
end
end
end
if vulnAmount ~= nil and vulnAmount > 0 then
tm.vuln = tm.vuln + vulnAmount
if self:HasRelic("championBelt") then
@@ -512,6 +557,38 @@ if c.drawSkillBlock ~= nil and c.drawSkillBlock > 0 then
end
end
end
local drawDamage = self:AddPowerFieldTotal("drawDamage") + (self.DrawDamageThisTurn or 0)
local drawPoison = self:AddPowerFieldTotal("drawPoison") + (self.DrawPoisonThisTurn or 0)
if (drawDamage ~= nil and drawDamage > 0) or (drawPoison ~= nil and drawPoison > 0) then
for mi = 1, #self.Monsters do
local m2 = self.Monsters[mi]
if m2 ~= nil and m2.alive == true then
local dmg = drawDamage or 0
if m2.vuln > 0 then
dmg = math.floor(dmg * 1.5)
end
if m2.block > 0 then
local absorbed = math.min(m2.block, dmg)
m2.block = m2.block - absorbed
dmg = dmg - absorbed
end
if drawPoison ~= nil and drawPoison > 0 then
m2.poison = (m2.poison or 0) + drawPoison
end
if dmg > 0 then
m2.hp = m2.hp - dmg
end
self:ShowDmgPop(mi, dmg)
self:MonsterHitMotion(mi)
if m2.hp <= 0 then
m2.hp = 0
self:KillMonster(m2.slot)
end
end
end
self:RenderCombat()
self:CheckCombatEnd()
end
if c.addShiv ~= nil and c.discard == nil and c.discardAll ~= true then
self:AddCardsToHand("Shiv", c.addShiv)
end`, [

View File

@@ -74,6 +74,11 @@ self.DrawDisabledThisTurn = false
self.NextSkillCostZero = false
self.NextSkillRepeatCount = 0
self.SkillCostReductionThisTurn = 0
self.ShivFirstDamageBonusUsed = false
self.ActiveAttackDamageVsWeakMultiplier = 1
self.DrawDamageThisTurn = 0
self.DrawPoisonThisTurn = 0
self.ShivAoeThisCombat = false
self.PlayerStr = 0
self.PlayerDex = 0
self.PlayerThorns = 0