전투 카드 대상 표시 개선
This commit is contained in:
@@ -165,16 +165,58 @@ for i = 1, #self.Monsters do
|
||||
end
|
||||
end
|
||||
return best`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'touchPoint' }], 0, 'number'),
|
||||
method('RenderTargetFrames', `local dragActive = self.DragTargetIndex ~= nil and self.DragTargetIndex > 0
|
||||
local shownTarget = self.TargetIndex
|
||||
if dragActive == true then shownTarget = self.DragTargetIndex end
|
||||
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" .. self:IntStr(i) .. "/TargetMarker", active and dragActive)
|
||||
self:SetEntityEnabled("/ui/RunUIGroup/CombatHud/MonsterStatus" .. self:IntStr(i) .. "/TargetMarker/Label", active and dragActive)
|
||||
end`),
|
||||
method('GetCardTargetMode', `if card == nil then
|
||||
return "none"
|
||||
end
|
||||
local shivAoe = card.class == "shiv" and (self.ShivAoeThisCombat == true or self:HasPowerField("shivAoe") == true)
|
||||
if card.aoe == true or card.affectsAllEnemies == true or shivAoe then
|
||||
return "all"
|
||||
end
|
||||
if card.kind == "Attack" then
|
||||
return "single"
|
||||
end
|
||||
if card.weak ~= nil or card.vuln ~= nil or card.poison ~= nil or card.xWeakPerEnergy ~= nil or card.removeEnemyBlock == true or card.removeEnemyArtifact == true or (card.enemyStrengthLossThisTurn ~= nil and card.enemyStrengthLossThisTurn > 0) then
|
||||
return "single"
|
||||
end
|
||||
return "player"`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'card' }]),
|
||||
method('GetDragTargetMode', `if self.DragSlot == nil or self.DragSlot <= 0 or self.Hand == nil or self.Cards == nil then
|
||||
return "none"
|
||||
end
|
||||
return self:GetCardTargetMode(self.Cards[self.Hand[self.DragSlot]])`),
|
||||
method('RenderPlayerTargetPreview', `local panel = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/PlayerPanel")
|
||||
if panel ~= nil and panel.UITransformComponent ~= nil then
|
||||
if active == true then
|
||||
panel.UITransformComponent.UIScale = Vector3(1.06, 1.06, 1)
|
||||
else
|
||||
panel.UITransformComponent.UIScale = Vector3(1, 1, 1)
|
||||
end
|
||||
end
|
||||
local name = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/PlayerPanel/Name")
|
||||
if name ~= nil and name.TextComponent ~= nil then
|
||||
if active == true then
|
||||
name.TextComponent.FontColor = Color(1, 0.84, 0.3, 1)
|
||||
else
|
||||
name.TextComponent.FontColor = Color(1, 1, 1, 1)
|
||||
end
|
||||
end
|
||||
local marker = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/PlayerTargetMarker")
|
||||
local player = _UserService.LocalPlayer
|
||||
if active == true and marker ~= nil and player ~= nil and player.TransformComponent ~= nil then
|
||||
if marker.SpriteGUIRendererComponent ~= nil then
|
||||
marker.SpriteGUIRendererComponent.ImageRUID = "f86110df71ce48dbbcbc8d38bd1076ad"
|
||||
marker.SpriteGUIRendererComponent.AnimClipPlayType = SpriteAnimClipPlayType.Loop
|
||||
marker.SpriteGUIRendererComponent.PlayRate = 1
|
||||
end
|
||||
if marker.UITransformComponent ~= nil then
|
||||
local worldPos = player.TransformComponent.WorldPosition
|
||||
local screenPos = _UILogic:WorldToScreenPosition(Vector2(worldPos.x, worldPos.y + 1.15))
|
||||
marker.UITransformComponent.anchoredPosition = _UILogic:ScreenToUIPosition(screenPos)
|
||||
end
|
||||
marker.Enable = true
|
||||
elseif marker ~= nil then
|
||||
marker.Enable = false
|
||||
end`, [{ Type: 'boolean', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'active' }]),
|
||||
method('RenderTargetFrames', `self:RenderCombat()`),
|
||||
method('OnCardDragBegin', `if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then
|
||||
return
|
||||
end
|
||||
@@ -194,13 +236,16 @@ for i = 1, 10 do
|
||||
end
|
||||
self.DragSlot = slot
|
||||
self.DragTargetIndex = 0
|
||||
self.DragCanPlay = false
|
||||
self:RenderTargetFrames()`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }]),
|
||||
method('OnCardDrag', `if self.DragSlot ~= slot then
|
||||
return
|
||||
end
|
||||
local oldTarget = self.DragTargetIndex
|
||||
local oldCanPlay = self.DragCanPlay
|
||||
local ui = _UILogic:ScreenToUIPosition(touchPoint)
|
||||
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)
|
||||
end
|
||||
local cardId = self.Hand[slot]
|
||||
@@ -210,8 +255,13 @@ if c ~= nil and c.kind == "Attack" then
|
||||
local best = self:FindMonsterAtTouch(touchPoint)
|
||||
if best ~= self.DragTargetIndex then
|
||||
self.DragTargetIndex = best
|
||||
self:RenderTargetFrames()
|
||||
end
|
||||
self.DragCanPlay = self.DragTargetIndex > 0
|
||||
else
|
||||
self.DragCanPlay = ui.y > -180
|
||||
end
|
||||
if oldTarget ~= self.DragTargetIndex or oldCanPlay ~= self.DragCanPlay then
|
||||
self:RenderTargetFrames()
|
||||
end`, [
|
||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' },
|
||||
{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'touchPoint' },
|
||||
@@ -220,6 +270,7 @@ end`, [
|
||||
return
|
||||
end
|
||||
self.DragSlot = 0
|
||||
self.DragCanPlay = false
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user