protected override bool OnCollision(Entity Entity, EntityClassification Classification)
 {
     var se = Entity.GetComponent<StatusEffectsComponent>();
     if (se == null)
         return false;
     var seac = this.GetDependency<StatusEffectPropertiesComponent>();
     se.ApplyStatusEffect(seac.StatusEffectAttributes);
     return true;
 }
Ejemplo n.º 2
0
 protected override bool OnCollision(Entity Entity, EntityClassification Classification)
 {
     var pc = Entity.GetComponent<PhysicsComponent>();
     if (pc == null)
         return false;
     CorvEngine.AudioManager.PlaySoundEffect(LaunchSound);
     pc.Velocity = LaunchVelocity;
     return true;
 }
Ejemplo n.º 3
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            if(ReloadScene)
                CorvusGame.Instance.SceneManager.ReloadScenes(false);
            if (string.IsNullOrEmpty(SpawnID))
                CorvusGame.Instance.SceneManager.ChangeScene(NextLevel, false);
            else
                CorvusGame.Instance.SceneManager.ChangeScene(NextLevel, false, SpawnID);

            return true;
        }
Ejemplo n.º 4
0
 protected override bool OnCollision(Entity Entity, EntityClassification Classification)
 {
     var sc = Entity.GetComponent<ScoreComponent>();
     sc.Coins += Value;
     var ftc = Entity.GetComponent<FloatingTextComponent>();
     if (ftc != null)
         ftc.Add("+" + Value.ToString(), Color.Gold);
     AudioManager.PlaySoundEffect("CoinPickup");
     Parent.Dispose();
     return true;
 }
Ejemplo n.º 5
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            var pc = Entity.GetComponent <PhysicsComponent>();

            if (pc == null)
            {
                return(false);
            }
            CorvEngine.AudioManager.PlaySoundEffect(LaunchSound);
            pc.Velocity = LaunchVelocity;
            return(true);
        }
Ejemplo n.º 6
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            var se = Entity.GetComponent <StatusEffectsComponent>();

            if (se == null)
            {
                return(false);
            }
            var seac = this.GetDependency <StatusEffectPropertiesComponent>();

            se.ApplyStatusEffect(seac.StatusEffectAttributes);
            return(true);
        }
Ejemplo n.º 7
0
 protected override bool OnCollision(Entity Entity, EntityClassification Classification)
 {
     var dc = Entity.GetComponent<DamageComponent>();
     if (dc == null)
         return false;
     if (!UseAttributes)
         dc.TakeDamage(this.Parent, Damage);
     else
     {
         var attri = this.GetDependency<AttributesComponent>();
         dc.TakeDamage(attri);
     }
     return true;
 }
Ejemplo n.º 8
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            var sc = Entity.GetComponent <ScoreComponent>();

            sc.Coins += Value;
            var ftc = Entity.GetComponent <FloatingTextComponent>();

            if (ftc != null)
            {
                ftc.Add("+" + Value.ToString(), Color.Gold);
            }
            AudioManager.PlaySoundEffect("CoinPickup");
            Parent.Dispose();
            return(true);
        }
Ejemplo n.º 9
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            if (!IsEnabled)
            {
                return(false);
            }
            //TODO: WIll need to make it randomize if NextScene is not set.
            //if (string.IsNullOrEmpty(NextScene))
            //    return false;
            //ScrollerGame.Instance.GameStateManager.PushState<LevelClearState>(true);
            var sceneManager = ScrollerGame.Instance.GetGameState <SceneManager>();

            sceneManager.RandomScene(false);
            //sceneManager.ChangeScene(NextScene, "", false);
            return(true);
        }
Ejemplo n.º 10
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            if (ReloadScene)
            {
                CorvusGame.Instance.SceneManager.ReloadScenes(false);
            }
            if (string.IsNullOrEmpty(SpawnID))
            {
                CorvusGame.Instance.SceneManager.ChangeScene(NextLevel, false);
            }
            else
            {
                CorvusGame.Instance.SceneManager.ChangeScene(NextLevel, false, SpawnID);
            }

            return(true);
        }
