Ejemplo n.º 1
0
        protected override bool SetupParticlesOnShow(Entity entity)
        {
            BuildingTypeVO buildingType = entity.Get <BuildingComponent>().BuildingType;

            if (buildingType.Type == BuildingType.Trap && entity.Get <TrapComponent>().CurrentState != TrapState.Spent && !ContractUtils.IsBuildingUpgrading(entity) && !ContractUtils.IsBuildingConstructing(entity))
            {
                TrapTypeVO trapType         = Service.Get <IDataController>().Get <TrapTypeVO>(buildingType.TrapUid);
                uint       trapMaxRadius    = TrapUtils.GetTrapMaxRadius(trapType);
                uint       trapAttackRadius = TrapUtils.GetTrapAttackRadius(trapType);
                base.SetupParticleSystemWithRange(this.triggerRadius, 5f, trapMaxRadius);
                base.SetupParticleSystemWithRange(this.damageRadius, 5f, trapAttackRadius);
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
 private void DetermineEffectRange(SmartEntity entity, ref uint maxRange, ref uint minRange)
 {
     if (entity.BuildingComp == null)
     {
         return;
     }
     if (entity.ShooterComp != null)
     {
         maxRange = entity.ShooterComp.ShooterVO.MaxAttackRange;
         minRange = entity.ShooterComp.ShooterVO.MinAttackRange;
         return;
     }
     if (entity.TrapComp != null)
     {
         maxRange = TrapUtils.GetTrapAttackRadius(entity.TrapComp.Type);
         return;
     }
 }
Ejemplo n.º 3
0
        protected virtual bool SetupParticlesOnShow(SmartEntity entity)
        {
            uint minRange;

            if (entity.ShooterComp != null)
            {
                minRange = entity.ShooterComp.ShooterVO.MaxAttackRange;
            }
            else
            {
                if (entity.TrapComp == null)
                {
                    return(false);
                }
                minRange = TrapUtils.GetTrapAttackRadius(entity.TrapComp.Type);
            }
            this.SetupParticleSystemWithRange(this.whiteRingParticles, 5f, minRange);
            return(true);
        }