예제 #1
0
        public override MParty Build(PartyBuildParams arg)
        {
            var characterFactory = new CharacterFactory();

            if (PartyTable.Instance.Table[arg.Culture].ContainsKey(arg.Name))
            {
                var party      = new MParty();
                var subParties = PartyTable.Instance.Table[arg.Culture][arg.Name];
                foreach (var subParty in subParties)
                {
                    var subPartyParams = new SubPartyBuildParams();
                    subPartyParams.culture   = arg.Culture;
                    subPartyParams.Name      = subParty.X;
                    subPartyParams.Remaining = (subParty.Y * arg.Difficulty);
                    var subPartyCharacters = this._subPartyBuilder.Build(subPartyParams);
                    if (subPartyCharacters != null)
                    {
                        foreach (var character in subPartyCharacters)
                        {
                            var model      = characterFactory.CreateNewCharacter(character.X);
                            var controller = new CChar();
                            var proxy      = new PChar(model);
                            proxy.StartCol = character.Y;
                            controller.SetProxy(proxy);
                            party.AddChar(controller);
                        }
                    }
                }
                return(party);
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
 private void Process()
 {
     if (PredefinedCharTable.Instance.Table.ContainsKey(this._data.ToSummon))
     {
         var preCharParams = PredefinedCharTable.Instance.Table[this._data.ToSummon];
         var factory       = new CharacterFactory();
         var summon        = factory.CreateNewCharacter(preCharParams);
         summon.SetLParty(this._data.LParty);
         var controller = new CChar();
         var proxy      = new PChar(summon);
         controller.SetProxy(proxy);
         this._data.Party.AddChar(controller);
         CombatManager.Instance.ProcessSummon(controller);
         this._data.TargetTile = this._data.TargetTile.GetNearestEmptyTile();
         CharLoader.Instance.LoadSummon(controller, this._data.TargetTile);
         proxy.SetPointsToMax(ESecondaryStat.AP);
         proxy.SetPointsToMax(ESecondaryStat.HP);
         proxy.SetPointsToMax(ESecondaryStat.Stamina);
         proxy.SetPointsToMax(ESecondaryStat.Morale);
         this.ProcessParticles(controller);
     }
 }