Ejemplo n.º 1
0
        protected override void OnLockStateChanged(Lock @lock)
        {
            base.OnLockStateChanged(@lock);

            if (@lock is UnitLock u)
            {
                var player = u.Target as Player;
                player?.Session.CancelLogout();

                if (@lock.State == LockState.Locked)
                {
                    //  !!
                    //  this will enqueue primary, secondary, and will also fire if a primary is converted to secondary
                    //  !!

                    var npc = u.Target as Npc;

                    if (npc != null)
                    {
                        MissionHandler.EnqueueMissionEventInfo(new LockUnitEventInfo(this, npc, npc.CurrentPosition));
                        MissionHandler.SignalParticipationByLocking(npc.GetMissionGuid());
                    }
                }
            }

            if (@lock.State == LockState.Inprogress && EffectHandler.ContainsEffect(EffectType.effect_invulnerable))
            {
                EffectHandler.RemoveEffectsByType(EffectType.effect_invulnerable);
            }
        }
Ejemplo n.º 2
0
	public Game (Player p1, Player p2) {

		this.player1 = p1;
		this.player2 = p2;
		this.effectHandler = new EffectHandler();
		this.turnHandler = new TurnHandler();
	}
Ejemplo n.º 3
0
 public Game(Player p1, Player p2)
 {
     this.player1       = p1;
     this.player2       = p2;
     this.effectHandler = new EffectHandler();
     this.turnHandler   = new TurnHandler();
 }
Ejemplo n.º 4
0
 public override bool Apply(Tile tile)
 {
     if (tile.tileContent != null)
     {
         EffectHandler handler = tile.tileContent.GetComponent <EffectHandler>();
         A_Effect      effect  = handler.GetFirst(GameHelper.EffectType.SpiderWeb);
         if (effect != null)
         {
             effect.AddDuration(1.0f);
             Destroy(this.gameObject);
             return(false);
         }
         else
         {
             if (tile.tileContent != null && tile.GetCharacter() != null)
             {
                 character          = tile.GetCharacter();
                 character.movment += movementDec;
             }
             this.tile = tile;
             active    = true;
             EventManager.OnTurnEnd += TurnEnd;
             tile.tileContent.GetComponent <EffectHandler>().AddEffect(this);
         }
     }
     return(true);
 }
Ejemplo n.º 5
0
    public override void OnUpdate()
    {
        if (timer > 0)
        {
            timer--;
        }
        else
        {
            timer = 20;
            health.Damage(new DamageBase(Handler.gameObject, 2));

            if (firstTranslate)
            {
                foreach (Collider2D collider in Handler.gameObject.GetComponent <NearestObjects>().NearestColliders)
                {
                    EffectHandler handler = collider.gameObject.GetComponent <EffectHandler>();
                    if (handler != null)
                    {
                        handler.AddEffect(new BurnEffect());
                    }
                }
                firstTranslate = false;
            }
        }
    }
    private void Start()
    {
        if (OnShootEvent == null)
        {
            OnShootEvent = new UnityEvent();
        }
        if (OnDashEvent == null)
        {
            OnDashEvent = new UnityEvent();
        }

        moveLayerMask = LayerMask.GetMask("Player", "Scene");

        hpBar.GetComponent <SpriteRenderer>().color = mainColor;
        currentHp     = maxHp;
        hpBarScale    = hpBar.transform.localScale;
        player        = EffectHandler.Instance.player;
        mRigidbody2D  = GetComponent <Rigidbody2D>();
        effectHandler = EffectHandler.Instance;
        controller    = PlayerController.Instance;
        spawner       = EnemySpawner.Instance;
        statsManager  = StatsManager.Instance;

        if (triggerOnInstantiate)
        {
            isTriggered = true;
            timeToShoot = Random.value * timeMultipler;
        }
        feetPos = new Vector3(0, transform.localScale.y * 0.5f, 0);
    }
Ejemplo n.º 7
0
 /// <summary>
 /// 分析技能效果 转换为处理对象
 /// </summary>
 /// <param name="key"></param>
 /// <param name="skill"></param>
 private SkillHandler[] ParseSkill(SkillModel skill)
 {
     // 创建处理对象数组 保存不同的等级
     SkillHandler[] skillHandlers = new SkillHandler[skill.LvData.Length];
     for (int i = 0; i < skillHandlers.Length; i++)
     {
         // 创建每一级的处理对象
         SkillHandler  skillHandler = new SkillHandler(skill.Id);
         EffectModel[] effects      = skill.LvData[i].EffectData;
         skillHandler.Effects = new EffectModel[effects.Length];
         // 遍历技能效果
         for (int j = 0; j < effects.Length; j++)
         {
             EffectModel effect = effects[j];
             skillHandler.Effects[j] = effect;
             // 判断效果类型 将相应的处理添加到委托里
             EffectHandler handler = SkillHandlerData.HandlerDict.ExTryGet(effect.Type);
             if (handler != null)
             {
                 skillHandler.Handler += handler;
             }
         }
         skillHandlers[i] = skillHandler;
     }
     return(skillHandlers);
 }
