Ejemplo n.º 1
0
        public void TestLoadAll()
        {
            AutomaticSkillTargetType.DicTargetType.Clear();

            BaseEffect.LoadAllEffects();
            BaseSkillRequirement.LoadAllRequirements();
            AutomaticSkillTargetType.LoadAllTargetTypes();
        }
        public UnitTransformingEditor()
        {
            InitializeComponent();

            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
        }
Ejemplo n.º 3
0
        public UnitBuilderEditor()
        {
            InitializeComponent();

            DicUnitType             = Unit.LoadAllUnits();
            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
        }
        public ProjectEternityCharacterEditor()
        {
            InitializeComponent();

            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();
        }
Ejemplo n.º 5
0
        public override void Load()
        {
            fntFinlanderFont = Content.Load <SpriteFont>("Fonts/Finlander Font");

            DicUnitType             = Unit.LoadAllUnits();
            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();
        }
        public override void Load()
        {
            ActiveParser = new IntermissionScreenFormulaParser();

            Menu = new PartMenu[] { new PartMenu("Start battle", new string[] { }),
                                    new PartMenu("View", new string[] { "Pilot View", "Unit View", "Parts View" }),
                                    new PartMenu("Customize", new string[] { "Squad Customize", "Unit Customize", "Unit Equipment", "Pilot Selection", "Parts Equip", "Shop", "Forge" }),
                                    new PartMenu("Data", new string[] { "Save", "Load", "Options" }),
                                    new PartMenu("VR training", new string[] { }),
                                    new PartMenu("Exit", new string[] { }) };
            Menu[2].Open = true;

            DicUnitType             = Unit.LoadAllUnits();
            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();

            fntArial12 = Content.Load <SpriteFont>("Fonts/Arial12");

            UnitEquipmentAvailable = false;

            PlayerRoster = new Roster();
            PlayerRoster.LoadRoster();
            foreach (RosterUnit ActiveUnit in PlayerRoster.DicRosterUnit.Values)
            {
                Unit NewUnit = Unit.FromType(ActiveUnit.UnitTypeName, ActiveUnit.FilePath, GameScreen.ContentFallback, DicUnitType, DicRequirement,
                                             DicEffect, DicAutomaticSkillTarget);

                NewUnit.TeamTags.AddTag("Present");
                NewUnit.TeamTags.AddTag("Event");
                PlayerRoster.TeamUnits.Add(NewUnit);
            }

            foreach (RosterCharacter ActiveCharacter in PlayerRoster.DicRosterCharacter.Values)
            {
                Character NewCharacter = new Character(ActiveCharacter.FilePath, GameScreen.ContentFallback, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);

                NewCharacter.TeamTags.AddTag("Present");
                NewCharacter.TeamTags.AddTag("Event");

                PlayerRoster.TeamCharacters.Add(NewCharacter);
            }

            List <Unit> ListPresentUnit = PlayerRoster.TeamUnits.GetPresent();

            for (int U = 0; U < ListPresentUnit.Count; ++U)
            {
                var ActiveUnit = ListPresentUnit[U] as UnitMultiForm;
                if (ActiveUnit != null)
                {
                    UnitEquipmentAvailable = true;
                }
            }
        }
        public ProjectEternityRelationshipEditor()
        {
            InitializeComponent();

            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();

            AllowEvents = true;
            cboEffectType.Items.AddRange(DicEffect.Values.OrderBy(x => x.EffectTypeName).ToArray());
        }
Ejemplo n.º 8
0
        public ProjectEternityRosterEditor()
        {
            InitializeComponent();
            ListCharacter = new List <Character>();
            ListUnit      = new List <Unit>();

            DicUnitType             = Unit.LoadAllUnits();
            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();
        }
Ejemplo n.º 9
0
        public Attacks()
        {
            InitializeComponent();

            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();

            _ListAttack = new List <Attack>();
            AttackUpgradesValueIndex = 0;
            AttackUpgradesCostIndex  = 0;
        }
Ejemplo n.º 10
0
        public ProjectEternityStandardPartEditor()
        {
            InitializeComponent();

            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();

            AllowEvents = true;
            cboEffectType.Items.AddRange(DicEffect.Values.ToArray());
            cboRequirementType.Items.AddRange(DicRequirement.Values.ToArray());
        }
Ejemplo n.º 11
0
        public readonly List <SpeakerPriority> ListSpeakerPriority;//Used to center camera if the character is talking

        public VisualNovelCharacter(string CharacterName)
        {
            this.CharacterName = CharacterName;

            ListSpeakerPriority = new List <SpeakerPriority>();

            Dictionary <string, BaseSkillRequirement>     DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            Dictionary <string, BaseEffect>               DicEffect               = BaseEffect.LoadAllEffects();
            Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            Dictionary <string, ManualSkillTarget>        DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();

            _LoadedCharacter = new Character(CharacterName, null, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);
        }
