灵儿吧 关注:38,527贴子:855,489

已经在编写仙剑杀的lua包了,你们要赞我给点动力啊。

只看楼主收藏回复

lixiaoyao = sgs.General(extension, "lixiaoyao", "qun", "4")
LuaYujian = sgs.CreateDistanceSkill{
name = "LuaYujian",
correct_func = function(self, from, to)
if from:hasSkill("LuaYujian") then
return -1
end
if to:hasSkill("LuaYujian") then
return 1
end
end,
}
LuaTanyun = sgs.CreateViewAsSkill{
name = "LuaTanyun",
n = 1,
view_filter = function(self, selected, to_select)
return to_select:getSuit() == sgs.Card_Diamond
end,
view_as = function(self, cards)
if #cards == 0 then
return nil
elseif #cards == 1 then
local card = cards[1]
local suit = card:getSuit()
local point = card:getNumber()
local id = card:getId()
local snatch = sgs.Sanguosha:cloneCard("snatch", suit, point)
snatch:addSubcard(id)
snatch:setSkillName(self:objectName())
return snatch
end
end
}
lixiaoyao:addSkill(LuaYujian)
lixiaoyao:addSkill(LuaTanyun)
zhaolinger = sgs.General(extension, "zhaolinger", "god", "5",false)
LuaHuanhun = sgs.CreateTriggerSkill{
name = "LuaHuanhun",
events = {sgs.Dying},
on_trigger = function(self, event, player, data)
local room = player:getRoom()
local dying = data:toDying()
local dier = dying.who
if(player ~= dier) then
if dier:getHp() < 1 and player:askForSkillInvoke(self:objectName(), data) then
local recover = sgs.RecoverStruct()
recover.who = dier
recover.recover = 1
room:recover(dier, recover)
room:setPlayerProperty(player, "hp", sgs.QVariant(player:getHp()-1))
end
end
return false
end
}
LuaLeizhou = sgs.CreateTriggerSkill{
name = "LuaLeizhou" ,
events = {sgs.CardResponded} ,
on_trigger = function(self, event, player, data)
local card_star = data:toCardResponse().m_card
local room = player:getRoom()
if card_star:isKindOf("Jink") then
local target = room:askForPlayerChosen(player, room:getAlivePlayers(), self:objectName(), "LuaLeizhou-invoke", true, true)
if target then
local judge = sgs.JudgeStruct()
judge.pattern = ".|spade"
judge.good = false
judge.negative = true
judge.reason = self:objectName()
judge.who = target
room:judge(judge)
if judge:isBad() then
room:damage(sgs.DamageStruct(self:objectName(), player, target, 2, sgs.DamageStruct_Thunder))
end
end
end
return false
end
}
zhaolinger:addSkill(LuaHuanhun)
zhaolinger:addSkill(LuaLeizhou)
sgs.LoadTranslationTable{
["xianjian"] = "仙剑包",
["lixiaoyao"] = "李逍遥",
["&lixiaoyao"] = "李逍遥",
["#lixiaoyao"] = "仗剑江湖",
["LuaYujian"] = "御剑",
[":LuaYujian"] = "你计算的与其他角色的距离-1,其他角色计算与你的距离+1。",
["LuaTanyun"] = "探云",
[":LuaTanyun"] = "你可把将[表情]牌视为[顺手牵羊]使用。",
["zhaolinger"] = "赵灵儿",
["&zhaolinger"] = "赵灵儿",
["#zhaolinger"] = "女娲后裔",
["LuaHuanhun"] = "还魂",
[":LuaHuanhun"] = "若有角色处于濒死状态,你可以损失1点生命,为其回复1点生命。",
["LuaLeizhou"] = "雷咒",
[":LuaLeizhou"] = "每当你使用或打出一张【闪】时,你可以令一名角色进行判定:若结果为[表情],你对该角色造成2点雷电伤害。"
}


来自Android客户端1楼2015-08-31 19:23回复
    @凇_ @空舞蝶梦


    来自Android客户端2楼2015-08-31 19:38
    回复
      2025-05-22 14:49:24
      广告


      IP属地:云南来自Android客户端3楼2015-08-31 19:56
      回复
        完全看不懂,所以赞一个吧。


        来自iPhone客户端7楼2015-09-01 08:17
        回复
          好难啊,目前只设计好几个主角的


          来自Android客户端8楼2015-09-01 13:15
          回复
            我去,分分钟给程序员跪……
            完全看不懂,回去研究下~


            IP属地:江苏9楼2015-09-01 16:40
            回复
              想技能很麻烦啊你们可以帮我忙啊写下人物还有技能,剩下的就交给我了。谢谢了


              来自Android客户端10楼2015-09-01 16:53
              收起回复
                不明觉厉


                IP属地:安徽来自Android客户端11楼2015-09-02 11:00
                回复
                  2025-05-22 14:43:24
                  广告
                  不明觉厉,但是点个赞


                  来自Android客户端12楼2015-09-04 20:21
                  回复
                    没用过
                    但是按你这代码风格
                    1000行代码之后铁定得跪。。。


                    IP属地:广东13楼2015-09-06 11:54
                    回复
                      你这个要多写写注释,不然过段时间自己都看不懂了


                      IP属地:上海来自iPhone客户端14楼2015-09-06 23:22
                      收起回复
                        确实,还是要多写一点注释~


                        IP属地:广东15楼2015-09-08 05:28
                        回复
                          怕怕


                          IP属地:山东16楼2015-09-08 07:49
                          回复