Ejemplo n.º 8
0
 /// <param name="name">Имя эффекта</param>
 /// <param name="timeLeft">Сколько будет длится эффект. В секундах. -1 - бесконечность</param>
 /// <param name="value">На сколько прибавится значение характеристики</param>
 /// <param name="procent">На сколько прибавится процент характеристики. Формула: (оригинал + значение) * (1 + процент)</param>
 /// <param name="isDisplayed">Показывается ли эффект в GUI</param>
 public AttributeEffect(string name, int timeLeft, EffectHandler handler, bool isDisplayed, float value, float procent) : base(name,
                                                                                                                               timeLeft, isDisplayed)
 {
     // ReSharper disable once VirtualMemberCallInConstructor
     attribute    = GetAttribute();
     this.value   = value;
     this.procent = procent;
 }
Ejemplo n.º 9
0
    public override void Init()
    {
        playerStats   = PlayerStats._instance;
        effectHandler = EffectHandler._instance;

        FillDictionary();
        GameManager.DeathEvent += DeathReset;
    }
Ejemplo n.º 10
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        EffectHandler handler = other.gameObject.GetComponent <EffectHandler>();

        if (handler != null)
        {
            handler.AddEffect(new UnconsciousEffect(float.Parse(GetComponent <SpawnedData>().spawnedData[0])));
            Destroy(gameObject);
        }
    }
Ejemplo n.º 11
0
    public void UseAbility(int index, HashSet <GridCell> cells, GridCell target, bool crit)
    {
        AbilityInfo info = abilityInfo [index];

        foreach (GridCell c in cells)
        {
            if (crit)
            {
                foreach (DamageProperty prop in info.ability.critDamageEffects)
                {
                    EffectHandler.ApplyDamage(prop, unit, c, info.level);
                }
            }

            else
            {
                foreach (DamageProperty prop in info.ability.damageEffects)
                {
                    EffectHandler.ApplyDamage(prop, unit, c, info.level);
                }
            }

            if (c.currentUnit != null)
            {
                if (info.hitThisTurn.ContainsKey(c.currentUnit))
                {
                    info.hitThisTurn [c.currentUnit]++;
                }
                else
                {
                    info.hitThisTurn.Add(c.currentUnit, 1);
                }
            }
        }

        unit.unitController.UseAbility(info.ability.animationTrigger, target);
        unit.stats.SetAp(-info.ability.apCostPerLvl [info.level - 1]);
        info.castsThisTurn++;
        info.remainingCooldown = info.ability.cooldownPerLvl [info.level - 1];
        unit.OutsideUpdateUnitState();
        unit.floatingText.DisplayApChange(-info.ability.apCostPerLvl [info.level - 1]);

        if (info.ability.castsPerTargetPerLvl [info.level - 1] != 0 && target.currentUnit != null)
        {
            if (info.hitThisTurn.ContainsKey(target.currentUnit))
            {
                info.hitThisTurn [target.currentUnit]++;
            }
            else
            {
                info.hitThisTurn.Add(target.currentUnit, 1);
            }
        }
    }
Ejemplo n.º 12
0
 private void ApplySyndicateAreaEffect(bool apply)
 {
     if (apply)
     {
         var effectBuilder = NewEffectBuilder().SetType(EffectType.effect_syndicate_area);
         ApplyEffect(effectBuilder);
     }
     else
     {
         EffectHandler.RemoveEffectsByType(EffectType.effect_syndicate_area);
     }
 }
Ejemplo n.º 13
0
 protected override ActionBlock[] GetBlocks()
 {
     return new [] {
         new ActionBlock("Add Effect", () => {
             EffectHandler handler = (EffectHandler) target;
             if (GUILayout.Button("UnconsciousEffect"))
                 handler.AddEffect(new UnconsciousEffect(3));
             if (GUILayout.Button("BurnEffect"))
                 handler.AddEffect(new BurnEffect());
         })
     };
 }