Ejemplo n.º 11
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            var ec = Entity.GetComponent<EquipmentComponent>();
            if (ec == null)
                return false;
            var ac = this.GetDependency<AttributesComponent>();
            var cpc = this.GetDependency<CombatPropertiesComponent>();
            var wdc = this.GetDependency<WeaponPropertiesComponent>();
            var seac = Parent.GetComponent<StatusEffectPropertiesComponent>();
            ec.EquipWeapon(new Weapon(wdc.WeaponData, cpc.CombatProperties, ac.Attributes, seac.StatusEffectAttributes));

            var ftc = Entity.GetComponent<FloatingTextComponent>();
            ftc.Add(wdc.WeaponData.Name, Color.Black);

            CorvEngine.AudioManager.PlaySoundEffect("WeaponPickup");

            return true;
        }
Ejemplo n.º 12
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            bool colGood = false;
            //Apply normal damage.
            var dc = Entity.GetComponent <DamageComponent>();

            if (dc != null)
            {
                dc.TakeDamage(AttributesComponent);
                colGood = true;
            }

            var mc = Entity.GetComponent <MovementComponent>();

            if (mc != null)
            {
                mc.Knockback(AttributesComponent.TotalKnockback, (PC.VelocityX > 0) ? 1 : -1);
                colGood = true;
            }

            //Apply status effect if it can.
            if (CPComponent.AppliesEffect)
            {
                var sc = Entity.GetComponent <StatusEffectsComponent>();
                if (sc != null)
                {
                    sc.ApplyStatusEffect(SEAComponent.StatusEffectAttributes);
                    colGood = true;
                }
            }
            //Make an aoe appear if there should be one.
            if (CPComponent.IsAoE)
            {
                AreaOfEffectComponent.CreateAoEEntity(this.Parent);
                colGood = true;
            }

            if (!string.IsNullOrEmpty(CPComponent.ProjectileOnHitSound))
            {
                AudioManager.PlaySoundEffect(CPComponent.ProjectileOnHitSound);
            }

            return(colGood);
        }
Ejemplo n.º 13
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            var mc = Entity.GetComponent<MovementComponent>();
            if (mc == null)
                return false;

            if ((DateTime.Now - _LastKnockback).TotalMilliseconds > KnockbackTimeout)
            {
                _LastKnockback = DateTime.Now;
                float myx = Entity.Position.X - Parent.Position.X;
                float kb = (!UseAttributes) ? Knockback : this.GetDependency<AttributesComponent>().TotalKnockback;
                mc.Knockback(kb, (myx > 0) ? 1 : -1);
                return true;
            }
            else
            {
                return false;
            }
        }
Ejemplo n.º 14
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            var dc = Entity.GetComponent <DamageComponent>();

            if (dc == null)
            {
                return(false);
            }
            if (!UseAttributes)
            {
                dc.TakeDamage(this.Parent, Damage);
            }
            else
            {
                var attri = this.GetDependency <AttributesComponent>();
                dc.TakeDamage(attri);
            }
            return(true);
        }
Ejemplo n.º 15
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            var mc = Entity.GetComponent <MovementComponent>();

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

            if ((DateTime.Now - _LastKnockback).TotalMilliseconds > KnockbackTimeout)
            {
                _LastKnockback = DateTime.Now;
                float myx = Entity.Position.X - Parent.Position.X;
                float kb  = (!UseAttributes) ? Knockback : this.GetDependency <AttributesComponent>().TotalKnockback;
                mc.Knockback(kb, (myx > 0) ? 1 : -1);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 16
0
 protected override bool OnCollision(Entity Entity, EntityClassification Classification)
 {
     bool colGood = false;
     //Apply normal damage.
     var dc = Entity.GetComponent<DamageComponent>();
     if (dc != null)
     {
         dc.TakeDamage(AttributesComponent, CPComponent.AoEDamagePercent);
         colGood = true;
     }
     //Apply status effect if it can.
     if (CPComponent.AppliesEffect)
     {
         var sc = Entity.GetComponent<StatusEffectsComponent>();
         if (sc != null)
         {
             sc.ApplyStatusEffect(SEAComponent.StatusEffectAttributes);
             colGood = true;
         }
     }
     return colGood;
 }
Ejemplo n.º 17
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            bool colGood = false;
            //Apply normal damage.
            var dc = Entity.GetComponent <DamageComponent>();

            if (dc != null)
            {
                dc.TakeDamage(AttributesComponent, CPComponent.AoEDamagePercent);
                colGood = true;
            }
            //Apply status effect if it can.
            if (CPComponent.AppliesEffect)
            {
                var sc = Entity.GetComponent <StatusEffectsComponent>();
                if (sc != null)
                {
                    sc.ApplyStatusEffect(SEAComponent.StatusEffectAttributes);
                    colGood = true;
                }
            }
            return(colGood);
        }
