1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
RemoveGeneral_Skill = sgs.CreateTriggerSkill{
name = "RemoveGeneral_Skill",
events = {sgs.MarkChanged, sgs.TurnStart},
global = true,
frequency = sgs.Skill_Compulsory,
on_trigger = function(self, event, player, data)
if event == sgs.MarkChanged then
local mark = data:toMark()
if mark.name == "@RemoveGeneral" then
local skills = player:getVisibleSkillList()
local room = player:getRoom()
if player:getMark("@RemoveGeneral")>0 then
for _, skill in sgs.qlist(skills) do
room:addPlayerMark(player, "Qingcheng"..skill:objectName())
end
else
for _, skill in sgs.qlist(skills) do
room:removePlayerMark(player, "Qingcheng"..skill:objectName())
end
end
end
elseif event == sgs.TurnStart then
local room = player:getRoom()
if player:getMark("@RemoveGeneral")>0 then
room:setPlayerMark(player, "@RemoveGeneral", 0)
local msg = sgs.LogMessage()
msg.type = "#RemoveGeneralBack"
msg.from = player
room:sendLog(msg)
return true
end
end
end,
can_trigger = function(self, target)
return target ~= nil
end,
priority = 12
}
local RemoveGeneral_SkillList=sgs.SkillList()
if not sgs.Sanguosha:getSkill("RemoveGeneral_Skill") then
RemoveGeneral_SkillList:append(RemoveGeneral_Skill)
end
sgs.Sanguosha:addSkills(RemoveGeneral_SkillList)
|
|
My Lua Products
I have finished or been updating many(actually just 2 project) Lua Package.
●Goddess.lua: The Goddess Package. At the beginning, I planned to add the unoffical goddess generals into QSanguosha. The package updated lastly on November 2, 2017. Because of the second project, this project paused. Now this package contain the goddess generals, unoffical generals and the opinions of online friends. The download password is isfb.
●●Goddess Package[Internet Needed]
●●Download Goddess Package [Internet Needed]
●Left Program: The system of remove generals. It's picked from Goddess.lua. Old Version Application doesn't support this program because of MarkChanged, a event appear in new version.
|