Ejemplo n.º 14
0
 // handle the cell effect, spell or buff alike
 public void handleCellEffect(EffectHandler handler, Entity origin, Cell target)
 {
     Debug.Log("handleCellEffect");
     if (handler is EffectHandlerDash)
     {
         handleEffectDash((EffectHandlerDash)handler, origin, target);
     }
     else if (handler is EffectHandlerWarp)
     {
         handleEffectWarp((EffectHandlerWarp)handler, origin, target);
     }
 }
Ejemplo n.º 15
0
 protected override void OnUpdate()
 {
     Entities.WithAllReadOnly <EffectComponent, MoveComponent>()
     .ForEach((Entity id, ref EffectComponent effect, ref MoveComponent move) =>
     {
         EffectHandler effectHandler = EntityUtility.Instance.GetComponent <EffectHandler>(id);
         if (effectHandler != null)
         {
             effectHandler.OnMoveSpeed(move.speed);
         }
     });
 }
Ejemplo n.º 16
0
        public void ApplySelfTeleportEnablerEffect(TimeSpan duration)
        {
            var effect = EffectHandler.GetEffectsByType(EffectType.effect_teleport_self_enabler).FirstOrDefault();

            if (effect != null)
            {
                EffectHandler.Remove(effect);
            }

            var builder = NewEffectBuilder().SetType(EffectType.effect_teleport_self_enabler).WithDuration(duration);

            ApplyEffect(builder);
        }
Ejemplo n.º 17
0
        public ErrorCodes CheckPvp()
        {
            var zone = Zone;

            Debug.Assert(zone != null);

            if (!HasPvpEffect && (zone.Configuration.Protected || EffectHandler.ContainsEffect(EffectType.effect_syndicate_area)))
            {
                return(ErrorCodes.PvpIsNotAllowed);
            }

            return(ErrorCodes.NoError);
        }
Ejemplo n.º 18
0
 private void ApplyHighwayEffect(bool apply)
 {
     if (apply)
     {
         var effectBuilder = NewEffectBuilder().SetType(EffectType.effect_highway)
                             .WithPropertyModifier(ItemPropertyModifier.Create(AggregateField.effect_speed_highway_modifier, 1.0));
         ApplyEffect(effectBuilder);
     }
     else
     {
         EffectHandler.RemoveEffectsByType(EffectType.effect_highway);
     }
 }
Ejemplo n.º 19
0
        // ######################################################

        // handle the entity effect, spell or buff alike
        public void handleEntityEffect(EffectHandler handler, Entity origin, Entity target)
        {
            if (handler is EffectHandlerDirectDamage)
            {
                handleEffectDirectDamage((EffectHandlerDirectDamage)handler, origin, target);
            }
            else if (handler is EffectHandlerIndirectDamage)
            {
                handleEffectIndirectDamage((EffectHandlerIndirectDamage)handler, origin, target);
            }
            else if (handler is EffectHandlerHeal)
            {
                handleEffectHeal((EffectHandlerHeal)handler, origin, target);
            }
            else if (handler is EffectHandlerBuff)
            {
                handleEffectBuff((EffectHandlerBuff)handler, origin, target);
            }
            else if (handler is EffectHandlerDebuff)
            {
                handleEffectDebuff((EffectHandlerDebuff)handler, origin, target);
            }
            else if (handler is EffectHandlerModAP)
            {
                handleEffectModAP((EffectHandlerModAP)handler, origin, target);
            }
            else if (handler is EffectHandlerModMP)
            {
                handleEffectModMP((EffectHandlerModMP)handler, origin, target);
            }
            else if (handler is EffectHandlerModRange)
            {
                handleEffectModRange((EffectHandlerModRange)handler, origin, target);
            }
            else if (handler is EffectHandlerStun)
            {
                handleEffectStun((EffectHandlerStun)handler, origin, target);
            }
            else if (handler is EffectHandlerUnstun)
            {
                handleEffectUnstun((EffectHandlerUnstun)handler, origin, target);
            }
            else if (handler is EffectHandlerPush)
            {
                handleEffectPush((EffectHandlerPush)handler, origin, target);
            }
            else if (handler is EffectHandlerPull)
            {
                handleEffectPull((EffectHandlerPull)handler, origin, target);
            }
        }
        public void ApplyCurrentEffect()
        {
            if (EffectHandler.ContainsEffect(CurrentEffectType))
            {
                return;
            }

            var builder = NewEffectBuilder().SetType(CurrentEffectType)
                          .SetOwnerToSource()
                          .EnableModifiers(false)
                          .WithTargetSelector(zone => GetTargetUnits());

            OnApplyEffect(builder);
            ApplyEffect(builder);
        }
    // Start is called before the first frame update
    void Start()
    {
//        health = 100;
        CustomeNetworkManager = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent <CustomeNetworkManager>();
        EffectHandler         = this.GetComponent <EffectHandler>();
        animationHandler      = this.GetComponent <AnimationHandler>();
        if (!isLocalPlayer)
        {
            this.gameObject.GetComponent <movment>().enabled = false;
        }
        else
        {
            this.gameObject.tag = "local";
            this.gameObject.GetComponent <movment>().enabled = true;
        }
    }
