Пример #1
0
        protected virtual bool InitTplData(IActorInitBase initBase)
        {
            var init = initBase as NpcInit;

            if (null == init)
            {
                return(false);
            }

            mNpcData.TemplateId = init.Data.tid;
            if (null == NPCData.Template)
            {
                return(false);
            }

            mNpcData.RoleName = NPCData.Template.name;
            mDeadBodyTime     = mNpcData.Template.deadBodyTime;
            SkillMgr.Init(this, mNpcData);

            mCurrentSpellID    = SkillMgr.getElementByIndex(0).ID;
            mCastSpellDistance = NPCData.Template.distance;
            mSpellType         = (ushort)eSkillTargetType.Enemy;

            BaseGameLogic <INPCLogic> bgLogic = (BaseGameLogic <INPCLogic>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.NPCLogic, (short)mNpcData.Template.logic);

            if (null != bgLogic)
            {
                mLogic = bgLogic.Logic;
            }

            mState = eNPCState.Idle;

            return(true);
        }
Пример #2
0
        public bool InitLogic()
        {
            BaseGameLogic <ITaskObjective> bgLogic = (BaseGameLogic <ITaskObjective>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.TaskLogic, (short)mTaskData.Template.EventType);

            if (null == bgLogic)
            {
                return(false);
            }

            mObjective = bgLogic.Logic;

            return(mObjective.OnInit(this));
        }
Пример #3
0
        public bool InitLogic()
        {
            if (null == mCopyTplData)
            {
                return(false);
            }

            BaseGameLogic <IInstanceObjective> bgLogic = (BaseGameLogic <IInstanceObjective>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.InstanceLogic, (short)mCopyTplData.logic);

            if (null == bgLogic)
            {
                return(false);
            }

            mObjective = bgLogic.Logic;

            return(mObjective.OnInit(this));
        }
Пример #4
0
        public bool Init(AcceptAchieveData _data)
        {
            data    = _data;
            data.id = mTemplate.id;
            if (data.targetNum >= mTemplate.targetNum)
            {
                return(false);
            }

            BaseGameLogic <IAchieveObjective> bgLogic = (BaseGameLogic <IAchieveObjective>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.AchieveLogic, (short)mTemplate.type);

            if (null == bgLogic)
            {
                return(false);
            }

            mObjective = bgLogic.Logic;

            return(mObjective.OnInit(this));
        }
Пример #5
0
        /// <summary>
        /// 初始化行动组
        /// </summary>
        public bool InitActionGroup()
        {
            mActionGroupData = new ActionGroup(0);
            BaseGameLogic <ISkillLogic> actionLogic = (BaseGameLogic <ISkillLogic>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.SkillLogic, (short)mData.action);

            if (null != actionLogic)
            {
                mActionGroupData.actions.Add(new Action(actionLogic.Logic));
            }

            if (mLvData.buff1ids > 0)
            {
                actionLogic = (BaseGameLogic <ISkillLogic>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.SkillLogic, (short)eSkillLogic.Effect);
                if (null != actionLogic)
                {
                    Action action = new Action(actionLogic.Logic);
                    action.actionParams.Add(mLvData.buff1ids);
                    action.actionParams.Add(mLvData.buff1level);
                    action.actionParams.Add(mLvData.buff1TarType);
                    action.actionParams.Add(mLvData.buff1Rate);
                    mActionGroupData.actions.Add(action);
                }
            }

            if (mLvData.buff2ids > 0)
            {
                actionLogic = (BaseGameLogic <ISkillLogic>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.SkillLogic, (short)eSkillLogic.Effect);
                if (null != actionLogic)
                {
                    Action action = new Action(actionLogic.Logic);
                    action.actionParams.Add(mLvData.buff2ids);
                    action.actionParams.Add(mLvData.buff2level);
                    action.actionParams.Add(mLvData.buff2TarType);
                    action.actionParams.Add(mLvData.buff2Rate);
                    mActionGroupData.actions.Add(action);
                }
            }

            return(true);
        }
