--作者: 何健 --日期: 2019-09-05 --文件: NatureFabaoData.lua --模块: NatureFabaoData --描述: 法宝数据系统子类继承NatureBaseData ------------------------------------------------ local NatureBase = require "Logic.Nature.NatureBaseData" local SkillSetDate = require "Logic.Nature.NatureSkillSetData" local ModelData= require "Logic.Nature.NatureBaseModelData" local FashionData = require "Logic.Nature.NatureFashionData" local BaseItemData = require "Logic.Nature.NatureBaseItemData" local RedPointCustomCondition = CS.Thousandto.Code.Logic.RedPointCustomCondition local NatureFabaoData = { Cfg = nil , --阵法配置表数据 IsMax = 0, --阵法最大等级 super = nil, --父类对象 BreakItem = List:New() --突破道具 } function NatureFabaoData:New() local _obj = NatureBase:New(NatureEnum.FaBao) local _M = Utils.DeepCopy(self) _M.super = _obj return _M end --初始化技能 function NatureFabaoData:Initialize() --初始化化形数据 DataConfig.DataHuaxingfabao:Foreach(function(k, v) if v.IfFashion == 1 and v.IsIgnore == 1 then local _data = FashionData:New(v) if v.Type ~= 1 then self.super.FishionList:Add(_data) end end end) self.super.FishionList:Sort( function(a,b) return tonumber(a.SortNum) < tonumber(b.SortNum) end ) end --反初始化 function NatureFabaoData:UnInitialize() self.Cfg = nil self.super = nil self.IsMax = 0 end --初始化服务器数据 function NatureFabaoData:InitWingInfo(msg) if msg and msg.natureInfo then self.Cfg = DataConfig.DataHuaxingfabao[msg.natureInfo.curLevel] self.super:UpDateModel(msg.natureInfo.haveActiveModel) --设置模型 self.super:UpDataFashionInfos(msg.natureInfo.outlineInfo) --设置化形 self.super:Parase(msg.natureType,msg.natureInfo) self.super:UpDateFashionHit(FunctionStartIdCode.FaBaoHuaxing) self.super:UpDateDrugHit(FunctionStartIdCode.FaBaoDrug) end end --更新设置模型ID function NatureFabaoData:UpDateModelId(model) self.super.CurModel = model end --更新化形升级结果 function NatureFabaoData:UpDateFashionInfo(msg) local _info = DataConfig.DataHuaxingfabao[msg.id] self.super:UpDataFashion(msg,_info) self.super:UpDateFashionHit(FunctionStartIdCode.FaBaoHuaxing) end function NatureFabaoData:GetDamage(modelID) local _damage = 0 if self.super.FishionList then --化形 self.super.FishionList:Find( function(code) if code.IsActive then local _numArr = Utils.SplitNumber(code.Cfg.Fabaohit, "_") if not modelID then if #_numArr >= 2 then _damage = _damage + _numArr[1] + _numArr[2] * code.Level end else if modelID > 0 and code.ModelId == modelID then _damage = _numArr[1] + _numArr[2] * code.Level return true end end end end ) end return _damage end --功能函数!!!!!!!!!!!!!!! --是否满级了 function NatureFabaoData:IsMaxLevel() return self.IsMax <= self.super.Level end --获取模型相机大小 function NatureFabaoData:Get3DUICamerSize(modelid) local _info = DataConfig.DataHuaxingfabao[modelid] if _info then return _info.CameraSize end return 1 end function NatureFabaoData:GetModelYPosition(modelid) local _info = DataConfig.DataHuaxingfabao[modelid] if _info and _info.ModelYPos then return _info.ModelYPos / self:Get3DUICamerSize(modelid) end return 0 end function NatureFabaoData:GetShowModelYPosition(modelid) local _info = DataConfig.DataHuaxingfabao[modelid] if _info and _info.ShowModelYPos then return _info.ShowModelYPos / self:Get3DUICamerSize(modelid) end return 0 end --更新服务器过来的属性数据 function NatureFabaoData:UpDateMsgWeaponInfo(weaponsInfo) if weaponsInfo then for i=1,#weaponsInfo do local _info = self.super.AttrList:Find( function(code) return code.AttrID == weaponsInfo[i].id end ) if _info then _info.Attr = weaponsInfo[i].value end end end end --得到属性值是否可以突破 function NatureFabaoData:GetAttrIsBreak() if self.super.AttrList then for i=1,#self.super.AttrList do if self.super.AttrList[i].Attr < self.super.AttrList[i].AddAttr then return false end end return true end return false end --更新吃果子信息 function NatureFabaoData:UpDateGrugInfo(msg) self.super.Fight = msg.fight self.super:UpDateDrug(msg.druginfo) self.super:UpDateDrugHit(FunctionStartIdCode.FaBaoDrug) end return NatureFabaoData