diff --git a/audio/death/of_heg__xurong.mp3 b/audio/death/of_heg__xurong.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..af167cd4bbbf677762701f10d8b7cc114cb6da9d Binary files /dev/null and b/audio/death/of_heg__xurong.mp3 differ diff --git a/audio/skill/of_heg__xionghuo1.mp3 b/audio/skill/of_heg__xionghuo1.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..091dc6b3542fe65370eb4331b907577f9d64e23a Binary files /dev/null and b/audio/skill/of_heg__xionghuo1.mp3 differ diff --git a/audio/skill/of_heg__xionghuo2.mp3 b/audio/skill/of_heg__xionghuo2.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..fb542710edc4018f5b3f4a76061f53e5f5a8f99f Binary files /dev/null and b/audio/skill/of_heg__xionghuo2.mp3 differ diff --git a/hegemony_standard.lua b/hegemony_standard.lua index 96d6b999e895dbe1d61a0ba393dd6cebb64ee180..66e9261ed885629817fe58f8982acfc250301276 100644 --- a/hegemony_standard.lua +++ b/hegemony_standard.lua @@ -610,7 +610,7 @@ Fk:loadTranslationTable{ ["illustrator:hs__caopi"] = "DH", ["hs__fangzhu"] = "放逐", - [":hs__fangzhu"] = "当你受到伤害后,你可令一名其他角色选择一项:1.摸X张牌并叠置(X为你已损失的体力值);2.弃置一张牌并失去1点体力。", + [":hs__fangzhu"] = "当你受到伤害后,你可令一名其他角色选择一项:1.摸X张牌并叠置;2.弃置X张牌并失去1点体力。(X为你已损失的体力值)", ["#hs__fangzhu-choose"] = "放逐:你可令一名其他角色选择摸%arg张牌并叠置,或弃置一张牌并失去1点体力", ["hs__fangzhu_ask"] = "放逐:弃置%arg张牌并失去1点体力,或点击“取消”,摸牌并叠置", diff --git a/image/generals/of_heg__xurong.jpg b/image/generals/of_heg__xurong.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b649fd54b943df6f3d55ffa818416e430b046fb8 Binary files /dev/null and b/image/generals/of_heg__xurong.jpg differ diff --git a/init.lua b/init.lua index c060eef0bbd1bec8d8b0de56a8e29389293dd271..f284da1a8e6451eaa72deaa1b6c1cc688b64213e 100644 --- a/init.lua +++ b/init.lua @@ -5,6 +5,7 @@ local transformation = require "packages/hegemony/transformation"[1] local power = require "packages/hegemony/power"[1] local tenyear = require "packages/hegemony/tenyear_heg" local overseas = require "packages/hegemony/overseas_heg" +local offline = require "packages/hegemony/offline_heg" local ex = require "packages/hegemony/lord_ex" local hegemony_cards = require "packages/hegemony/hegemony_cards" @@ -25,6 +26,7 @@ return { power, tenyear, overseas, + offline, ex, hegemony_cards, diff --git a/lord_ex.lua b/lord_ex.lua index 320473d0e60906c0b0bf170315165dd821b7f579..b99c4894eca4b60c9de2d1f285dc834d4932daa7 100644 --- a/lord_ex.lua +++ b/lord_ex.lua @@ -940,7 +940,10 @@ local jilix = fk.CreateTriggerSkill{ if event == fk.TargetConfirmed then data.additionalEffect = 1 else - H.removeGeneral(room, player, true) + local isDeputy = H.inGeneralSkills(player, self.name) + if isDeputy then + H.removeGeneral(room, player, isDeputy == "d") + end return true end end, diff --git a/momentum.lua b/momentum.lua index b7437fb928884c1dd46329f9f6374d48506a31a0..a16e4fd8284971e5a92362091272071cf5fbd368 100644 --- a/momentum.lua +++ b/momentum.lua @@ -34,8 +34,8 @@ local hengjiang = fk.CreateTriggerSkill{ local target = room.current if target ~= nil and not target.dead then room:doIndicate(player.id, {target.id}) - room:addPlayerMark(target, "@hengjiang-turn", math.min(1, #target:getCardIds("e"))) - room:addPlayerMark(target, MarkEnum.MinusMaxCardsInTurn, math.min(1, #target:getCardIds("e"))) + room:addPlayerMark(target, "@hengjiang-turn", math.max(1, #target:getCardIds("e"))) + room:addPlayerMark(target, MarkEnum.MinusMaxCardsInTurn, math.max(1, #target:getCardIds("e"))) end end } diff --git a/offline_heg.lua b/offline_heg.lua new file mode 100644 index 0000000000000000000000000000000000000000..f4627379adeb3a1c0ff91ac27c88c4fd4914a822 --- /dev/null +++ b/offline_heg.lua @@ -0,0 +1,146 @@ +local extension = Package:new("offline_heg") +extension.extensionName = "hegemony" +extension.game_modes_whitelist = { 'nos_heg_mode', 'new_heg_mode' } + +local H = require "packages/hegemony/util" +local U = require "packages/utility/utility" + +Fk:loadTranslationTable{ + ["offline_heg"] = "国战-线下卡专属", + ["of_heg"] = "线下", +} + +local xurong = General(extension, "of_heg__xurong", "qun", 4) +local xionghuo = fk.CreateActiveSkill{ + name = "of_heg__xionghuo", + anim_type = "offensive", + card_num = 0, + target_num = 1, + prompt = "#of_heg__xionghuo-active", + can_use = function(self, player) + return player:getMark("@of_heg__baoli") > 0 + end, + card_filter = Util.FalseFunc, + target_filter = function(self, to_select, selected) + local target = Fk:currentRoom():getPlayerById(to_select) + return #selected == 0 and to_select ~= Self.id and target:getMark("@of_heg__baoli") == 0 and not H.compareKingdomWith(Self, target) + end, + on_use = function(self, room, effect) + local player = room:getPlayerById(effect.from) + local target = room:getPlayerById(effect.tos[1]) + room:removePlayerMark(player, "@of_heg__baoli", 1) + room:addPlayerMark(target, "@of_heg__baoli", 1) + end, +} +local xionghuo_record = fk.CreateTriggerSkill{ + name = "#of_heg__xionghuo_record", + main_skill = xionghuo, + anim_type = "offensive", + events = {fk.GeneralRevealed, fk.DamageCaused, fk.EventPhaseStart}, + can_trigger = function(self, event, target, player, data) + if player:hasSkill(xionghuo.name) then + if event == fk.GeneralRevealed then + if player:usedSkillTimes(self.name, Player.HistoryGame) == 0 then + for _, v in pairs(data) do + if table.contains(Fk.generals[v]:getSkillNameList(), xionghuo.name) then return true end + end + end + elseif event == fk.DamageCaused then + return target == player and data.to ~= player and data.to:getMark("@of_heg__baoli") > 0 and data.card and data.to:getMark("@@of_heg__baoli_damage-turn") == 0 + else + return target ~= player and target:getMark("@of_heg__baoli") > 0 and target.phase == Player.Play + end + end + end, + on_cost = Util.TrueFunc, + on_use = function(self, event, target, player, data) + local room = player.room + player:broadcastSkillInvoke("of_heg__xionghuo") + if event == fk.GeneralRevealed then + room:addPlayerMark(player, "@of_heg__baoli", 3) + elseif event == fk.DamageCaused then + room:doIndicate(player.id, {data.to.id}) + data.damage = data.damage + 1 + room:setPlayerMark(data.to, "@@of_heg__baoli_damage-turn", 1) + else + room:doIndicate(player.id, {target.id}) + room:setPlayerMark(target, "@of_heg__baoli", 0) + local rand = math.random(1, target:isNude() and 2 or 3) + if rand == 1 then + room:damage { + from = player, + to = target, + damage = 1, + damageType = fk.FireDamage, + skillName = "of_heg__xionghuo", + } + if not (player.dead or target.dead) then + local mark = U.getMark(target, "of_heg__xionghuo_prohibit-turn") + table.insert(mark, player.id) + room:setPlayerMark(target, "of_heg__xionghuo_prohibit-turn", mark) + end + elseif rand == 2 then + room:loseHp(target, 1, "of_heg__xionghuo") + if not target.dead then + room:addPlayerMark(target, "MinusMaxCards-turn", 1) + end + else + local cards = table.random(target:getCardIds(Player.Hand), 1) + table.insertTable(cards, table.random(target:getCardIds(Player.Equip), 1)) + room:obtainCard(player, cards, false, fk.ReasonPrey) + end + end + end, + + refresh_events = {fk.BuryVictim, fk.EventLoseSkill}, + can_refresh = function(self, event, target, player, data) + if event == fk.BuryVictim then + return player == target and player:hasSkill(xionghuo, true, true) and table.every(player.room.alive_players, function (p) + return not p:hasSkill(xionghuo, true) + end) + elseif event == fk.EventLoseSkill then + return player == target and data == xionghuo and table.every(player.room.alive_players, function (p) + return not p:hasSkill(xionghuo, true) + end) + end + end, + on_refresh = function(self, event, target, player, data) + local room = player.room + for _, p in ipairs(room.alive_players) do + if p:getMark("@of_heg__baoli") > 0 then + room:setPlayerMark(p, "@of_heg__baoli", 0) + end + end + end, +} +local xionghuo_prohibit = fk.CreateProhibitSkill{ + name = "#of_heg__xionghuo_prohibit", + is_prohibited = function(self, from, to, card) + return card.trueName == "slash" and table.contains(U.getMark(from, "of_heg__xionghuo_prohibit-turn") ,to.id) + end, +} + +xionghuo:addRelatedSkill(xionghuo_record) +xionghuo:addRelatedSkill(xionghuo_prohibit) +xurong:addSkill(xionghuo) + +Fk:loadTranslationTable{ + ["of_heg__xurong"] = "徐荣", + ["#of_heg__xurong"] = "玄菟战魔", + ["cv:of_heg__xurong"] = "曹真", + ["designer:of_heg__xurong"] = "Loun老萌", + ["illustrator:of_heg__xurong"] = "青岛磐蒲", + + ["of_heg__xionghuo"] = "凶镬", + [":of_heg__xionghuo"] = "①当你首次明置此武将牌后,你获得三枚“暴戾”标记。②出牌阶段,你可以交给一名与你势力不同的角色一枚“暴戾”标记。③每回合每名角色限一次,当你使用牌对拥有“暴戾”标记的其他角色造成伤害时,此伤害+1。④拥有“暴戾”标记的其他角色出牌阶段开始时,其移去“暴戾”标记并随机执行:1.你对其造成1点火焰伤害,其本回合不能对你使用【杀】;2.其失去1点体力且本回合手牌上限-1;3.你获得其装备区里的一张牌,然后获得其一张手牌。", + + ["#of_heg__xionghuo_record"] = "凶镬", + ["@of_heg__baoli"] = "暴戾", + ["#of_heg__xionghuo-active"] = "发动 凶镬,将“暴戾”交给其他角色", + ["@@of_heg__baoli_damage-turn"] = "凶镬 已造伤", + + ["$of_heg__xionghuo1"] = "战场上的懦夫,可不会有好结局!", + ["$of_heg__xionghuo2"] = "用最残忍的方式,碾碎敌人!", + ["~of_heg__xurong"] = "死于战场……是个不错的结局……", +} +return extension diff --git a/overseas_heg.lua b/overseas_heg.lua index 40a8a83a7497a984e403a4d0a8dd0bd290034b74..2916fd235301cbe55912c3459e3382e11e411139 100644 --- a/overseas_heg.lua +++ b/overseas_heg.lua @@ -3,6 +3,7 @@ extension.extensionName = "hegemony" extension.game_modes_whitelist = { 'nos_heg_mode', 'new_heg_mode' } local H = require "packages/hegemony/util" +local U = require "packages/utility/utility" Fk:loadTranslationTable{ ["overseas_heg"] = "国战-国际服专属", @@ -492,4 +493,5 @@ Fk:loadTranslationTable{ ["$yuanyuk2"] = "这片土地的人,真是太有趣了。", ["~os_heg__himiko"] = "我还会从黄泉比良坂回来的……", } + return extension diff --git a/util.lua b/util.lua index 5601b204531890fa3254de886150ec135a81793a..ce442c82778c66267461f9607289a45b5174d306 100644 --- a/util.lua +++ b/util.lua @@ -480,12 +480,15 @@ H.doCommand = function(to, skill_name, index, from, forced) ret = ret .. " " .. Fk:translate("chose") .. " " .. Fk:translate(result) .. "" room:doBroadcastNotify("ServerMessage", ret) --]] - if choice == "Cancel" then return false end local commandData = { from = from, to = to, command = index, } + if choice == "Cancel" then + room.logic:trigger("fk.AfterCommandUse", to, commandData) + return false + end if room.logic:trigger("fk.ChooseDoCommand", to, commandData) then room.logic:trigger("fk.AfterCommandUse", to, commandData) return true @@ -978,6 +981,24 @@ H.transformGeneral = function(room, player, isMain, isHidden) end end room:setPlayerMark(player, isMain and "__heg_general" or "__heg_deputy", general) + if not isHidden then + room:changeHero(player, general, false, not isMain, true, false, false) + else + -- 暗置变更 + local lose = Fk.generals[orig] + local general = isMain and Fk.generals[player:getMark("__heg_general")] or Fk.generals[player:getMark("__heg_deputy")] + room:setPlayerGeneral(player, "anjiang", isMain) + local skills = table.connect(general.skills, table.map(general.other_skills, Util.Name2SkillMapper)) + local location = isMain and "d" or "m" + for _, s in ipairs(skills) do + if s.relate_to_place ~= location then + addHegSkill(player, s, room) + end + end + for _, s in ipairs(lose:getSkillNameList()) do + room:handleAddLoseSkills(player, "-"..s, nil) + end + end room.logic:trigger("fk.GeneralTransformed", player, orig) end