Ejemplo n.º 12
0
        public override void LoadAutomaticSkillActivation()
        {
            base.LoadAutomaticSkillActivation();

            AutomaticSkillTargetType.LoadFromAssemblyFiles(Directory.GetFiles("Effects/Deathmatch Map", "*.dll"), typeof(AutomaticSkillTargetType), GlobalDeathmatchContext);

            var ListAssembly = RoslynWrapper.GetCompiledAssembliesFromFolder("Effects/Deathmatch Map", " *.csx", SearchOption.TopDirectoryOnly);

            foreach (Assembly ActiveAssembly in ListAssembly)
            {
                AutomaticSkillTargetType.LoadFromAssembly(ActiveAssembly, typeof(AutomaticSkillTargetType), GlobalDeathmatchContext);
            }
        }
Ejemplo n.º 13
0
        public UnitTester()
        {
            InitializeComponent();

            DicUnitType             = Unit.LoadAllUnits();
            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();

            FilePath       = null;
            AttackerBoosts = new StatsBoosts();
            DefenderBoosts = new StatsBoosts();
            AllowUpdate    = false;
        }
        public SkillChainEditor()
        {
            InitializeComponent();
            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();

            foreach (KeyValuePair <string, BaseEffect> ActiveEffect in Projectile.GetCoreProjectileEffects(null))
            {
                DicEffect.Add(ActiveEffect.Key, ActiveEffect.Value);
            }

            tvSkills.NodeMouseClick += (sender, args) => tvSkills.SelectedNode = args.Node;
            cboEffectType.Items.AddRange(DicEffect.Values.ToArray());
            cboRequirementType.Items.AddRange(DicRequirement.Values.ToArray());
        }
Ejemplo n.º 15
0
        public ProjectEternityAttackEditor()
        {
            InitializeComponent();

            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();

            cbAirRank.SelectedIndex   = 0;
            cbLandRank.SelectedIndex  = 0;
            cbSeaRank.SelectedIndex   = 0;
            cbSpaceRank.SelectedIndex = 0;
            txtName.Text       = "New Item";
            txtName.ReadOnly   = false;
            menuStrip1.Visible = false;
        }
Ejemplo n.º 16
0
        public virtual void LoadAutomaticSkillActivation()
        {
            AutomaticSkillTargetType.DicTargetType.Clear();
            AutomaticSkillTargetType.LoadFromAssemblyFiles(Directory.GetFiles("Effects", "*.dll"), typeof(AutomaticSkillTargetType));
            AutomaticSkillTargetType.LoadFromAssemblyFiles(Directory.GetFiles("Effects/Battle Map", "*.dll"), typeof(AutomaticSkillTargetType), GlobalBattleContext);

            var ListAssembly = RoslynWrapper.GetCompiledAssembliesFromFolder("Effects", "*.csx", SearchOption.TopDirectoryOnly);

            foreach (Assembly ActiveAssembly in ListAssembly)
            {
                AutomaticSkillTargetType.LoadFromAssembly(ActiveAssembly, typeof(AutomaticSkillTargetType));
            }
            ListAssembly = RoslynWrapper.GetCompiledAssembliesFromFolder("Effects/Battle Map", "*.csx", SearchOption.TopDirectoryOnly);
            foreach (Assembly ActiveAssembly in ListAssembly)
            {
                AutomaticSkillTargetType.LoadFromAssembly(ActiveAssembly, typeof(AutomaticSkillTargetType), GlobalBattleContext);
            }
        }
Ejemplo n.º 17
0
        public SkillLevelsEditor(string SkillName)
        {
            InitializeComponent();

            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();

            lblName.Text = SkillName;
            dgvLevels.Rows.Clear();

            BaseAutomaticSkill NewSkill = new BaseAutomaticSkill("Content/Characters/Skills/" + SkillName + ".pecs", SkillName, DicRequirement, DicEffect, DicAutomaticSkillTarget);

            for (int L = 0; L < NewSkill.ListSkillLevel.Count; ++L)
            {
                dgvLevels.Rows.Add(L + 1, L + 1);
            }
        }
