Enhancement (#296)

1. 主动技prompt修复
2. 没有player时点击手牌区不会报错
3. 修复一些翻译
4. 修复客户端buddy失去手牌
This commit is contained in:
Nyutanislavsky 2023-12-12 19:07:49 +08:00 committed by GitHub
parent d6cc608723
commit 8710c1f14f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 8 deletions

View File

@ -479,8 +479,6 @@ Item {
onCardSelected: function(card) {
Logic.enableTargets(card);
roomScene.resetPrompt();
if (typeof card === "number" && card !== -1 && roomScene.state === "playing"
&& JSON.parse(Backend.callLuaFunction("GetPlayerHandcards", [Self.id])).includes(card)) {

View File

@ -267,6 +267,7 @@ RowLayout {
} else {
handcardAreaItem.unselectAll();
selected_card = -1;
roomScene.resetPrompt();
}
cardSelected(selected_card);
}

View File

@ -109,8 +109,8 @@ function Client:moveCards(moves)
pcardMax = from:getMaxCards(),
id = move.from,
})
if from.id ~= Self.id and move.fromArea == Card.PlayerHand then
for i = 1, #move.ids do
if move.fromArea == Card.PlayerHand and not Self:isBuddy(self:getPlayerById(move.from)) then
for _ = 1, #move.ids do
table.remove(from.player_cards[Player.Hand])
end
else

View File

@ -613,7 +613,7 @@ end
function GetPlayerHandcards(pid)
local c = ClientInstance
local p = c:getPlayerById(pid)
return json.encode(p.player_cards[Player.Hand])
return p and json.encode(p.player_cards[Player.Hand]) or ""
end
function GetPlayerEquips(pid)

View File

@ -4,11 +4,14 @@
local FilterSkill = StatusSkill:subclass("FilterSkill")
---@param card Card
---@param player Player
---@param isJudgeEvent bool
function FilterSkill:cardFilter(card, player, isJudgeEvent)
return false
end
---@param card Card
---@param player Player
---@return Card
function FilterSkill:viewAs(card, player)
return nil

View File

@ -227,7 +227,7 @@ end
---@field public pattern? string
---@field public enabled_at_play? fun(self: ViewAsSkill, player: Player): boolean?
---@field public enabled_at_response? fun(self: ViewAsSkill, player: Player, response: boolean): boolean?
---@field public before_use? fun(self: ViewAsSkill, player: ServerPlayer, use: CardUseStruct)
---@field public before_use? fun(self: ViewAsSkill, player: ServerPlayer, use: CardUseStruct): string?
---@field public prompt? string|fun(self: ActiveSkill, selected: integer[], selected_cards: integer[]): string
---@param spec ViewAsSkillSpec
@ -396,7 +396,7 @@ function fk.CreateTargetModSkill(spec)
end
---@class FilterSpec: StatusSkillSpec
---@field public card_filter? fun(self: FilterSkill, card: Card, player: Player): boolean?
---@field public card_filter? fun(self: FilterSkill, card: Card, player: Player, isJudgeEvent: boolean): boolean?
---@field public view_as? fun(self: FilterSkill, card: Card, player: Player): Card?
---@param spec FilterSpec

View File

@ -14,7 +14,7 @@ Fk:loadTranslationTable({
-- ["club"] = "Club",
-- ["diamond"] = "Diamond",
["nosuit"] = "No suit",
["black"] = '<font color="black">黑色</font>',
["black"] = '<font color="black">Black</font>',
["red"] = '<font color="#CC3131">Red</font>',
["nocolor"] = '<font color="grey">NoColor</font>',
-- ["suit"] = "花色",
@ -122,6 +122,7 @@ Fk:loadTranslationTable({
["qinggang_sword"] = "Qinggang Sword",
[":qinggang_sword"] = "Qinggang Sword (equip card, weapon)<br /><b>ATK range</b>: 2<br /><b>Weapon skill</b>: Your Slash ignores the target's armor.",
["#qinggang_sword_skill"] = "Qinggang Sword",
["ice_sword"] = "Ice Sword",
[":ice_sword"] = "Ice Sword (equip card, weapon)<br /><b>ATK range</b>: 2<br /><b>Weapon skill</b>: When your used Slash is about to cause DMG to a player who has cards, you can prevent this DMG and discard him 2 cards successively.",

View File

@ -122,6 +122,7 @@ Fk:loadTranslationTable{
["qinggang_sword"] = "青釭剑",
[":qinggang_sword"] = "装备牌·武器<br /><b>攻击范围</b><br /><b>武器技能</b>:锁定技,你的【杀】无视目标角色的防具。",
["#qinggang_sword_skill"] = "青釭剑",
["ice_sword"] = "寒冰剑",
[":ice_sword"] = "装备牌·武器<br /><b>攻击范围</b><br /><b>武器技能</b>:当你使用【杀】对目标角色造成伤害时,若该角色有牌,你可以防止此伤害,然后依次弃置其两张牌。",