Fix damage pop UI paths and card hover tooltip support

This commit is contained in:
2026-07-13 01:59:11 +09:00
parent 84381947be
commit 1029459f23
22 changed files with 4569 additions and 878 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,164 @@
# Card UI Standardization
## Goal
Make every card-shaped UI use the same input structure so hover tooltip,
click, drag, and future interactions behave the same way everywhere.
Target surfaces:
- hand cards
- reward cards
- shop cards
- draw pile / discard pile / exhaust pile viewer cards
- all deck / class deck / codex cards
## Standard Card Entity Shape
Each visible card should have one root entity that owns input.
```text
CardRoot
- UITransformComponent
- SpriteGUIRendererComponent
- ButtonComponent
- UITouchReceiveComponent
- Cost
- Name
- Desc
- Art
```
Rules:
1. `CardRoot` covers the full card rect.
2. `CardRoot` owns both click and hover.
3. Child entities are display only.
4. Child entities must not become the primary input target.
## Required Component Rules
### Card root
- `UITransformComponent`
- `SpriteGUIRendererComponent`
- `ButtonComponent`
- `UITouchReceiveComponent`
Recommended sprite settings:
- `RaycastTarget: true`
- card frame sprite on root
### Card children
- `Cost`, `Name`, `Desc`: text only
- `Art`: sprite only
Recommended child sprite settings:
- `RaycastTarget: false`
That keeps hover/click ownership on the root card entity.
## Path Rules
Use the same path naming pattern everywhere:
- hand: `/ui/.../CardHand/Card1`
- reward: `/ui/.../RewardHud/Reward1`
- shop: `/ui/.../ShopHud/Card1`
- inspect: `/ui/.../DeckInspectHud/Grid/Card1`
- all deck: `/ui/.../DeckAllHud/Grid/Card1`
The important part is that each list has a stable root card path ending in a
numeric slot. That lets controller code resolve hover target -> slot -> card id
without special cases.
## Controller Rules
Once UI is standardized, controller logic should follow this shape:
1. Resolve `path`
2. Resolve `slot` from `path`
3. Resolve `cardId` from current backing list
4. Show tooltip from `cardId`
Preferred shared methods:
- `GetHoveredCardId(path)`
- `HoverCardByPath(path)`
- `UnhoverCardByPath(path)`
The hand should just become one caller of the same shared path-based hover
logic rather than having its own special tooltip flow.
## Safe Rollout Order
Do not standardize every card surface at once.
### Step 1
Document current structures for:
- `RewardHud/Reward1`
- `ShopHud/Card1`
- `DeckInspectHud/Grid/Card1`
- `DeckAllHud/Grid/Card1`
### Step 2
Make `DeckInspectHud/Grid/CardN` match `RewardHud/RewardN` component structure.
### Step 3
Verify game boot and UI load before changing controller hover bindings.
### Step 4
Make `DeckAllHud/Grid/CardN` match the same structure.
### Step 5
After both surfaces are stable, bind hover events in controller code.
## Validation Checklist
Before testing hover behavior:
- game boots with no `LEA-3015 CannotLoad`
- `DefaultGroup.ui` loads cleanly
- card roots exist at expected paths
- root card sprite has `RaycastTarget: true`
- child art sprite has `RaycastTarget: false`
- root has both `ButtonComponent` and `UITouchReceiveComponent`
After binding hover:
- hand tooltip still works
- reward tooltip still works
- shop tooltip still works
- inspect tooltip works
- all deck tooltip works
- no duplicated tooltip flicker
- no drag regression on hand cards
## What Not To Do
- do not hand-edit `ui/DefaultGroup.ui`
- do not change multiple card surfaces in one shot
- do not mix root-input cards with child-input cards
- do not add hover logic before confirming the target card entity actually
receives input
## Recommended Next Change
The next implementation step should be:
1. diff `DeckInspectHud/Grid/Card1` against `RewardHud/Reward1`
2. make only `DeckInspectHud` root card structure match
3. regenerate UI
4. boot test
5. then bind hover for inspect cards only
That keeps the blast radius small.

View File