Ejemplo n.º 18
0
        public VisualNovelCharacter(BinaryReader BR)
        {
            this.CharacterName = BR.ReadString();

            int ListSpeakerPriorityCounter = BR.ReadInt32();

            ListSpeakerPriority = new List <SpeakerPriority>(ListSpeakerPriorityCounter);
            for (int S = 0; S < ListSpeakerPriorityCounter; ++S)
            {
                ListSpeakerPriority.Add(new SpeakerPriority((SpeakerPriority.PriorityTypes)BR.ReadByte(), BR.ReadString()));
            }

            Dictionary <string, BaseSkillRequirement>     DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            Dictionary <string, BaseEffect>               DicEffect               = BaseEffect.LoadAllEffects();
            Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            Dictionary <string, ManualSkillTarget>        DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();

            _LoadedCharacter = new Character(CharacterName, null, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);
        }
        public ProjectEternityUnitModularEditor()
        {
            InitializeComponent();

            ListPilot = new List <Character>();

            ListHead     = new List <PartHead>();
            ListTorso    = new List <PartTorso>();
            ListLeftArm  = new List <PartArm>();
            ListRightArm = new List <PartArm>();
            ListLegs     = new List <PartLegs>();

            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();

            ResetControls();
        }
        public UnitNormalEditor()
        {
            InitializeComponent();
            FilePath = null;

            frmAttacks        = new Attacks();
            frmDetails        = new DetailsEditor();
            frmUnitSizeEditor = new UnitSizeEditor();

            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();

            txtName.Text        = "";
            txtPrice.Text       = "0";
            txtDescription.Text = "";

            txtBaseHP.Text       = "0";
            txtBaseEN.Text       = "0";
            txtBaseArmor.Text    = "0";
            txtBaseMobility.Text = "0";
            txtBaseMovement.Text = "0";
            txtPartsSlots.Value  = 1;

            lstPilots.Items.Clear();

            lstAnimations.Items.Add(new ListViewItem("Default"));
            lstAnimations.Items.Add(new ListViewItem("Hit"));
            lstAnimations.Items.Add(new ListViewItem("Hit To Default"));
            lstAnimations.Items.Add(new ListViewItem("Move Foward"));
            lstAnimations.Items.Add(new ListViewItem("Move Foward To Default"));
            lstAnimations.Items.Add(new ListViewItem("Move Backward"));
            lstAnimations.Items.Add(new ListViewItem("Move Backward To Default"));
            lstAnimations.Items.Add(new ListViewItem("Destroyed"));
            lstAnimations.Items.Add(new ListViewItem("Shield"));
            lstAnimations.Items.Add(new ListViewItem("Shield To Default"));
            lstAnimations.Items.Add(new ListViewItem("Parry Start"));
            lstAnimations.Items.Add(new ListViewItem("Parry End"));
            lstAnimations.Items.Add(new ListViewItem("Shoot Down Firing"));
            lstAnimations.Items.Add(new ListViewItem("Shoot Down Shot"));
        }
Ejemplo n.º 21
0
        public void LoadCharactersLoadout()
        {
            FileStream   FS = new FileStream("Content/New game characters loadout.txt", FileMode.Open, FileAccess.ReadWrite);
            StreamReader SR = new StreamReader(FS);

            Dictionary <string, BaseSkillRequirement>     DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            Dictionary <string, BaseEffect>               DicEffect               = BaseEffect.LoadAllEffects();
            Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            Dictionary <string, ManualSkillTarget>        DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();

            //Read everything
            while (!SR.EndOfStream)
            {
                string PilotName = SR.ReadLine();

                Character NewCharacter = new Character(PilotName, GameScreen.ContentFallback, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);
                NewCharacter.Level = 1;
                TeamCharacters.ListAll.Add(NewCharacter);
            }
            FS.Close();
        }
        public RelationshipEditor(BaseAutomaticSkill[] ArrayRelationshipBonus)
        {
            InitializeComponent();
            AllowEvents             = false;
            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            cboRequirementType.Items.AddRange(DicRequirement.Values.OrderBy(x => x.SkillRequirementName).ToArray());

            ListRelationshipSkill         = new List <BaseAutomaticSkill>();
            ListRelationshipSkillOriginal = new List <BaseAutomaticSkill>();

            foreach (BaseAutomaticSkill ActiveSkill in ArrayRelationshipBonus)
            {
                ListRelationshipSkill.Add(ActiveSkill);
                ListRelationshipSkillOriginal.Add(ActiveSkill);

                for (int L = 0; L < ActiveSkill.ListSkillLevel.Count; ++L)
                {
                    lstCharacters.Items.Add("Character " + (lstCharacters.Items.Count + 1));
                }
            }
            AllowEvents = true;
        }
Ejemplo n.º 23
0
        public void LoadUnitsLoadout()
        {
            Unit.LoadAllUnits();

            FileStream   FS = new FileStream("Content/New game units loadout.txt", FileMode.Open, FileAccess.ReadWrite);
            StreamReader SR = new StreamReader(FS);

            Dictionary <string, Unit> DicUnitType = Unit.LoadAllUnits();
            Dictionary <string, BaseSkillRequirement>     DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            Dictionary <string, BaseEffect>               DicEffect               = BaseEffect.LoadAllEffects();
            Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();

            //Read everything
            while (!SR.EndOfStream)
            {
                string UnitName = SR.ReadLine();

                string[] UnitInfo   = UnitName.Split(new[] { "\\", "/" }, StringSplitOptions.None);
                Unit     _SpawnUnit = Unit.FromType(UnitInfo[0], UnitName.Remove(0, UnitInfo[0].Length + 1), GameScreen.ContentFallback, DicUnitType, DicRequirement, DicEffect, DicAutomaticSkillTarget);

                TeamUnits.ListAll.Add(_SpawnUnit);
            }
            FS.Close();
        }