Ejemplo n.º 22
0
    private void Awake()
    {
        foreach (var effect in effects)
        {
            EffectType type = effect.Type;
            if (effectDict.ContainsKey(type))
            {
                continue;
            }

            effectDict.Add(type, effect);
        }

        if (instance == null)
        {
            instance = this;
            return;
        }

        Destroy(this);
    }
Ejemplo n.º 23
0
    public override bool Apply(Tile tile)
    {
        EffectHandler handler = tile.tileContent.GetComponent <EffectHandler>();
        A_Effect      effect  = handler.GetFirst(GameHelper.EffectType.SpiderWeb);

        if (effect != null)
        {
            effect.AddDuration(1.0f);
            Destroy(this.gameObject);
            return(false);
        }
        else if (tile.tileContent != null)
        {
            this.tile = tile;
            active    = true;
            tile.tileContent.OnWalkOver += WalkOver;
            EventManager.OnTurnEnd      += TurnEnd;
            tile.tileContent.GetComponent <EffectHandler>().AddEffect(this);
        }
        return(true);
    }
Ejemplo n.º 24
0
        /// <summary>
        /// Called by the web controller to start an effect (after first stopping any active effect).
        /// Configuration and active state is persisted to file.
        /// </summary>
        /// <param name="config"></param>
        /// <param name="handler"></param>
        /// <returns></returns>
        public async Task StartEffect(EffectConfig config, EffectHandler handler)
        {
            // Cancel previous handler if there is one
            _effectCancellationTokenSource?.Cancel();

            // Start the new handler
            _effectCancellationTokenSource = new CancellationTokenSource();
            handler.Start(_effectCancellationTokenSource.Token);
            ActiveHandler = handler;

            // Save config including state
            var otherConfig = config.GetType() == typeof(XmasEffectConfig)
                ? (EffectConfig)await _storageService.LoadConfig <WarmupEffectConfig>()
                : (EffectConfig)await _storageService.LoadConfig <XmasEffectConfig>();

            otherConfig.Active = false;
            config.Active      = true;
            await _storageService.SaveConfig(otherConfig);

            await _storageService.SaveConfig(config);
        }
Ejemplo n.º 25
0
        public override void OnUpdateToDb()
        {
            try
            {
                if (!IsRepackaged)
                {
                    DynamicProperties.Update(k.armor, Armor.Ratio(ArmorMax));
                    DynamicProperties.Update(k.currentCore, Core);
                }

                var zone = Zone;
                if (zone == null || States.Dead)
                {
                    return;
                }

                var character = Character;
                character.ZoneId       = zone.Id;
                character.ZonePosition = CurrentPosition;

                var p = DynamicProperties.GetProperty <int>(k.pvpRemaining);

                var pvpEffect = EffectHandler.GetEffectsByType(EffectType.effect_pvp).FirstOrDefault();
                if (pvpEffect == null)
                {
                    p.Clear();
                    return;
                }

                var effectTimer = pvpEffect.Timer;
                if (effectTimer != null)
                {
                    p.Value = (int)effectTimer.Remaining.TotalMilliseconds;
                }
            }
            finally
            {
                base.OnUpdateToDb();
            }
        }
