1、给carditem增加dragging参数;
2、filterskill在mute的情况下不播放技能特效;
3、给ActiveSkill增加no_indicate参数
4、回合开始时、结束时这两个时机当前回合角色的phase设置为Player.None
5、给usecard增加noIndicate参数
This commit is contained in:
xxyheaven 2024-04-07 00:21:15 +08:00 committed by GitHub
parent e959c649f1
commit 873d68363c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 35 additions and 22 deletions

View File

@ -62,6 +62,7 @@ Item {
property alias goBackAnim: goBackAnimation property alias goBackAnim: goBackAnimation
property int goBackDuration: 500 property int goBackDuration: 500
property bool busy: false // whether there is a running emotion on the card property bool busy: false // whether there is a running emotion on the card
property alias dragging: drag.active
signal toggleDiscards() signal toggleDiscards()
signal clicked() signal clicked()
@ -278,6 +279,7 @@ Item {
} }
DragHandler { DragHandler {
id: drag
enabled: draggable enabled: draggable
grabPermissions: PointHandler.TakeOverForbidden grabPermissions: PointHandler.TakeOverForbidden
xAxis.enabled: true xAxis.enabled: true

View File

@ -602,12 +602,12 @@ function Engine:filterCard(id, player, data)
if modify and RoomInstance then if modify and RoomInstance then
if not f.mute then if not f.mute then
player:broadcastSkillInvoke(f.name) player:broadcastSkillInvoke(f.name)
end
RoomInstance:doAnimate("InvokeSkill", { RoomInstance:doAnimate("InvokeSkill", {
name = f.name, name = f.name,
player = player.id, player = player.id,
skill_type = f.anim_type, skill_type = f.anim_type,
}) })
end
RoomInstance:sendLog{ RoomInstance:sendLog{
type = "#FilterCard", type = "#FilterCard",
arg = f.name, arg = f.name,

View File

@ -9,6 +9,7 @@
---@field public frequency Frequency @ 技能发动的频繁程度通常compulsory锁定技及limited限定技用的多。 ---@field public frequency Frequency @ 技能发动的频繁程度通常compulsory锁定技及limited限定技用的多。
---@field public visible boolean @ 技能是否会显示在游戏中 ---@field public visible boolean @ 技能是否会显示在游戏中
---@field public mute boolean @ 决定是否关闭技能配音 ---@field public mute boolean @ 决定是否关闭技能配音
---@field public no_indicate boolean @ 决定是否关闭技能指示线
---@field public global boolean @ 决定是否是全局技能 ---@field public global boolean @ 决定是否是全局技能
---@field public anim_type string @ 技能类型定义 ---@field public anim_type string @ 技能类型定义
---@field public related_skills Skill[] @ 和本技能相关的其他技能,有时候一个技能实际上是通过好几个技能拼接而实现的。 ---@field public related_skills Skill[] @ 和本技能相关的其他技能,有时候一个技能实际上是通过好几个技能拼接而实现的。
@ -41,6 +42,7 @@ function Skill:initialize(name, frequency)
self.lordSkill = false self.lordSkill = false
self.cardSkill = false self.cardSkill = false
self.mute = false self.mute = false
self.no_indicate = false
self.anim_type = "" self.anim_type = ""
self.related_skills = {} self.related_skills = {}
self.attachedKingdom = {} self.attachedKingdom = {}

View File

@ -27,6 +27,7 @@ _, Weapon, Armor, DefensiveRide, OffensiveRide, Treasure = table.unpack(Equip)
local function readCommonSpecToSkill(skill, spec) local function readCommonSpecToSkill(skill, spec)
skill.mute = spec.mute skill.mute = spec.mute
skill.no_indicate = spec.no_indicate
skill.anim_type = spec.anim_type skill.anim_type = spec.anim_type
if spec.attached_equip then if spec.attached_equip then

View File

@ -226,9 +226,8 @@ end
GameEvent.functions[GameEvent.Turn] = function(self) GameEvent.functions[GameEvent.Turn] = function(self)
local room = self.room local room = self.room
local logic = room.logic room.current.phase = Player.PhaseNone
room.logic:trigger(fk.TurnStart, room.current)
logic:trigger(fk.TurnStart, room.current)
room.current:play() room.current:play()
end end
@ -251,8 +250,10 @@ GameEvent.cleaners[GameEvent.Turn] = function(self)
current.skipped_phases = {} current.skipped_phases = {}
end end
current.phase = Player.PhaseNone
logic:trigger(fk.TurnEnd, current, nil, self.interrupted) logic:trigger(fk.TurnEnd, current, nil, self.interrupted)
logic:trigger(fk.AfterTurnEnd, current, nil, self.interrupted) logic:trigger(fk.AfterTurnEnd, current, nil, self.interrupted)
current.phase = Player.NotActive
for _, p in ipairs(room.players) do for _, p in ipairs(room.players) do
p:setCardUseHistory("", 0, Player.HistoryTurn) p:setCardUseHistory("", 0, Player.HistoryTurn)

View File

@ -48,20 +48,23 @@ local sendCardEmotionAndLog = function(room, cardUseEvent)
---[[ ---[[
if not _card:isVirtual() then if not _card:isVirtual() then
local temp = { card = _card } local temp = { card = _card }
Fk:filterCard(_card.id, room:getPlayerById(from), temp) Fk:filterCard(_card.id, room:getCardOwner(_card), temp)
card = temp.card card = temp.card
end end
cardUseEvent.card = card cardUseEvent.card = card
--]] --]]
playCardEmotionAndSound(room, room:getPlayerById(from), card) playCardEmotionAndSound(room, room:getPlayerById(from), card)
if not cardUseEvent.noIndicate then
room:doAnimate("Indicate", { room:doAnimate("Indicate", {
from = from, from = from,
to = cardUseEvent.tos or Util.DummyTable, to = cardUseEvent.tos or Util.DummyTable,
}) })
end
local useCardIds = card:isVirtual() and card.subcards or { card.id } local useCardIds = card:isVirtual() and card.subcards or { card.id }
if cardUseEvent.tos and #cardUseEvent.tos > 0 then if cardUseEvent.tos and #cardUseEvent.tos > 0 and not cardUseEvent.noIndicate then
local to = {} local to = {}
for _, t in ipairs(cardUseEvent.tos) do for _, t in ipairs(cardUseEvent.tos) do
table.insert(to, t[1]) table.insert(to, t[1])
@ -182,18 +185,18 @@ GameEvent.functions[GameEvent.UseCard] = function(self)
cardUseEvent.card.skill:onUse(room, cardUseEvent) cardUseEvent.card.skill:onUse(room, cardUseEvent)
end end
local _card = sendCardEmotionAndLog(room, cardUseEvent)
if logic:trigger(fk.PreCardUse, room:getPlayerById(cardUseEvent.from), cardUseEvent) then if logic:trigger(fk.PreCardUse, room:getPlayerById(cardUseEvent.from), cardUseEvent) then
logic:breakEvent() logic:breakEvent()
end end
local _card = sendCardEmotionAndLog(room, cardUseEvent)
room:moveCardTo(cardUseEvent.card, Card.Processing, nil, fk.ReasonUse) room:moveCardTo(cardUseEvent.card, Card.Processing, nil, fk.ReasonUse)
local card = cardUseEvent.card local card = cardUseEvent.card
local useCardIds = card:isVirtual() and card.subcards or { card.id } local useCardIds = card:isVirtual() and card.subcards or { card.id }
if #useCardIds > 0 then if #useCardIds > 0 then
if cardUseEvent.tos and #cardUseEvent.tos > 0 and #cardUseEvent.tos <= 2 then if cardUseEvent.tos and #cardUseEvent.tos > 0 and #cardUseEvent.tos <= 2 and not cardUseEvent.noIndicate then
local tos = table.map(cardUseEvent.tos, function(e) return e[1] end) local tos = table.map(cardUseEvent.tos, function(e) return e[1] end)
room:sendFootnote(useCardIds, { room:sendFootnote(useCardIds, {
type = "##UseCardTo", type = "##UseCardTo",
@ -255,6 +258,11 @@ GameEvent.functions[GameEvent.RespondCard] = function(self)
local cardResponseEvent = table.unpack(self.data) local cardResponseEvent = table.unpack(self.data)
local room = self.room local room = self.room
local logic = room.logic local logic = room.logic
if logic:trigger(fk.PreCardRespond, room:getPlayerById(cardResponseEvent.from), cardResponseEvent) then
logic:breakEvent()
end
local from = cardResponseEvent.customFrom or cardResponseEvent.from local from = cardResponseEvent.customFrom or cardResponseEvent.from
local card = cardResponseEvent.card local card = cardResponseEvent.card
local cardIds = room:getSubcardsByRule(card) local cardIds = room:getSubcardsByRule(card)
@ -284,10 +292,6 @@ GameEvent.functions[GameEvent.RespondCard] = function(self)
playCardEmotionAndSound(room, room:getPlayerById(from), card) playCardEmotionAndSound(room, room:getPlayerById(from), card)
if logic:trigger(fk.PreCardRespond, room:getPlayerById(cardResponseEvent.from), cardResponseEvent) then
logic:breakEvent()
end
room:moveCardTo(card, Card.Processing, nil, fk.ReasonResonpse) room:moveCardTo(card, Card.Processing, nil, fk.ReasonResonpse)
if #cardIds > 0 then if #cardIds > 0 then
room:sendFootnote(cardIds, { room:sendFootnote(cardIds, {

View File

@ -2083,7 +2083,9 @@ function Room:handleUseCardReply(player, data)
if skill.interaction then skill.interaction.data = data.interaction_data end if skill.interaction then skill.interaction.data = data.interaction_data end
if skill:isInstanceOf(ActiveSkill) then if skill:isInstanceOf(ActiveSkill) then
self:useSkill(player, skill, function() self:useSkill(player, skill, function()
if not skill.no_indicate then
self:doIndicate(player.id, targets) self:doIndicate(player.id, targets)
end
skill:onUse(self, { skill:onUse(self, {
from = player.id, from = player.id,
cards = selected_cards, cards = selected_cards,

View File

@ -115,6 +115,7 @@ fk.IceDamage = 4
---@field public prohibitedCardNames? string[] ---@field public prohibitedCardNames? string[]
---@field public damageDealt? table<PlayerId, number> ---@field public damageDealt? table<PlayerId, number>
---@field public additionalEffect? integer ---@field public additionalEffect? integer
---@field public noIndicate? boolean
---@class AimStruct ---@class AimStruct
---@field public from integer ---@field public from integer