Ejemplo n.º 24
0
        public override void Load()
        {
            Trace.Listeners.Add(new TextWriterTraceListener("ClientError.log", "myListener"));

            PlayerManager.DicUnitType = Unit.LoadAllUnits();
            PlayerManager.DicRequirement = BaseSkillRequirement.LoadAllRequirements();
            PlayerManager.DicEffect = BaseEffect.LoadAllEffects();
            PlayerManager.DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            PlayerManager.DicManualSkillTarget = ManualSkillTarget.LoadAllTargetTypes();

            fntArial12 = Content.Load<SpriteFont>("Fonts/Arial12");
            ChatInput = new TextInput(fntArial12, sprPixel, sprPixel, new Vector2(68, 518), new Vector2(470, 20), SendMessage);

            sndBGM = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/Music/Channel.mp3");
            sndBGM.SetLoop(true);
            sndBGM.PlayAsBGM();

            sndButtonOver = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav");
            sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav");

            sprBackground = Content.Load<Texture2D>("Triple Thunder/Menus/Channel/Background");
            sprLicenseAll = Content.Load<Texture2D>("Triple Thunder/Menus/Channel/License All");
            sprTitleBattle = Content.Load<Texture2D>("Triple Thunder/Menus/Channel/Title Battle");

            LocalPlayerSelectionButton = new BoxButton(new Rectangle(400, 8, 120, 45), fntArial12, "Local Players\r\nManagement", OnButtonOver, SelectLocalPlayers);

            QuickStartButton = new BoxButton(new Rectangle(47, 70, 100, 45), fntArial12, "Quick Start", OnButtonOver, null);
            CreateARoomButton = new BoxButton(new  Rectangle(150, 70, 100, 45), fntArial12, "Create\n\ra Room", OnButtonOver, CreateARoom);
            WaitingRoomOnlyButton = new InteractiveButton(Content, "Triple Thunder/Menus/Channel/Waiting Room Only", new Vector2(447, 85), OnButtonOver, null);

            InfoButton = new BoxButton(new Rectangle(572, 40, 100, 35), fntArial12, "Info", OnButtonOver, null);
            RankingButton = new BoxButton(new Rectangle(682, 40, 100, 35), fntArial12, "Ranking", OnButtonOver, null);
            OptionsButton = new BoxButton(new Rectangle(572, 74, 100, 35), fntArial12, "Options", OnButtonOver, null);
            HelpButton = new BoxButton(new Rectangle(682, 74, 100, 35), fntArial12, "Help", OnButtonOver, null);

            ShowAllPlayersFilter = new BoxButton(new Rectangle(572, 130, 60, 25), fntArial12, "All", OnButtonOver, ShowAllPlayers);
            ShowFriendsFilter = new BoxButton(new Rectangle(572 + 62, 130, 60, 25), fntArial12, "Friends", OnButtonOver, ShowFriends);
            ShowGuildsFilter = new BoxButton(new Rectangle(572 + 62 + 62, 130, 60, 25), fntArial12, "Guild", OnButtonOver, ShowGuild);
            
            InventoryButton = new BoxButton(new Rectangle(572, 514, 100, 45), fntArial12, "Inventory", OnButtonOver, OpenInventory);
            ShopButton = new BoxButton(new Rectangle(682, 514, 100, 45), fntArial12, "Shop", OnButtonOver, OpenShop);

            ShowAllPlayersFilter.CanBeChecked = true;
            ShowFriendsFilter.CanBeChecked = true;
            ShowGuildsFilter.CanBeChecked = true;
            ShowAllPlayersFilter.Select();

            ArrayMenuButton = new IUIElement[]
            {
                LocalPlayerSelectionButton, CreateARoomButton, QuickStartButton,
                InfoButton, RankingButton, OptionsButton, HelpButton,
                ShowAllPlayersFilter, ShowFriendsFilter, ShowGuildsFilter,
                ShopButton, InventoryButton,
            };

            if (OnlineGameClient != null)
            {
                InitOnlineGameClient();
                InitOnlineCommunicationClient();
            }
            else
            {
                BattleMapPlayer NewPlayer = new BattleMapPlayer(PlayerManager.OnlinePlayerID, "Player " + (PlayerManager.ListLocalPlayer.Count + 1), BattleMapPlayer.PlayerTypes.Online, false, 0, true, Color.Blue);

                PlayerManager.ListLocalPlayer.Add(NewPlayer);
                PlayerManager.ListLocalPlayer[0].LoadLocally(GameScreen.ContentFallback);
            }
        }
