private void LoadButton_Click(object sender, EventArgs e) { Test.Play(); Player mainPlayer = PlayerSaveLoad.ReadFromBinaryFile <Player>(LoadList.SelectedItem.ToString()); Main_Game MainGame = new Main_Game(mainPlayer); MainGame.ShowDialog(); Close(); }
public void button1_Click_1(object sender, EventArgs e) { Test.Play(); Player mainPlayer = Player.Instance; mainPlayer.EntityName = nameTxt.Text; mainPlayer.EntityStats.charHP = 100; mainPlayer.EntityStats.charMP = 10; mainPlayer.EntityStats.charDex = dexPoints; mainPlayer.EntityStats.charCon = conPoints; mainPlayer.EntityStats.charChr = chrPoints; mainPlayer.EntityStats.charInt = intPoints; mainPlayer.EntityStats.charStr = strPoints; mainPlayer.EntityStats.charWis = wisPoints; mainPlayer.PlayerExp = 0; mainPlayer.EntityLevel = 1; mainPlayer.PlayerGold = 0; if (punchBtn.Checked == true) { Abilities Slash = new Abilities(); Slash.SkillPower = 20; Slash.SkillAccuracy = 100; Slash.SkillCost = 0; Slash.SkillName = "Slash"; mainPlayer.EntitySkills.PhysicalSkills.Add(Slash); } if (magicMissileBtn.Checked == true) { Abilities MagicMissile = new Abilities(); MagicMissile.SkillPower = 20; MagicMissile.SkillAccuracy = 65; MagicMissile.SkillCost = 2; MagicMissile.SkillName = "Magic Missile"; mainPlayer.EntitySkills.MagicalSkills.Add(MagicMissile); } Abilities Heal = new Abilities(); Heal.SkillPower = 20; Heal.SkillAccuracy = 100; Heal.SkillCost = 0; Heal.SkillName = "Heal"; mainPlayer.EntitySkills.SelfSkills.Add(Heal); if (axeBtn.Checked == true) { Weapon IronAxe = new Weapon(); IronAxe.Name = "Iron Axe"; IronAxe.Attack = 15; IronAxe.Price = 10; IronAxe.Stats.StatBonus = 2; IronAxe.Stats.StatType = "Strength"; mainPlayer.WeaponEquipped.Add(IronAxe); mainPlayer.ApplyEquipedWeapon(); } if (swordBtn.Checked == true) { Weapon IronSword = new Weapon(); IronSword.Name = "Iron Sword"; IronSword.Attack = 15; IronSword.Price = 10; IronSword.Stats.StatBonus = 2; IronSword.Stats.StatType = "Dexterity"; mainPlayer.WeaponEquipped.Add(IronSword); mainPlayer.ApplyEquipedWeapon(); } if (charAvatar.Image == CloudAv) { mainPlayer.PlayerGender = true; } if (charAvatar.Image == TifaAv) { mainPlayer.PlayerGender = false; } Armor ClothRobe = new Armor(); ClothRobe.Name = "Cloth Robe"; ClothRobe.Defense = 15; ClothRobe.Price = 10; ClothRobe.Stats.StatBonus = 2; ClothRobe.Stats.StatType = "Intelligence"; mainPlayer.ArmorEquipped.Add(ClothRobe); mainPlayer.ApplyEquipedWeapon(); Form mainGame = new Main_Game(mainPlayer); mainGame.Show(); Close(); }