Exemplo n.º 1
0
        public void Atomize()
        {
            ScenarioName     = ActiveScenario.Name;
            ModuleName       = ActiveScenario.ActiveModule.Name;
            ModuleTurnNumber = ActiveScenario.ActiveModule.TurnNumber;
            int i = 0;

            foreach (Actor actor in ActiveScenario.PlayerParty)
            {
                PlayerPartyNames.Add(i, actor.Name);
                PlayerPartyGenders.Add(i, actor.Gender);
                if (actor is Character)
                {
                    Character actorChar = actor as Character;
                    PlayerPartyIsCharacter.Add(i, true);
                    PlayerPartyProfessions.Add(i, actorChar.Profession.Title);
                    PlayerPartyInventoryItems.Add(i, actorChar.Inventory.Items);
                    PlayerPartyEquipmentSlots.Add(i, actorChar.Equipment.Slot);
                    PlayerPartyAttributes.Add(i, actorChar.Attributes.BaseValue);
                    PlayerPartyTalents.Add(i, actorChar.Talents.BaseValue);
                    List <int> XpLvl = new List <int>()
                    {
                        actorChar.XP.Current, actorChar.XP.Level
                    };
                    PlayerPartyXpLvl.Add(i, XpLvl);
                }
                else
                {
                    PlayerPartyIsCharacter.Add(i, false);
                }
                PlayerPartySkillbars.Add(i, actor.Skillbar);
                PlayerPartyActiveEffects.Add(i, actor.ActiveEffects);
                List <int> HpSp = new List <int>()
                {
                    actor.HP.Current, actor.SP.Current
                };
                PlayerPartyHpSp.Add(i, HpSp);
                i++;
            }
            i = 0;
            foreach (Actor actor in ActiveScenario.ActiveModule.Allies)
            {
                AllyPartyNames.Add(i, actor.Name);
                AllyPartyGenders.Add(i, actor.Gender);
                if (actor is Character)
                {
                    Character actorChar = (Character)actor;
                    AllyPartyIsCharacter.Add(i, true);
                    AllyPartyProfessions.Add(i, actorChar.Profession.Title);
                    AllyPartyInventoryItems.Add(i, actorChar.Inventory.Items);
                    AllyPartyEquipmentSlots.Add(i, actorChar.Equipment.Slot);
                    AllyPartyAttributes.Add(i, actorChar.Attributes.BaseValue);
                    AllyPartyTalents.Add(i, actorChar.Talents.BaseValue);
                }
                else
                {
                    PlayerPartyIsCharacter.Add(i, false);
                }
                AllyPartySkillbars.Add(i, actor.Skillbar);
                AllyPartyActiveEffects.Add(i, actor.ActiveEffects);
                List <int> HpSp = new List <int>()
                {
                    actor.HP.Current, actor.SP.Current
                };
                AllyPartyHpSp.Add(i, HpSp);
                i++;
            }
            i = 0;
            // TODO: if actor is enemy, serialize as enemy
            foreach (Actor actor in ActiveScenario.ActiveModule.Enemies)
            {
                EnemyPartyNames.Add(i, actor.Name);
                EnemyPartyGenders.Add(i, actor.Gender);
                if (actor is Character)
                {
                    Character actorChar = (Character)actor;
                    EnemyPartyIsCharacter.Add(i, true);
                    EnemyPartyProfessions.Add(i, actorChar.Profession.Title);
                    EnemyPartyInventoryItems.Add(i, actorChar.Inventory.Items);
                    EnemyPartyEquipmentSlots.Add(i, actorChar.Equipment.Slot);
                    EnemyPartyAttributes.Add(i, actorChar.Attributes.BaseValue);
                    EnemyPartyTalents.Add(i, actorChar.Talents.BaseValue);
                }
                else
                {
                    PlayerPartyIsCharacter.Add(i, false);
                }
                EnemyPartySkillbars.Add(i, actor.Skillbar);
                EnemyPartyActiveEffects.Add(i, actor.ActiveEffects);
                List <int> HpSp = new List <int>()
                {
                    actor.HP.Current, actor.SP.Current
                };
                EnemyPartyHpSp.Add(i, HpSp);
                i++;
            }

            ActiveScenario = null;
        }
Exemplo n.º 2
0
        public void DeAtomize()
        {
            List <Actor> PlayerParty = new List <Actor>();

            for (int i = 0; i < PlayerPartyNames.Count(); i++)
            {
                if (PlayerPartyIsCharacter[i])
                {
                    PlayerParty.Add(new Character(PlayerPartyNames[i],
                                                  ProfessionMaker(PlayerPartyProfessions[i], PlayerPartyGenders[i])
                                                  ));
                    Character character = PlayerParty[i] as Character;
                    character.XP.Level   = PlayerPartyXpLvl[i][1];
                    character.XP.Current = PlayerPartyXpLvl[i][0];
                }
                else
                {
                    // must be an enemy! add behavior here
                }
                PlayerParty[i].HP.Current = PlayerPartyHpSp[i][0];
                PlayerParty[i].SP.Current = PlayerPartyHpSp[i][1];
            }
            List <Actor> AllyParty = new List <Actor>();

            for (int i = 0; i < AllyPartyNames.Count(); i++)
            {
                if (AllyPartyIsCharacter[i])
                {
                    AllyParty.Add(new Character(AllyPartyNames[i],
                                                ProfessionMaker(AllyPartyProfessions[i], AllyPartyGenders[i])
                                                ));
                    Character character = AllyParty[i] as Character;
                    character.XP.Level   = AllyPartyXpLvl[i][1];
                    character.XP.Current = AllyPartyXpLvl[i][0];
                }
                else
                {
                    // must be an enemy! add behavior here
                }
                AllyParty[i].HP.Current = AllyPartyHpSp[i][0];
                AllyParty[i].SP.Current = AllyPartyHpSp[i][1];
            }
            List <Actor> EnemyParty = new List <Actor>();

            for (int i = 0; i < EnemyPartyNames.Count(); i++)
            {
                if (EnemyPartyIsCharacter[i])
                {
                    EnemyParty.Add(new Character(EnemyPartyNames[i],
                                                 ProfessionMaker(EnemyPartyProfessions[i], EnemyPartyGenders[i])
                                                 ));
                    Character character = EnemyParty[i] as Character;
                    character.XP.Level   = EnemyPartyXpLvl[i][1];
                    character.XP.Current = EnemyPartyXpLvl[i][0];
                }
                else
                {
                    // must be an enemy! add behavior here
                }
                EnemyParty[i].HP.Current = EnemyPartyHpSp[i][0];
                EnemyParty[i].SP.Current = EnemyPartyHpSp[i][1];
            }

            ActiveScenario                      = ScenarioMaker(ScenarioName, ModuleName);
            ActiveScenario.PlayerParty          = PlayerParty;
            ActiveScenario.ActiveModule.Allies  = AllyParty;
            ActiveScenario.ActiveModule.Enemies = EnemyParty;
            ActiveScenario.UpdateModuleParty();
        }