카드 설명 키워드 하이라이트 추가
This commit is contained in:
@@ -415,7 +415,8 @@ if self.PlayerVuln > 0 then self.PlayerVuln = self.PlayerVuln - 1 end
|
||||
self:RenderHand(false)
|
||||
self:RenderPiles()
|
||||
self:EnemyTurn()`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'retainSlot' }]),
|
||||
method('DrawCards', `local drawnSlots = {}
|
||||
method('DrawCards', `local drawnSlots = {}
|
||||
local drawnCards = {}
|
||||
local drewAny = false
|
||||
for i = 1, amount do
|
||||
\tif #self.DrawPile <= 0 then
|
||||
@@ -425,6 +426,7 @@ for i = 1, amount do
|
||||
\t\tbreak
|
||||
\tend
|
||||
\tlocal cardId = table.remove(self.DrawPile)
|
||||
\ttable.insert(drawnCards, cardId)
|
||||
\tif #self.Hand >= 10 then
|
||||
\t\ttable.insert(self.DiscardPile, cardId)
|
||||
\t\tself:TriggerSly(cardId)
|
||||
@@ -444,10 +446,11 @@ if animate == true and #drawnSlots > 0 then
|
||||
\t\tlocal slot = drawnSlots[i]
|
||||
\t\tself:AnimateCardFrom(slot, drawStart, Vector2(self:GetHandSlotX(slot), 0), 0.08 + i * 0.045)
|
||||
\tend
|
||||
return drawnCards
|
||||
end`, [
|
||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'amount' },
|
||||
{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'animate' },
|
||||
]),
|
||||
], 0, 'any'),
|
||||
method('AddCardsToHand', `if self.Hand == nil then
|
||||
self.Hand = {}
|
||||
end
|
||||
|
||||
@@ -60,7 +60,7 @@ if e ~= nil and e.SpriteGUIRendererComponent ~= nil then
|
||||
end
|
||||
self:SetText(base .. "/Cost", string.format("%d", c.cost))
|
||||
self:SetText(base .. "/Name", c.name)
|
||||
self:SetText(base .. "/Desc", c.desc)
|
||||
self:SetText(base .. "/Desc", self:FormatCardDescription(c.desc))
|
||||
local art = _EntityService:GetEntityByPath(base .. "/Art")
|
||||
if art ~= nil then
|
||||
if c.image ~= nil and c.image ~= "" then
|
||||
@@ -459,8 +459,9 @@ if c.weak ~= nil or c.vuln ~= nil or c.poison ~= nil then
|
||||
end
|
||||
end
|
||||
end
|
||||
local drawnCards = {}
|
||||
if c.draw ~= nil then
|
||||
self:DrawCards(c.draw, true)
|
||||
drawnCards = self:DrawCards(c.draw, true) or {}
|
||||
end
|
||||
if c.drawUntilHandSize ~= nil and c.drawUntilHandSize > 0 then
|
||||
local currentHand = 0
|
||||
@@ -472,7 +473,18 @@ if c.drawUntilHandSize ~= nil and c.drawUntilHandSize > 0 then
|
||||
end
|
||||
local need = c.drawUntilHandSize - currentHand
|
||||
if need > 0 then
|
||||
self:DrawCards(need, true)
|
||||
local moreDrawnCards = self:DrawCards(need, true) or {}
|
||||
for i = 1, #moreDrawnCards do
|
||||
table.insert(drawnCards, moreDrawnCards[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
if c.drawSkillBlock ~= nil and c.drawSkillBlock > 0 then
|
||||
for i = 1, #drawnCards do
|
||||
local drawnCard = self.Cards[drawnCards[i]]
|
||||
if drawnCard ~= nil and drawnCard.kind == "Skill" then
|
||||
self:AddCardBlock(c.drawSkillBlock)
|
||||
end
|
||||
end
|
||||
end
|
||||
if c.addShiv ~= nil and c.discard == nil and c.discardAll ~= true then
|
||||
|
||||
@@ -3,6 +3,47 @@ import { CARDS, ENEMIES, CLASSES, JOBS, SOUL_UNLOCKS, CARDFRAMES, RARITIES, MAP_
|
||||
import { UI_FILE, COMMON_FILE, UI_ROOT, GENERATED_UI_SECTIONS, UI_APPEND_ORDER, DISABLED_STOCK_CONTROLS, TRANSPARENT, DARK, GOLD, ATTACK, DEFEND, SKILL, DAMAGE_DIGIT_RUIDS, DAMAGE_POP_MAX_DIGITS, DAMAGE_POP_DIGIT_W, DAMAGE_POP_DIGIT_H, DAMAGE_POP_DIGIT_SPACING, MAX_MONSTERS, HEAD_OFFSET_Y, HP_BAR_W, WHITE, CARD_NAME_TEXT, CARD_DESC_TEXT, cardFaceLayout, CARD_W, CARD_H, CARD_SPACING, CARD_XS, ALIGN_CENTER, ALIGN_BOTTOM_CENTER, guid, transform, sprite, button, text, scrollLayoutGroup, popupLayerFor, uiOrderFor, displayOrderFor, applySortingOverride, entity, uiPath, sectionRoot, isGeneratedUiEntity, appendUiSection } from '../lib/ui-helpers.mjs';
|
||||
|
||||
export const tooltipMethods = [
|
||||
method('FormatCardDescription', `if desc == nil or desc == "" then
|
||||
return ""
|
||||
end
|
||||
local function replacePlain(text, needle, replacement)
|
||||
local out = ""
|
||||
local pos = 1
|
||||
while true do
|
||||
local s, e = string.find(text, needle, pos, true)
|
||||
if s == nil then
|
||||
out = out .. string.sub(text, pos)
|
||||
break
|
||||
end
|
||||
out = out .. string.sub(text, pos, s - 1) .. replacement
|
||||
pos = e + 1
|
||||
end
|
||||
return out
|
||||
end
|
||||
local terms = {
|
||||
"교활",
|
||||
"보존",
|
||||
"민첩",
|
||||
"가시",
|
||||
"소멸",
|
||||
"선천성",
|
||||
"취약",
|
||||
"약화",
|
||||
"독",
|
||||
"광역",
|
||||
"관통",
|
||||
"방어도",
|
||||
"힘",
|
||||
"스킬",
|
||||
"공격",
|
||||
"파워",
|
||||
}
|
||||
local out = desc
|
||||
for i = 1, #terms do
|
||||
local term = terms[i]
|
||||
out = replacePlain(out, term, "<color=#70D6FF>" .. term .. "</color>")
|
||||
end
|
||||
return out`, [{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'desc' }], 0, 'string'),
|
||||
method('BuildCardKeywordTooltip', `if c == nil then
|
||||
return ""
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user