Ejemplo n.º 25
0
        public static void LoadSystemLists()
        {
            Dictionary <string, BaseSkillRequirement>     DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            Dictionary <string, BaseEffect>               DicEffect               = BaseEffect.LoadAllEffects();
            Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            Dictionary <string, ManualSkillTarget>        DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();

            #region Parts

            if (File.Exists("Content/Parts List.txt"))
            {
                StreamReader SR = new StreamReader("Content/Parts List.txt");

                while (!SR.EndOfStream)
                {
                    string   Line       = SR.ReadLine();
                    string[] PartByType = Line.Split('/');
                    if (PartByType[0] == "Standard Parts")
                    {
                        ListPart.Add(Line, new UnitStandardPart("Content/Units/" + Line + ".pep", DicRequirement, DicEffect, DicAutomaticSkillTarget));
                    }
                    else if (PartByType[0] == "Consumable Parts")
                    {
                        ListPart.Add(Line, new UnitConsumablePart("Content/Units/" + Line + ".pep", DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget));
                    }
                }
                SR.Close();
            }
            else
            {
                string[] Files = Directory.GetFiles("Content/Units/Standard Parts", "*.pep", SearchOption.AllDirectories);

                foreach (string File in Files)
                {
                    ListPart.Add(File, new UnitStandardPart(File, DicRequirement, DicEffect, DicAutomaticSkillTarget));
                }
                Files = Directory.GetFiles("Content/Units/Consumable Parts", "*.pep", SearchOption.AllDirectories);

                foreach (var File in Files)
                {
                    ListPart.Add(File, new UnitConsumablePart(File, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget));
                }
            }

            #endregion

            #region Buyable Skills

            if (File.Exists("Content/Buyable Skills List.txt"))
            {
                StreamReader SR = new StreamReader("Content/Buyable Skills List.txt");

                while (!SR.EndOfStream)
                {
                    string Line = SR.ReadLine();
                    ListBuyableSkill.Add(new BaseAutomaticSkill("Content/Characters/Skills/" + Line + ".pecs", Line, DicRequirement, DicEffect, DicAutomaticSkillTarget));
                }
                SR.Close();
            }
            else
            {
                string[] Files = Directory.GetFiles("Content/Characters/Skills", "*.pecs", SearchOption.AllDirectories);

                foreach (string File in Files)
                {
                    string RelativePath = File;
                    ListBuyableSkill.Add(new BaseAutomaticSkill(File, RelativePath, DicRequirement, DicEffect, DicAutomaticSkillTarget));
                }
            }

            #endregion

            #region Spirits

            if (File.Exists("Content/Spirits List.txt"))
            {
                StreamReader SR = new StreamReader("Content/Spirits List.txt");

                while (!SR.EndOfStream)
                {
                    string Line = SR.ReadLine();
                    ListSpirit.Add(new ManualSkill("Content/Characters/Spirits/" + Line + ".pecs", DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget));
                }
                SR.Close();
            }
            else
            {
                string[] Files = Directory.GetFiles("Content/Characters/Spirits", "*.pecs", SearchOption.AllDirectories);

                foreach (string File in Files)
                {
                    ListSpirit.Add(new ManualSkill(File, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget));
                }
            }

            #endregion

            #region Skills

            if (File.Exists("Content/Skills List.txt"))
            {
                StreamReader SR = new StreamReader("Content/Skills List.txt");

                while (!SR.EndOfStream)
                {
                    string Line = SR.ReadLine();
                    ListBuyableSkill.Add(new BaseAutomaticSkill("Content/Characters/Skills/" + Line + ".pecs", Line, DicRequirement, DicEffect, DicAutomaticSkillTarget));
                }
                SR.Close();
            }
            else
            {
                string[] Files = Directory.GetFiles("Content/Characters/Skills", "*.pecs", SearchOption.AllDirectories);

                foreach (string File in Files)
                {
                    string RelativePath = File;
                    ListSkill.Add(new BaseAutomaticSkill(File, RelativePath, DicRequirement, DicEffect, DicAutomaticSkillTarget));
                }
            }

            #endregion

            #region Abilities

            if (File.Exists("Content/Abilities List.txt"))
            {
                StreamReader SR = new StreamReader("Content/Abilities List.txt");

                while (!SR.EndOfStream)
                {
                    string Line = SR.ReadLine();
                    ListAbility.Add(new BaseAutomaticSkill("Content/Units/Abilities/" + Line + ".pecs", Line, DicRequirement, DicEffect, DicAutomaticSkillTarget));
                }
                SR.Close();
            }
            else
            {
                string[] Files = Directory.GetFiles("Content/Units/Abilities", "*.pecs", SearchOption.AllDirectories);

                foreach (string File in Files)
                {
                    string RelativePath = File;
                    ListAbility.Add(new BaseAutomaticSkill(File, RelativePath, DicRequirement, DicEffect, DicAutomaticSkillTarget));
                }
            }

            #endregion
        }