@@ -77,4 +77,7 @@ end`, [
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'path' },
{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'enabled' },
], 2),
method('IntStr', `return string.format("%d", math.floor((n or 0) + 0.00001))`, [
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'n' },
], 0, 'string'),
];

View File

@@ -172,8 +172,8 @@ for i = 1, #self.Monsters do
local m = self.Monsters[i]
local active = false
if m ~= nil and m.alive == true and i == shownTarget then active = true end
self:SetEntityEnabled("/ui/RunUIGroup/CombatHud/MonsterStatus" .. tostring(i) .. "/TargetMarker", active and dragActive)
self:SetEntityEnabled("/ui/RunUIGroup/CombatHud/MonsterStatus" .. tostring(i) .. "/TargetMarker/Label", active and dragActive)
self:SetEntityEnabled("/ui/RunUIGroup/CombatHud/MonsterStatus" .. self:IntStr(i) .. "/TargetMarker", active and dragActive)
self:SetEntityEnabled("/ui/RunUIGroup/CombatHud/MonsterStatus" .. self:IntStr(i) .. "/TargetMarker/Label", active and dragActive)
end`),
method('OnCardDragBegin', `if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then
return
@@ -186,7 +186,7 @@ if self.CardHoverTweenId ~= nil and self.CardHoverTweenId ~= 0 then
self.CardHoverTweenId = 0
end
for i = 1, 10 do
local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(i))
local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(i))
if e ~= nil and e.UITransformComponent ~= nil then
e.UITransformComponent.UIScale = Vector3(1, 1, 1)
e.UITransformComponent.anchoredPosition = Vector2(self:GetHandSlotX(i), 0)
@@ -198,7 +198,7 @@ self:RenderTargetFrames()`, [{ Type: 'number', DefaultValue: null, SyncDirection
method('OnCardDrag', `if self.DragSlot ~= slot then
return
end
local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(slot))
local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(slot))
if e ~= nil and e.UITransformComponent ~= nil then
local ui = _UILogic:ScreenToUIPosition(touchPoint)
e.UITransformComponent.anchoredPosition = Vector2(ui.x, ui.y + 360)
@@ -220,7 +220,7 @@ end`, [
return
end
self.DragSlot = 0
local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(slot))
local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(slot))
if e ~= nil and e.UITransformComponent ~= nil then
e.UITransformComponent.anchoredPosition = Vector2(self:GetHandSlotX(slot), 0)
e.UITransformComponent.UIScale = Vector3(1, 1, 1)
@@ -568,7 +568,7 @@ if m.entity ~= nil and isvalid(m.entity) then
local ent = m.entity
_TimerService:SetTimerOnce(function() if isvalid(ent) then ent:SetVisible(false) end end, 0.4)
end
self:SetEntityEnabled("/ui/RunUIGroup/CombatHud/MonsterStatus" .. tostring(slot), false)
self:SetEntityEnabled("/ui/RunUIGroup/CombatHud/MonsterStatus" .. self:IntStr(slot), false)
for i = 1, #self.Monsters do
if self.Monsters[i].alive == true then self.TargetIndex = i; break end
end`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }]),
@@ -642,7 +642,7 @@ if idx == 0 or self.PlayerHp <= 0 then
return
end
local m = self.Monsters[idx]
local base = "/ui/RunUIGroup/CombatHud/MonsterStatus" .. tostring(idx)
local base = "/ui/RunUIGroup/CombatHud/MonsterStatus" .. self:IntStr(idx)
self:SetEntityEnabled(base .. "/ActFrame", true)
_TimerService:SetTimerOnce(function()
local poisonTicks = 1

View File

@@ -73,19 +73,20 @@ end
self:BindClassDeckTabs()
local allDeckGrid = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckAllHud/Grid")
if allDeckGrid ~= nil and (allDeckGrid.UITouchReceiveComponent ~= nil or allDeckGrid:AddComponent("UITouchReceiveComponent") ~= nil) then
allDeckGrid:ConnectEvent(UITouchEnterEvent, function(ev) self:HoverGridCard("/ui/DeckUIGroup/DeckAllHud/Grid", ev.TouchPoint) end)
allDeckGrid:ConnectEvent(UITouchDownEvent, function(ev) self:HoverGridCard("/ui/DeckUIGroup/DeckAllHud/Grid", ev.TouchPoint) end)
allDeckGrid:ConnectEvent(UITouchDragEvent, function(ev) self:HoverGridCard("/ui/DeckUIGroup/DeckAllHud/Grid", ev.TouchPoint) end)
allDeckGrid:ConnectEvent(UITouchExitEvent, function() self:UnhoverGridCard("/ui/DeckUIGroup/DeckAllHud/Grid") end)
allDeckGrid:ConnectEvent(UITouchEnterEvent, function(ev) self.GridScrollActive = false; self:HoverGridCard("/ui/DeckUIGroup/DeckAllHud/Grid", ev.TouchPoint) end)
allDeckGrid:ConnectEvent(UITouchDownEvent, function(ev) self.GridScrollActive = false; self:HoverGridCard("/ui/DeckUIGroup/DeckAllHud/Grid", ev.TouchPoint) end)
allDeckGrid:ConnectEvent(UITouchDragEvent, function(ev) self.GridScrollActive = true; self:UnhoverGridCard("/ui/DeckUIGroup/DeckAllHud/Grid") end)
allDeckGrid:ConnectEvent(UITouchEndDragEvent, function() self.GridScrollActive = false end)
allDeckGrid:ConnectEvent(UITouchExitEvent, function() self.GridScrollActive = false; self:UnhoverGridCard("/ui/DeckUIGroup/DeckAllHud/Grid") end)
end
for i = 1, 120 do
local allCard = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckAllHud/Grid/Card" .. tostring(i))
local allCard = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckAllHud/Grid/Card" .. self:IntStr(i))
if allCard ~= nil and (allCard.ButtonComponent ~= nil or allCard:AddComponent("ButtonComponent") ~= nil) then
if allCard.SpriteGUIRendererComponent ~= nil then
allCard.SpriteGUIRendererComponent.RaycastTarget = true
end
local slot = i
local cardPath = "/ui/DeckUIGroup/DeckAllHud/Grid/Card" .. tostring(i)
local cardPath = "/ui/DeckUIGroup/DeckAllHud/Grid/Card" .. self:IntStr(i)
allCard:ConnectEvent(ButtonStateChangeEvent, function(ev)
local state = nil
if ev ~= nil then
@@ -102,15 +103,16 @@ for i = 1, 120 do
end
local inspectGrid = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckInspectHud/Grid")
if inspectGrid ~= nil and (inspectGrid.UITouchReceiveComponent ~= nil or inspectGrid:AddComponent("UITouchReceiveComponent") ~= nil) then
inspectGrid:ConnectEvent(UITouchEnterEvent, function(ev) self:HoverGridCard("/ui/DeckUIGroup/DeckInspectHud/Grid", ev.TouchPoint) end)
inspectGrid:ConnectEvent(UITouchDownEvent, function(ev) self:HoverGridCard("/ui/DeckUIGroup/DeckInspectHud/Grid", ev.TouchPoint) end)
inspectGrid:ConnectEvent(UITouchDragEvent, function(ev) self:HoverGridCard("/ui/DeckUIGroup/DeckInspectHud/Grid", ev.TouchPoint) end)
inspectGrid:ConnectEvent(UITouchExitEvent, function() self:UnhoverGridCard("/ui/DeckUIGroup/DeckInspectHud/Grid") end)
inspectGrid:ConnectEvent(UITouchEnterEvent, function(ev) self.GridScrollActive = false; self:HoverGridCard("/ui/DeckUIGroup/DeckInspectHud/Grid", ev.TouchPoint) end)
inspectGrid:ConnectEvent(UITouchDownEvent, function(ev) self.GridScrollActive = false; self:HoverGridCard("/ui/DeckUIGroup/DeckInspectHud/Grid", ev.TouchPoint) end)
inspectGrid:ConnectEvent(UITouchDragEvent, function(ev) self.GridScrollActive = true; self:UnhoverGridCard("/ui/DeckUIGroup/DeckInspectHud/Grid") end)
inspectGrid:ConnectEvent(UITouchEndDragEvent, function() self.GridScrollActive = false end)
inspectGrid:ConnectEvent(UITouchExitEvent, function() self.GridScrollActive = false; self:UnhoverGridCard("/ui/DeckUIGroup/DeckInspectHud/Grid") end)
end
for i = 1, 60 do
local inspectCard = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckInspectHud/Grid/Card" .. tostring(i))
local inspectCard = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckInspectHud/Grid/Card" .. self:IntStr(i))
if inspectCard ~= nil and (inspectCard.ButtonComponent ~= nil or inspectCard:AddComponent("ButtonComponent") ~= nil) then
local cardPath = "/ui/DeckUIGroup/DeckInspectHud/Grid/Card" .. tostring(i)
local cardPath = "/ui/DeckUIGroup/DeckInspectHud/Grid/Card" .. self:IntStr(i)
inspectCard:ConnectEvent(ButtonStateChangeEvent, function(ev)
local state = nil
if ev ~= nil then
@@ -125,9 +127,9 @@ for i = 1, 60 do
end
end
for i = 1, 10 do
local cardEntity = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(i))
local cardEntity = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(i))
if cardEntity ~= nil and cardEntity.UITouchReceiveComponent ~= nil then
local cardPath = "/ui/RunUIGroup/CardHand/Card" .. tostring(i)
local cardPath = "/ui/RunUIGroup/CardHand/Card" .. self:IntStr(i)
cardEntity:ConnectEvent(UITouchEnterEvent, function() self:SetCardHover(cardPath, true) end)
cardEntity:ConnectEvent(UITouchExitEvent, function() self:SetCardHover(cardPath, false) end)
cardEntity:ConnectEvent(UITouchBeginDragEvent, function(ev) self:OnCardDragBegin(i) end)
@@ -141,11 +143,11 @@ for i = 1, 10 do
end
end
for i = 1, 3 do
local rc = _EntityService:GetEntityByPath("/ui/RunUIGroup/RewardHud/Reward" .. tostring(i))
local rc = _EntityService:GetEntityByPath("/ui/RunUIGroup/RewardHud/Reward" .. self:IntStr(i))
if rc ~= nil and (rc.ButtonComponent ~= nil or rc:AddComponent("ButtonComponent") ~= nil) then
rc:ConnectEvent(ButtonClickEvent, function() self:PickReward(i) end)
if rc.UITouchReceiveComponent ~= nil then
local cardPath = "/ui/RunUIGroup/RewardHud/Reward" .. tostring(i)
local cardPath = "/ui/RunUIGroup/RewardHud/Reward" .. self:IntStr(i)
rc:ConnectEvent(UITouchEnterEvent, function() self:SetCardHover(cardPath, true) end)
rc:ConnectEvent(UITouchExitEvent, function() self:SetCardHover(cardPath, false) end)
rc:ConnectEvent(UITouchEnterEvent, function() self:HoverCardByPath(cardPath) end)
@@ -172,11 +174,11 @@ for i = 1, #mapNodeIds do
end
end
for i = 1, 3 do
local sc = _EntityService:GetEntityByPath("/ui/RunUIGroup/ShopHud/Card" .. tostring(i))
local sc = _EntityService:GetEntityByPath("/ui/RunUIGroup/ShopHud/Card" .. self:IntStr(i))
if sc ~= nil and (sc.ButtonComponent ~= nil or sc:AddComponent("ButtonComponent") ~= nil) then
sc:ConnectEvent(ButtonClickEvent, function() self:BuyCard(i) end)
if sc.UITouchReceiveComponent ~= nil then
local cardPath = "/ui/RunUIGroup/ShopHud/Card" .. tostring(i)
local cardPath = "/ui/RunUIGroup/ShopHud/Card" .. self:IntStr(i)
sc:ConnectEvent(UITouchEnterEvent, function() self:SetCardHover(cardPath, true) end)
sc:ConnectEvent(UITouchExitEvent, function() self:SetCardHover(cardPath, false) end)
sc:ConnectEvent(UITouchEnterEvent, function() self:HoverCardByPath(cardPath) end)
@@ -197,13 +199,13 @@ if restLeave ~= nil and (restLeave.ButtonComponent ~= nil or restLeave:AddCompon
restLeave:ConnectEvent(ButtonClickEvent, function() self:LeaveNode() end)
end
for i = 1, ${MAX_MONSTERS} do
local ms = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/MonsterStatus" .. tostring(i))
local ms = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/MonsterStatus" .. self:IntStr(i))
if ms ~= nil and (ms.ButtonComponent ~= nil or ms:AddComponent("ButtonComponent") ~= nil) then
ms:ConnectEvent(ButtonClickEvent, function() self:SetTarget(i) end)
end
end
for i = 1, 10 do
local rs = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/TopBar/RelicSlot" .. tostring(i))
local rs = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/TopBar/RelicSlot" .. self:IntStr(i))
if rs ~= nil and rs.UITouchReceiveComponent ~= nil then
local idx = i
rs:ConnectEvent(UITouchEnterEvent, function()
@@ -217,7 +219,7 @@ for i = 1, 10 do
end
end
for i = 1, 5 do
local ps = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/TopBar/PotionSlot" .. tostring(i))
local ps = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/TopBar/PotionSlot" .. self:IntStr(i))
if ps ~= nil and ps.UITouchReceiveComponent ~= nil then
local idx = i
ps:ConnectEvent(UITouchEnterEvent, function()
@@ -265,7 +267,7 @@ if jcJob ~= nil and (jcJob.ButtonComponent ~= nil or jcJob:AddComponent("ButtonC
end
for i = 1, 3 do
local slotIdx = i
local jb = _EntityService:GetEntityByPath("/ui/SelectUIGroup/JobSelectHud/Job_slot" .. tostring(i))
local jb = _EntityService:GetEntityByPath("/ui/SelectUIGroup/JobSelectHud/Job_slot" .. self:IntStr(i))
if jb ~= nil and (jb.ButtonComponent ~= nil or jb:AddComponent("ButtonComponent") ~= nil) then
jb:ConnectEvent(ButtonClickEvent, function()
if self.JobOpts ~= nil and self.JobOpts[slotIdx] ~= nil then

View File

@@ -44,7 +44,7 @@ end
self:SetText("/ui/DeckUIGroup/DeckInspectHud/Title", title .. suffix)
self:SetEntityEnabled("/ui/DeckUIGroup/DeckInspectHud/Empty", count <= 0)
for i = 1, 60 do
local path = "/ui/DeckUIGroup/DeckInspectHud/Grid/Card" .. tostring(i)
local path = "/ui/DeckUIGroup/DeckInspectHud/Grid/Card" .. self:IntStr(i)
local cardId = nil
if pile ~= nil then
cardId = pile[i]
@@ -59,7 +59,7 @@ end`, [
{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'pile' },
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'title' },
]),
method('ApplyInspectCardVisual', `self:ApplyCardFace("/ui/DeckUIGroup/DeckInspectHud/Grid/Card" .. tostring(slot), cardId)`, [
method('ApplyInspectCardVisual', `self:ApplyCardFace("/ui/DeckUIGroup/DeckInspectHud/Grid/Card" .. self:IntStr(slot), cardId)`, [
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' },
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'cardId' },
]),
@@ -223,7 +223,7 @@ self:SetText("/ui/DeckUIGroup/DeckAllHud/Title", title .. " (" .. tostring(count
self:RenderClassDeckTabs()
self:SetEntityEnabled("/ui/DeckUIGroup/DeckAllHud/Empty", count <= 0)
for i = 1, 120 do
local path = "/ui/DeckUIGroup/DeckAllHud/Grid/Card" .. tostring(i)
local path = "/ui/DeckUIGroup/DeckAllHud/Grid/Card" .. self:IntStr(i)
local cardId = pile[i]
if cardId == nil then
self:SetEntityEnabled(path, false)
@@ -232,7 +232,7 @@ for i = 1, 120 do
self:ApplyAllDeckCardVisual(i, cardId)
end
end`),
method('ApplyAllDeckCardVisual', `self:ApplyCardFace("/ui/DeckUIGroup/DeckAllHud/Grid/Card" .. tostring(slot), cardId)`, [
method('ApplyAllDeckCardVisual', `self:ApplyCardFace("/ui/DeckUIGroup/DeckAllHud/Grid/Card" .. self:IntStr(slot), cardId)`, [
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' },
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'cardId' },
]),

View File

@@ -56,7 +56,7 @@ if n > 8 then spacing = math.floor(1400 / n) end
local startX = -((n - 1) * spacing) / 2
local drawStart = Vector2(-590, 8)
for i = 1, 10 do
\tlocal cardEntity = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(i))
\tlocal cardEntity = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(i))
\tif cardEntity ~= nil then
\t\tlocal cardId = self.Hand[i]
\t\tif cardId == nil then
@@ -151,7 +151,7 @@ if self.CardHoverTweenId ~= nil and self.CardHoverTweenId ~= 0 then
end
local items = {}
for i = 1, count do
local e = _EntityService:GetEntityByPath(prefix .. tostring(i))
local e = _EntityService:GetEntityByPath(prefix .. self:IntStr(i))
if e ~= nil and e.UITransformComponent ~= nil then
local tr = e.UITransformComponent
local tx = xs[i]
@@ -195,7 +195,7 @@ self.CardHoverTweenId = eventId`, [
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'path' },
{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'hover' },
]),
method('ApplyCardVisual', `self:ApplyCardFace("/ui/RunUIGroup/CardHand/Card" .. tostring(slot), cardId)`, [
method('ApplyCardVisual', `self:ApplyCardFace("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(slot), cardId)`, [
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' },
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'cardId' },
]),
@@ -217,7 +217,7 @@ if math.abs(n - math.floor(n)) < 0.00001 then
return string.format("%d", math.floor(n))
end
return tostring(n)`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'value' }], 0, 'string'),
method('AnimateCardFrom', `local cardEntity = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(slot))
method('AnimateCardFrom', `local cardEntity = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(slot))
if cardEntity == nil or cardEntity.UITransformComponent == nil then
\treturn
end
@@ -246,10 +246,10 @@ 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))
\tlocal e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(slot))
\tif e ~= nil then
\t\te.Enable = true
\t\tself:ApplyCardFace("/ui/RunUIGroup/CardHand/Card" .. tostring(slot), cardIds[i])
\t\tself:ApplyCardFace("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(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
@@ -266,7 +266,7 @@ eventId = _TimerService:SetTimerRepeat(function()
\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\tlocal e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(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
@@ -281,7 +281,7 @@ eventId = _TimerService:SetTimerRepeat(function()
\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\tlocal e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(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

View File

@@ -95,7 +95,7 @@ if self:AddPotion(pid) == true then
self:Toast("물약 획득: " .. p.name)
end`),
method('RenderPotions', `for i = 1, 5 do
local base = "/ui/RunUIGroup/CombatHud/TopBar/PotionSlot" .. tostring(i)
local base = "/ui/RunUIGroup/CombatHud/TopBar/PotionSlot" .. self:IntStr(i)
local e = _EntityService:GetEntityByPath(base)
if e ~= nil and e.SpriteGUIRendererComponent ~= nil then
local pid = nil
@@ -188,7 +188,7 @@ if self.RunRelics ~= nil then
count = #self.RunRelics
end
for i = 1, 10 do
local base = "/ui/RunUIGroup/CombatHud/TopBar/RelicSlot" .. tostring(i)
local base = "/ui/RunUIGroup/CombatHud/TopBar/RelicSlot" .. self:IntStr(i)
local e = _EntityService:GetEntityByPath(base)
if e ~= nil and e.SpriteGUIRendererComponent ~= nil then
local rid = nil

View File

@@ -71,7 +71,7 @@ if opts == nil then
end
self.JobOpts = opts
for i = 1, 3 do
local base = "/ui/SelectUIGroup/JobSelectHud/Job_slot" .. tostring(i)
local base = "/ui/SelectUIGroup/JobSelectHud/Job_slot" .. self:IntStr(i)
local o = opts[i]
if o ~= nil then
self:SetEntityEnabled(base, true)

View File

@@ -14,7 +14,7 @@ end
local worldPos = transform.WorldPosition
local screen = _UILogic:WorldToScreenPosition(Vector2(worldPos.x, worldPos.y + ${HEAD_OFFSET_Y}))
local uipos = _UILogic:ScreenToUIPosition(screen)
local slotEntity = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/MonsterStatus" .. tostring(slot))
local slotEntity = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/MonsterStatus" .. self:IntStr(slot))
if slotEntity ~= nil and slotEntity.UITransformComponent ~= nil then
slotEntity.UITransformComponent.anchoredPosition = uipos
end`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }]),

