Exemplo n.º 1
0
        public void StartGame(AbstractCharactorConfig mainCharactor, AbstractCharactorConfig helpCharactor, int Seed = 0)
        {
            RandomUtil.SetSeed(Seed);
            EventSystem.Call(EventType.GameStart, mainCharactor, helpCharactor);

            /*player = new Player()
             * {
             *  MainCharactorType = mainCharactor,
             *  HelpCharactorType = helpCharactor,
             * };
             * player.Init();*/
            /*Model.Game.Scene.AddComponent<CardFactory>();
             * Instance.player = new Player()
             * {
             *  MainCharactorType = mainCharactor,
             *  HelpCharactorType = helpCharactor,
             * };
             * player.Init();
             * player.AddBuff<Buff_Str>().Amount = 1;
             *
             * RandomUtil.SetSeed(1);
             *
             * instance.NowMap = new Map();
             * //NowMap.Creat(5, 0);
             * NowBattle = new Battle();
             * NowBattle.StartBattle(new List<AbstractEnemy>() { new Maoyu() });
             * Log.Debug("战斗结束!");*/
        }
Exemplo n.º 2
0
 void InitCharactorConfig(AbstractCharactorConfig Config)
 {
     //AbstractCharactorConfig Config = CharactorConfigFactory.Instance.Get(charactorTypeEnum);
     foreach (var cardId in Config.BaseCardID)
     {
         Deck.Add(CardFactory.Instance.GetPlayerCard(cardId));
     }
     if (Config == MainCharactorType)
     {
         //foreach (int i in MainCharactorType.BaseRelic)
         //AddRelics();
     }
     Gold  += Config.Gold;
     MaxHp += Config.MaxHp;
 }
Exemplo n.º 3
0
 /// <summary>
 /// 初始化卡组,金钱等信息
 /// </summary>
 public void Init(AbstractCharactorConfig main, AbstractCharactorConfig help)
 {
     MainCharactorType = main;
     HelpCharactorType = help;
     Deck.Clear();
     Relics.Clear();
     potions.Clear();
     Gold  = 0;
     MaxHp = 0;
     //主人物初始能量为2,支援人物初始能量为1
     MaxPower     = 2;
     MaxHelpPower = 1;
     InitCharactorConfig(MainCharactorType);
     InitCharactorConfig(HelpCharactorType);
     NowHp = MaxHp;
 }