mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
fix bug (#337)
1、给carditem增加dragging参数; 2、filterskill在mute的情况下不播放技能特效; 3、给ActiveSkill增加no_indicate参数 4、回合开始时、结束时这两个时机当前回合角色的phase设置为Player.None 5、给usecard增加noIndicate参数
This commit is contained in:
parent
e959c649f1
commit
873d68363c
|
@ -62,6 +62,7 @@ Item {
|
|||
property alias goBackAnim: goBackAnimation
|
||||
property int goBackDuration: 500
|
||||
property bool busy: false // whether there is a running emotion on the card
|
||||
property alias dragging: drag.active
|
||||
|
||||
signal toggleDiscards()
|
||||
signal clicked()
|
||||
|
@ -278,6 +279,7 @@ Item {
|
|||
}
|
||||
|
||||
DragHandler {
|
||||
id: drag
|
||||
enabled: draggable
|
||||
grabPermissions: PointHandler.TakeOverForbidden
|
||||
xAxis.enabled: true
|
||||
|
|
|
@ -602,12 +602,12 @@ function Engine:filterCard(id, player, data)
|
|||
if modify and RoomInstance then
|
||||
if not f.mute then
|
||||
player:broadcastSkillInvoke(f.name)
|
||||
RoomInstance:doAnimate("InvokeSkill", {
|
||||
name = f.name,
|
||||
player = player.id,
|
||||
skill_type = f.anim_type,
|
||||
})
|
||||
end
|
||||
RoomInstance:doAnimate("InvokeSkill", {
|
||||
name = f.name,
|
||||
player = player.id,
|
||||
skill_type = f.anim_type,
|
||||
})
|
||||
RoomInstance:sendLog{
|
||||
type = "#FilterCard",
|
||||
arg = f.name,
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
---@field public frequency Frequency @ 技能发动的频繁程度,通常compulsory(锁定技)及limited(限定技)用的多。
|
||||
---@field public visible boolean @ 技能是否会显示在游戏中
|
||||
---@field public mute boolean @ 决定是否关闭技能配音
|
||||
---@field public no_indicate boolean @ 决定是否关闭技能指示线
|
||||
---@field public global boolean @ 决定是否是全局技能
|
||||
---@field public anim_type string @ 技能类型定义
|
||||
---@field public related_skills Skill[] @ 和本技能相关的其他技能,有时候一个技能实际上是通过好几个技能拼接而实现的。
|
||||
|
@ -41,6 +42,7 @@ function Skill:initialize(name, frequency)
|
|||
self.lordSkill = false
|
||||
self.cardSkill = false
|
||||
self.mute = false
|
||||
self.no_indicate = false
|
||||
self.anim_type = ""
|
||||
self.related_skills = {}
|
||||
self.attachedKingdom = {}
|
||||
|
|
|
@ -27,6 +27,7 @@ _, Weapon, Armor, DefensiveRide, OffensiveRide, Treasure = table.unpack(Equip)
|
|||
|
||||
local function readCommonSpecToSkill(skill, spec)
|
||||
skill.mute = spec.mute
|
||||
skill.no_indicate = spec.no_indicate
|
||||
skill.anim_type = spec.anim_type
|
||||
|
||||
if spec.attached_equip then
|
||||
|
|
|
@ -226,9 +226,8 @@ end
|
|||
|
||||
GameEvent.functions[GameEvent.Turn] = function(self)
|
||||
local room = self.room
|
||||
local logic = room.logic
|
||||
|
||||
logic:trigger(fk.TurnStart, room.current)
|
||||
room.current.phase = Player.PhaseNone
|
||||
room.logic:trigger(fk.TurnStart, room.current)
|
||||
room.current:play()
|
||||
end
|
||||
|
||||
|
@ -251,8 +250,10 @@ GameEvent.cleaners[GameEvent.Turn] = function(self)
|
|||
current.skipped_phases = {}
|
||||
end
|
||||
|
||||
current.phase = Player.PhaseNone
|
||||
logic:trigger(fk.TurnEnd, current, nil, self.interrupted)
|
||||
logic:trigger(fk.AfterTurnEnd, current, nil, self.interrupted)
|
||||
current.phase = Player.NotActive
|
||||
|
||||
for _, p in ipairs(room.players) do
|
||||
p:setCardUseHistory("", 0, Player.HistoryTurn)
|
||||
|
|
|
@ -48,20 +48,23 @@ local sendCardEmotionAndLog = function(room, cardUseEvent)
|
|||
---[[
|
||||
if not _card:isVirtual() then
|
||||
local temp = { card = _card }
|
||||
Fk:filterCard(_card.id, room:getPlayerById(from), temp)
|
||||
Fk:filterCard(_card.id, room:getCardOwner(_card), temp)
|
||||
card = temp.card
|
||||
end
|
||||
cardUseEvent.card = card
|
||||
--]]
|
||||
|
||||
playCardEmotionAndSound(room, room:getPlayerById(from), card)
|
||||
room:doAnimate("Indicate", {
|
||||
from = from,
|
||||
to = cardUseEvent.tos or Util.DummyTable,
|
||||
})
|
||||
|
||||
if not cardUseEvent.noIndicate then
|
||||
room:doAnimate("Indicate", {
|
||||
from = from,
|
||||
to = cardUseEvent.tos or Util.DummyTable,
|
||||
})
|
||||
end
|
||||
|
||||
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 = {}
|
||||
for _, t in ipairs(cardUseEvent.tos) do
|
||||
table.insert(to, t[1])
|
||||
|
@ -182,18 +185,18 @@ GameEvent.functions[GameEvent.UseCard] = function(self)
|
|||
cardUseEvent.card.skill:onUse(room, cardUseEvent)
|
||||
end
|
||||
|
||||
local _card = sendCardEmotionAndLog(room, cardUseEvent)
|
||||
|
||||
if logic:trigger(fk.PreCardUse, room:getPlayerById(cardUseEvent.from), cardUseEvent) then
|
||||
logic:breakEvent()
|
||||
end
|
||||
|
||||
local _card = sendCardEmotionAndLog(room, cardUseEvent)
|
||||
|
||||
room:moveCardTo(cardUseEvent.card, Card.Processing, nil, fk.ReasonUse)
|
||||
|
||||
local card = cardUseEvent.card
|
||||
local useCardIds = card:isVirtual() and card.subcards or { card.id }
|
||||
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)
|
||||
room:sendFootnote(useCardIds, {
|
||||
type = "##UseCardTo",
|
||||
|
@ -255,6 +258,11 @@ GameEvent.functions[GameEvent.RespondCard] = function(self)
|
|||
local cardResponseEvent = table.unpack(self.data)
|
||||
local room = self.room
|
||||
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 card = cardResponseEvent.card
|
||||
local cardIds = room:getSubcardsByRule(card)
|
||||
|
@ -284,10 +292,6 @@ GameEvent.functions[GameEvent.RespondCard] = function(self)
|
|||
|
||||
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)
|
||||
if #cardIds > 0 then
|
||||
room:sendFootnote(cardIds, {
|
||||
|
|
|
@ -2083,7 +2083,9 @@ function Room:handleUseCardReply(player, data)
|
|||
if skill.interaction then skill.interaction.data = data.interaction_data end
|
||||
if skill:isInstanceOf(ActiveSkill) then
|
||||
self:useSkill(player, skill, function()
|
||||
self:doIndicate(player.id, targets)
|
||||
if not skill.no_indicate then
|
||||
self:doIndicate(player.id, targets)
|
||||
end
|
||||
skill:onUse(self, {
|
||||
from = player.id,
|
||||
cards = selected_cards,
|
||||
|
|
|
@ -115,6 +115,7 @@ fk.IceDamage = 4
|
|||
---@field public prohibitedCardNames? string[]
|
||||
---@field public damageDealt? table<PlayerId, number>
|
||||
---@field public additionalEffect? integer
|
||||
---@field public noIndicate? boolean
|
||||
|
||||
---@class AimStruct
|
||||
---@field public from integer
|
||||
|
|
Loading…
Reference in New Issue
Block a user