Ejemplo n.º 1
0
 public UpgradeSystem(IGameContext context, MonsterFactory monsterFactory, Grid grid) : base(context)
 {
     _context = context;
     _grid    = grid;
     upgrade  = new Dictionary <CreatureType, Action <Vector3Int> >()
     {
         // white
         { CreatureType.Statue, monsterFactory.CreateHuman },
         { CreatureType.Human, (pos) =>
           {
               if (UnityEngine.Random.Range(0, 2) < 0.5)
               {
                   monsterFactory.CreateWarrior(pos);
               }
               else
               {
                   monsterFactory.CreateWorker(pos);
               }
           } },
         { CreatureType.Worker, monsterFactory.CreatePrist },
         { CreatureType.Warrior, monsterFactory.CreateHealer },
         // black
         { CreatureType.BlackStatue, monsterFactory.CreateSkeleton },
         { CreatureType.Skeleton, (pos) =>
           {
               if (UnityEngine.Random.Range(0, 2) < 0.5)
               {
                   monsterFactory.CreateBlackWorker(pos);
               }
               else
               {
                   monsterFactory.CreateZombie(pos);
               }
           } },
         { CreatureType.BlackWorker, monsterFactory.CreateLich },
     };
 }