Пример #6
0
        public float mCastSpellDistance; //攻击距离

        public bool InitState()
        {
            BaseGameLogic <IPlayerLogic> bgLogic = (BaseGameLogic <IPlayerLogic>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.PlayerLogic, (short)ePlayerLogicType.Robot);

            if (null == bgLogic)
            {
                return(false);
            }

            mLogic = bgLogic.Logic;

            if (IsDie)
            {
                mState = ePlayerState.None;
            }
            else
            {
                mState = ePlayerState.Idle;
            }

            return(true);
        }
Пример #7
0
        public Action mAction; //当前行动

        public override bool Init(int tid, byte lv)
        {
            mData   = CSTable.StaticDataManager.SkillActive[tid];
            mLvData = CSTable.StaticDataManager.SkillLevel[tid, lv];

            if (null == mData || null == mLvData)
            {
                return(false);
            }

            BaseGameLogic <ISkillSelector> selectorLogic = (BaseGameLogic <ISkillSelector>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.SkillSelector, (short)mData.selector);

            if (null != selectorLogic)
            {
                mSelector = selectorLogic.Logic;
            }

            BaseGameLogic <ISkillChecker> checkerLogic = (BaseGameLogic <ISkillChecker>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.SkillChecker, (short)mData.checker);

            if (null != checkerLogic)
            {
                mChecker = checkerLogic.Logic;
            }

            BaseGameLogic <ISkillConsumer> consumerLogic = (BaseGameLogic <ISkillConsumer>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.SkillConsumer, (short)mData.consumer);

            if (null != consumerLogic)
            {
                mConsumer = consumerLogic.Logic;
            }

            InitActionGroup();

            //已学会技能
            mStatus = eSkillStatus.Valid;

            return(true);
        }
Пример #8
0
        protected override bool InitTplData(IActorInitBase initBase)
        {
            var init = initBase as NpcInit;

            if (null == init)
            {
                return(false);
            }

            mNpcData.TemplateId = init.Data.tid;
            BaseGameLogic <INPCLogic> bgLogic = (BaseGameLogic <INPCLogic>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.NPCLogic, (short)eNPCLogicType.PlayerImage);

            if (null == bgLogic)
            {
                return(false);
            }

            mLogic             = bgLogic.Logic;
            mNpcData.RoleMaxHp = mPlayerData.value.MaxHP;
            mState             = eNPCState.None;

            return(true);
        }
Пример #9
0
 public BaseSkillLogic()
 {
     mInstance = new BaseGameLogic <ISkillLogic>(eGameLogicType.SkillLogic, (short)this.LogicType, this);
 }
Пример #10
0
 public BaseInstanceObjective()
 {
     mInstance = new BaseGameLogic <IInstanceObjective>(eGameLogicType.InstanceLogic, (short)this.LogicType, this);
 }
Пример #11
0
 public BasePlayerLogic()
 {
     mInstance = new BaseGameLogic <IPlayerLogic>(eGameLogicType.PlayerLogic, (short)this.LogicType, this);
 }
Пример #12
0
 public BaseSkillChecker()
 {
     mInstance = new BaseGameLogic <ISkillChecker>(eGameLogicType.SkillChecker, (short)this.CheckerType, this);
 }
Пример #13
0
 public BaseNPCLogic()
 {
     mInstance = new BaseGameLogic <INPCLogic>(eGameLogicType.NPCLogic, (short)this.LogicType, this);
 }
Пример #14
0
 public BaseTaskObjective()
 {
     mInstance = new BaseGameLogic <ITaskObjective>(eGameLogicType.TaskLogic, (short)this.LogicType, this);
 }
Пример #15
0
 public BaseSkillSelector()
 {
     mInstance = new BaseGameLogic <ISkillSelector>(eGameLogicType.SkillSelector, (short)this.SelectorType, this);
 }
Пример #16
0
 public BaseAchieveObjective()
 {
     mInstance = new BaseGameLogic <IAchieveObjective>(eGameLogicType.AchieveLogic, (short)this.LogicType, this);
 }