太阳神三国杀lua吧 关注:2,644贴子:73,380
  • 10回复贴,共1

【求助】我已经做好一个技能,但是不会做AI,拜托大佬

只看楼主收藏回复

内容如下
LuaLeishi = sgs.CreateViewAsSkill{
name = "LuaLeishi",
n = 0,
view_as = function(self, cards)
local card = LeishiCard:clone()
return card
end,
enabled_at_play = function(self, player)
return player:getMark("@qlaaa") >= 1 and not player:hasUsed("#LeishiCard")
end
}
技能描述:出牌阶段限一次,你可以弃置一枚“雷电”标记并指定一名目标,对其造成两点雷属性伤害。
求大佬帮我做一个AI


IP属地:河北1楼2018-05-25 11:05回复
    自顶


    IP属地:河北来自Android客户端3楼2018-05-27 09:46
    回复
      local LuaLeishi_skill = {}
      LuaLeishi_skill.name = "LuaLeishi"
      table.insert(sgs.ai_skills, LuaLeishi_skill)
      LuaLeishi_skill.getTurnUseCard = function(self)
      if self.player:getMark("@qlaaa") >= 1 and not self.player:hasUsed("#LeishiCard") then
      return sgs.Card_Parse("#LeishiCard:.:")
      end
      end
      sgs.ai_skill_use_func["#LeishiCard"] = function(card, use, self)
      self:sort(self.enemies, "defense")
      for _, enemy in ipairs(self.enemies) do
      if self:damageIsEffective(enemy, sgs.DamageStruct_Thunder) then
      use.card = card
      if use.to then use.to:append(enemy) end
      return
      end
      end
      end


      IP属地:北京5楼2018-05-27 11:01
      收起回复
        我唱这么走心,却走不进你心里


        IP属地:河北来自iPhone客户端6楼2018-05-27 19:19
        收起回复