Ejemplo n.º 26
0
        private void RefreshEffectBonus()
        {
            var siteInfo = GetIntrusionSiteInfo();

            var currentEffect = EffectHandler.GetEffectsByCategory(EffectCategory.effcat_intrusion_effect).FirstOrDefault();

            if (currentEffect != null)
            {
                var threshold = GetEffectBonusStabilityThreshold(currentEffect.Type);

                if (siteInfo.Stability < threshold)
                {
                    EffectHandler.Remove(currentEffect);
                    Logger.Info($"Intrusion outpost effect removed. outpost = {Eid} effecttype = {currentEffect.Type}");
                }
            }

            var corporationEid = siteInfo.Owner ?? 0L;

            if (corporationEid == 0L)
            {
                return;
            }

            EffectHandler.RemoveEffectsByCategory(EffectCategory.effcat_intrusion_effect);

            if (siteInfo.ActiveEffect != EffectType.undefined)
            {
                var threshold = GetEffectBonusStabilityThreshold(siteInfo.ActiveEffect);

                if (siteInfo.Stability < threshold)
                {
                    return;
                }

                var builder = NewEffectBuilder().SetType(siteInfo.ActiveEffect).SetOwnerToSource().WithCorporationEid(corporationEid);
                ApplyEffect(builder);
            }
        }
Ejemplo n.º 27
0
        protected Unit()
        {
            _damageProcessor = new DamageProcessor(this)
            {
                DamageTaken = OnDamageTaken
            };

            var effectHandler = new EffectHandler(this);

            effectHandler.EffectChanged += OnEffectChanged;
            EffectHandler = effectHandler;

            _optionalProperties.PropertyChanged += property =>
            {
                UpdateTypes |= UnitUpdateTypes.OptionalProperty;
            };

            InitUnitProperties();

            States  = new UnitStates(this);
            _height = new Lazy <double>(() => ComputeHeight() + 1.0);
        }
Ejemplo n.º 28
0
 /// <summary>
 /// 分析技能效果 转换为处理对象
 /// </summary>
 /// <param name="key"></param>
 /// <param name="skill"></param>
 private SkillHandler[] ParseSkill(SkillModel skill)
 {
     // 创建处理对象数组 保存不同的等级
     SkillHandler[] skillHandlers = new SkillHandler[skill.LvData.Length];
     for (int i = 0; i < skillHandlers.Length; i++)
     {
         // 创建每一级的处理对象
         SkillHandler skillHandler = new SkillHandler();
         skillHandler.SkillId = skill.Id;
         EffectModel[] effects = skill.LvData[i].EffectData;
         skillHandler.Data = new EffectModel[effects.Length];
         // 遍历技能效果
         for (int j = 0; j < effects.Length; j++)
         {
             EffectModel effect = effects[j];
             skillHandler.Data[j] = effect;
             // 判断效果类型 将相应的处理添加到委托里
             if (effect.Type.StartsWith(SkillData.DamageType))
             {
                 DamageHandler handler = SkillHandlerData.DamageDict.ExTryGet(effect.Type);
                 if (handler != null)
                 {
                     skillHandler.Damage += handler;
                 }
             }
             else if (effect.Type.StartsWith(SkillData.EffectType))
             {
                 EffectHandler handler = SkillHandlerData.EffectDict.ExTryGet(effect.Type);
                 if (handler != null)
                 {
                     skillHandler.Effect += handler;
                 }
             }
         }
         skillHandlers[i] = skillHandler;
     }
     return(skillHandlers);
 }
    private void Start()
    {
        mRigidbody2D = GetComponent <Rigidbody2D>();
        mAnimator    = GetComponent <Animator>();
        controller   = GetComponent <CharacterController2D>();
        lineRenderer = GetComponentInChildren <LineRenderer>();

        cam           = Camera.main;
        effectHandler = EffectHandler.Instance;
        tileManager   = TilemapManager.Instance;
        spawner       = EnemySpawner.Instance;
        statsManager  = StatsManager.Instance;

        timeLeft     = weapon.timeBetweenShoots;
        gravityScale = mRigidbody2D.gravityScale;
        mAnimator.SetFloat("shootSpeed", weapon.timeBetweenShoots * 5);

        Cursor.visible = false;

        startHealthBarColor  = healthBar.color;
        healthBar.fillAmount = Health;
        coinsText.text       = Coins.ToString();
        pointsBar.fillAmount = Points;
    }
Ejemplo n.º 30
0
    private void Start()
    {
        events         = GameManager.Instance.Events;
        handController = GetComponentInChildren <HandController>();
        physics        = GetComponent <Physics>();

        gunController = GetComponentInChildren <PlayerGun>();
        //gunController.OnReload += (duration) =>
        //{
        //    events.FireEvent(new Reload { Duration = duration });
        //};
        //gunController.OnClipChange += (bullets) =>
        //{
        //    events.FireEvent(new WeaponClipChange { BulletsInClip = bullets });
        //};

        //events.FireEvent(new WeaponMagChange { Bullets = gunController.Stats.ClipSize });

        health        = GetComponent <Health>();
        health.Amount = stats.MaxHealth;

        bodyRenderer.color = Color.white;
        effectsHandler     = GetComponent <EffectHandler>();
    }