Ejemplo n.º 26
0
        public override void Update(GameTime gameTime)
        {
            EllapsedTime += gameTime.ElapsedGameTime.TotalSeconds;

            if (EllapsedTime >= 10)
            {
                int OldNumberOfGameScreen  = ListGameScreen.Count;
                MultiplayerScreen Autoplay = new MultiplayerScreen();
                Autoplay.Load();
                Constants.ShowAnimation = false;
                DeathmatchMap NewMap = Autoplay.LoadAutoplay();
                NewMap.ListGameScreen = ListGameScreen;
                NewMap.Load();
                NewMap.Init();
                NewMap.TogglePreview(true);

                //Remove any GameScreen created by the map so they don't show up immediately.
                List <GameScreen> ListGameScreenCreatedByMap = new List <GameScreen>(ListGameScreen.Count - OldNumberOfGameScreen);
                for (int S = ListGameScreen.Count - 1 - OldNumberOfGameScreen; S >= 0; --S)
                {
                    ListGameScreenCreatedByMap.Add(ListGameScreen[S]);
                    ListGameScreen.RemoveAt(S);
                }

                RemoveAllScreens();
                ListGameScreen.Insert(0, NewMap);
                NewMap.Update(gameTime);

                for (int S = 0; S < ListGameScreenCreatedByMap.Count; ++S)
                {
                    ListGameScreen.Insert(0, ListGameScreenCreatedByMap[S]);
                    ListGameScreenCreatedByMap[S].Update(gameTime);
                }

                ListGameScreenCreatedByMap.Clear();
            }

            if (InputHelper.InputUpPressed())
            {
                EllapsedTime = 0;

                SelectedChoice--;
                sndSelection.Play();

                if (SelectedChoice == -1)
                {
                    SelectedChoice = 4;
                }
            }
            else if (InputHelper.InputDownPressed())
            {
                EllapsedTime = 0;

                SelectedChoice++;
                sndSelection.Play();

                if (SelectedChoice == 5)
                {
                    SelectedChoice = 0;
                }
            }
            else if (InputHelper.InputConfirmPressed())
            {
                switch ((MenuChoices)SelectedChoice)
                {
                case MenuChoices.NewGame:
                    sndIntroSong.Stop();
                    sndConfirm.Play();

                    /*
                     *
                     * int OldNumberOfGameScreen = ListGameScreen.Count;
                     * StreamReader BR = new StreamReader("Content/Map path.ini");
                     * DeathmatchMap NewMap = new DeathmatchMap(BR.ReadLine(), 0, new Dictionary<string, List<Core.Units.Squad>>());
                     * BR.Close();
                     * NewMap.ListGameScreen = ListGameScreen;
                     * NewMap.PlayerRoster = new Roster();
                     * NewMap.PlayerRoster.LoadRoster();
                     * NewMap.Load();
                     * NewMap.Init();
                     * NewMap.TogglePreview(true);
                     *
                     * //Remove any GameScreen created by the map so they don't show up immediately.
                     * List<GameScreen> ListGameScreenCreatedByMap = new List<GameScreen>(ListGameScreen.Count - OldNumberOfGameScreen);
                     * for (int S = ListGameScreen.Count - 1 - OldNumberOfGameScreen; S >= 0; --S)
                     * {
                     *  ListGameScreenCreatedByMap.Add(ListGameScreen[S]);
                     *  ListGameScreen.RemoveAt(S);
                     * }
                     *
                     * RemoveAllScreens();
                     * ListGameScreen.Insert(0, NewMap);
                     * NewMap.Update(gameTime);
                     *
                     * for (int S = 0; S < ListGameScreenCreatedByMap.Count; ++S)
                     * {
                     *  ListGameScreen.Insert(0, ListGameScreenCreatedByMap[S]);
                     *  ListGameScreenCreatedByMap[S].Update(gameTime);
                     * }
                     *
                     * ListGameScreenCreatedByMap.Clear();*/
                    PushScreen(new GameSelection());
                    break;

                case MenuChoices.QuickLoad:
                    if (File.Exists("User Data/Saves/TempSave.sav"))
                    {
                        sndIntroSong.Stop();
                        sndConfirm.Play();
                        BattleMap QuickLoadMap = BattleMap.LoadTemporaryMap(ListGameScreen);
                        QuickLoadMap.TogglePreview(true);
                        ListGameScreen.Insert(0, QuickLoadMap);
                    }
                    else
                    {
                        sndDeny.Play();
                    }
                    break;

                case MenuChoices.Encyclopedia:
                    sndDeny.Play();
                    break;

                case MenuChoices.Option:
                    PushScreen(new OptionMenu());
                    sndConfirm.Play();
                    break;

                case MenuChoices.LoadGame:
                    if (File.Exists("User Data/Saves/SRWE Save.bin"))
                    {
                        sndIntroSong.Stop();
                        sndConfirm.Play();

                        Roster PlayerRoster = new Roster();
                        PlayerRoster.LoadRoster();
                        Dictionary <string, Unit> DicUnitType = Unit.LoadAllUnits();
                        Dictionary <string, BaseSkillRequirement>     DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
                        Dictionary <string, BaseEffect>               DicEffect               = BaseEffect.LoadAllEffects();
                        Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
                        Dictionary <string, ManualSkillTarget>        DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();
                        DataScreen.LoadProgression(PlayerRoster, DicUnitType, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);
                        PushScreen(new NewIntermissionScreen(PlayerRoster));
                    }
                    else
                    {
                        sndDeny.Play();
                    }
                    break;
                }
            }
        }
