Ejemplo n.º 1
0
        public MacroManager(AIController ai)
        {
            this.ai = ai;

            UnitPref = new Dictionary <UnitTypes, int>();
            //Here is where we could use personalities, if they were implemented.
            List <int> randomPref = Shuffle <int>(new List <int>
            {
                80, 100, 85, 97
            });

            UnitPref.Add(UnitTypes.HEAVY, randomPref[0]);
            UnitPref.Add(UnitTypes.LIGHT, randomPref[1]);
            UnitPref.Add(UnitTypes.THROWN, randomPref[2]);
            UnitPref.Add(UnitTypes.CAVALRY, randomPref[3]);
            UnitPref.Add(UnitTypes.MACHINE, 50);
            UnitPref.Add(UnitTypes.SPECIAL, 30);
            unitToBuildMap = new Dictionary <UnitTypes, BuildingTypes>()
            {
                { UnitTypes.HEAVY, BuildingTypes.BARRACK },
                { UnitTypes.LIGHT, BuildingTypes.BARRACK },
                { UnitTypes.THROWN, BuildingTypes.ARCHERY },
                { UnitTypes.CAVALRY, BuildingTypes.STABLE },
            };
            if (ai.race == Races.ELVES) //Goddammit, why couldn't this buildings have the same type
            {
                unitToBuildMap.Add(UnitTypes.SPECIAL, BuildingTypes.ENT);
                unitToBuildMap.Add(UnitTypes.MACHINE, BuildingTypes.WORKSHOP);
            }
            else
            {
                unitToBuildMap.Add(UnitTypes.SPECIAL, BuildingTypes.GRYPHON);
                unitToBuildMap.Add(UnitTypes.MACHINE, BuildingTypes.ARTILLERY);
            }
            architect = new AIArchitect(ai);
        }
Ejemplo n.º 2
0
        public void CreateBuilding(BuildingTypes btype, Vector3 position, Quaternion rotation, AIArchitect architect)
        {
            GameObject  g      = Info.get.createBuilding(_selfRace, btype, position, rotation);
            IGameEntity entity = g.GetComponent <IGameEntity>();

            entity.registerFatalWounds(architect.onDestroy);
            OnBuildingCreated(entity);
        }
Ejemplo n.º 3
0
 public void CreateBuilding(BuildingTypes btype, Vector3 position, Quaternion rotation, AIArchitect architect)
 {
     GameObject g = Info.get.createBuilding(_selfRace, btype, position, rotation);
     IGameEntity entity = g.GetComponent<IGameEntity>();
     entity.registerFatalWounds(architect.onDestroy);
     OnBuildingCreated(entity);
 }