View File

@@ -162,7 +162,7 @@ if node ~= nil then
end
end
for k = 1, 3 do
local d = _EntityService:GetEntityByPath("/ui/RunUIGroup/MapHud/Dot_" .. dotId .. "_" .. tostring(k))
local d = _EntityService:GetEntityByPath("/ui/RunUIGroup/MapHud/Dot_" .. dotId .. "_" .. self:IntStr(k))
if d ~= nil then
d.Enable = has
if has == true and d.SpriteGUIRendererComponent ~= nil then

View File

@@ -15,7 +15,7 @@ return table.concat(parts, " ")`, [
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'poison' },
], 0, 'string'),
method('RenderCombat', `for i = 1, ${MAX_MONSTERS} do
local base = "/ui/RunUIGroup/CombatHud/MonsterStatus" .. tostring(i)
local base = "/ui/RunUIGroup/CombatHud/MonsterStatus" .. self:IntStr(i)
local m = self.Monsters[i]
if m ~= nil and m.alive == true then
self:SetEntityEnabled(base, true)
@@ -108,7 +108,7 @@ if popIndex > 5 then
popIndex = 1
end
self.DmgPopSlotQueue[slotKey] = popIndex
local base = "/ui/RunUIGroup/CombatHud/DmgPop" .. slotKey .. "_" .. tostring(popIndex)
local base = "/ui/RunUIGroup/CombatHud/DmgPop" .. slotKey .. "_" .. self:IntStr(popIndex)
local pop = _EntityService:GetEntityByPath(base)
if pop == nil then
return
@@ -129,10 +129,10 @@ local function showNow()
local totalW = #digits * ${DAMAGE_POP_DIGIT_W} + math.max(0, #digits - 1) * ${DAMAGE_POP_DIGIT_SPACING}
local startX = -totalW / 2 + ${DAMAGE_POP_DIGIT_W} / 2
for i = 1, ${DAMAGE_POP_MAX_DIGITS} do
self:SetEntityEnabled(base .. "/Digit" .. tostring(i), false)
self:SetEntityEnabled(base .. "/Digit" .. self:IntStr(i), false)
end
for i = 1, ${DAMAGE_POP_MAX_DIGITS} do
local digitPath = base .. "/Digit" .. tostring(i)
local digitPath = base .. "/Digit" .. self:IntStr(i)
local digitEntity = _EntityService:GetEntityByPath(digitPath)
if digitEntity ~= nil and digitEntity.SpriteGUIRendererComponent ~= nil then
if digits[i] ~= nil then
@@ -181,7 +181,7 @@ local function showNow()
local alpha = 1 - (i / 6)
if alpha < 0 then alpha = 0 end
for di = 1, ${DAMAGE_POP_MAX_DIGITS} do
local digitEntity = _EntityService:GetEntityByPath(base .. "/Digit" .. tostring(di))
local digitEntity = _EntityService:GetEntityByPath(base .. "/Digit" .. self:IntStr(di))
if digitEntity ~= nil and digitEntity.Enable == true and digitEntity.SpriteGUIRendererComponent ~= nil then
digitEntity.SpriteGUIRendererComponent.Color = Color(1, 1, 1, alpha)
end
@@ -196,14 +196,98 @@ showNow()`, [
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' },
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'amount' },
]),
method('ShowPlayerDmgPop', `local base = "/ui/RunUIGroup/CombatHud/PlayerPanel/DmgPop"
if amount > 0 then
self:SetText(base, "-" .. string.format("%d", amount))
else
self:SetText(base, "막음")
method('ShowPlayerDmgPop', `local shownAmount = math.max(0, math.floor(amount or 0))
if shownAmount <= 0 then
return
end
self:SetEntityEnabled(base, true)
_TimerService:SetTimerOnce(function() self:SetEntityEnabled(base, false) end, 0.6)`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'amount' }]),
local function setEnabled(entity, enabled)
if entity == nil then
return
end
entity.Enable = enabled
if entity.SpriteGUIRendererComponent ~= nil then
entity.SpriteGUIRendererComponent.Enable = enabled
end
if entity.TextComponent ~= nil then
entity.TextComponent.Enable = enabled
end
end
self.PlayerDmgPopIndex = (self.PlayerDmgPopIndex or 0) + 1
if self.PlayerDmgPopIndex > 4 then
self.PlayerDmgPopIndex = 1
end
local base = "/ui/RunUIGroup/CombatHud/PlayerPanel/DmgPop_" .. self:IntStr(self.PlayerDmgPopIndex)
local pop = _EntityService:GetEntityByPath(base)
if pop == nil then
return
end
setEnabled(pop, false)
local damageDigitRuids = { ${DAMAGE_DIGIT_RUIDS.map(luaStr).join(', ')} }
local shown = tostring(shownAmount)
if string.len(shown) > ${DAMAGE_POP_MAX_DIGITS} then
shown = string.sub(shown, 1, ${DAMAGE_POP_MAX_DIGITS})
end
local digits = {}
local digitEntitiesToEnable = {}
for i = 1, string.len(shown) do
table.insert(digits, tonumber(string.sub(shown, i, i)) or 0)
end
local totalW = #digits * ${DAMAGE_POP_DIGIT_W} + math.max(0, #digits - 1) * ${DAMAGE_POP_DIGIT_SPACING}
local startX = -totalW / 2 + ${DAMAGE_POP_DIGIT_W} / 2
for i = 1, ${DAMAGE_POP_MAX_DIGITS} do
local digitEntity = _EntityService:GetEntityByPath(base .. "/Digit" .. self:IntStr(i))
setEnabled(digitEntity, false)
end
for i = 1, ${DAMAGE_POP_MAX_DIGITS} do
local digitPath = base .. "/Digit" .. self:IntStr(i)
local digitEntity = _EntityService:GetEntityByPath(digitPath)
if digitEntity ~= nil and digitEntity.SpriteGUIRendererComponent ~= nil then
if digits[i] ~= nil then
digitEntity.SpriteGUIRendererComponent.ImageRUID = damageDigitRuids[digits[i] + 1]
digitEntity.SpriteGUIRendererComponent.Color = Color(1, 1, 1, 1)
if digitEntity.UITransformComponent ~= nil then
digitEntity.UITransformComponent.anchoredPosition = Vector2(startX + (i - 1) * (${DAMAGE_POP_DIGIT_W} + ${DAMAGE_POP_DIGIT_SPACING}), 0)
end
table.insert(digitEntitiesToEnable, digitEntity)
end
end
end
local startPos = Vector2(16, 34)
if pop.UITransformComponent ~= nil then
local cur = pop.UITransformComponent.anchoredPosition
if math.abs(cur.x) < 240 and math.abs(cur.y) < 140 then
startPos = cur
end
pop.UITransformComponent.anchoredPosition = startPos
end
setEnabled(pop, true)
for i = 1, #digitEntitiesToEnable do
setEnabled(digitEntitiesToEnable[i], true)
end
for i = 1, 6 do
_TimerService:SetTimerOnce(function()
local p = _EntityService:GetEntityByPath(base)
if p ~= nil and p.Enable == true and p.UITransformComponent ~= nil then
local cur = p.UITransformComponent.anchoredPosition
p.UITransformComponent.anchoredPosition = Vector2(cur.x, cur.y + 7)
end
local alpha = 1 - (i / 6)
if alpha < 0 then alpha = 0 end
for di = 1, ${DAMAGE_POP_MAX_DIGITS} do
local digitEntity = _EntityService:GetEntityByPath(base .. "/Digit" .. self:IntStr(di))
if digitEntity ~= nil and digitEntity.Enable == true and digitEntity.SpriteGUIRendererComponent ~= nil then
digitEntity.SpriteGUIRendererComponent.Color = Color(1, 1, 1, alpha)
end
end
end, 0.05 * i)
end
_TimerService:SetTimerOnce(function()
local p = _EntityService:GetEntityByPath(base)
if p ~= nil and p.UITransformComponent ~= nil then
p.UITransformComponent.anchoredPosition = startPos
end
setEnabled(p, false)
end, 0.3)`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'amount' }]),
method('ShakeCombatCamera', `local lp = _UserService.LocalPlayer
local cam = nil
if lp ~= nil then
@@ -342,8 +426,28 @@ end
local ratio = 0
if maxHp > 0 then ratio = hp / maxHp end
if ratio < 0 then ratio = 0 end
if ratio > 1 then ratio = 1 end
if self.HpBarOrigins == nil then
self.HpBarOrigins = {}
end
local t = e.UITransformComponent
local origin = self.HpBarOrigins[path]
if origin == nil then
local pivotX = 0
if t.Pivot ~= nil then
pivotX = t.Pivot.x or 0
end
origin = {
left = t.anchoredPosition.x - (t.RectSize.x * pivotX),
y = t.anchoredPosition.y,
height = t.RectSize.y,
pivotX = pivotX,
}
self.HpBarOrigins[path] = origin
end
local w = width * ratio
e.UITransformComponent.RectSize = Vector2(w, 14)`, [
t.RectSize = Vector2(w, origin.height or 14)
t.anchoredPosition = Vector2(origin.left + (w * (origin.pivotX or 0)), origin.y or t.anchoredPosition.y)`, [
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'path' },
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'hp' },
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'maxHp' },

