parent
2da6a49a16
commit
b95389beef
|
@ -61,8 +61,8 @@ function GetGeneralDetail(name)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
for _, g in pairs(Fk.generals) do
|
for _, g in pairs(Fk.generals) do
|
||||||
if table.contains(g.companions, general.trueName) then
|
if table.contains(g.companions, general.name) then
|
||||||
table.insertIfNeed(ret.companions, g.trueName)
|
table.insertIfNeed(ret.companions, g.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return json.encode(ret)
|
return json.encode(ret)
|
||||||
|
|
|
@ -720,7 +720,6 @@ end
|
||||||
---@param skill_name string @ 技能名
|
---@param skill_name string @ 技能名
|
||||||
---@param index integer | nil @ 语音编号,默认为-1(也就是随机播放)
|
---@param index integer | nil @ 语音编号,默认为-1(也就是随机播放)
|
||||||
function ServerPlayer:broadcastSkillInvoke(skill_name, index)
|
function ServerPlayer:broadcastSkillInvoke(skill_name, index)
|
||||||
print 'Room:broadcastSkillInvoke deprecated; use SPlayer:broadcastSkillInvoke'
|
|
||||||
index = index or -1
|
index = index or -1
|
||||||
self.room:sendLogEvent("PlaySkillSound", {
|
self.room:sendLogEvent("PlaySkillSound", {
|
||||||
name = skill_name,
|
name = skill_name,
|
||||||
|
@ -817,7 +816,7 @@ function ServerPlayer:revealGeneral(isDeputy, no_trigger)
|
||||||
generalName = self:getMark("__heg_general")
|
generalName = self:getMark("__heg_general")
|
||||||
end
|
end
|
||||||
|
|
||||||
local general = Fk.generals[generalName]
|
local general = Fk.generals[generalName] or Fk.generals["blank_shibing"]
|
||||||
for _, s in ipairs(general:getSkillNameList()) do
|
for _, s in ipairs(general:getSkillNameList()) do
|
||||||
local skill = Fk.skills[s]
|
local skill = Fk.skills[s]
|
||||||
self:loseFakeSkill(skill)
|
self:loseFakeSkill(skill)
|
||||||
|
@ -825,7 +824,7 @@ function ServerPlayer:revealGeneral(isDeputy, no_trigger)
|
||||||
|
|
||||||
local ret = true
|
local ret = true
|
||||||
if not ((isDeputy and self.general ~= "anjiang") or (not isDeputy and self.deputyGeneral ~= "anjiang")) then
|
if not ((isDeputy and self.general ~= "anjiang") or (not isDeputy and self.deputyGeneral ~= "anjiang")) then
|
||||||
local other = Fk.generals[self:getMark(isDeputy and "__heg_general" or "__heg_deputy")]
|
local other = Fk.generals[self:getMark(isDeputy and "__heg_general" or "__heg_deputy")] or Fk.generals["blank_shibing"]
|
||||||
for _, sname in ipairs(other:getSkillNameList()) do
|
for _, sname in ipairs(other:getSkillNameList()) do
|
||||||
local s = Fk.skills[sname]
|
local s = Fk.skills[sname]
|
||||||
if s.frequency == Skill.Compulsory and s.relate_to_place ~= (isDeputy and "m" or "d") then
|
if s.frequency == Skill.Compulsory and s.relate_to_place ~= (isDeputy and "m" or "d") then
|
||||||
|
@ -840,15 +839,19 @@ function ServerPlayer:revealGeneral(isDeputy, no_trigger)
|
||||||
|
|
||||||
local oldKingdom = self.kingdom
|
local oldKingdom = self.kingdom
|
||||||
room:changeHero(self, generalName, false, isDeputy)
|
room:changeHero(self, generalName, false, isDeputy)
|
||||||
local kingdom = general.kingdom
|
if oldKingdom ~= "wild" then
|
||||||
self.kingdom = kingdom
|
local kingdom = general.kingdom
|
||||||
if oldKingdom == "unknown" and #table.filter(room:getOtherPlayers(self),
|
self.kingdom = kingdom
|
||||||
function(p)
|
if oldKingdom == "unknown" and #table.filter(room:getOtherPlayers(self, false, true),
|
||||||
return p.kingdom == kingdom
|
function(p)
|
||||||
end) >= #room.players // 2 then
|
return p.kingdom == kingdom
|
||||||
self.kingdom = "wild"
|
end) >= #room.players // 2 then
|
||||||
|
self.kingdom = "wild"
|
||||||
|
end
|
||||||
|
room:broadcastProperty(self, "kingdom")
|
||||||
|
else
|
||||||
|
room:setPlayerProperty(self, "kingdom", "wild")
|
||||||
end
|
end
|
||||||
room:broadcastProperty(self, "kingdom")
|
|
||||||
|
|
||||||
if self.gender == General.Agender then
|
if self.gender == General.Agender then
|
||||||
self.gender = general.gender
|
self.gender = general.gender
|
||||||
|
|
|
@ -907,9 +907,11 @@ local doubleSwordsSkill = fk.CreateTriggerSkill{
|
||||||
attached_equip = "double_swords",
|
attached_equip = "double_swords",
|
||||||
events = {fk.TargetSpecified},
|
events = {fk.TargetSpecified},
|
||||||
can_trigger = function(self, event, target, player, data)
|
can_trigger = function(self, event, target, player, data)
|
||||||
return target == player and player:hasSkill(self.name) and
|
if target == player and player:hasSkill(self.name) and
|
||||||
data.card and data.card.trueName == "slash" and
|
data.card and data.card.trueName == "slash" then
|
||||||
(player.room:getPlayerById(data.to).gender ~= player.gender)
|
local target = player.room:getPlayerById(data.to)
|
||||||
|
return target.gender ~= player.gender and target.gender ~= General.Agender and player.gender ~= General.Agender
|
||||||
|
end
|
||||||
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