Ejemplo n.º 27
0
        public override void LoadAutomaticSkillActivation()
        {
            base.LoadAutomaticSkillActivation();

            foreach (KeyValuePair <string, AutomaticSkillTargetType> ActiveAutomaticSkill in AutomaticSkillTargetType.LoadFromAssemblyFiles(Directory.GetFiles("Effects/Deathmatch Map", "*.dll"), typeof(AutomaticSkillTargetType), GlobalDeathmatchContext))
            {
                DicAutomaticSkillTarget.Add(ActiveAutomaticSkill.Key, ActiveAutomaticSkill.Value);
            }

            List <Assembly> ListAssembly = RoslynWrapper.GetCompiledAssembliesFromFolder("Effects/Deathmatch Map", " *.csx", SearchOption.TopDirectoryOnly);

            foreach (Assembly ActiveAssembly in ListAssembly)
            {
                foreach (KeyValuePair <string, AutomaticSkillTargetType> ActiveAutomaticSkill in AutomaticSkillTargetType.LoadFromAssembly(ActiveAssembly, typeof(AutomaticSkillTargetType), GlobalDeathmatchContext))
                {
                    DicAutomaticSkillTarget.Add(ActiveAutomaticSkill.Key, ActiveAutomaticSkill.Value);
                }
            }
        }
        private BaseAutomaticSkill CreateDummySkill(BaseSkillRequirement Requirement, AutomaticSkillTargetType Target, BaseEffect Effect)
        {
            BaseAutomaticSkill NewSkill = new BaseAutomaticSkill();

            NewSkill.Name = "Dummy";
            NewSkill.ListSkillLevel.Add(new BaseSkillLevel());
            NewSkill.CurrentLevel = 1;

            BaseSkillActivation NewActivation = new BaseSkillActivation();

            NewSkill.CurrentSkillLevel.ListActivation.Add(NewActivation);

            NewActivation.ListRequirement.Add(Requirement);

            NewActivation.ListEffect.Add(Effect);
            NewActivation.ListEffectTargetReal.Add(new List <AutomaticSkillTargetType>());
            NewActivation.ListEffectTargetReal[0].Add(Target);

            return(NewSkill);
        }
Ejemplo n.º 29
0
        static void Main(string[] args)
        {
            string[] Files = Directory.GetFiles("Mods", "*.dll");
            for (int F = 0; F < Files.Length; F++)
            {
                Assembly ass = Assembly.LoadFile(Path.GetFullPath(Files[F]));
                //Get every classes in it.
                Type[] types = ass.GetTypes();
                for (int t = 0; t < types.Length; t++)
                {
                    //Look if the class inherit from Unit somewhere.
                    Type ObjectType           = types[t].BaseType;
                    bool InstanceIsBaseObject = ObjectType == typeof(BattleMap);
                    while (ObjectType != null && ObjectType != typeof(BattleMap))
                    {
                        ObjectType = ObjectType.BaseType;
                        if (ObjectType == null)
                        {
                            InstanceIsBaseObject = false;
                        }
                    }
                    //If this class is from BaseEditor, load it.
                    if (InstanceIsBaseObject)
                    {
                        BattleMap instance = Activator.CreateInstance(types[t]) as BattleMap;
                        BattleMap.DicBattmeMapType.Add(instance.GetMapType(), instance);
                    }
                }
            }
            PlayerManager.DicUnitType             = Unit.LoadAllUnits();
            PlayerManager.DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            PlayerManager.DicEffect               = BaseEffect.LoadAllEffects();
            PlayerManager.DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            PlayerManager.DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();

            Dictionary <string, OnlineScript> DicOnlineScripts = new Dictionary <string, OnlineScript>();

            IniFile ConnectionInfo       = IniFile.ReadFromFile("Connection Info.ini");
            string  ConnectionChain      = ConnectionInfo.ReadField("Game Server Info", "Connection Chain");
            string  UserInformationChain = ConnectionInfo.ReadField("User Information Info", "Connection Chain");

            GameMongoDBManager Databse = new GameMongoDBManager();

            Databse.Init(ConnectionChain, UserInformationChain);
            GameServer OnlineServer = new GameServer(Databse, DicOnlineScripts);

            DicOnlineScripts.Add(AskLoginScriptServer.ScriptName, new AskLoginScriptServer(OnlineServer));
            DicOnlineScripts.Add(BaseAskJoinRoomScriptServer.ScriptName, new AskJoinRoomScriptServer(OnlineServer));
            DicOnlineScripts.Add(AskRoomListScriptServer.ScriptName, new AskRoomListScriptServer(OnlineServer));
            DicOnlineScripts.Add(BaseCreateRoomScriptServer.ScriptName, new CreateRoomScriptServer(OnlineServer, BattleMapClientGroup.Template));
            DicOnlineScripts.Add(TransferRoomScriptServer.ScriptName, new TransferRoomScriptServer(OnlineServer, BattleMapClientGroup.Template));

            string PublicIP   = ConnectionInfo.ReadField("Game Server Info", "Public IP");
            int    PublicPort = int.Parse(ConnectionInfo.ReadField("Game Server Info", "Public Port"));

            Trace.Listeners.Add(new TextWriterTraceListener("Game Server Error.log", "myListener"));

            OnlineServer.StartListening(PublicIP, PublicPort);
            Console.ReadKey();
            OnlineServer.StopListening();
        }
