用m佬新框架的写法 仅提供思路,不保证无错
local module = ModuleBase:createModule('XXXXX')
function module:aaaTest(battleIndex)
for BWhile=10,19 do
local PlayerIndex = Battle.GetPlayer(battle,BWhile);
if(VaildChar(PlayerIndex)==true) then
if(Char.GetData(PlayerIndex,%对象_名字%) ~= "取消检测") then
for BPWhile=0,4 do
local BPlayerIndex = Battle.GetPlayer(battle,BPWhile);
if(BPlayerIndex >= 0) then
local ground = Char.GetData(PlayerIndex,%对象_地属性%);
local water = Char.GetData(PlayerIndex,%对象_水属性%);
local fire = Char.GetData(PlayerIndex,%对象_火属性%);
local wind = Char.GetData(PlayerIndex,%对象_风属性%);
local xue = Char.GetData(PlayerIndex,%对象_血%);
local combat = Char.GetData(PlayerIndex,%对象_攻击力%);
local level = Char.GetData(PlayerIndex,%对象_等级%);
NLG.TalkToCli(BPlayerIndex,-1,"[".. BWhile.."]"..Char.GetData(PlayerIndex,%对象_名字%).." 等级".. level..",属性 地".. ground.." 水".. water.." 火".. fire.." 风".. wind..",生命值".. xue..",攻击力".. combat.."",%颜色_黄色%,%字体_小%); end
end
end
end
end
end
function module:onLoad()
self:logInfo('load')
self:regCallback('BeforeBattleTurnStartEvent', Func.bind(self.aaaTest, self))
end
function module:onUnload()
self:logInfo('unload')
end
return module
|