Esempio n. 1
0
        public void Add(ICombatOwner attacker, Vector2 attackDir, float hitTime)
        {
            if (attacker != null)
            {
                AttackInfo info = new AttackInfo();
                info.Attacker  = attacker;
                info.attackDir = attackDir;
                info.HitTime   = hitTime;


                if (attacker.CombatType <= eCombatType.Hero)
                {
                    m_attackerList.AddLast(info);
                }
                else
                {
                    m_attackerMonsterList.AddLast(info);
                }
            }
        }
Esempio n. 2
0
        /*
         * public IEntity CreateEntity(EntityInfo info, AnimationEventStates animationEventStates)
         * {
         *  LevelBase level = Global.SceneGraphMgr.WorldLevelRoot.GetLevel(info.CombatType);
         *
         *  ObjectMain objectMain = null;
         *  if (info.CombatType == eCombatType.Anim)
         *  {
         *      ObjectAnimMain objectAnimMain = Global.FactoryMgr.CreatePoolComponent<ObjectAnimMain>(info.ActorAsset.PathType, info.ActorAsset.Path,
         *          info.ActorAsset.Pos, info.ActorAsset.Rotate, level.transform);
         *
         *      if (animationEventStates == null)
         *      {
         *          animationEventStates = Global.FactoryMgr.CreateAnimationEvent(info.ActorAsset.PathType, info.ActorAsset.AnimationEventPath);
         *      }
         *
         *      objectAnimMain.Initialize(animationEventStates);
         *
         *      objectMain = objectAnimMain;
         *
         *  }
         *  else
         *  {
         *      objectMain = Global.FactoryMgr.CreatePoolComponent<ObjectMain>(info.ActorAsset.PathType, info.ActorAsset.Path,
         *          info.ActorAsset.Pos, info.ActorAsset.Rotate, level.transform);
         *  }
         *
         *  IEntity entity = MakeEntity(info, objectMain);
         *
         *  objectMain.Lock();
         *
         *  ActorRoot root = new ActorRoot();
         *  root.AttachChild(objectMain);
         *
         *  AttachActor(level, root);
         *
         *  return entity;
         * }
         *
         * private IEntity MakeEntity(EntityInfo info, ObjectMain objectMain)
         * {
         *  IEntity entity = null;
         *  if (info.CombatType == eCombatType.Static)
         *  {
         *      entity = new StaticEntity(info, objectMain);
         *  }
         *  else if (info.CombatType == eCombatType.Anim)
         *  {
         *      entity = new AnimEntity(info, objectMain);
         *  }
         *
         *  if (entity != null)
         *  {
         *      entity.Initialize();
         *  }
         *  return entity;
         * }
         *
         * public void DestroyEntity(IEntity entity)
         * {
         *  eCombatType combatType = entity.CombatType;
         *
         *  Remove(entity.CombatType, entity.NetID);
         *
         *  IGraphNodeGroup parentnode = entity.Main.Parent as IGraphNodeGroup;
         *  Debug.Assert(parentnode != null);
         *
         *  entity.Terminate();
         *
         *  LevelBase level = Global.SceneGraphMgr.WorldLevelRoot.GetLevel(combatType);
         *  DetachActor(level, parentnode);
         * }
         */

        public void KillAllNPCs(bool awardXP)
        {
            IEntity             attacker  = null;
            List <ICombatOwner> lstActors = new List <ICombatOwner>();

            if (GetCombats(eCombatType.Monster, ref lstActors))
            {
                if (lstActors.Count <= 0)
                {
                    return;
                }
            }
            if (m_hero != null)
            {
                attacker = m_hero;
            }

            for (int i = 0; i < lstActors.Count; i++)
            {
                ICombatOwner actor = lstActors[i];
                //NetBattleHandler.SendDead(attacker.NetID, actor.NetID, 13, 0, 0, TimeManager.serverTick);
            }
        }
Esempio n. 3
0
 //public DamageInfo() { }
 public DamageInfo(ICombatOwner attacker, ICombatOwner defender)
 {
     Attacker = attacker;
     Defender = defender;
 }
Esempio n. 4
0
        public void Insert(ICombatOwner actor)
        {
            CombatRepository repository = GetRepository(actor.CombatType);

            repository.Insert(actor);
        }