public static NTGBattleMemberSkillBehaviour GetBattleMemberSkillBehaviour(int behaviourId) { var newBehavLua = (LuaTable)((LuaTable)data["SkillBehavioursData"])[behaviourId.ToString()]; var memberSkillBehaviourLua = new NTGBattleMemberSkillBehaviour(); memberSkillBehaviourLua.Id = Convert.ToInt32(newBehavLua["Id"]); { var Param = (LuaTable)newBehavLua["Param"]; var param = Param.ToArray(); memberSkillBehaviourLua.Param = new float[param.Length]; for (int i = 0; i < param.Length; i++) { memberSkillBehaviourLua.Param[i] = Convert.ToSingle(param[i]); } } memberSkillBehaviourLua.Range = Convert.ToSingle(newBehavLua["Range"]); memberSkillBehaviourLua.Speed = Convert.ToSingle(newBehavLua["Speed"]); memberSkillBehaviourLua.Duration = Convert.ToSingle(newBehavLua["Duration"]); memberSkillBehaviourLua.Pretime = Convert.ToSingle(newBehavLua["PreTime"]); memberSkillBehaviourLua.Stiff = Convert.ToSingle(newBehavLua["Stiff"]); memberSkillBehaviourLua.BaseValue = Convert.ToSingle(newBehavLua["BaseValue"]); memberSkillBehaviourLua.PAdd = Convert.ToSingle(newBehavLua["PAtkAdd"]); memberSkillBehaviourLua.MAdd = Convert.ToSingle(newBehavLua["MAtkAdd"]); memberSkillBehaviourLua.HPAdd = Convert.ToSingle(newBehavLua["HpAdd"]); memberSkillBehaviourLua.MPAdd = Convert.ToSingle(newBehavLua["MpAdd"]); memberSkillBehaviourLua.EffectType = Convert.ToInt32(newBehavLua["DamageType"]); memberSkillBehaviourLua.Mask = Convert.ToInt32(newBehavLua["Mask"]); memberSkillBehaviourLua.Shock = Convert.ToString(newBehavLua["Shock"]); return(memberSkillBehaviourLua); }
private void Load(NTGBattleMemberSkillBehaviour behav) { behaviour = behav; id = behav.Id; param = behav.Param; range = behav.Range; speed = behav.Speed; duration = behav.Duration; pretime = behav.Pretime; stiff = behav.Stiff; baseValue = behav.BaseValue; pAdd = behav.PAdd; mAdd = behav.MAdd; hpAdd = behav.HPAdd; mpAdd = behav.MPAdd; effectType = (EffectType)behav.EffectType; mask = behav.Mask; shock = behav.Shock; }
public virtual void Init(NTGBattleUnitController owner, NTGBattleUnitController shooter = null, NTGBattleSkillController skillController = null, NTGBattleMemberSkillBehaviour behav = null, float[] p = null, string[] sp = null) { this.owner = owner; this.shooter = shooter; this.skillController = skillController; if (behav != null) { Load(behav); } this.p = p; this.sp = sp; FXReset(); if (audioController != null) { audioController.Init(); } foreach (var ls in GetComponents <NTGLuaScript>()) { if (ls.luaScript.Substring(0, ls.luaScript.LastIndexOf(".")) == "Logic.Battle.Skill") { //ls.LuaCall("Init", fxAnchor, owner, p, sp); } } }