Ejemplo n.º 30
0
        public GUI(bool LoadContent = true)
        {
            if (LoadContent)
            {
                SplashScreen.ShowSplashScreen();
                SplashScreen.SetStatus("Initializing Roslyn");
            }

            InitializeComponent();

            if (LoadContent)
            {
                FormulaParser.ActiveParser = new GUIFormulaParser();
                AutomaticSkillTargetType.LoadAllTargetTypes();
                ManualSkillTarget.LoadAllSkillRequirement();
                SplashScreen.SetStatus("Initializing Graphics");
                RootGraphicDevice = new GUIGraphicDevice();
                GameScreens.GameScreen.LoadHelpers(RootGraphicDevice.Content);
                GameScreens.GameScreen.GraphicsDevice = RootGraphicDevice.GraphicsDevice;
            }

            BaseEditor.GetItemsByRoot = GetItemsByRoot;
            this.SetStyle(ControlStyles.StandardDoubleClick, false);//Disable right double click.

            //Place holder to store values for the lookup.
            ListEditor = new Dictionary <string, List <ItemContainer> >();

            if (Directory.Exists("Editors") && LoadContent)
            {
                tvItems.Nodes.Clear();
                //Look for every dll in the Editors folder.
                String[] Files = Directory.GetFiles("Editors", "*.dll");
                Type     EditorType;
                bool     EditorIsBaseEditor = true;
                for (int F = 0; F < Files.Count(); F++)
                {//Load a dll.
                    Assembly ass   = Assembly.LoadFile(Path.GetFullPath(Files[F]));
                    Type[]   types = null;
                    //Get every classes in it.
                    try
                    {
                        types = ass.GetTypes();
                    }
                    catch (Exception ex)
                    {
                        if (ex is ReflectionTypeLoadException)
                        {
                            var typeLoadException = ex as ReflectionTypeLoadException;
                            var loaderExceptions  = typeLoadException.LoaderExceptions;

                            MessageBox.Show(ex.Message);
                        }
                        continue;
                    }
                    for (int t = 0; t < types.Count(); t++)
                    {
                        //Look if the class inherit from BaseEditor somewhere.
                        EditorType         = types[t];
                        EditorIsBaseEditor = false;
                        while (EditorType != null && !EditorIsBaseEditor)
                        {
                            EditorType = EditorType.BaseType;
                            if (EditorType == typeof(BaseEditor))
                            {
                                EditorIsBaseEditor = true;
                            }
                        }
                        //If this class is from BaseEditor, load it.
                        if (EditorIsBaseEditor)
                        {
                            BaseEditor instance = null;
                            try
                            {
                                instance = Activator.CreateInstance(types[t]) as BaseEditor;
                            }
                            catch (Exception e)
                            {
                                MessageBox.Show(e.ToString());
                                continue;
                            }

                            //Get the BaseEditor's EditorInfo.
                            EditorInfo[] Info = instance.LoadEditors();
                            if (Info == null)
                            {
                                continue;
                            }

                            //Loop through the Item paths used to filter the items(if there is multiple items type by editor).
                            for (int P = 0; P < Info.Length; P++)
                            {
                                AddEditor(Info[P]);
                            }
                        }
                    }
                }

                InitGUI();
            }

            if (LoadContent)
            {
                SplashScreen.CloseForm();
            }
        }