View File

@@ -34,7 +34,7 @@ local hud = _EntityService:GetEntityByPath("/ui/RunUIGroup/RewardHud")
if hud ~= nil then
hud.Enable = true
end`),
method('ApplyRewardVisual', `self:ApplyCardFace("/ui/RunUIGroup/RewardHud/Reward" .. tostring(slot), cardId)`, [
method('ApplyRewardVisual', `self:ApplyCardFace("/ui/RunUIGroup/RewardHud/Reward" .. self:IntStr(slot), cardId)`, [
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' },
{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'cardId' },
]),

View File

@@ -108,6 +108,7 @@ self.DamageDealtThisTurn = 0
self.DmgPopSeq = 0
self.CombatCameraShakeSeq = 0
self.DmgPopSlotQueue = {}
self.PlayerDmgPopIndex = 0
self.FirstHpLossDone = false
self.ClayBlockNext = 0
self.DiscardSelectRemaining = 0

View File

@@ -24,7 +24,7 @@ self:ShowState("shop")`),
for i = 1, 3 do
local cid = self.ShopChoices[i]
local c = self.Cards[cid]
local base = "/ui/RunUIGroup/ShopHud/Card" .. tostring(i)
local base = "/ui/RunUIGroup/ShopHud/Card" .. self:IntStr(i)
if c ~= nil then
self:ApplyCardFace(base, cid)
self:SetText(base .. "/Price", string.format("%d", ${CARD_PRICE}) .. " 메소")

View File

@@ -75,7 +75,7 @@ self:RenderSoulLabel()
self:RenderSoulShop()`, [{ Type: "number", DefaultValue: null, SyncDirection: 0, Attributes: [], Name: "slot" }]),
method('RenderSoulShop', `local defs = self.SoulShopDef or {}
for i = 1, 4 do
local base = "/ui/LobbyUIGroup/SoulShopHud/Item" .. tostring(i)
local base = "/ui/LobbyUIGroup/SoulShopHud/Item" .. self:IntStr(i)
local d = defs[i]
if d == nil then
self:SetEntityEnabled(base, false)
@@ -103,7 +103,7 @@ end
self.SoulShopBound = true
for i = 1, 4 do
local idx = i
local e = _EntityService:GetEntityByPath("/ui/LobbyUIGroup/SoulShopHud/Item" .. tostring(i))
local e = _EntityService:GetEntityByPath("/ui/LobbyUIGroup/SoulShopHud/Item" .. self:IntStr(i))
if e ~= nil and (e.ButtonComponent ~= nil or e:AddComponent("ButtonComponent") ~= nil) then
e:ConnectEvent(ButtonClickEvent, function() self:BuySoulUnlock(idx) end)
end

View File