Ejemplo n.º 31
0
 public void resolveBuffEffect(EffectBuff effect, Entity origin, Cell target, string trigger)
 {
     if (areGlobalConditionsValid(effect.conditions))
     {
         if (areOriginConditionsValid(effect.conditions, origin))
         {
             // look if effect is trigered
             Type          effectType    = typeof(EffectBuff);
             FieldInfo     myFieldInfo   = effectType.GetField(trigger);
             EffectHandler effectHandler = (EffectHandler)myFieldInfo.GetValue(effect);
             if (effectHandler != null)
             {
                 foreach (Cell c in getBuffEffectAffectedCells(effect, origin, target))
                 {
                     Entity e = c.currentEntity; // get entity on cell
                     if (e != null)
                     {
                         if (e == origin && effect.affectSelf ||
                             e.teamId != origin.teamId && effect.affectEnemy ||
                             e != origin && e.teamId == origin.teamId && effect.affectAlly)
                         {
                             if (areTargetConditionsValid(effect.conditions, e))
                             {
                                 handleEntityEffect(effectHandler, origin, e);
                             }
                         }
                     }
                     if (effect.affectCell)
                     {
                         handleCellEffect(effectHandler, origin, c);
                     }
                 }
             }
         }
     }
 }
		public DecompiledEffect(SourceShader source, Platform platform)
		{
			this.techniqueDefaults = new Dictionary<string, TechniqueExtraData>();

			var handler = new EffectHandler();
			handler.source = source.ShaderSource;
			handler.filename = source.FileName;
			handler.buildForXbox = platform == Platform.Xbox;

			//create the native DX decompiler wrapper
			var decompiler = new Native.ShaderDecompiler(ASCIIEncoding.ASCII.GetBytes(source.ShaderSource), source.FileName, platform == Platform.Xbox, handler);
			
			Effect effect = handler.Effect;

			if (decompiler.Errors != null && decompiler.GetShaderCode() == null)
				Common.ThrowError(decompiler.Errors);
			
			//now pull the good stuff out.

			List<Register> registers = new List<Register>();
			List<Register> textures = new List<Register>();

			for (int i = 0; i < effect.Parameters.Count; i++)
			{
				Register register = new Register();

				if (effect.Parameters[i].ParameterType == EffectParameterType.Single ||
					effect.Parameters[i].ParameterType == EffectParameterType.Int32 ||
					effect.Parameters[i].ParameterType == EffectParameterType.Bool)
				{
					register.Name = effect.Parameters[i].Name;
					register.Semantic = effect.Parameters[i].Semantic;
					register.ArraySize = effect.Parameters[i].Elements.Count;
					register.Size = effect.Parameters[i].RowCount * Math.Max(1, register.ArraySize);
					registers.Add(register);
				}

				if (effect.Parameters[i].ParameterType >= EffectParameterType.Texture &&
					effect.Parameters[i].ParameterType <= EffectParameterType.TextureCube)
				{
					EffectParameterType type = effect.Parameters[i].ParameterType;
					if (type == EffectParameterType.Texture1D)
						type = EffectParameterType.Texture2D;

					register.Name = effect.Parameters[i].Name;
					register.Semantic = effect.Parameters[i].Semantic;
					register.Type = type.ToString();
					textures.Add(register);
					register.Category = RegisterCategory.Texture;
					registers.Add(register);
				}

			}

			//iterate the samplers (XNA 4 removed the ability to query samplers!)
			var samplers = decompiler.GetSamplers();
			for (int i = 0; i < samplers.Length; i++)
			{
				var sampler = new Register();
				sampler.Name = samplers[i].Name;
				sampler.Semantic = samplers[i].Semantic;
				sampler.Type = samplers[i].Type;
				sampler.Category = RegisterCategory.Sampler;
				registers.Add(sampler);
			}
			
			//null any empty semantics
			for (int i = 0; i < registers.Count; i++)
			{
				Register reg = registers[i];
				if (reg.Semantic != null && reg.Semantic.Length == 0)
					reg.Semantic = null;
				registers[i] = reg;
			}

			this.effectRegisters = new RegisterSet(registers.ToArray());
			this.decompiledAsm = decompiler.DisassembledCode;

			ExtractEffectDefaults(effect, textures, source, platform);

			effect.Dispose();
			effect = null;
		}