public Elemental(SerializationInfo info, StreamingContext context)
        {
            Name = info.GetString("Name");
            Icon = info.GetValue("Icon", typeof(pIcon)) as pIcon;
            Description = info.GetString("Description");

            Immunities = (List<Elemental>)info.GetValue("Immunities", typeof(List<Elemental>));
            Resistances = (List<Elemental>)info.GetValue("Resistances", typeof(List<Elemental>));
            Weaknesses = (List<Elemental>)info.GetValue("Weaknesses", typeof(List<Elemental>));
        }
        public ItemObject(SerializationInfo info, StreamingContext context)
        {
            Name = (String)info.GetValue("Name", typeof(String));
            Description = (String)info.GetValue("Desc", typeof(String));
            Icon = (pIcon)info.GetValue("Icon", typeof(pIcon));

            HPRecovery = (Int32)info.GetValue("HPRecovery", typeof(Int32));
            MPRecovery = (Int32)info.GetValue("MPRecovery", typeof(Int32));
            HPPercent = (Int32)info.GetValue("HPPercent", typeof(Int32));
            MPPercent = (Int32)info.GetValue("MPPercent", typeof(Int32));

            Ephemeral = (Boolean)info.GetValue("Ephemeral", typeof(Boolean));
            Price = (Int32)info.GetValue("Price", typeof(Int32));
            Unique = (Boolean)info.GetValue("Unique", typeof(Boolean));
            Weight = (Int32)info.GetValue("Weight", typeof(Int32));

            Target = (TargetType)info.GetValue("Target", typeof(TargetType));
            StatusClear = (List<StatusEffect>)info.GetValue("StatusClear", typeof(List<StatusEffect>));

            PermaChange = (CharactStats)info.GetValue("PermaChange", typeof(CharactStats));
        }
 public Elemental()
 {
     SetName(String.Empty);
     Icon = null;
     Description = null;
 }
 public Elemental(String name, pIcon icon)
 {
     SetName(name);
     Icon = icon;
     Description = null;
 }
 public Elemental(String name)
 {
     SetName(name);
     Icon = null;
     Description = null;
 }
        private void BTN_SaveElement_Click(object sender, EventArgs e)
        {
            using (XNAUtils utils = new XNAUtils())
            {
                if (linkLBL_ELEM_Name.Text == LIST_Elements.SelectedItem.ToString() || !ContainsSameName(LIST_Elements, linkLBL_ELEM_Name.Text))
                {
                    pIcon icon = new pIcon(utils.ConvertToTexture(PN_IconElement.BackgroundImage), linkLBL_ELEM_Name.Text);
                    Elemental elem = new Elemental(linkLBL_ELEM_Name.Text, icon);

                    elem.Immunities = new List<Elemental>();
                    elem.Resistances = new List<Elemental>();
                    elem.Weaknesses = new List<Elemental>();

                    elem.Immunities = ES_Immunites.UpdateList();
                    elem.Resistances = ES_Resistances.UpdateList();
                    elem.Weaknesses = ES_Faiblesses.UpdateList();

                    elem.SetDescription(TB_Description.Text);

                    LIST_Elements.Items[LIST_Elements.SelectedIndex] = elem;
                }

                else
                    GenerateSaveWarningBox("élément", linkLBL_ELEM_Name.Text);

                ES_Faiblesses.Init(LIST_Elements, linkLBL_ELEM_Name.Text);
                ES_Resistances.Init(LIST_Elements, linkLBL_ELEM_Name.Text);
                ES_Immunites.Init(LIST_Elements, linkLBL_ELEM_Name.Text);
            }
        }
        private void BTN_SaveAttack_Click(object sender, EventArgs e)
        {
            using (XNAUtils utils = new XNAUtils())
            {
                if (LBL_ATK_Name.Text == LIST_SpecialAttacks.SelectedItem.ToString() || !ContainsSameName(LIST_SpecialAttacks, LBL_ATK_Name.Text))
                {
                    SpecialAttack atk = new SpecialAttack();
                    pIcon icon = new pIcon(utils.ConvertToTexture(PN_Attaque.BackgroundImage), LBL_ATK_Name.Text);
                    atk.AtkIcon = icon;
                    atk.AtkType = (AttackType)DDL_ATK_Type.SelectedItem;
                    atk.DamageRatio = (float)NUM_ATK_Ratio.Value;
                    atk.Name = LBL_ATK_Name.Text;
                    atk.Radius = (int)NUM_ATK_Radius.Value;
                    atk.AnimTarget = (Animation)DDL_ATK_AnimationTarget.SelectedItem;
                    atk.AnimSelf = (Animation)DDL_ATK_AnimationSelf.SelectedItem;
                    atk.Target = (TargetType)DDL_Cible.SelectedItem;

                    LIST_SpecialAttacks.Items[LIST_SpecialAttacks.SelectedIndex] = atk;
                }
                else
                    GenerateSaveWarningBox("attaque spéciale", LBL_ATK_Name.Text);
            }
        }