Ejemplo n.º 1
0
        void cbAffects_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Loading || cbAffects.SelectedIndex < 0)
            {
                return;
            }
            myFX.ToWho            = (Enums.eToWho)cbAffects.SelectedIndex;
            lblAffectsCaster.Text = "";
            var power = myFX.GetPower();

            if (power != null && (power.EntitiesAutoHit & Enums.eEntity.Caster) > Enums.eEntity.None)
            {
                lblAffectsCaster.Text = "Power also affects Self";
            }
            UpdateFXText();
        }
Ejemplo n.º 2
0
        public void DisplayEffectData()
        {
            string  Style = "####0" + NumberFormatInfo.CurrentInfo.NumberDecimalSeparator + "0##";
            IEffect fx    = myFX;

            cbPercentageOverride.SelectedIndex = (int)fx.DisplayPercentageOverride;
            txtFXScale.Text           = Strings.Format(fx.Scale, Style);
            txtFXDuration.Text        = Strings.Format(fx.nDuration, Style);
            txtFXMag.Text             = Strings.Format(fx.nMagnitude, Style);
            cmbEffectId.Text          = fx.EffectId;
            txtFXTicks.Text           = Strings.Format(fx.Ticks, "####0");
            txtOverride.Text          = fx.Override;
            txtFXDelay.Text           = Strings.Format(fx.DelayedTime, Style);
            txtFXProb.Text            = Strings.Format(fx.BaseProbability, Style);
            txtPPM.Text               = Strings.Format(fx.ProcsPerMinute, Style);
            lblProb.Text              = "(" + Strings.Format((float)(fx.BaseProbability * 100.0), "####0") + "%)";
            cbAttribute.SelectedIndex = (int)fx.AttribType;
            cbAspect.SelectedIndex    = (int)fx.Aspect;
            cbModifier.SelectedIndex  = DatabaseAPI.NidFromUidAttribMod(fx.ModifierTable);
            lblAffectsCaster.Text     = "";
            if (fx.ToWho == Enums.eToWho.All)
            {
                cbAffects.SelectedIndex = 1;
            }
            else
            {
                cbAffects.SelectedIndex = (int)fx.ToWho;
            }
            var power = fx.GetPower();

            if (power != null && (power.EntitiesAutoHit & Enums.eEntity.Caster) > Enums.eEntity.None)
            {
                lblAffectsCaster.Text = "Power also affects Self";
            }
            rbIfAny.Checked               = fx.PvMode == Enums.ePvX.Any;
            rbIfCritter.Checked           = fx.PvMode == Enums.ePvX.PvE;
            rbIfPlayer.Checked            = fx.PvMode == Enums.ePvX.PvP;
            chkStack.Checked              = fx.Stacking == Enums.eStacking.Yes;
            chkFXBuffable.Checked         = !fx.Buffable;
            chkFXResistable.Checked       = !fx.Resistible;
            chkNearGround.Checked         = fx.NearGround;
            IgnoreED.Checked              = fx.IgnoreED;
            cbFXSpecialCase.SelectedIndex = (int)fx.SpecialCase;
            cbFXClass.SelectedIndex       = (int)fx.EffectClass;
            chkVariable.Checked           = fx.VariableModifiedOverride;
            clbSuppression.BeginUpdate();
            clbSuppression.Items.Clear();
            string[] names1 = Enum.GetNames(fx.Suppression.GetType());
            int[]    values = (int[])Enum.GetValues(fx.Suppression.GetType());
            int      num1   = names1.Length - 1;

            for (int index = 0; index <= num1; ++index)
            {
                clbSuppression.Items.Add(names1[index], (fx.Suppression & (Enums.eSuppress)values[index]) != Enums.eSuppress.None);
            }
            clbSuppression.EndUpdate();
            lvEffectType.BeginUpdate();
            lvEffectType.Items.Clear();
            int index1 = -1;

            string[] names2 = Enum.GetNames(fx.EffectType.GetType());
            int      num2   = names2.Length - 1;

            for (int index2 = 0; index2 <= num2; ++index2)
            {
                lvEffectType.Items.Add(names2[index2]);
                if ((Enums.eEffectType)index2 == fx.EffectType)
                {
                    index1 = index2;
                }
            }
            if (index1 > -1)
            {
                lvEffectType.Items[index1].Selected = true;
                lvEffectType.Items[index1].EnsureVisible();
            }
            lvEffectType.EndUpdate();
            UpdateEffectSubAttribList();
        }