Ejemplo n.º 18
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            var ec = Entity.GetComponent <EquipmentComponent>();

            if (ec == null)
            {
                return(false);
            }
            var ac   = this.GetDependency <AttributesComponent>();
            var cpc  = this.GetDependency <CombatPropertiesComponent>();
            var wdc  = this.GetDependency <WeaponPropertiesComponent>();
            var seac = Parent.GetComponent <StatusEffectPropertiesComponent>();

            ec.EquipWeapon(new Weapon(wdc.WeaponData, cpc.CombatProperties, ac.Attributes, seac.StatusEffectAttributes));

            var ftc = Entity.GetComponent <FloatingTextComponent>();

            ftc.Add(wdc.WeaponData.Name, Color.Black);

            CorvEngine.AudioManager.PlaySoundEffect("WeaponPickup");

            return(true);
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Called when a collision with the specified Entity of the given Classification occurs.
 /// Returns whether or not the collision was valid, causing this object to be disposed if DisposeOnCollision was true.
 /// </summary>
 protected abstract bool OnCollision(Entity Entity, EntityClassification Classification);
Ejemplo n.º 20
0
        protected override bool OnCollision(Entity Entity, EntityClassification Classification)
        {
            bool colGood = false;
            //Apply normal damage.
            var dc = Entity.GetComponent<DamageComponent>();
            if (dc != null)
            {
                dc.TakeDamage(AttributesComponent);
                colGood = true;
            }

            var mc = Entity.GetComponent<MovementComponent>();
            if (mc != null)
            {
                mc.Knockback(AttributesComponent.TotalKnockback, (PC.VelocityX > 0) ? 1 : -1);
                colGood = true;
            }

            //Apply status effect if it can.
            if (CPComponent.AppliesEffect)
            {
                var sc = Entity.GetComponent<StatusEffectsComponent>();
                if (sc != null)
                {
                    sc.ApplyStatusEffect(SEAComponent.StatusEffectAttributes);
                    colGood = true;
                }
            }
            //Make an aoe appear if there should be one.
            if (CPComponent.IsAoE) {
                AreaOfEffectComponent.CreateAoEEntity(this.Parent);
                colGood = true;
            }

            if (!string.IsNullOrEmpty(CPComponent.ProjectileOnHitSound))
                AudioManager.PlaySoundEffect(CPComponent.ProjectileOnHitSound);

            return colGood;
        }
Ejemplo n.º 21
0
 protected override bool OnCollision(Entity Entity, EntityClassification Classification)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Called when a collision with the specified Entity of the given Classification occurs.
 /// Returns whether or not the collision was valid, causing this object to be disposed if DisposeOnCollision was true.
 /// </summary>
 protected abstract bool OnCollision(Entity Entity, EntityClassification Classification);
Ejemplo n.º 23
0
 protected override bool OnCollision(Entity Entity, EntityClassification Classification)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 24
0
        public async Task <List <OrganizationExtended> > GetExtendedOrganizationUnitsAsync(User user, EntityClassification entityClassificationId)
        {
            var query = await(from uou in UserOrganizationUnitRepository.GetAll()
                              join ou in OrganizationExtendedUnitRepository.GetAll() on uou.OrganizationUnitId equals ou.Id
                              where uou.UserId == user.Id && ou.EntityClassificationId == entityClassificationId
                              select ou).ToListAsync();

            return(query);
        }