Ejemplo n.º 1
0
        public static void AddCharacters(IEnumerable <BaseCharacter> characters)
        {
            List <BaseDamageEntity> damageEntities = new List <BaseDamageEntity>();

            foreach (BaseCharacter character in characters)
            {
                if (character == null || AllCharacters.ContainsKey(character.DataId))
                {
                    continue;
                }

                AllCharacters[character.DataId] = character;
                if (character is PlayerCharacter)
                {
                    PlayerCharacter playerCharacter = character as PlayerCharacter;
                    PlayerCharacters[character.DataId] = playerCharacter;
                }
                else if (character is MonsterCharacter)
                {
                    MonsterCharacter monsterCharacter = character as MonsterCharacter;
                    MonsterCharacters[character.DataId] = monsterCharacter;
                    MissileDamageEntity missileDamageEntity = monsterCharacter.damageInfo.missileDamageEntity;
                    if (missileDamageEntity != null)
                    {
                        damageEntities.Add(missileDamageEntity);
                    }
                }
            }
            AddDamageEntities(damageEntities);
        }
Ejemplo n.º 2
0
        public static void AddSkills(IEnumerable <Skill> skills)
        {
            List <GameEffectCollection> effects        = new List <GameEffectCollection>();
            List <BaseDamageEntity>     damageEntities = new List <BaseDamageEntity>();

            foreach (Skill skill in skills)
            {
                if (skill == null || Skills.ContainsKey(skill.DataId))
                {
                    continue;
                }
                Skills[skill.DataId] = skill;
                effects.Add(skill.castEffects);
                effects.Add(skill.hitEffects);
                MissileDamageEntity missileDamageEntity = skill.damageInfo.missileDamageEntity;
                if (missileDamageEntity != null)
                {
                    damageEntities.Add(missileDamageEntity);
                }
            }
            AddGameEffectCollections(effects);
            AddDamageEntities(damageEntities);
        }