@@ -173,7 +173,7 @@ local uiPos = _UILogic:ScreenToUIPosition(touchPoint)
local bestPath = nil
local bestDist = 999999
for i = 1, maxSlots do
local path = prefix .. tostring(i)
local path = prefix .. self:IntStr(i)
local cardEntity = _EntityService:GetEntityByPath(path)
if cardEntity ~= nil and cardEntity.Enable == true and cardEntity.UITransformComponent ~= nil then
local pos = self:GetUiPathPosition(path)
@@ -255,6 +255,9 @@ end
if self.DragSlot ~= nil and self.DragSlot > 0 and string.find(path, "/ui/RunUIGroup/CardHand/Card", 1, true) == 1 then
return
end
if self.GridScrollActive == true and (string.find(path, "/ui/DeckUIGroup/DeckAllHud/Grid/Card", 1, true) == 1 or string.find(path, "/ui/DeckUIGroup/DeckInspectHud/Grid/Card", 1, true) == 1) then
return
end
local cardId = self:GetHoveredCardId(path)
if cardId == nil or self.Cards == nil then
self:HideTooltip()
@@ -320,7 +323,7 @@ local cardId = self.Hand[slot]
if cardId == nil then
return
end
local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(slot))
local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(slot))
if e ~= nil and e.UITransformComponent ~= nil then
e.UITransformComponent.UIScale = Vector3(1.3, 1.3, 1)
end
@@ -328,13 +331,13 @@ local c = self.Cards[cardId]
if c ~= nil then
local tip = self:BuildCardKeywordTooltip(c)
if tip ~= "" then
local anchor = self:GetTooltipAnchorForPath("/ui/RunUIGroup/CardHand/Card" .. tostring(slot))
local anchor = self:GetTooltipAnchorForPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(slot))
self:ShowTooltipAt("키워드", tip, anchor.x, anchor.y)
else
self:HideTooltip()
end
end`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }]),
method('UnhoverCard', `local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. tostring(slot))
method('UnhoverCard', `local e = _EntityService:GetEntityByPath("/ui/RunUIGroup/CardHand/Card" .. self:IntStr(slot))
if e ~= nil and e.UITransformComponent ~= nil then
e.UITransformComponent.UIScale = Vector3(1, 1, 1)
end

View File

@@ -38,6 +38,8 @@ function writeCodeblocks() {
prop('number', 'DmgPopSeq', '0'),
prop('number', 'CombatCameraShakeSeq', '0'),
prop('any', 'DmgPopSlotQueue'),
prop('number', 'PlayerDmgPopIndex', '0'),
prop('any', 'HpBarOrigins'),
prop('any', 'EndTurnHandler'),
prop('any', 'NewGameHandler'),
prop('any', 'WarriorSelectHandler'),
@@ -78,6 +80,7 @@ function writeCodeblocks() {
prop('string', 'ClassDeckTitle', '""'),
prop('string', 'ClassDeckClass', '""'),
prop('string', 'GridHoverPath', '""'),
prop('boolean', 'GridScrollActive', 'false'),
prop('any', 'SoulUnlocks'),
prop('any', 'SoulShopDef'),
prop('boolean', 'SoulShopBound', 'false'),

View File

@@ -100,7 +100,7 @@ const SOUL_UNLOCKS = [
{ key: 'relic', name: '유물 수집가', desc: '런 시작 시 유물 1개 추가', cost: 6 },
];
function luaSoulShopTable(unlocks) {
const items = unlocks.map((u) => `\t{ key = ${luaStr(u.key)}, name = ${luaStr(u.name)}, desc = ${luaStr(u.desc)}, cost = ${u.cost} },`).join('\n');
const items = unlocks.map((u) => `\t{ key = ${luaStr(u.key)}, name = ${luaStr(u.name)}, desc = ${luaStr(u.desc)}, cost = ${luaNum(u.cost)} },`).join('\n');
return `self.SoulShopDef = {\n${items}\n}`;
}
if (!ENEMIES.enemies[ENEMIES.activeEnemy]) {
@@ -165,7 +165,7 @@ for (const id of RELICS.relicPool) {
}
function luaRelicsTable(relics) {
const lines = Object.entries(relics).map(([id, r]) =>
`\t${id} = { name = ${luaStr(r.name)}, desc = ${luaStr(r.desc)}, hook = ${luaStr(r.hook)}, effect = ${luaStr(r.effect)}, value = ${r.value}, icon = ${luaStr(r.icon || '')} },`);
`\t${id} = { name = ${luaStr(r.name)}, desc = ${luaStr(r.desc)}, hook = ${luaStr(r.hook)}, effect = ${luaStr(r.effect)}, value = ${luaNum(r.value)}, icon = ${luaStr(r.icon || '')} },`);
return `self.Relics = {\n${lines.join('\n')}\n}`;
}
@@ -175,32 +175,38 @@ for (const [pid, p] of Object.entries(POTIONS.potions)) {
}
function luaPotionsTable(potions) {
const lines = Object.entries(potions).map(([id, p]) =>
`\t${id} = { name = ${luaStr(p.name)}, desc = ${luaStr(p.desc)}, effect = ${luaStr(p.effect)}, value = ${p.value}, icon = ${luaStr(p.icon || '')} },`);
`\t${id} = { name = ${luaStr(p.name)}, desc = ${luaStr(p.desc)}, effect = ${luaStr(p.effect)}, value = ${luaNum(p.value)}, icon = ${luaStr(p.icon || '')} },`);
return `self.Potions = {\n${lines.join('\n')}\n}`;
}
function luaIntentsArray(intents) {
return '{ ' + intents.map((it) => {
const fields = [`kind = ${luaStr(it.kind)}`, `value = ${it.value != null ? it.value : 0}`];
const fields = [`kind = ${luaStr(it.kind)}`, `value = ${luaNum(it.value != null ? it.value : 0)}`];
if (it.effect != null) fields.push(`effect = ${luaStr(it.effect)}`);
if (it.card != null) fields.push(`card = ${luaStr(it.card)}`);
if (it.count != null) fields.push(`count = ${it.count}`);
if (it.count != null) fields.push(`count = ${luaNum(it.count)}`);
return `{ ${fields.join(', ')} }`;
}).join(', ') + ' }';
}
function luaEnemiesTable(enemies) {
const lines = Object.entries(enemies).map(([id, e]) =>
`\t${id} = { name = ${luaStr(e.name)}, maxHp = ${e.maxHp}, intents = ${luaIntentsArray(e.intents)} },`);
`\t${id} = { name = ${luaStr(e.name)}, maxHp = ${luaNum(e.maxHp)}, intents = ${luaIntentsArray(e.intents)} },`);
return `self.Enemies = {\n${lines.join('\n')}\n}`;
}
function luaStr(s) {
return '"' + String(s).replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n') + '"';
}
function luaNum(n) {
const v = Number(n);
if (!Number.isFinite(v)) return '0';
if (Number.isInteger(v)) return String(v);
return String(v);
}
function luaJobsTable(jobs) {
const cls = Object.entries(jobs).map(([clsId, list]) => {
const items = list.map((j) =>
`\t\t{ id = ${luaStr(j.id)}, name = ${luaStr(j.name)}, desc = ${luaStr(j.desc)}, starter = ${luaStr(j.starter)}, tier = ${j.tier ?? 2}, parent = ${luaStr(j.parent ?? clsId)} },`).join('\n');
`\t\t{ id = ${luaStr(j.id)}, name = ${luaStr(j.name)}, desc = ${luaStr(j.desc)}, starter = ${luaStr(j.starter)}, tier = ${luaNum(j.tier ?? 2)}, parent = ${luaStr(j.parent ?? clsId)} },`).join('\n');
return `\t${clsId} = {\n${items}\n\t},`;
}).join('\n');
return `self.Jobs = {\n${cls}\n}`;
@@ -217,133 +223,133 @@ function luaClassLineagesTable(lineages) {
}
function luaJobMetaTable(meta) {
const rows = Object.entries(meta).map(([jobId, entry]) =>
`\t${jobId} = { name = ${luaStr(entry.name)}, starter = ${luaStr(entry.starter)}, tier = ${entry.tier}, parent = ${luaStr(entry.parent)}, sourceClass = ${luaStr(entry.sourceClass)} },`);
`\t${jobId} = { name = ${luaStr(entry.name)}, starter = ${luaStr(entry.starter)}, tier = ${luaNum(entry.tier)}, parent = ${luaStr(entry.parent)}, sourceClass = ${luaStr(entry.sourceClass)} },`);
return `self.JobMeta = {\n${rows.join('\n')}\n}`;
}
function luaCardsTable(cards) {
const lines = Object.entries(cards).map(([id, c]) => {
const fields = [`name = ${luaStr(c.name)}`, `cost = ${c.cost}`, `desc = ${luaStr(c.desc)}`, `kind = ${luaStr(c.kind)}`];
if (c.damage != null) fields.push(`damage = ${c.damage}`);
if (c.damageFromCurrentBlock != null) fields.push(`damageFromCurrentBlock = ${c.damageFromCurrentBlock}`);
if (c.damagePerCombo != null) fields.push(`damagePerCombo = ${c.damagePerCombo}`);
if (c.damagePerHolyCharge != null) fields.push(`damagePerHolyCharge = ${c.damagePerHolyCharge}`);
if (c.attackDamagePerCombo != null) fields.push(`attackDamagePerCombo = ${c.attackDamagePerCombo}`);
const fields = [`name = ${luaStr(c.name)}`, `cost = ${luaNum(c.cost)}`, `desc = ${luaStr(c.desc)}`, `kind = ${luaStr(c.kind)}`];
if (c.damage != null) fields.push(`damage = ${luaNum(c.damage)}`);
if (c.damageFromCurrentBlock != null) fields.push(`damageFromCurrentBlock = ${luaNum(c.damageFromCurrentBlock)}`);
if (c.damagePerCombo != null) fields.push(`damagePerCombo = ${luaNum(c.damagePerCombo)}`);
if (c.damagePerHolyCharge != null) fields.push(`damagePerHolyCharge = ${luaNum(c.damagePerHolyCharge)}`);
if (c.attackDamagePerCombo != null) fields.push(`attackDamagePerCombo = ${luaNum(c.attackDamagePerCombo)}`);
if (c.damageNameMatch != null) fields.push(`damageNameMatch = ${luaStr(c.damageNameMatch)}`);
if (c.damagePerOwnedNameMatch != null) fields.push(`damagePerOwnedNameMatch = ${c.damagePerOwnedNameMatch}`);
if (c.damagePerOtherHandCard != null) fields.push(`damagePerOtherHandCard = ${c.damagePerOtherHandCard}`);
if (c.damagePerAttackPlayedThisTurn != null) fields.push(`damagePerAttackPlayedThisTurn = ${c.damagePerAttackPlayedThisTurn}`);
if (c.damagePerDiscardedThisTurn != null) fields.push(`damagePerDiscardedThisTurn = ${c.damagePerDiscardedThisTurn}`);
if (c.damagePerSkillInHand != null) fields.push(`damagePerSkillInHand = ${c.damagePerSkillInHand}`);
if (c.damagePerCardDrawnThisCombat != null) fields.push(`damagePerCardDrawnThisCombat = ${c.damagePerCardDrawnThisCombat}`);
if (c.damagePerTurn != null) fields.push(`damagePerTurn = ${c.damagePerTurn}`);
if (c.cardPlayedDamage != null) fields.push(`cardPlayedDamage = ${c.cardPlayedDamage}`);
if (c.cardPlayedRandomDamage != null) fields.push(`cardPlayedRandomDamage = ${c.cardPlayedRandomDamage}`);
if (c.attackPlayedDamage != null) fields.push(`attackPlayedDamage = ${c.attackPlayedDamage}`);
if (c.firstCardDamageBonus != null) fields.push(`firstCardDamageBonus = ${c.firstCardDamageBonus}`);
if (c.rewardOnKill != null) fields.push(`rewardOnKill = ${c.rewardOnKill}`);
if (c.maxHpOnKill != null) fields.push(`maxHpOnKill = ${c.maxHpOnKill}`);
if (c.intangible != null) fields.push(`intangible = ${c.intangible}`);
if (c.endTurnDexLoss != null) fields.push(`endTurnDexLoss = ${c.endTurnDexLoss}`);
if (c.poisonPerTurn != null) fields.push(`poisonPerTurn = ${c.poisonPerTurn}`);
if (c.attackPoison != null) fields.push(`attackPoison = ${c.attackPoison}`);
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.blockPerDamageDealtThisTurn != null) fields.push(`blockPerDamageDealtThisTurn = ${c.blockPerDamageDealtThisTurn}`);
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}`);
if (c.cardPlayedBlock != null) fields.push(`cardPlayedBlock = ${c.cardPlayedBlock}`);
if (c.comboOnAttack != null) fields.push(`comboOnAttack = ${c.comboOnAttack}`);
if (c.comboMax != null) fields.push(`comboMax = ${c.comboMax}`);
if (c.attackWeak != null) fields.push(`attackWeak = ${c.attackWeak}`);
if (c.holyChargeOnHolyForce != null) fields.push(`holyChargeOnHolyForce = ${c.holyChargeOnHolyForce}`);
if (c.holyChargeMax != null) fields.push(`holyChargeMax = ${c.holyChargeMax}`);
if (c.damageTakenReduction != null) fields.push(`damageTakenReduction = ${c.damageTakenReduction}`);
if (c.blockOnDamaged != null) fields.push(`blockOnDamaged = ${c.blockOnDamaged}`);
if (c.strengthOnDamagedOnce != null) fields.push(`strengthOnDamagedOnce = ${c.strengthOnDamagedOnce}`);
if (c.drawOnExhaust != null) fields.push(`drawOnExhaust = ${c.drawOnExhaust}`);
if (c.damagePerOwnedNameMatch != null) fields.push(`damagePerOwnedNameMatch = ${luaNum(c.damagePerOwnedNameMatch)}`);
if (c.damagePerOtherHandCard != null) fields.push(`damagePerOtherHandCard = ${luaNum(c.damagePerOtherHandCard)}`);
if (c.damagePerAttackPlayedThisTurn != null) fields.push(`damagePerAttackPlayedThisTurn = ${luaNum(c.damagePerAttackPlayedThisTurn)}`);
if (c.damagePerDiscardedThisTurn != null) fields.push(`damagePerDiscardedThisTurn = ${luaNum(c.damagePerDiscardedThisTurn)}`);
if (c.damagePerSkillInHand != null) fields.push(`damagePerSkillInHand = ${luaNum(c.damagePerSkillInHand)}`);
if (c.damagePerCardDrawnThisCombat != null) fields.push(`damagePerCardDrawnThisCombat = ${luaNum(c.damagePerCardDrawnThisCombat)}`);
if (c.damagePerTurn != null) fields.push(`damagePerTurn = ${luaNum(c.damagePerTurn)}`);
if (c.cardPlayedDamage != null) fields.push(`cardPlayedDamage = ${luaNum(c.cardPlayedDamage)}`);
if (c.cardPlayedRandomDamage != null) fields.push(`cardPlayedRandomDamage = ${luaNum(c.cardPlayedRandomDamage)}`);
if (c.attackPlayedDamage != null) fields.push(`attackPlayedDamage = ${luaNum(c.attackPlayedDamage)}`);
if (c.firstCardDamageBonus != null) fields.push(`firstCardDamageBonus = ${luaNum(c.firstCardDamageBonus)}`);
if (c.rewardOnKill != null) fields.push(`rewardOnKill = ${luaNum(c.rewardOnKill)}`);
if (c.maxHpOnKill != null) fields.push(`maxHpOnKill = ${luaNum(c.maxHpOnKill)}`);
if (c.intangible != null) fields.push(`intangible = ${luaNum(c.intangible)}`);
if (c.endTurnDexLoss != null) fields.push(`endTurnDexLoss = ${luaNum(c.endTurnDexLoss)}`);
if (c.poisonPerTurn != null) fields.push(`poisonPerTurn = ${luaNum(c.poisonPerTurn)}`);
if (c.attackPoison != null) fields.push(`attackPoison = ${luaNum(c.attackPoison)}`);
if (c.otherHandAtLeast != null) fields.push(`otherHandAtLeast = ${luaNum(c.otherHandAtLeast)}`);
if (c.bonusHitsWhenOtherHandAtLeast != null) fields.push(`bonusHitsWhenOtherHandAtLeast = ${luaNum(c.bonusHitsWhenOtherHandAtLeast)}`);
if (c.block != null) fields.push(`block = ${luaNum(c.block)}`);
if (c.blockGainMultiplier != null) fields.push(`blockGainMultiplier = ${luaNum(c.blockGainMultiplier)}`);
if (c.blockPerDamageDealtThisTurn != null) fields.push(`blockPerDamageDealtThisTurn = ${luaNum(c.blockPerDamageDealtThisTurn)}`);
if (c.strength != null) fields.push(`strength = ${luaNum(c.strength)}`);
if (c.dex != null) fields.push(`dex = ${luaNum(c.dex)}`);
if (c.thorns != null) fields.push(`thorns = ${luaNum(c.thorns)}`);
if (c.cardPlayedBlock != null) fields.push(`cardPlayedBlock = ${luaNum(c.cardPlayedBlock)}`);
if (c.comboOnAttack != null) fields.push(`comboOnAttack = ${luaNum(c.comboOnAttack)}`);
if (c.comboMax != null) fields.push(`comboMax = ${luaNum(c.comboMax)}`);
if (c.attackWeak != null) fields.push(`attackWeak = ${luaNum(c.attackWeak)}`);
if (c.holyChargeOnHolyForce != null) fields.push(`holyChargeOnHolyForce = ${luaNum(c.holyChargeOnHolyForce)}`);
if (c.holyChargeMax != null) fields.push(`holyChargeMax = ${luaNum(c.holyChargeMax)}`);
if (c.damageTakenReduction != null) fields.push(`damageTakenReduction = ${luaNum(c.damageTakenReduction)}`);
if (c.blockOnDamaged != null) fields.push(`blockOnDamaged = ${luaNum(c.blockOnDamaged)}`);
if (c.strengthOnDamagedOnce != null) fields.push(`strengthOnDamagedOnce = ${luaNum(c.strengthOnDamagedOnce)}`);
if (c.drawOnExhaust != null) fields.push(`drawOnExhaust = ${luaNum(c.drawOnExhaust)}`);
if (c.drawNameMatchAutoPlay != null) fields.push(`drawNameMatchAutoPlay = ${luaStr(c.drawNameMatchAutoPlay)}`);
if (c.weak != null) fields.push(`weak = ${c.weak}`);
if (c.vuln != null) fields.push(`vuln = ${c.vuln}`);
if (c.weak != null) fields.push(`weak = ${luaNum(c.weak)}`);
if (c.vuln != null) fields.push(`vuln = ${luaNum(c.vuln)}`);
if (c.powerEffect != null) fields.push(`powerEffect = ${luaStr(c.powerEffect)}`);
if (c.value != null) fields.push(`value = ${c.value}`);
if (c.value != null) fields.push(`value = ${luaNum(c.value)}`);
if (!c.class) throw new Error(`[gen-slaydeck] 카드 ${id}에 class 누락`);
fields.push(`class = ${luaStr(c.class)}`);
fields.push(`rarity = ${luaStr(c.rarity)}`);
if (c.hits != null) fields.push(`hits = ${c.hits}`);
if (c.hits != null) fields.push(`hits = ${luaNum(c.hits)}`);
if (c.pierce === true) fields.push('pierce = true');
if (c.selfVuln != null) fields.push(`selfVuln = ${c.selfVuln}`);
if (c.draw != null) fields.push(`draw = ${c.draw}`);
if (c.drawUntilHandSize != null) fields.push(`drawUntilHandSize = ${c.drawUntilHandSize}`);
if (c.drawSkillBlock != null) fields.push(`drawSkillBlock = ${c.drawSkillBlock}`);
if (c.drawDamage != null) fields.push(`drawDamage = ${c.drawDamage}`);
if (c.drawPoison != null) fields.push(`drawPoison = ${c.drawPoison}`);
if (c.selfVuln != null) fields.push(`selfVuln = ${luaNum(c.selfVuln)}`);
if (c.draw != null) fields.push(`draw = ${luaNum(c.draw)}`);
if (c.drawUntilHandSize != null) fields.push(`drawUntilHandSize = ${luaNum(c.drawUntilHandSize)}`);
if (c.drawSkillBlock != null) fields.push(`drawSkillBlock = ${luaNum(c.drawSkillBlock)}`);
if (c.drawDamage != null) fields.push(`drawDamage = ${luaNum(c.drawDamage)}`);
if (c.drawPoison != null) fields.push(`drawPoison = ${luaNum(c.drawPoison)}`);
if (c.exhaustHandNonAttack === true) fields.push('exhaustHandNonAttack = true');
if (c.exhaustHandAll === true) fields.push('exhaustHandAll = true');
if (c.drawPerExhausted != null) fields.push(`drawPerExhausted = ${c.drawPerExhausted}`);
if (c.blockPerExhaustedCard != null) fields.push(`blockPerExhaustedCard = ${c.blockPerExhaustedCard}`);
if (c.addRandomCardCount != null) fields.push(`addRandomCardCount = ${c.addRandomCardCount}`);
if (c.addRandomCardPerExhausted != null) fields.push(`addRandomCardPerExhausted = ${c.addRandomCardPerExhausted}`);
if (c.drawPerExhausted != null) fields.push(`drawPerExhausted = ${luaNum(c.drawPerExhausted)}`);
if (c.blockPerExhaustedCard != null) fields.push(`blockPerExhaustedCard = ${luaNum(c.blockPerExhaustedCard)}`);
if (c.addRandomCardCount != null) fields.push(`addRandomCardCount = ${luaNum(c.addRandomCardCount)}`);
if (c.addRandomCardPerExhausted != null) fields.push(`addRandomCardPerExhausted = ${luaNum(c.addRandomCardPerExhausted)}`);
if (c.addRandomCardKind != null) fields.push(`addRandomCardKind = ${luaStr(c.addRandomCardKind)}`);
if (c.addRandomCardSameClass === true) fields.push('addRandomCardSameClass = true');
if (c.addedCardsCostZeroThisTurn === true) fields.push('addedCardsCostZeroThisTurn = true');
if (c.playTopDrawPileCount != null) fields.push(`playTopDrawPileCount = ${c.playTopDrawPileCount}`);
if (c.playTopDrawPileCountPerEnergy != null) fields.push(`playTopDrawPileCountPerEnergy = ${c.playTopDrawPileCountPerEnergy}`);
if (c.heal != null) fields.push(`heal = ${c.heal}`);
if (c.healPerHolyCharge != null) fields.push(`healPerHolyCharge = ${c.healPerHolyCharge}`);
if (c.gainEnergy != null) fields.push(`gainEnergy = ${c.gainEnergy}`);
if (c.comboGain != null) fields.push(`comboGain = ${c.comboGain}`);
if (c.playTopDrawPileCount != null) fields.push(`playTopDrawPileCount = ${luaNum(c.playTopDrawPileCount)}`);
if (c.playTopDrawPileCountPerEnergy != null) fields.push(`playTopDrawPileCountPerEnergy = ${luaNum(c.playTopDrawPileCountPerEnergy)}`);
if (c.heal != null) fields.push(`heal = ${luaNum(c.heal)}`);
if (c.healPerHolyCharge != null) fields.push(`healPerHolyCharge = ${luaNum(c.healPerHolyCharge)}`);
if (c.gainEnergy != null) fields.push(`gainEnergy = ${luaNum(c.gainEnergy)}`);
if (c.comboGain != null) fields.push(`comboGain = ${luaNum(c.comboGain)}`);
if (c.removePlayerDebuffs === true) fields.push('removePlayerDebuffs = true');
if (c.holyForce === true) fields.push('holyForce = true');
if (c.holyChargeGain != null) fields.push(`holyChargeGain = ${c.holyChargeGain}`);
if (c.blockPerHolyCharge != null) fields.push(`blockPerHolyCharge = ${c.blockPerHolyCharge}`);
if (c.holyChargeGain != null) fields.push(`holyChargeGain = ${luaNum(c.holyChargeGain)}`);
if (c.blockPerHolyCharge != null) fields.push(`blockPerHolyCharge = ${luaNum(c.blockPerHolyCharge)}`);
if (c.holyChargeSpendAll === true) fields.push('holyChargeSpendAll = true');
if (c.poison != null) fields.push(`poison = ${c.poison}`);
if (c.discard != null) fields.push(`discard = ${c.discard}`);
if (c.poison != null) fields.push(`poison = ${luaNum(c.poison)}`);
if (c.discard != null) fields.push(`discard = ${luaNum(c.discard)}`);
if (c.discardAll === true) fields.push('discardAll = true');
if (c.drawPerDiscarded != null) fields.push(`drawPerDiscarded = ${c.drawPerDiscarded}`);
if (c.addShiv != null) fields.push(`addShiv = ${c.addShiv}`);
if (c.turnStartShiv != null) fields.push(`turnStartShiv = ${c.turnStartShiv}`);
if (c.turnStartDraw != null) fields.push(`turnStartDraw = ${c.turnStartDraw}`);
if (c.turnStartDiscard != null) fields.push(`turnStartDiscard = ${c.turnStartDiscard}`);
if (c.drawPerDiscarded != null) fields.push(`drawPerDiscarded = ${luaNum(c.drawPerDiscarded)}`);
if (c.addShiv != null) fields.push(`addShiv = ${luaNum(c.addShiv)}`);
if (c.turnStartShiv != null) fields.push(`turnStartShiv = ${luaNum(c.turnStartShiv)}`);
if (c.turnStartDraw != null) fields.push(`turnStartDraw = ${luaNum(c.turnStartDraw)}`);
if (c.turnStartDiscard != null) fields.push(`turnStartDiscard = ${luaNum(c.turnStartDiscard)}`);
if (c.handCostZeroThisTurn === true) fields.push('handCostZeroThisTurn = true');
if (c.drawDisabledThisTurn === true) fields.push('drawDisabledThisTurn = true');
if (c.addShivPerDiscard === true) fields.push('addShivPerDiscard = true');
if (c.useAllEnergy === true) fields.push('useAllEnergy = true');
if (c.shivDamageBonus != null) fields.push(`shivDamageBonus = ${c.shivDamageBonus}`);
if (c.firstShivDamageBonus != null) fields.push(`firstShivDamageBonus = ${c.firstShivDamageBonus}`);
if (c.shivDamageBonus != null) fields.push(`shivDamageBonus = ${luaNum(c.shivDamageBonus)}`);
if (c.firstShivDamageBonus != null) fields.push(`firstShivDamageBonus = ${luaNum(c.firstShivDamageBonus)}`);
if (c.shivRetain === true) fields.push('shivRetain = true');
if (c.shivAoe === true) fields.push('shivAoe = true');
if (c.attackDamageVsWeakMultiplier != null) fields.push(`attackDamageVsWeakMultiplier = ${c.attackDamageVsWeakMultiplier}`);
if (c.poisonHits != null) fields.push(`poisonHits = ${c.poisonHits}`);
if (c.attackDamageVsWeakMultiplier != null) fields.push(`attackDamageVsWeakMultiplier = ${luaNum(c.attackDamageVsWeakMultiplier)}`);
if (c.poisonHits != null) fields.push(`poisonHits = ${luaNum(c.poisonHits)}`);
if (c.poisonRandomTargets === true) fields.push('poisonRandomTargets = true');
if (c.poisonIfTargetPoisoned === true) fields.push('poisonIfTargetPoisoned = true');
if (c.xDamagePerEnergy != null) fields.push(`xDamagePerEnergy = ${c.xDamagePerEnergy}`);
if (c.xWeakPerEnergy != null) fields.push(`xWeakPerEnergy = ${c.xWeakPerEnergy}`);
if (c.nextTurnBlock != null) fields.push(`nextTurnBlock = ${c.nextTurnBlock}`);
if (c.nextTurnDraw != null) fields.push(`nextTurnDraw = ${c.nextTurnDraw}`);
if (c.xDamagePerEnergy != null) fields.push(`xDamagePerEnergy = ${luaNum(c.xDamagePerEnergy)}`);
if (c.xWeakPerEnergy != null) fields.push(`xWeakPerEnergy = ${luaNum(c.xWeakPerEnergy)}`);
if (c.nextTurnBlock != null) fields.push(`nextTurnBlock = ${luaNum(c.nextTurnBlock)}`);
if (c.nextTurnDraw != null) fields.push(`nextTurnDraw = ${luaNum(c.nextTurnDraw)}`);
if (c.nextTurnKeepBlock === true) fields.push('nextTurnKeepBlock = true');
if (c.nextTurnAttackMultiplier != null) fields.push(`nextTurnAttackMultiplier = ${c.nextTurnAttackMultiplier}`);
if (c.nextTurnCopies != null) fields.push(`nextTurnCopies = ${c.nextTurnCopies}`);
if (c.nextTurnAttackMultiplier != null) fields.push(`nextTurnAttackMultiplier = ${luaNum(c.nextTurnAttackMultiplier)}`);
if (c.nextTurnCopies != null) fields.push(`nextTurnCopies = ${luaNum(c.nextTurnCopies)}`);
if (c.nextTurnSelectHandCard === true) fields.push('nextTurnSelectHandCard = true');
if (c.nextTurnSelectPrompt != null) fields.push(`nextTurnSelectPrompt = ${luaStr(c.nextTurnSelectPrompt)}`);
if (c.nextSkillRepeatCount != null) fields.push(`nextSkillRepeatCount = ${c.nextSkillRepeatCount}`);
if (c.nextSkillRepeatCount != null) fields.push(`nextSkillRepeatCount = ${luaNum(c.nextSkillRepeatCount)}`);
if (c.nextSkillCostZero === true) fields.push('nextSkillCostZero = true');
if (c.skillCostReductionThisTurn != null) fields.push(`skillCostReductionThisTurn = ${c.skillCostReductionThisTurn}`);
if (c.skillCostReductionThisTurn != null) fields.push(`skillCostReductionThisTurn = ${luaNum(c.skillCostReductionThisTurn)}`);
if (c.skillSlyOnPlay === true) fields.push('skillSlyOnPlay = true');
if (c.turnHandSlyCount != null) fields.push(`turnHandSlyCount = ${c.turnHandSlyCount}`);
if (c.combatCostReductionOnPlay != null) fields.push(`combatCostReductionOnPlay = ${c.combatCostReductionOnPlay}`);
if (c.turnHandSlyCount != null) fields.push(`turnHandSlyCount = ${luaNum(c.turnHandSlyCount)}`);
if (c.combatCostReductionOnPlay != null) fields.push(`combatCostReductionOnPlay = ${luaNum(c.combatCostReductionOnPlay)}`);
if (c.randomTargetEachHit === true) fields.push('randomTargetEachHit = true');
if (c.repeatOnKill === true) fields.push('repeatOnKill = true');
if (c.affectsAllEnemies === true) fields.push('affectsAllEnemies = true');
if (c.removeEnemyBlock === true) fields.push('removeEnemyBlock = true');
if (c.removeEnemyArtifact === true) fields.push('removeEnemyArtifact = true');
if (c.enemyStrengthLossThisTurn != null) fields.push(`enemyStrengthLossThisTurn = ${c.enemyStrengthLossThisTurn}`);
if (c.extraPoisonTicks != null) fields.push(`extraPoisonTicks = ${c.extraPoisonTicks}`);
if (c.poisonApplicationBurstEvery != null) fields.push(`poisonApplicationBurstEvery = ${c.poisonApplicationBurstEvery}`);
if (c.poisonApplicationBurstDamage != null) fields.push(`poisonApplicationBurstDamage = ${c.poisonApplicationBurstDamage}`);
if (c.enemyStrengthLossThisTurn != null) fields.push(`enemyStrengthLossThisTurn = ${luaNum(c.enemyStrengthLossThisTurn)}`);
if (c.extraPoisonTicks != null) fields.push(`extraPoisonTicks = ${luaNum(c.extraPoisonTicks)}`);
if (c.poisonApplicationBurstEvery != null) fields.push(`poisonApplicationBurstEvery = ${luaNum(c.poisonApplicationBurstEvery)}`);
if (c.poisonApplicationBurstDamage != null) fields.push(`poisonApplicationBurstDamage = ${luaNum(c.poisonApplicationBurstDamage)}`);
if (c.innate === true) fields.push('innate = true');
if (c.playableWhenDrawPileEmpty === true) fields.push('playableWhenDrawPileEmpty = true');
if (c.sly === true) fields.push('sly = true');
@@ -353,7 +359,7 @@ function luaCardsTable(cards) {
if (c.unplayable === true) fields.push('unplayable = true');
if (c.curse === true) fields.push('curse = true');
if (c.token === true) fields.push('token = true');
if (c.endTurnDamage != null) fields.push(`endTurnDamage = ${c.endTurnDamage}`);
if (c.endTurnDamage != null) fields.push(`endTurnDamage = ${luaNum(c.endTurnDamage)}`);
if (c.fx != null) fields.push(`fx = ${luaStr(c.fx)}`);
if (c.image != null) fields.push(`image = ${luaStr(c.image)}`);
return `\t${id} = { ${fields.join(', ')} },`;

View File

@@ -1539,7 +1539,7 @@
{
"id": "0e200005-0000-4000-8000-00000e200005",
"path": "/ui/DeckUIGroup/DeckAllHud/Grid",
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ScrollLayoutGroupComponent",
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ScrollLayoutGroupComponent,MOD.Core.UITouchReceiveComponent",
"jsonString": {
"name": "Grid",
"path": "/ui/DeckUIGroup/DeckAllHud/Grid",
@@ -1728,6 +1728,10 @@
"UseScroll": true,
"VerticalScrollBarDirection": 1,
"Enable": true
},
{
"@type": "MOD.Core.UITouchReceiveComponent",
"Enable": true
}
],
"@version": 1
@@ -106038,7 +106042,7 @@
{
"id": "0e100005-0000-4000-8000-00000e100005",
"path": "/ui/DeckUIGroup/DeckInspectHud/Grid",
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ScrollLayoutGroupComponent",
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ScrollLayoutGroupComponent,MOD.Core.UITouchReceiveComponent",
"jsonString": {
"name": "Grid",
"path": "/ui/DeckUIGroup/DeckInspectHud/Grid",
@@ -106227,6 +106231,10 @@
"UseScroll": true,
"VerticalScrollBarDirection": 1,
"Enable": true
},
{
"@type": "MOD.Core.UITouchReceiveComponent",
"Enable": true
}
],
"@version": 1

File diff suppressed because it is too large Load Diff

626
ui/ToolTipGroup.ui Normal file
View File

@@ -0,0 +1,626 @@
{
"Id": "",
"GameId": "",
"EntryKey": "ui://8208cc46-b682-444c-91a0-906bd01d39e1",
"ContentType": "x-mod/ui",
"Content": "",
"Usage": 0,
"UsePublish": 1,
"UseService": 0,
"CoreVersion": "26.5.0.0",
"StudioVersion": "0.1.0.0",
"DynamicLoading": 0,
"ContentProto": {
"Use": "Binary",
"Entities": [
{
"id": "8208cc46-b682-444c-91a0-906bd01d39e1",
"path": "/ui/ToolTipGroup",
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.UIGroupComponent,MOD.Core.CanvasGroupComponent",
"jsonString": {
"name": "ToolTipGroup",
"path": "/ui/ToolTipGroup",
"nameEditable": true,
"enable": true,
"visible": true,
"localize": true,
"displayOrder": 7,
"pathConstraints": "//",
"revision": 1,
"origin": {
"type": "Model",
"entry_id": "uigroup",
"sub_entity_id": null,
"root_entity_id": null,
"replaced_model_id": null
},
"modelId": "uigroup",
"@components": [
{
"@type": "MOD.Core.UITransformComponent",
"AlignmentOption": 15,
"AnchorsMax": {
"x": 1.0,
"y": 1.0
},
"AnchorsMin": {
"x": 0.0,
"y": 0.0
},
"MobileOnly": false,
"OffsetMax": {
"x": 0.0,
"y": 0.0
},
"OffsetMin": {
"x": 0.0,
"y": 0.0
},
"Pivot": {
"x": 0.5,
"y": 0.5
},
"RectSize": {
"x": 1920.0,
"y": 1080.0
},
"UIMode": 1,
"UIVersion": 2,
"anchoredPosition": {
"x": 0.0,
"y": 0.0
},
"Position": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"QuaternionRotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 1.0
},
"Enable": true
},
{
"@type": "MOD.Core.UIGroupComponent",
"DefaultShow": true,
"GroupOrder": 7,
"GroupType": 2,
"Enable": true
},
{
"@type": "MOD.Core.CanvasGroupComponent",
"Enable": true
}
],
"@version": 1
}
},
{
"id": "0cb0014a-0000-4000-8000-00000cb0014a",
"path": "/ui/ToolTipGroup/TooltipBox",
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent",
"jsonString": {
"name": "TooltipBox",
"path": "/ui/ToolTipGroup/TooltipBox",
"nameEditable": true,
"enable": false,
"visible": true,
"localize": true,
"displayOrder": 0,
"pathConstraints": "///",
"revision": 1,
"origin": {
"type": "Model",
"entry_id": "UISprite",
"sub_entity_id": null,
"root_entity_id": null,
"replaced_model_id": null
},
"modelId": "uisprite",
"@components": [
{
"@type": "MOD.Core.UITransformComponent",
"ActivePlatform": 255,
"AlignmentOption": 0,
"AnchorsMax": {
"x": 0.5,
"y": 0.5
},
"AnchorsMin": {
"x": 0.5,
"y": 0.5
},
"MobileOnly": false,
"OffsetMax": {
"x": 179.9999,
"y": 475.0001
},
"OffsetMin": {
"x": -180.0001,
"y": 325.0001
},
"Pivot": {
"x": 0.5,
"y": 0.5
},
"RectSize": {
"x": 360.0,
"y": 150.0
},
"UIMode": 1,
"UIScale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"UIVersion": 2,
"anchoredPosition": {
"x": -0.0001,
"y": 400.0001
},
"Rotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"Position": {
"x": -0.0001,
"y": 400.0001,
"z": 0.0
},
"QuaternionRotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": -1.0
},
"Scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"ZRotation": 0.0,
"Enable": true
},
{
"@type": "MOD.Core.SpriteGUIRendererComponent",
"AnimClipPlayType": 0,
"EndFrameIndex": 2147483647,
"ImageRUID": {
"DataId": ""
},
"LocalPosition": {
"x": 0.0,
"y": 0.0
},
"LocalScale": {
"x": 1.0,
"y": 1.0
},
"OverrideSorting": false,
"PlayRate": 1.0,
"PreserveSprite": 0,
"StartFrameIndex": 0,
"Color": {
"r": 0.04,
"g": 0.05,
"b": 0.08,
"a": 0.96
},
"DropShadow": false,
"DropShadowAngle": 30.0,
"DropShadowColor": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 0.72
},
"DropShadowDistance": 32.0,
"FillAmount": 1.0,
"FillCenter": true,
"FillClockWise": true,
"FillMethod": 0,
"FillOrigin": 0,
"FlipX": false,
"FlipY": false,
"FrameColumn": 1,
"FrameRate": 0,
"FrameRow": 1,
"Outline": false,
"OutlineColor": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 1.0
},
"OutlineWidth": 3.0,
"RaycastTarget": false,
"Type": 1,
"Enable": true
}
],
"@version": 1
}
},
{
"id": "0cb0014b-0000-4000-8000-00000cb0014b",
"path": "/ui/ToolTipGroup/TooltipBox/Name",
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
"jsonString": {
"name": "Name",
"path": "/ui/ToolTipGroup/TooltipBox/Name",
"nameEditable": true,
"enable": true,
"visible": true,
"localize": true,
"displayOrder": 0,
"pathConstraints": "////",
"revision": 1,
"origin": {
"type": "Model",
"entry_id": "UIText",
"sub_entity_id": null,
"root_entity_id": null,
"replaced_model_id": null
},
"modelId": "uitext",
"@components": [
{
"@type": "MOD.Core.UITransformComponent",
"ActivePlatform": 255,
"AlignmentOption": 0,
"AnchorsMax": {
"x": 0.5,
"y": 0.5
},
"AnchorsMin": {
"x": 0.5,
"y": 0.5
},
"MobileOnly": false,
"OffsetMax": {
"x": 166.0,
"y": 66.0
},
"OffsetMin": {
"x": -166.0,
"y": 38.0
},
"Pivot": {
"x": 0.5,
"y": 0.5
},
"RectSize": {
"x": 332.0,
"y": 28.0
},
"UIMode": 1,
"UIScale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"UIVersion": 2,
"anchoredPosition": {
"x": 0.0,
"y": 52.0
},
"Position": {
"x": 0.0,
"y": 52.0,
"z": 0.0
},
"QuaternionRotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 1.0
},
"Scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"Enable": true
},
{
"@type": "MOD.Core.SpriteGUIRendererComponent",
"AnimClipPlayType": 0,
"EndFrameIndex": 2147483647,
"ImageRUID": {
"DataId": ""
},
"LocalPosition": {
"x": 0.0,
"y": 0.0
},
"LocalScale": {
"x": 1.0,
"y": 1.0
},
"OverrideSorting": false,
"PlayRate": 1.0,
"PreserveSprite": 0,
"StartFrameIndex": 0,
"Color": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 0.0
},
"DropShadow": false,
"DropShadowAngle": 30.0,
"DropShadowColor": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 0.72
},
"DropShadowDistance": 32.0,
"FillAmount": 1.0,
"FillCenter": true,
"FillClockWise": true,
"FillMethod": 0,
"FillOrigin": 0,
"FlipX": false,
"FlipY": false,
"FrameColumn": 1,
"FrameRate": 0,
"FrameRow": 1,
"Outline": false,
"OutlineColor": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 1.0
},
"OutlineWidth": 3.0,
"RaycastTarget": false,
"Type": 1,
"Enable": true
},
{
"@type": "MOD.Core.TextComponent",
"Alignment": 4,
"Bold": true,
"DropShadow": false,
"DropShadowAngle": 30.0,
"DropShadowColor": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 0.72
},
"DropShadowDistance": 32.0,
"Font": 0,
"FontColor": {
"r": 0.94,
"g": 0.74,
"b": 0.26,
"a": 1.0
},
"FontSize": 19,
"MaxSize": 19,
"MinSize": 8,
"OutlineColor": {
"r": 0.08,
"g": 0.08,
"b": 0.08,
"a": 1.0
},
"OutlineDistance": {
"x": 1.0,
"y": -1.0
},
"OutlineWidth": 1.0,
"Overflow": 0,
"OverrideSorting": false,
"Padding": {
"left": 0,
"right": 0,
"top": 0,
"bottom": 0
},
"SizeFit": false,
"Text": "",
"UseOutLine": true,
"Enable": true
}
],
"@version": 1
}
},
{
"id": "0cb0014c-0000-4000-8000-00000cb0014c",
"path": "/ui/ToolTipGroup/TooltipBox/Desc",
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
"jsonString": {
"name": "Desc",
"path": "/ui/ToolTipGroup/TooltipBox/Desc",
"nameEditable": true,
"enable": true,
"visible": true,
"localize": true,
"displayOrder": 1,
"pathConstraints": "////",
"revision": 1,
"origin": {
"type": "Model",
"entry_id": "UIText",
"sub_entity_id": null,
"root_entity_id": null,
"replaced_model_id": null
},
"modelId": "uitext",
"@components": [
{
"@type": "MOD.Core.UITransformComponent",
"ActivePlatform": 255,
"AlignmentOption": 0,
"AnchorsMax": {
"x": 0.5,
"y": 0.5
},
"AnchorsMin": {
"x": 0.5,
"y": 0.5
},
"MobileOnly": false,
"OffsetMax": {
"x": 166.0,
"y": 33.0
},
"OffsetMin": {
"x": -166.0,
"y": -69.0
},
"Pivot": {
"x": 0.5,
"y": 0.5
},
"RectSize": {
"x": 332.0,
"y": 102.0
},
"UIMode": 1,
"UIScale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"UIVersion": 2,
"anchoredPosition": {
"x": 0.0,
"y": -18.0
},
"Position": {
"x": 0.0,
"y": -18.0,
"z": 0.0
},
"QuaternionRotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 1.0
},
"Scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"Enable": true
},
{
"@type": "MOD.Core.SpriteGUIRendererComponent",
"AnimClipPlayType": 0,
"EndFrameIndex": 2147483647,
"ImageRUID": {
"DataId": ""
},
"LocalPosition": {
"x": 0.0,
"y": 0.0
},
"LocalScale": {
"x": 1.0,
"y": 1.0
},
"OverrideSorting": false,
"PlayRate": 1.0,
"PreserveSprite": 0,
"StartFrameIndex": 0,
"Color": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 0.0
},
"DropShadow": false,
"DropShadowAngle": 30.0,
"DropShadowColor": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 0.72
},
"DropShadowDistance": 32.0,
"FillAmount": 1.0,
"FillCenter": true,
"FillClockWise": true,
"FillMethod": 0,
"FillOrigin": 0,
"FlipX": false,
"FlipY": false,
"FrameColumn": 1,
"FrameRate": 0,
"FrameRow": 1,
"Outline": false,
"OutlineColor": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 1.0
},
"OutlineWidth": 3.0,
"RaycastTarget": false,
"Type": 1,
"Enable": true
},
{
"@type": "MOD.Core.TextComponent",
"Alignment": 0,
"Bold": false,
"DropShadow": false,
"DropShadowAngle": 30.0,
"DropShadowColor": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 0.72
},
"DropShadowDistance": 32.0,
"Font": 0,
"FontColor": {
"r": 0.92,
"g": 0.92,
"b": 0.95,
"a": 1.0
},
"FontSize": 15,
"MaxSize": 15,
"MinSize": 8,
"OutlineColor": {
"r": 0.08,
"g": 0.08,
"b": 0.08,
"a": 1.0
},
"OutlineDistance": {
"x": 1.0,
"y": -1.0
},
"OutlineWidth": 1.0,
"Overflow": 0,
"OverrideSorting": false,
"Padding": {
"left": 0,
"right": 0,
"top": 0,
"bottom": 0
},
"SizeFit": false,
"Text": "",
"UseOutLine": true,
"Enable": true
}
],
"@version": 1
}
}
]
}
}