예제 #1
0
        private void NpcSkillAttackInternal(RoleView target, NpcSkillAttackEvent evData)
        {
            var       skillKey  = evData.bUseSkill ? AnimNames.Skill : AnimNames.Attack;
            SkillData skillData = null;

            roleData.skills.TryGetValue(skillKey, out skillData);
            if (skillData != null)
            {
                var targetFrameAction = new FrameActionData();  //被击者
                targetFrameAction.currHp      = evData.currHp;
                targetFrameAction.maxHp       = evData.maxHp;
                targetFrameAction.amount      = evData.amount;
                targetFrameAction.bPlaySound  = evData.bPlaySound;
                targetFrameAction.type        = FrameActionType.Passive;
                targetFrameAction.skillParams = skillData.skillParams;
                target.OnTakeDamage(targetFrameAction);

                var myFrameAction = new FrameActionData();      //攻击者
                myFrameAction.type         = FrameActionType.Active;
                myFrameAction.skillParams  = skillData.skillParams;
                myFrameAction.bPlaySound   = evData.bPlaySound;
                myFrameAction.target       = target;
                myFrameAction.animClipName = evData.bUseSkill ? AnimNames.Skill : AnimNames.Attack;
                timerMgr.AddFrameActions(skillData.frameDatas, myFrameAction, OnFrameAction);
            }
            else
            {
                GLogger.Red("!!!NpcSkillAttackInternal:>>" + evData.attackerid + " " + evData.defenderid + " " + evData.bUseSkill);
            }
        }
예제 #2
0
        public override void Enter()
        {
            base.Enter();
            mynpcId   = npcFsm.GetVar <long>("mynpcId");
            myNpcData = npcDataMgr.GetNpcData(mynpcId.value);
            GLogger.Red(mynpcId.value + " enter Death...");

            DoNpcDeath();
        }
예제 #3
0
        /// <summary>
        /// 战斗结束
        /// </summary>
        private void OnBattleEnd(GameEventData eventData)
        {
            var battleEndEvent = eventData.evParam as BattleEndEvent;
            var battleType     = battleEndEvent.type;

            if (battleType == BattleType.TurnBase)
            {
                Util.CallLuaMethod("LeaveDungeon", (Action) delegate()
                {
                    GLogger.Red("BattleEnd---->>>" + battleType);
                });
            }
            else
            {
                GLogger.Red("BattleEnd---->>>" + battleType);
            }
        }