Powered By Adobe Dreamweaver CC 2017 & Notepad++ & Microsoft Visual Studio 2017

Made By Michael Xiaohao Zhang

QSanguosha Lua Package

Index

Hometown

Family

Experiences

Mogic

Others


About QSanguosha

  QSanguosha is a free open source LTK(Legends of the Three Kingdoms) game made by Moligaloo and his Mogara Group. Of course, it's not a offical application. It's powered by C++ Qt Framework. It was built in 2010 and it had updated and been maintained until 2015. Besides the offical LTK cards, there are many innovative cards you can play in the game like Yitian Package and Yi Package. Now, the newest personal version updated on December 12, 2017. It can be download in QSanguosha Post Bar.

●The Surface of this Application

About Lua Language

  Lua Language is a kind of lightweight and quick Sprict Language. It was made by Computer Graphics Technology Group at the Pontifical Catholic University of Rio de Janeiro, in Brazil in 1993, which is based on Standard C Language. You can use the lua for writing a sprict to embed into the main application so it's used widely especially in games such as WOW and EU.

  QSanguosha provides a port for you, the Lua. You can create a general or a card by Lua Sprict if you want. QSanguosha offers a number of easy and understanding function to make the Lua more easily. And then you just need to put it into certain location and your sprict will be run.

●Lua

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.


  ●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.

Copyright ©2018 "Changer S.M." Juvenile Class of XJTU
Builder:Small M.

B304, General Building, Nankai High School, No.36, Nankai 4th Road, Nankai, Tianjin, China
Tel:+8615628879568 Twitter:@michaelxiaohao

Thanks to: Github.io

Choose Language

English 简体中文
繁體中文 日本語

Pусский

Deutsch
Español العربية
Français Portugues

Ελληνικά

한국어