mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-15 19:22:25 +08:00
Enhance (#338)
1. 国战选将框动态显示珠联璧合(等待更清晰的图…) 2. 废除和恢复区域log 3. 搬运isMale,isFemale,compareDistance,hasShownSkill 4. hasSkill如果是状态技,判断是否亮出,未亮出的返回false 5. 标准包调整,修复八卦阵,离间结姻用isMale 6. 亮将技能改用&后缀并详细化prompt 7. 拼点移动起点改为owner 8. 使用牌filter改为owner --------- Co-authored-by: notify <notify-ctrl@qq.com>
This commit is contained in:
parent
1a4da186d2
commit
30e33f92c7
|
@ -954,7 +954,7 @@ callbacks["AskForGeneral"] = (jsonData) => {
|
||||||
});
|
});
|
||||||
box.choiceNum = n;
|
box.choiceNum = n;
|
||||||
box.convertDisabled = !!convert;
|
box.convertDisabled = !!convert;
|
||||||
box.needSameKingdom = !!heg;
|
box.hegemony = !!heg;
|
||||||
for (let i = 0; i < generals.length; i++)
|
for (let i = 0; i < generals.length; i++)
|
||||||
box.generalList.append({ "name": generals[i] });
|
box.generalList.append({ "name": generals[i] });
|
||||||
box.updatePosition();
|
box.updatePosition();
|
||||||
|
|
|
@ -12,7 +12,7 @@ GraphicsBox {
|
||||||
property var selectedItem: []
|
property var selectedItem: []
|
||||||
property bool loaded: false
|
property bool loaded: false
|
||||||
property bool convertDisabled: false
|
property bool convertDisabled: false
|
||||||
property bool needSameKingdom: false
|
property bool hegemony: false
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id: generalList
|
id: generalList
|
||||||
|
@ -230,6 +230,14 @@ GraphicsBox {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateCompanion(gcard1, gcard2, overwrite) {
|
||||||
|
if (lcall("IsCompanionWith", gcard1.name, gcard2.name)) {
|
||||||
|
gcard1.hasCompanions = true;
|
||||||
|
} else if (overwrite) {
|
||||||
|
gcard1.hasCompanions = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updatePosition()
|
function updatePosition()
|
||||||
{
|
{
|
||||||
choices = [];
|
choices = [];
|
||||||
|
@ -248,12 +256,37 @@ GraphicsBox {
|
||||||
root.choicesChanged();
|
root.choicesChanged();
|
||||||
|
|
||||||
fightButton.enabled = (choices.length == choiceNum) &&
|
fightButton.enabled = (choices.length == choiceNum) &&
|
||||||
(needSameKingdom ? isHegPair(selectedItem[0], selectedItem[1]) : true);
|
(hegemony ? isHegPair(selectedItem[0], selectedItem[1]) : true);
|
||||||
|
|
||||||
for (i = 0; i < generalCardList.count; i++) {
|
for (i = 0; i < generalCardList.count; i++) {
|
||||||
item = generalCardList.itemAt(i);
|
item = generalCardList.itemAt(i);
|
||||||
item.selectable = needSameKingdom ? isHegPair(selectedItem[0], item)
|
item.selectable = hegemony ? isHegPair(selectedItem[0], item)
|
||||||
: true;
|
: true;
|
||||||
|
if (hegemony) {
|
||||||
|
if (selectedItem[0]) {
|
||||||
|
if (selectedItem[1]) {
|
||||||
|
if (selectedItem[0] === item) {
|
||||||
|
updateCompanion(item, selectedItem[1], true);
|
||||||
|
} else if (selectedItem[1] === item) {
|
||||||
|
updateCompanion(item, selectedItem[0], true);
|
||||||
|
} else {
|
||||||
|
item.hasCompanions = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (selectedItem[0] !== item) {
|
||||||
|
updateCompanion(item, selectedItem[0], true);
|
||||||
|
} else {
|
||||||
|
for (let j = 0; j < generalList.count; j++) {
|
||||||
|
updateCompanion(item, generalList.get(j), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let j = 0; j < generalList.count; j++) {
|
||||||
|
updateCompanion(item, generalList.get(j), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (selectedItem.indexOf(item) != -1)
|
if (selectedItem.indexOf(item) != -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ CardItem {
|
||||||
property int shieldNum
|
property int shieldNum
|
||||||
property string pkgName: ""
|
property string pkgName: ""
|
||||||
property bool detailed: true
|
property bool detailed: true
|
||||||
|
property alias hasCompanions: companions.visible
|
||||||
name: ""
|
name: ""
|
||||||
// description: Sanguosha.getGeneralDescription(name)
|
// description: Sanguosha.getGeneralDescription(name)
|
||||||
suit: ""
|
suit: ""
|
||||||
|
@ -157,6 +158,7 @@ CardItem {
|
||||||
height: 80
|
height: 80
|
||||||
x: 2
|
x: 2
|
||||||
y: lineCount > 6 ? 30 : 34
|
y: lineCount > 6 ? 30 : 34
|
||||||
|
z: 999
|
||||||
text: name !== "" ? luatr(name) : "nil"
|
text: name !== "" ? luatr(name) : "nil"
|
||||||
visible: luatr(name).length <= 6 && detailed && known
|
visible: luatr(name).length <= 6 && detailed && known
|
||||||
color: "white"
|
color: "white"
|
||||||
|
@ -170,6 +172,7 @@ CardItem {
|
||||||
Text {
|
Text {
|
||||||
x: 0
|
x: 0
|
||||||
y: 12
|
y: 12
|
||||||
|
z: 999
|
||||||
rotation: 90
|
rotation: 90
|
||||||
transformOrigin: Item.BottomLeft
|
transformOrigin: Item.BottomLeft
|
||||||
text: luatr(name)
|
text: luatr(name)
|
||||||
|
@ -184,6 +187,7 @@ CardItem {
|
||||||
visible: pkgName !== "" && detailed && known
|
visible: pkgName !== "" && detailed && known
|
||||||
height: 16
|
height: 16
|
||||||
width: childrenRect.width + 4
|
width: childrenRect.width + 4
|
||||||
|
z: 100
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: 4
|
anchors.bottomMargin: 4
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@ -205,6 +209,17 @@ CardItem {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: companions
|
||||||
|
width: parent.width
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
visible: false
|
||||||
|
source: SkinBank.getGeneralCardDir(kingdom) + kingdom + "-companions"
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
y: 80
|
||||||
|
z: 1
|
||||||
|
}
|
||||||
|
|
||||||
onNameChanged: {
|
onNameChanged: {
|
||||||
const data = lcall("GetGeneralData", name);
|
const data = lcall("GetGeneralData", name);
|
||||||
kingdom = data.kingdom;
|
kingdom = data.kingdom;
|
||||||
|
|
BIN
image/card/general/qun-companions.png
Normal file
BIN
image/card/general/qun-companions.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
BIN
image/card/general/shu-companions.png
Normal file
BIN
image/card/general/shu-companions.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
BIN
image/card/general/wei-companions.png
Normal file
BIN
image/card/general/wei-companions.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
BIN
image/card/general/wild-companions.png
Normal file
BIN
image/card/general/wild-companions.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.7 KiB |
BIN
image/card/general/wu-companions.png
Normal file
BIN
image/card/general/wu-companions.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
|
@ -72,6 +72,11 @@ function GetSameGenerals(name)
|
||||||
return json.encode(Fk:getSameGenerals(name))
|
return json.encode(Fk:getSameGenerals(name))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function IsCompanionWith(general, general2)
|
||||||
|
local _general, _general2 = Fk.generals[general], Fk.generals[general2]
|
||||||
|
return json.encode(_general:isCompanionWith(_general2))
|
||||||
|
end
|
||||||
|
|
||||||
local cardSubtypeStrings = {
|
local cardSubtypeStrings = {
|
||||||
[Card.SubtypeNone] = "none",
|
[Card.SubtypeNone] = "none",
|
||||||
[Card.SubtypeDelayedTrick] = "delayed_trick",
|
[Card.SubtypeDelayedTrick] = "delayed_trick",
|
||||||
|
|
|
@ -431,9 +431,12 @@ Fk:loadTranslationTable{
|
||||||
["$DiscardOther"] = "%to 弃置了 %from 的 %arg 张牌 %card",
|
["$DiscardOther"] = "%to 弃置了 %from 的 %arg 张牌 %card",
|
||||||
["$PutToDiscard"] = "%arg 张牌 %card 被置入弃牌堆",
|
["$PutToDiscard"] = "%arg 张牌 %card 被置入弃牌堆",
|
||||||
|
|
||||||
|
["#AbortArea"] = "%from 的 %arg 被废除",
|
||||||
|
["#ResumeArea"] = "%from 的 %arg 被恢复",
|
||||||
|
|
||||||
["#ShowCard"] = "%from 展示了牌 %card",
|
["#ShowCard"] = "%from 展示了牌 %card",
|
||||||
["#Recast"] = "%from 重铸了 %card",
|
["#Recast"] = "%from 重铸了 %card",
|
||||||
["#RecastBySkill"] = "%from 发动了 “%arg” 重铸了 %card",
|
["#RecastBySkill"] = "%from 因 “%arg” 重铸了 %card",
|
||||||
|
|
||||||
-- phase
|
-- phase
|
||||||
["#PhaseSkipped"] = "%from 跳过了 %arg",
|
["#PhaseSkipped"] = "%from 跳过了 %arg",
|
||||||
|
|
|
@ -110,8 +110,8 @@ function General:getSkillNameList(include_lord)
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
--- 为武将增加珠联璧合关系武将(1个或多个),只需写trueName。
|
--- 为武将增加珠联璧合关系武将(1个或多个)。
|
||||||
---@param name string[] @ 武将真名(表)
|
---@param name string|string[] @ 武将名(表)
|
||||||
function General:addCompanions(name)
|
function General:addCompanions(name)
|
||||||
if type(name) == "table" then
|
if type(name) == "table" then
|
||||||
table.insertTable(self.companions, name)
|
table.insertTable(self.companions, name)
|
||||||
|
@ -120,4 +120,12 @@ function General:addCompanions(name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- 是否与另一武将构成珠联璧合关系。
|
||||||
|
---@param other General @ 另一武将
|
||||||
|
function General:isCompanionWith(other)
|
||||||
|
return table.contains(self.companions, other.name) or table.contains(other.companions, self.name)
|
||||||
|
or (string.find(self.name, "lord") and (other.kingdom == self.kingdom or other.subkingdom == self.kingdom))
|
||||||
|
or (string.find(other.name, "lord") and (self.kingdom == other.kingdom or self.subkingdom == other.kingdom))
|
||||||
|
end
|
||||||
|
|
||||||
return General
|
return General
|
||||||
|
|
|
@ -560,6 +560,30 @@ function Player:distanceTo(other, mode, ignore_dead)
|
||||||
return math.max(ret, 1)
|
return math.max(ret, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- 比较距离
|
||||||
|
---@param other Player @ 终点角色
|
||||||
|
---@param num integer @ 比较基准
|
||||||
|
---@param operator string @ 运算符,有 ``"<"`` ``">"`` ``"<="`` ``">="`` ``"=="`` ``"~="``
|
||||||
|
---@return boolean @ 返回比较结果,不计入距离结果永远为false
|
||||||
|
function Player:compareDistance(other, num, operator)
|
||||||
|
local distance = self:distanceTo(other)
|
||||||
|
if distance < 0 or num < 0 then return false end
|
||||||
|
if operator == ">" then
|
||||||
|
return distance > num
|
||||||
|
elseif operator == "<" then
|
||||||
|
return distance < num
|
||||||
|
elseif operator == "==" then
|
||||||
|
return distance == num
|
||||||
|
elseif operator == ">=" then
|
||||||
|
return distance >= num
|
||||||
|
elseif operator == "<=" then
|
||||||
|
return distance <= num
|
||||||
|
elseif operator == "~=" then
|
||||||
|
return distance ~= num
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
--- 获取其他玩家是否在玩家的攻击范围内。
|
--- 获取其他玩家是否在玩家的攻击范围内。
|
||||||
---@param other Player @ 其他玩家
|
---@param other Player @ 其他玩家
|
||||||
---@param fixLimit? integer @ 卡牌距离限制增加专用
|
---@param fixLimit? integer @ 卡牌距离限制增加专用
|
||||||
|
@ -762,7 +786,12 @@ function Player:hasSkill(skill, ignoreNullified, ignoreAlive)
|
||||||
end
|
end
|
||||||
|
|
||||||
if table.contains(self.player_skills, skill) then
|
if table.contains(self.player_skills, skill) then
|
||||||
return true
|
if not skill:isInstanceOf(StatusSkill) then return true end
|
||||||
|
if self:isInstanceOf(ServerPlayer) then
|
||||||
|
return not self:isFakeSkill(skill)
|
||||||
|
else
|
||||||
|
return table.contains(self.player_skills, skill)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if self:isInstanceOf(ServerPlayer) and -- isInstanceOf(nil) will return false
|
if self:isInstanceOf(ServerPlayer) and -- isInstanceOf(nil) will return false
|
||||||
|
@ -781,6 +810,20 @@ function Player:hasSkill(skill, ignoreNullified, ignoreAlive)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- 技能是否亮出
|
||||||
|
---@param skill string | Skill
|
||||||
|
---@return boolean
|
||||||
|
function Player:hasShownSkill(skill, ignoreNullified, ignoreAlive)
|
||||||
|
if not self:hasSkill(skill, ignoreNullified, ignoreAlive) then return false end
|
||||||
|
|
||||||
|
if self:isInstanceOf(ServerPlayer) then
|
||||||
|
return not self:isFakeSkill(skill)
|
||||||
|
else
|
||||||
|
if type(skill) == "string" then skill = Fk.skills[skill] end
|
||||||
|
return table.contains(self.player_skills, skill)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- 为玩家增加对应技能。
|
--- 为玩家增加对应技能。
|
||||||
---@param skill string | Skill @ 技能名
|
---@param skill string | Skill @ 技能名
|
||||||
---@param source_skill? string | Skill @ 本有技能(和衍生技能相对)
|
---@param source_skill? string | Skill @ 本有技能(和衍生技能相对)
|
||||||
|
@ -1137,4 +1180,14 @@ function Player:compareGenderWith(other, diff)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- 是否为男性(包括双性)。
|
||||||
|
function Player:isMale()
|
||||||
|
return self.gender == General.Male or self.gender == General.Bigender
|
||||||
|
end
|
||||||
|
|
||||||
|
--- 是否为女性(包括双性)。
|
||||||
|
function Player:isFemale()
|
||||||
|
return self.gender == General.Female or self.gender == General.Bigender
|
||||||
|
end
|
||||||
|
|
||||||
return Player
|
return Player
|
||||||
|
|
|
@ -209,7 +209,7 @@ function ActiveSkill:onUse(room, cardUseEvent) end
|
||||||
|
|
||||||
---@param room Room
|
---@param room Room
|
||||||
---@param cardUseEvent CardUseStruct
|
---@param cardUseEvent CardUseStruct
|
||||||
---@param isEnding? bool
|
---@param finished? bool
|
||||||
function ActiveSkill:onAction(room, cardUseEvent, finished) end
|
function ActiveSkill:onAction(room, cardUseEvent, finished) end
|
||||||
|
|
||||||
---@param room Room
|
---@param room Room
|
||||||
|
|
|
@ -38,7 +38,7 @@ GameEvent.functions[GameEvent.Pindian] = function(self)
|
||||||
|
|
||||||
table.insert(moveInfos, {
|
table.insert(moveInfos, {
|
||||||
ids = { _pindianCard.id },
|
ids = { _pindianCard.id },
|
||||||
from = pindianData.from.id,
|
from = room.owner_map[_pindianCard.id],
|
||||||
fromArea = room:getCardArea(_pindianCard.id),
|
fromArea = room:getCardArea(_pindianCard.id),
|
||||||
toArea = Card.Processing,
|
toArea = Card.Processing,
|
||||||
moveReason = fk.ReasonPut,
|
moveReason = fk.ReasonPut,
|
||||||
|
@ -56,7 +56,7 @@ GameEvent.functions[GameEvent.Pindian] = function(self)
|
||||||
|
|
||||||
table.insert(moveInfos, {
|
table.insert(moveInfos, {
|
||||||
ids = { _pindianCard.id },
|
ids = { _pindianCard.id },
|
||||||
from = to.id,
|
from = room.owner_map[_pindianCard.id],
|
||||||
fromArea = room:getCardArea(_pindianCard.id),
|
fromArea = room:getCardArea(_pindianCard.id),
|
||||||
toArea = Card.Processing,
|
toArea = Card.Processing,
|
||||||
moveReason = fk.ReasonPut,
|
moveReason = fk.ReasonPut,
|
||||||
|
|
|
@ -3040,6 +3040,7 @@ end
|
||||||
---@param tos ServerPlayer | ServerPlayer[] @ 目标角色(列表)
|
---@param tos ServerPlayer | ServerPlayer[] @ 目标角色(列表)
|
||||||
---@param skillName? string @ 技能名
|
---@param skillName? string @ 技能名
|
||||||
---@param extra? boolean @ 是否不计入次数
|
---@param extra? boolean @ 是否不计入次数
|
||||||
|
---@return CardUseStruct
|
||||||
function Room:useVirtualCard(card_name, subcards, from, tos, skillName, extra)
|
function Room:useVirtualCard(card_name, subcards, from, tos, skillName, extra)
|
||||||
local card = Fk:cloneCard(card_name)
|
local card = Fk:cloneCard(card_name)
|
||||||
card.skillName = skillName
|
card.skillName = skillName
|
||||||
|
@ -3064,7 +3065,7 @@ function Room:useVirtualCard(card_name, subcards, from, tos, skillName, extra)
|
||||||
use.extraUse = extra
|
use.extraUse = extra
|
||||||
self:useCard(use)
|
self:useCard(use)
|
||||||
|
|
||||||
return true
|
return use
|
||||||
end
|
end
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
@ -3936,6 +3937,13 @@ function Room:abortPlayerArea(player, playerSlots)
|
||||||
table.insertTable(player.sealedSlots, slotsToSeal)
|
table.insertTable(player.sealedSlots, slotsToSeal)
|
||||||
self:broadcastProperty(player, "sealedSlots")
|
self:broadcastProperty(player, "sealedSlots")
|
||||||
|
|
||||||
|
for _, s in ipairs(slotsToSeal) do
|
||||||
|
self:sendLog{
|
||||||
|
type = "#AbortArea",
|
||||||
|
from = player.id,
|
||||||
|
arg = s,
|
||||||
|
}
|
||||||
|
end
|
||||||
self.logic:trigger(fk.AreaAborted, player, { slots = slotsSealed })
|
self.logic:trigger(fk.AreaAborted, player, { slots = slotsSealed })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -3961,6 +3969,13 @@ function Room:resumePlayerArea(player, playerSlots)
|
||||||
|
|
||||||
if #slotsToResume > 0 then
|
if #slotsToResume > 0 then
|
||||||
self:broadcastProperty(player, "sealedSlots")
|
self:broadcastProperty(player, "sealedSlots")
|
||||||
|
for _, s in ipairs(slotsToResume) do
|
||||||
|
self:sendLog{
|
||||||
|
type = "#ResumeArea",
|
||||||
|
from = player.id,
|
||||||
|
arg = s,
|
||||||
|
}
|
||||||
|
end
|
||||||
self.logic:trigger(fk.AreaResumed, player, { slots = slotsToResume })
|
self.logic:trigger(fk.AreaResumed, player, { slots = slotsToResume })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -943,7 +943,7 @@ function ServerPlayer:revealGeneral(isDeputy, no_trigger)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if ret then
|
if ret then
|
||||||
self:loseFakeSkill("reveal_skill")
|
self:loseFakeSkill("reveal_skill&")
|
||||||
end
|
end
|
||||||
|
|
||||||
local oldKingdom = self.kingdom
|
local oldKingdom = self.kingdom
|
||||||
|
@ -1058,7 +1058,7 @@ function ServerPlayer:hideGeneral(isDeputy)
|
||||||
local s = Fk.skills[sname]
|
local s = Fk.skills[sname]
|
||||||
if s.relate_to_place ~= place then
|
if s.relate_to_place ~= place then
|
||||||
if s.frequency == Skill.Compulsory then
|
if s.frequency == Skill.Compulsory then
|
||||||
self:addFakeSkill("reveal_skill")
|
self:addFakeSkill("reveal_skill&")
|
||||||
end
|
end
|
||||||
self:addFakeSkill(s)
|
self:addFakeSkill(s)
|
||||||
end
|
end
|
||||||
|
|
|
@ -271,8 +271,8 @@ local revealProhibited = fk.CreateInvaliditySkill {
|
||||||
|
|
||||||
-- 亮将
|
-- 亮将
|
||||||
local revealSkill = fk.CreateActiveSkill{
|
local revealSkill = fk.CreateActiveSkill{
|
||||||
name = "reveal_skill",
|
name = "reveal_skill&",
|
||||||
prompt = "#reveal_skill",
|
prompt = "#reveal_skill&",
|
||||||
interaction = function(self)
|
interaction = function(self)
|
||||||
local choiceList = {}
|
local choiceList = {}
|
||||||
if (Self.general == "anjiang" and not Self:prohibitReveal()) then
|
if (Self.general == "anjiang" and not Self:prohibitReveal()) then
|
||||||
|
@ -280,7 +280,7 @@ local revealSkill = fk.CreateActiveSkill{
|
||||||
for _, sname in ipairs(general:getSkillNameList(true)) do
|
for _, sname in ipairs(general:getSkillNameList(true)) do
|
||||||
local s = Fk.skills[sname]
|
local s = Fk.skills[sname]
|
||||||
if s.frequency == Skill.Compulsory and s.relate_to_place ~= "m" then
|
if s.frequency == Skill.Compulsory and s.relate_to_place ~= "m" then
|
||||||
table.insert(choiceList, "revealMain")
|
table.insert(choiceList, "revealMain:::" .. general.name)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -290,13 +290,13 @@ local revealSkill = fk.CreateActiveSkill{
|
||||||
for _, sname in ipairs(general:getSkillNameList(true)) do
|
for _, sname in ipairs(general:getSkillNameList(true)) do
|
||||||
local s = Fk.skills[sname]
|
local s = Fk.skills[sname]
|
||||||
if s.frequency == Skill.Compulsory and s.relate_to_place ~= "d" then
|
if s.frequency == Skill.Compulsory and s.relate_to_place ~= "d" then
|
||||||
table.insert(choiceList, "revealDeputy")
|
table.insert(choiceList, "revealDeputy:::" .. general.name)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if #choiceList == 0 then return false end
|
if #choiceList == 0 then return false end
|
||||||
return UI.ComboBox { choices = choiceList}
|
return UI.ComboBox { choices = choiceList }
|
||||||
end,
|
end,
|
||||||
target_num = 0,
|
target_num = 0,
|
||||||
card_num = 0,
|
card_num = 0,
|
||||||
|
@ -305,18 +305,16 @@ local revealSkill = fk.CreateActiveSkill{
|
||||||
local player = room:getPlayerById(effect.from)
|
local player = room:getPlayerById(effect.from)
|
||||||
local choice = self.interaction.data
|
local choice = self.interaction.data
|
||||||
if not choice then return false
|
if not choice then return false
|
||||||
elseif choice == "revealMain" then player:revealGeneral(false)
|
elseif choice:startsWith("revealMain") then player:revealGeneral(false)
|
||||||
elseif choice == "revealDeputy" then player:revealGeneral(true) end
|
elseif choice:startsWith("revealDeputy") then player:revealGeneral(true) end
|
||||||
end,
|
end,
|
||||||
can_use = function(self, player)
|
can_use = function(self, player)
|
||||||
local choiceList = {}
|
|
||||||
if (player.general == "anjiang" and not player:prohibitReveal()) then
|
if (player.general == "anjiang" and not player:prohibitReveal()) then
|
||||||
local general = Fk.generals[player:getMark("__heg_general")]
|
local general = Fk.generals[player:getMark("__heg_general")]
|
||||||
for _, sname in ipairs(general:getSkillNameList(true)) do
|
for _, sname in ipairs(general:getSkillNameList(true)) do
|
||||||
local s = Fk.skills[sname]
|
local s = Fk.skills[sname]
|
||||||
if s.frequency == Skill.Compulsory and s.relate_to_place ~= "m" then
|
if s.frequency == Skill.Compulsory and s.relate_to_place ~= "m" then
|
||||||
table.insert(choiceList, "revealMain")
|
return true
|
||||||
break
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -325,12 +323,11 @@ local revealSkill = fk.CreateActiveSkill{
|
||||||
for _, sname in ipairs(general:getSkillNameList(true)) do
|
for _, sname in ipairs(general:getSkillNameList(true)) do
|
||||||
local s = Fk.skills[sname]
|
local s = Fk.skills[sname]
|
||||||
if s.frequency == Skill.Compulsory and s.relate_to_place ~= "d" then
|
if s.frequency == Skill.Compulsory and s.relate_to_place ~= "d" then
|
||||||
table.insert(choiceList, "revealDeputy")
|
return true
|
||||||
break
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return #choiceList > 0
|
return false
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,9 +195,11 @@ Fk:loadTranslationTable({
|
||||||
["ex__choose_skill"] = "Choose",
|
["ex__choose_skill"] = "Choose",
|
||||||
["distribution_select_skill"] = "Distribute",
|
["distribution_select_skill"] = "Distribute",
|
||||||
["choose_players_to_move_card_in_board"] = "Choose players",
|
["choose_players_to_move_card_in_board"] = "Choose players",
|
||||||
["reveal_skill"] = "Reveal",
|
["reveal_skill&"] = "Reveal",
|
||||||
["#reveal_skill"] = "Choose a character to reveal",
|
["#reveal_skill&"] = "Choose a character to reveal",
|
||||||
[":reveal_skill"] = "In action phase, you can reveal a character who has Forced skills.",
|
[":reveal_skill&"] = "In action phase, you can reveal a character who has Forced skills.",
|
||||||
|
["revealMain"] = "Reveal main character %arg",
|
||||||
|
["revealDeputy"] = "Reveal deputy character %arg",
|
||||||
|
|
||||||
["game_rule"] = "Discard",
|
["game_rule"] = "Discard",
|
||||||
}, "en_US")
|
}, "en_US")
|
||||||
|
|
|
@ -522,9 +522,11 @@ Fk:loadTranslationTable{
|
||||||
["ex__choose_skill"] = "选择",
|
["ex__choose_skill"] = "选择",
|
||||||
["distribution_select_skill"] = "分配",
|
["distribution_select_skill"] = "分配",
|
||||||
["choose_players_to_move_card_in_board"] = "选择角色",
|
["choose_players_to_move_card_in_board"] = "选择角色",
|
||||||
["reveal_skill"] = "亮将",
|
["reveal_skill&"] = "亮将",
|
||||||
["#reveal_skill"] = "选择一个武将亮将(点击左侧选择框展开)",
|
["#reveal_skill&"] = "选择一个武将亮将(点击左侧选择框展开)",
|
||||||
[":reveal_skill"] = "出牌阶段,你可亮出一张有锁定技的武将。",
|
[":reveal_skill&"] = "出牌阶段,你可明置一张有锁定技的武将。",
|
||||||
|
["revealMain"] = "明置主将 %arg",
|
||||||
|
["revealDeputy"] = "明置副将 %arg",
|
||||||
|
|
||||||
["game_rule"] = "弃牌阶段",
|
["game_rule"] = "弃牌阶段",
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,10 +170,11 @@ local tuxi = fk.CreateTriggerSkill{
|
||||||
end,
|
end,
|
||||||
on_use = function(self, event, target, player, data)
|
on_use = function(self, event, target, player, data)
|
||||||
local room = player.room
|
local room = player.room
|
||||||
|
room:sortPlayersByAction(self.cost_data)
|
||||||
for _, id in ipairs(self.cost_data) do
|
for _, id in ipairs(self.cost_data) do
|
||||||
if player.dead then return end
|
if player.dead then return end
|
||||||
local p = room:getPlayerById(id)
|
local p = room:getPlayerById(id)
|
||||||
if not p.dead then
|
if not p.dead and not p:isKongcheng() then
|
||||||
local c = room:askForCardChosen(player, p, "h", self.name)
|
local c = room:askForCardChosen(player, p, "h", self.name)
|
||||||
room:obtainCard(player.id, c, false, fk.ReasonPrey)
|
room:obtainCard(player.id, c, false, fk.ReasonPrey)
|
||||||
end
|
end
|
||||||
|
@ -689,6 +690,9 @@ local qixi = fk.CreateViewAsSkill{
|
||||||
c:addSubcard(cards[1])
|
c:addSubcard(cards[1])
|
||||||
return c
|
return c
|
||||||
end,
|
end,
|
||||||
|
enabled_at_response = function (self, player, response)
|
||||||
|
return not response
|
||||||
|
end
|
||||||
}
|
}
|
||||||
local ganning = General:new(extension, "ganning", "wu", 4)
|
local ganning = General:new(extension, "ganning", "wu", 4)
|
||||||
ganning:addSkill(qixi)
|
ganning:addSkill(qixi)
|
||||||
|
@ -759,7 +763,7 @@ local fanjian = fk.CreateActiveSkill{
|
||||||
can_use = function(self, player)
|
can_use = function(self, player)
|
||||||
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
|
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
|
||||||
end,
|
end,
|
||||||
card_filter = function() return false end,
|
card_filter = Util.FalseFunc,
|
||||||
target_filter = function(self, to_select, selected)
|
target_filter = function(self, to_select, selected)
|
||||||
return #selected == 0 and to_select ~= Self.id
|
return #selected == 0 and to_select ~= Self.id
|
||||||
end,
|
end,
|
||||||
|
@ -801,6 +805,9 @@ local guose = fk.CreateViewAsSkill{
|
||||||
c:addSubcard(cards[1])
|
c:addSubcard(cards[1])
|
||||||
return c
|
return c
|
||||||
end,
|
end,
|
||||||
|
enabled_at_response = function (self, player, response)
|
||||||
|
return not response
|
||||||
|
end
|
||||||
}
|
}
|
||||||
local liuli = fk.CreateTriggerSkill{
|
local liuli = fk.CreateTriggerSkill{
|
||||||
name = "liuli",
|
name = "liuli",
|
||||||
|
@ -937,9 +944,7 @@ local jieyin = fk.CreateActiveSkill{
|
||||||
end,
|
end,
|
||||||
target_filter = function(self, to_select, selected)
|
target_filter = function(self, to_select, selected)
|
||||||
local target = Fk:currentRoom():getPlayerById(to_select)
|
local target = Fk:currentRoom():getPlayerById(to_select)
|
||||||
return target:isWounded() and
|
return target:isWounded() and target:isMale() and #selected < 1 and to_select ~= Self.id
|
||||||
(target.gender == General.Male or target.gender == General.Bigender)
|
|
||||||
and #selected < 1 and to_select ~= Self.id
|
|
||||||
end,
|
end,
|
||||||
target_num = 1,
|
target_num = 1,
|
||||||
card_num = 2,
|
card_num = 2,
|
||||||
|
@ -1015,11 +1020,9 @@ local jijiu = fk.CreateViewAsSkill{
|
||||||
c:addSubcard(cards[1])
|
c:addSubcard(cards[1])
|
||||||
return c
|
return c
|
||||||
end,
|
end,
|
||||||
enabled_at_play = function(self, player)
|
enabled_at_play = Util.FalseFunc,
|
||||||
return false
|
enabled_at_response = function(self, player, res)
|
||||||
end,
|
return player.phase == Player.NotActive and not res
|
||||||
enabled_at_response = function(self, player)
|
|
||||||
return player.phase == Player.NotActive
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
local huatuo = General:new(extension, "huatuo", "qun", 3)
|
local huatuo = General:new(extension, "huatuo", "qun", 3)
|
||||||
|
@ -1067,8 +1070,7 @@ local lijian = fk.CreateActiveSkill{
|
||||||
end,
|
end,
|
||||||
target_filter = function(self, to_select, selected)
|
target_filter = function(self, to_select, selected)
|
||||||
if #selected < 2 and to_select ~= Self.id then
|
if #selected < 2 and to_select ~= Self.id then
|
||||||
local target = Fk:currentRoom():getPlayerById(to_select)
|
return Fk:currentRoom():getPlayerById(to_select):isMale()
|
||||||
return target.gender == General.Male or target.gender == General.Bigender
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
target_num = 2,
|
target_num = 2,
|
||||||
|
|
|
@ -1157,7 +1157,8 @@ local eightDiagramSkill = fk.CreateTriggerSkill{
|
||||||
events = {fk.AskForCardUse, fk.AskForCardResponse},
|
events = {fk.AskForCardUse, fk.AskForCardResponse},
|
||||||
can_trigger = function(self, event, target, player, data)
|
can_trigger = function(self, event, target, player, data)
|
||||||
return target == player and player:hasSkill(self) and
|
return target == player and player:hasSkill(self) and
|
||||||
(data.cardName == "jink" or (data.pattern and Exppattern:Parse(data.pattern):matchExp("jink|0|nosuit|none")))
|
(data.cardName == "jink" or (data.pattern and Exppattern:Parse(data.pattern):matchExp("jink|0|nosuit|none"))) and
|
||||||
|
(event == fk.AskForCardUse and not player:prohibitUse(Fk:cloneCard("jink")) or not player:prohibitResponse(Fk:cloneCard("jink")))
|
||||||
end,
|
end,
|
||||||
on_use = function(self, event, target, player, data)
|
on_use = function(self, event, target, player, data)
|
||||||
local room = player.room
|
local room = player.room
|
||||||
|
|
Loading…
Reference in New Issue
Block a user