public CityguardBuilding() { _elementType = ElementType.Type.BUILDING_CITYGUARD_HOUSE; _imagePath = "pack://application:,,,/Resources/Images/Military/building_cityguard_house.png"; _detailImagePath = "pack://application:,,,/Resources/Images/Military/menu_cityguard_house.png"; _name = "Cityguard House"; _elementInfo = "It allows recruitment of City Guards and, if upgraded, increases their stats."; _hasLevelEnable = true; _isRessources = false; _isBarrack = false; // Element cost for each level _elementCostsList.Add(1, new ElementCost(15, 30, 0)); _elementCostsList.Add(2, new ElementCost(30, 60, 0)); _elementCostsList.Add(3, new ElementCost(55, 110, 0)); _elementCostsList.Add(4, new ElementCost(140, 280, 0)); _elementCostsList.Add(5, new ElementCost(400, 800, 0)); _elementCostsList.Add(6, new ElementCost(1000, 2000, 0)); _elementCostsList.Add(7, new ElementCost(1900, 3800, 0)); _elementCostsList.Add(8, new ElementCost(3200, 6400, 0)); _elementCostsList.Add(9, new ElementCost(5100, 10200, 0)); _elementCostsList.Add(10, new ElementCost(8000, 16000, 0)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 2); _elementScoreList.Add(3, 4); _elementScoreList.Add(4, 7); _elementScoreList.Add(5, 12); _elementScoreList.Add(6, 18); _elementScoreList.Add(7, 25); _elementScoreList.Add(8, 34); _elementScoreList.Add(9, 45); _elementScoreList.Add(10, 60); }
public MoonglowTowerBuilding() { _elementType = ElementType.Type.BUILDING_MOONGLOW_TOWER; _imagePath = "pack://application:,,,/Resources/Images/Military/building_moonglow_tower.png"; _detailImagePath = "pack://application:,,,/Resources/Images/Military/menu_moonglow_tower.png"; _name = "Moonglow Tower"; _elementInfo = "Allows recruitment of caster units and, if upgraded, increases their stats."; _hasLevelEnable = true; _isRessources = false; _isBarrack = false; // Element cost for each level _elementCostsList.Add(1, new ElementCost(30, 60, 0)); _elementCostsList.Add(2, new ElementCost(60, 120, 0)); _elementCostsList.Add(3, new ElementCost(120, 240, 0)); _elementCostsList.Add(4, new ElementCost(300, 600, 0)); _elementCostsList.Add(5, new ElementCost(900, 1800, 0)); _elementCostsList.Add(6, new ElementCost(2100, 4200, 0)); _elementCostsList.Add(7, new ElementCost(4200, 8400, 0)); _elementCostsList.Add(8, new ElementCost(7200, 14400, 0)); _elementCostsList.Add(9, new ElementCost(11400, 22800, 0)); _elementCostsList.Add(10, new ElementCost(17400, 34800, 0)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 4); _elementScoreList.Add(3, 7); _elementScoreList.Add(4, 14); _elementScoreList.Add(5, 24); _elementScoreList.Add(6, 36); _elementScoreList.Add(7, 50); _elementScoreList.Add(8, 68); _elementScoreList.Add(9, 90); _elementScoreList.Add(10, 120); }
public StableBuilding() { _elementType = ElementType.Type.BUILDING_STABLE; _imagePath = "pack://application:,,,/Resources/Images/Military/building_stable.png"; _detailImagePath = "pack://application:,,,/Resources/Images/Military/menu_stable.png"; _name = "Stable"; _elementInfo = "Allows recruitment of cavalry units and, if upgraded, increases their stats."; _hasLevelEnable = true; _isRessources = false; _isBarrack = false; // Element cost for each level _elementCostsList.Add(1, new ElementCost(25, 50, 0)); _elementCostsList.Add(2, new ElementCost(55, 110, 0)); _elementCostsList.Add(3, new ElementCost(110, 220, 0)); _elementCostsList.Add(4, new ElementCost(275, 550, 0)); _elementCostsList.Add(5, new ElementCost(800, 1600, 0)); _elementCostsList.Add(6, new ElementCost(1900, 3800, 0)); _elementCostsList.Add(7, new ElementCost(3750, 7500, 0)); _elementCostsList.Add(8, new ElementCost(6500, 13000, 0)); _elementCostsList.Add(9, new ElementCost(10200, 20400, 0)); _elementCostsList.Add(10, new ElementCost(15500, 31000, 0)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 3); _elementScoreList.Add(3, 6); _elementScoreList.Add(4, 12); _elementScoreList.Add(5, 20); _elementScoreList.Add(6, 30); _elementScoreList.Add(7, 42); _elementScoreList.Add(8, 57); _elementScoreList.Add(9, 75); _elementScoreList.Add(10, 100); }
public TrainingGroundBuilding() { _elementType = ElementType.Type.BUILDING_TRAINING_GROUND; _imagePath = "pack://application:,,,/Resources/Images/Military/building_training_ground.png"; _detailImagePath = "pack://application:,,,/Resources/Images/Military/menu_training_ground.png"; _name = "Training Ground"; _elementInfo = "Allows recruitment of infantry units and, if upgraded, increases their stats."; _hasLevelEnable = true; _isRessources = false; _isBarrack = false; // Element cost for each level _elementCostsList.Add(1, new ElementCost(20, 40, 0)); _elementCostsList.Add(2, new ElementCost(40, 80, 0)); _elementCostsList.Add(3, new ElementCost(80, 160, 0)); _elementCostsList.Add(4, new ElementCost(200, 400, 0)); _elementCostsList.Add(5, new ElementCost(600, 1200, 0)); _elementCostsList.Add(6, new ElementCost(1400, 2800, 0)); _elementCostsList.Add(7, new ElementCost(2800, 5600, 0)); _elementCostsList.Add(8, new ElementCost(4800, 9600, 0)); _elementCostsList.Add(9, new ElementCost(7500, 15000, 0)); _elementCostsList.Add(10, new ElementCost(11500, 23000, 0)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 2); _elementScoreList.Add(3, 5); _elementScoreList.Add(4, 10); _elementScoreList.Add(5, 16); _elementScoreList.Add(6, 24); _elementScoreList.Add(7, 34); _elementScoreList.Add(8, 46); _elementScoreList.Add(9, 60); _elementScoreList.Add(10, 80); }
/// <summary> /// Assigns the elementtype to the weapon mesh and effects. /// </summary> public void AssignElement() { redTexts.gameObject.SetActive(false); blueTexts.gameObject.SetActive(false); purpleTexts.gameObject.SetActive(false); weapon = rInput.weapon; if (weapon) { switch (school) { case 0: weapon.ChangeMesh("Red"); print("Red"); //Red elementType = ElementType.Type.Red; redTexts.gameObject.SetActive(true); break; case 1: weapon.ChangeMesh("Purple"); print("Purple"); //Purple elementType = ElementType.Type.Purple; purpleTexts.gameObject.SetActive(true); break; case 2: weapon.ChangeMesh("Blue"); print("Blue"); //Blue elementType = ElementType.Type.Blue; blueTexts.gameObject.SetActive(true); break; } } }
private void expandRessource(Element element, ElementType.Type elementType) { List <Element> firstLayer = new List <Element>(); firstLayer = firstLayer.Concat(rotateElement(element, elementType, 2)).ToList(); foreach (var secondElement in firstLayer) { rotateElement(secondElement, elementType, 3); } }
private List <Element> rotateElement(Element element, ElementType.Type elementType, int chance) { List <Element> newElements = new List <Element>(); List <Element> testList = new List <Element>(); Element[,] map = Gameboard.Instance.GetMap(); int frameCount = Gameboard.Instance.GetFrameCount; if (element.PositionX > 0) { if (Random.Next(chance) == chance) { testList.Add(map[element.PositionX - 1, element.PositionY]); } } if (element.PositionX < frameCount - 1) { if (Random.Next(chance) == chance - 1) { testList.Add(map[element.PositionX + 1, element.PositionY]); } } if (element.PositionY > 0) { if (Random.Next(chance) == chance - 1) { testList.Add(map[element.PositionX, element.PositionY - 1]); } } if (element.PositionY < frameCount - 1) { if (Random.Next(chance) == chance - 1) { testList.Add(map[element.PositionX, element.PositionY + 1]); } } foreach (var elementCheck in testList) { if (!elementCheck.HasElement) { newElements.Add(elementCheck); elementCheck.SetElementType(ElementType.GetTypeObject(elementType)); } } return(newElements); }
public StoneElementType() { _elementType = ElementType.Type.RESSOURCE_STONE; _name = ElementType.GetTypeName(_elementType); _isRessources = true; _hasLevelEnable = false; _imagePath = "pack://application:,,,/Resources/Images/resource_stone.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_stone.png"; _elementInfo = "Each Quarry gains 50% for the first adjacent stone node, then 40% for each after that. The Quarry's production efficiency can then be increased up to 75% by an adjacent Stonemason, and up to 30% by each adjacent Cottage."; // Bonus linked to Stone _elementProductionBonus = new ElementProductionBonus(0, 0, 0, 0); _elementProductionBonus.IsRessourcesBonus = true; _elementProductionBonus.FirstBonus = 50; _elementProductionBonus.SecondBonus = 40; }
public FieldsElementType() { _elementType = ElementType.Type.RESSOURCE_FIELDS; _name = ElementType.GetTypeName(_elementType); _isRessources = true; _hasLevelEnable = false; _imagePath = "pack://application:,,,/Resources/Images/resource_corn.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_field.png"; _elementInfo = "Each Woodcutter's Hut gains 50% production efficiency from the first adjacent wood node, then 40% for each after that. The Woodcutter's Hut production efficiency can then be further increased up to 75% by an adjacent Sawmill, and up to 30% by each adjacent Cottage."; // Bonus linked to fields _elementProductionBonus = new ElementProductionBonus(0,0,0,0); _elementProductionBonus.IsRessourcesBonus = true; _elementProductionBonus.FirstBonus = 50; _elementProductionBonus.SecondBonus = 40; }
public LakeElementType() { _elementType = ElementType.Type.RESSOURCE_WATER; _name = ElementType.GetTypeName(_elementType); _isRessources = true; _hasLevelEnable = false; _imagePath = "pack://application:,,,/Resources/Images/resource_lake.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_lake.png"; _elementInfo = "Increases the food production efficiency of adjacent Farms by 50%."; // Bonus linked to fields _elementProductionBonus = new ElementProductionBonus(0, 0, 0, 0); _elementProductionBonus.IsRessourcesBonus = true; _elementProductionBonus.FirstBonus = 50; _elementProductionBonus.SecondBonus = 50; }
public FieldsElementType() { _elementType = ElementType.Type.RESSOURCE_FIELDS; _name = ElementType.GetTypeName(_elementType); _isRessources = true; _hasLevelEnable = false; _imagePath = "pack://application:,,,/Resources/Images/resource_corn.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_field.png"; _elementInfo = "Each Woodcutter's Hut gains 50% production efficiency from the first adjacent wood node, then 40% for each after that. The Woodcutter's Hut production efficiency can then be further increased up to 75% by an adjacent Sawmill, and up to 30% by each adjacent Cottage."; // Bonus linked to fields _elementProductionBonus = new ElementProductionBonus(0, 0, 0, 0); _elementProductionBonus.IsRessourcesBonus = true; _elementProductionBonus.FirstBonus = 50; _elementProductionBonus.SecondBonus = 40; }
/// <summary> /// Called once per frame, /// Sets element shields on enemies based on player element type. /// </summary> void Update() { ElementType.Type playerElement = player.elementType; foreach (GameObject e in activePool) { if (e.GetComponent <Enemy>().elementType == playerElement) { e.GetComponent <Enemy>().ElementShield(true); } else { e.GetComponent <Enemy>().ElementShield(false); } } }
public BarrackBuilding() { _elementType = ElementType.Type.BUILDING_BARRACK; _imagePath = "pack://application:,,,/Resources/Images/Military/building_barrack.png"; _detailImagePath = "pack://application:,,,/Resources/Images/Military/menu_barrack.png"; _name = "Barrack"; _elementInfo = "Barrack increases the maximum army size of a city."; _hasLevelEnable = true; _isRessources = false; _isBarrack = true; // Element cost for each level _elementCostsList.Add(1, new ElementCost(0, 50, 0)); _elementCostsList.Add(2, new ElementCost(0, 150, 0)); _elementCostsList.Add(3, new ElementCost(0, 300, 0)); _elementCostsList.Add(4, new ElementCost(0, 600, 0)); _elementCostsList.Add(5, new ElementCost(0, 1200, 0)); _elementCostsList.Add(6, new ElementCost(0, 2500, 0)); _elementCostsList.Add(7, new ElementCost(0, 4000, 0)); _elementCostsList.Add(8, new ElementCost(0, 7000, 0)); _elementCostsList.Add(9, new ElementCost(0, 11500, 0)); _elementCostsList.Add(10, new ElementCost(0, 17500, 0)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 2); _elementScoreList.Add(3, 4); _elementScoreList.Add(4, 7); _elementScoreList.Add(5, 12); _elementScoreList.Add(6, 18); _elementScoreList.Add(7, 25); _elementScoreList.Add(8, 34); _elementScoreList.Add(9, 45); _elementScoreList.Add(10, 60); // Army size for each level _elementArmySizeList.Add(1, 10); _elementArmySizeList.Add(2, 30); _elementArmySizeList.Add(3, 60); _elementArmySizeList.Add(4, 100); _elementArmySizeList.Add(5, 160); _elementArmySizeList.Add(6, 240); _elementArmySizeList.Add(7, 350); _elementArmySizeList.Add(8, 500); _elementArmySizeList.Add(9, 700); _elementArmySizeList.Add(10, 1000); }
public WarehouseElementType() { _elementType = ElementType.Type.BUILDING_WAREHOUSE; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_storage.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_storage.png"; _elementInfo = "It increases the storage capacity for all resources. Enhanced by any bordering Sawmill, Stonemason, Mill or Foundry."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(60, 0, 0)); _elementCostsList.Add(2, new ElementCost(150, 0, 0)); _elementCostsList.Add(3, new ElementCost(250, 50, 0)); _elementCostsList.Add(4, new ElementCost(500, 150, 0)); _elementCostsList.Add(5, new ElementCost(1600, 400, 0)); _elementCostsList.Add(6, new ElementCost(3000, 1000, 0)); _elementCostsList.Add(7, new ElementCost(6000, 2000, 0)); _elementCostsList.Add(8, new ElementCost(9600, 4800, 0)); _elementCostsList.Add(9, new ElementCost(15000, 9000, 0)); _elementCostsList.Add(10, new ElementCost(20000, 13000, 0)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 2); _elementScoreList.Add(3, 5); _elementScoreList.Add(4, 10); _elementScoreList.Add(5, 16); _elementScoreList.Add(6, 24); _elementScoreList.Add(7, 34); _elementScoreList.Add(8, 46); _elementScoreList.Add(9, 60); _elementScoreList.Add(10, 80); // Element Storage for each level _elementStorageList.Add(1, new ElementStorage(2500)); _elementStorageList.Add(2, new ElementStorage(5000)); _elementStorageList.Add(3, new ElementStorage(9000)); _elementStorageList.Add(4, new ElementStorage(16000)); _elementStorageList.Add(5, new ElementStorage(26000)); _elementStorageList.Add(6, new ElementStorage(42000)); _elementStorageList.Add(7, new ElementStorage(65000)); _elementStorageList.Add(8, new ElementStorage(100000)); _elementStorageList.Add(9, new ElementStorage(145000)); _elementStorageList.Add(10, new ElementStorage(200000)); }
public QuarryElementType() { _elementType = ElementType.Type.BUILDING_QUARRY; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_stone_quary.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_quarry.png"; _elementInfo = "It produces Stone. Productivity can be increased by bordering Rocks, Cottages and a maximum of one Stonemason."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(50, 0, 0)); _elementCostsList.Add(2, new ElementCost(200, 0, 0)); _elementCostsList.Add(3, new ElementCost(400, 200, 0)); _elementCostsList.Add(4, new ElementCost(1400, 600, 0)); _elementCostsList.Add(5, new ElementCost(3500, 1500, 0)); _elementCostsList.Add(6, new ElementCost(6000, 3000, 0)); _elementCostsList.Add(7, new ElementCost(10000, 5000, 0)); _elementCostsList.Add(8, new ElementCost(16000, 8000, 0)); _elementCostsList.Add(9, new ElementCost(25000, 13000, 0)); _elementCostsList.Add(10, new ElementCost(38000, 20000, 0)); // Element production for each level _elementProductionList.Add(1, new ElementProduction(0, 20, 0, 0)); _elementProductionList.Add(2, new ElementProduction(0, 40, 0, 0)); _elementProductionList.Add(3, new ElementProduction(0, 60, 0, 0)); _elementProductionList.Add(4, new ElementProduction(0, 85, 0, 0)); _elementProductionList.Add(5, new ElementProduction(0, 110, 0, 0)); _elementProductionList.Add(6, new ElementProduction(0, 140, 0, 0)); _elementProductionList.Add(7, new ElementProduction(0, 175, 0, 0)); _elementProductionList.Add(8, new ElementProduction(0, 210, 0, 0)); _elementProductionList.Add(9, new ElementProduction(0, 250, 0, 0)); _elementProductionList.Add(10, new ElementProduction(0, 300, 0, 0)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 3); _elementScoreList.Add(3, 6); _elementScoreList.Add(4, 12); _elementScoreList.Add(5, 20); _elementScoreList.Add(6, 30); _elementScoreList.Add(7, 42); _elementScoreList.Add(8, 57); _elementScoreList.Add(9, 75); _elementScoreList.Add(10, 100); }
public TownhouseElementType() { _elementType = ElementType.Type.BUILDING_TOWNHOUSE; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_townhouse.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_townhouse.png"; _elementInfo = "It enables taxation (gold). Income from tax can be increased by connecting Marketplaces and Harbors."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(0, 100, 0)); _elementCostsList.Add(2, new ElementCost(0, 300, 0)); _elementCostsList.Add(3, new ElementCost(0, 600, 0)); _elementCostsList.Add(4, new ElementCost(0, 2000, 0)); _elementCostsList.Add(5, new ElementCost(1000, 4000, 0)); _elementCostsList.Add(6, new ElementCost(2000, 7000, 0)); _elementCostsList.Add(7, new ElementCost(3500, 11500, 0)); _elementCostsList.Add(8, new ElementCost(7000, 17000, 0)); _elementCostsList.Add(9, new ElementCost(14000, 20000, 0)); _elementCostsList.Add(10, new ElementCost(29000, 29000, 0)); // Element production for each level _elementProductionList.Add(1, new ElementProduction(0, 0, 0, 0, 25)); _elementProductionList.Add(2, new ElementProduction(0, 0, 0, 0, 50)); _elementProductionList.Add(3, new ElementProduction(0, 0, 0, 0, 75)); _elementProductionList.Add(4, new ElementProduction(0, 0, 0, 0, 100)); _elementProductionList.Add(5, new ElementProduction(0, 0, 0, 0, 130)); _elementProductionList.Add(6, new ElementProduction(0, 0, 0, 0, 170)); _elementProductionList.Add(7, new ElementProduction(0, 0, 0, 0, 210)); _elementProductionList.Add(8, new ElementProduction(0, 0, 0, 0, 260)); _elementProductionList.Add(9, new ElementProduction(0, 0, 0, 0, 320)); _elementProductionList.Add(10, new ElementProduction(0, 0, 0, 0, 400)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 3); _elementScoreList.Add(3, 6); _elementScoreList.Add(4, 12); _elementScoreList.Add(5, 20); _elementScoreList.Add(6, 30); _elementScoreList.Add(7, 42); _elementScoreList.Add(8, 57); _elementScoreList.Add(9, 75); _elementScoreList.Add(10, 100); }
public FarmElementType() { _elementType = ElementType.Type.BUILDING_FARM; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_farm_2.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_farm.png"; _elementInfo = "It produces food. Any bordering grassland, lakes, Cottages and Mills will increase productivity."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(50, 0, 0)); _elementCostsList.Add(2, new ElementCost(200, 0, 0)); _elementCostsList.Add(3, new ElementCost(400, 200, 0)); _elementCostsList.Add(4, new ElementCost(1400, 600, 0)); _elementCostsList.Add(5, new ElementCost(3500, 1500, 0)); _elementCostsList.Add(6, new ElementCost(6000, 3000, 0)); _elementCostsList.Add(7, new ElementCost(10000, 5000, 0)); _elementCostsList.Add(8, new ElementCost(16000, 8000, 0)); _elementCostsList.Add(9, new ElementCost(25000, 13000, 0)); _elementCostsList.Add(10, new ElementCost(38000, 20000, 0)); // Element production for each level _elementProductionList.Add(1, new ElementProduction(0, 0, 0, 5)); _elementProductionList.Add(2, new ElementProduction(0, 0, 0, 8)); _elementProductionList.Add(3, new ElementProduction(0, 0, 0, 15)); _elementProductionList.Add(4, new ElementProduction(0, 0, 0, 20)); _elementProductionList.Add(5, new ElementProduction(0, 0, 0, 30)); _elementProductionList.Add(6, new ElementProduction(0, 0, 0, 45)); _elementProductionList.Add(7, new ElementProduction(0, 0, 0, 75)); _elementProductionList.Add(8, new ElementProduction(0, 0, 0, 120)); _elementProductionList.Add(9, new ElementProduction(0, 0, 0, 200)); _elementProductionList.Add(10, new ElementProduction(0, 0, 0, 300)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 3); _elementScoreList.Add(3, 6); _elementScoreList.Add(4, 12); _elementScoreList.Add(5, 20); _elementScoreList.Add(6, 30); _elementScoreList.Add(7, 42); _elementScoreList.Add(8, 57); _elementScoreList.Add(9, 75); _elementScoreList.Add(10, 100); }
public WoodcutterElementType() { _elementType = ElementType.Type.BUILDING_WOODCUTTER; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_woodcutter.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_woodcutter.png"; _elementInfo = "It produces wood. Any bordering woods, Cottages and a maximum of one Sawmill will increase productivity."; // Element cost for each level _elementCostsList.Add(1,new ElementCost(50,0,0)); _elementCostsList.Add(2, new ElementCost(200,0,0)); _elementCostsList.Add(3, new ElementCost(400,200,0)); _elementCostsList.Add(4,new ElementCost(1400,600,0)); _elementCostsList.Add(5, new ElementCost(3500, 1500, 0)); _elementCostsList.Add(6, new ElementCost(6000, 3000, 0)); _elementCostsList.Add(7, new ElementCost(10000, 5000, 0)); _elementCostsList.Add(8, new ElementCost(16000, 8000, 0)); _elementCostsList.Add(9, new ElementCost(25000, 13000, 0)); _elementCostsList.Add(10, new ElementCost(38000, 20000, 0)); // Element production for each level _elementProductionList.Add(1, new ElementProduction(20, 0, 0, 0)); _elementProductionList.Add(2, new ElementProduction(40, 0, 0, 0)); _elementProductionList.Add(3, new ElementProduction(60, 0, 0, 0)); _elementProductionList.Add(4, new ElementProduction(85, 0, 0, 0)); _elementProductionList.Add(5, new ElementProduction(110, 0, 0, 0)); _elementProductionList.Add(6, new ElementProduction(140, 0, 0, 0)); _elementProductionList.Add(7, new ElementProduction(175, 0, 0, 0)); _elementProductionList.Add(8, new ElementProduction(210, 0, 0, 0)); _elementProductionList.Add(9, new ElementProduction(250, 0, 0, 0)); _elementProductionList.Add(10, new ElementProduction(300, 0, 0, 0)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 3); _elementScoreList.Add(3, 6); _elementScoreList.Add(4, 12); _elementScoreList.Add(5, 20); _elementScoreList.Add(6, 30); _elementScoreList.Add(7, 42); _elementScoreList.Add(8, 57); _elementScoreList.Add(9, 75); _elementScoreList.Add(10, 100); }
public ResearchCenterElementType() { _elementType = ElementType.Type.BUILDING_RESEARCH_CENTER; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_research_center.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_research_center.png"; _elementInfo = "It produces research."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(100, 0, 0)); _elementCostsList.Add(2, new ElementCost(300, 0, 0)); _elementCostsList.Add(3, new ElementCost(600, 0, 0)); _elementCostsList.Add(4, new ElementCost(2000, 0, 0)); _elementCostsList.Add(5, new ElementCost(4000, 1000, 0)); _elementCostsList.Add(6, new ElementCost(7000, 2000, 0)); _elementCostsList.Add(7, new ElementCost(11500, 3500, 0)); _elementCostsList.Add(8, new ElementCost(17000, 7000, 0)); _elementCostsList.Add(9, new ElementCost(10000, 14000, 0)); _elementCostsList.Add(10, new ElementCost(29000, 29000, 0)); // Element production for each level _elementProductionList.Add(1, new ElementProduction(0, 0, 0, 0, 0, 25)); _elementProductionList.Add(2, new ElementProduction(0, 0, 0, 0, 0, 50)); _elementProductionList.Add(3, new ElementProduction(0, 0, 0, 0, 0, 75)); _elementProductionList.Add(4, new ElementProduction(0, 0, 0, 0, 0, 100)); _elementProductionList.Add(5, new ElementProduction(0, 0, 0, 0, 0, 130)); _elementProductionList.Add(6, new ElementProduction(0, 0, 0, 0, 0, 170)); _elementProductionList.Add(7, new ElementProduction(0, 0, 0, 0, 0, 210)); _elementProductionList.Add(8, new ElementProduction(0, 0, 0, 0, 0, 260)); _elementProductionList.Add(9, new ElementProduction(0, 0, 0, 0, 0, 320)); _elementProductionList.Add(10, new ElementProduction(0, 0, 0, 0, 0, 400)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 3); _elementScoreList.Add(3, 6); _elementScoreList.Add(4, 12); _elementScoreList.Add(5, 20); _elementScoreList.Add(6, 30); _elementScoreList.Add(7, 42); _elementScoreList.Add(8, 57); _elementScoreList.Add(9, 75); _elementScoreList.Add(10, 100); }
public WoodcutterElementType() { _elementType = ElementType.Type.BUILDING_WOODCUTTER; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_woodcutter.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_woodcutter.png"; _elementInfo = "It produces wood. Any bordering woods, Cottages and a maximum of one Sawmill will increase productivity."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(50, 0, 0)); _elementCostsList.Add(2, new ElementCost(200, 0, 0)); _elementCostsList.Add(3, new ElementCost(400, 200, 0)); _elementCostsList.Add(4, new ElementCost(1400, 600, 0)); _elementCostsList.Add(5, new ElementCost(3500, 1500, 0)); _elementCostsList.Add(6, new ElementCost(6000, 3000, 0)); _elementCostsList.Add(7, new ElementCost(10000, 5000, 0)); _elementCostsList.Add(8, new ElementCost(16000, 8000, 0)); _elementCostsList.Add(9, new ElementCost(25000, 13000, 0)); _elementCostsList.Add(10, new ElementCost(38000, 20000, 0)); // Element production for each level _elementProductionList.Add(1, new ElementProduction(20, 0, 0, 0)); _elementProductionList.Add(2, new ElementProduction(40, 0, 0, 0)); _elementProductionList.Add(3, new ElementProduction(60, 0, 0, 0)); _elementProductionList.Add(4, new ElementProduction(85, 0, 0, 0)); _elementProductionList.Add(5, new ElementProduction(110, 0, 0, 0)); _elementProductionList.Add(6, new ElementProduction(140, 0, 0, 0)); _elementProductionList.Add(7, new ElementProduction(175, 0, 0, 0)); _elementProductionList.Add(8, new ElementProduction(210, 0, 0, 0)); _elementProductionList.Add(9, new ElementProduction(250, 0, 0, 0)); _elementProductionList.Add(10, new ElementProduction(300, 0, 0, 0)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 3); _elementScoreList.Add(3, 6); _elementScoreList.Add(4, 12); _elementScoreList.Add(5, 20); _elementScoreList.Add(6, 30); _elementScoreList.Add(7, 42); _elementScoreList.Add(8, 57); _elementScoreList.Add(9, 75); _elementScoreList.Add(10, 100); }
public IronMineElementType() { _elementType = ElementType.Type.BUILDING_IRONMINE; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_iron_quary.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_ironmine.png"; _elementInfo = "It produces iron. Any bordering ore deposits, Cottages and a maximum of one Foundry will increase productivity."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(50, 0, 0)); _elementCostsList.Add(2, new ElementCost(200, 0, 0)); _elementCostsList.Add(3, new ElementCost(400, 200, 0)); _elementCostsList.Add(4, new ElementCost(1400, 600, 0)); _elementCostsList.Add(5, new ElementCost(3500, 1500, 0)); _elementCostsList.Add(6, new ElementCost(6000, 3000, 0)); _elementCostsList.Add(7, new ElementCost(10000, 5000, 0)); _elementCostsList.Add(8, new ElementCost(16000, 8000, 0)); _elementCostsList.Add(9, new ElementCost(25000, 13000, 0)); _elementCostsList.Add(10, new ElementCost(38000, 20000, 0)); // Element production for each level _elementProductionList.Add(1, new ElementProduction(0, 0, 20, 0)); _elementProductionList.Add(2, new ElementProduction(0, 0, 40, 0)); _elementProductionList.Add(3, new ElementProduction(0, 0, 60, 0)); _elementProductionList.Add(4, new ElementProduction(0, 0, 85, 0)); _elementProductionList.Add(5, new ElementProduction(0, 0, 110, 0)); _elementProductionList.Add(6, new ElementProduction(0, 0, 140, 0)); _elementProductionList.Add(7, new ElementProduction(0, 0, 175, 0)); _elementProductionList.Add(8, new ElementProduction(0, 0, 210, 0)); _elementProductionList.Add(9, new ElementProduction(0, 0, 250, 0)); _elementProductionList.Add(10, new ElementProduction(0, 0, 300, 0)); // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 3); _elementScoreList.Add(3, 6); _elementScoreList.Add(4, 12); _elementScoreList.Add(5, 20); _elementScoreList.Add(6, 30); _elementScoreList.Add(7, 42); _elementScoreList.Add(8, 57); _elementScoreList.Add(9, 75); _elementScoreList.Add(10, 100); }
public TownHallElementType() { _elementType = ElementType.Type.BUILDING_TOWNHALL; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_townhall.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_townhall.png"; _elementInfo = "It provides basic storage and wood production. Also determines the maximum number of buildings in a city. Only one can be built in each city. Cannot be totally demolished or destroyed."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(0, 0, 0)); _elementCostsList.Add(2, new ElementCost(200, 0, 0)); _elementCostsList.Add(3, new ElementCost(500, 100, 0)); _elementCostsList.Add(4, new ElementCost(1000, 300, 0)); _elementCostsList.Add(5, new ElementCost(3000, 1500, 0)); _elementCostsList.Add(6, new ElementCost(8000, 4000, 0)); _elementCostsList.Add(7, new ElementCost(15000, 10000, 0)); _elementCostsList.Add(8, new ElementCost(30000, 25000, 0)); _elementCostsList.Add(9, new ElementCost(60000, 60000, 0)); _elementCostsList.Add(10, new ElementCost(120000, 120000, 0)); // Element Score for each level _elementScoreList.Add(1, 3); _elementScoreList.Add(2, 9); _elementScoreList.Add(3, 18); _elementScoreList.Add(4, 36); _elementScoreList.Add(5, 60); _elementScoreList.Add(6, 90); _elementScoreList.Add(7, 126); _elementScoreList.Add(8, 171); _elementScoreList.Add(9, 225); _elementScoreList.Add(10, 300); // Element Storage for each level _elementStorageList.Add(1, new ElementStorage(5000)); _elementStorageList.Add(2, new ElementStorage(7000)); _elementStorageList.Add(3, new ElementStorage(10000)); _elementStorageList.Add(4, new ElementStorage(15000)); _elementStorageList.Add(5, new ElementStorage(24000)); _elementStorageList.Add(6, new ElementStorage(35000)); _elementStorageList.Add(7, new ElementStorage(50000)); _elementStorageList.Add(8, new ElementStorage(80000)); _elementStorageList.Add(9, new ElementStorage(125000)); _elementStorageList.Add(10, new ElementStorage(175000)); }
public IronElementType() { _elementType = ElementType.Type.RESSOURCE_IRON; _name = ElementType.GetTypeName(_elementType); _isRessources = true; _hasLevelEnable = false; var select = Random.Next(1, 5); _imagePath = "pack://application:,,,/Resources/Images/resource_iron_" + select.ToString() + ".png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_iron.png"; _elementInfo = "Each Iron Mine gains 50% for the first adjacent iron node, then 40% for each after that. The Iron Mine's production efficiency can then be increased up to 75% by an adjacent Foundry, and up to 30% by each adjacent Cottage."; // Bonus linked to iron _elementProductionBonus = new ElementProductionBonus(0, 0, 0, 0); _elementProductionBonus.IsRessourcesBonus = true; _elementProductionBonus.FirstBonus = 50; _elementProductionBonus.SecondBonus = 40; }
/// <summary> /// Updates the mesh. Used for resetting meshes after a cast. /// </summary> /// <param name="el">The el.</param> /// <param name="y">if set to <c>true</c> [y].</param> public void UpdateMesh(ElementType.Type el, bool y) { switch (el) { case ElementType.Type.Blue: transform.GetComponentInChildren <MeshRenderer>().material = blue; transform.GetComponentInChildren <MeshRenderer>().materials[0] = blue; ChangeMesh("Blue"); if (y) { blueMesh.SetActive(true); blueMesh.GetComponent <PSMeshRendererUpdater>().UpdateMeshEffect(wandMesh.gameObject); } break; case ElementType.Type.Red: transform.GetComponentInChildren <MeshRenderer>().material = red; transform.GetComponentInChildren <MeshRenderer>().materials[0] = red; ChangeMesh("Red"); if (y) { redMesh.SetActive(true); redMesh.GetComponent <PSMeshRendererUpdater>().UpdateMeshEffect(wandMesh.gameObject); } break; case ElementType.Type.Purple: transform.GetComponentInChildren <MeshRenderer>().material = purple; transform.GetComponentInChildren <MeshRenderer>().materials[0] = purple; ChangeMesh("Purple"); if (y) { purpleMesh.SetActive(true); purpleMesh.GetComponent <PSMeshRendererUpdater>().UpdateMeshEffect(wandMesh.gameObject); } break; } if (!y) { blueMesh.SetActive(false); redMesh.SetActive(false); purpleMesh.SetActive(false); } }
/// <summary> /// Takes the damage passed of element type. /// </summary> /// <param name="damage">The damage.</param> /// <param name="el">The el.</param> public void TakeDamage(int damage, ElementType.Type el) { float dF = damage; damage = Mathf.RoundToInt(dF *= ElementType.getDamageModifier(el, elementType)); CheckDeath(); if (currentHealth <= 0) { return; } hpScript.ChangeHP(-damage, hpSpawnLoc.position, Vector3.up, 20f, damage.ToString()); currentHealth -= damage; anim.SetTrigger("TakeDamage"); CheckDeath(); }
public FoundryElementType() { _elementType = ElementType.Type.BUILDING_FOUNDRY; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_foundry.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_foundry.png"; _elementInfo = "It increases the efficiency of bordering Ore Mines and iron storage capacity of bordering Storage."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(60, 60, 0)); _elementCostsList.Add(2, new ElementCost(150, 150, 0)); _elementCostsList.Add(3, new ElementCost(350, 350, 0)); _elementCostsList.Add(4, new ElementCost(1100, 1100, 0)); _elementCostsList.Add(5, new ElementCost(2700, 2700, 0)); _elementCostsList.Add(6, new ElementCost(5000, 5000, 0)); _elementCostsList.Add(7, new ElementCost(8500, 8500, 0)); _elementCostsList.Add(8, new ElementCost(13500, 13500, 0)); _elementCostsList.Add(9, new ElementCost(21500, 21500, 0)); _elementCostsList.Add(10, new ElementCost(33000, 33000, 0)); for (int i = 1; i <= 10; i++) { _elementProductionBonusList.Add(i, new ElementProductionBonus(0, 0, 30 + (i - 1) * 5, 0)); } // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 4); _elementScoreList.Add(3, 7); _elementScoreList.Add(4, 14); _elementScoreList.Add(5, 24); _elementScoreList.Add(6, 36); _elementScoreList.Add(7, 50); _elementScoreList.Add(8, 68); _elementScoreList.Add(9, 90); _elementScoreList.Add(10, 120); }
public StoneMasonElementType() { _elementType = ElementType.Type.BUILDING_STONEMASON; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_stonemason.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_stonemason.png"; _elementInfo = "It increases the efficiency of bordering Quarries and stone storage capacity of any bordering Storage."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(60, 60, 0)); _elementCostsList.Add(2, new ElementCost(150, 150, 0)); _elementCostsList.Add(3, new ElementCost(350, 350, 0)); _elementCostsList.Add(4, new ElementCost(1100, 1100, 0)); _elementCostsList.Add(5, new ElementCost(2700, 2700, 0)); _elementCostsList.Add(6, new ElementCost(5000, 5000, 0)); _elementCostsList.Add(7, new ElementCost(8500, 8500, 0)); _elementCostsList.Add(8, new ElementCost(13500, 13500, 0)); _elementCostsList.Add(9, new ElementCost(21500, 21500, 0)); _elementCostsList.Add(10, new ElementCost(33000, 33000, 0)); for (int i = 1; i <= 10; i++) { _elementProductionBonusList.Add(i, new ElementProductionBonus(0, 0, 30 + (i - 1) * 5, 0)); } // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 4); _elementScoreList.Add(3, 7); _elementScoreList.Add(4, 14); _elementScoreList.Add(5, 24); _elementScoreList.Add(6, 36); _elementScoreList.Add(7, 50); _elementScoreList.Add(8, 68); _elementScoreList.Add(9, 90); _elementScoreList.Add(10, 120); }
public MarketplaceElementType() { _elementType = ElementType.Type.BUILDING_MARKETPLACE; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_marketplace.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_marketplace.png"; _elementInfo = "It allows transport of resources between cities and enables trade with other players by land. Also increases the tax income of connected buildings."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(40, 20, 0)); _elementCostsList.Add(2, new ElementCost(80, 40, 0)); _elementCostsList.Add(3, new ElementCost(160, 80, 0)); _elementCostsList.Add(4, new ElementCost(400, 200, 0)); _elementCostsList.Add(5, new ElementCost(1200, 600, 0)); _elementCostsList.Add(6, new ElementCost(2800, 1400, 0)); _elementCostsList.Add(7, new ElementCost(5600, 2800, 0)); _elementCostsList.Add(8, new ElementCost(9600, 4800, 0)); _elementCostsList.Add(9, new ElementCost(15200, 7600, 0)); _elementCostsList.Add(10, new ElementCost(23200, 11600, 0)); for (int i = 1; i <= 10; i++) { _elementProductionBonusList.Add(i, new ElementProductionBonus(0, 0, i*2, 0)); } // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 2); _elementScoreList.Add(3, 5); _elementScoreList.Add(4, 10); _elementScoreList.Add(5, 16); _elementScoreList.Add(6, 24); _elementScoreList.Add(7, 34); _elementScoreList.Add(8, 46); _elementScoreList.Add(9, 60); _elementScoreList.Add(10, 80); }
public MarketplaceElementType() { _elementType = ElementType.Type.BUILDING_MARKETPLACE; _name = ElementType.GetTypeName(_elementType); _isRessources = false; _hasLevelEnable = true; _imagePath = "pack://application:,,,/Resources/Images/building_marketplace.png"; _detailImagePath = "pack://application:,,,/Resources/Images/menu_marketplace.png"; _elementInfo = "It allows transport of resources between cities and enables trade with other players by land. Also increases the tax income of connected buildings."; // Element cost for each level _elementCostsList.Add(1, new ElementCost(40, 20, 0)); _elementCostsList.Add(2, new ElementCost(80, 40, 0)); _elementCostsList.Add(3, new ElementCost(160, 80, 0)); _elementCostsList.Add(4, new ElementCost(400, 200, 0)); _elementCostsList.Add(5, new ElementCost(1200, 600, 0)); _elementCostsList.Add(6, new ElementCost(2800, 1400, 0)); _elementCostsList.Add(7, new ElementCost(5600, 2800, 0)); _elementCostsList.Add(8, new ElementCost(9600, 4800, 0)); _elementCostsList.Add(9, new ElementCost(15200, 7600, 0)); _elementCostsList.Add(10, new ElementCost(23200, 11600, 0)); for (int i = 1; i <= 10; i++) { _elementProductionBonusList.Add(i, new ElementProductionBonus(0, 0, i * 2, 0)); } // Element Score for each level _elementScoreList.Add(1, 1); _elementScoreList.Add(2, 2); _elementScoreList.Add(3, 5); _elementScoreList.Add(4, 10); _elementScoreList.Add(5, 16); _elementScoreList.Add(6, 24); _elementScoreList.Add(7, 34); _elementScoreList.Add(8, 46); _elementScoreList.Add(9, 60); _elementScoreList.Add(10, 80); }
/// <summary> /// Returns the start, middle and end object for the appropriate ElementType.Type. /// </summary> /// <param name="colour">The colour.</param> /// <returns>List<GameObject>.</returns> public List <GameObject> returnBeams(string colour) { List <GameObject> returnedBeams = new List <GameObject>(); switch (colour) { case "Blue": returnedBeams.Add(beamStartb); returnedBeams.Add(beamb); returnedBeams.Add(beamEndb); type = ElementType.Type.Blue; currentschool = "Blue"; break; case "Red": returnedBeams.Add(beamStartr); returnedBeams.Add(beamr); returnedBeams.Add(beamEndr); type = ElementType.Type.Red; currentschool = "Red"; break; case "Purple": returnedBeams.Add(beamStartp); returnedBeams.Add(beamp); returnedBeams.Add(beamEndp); type = ElementType.Type.Purple; currentschool = "Purple"; break; default: print("default"); break; } return(returnedBeams); }
/// <summary> /// Sets up the enemy with all customisation and element settings. /// </summary> /// <param name="profile">The profile.</param> public void SetUp(EnemyProfiles profile) { elementshieldB.SetActive(false); elementshieldP.SetActive(false); elementshieldR.SetActive(false); elementshield = null; player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); myProfile = profile; int level = profile.Level; disableAll(); switch (profile.myClass) { case EnemyProfiles.Class.Healer: HealerWeapons[level - 1].SetActive(true); HealerHeads[level - 1].SetActive(true); HealerBacks[level - 1].SetActive(true); supportEnemy = true; break; case EnemyProfiles.Class.Archer: ArcherWeapons[level - 1].SetActive(true); ArcherHeads[level - 1].SetActive(true); ArcherBacks[level - 1].SetActive(true); supportEnemy = false; break; case EnemyProfiles.Class.Mage: MageBacks[level - 1].SetActive(true); MageHeads[level - 1].SetActive(true); MageShields[level - 1].SetActive(true); MageWeapons[level - 1].SetActive(true); supportEnemy = false; break; } transform.localScale = new Vector3(profile.baseSize, profile.baseSize, profile.baseSize); GetComponentInChildren <MeshRenderer>().enabled = true; lockedOn = false; foreach (GameObject o in blastObjects) { o.SetActive(false); } rootSeconds = 0f; freezeSeconds = 0f; navAgent = GetComponent <NavMeshAgent>(); anim = GetComponent <Animator>(); this.gameObject.SetActive(true); baseHealth = profile.maxHealth; currentHealth = baseHealth; hpScript.HP = currentHealth; int elementInt = Random.Range(0, 3); switch (elementInt) { case 0: elementType = ElementType.Type.Purple; elementshield = elementshieldP; break; case 1: elementType = ElementType.Type.Red; elementshield = elementshieldR; break; case 2: elementType = ElementType.Type.Blue; elementshield = elementshieldB; break; default: elementType = ElementType.Type.Neutral; break; } setMesh(); if (!NONMOVINGENEMY) { maxSpeed = profile.baseSpeed; navAgent.speed = maxSpeed; navAgent.stoppingDistance = profile.randomDistance; navAgent.isStopped = true; } dead = false; anim.SetTrigger("Spawn"); StartCoroutine(HealTick()); timeAlive = 0; StartCoroutine(AliveCount()); waterBall.SetActive(false); BrainState = "NEUTRAL"; }
/// <summary> /// Overrides the current element type. /// </summary> /// <param name="elType">Type of the el.</param> public void Override(ElementType.Type elType) { elementType = elType; }
private void checkNeighbourBonusBuilding(Element element) { if (element == null || !element.HasElement || element.GetElementType() == null) { return; } Element[,] map = _gameboard.GetMap(); int frameCount = _gameboard.GetFrameCount; int x = element.PositionX; int y = element.PositionY; Element bonusBuilding = null; ElementType.Type buildingBonurType = ElementType.GetBonusBuilding(element.GetElementType().GetElementType()); if (buildingBonurType == ElementType.Type.DEFAULT) { return; } if (y > 0) { if (x > 0) { if (map[x - 1, y - 1].HasElement && map[x - 1, y - 1].GetElementType().GetElementType() == buildingBonurType) { bonusBuilding = getBestOne(bonusBuilding, map[x - 1, y - 1]); } } if (map[x, y - 1].HasElement && map[x, y - 1].GetElementType().GetElementType() == buildingBonurType) { bonusBuilding = getBestOne(bonusBuilding, map[x, y - 1]); } if (x < frameCount - 1) { if (map[x + 1, y - 1].HasElement && map[x + 1, y - 1].GetElementType().GetElementType() == buildingBonurType) { bonusBuilding = getBestOne(bonusBuilding, map[x + 1, y - 1]); } } } if (y < frameCount - 1) { if (x > 0) { if (map[x - 1, y + 1].HasElement && map[x - 1, y + 1].GetElementType().GetElementType() == buildingBonurType) { bonusBuilding = getBestOne(bonusBuilding, map[x - 1, y + 1]); } } if (map[x, y + 1].HasElement && map[x, y + 1].GetElementType().GetElementType() == buildingBonurType) { bonusBuilding = getBestOne(bonusBuilding, map[x, y + 1]); } if (x < frameCount - 1) { if (map[x + 1, y + 1].HasElement && map[x + 1, y + 1].GetElementType().GetElementType() == buildingBonurType) { bonusBuilding = getBestOne(bonusBuilding, map[x + 1, y + 1]); } } } if (x > 0) { if (map[x - 1, y].HasElement && map[x - 1, y].GetElementType().GetElementType() == buildingBonurType) { bonusBuilding = getBestOne(bonusBuilding, map[x - 1, y]); } } if (x < frameCount - 1) { if (map[x + 1, y].HasElement && map[x + 1, y].GetElementType().GetElementType() == buildingBonurType) { bonusBuilding = getBestOne(bonusBuilding, map[x + 1, y]); } } element.BonusBuilding = bonusBuilding; }
private void checkNeighbourRessources(Element element) { if (element == null || !element.HasElement || element.GetElementType() == null) { return; } Element[,] map = _gameboard.GetMap(); int frameCount = _gameboard.GetFrameCount; int x = element.PositionX; int y = element.PositionY; int ressourceCount = 0; ElementType.Type ressourceType = ElementType.GetBonusRessource(element.GetElementType().GetElementType()); if (ressourceType == ElementType.Type.DEFAULT) { return; } if (y > 0) { if (x > 0) { if (map[x - 1, y - 1].HasElement && map[x - 1, y - 1].GetElementType().GetElementType() == ressourceType) { ressourceCount++; } } if (map[x, y - 1].HasElement && map[x, y - 1].GetElementType().GetElementType() == ressourceType) { ressourceCount++; } if (x < frameCount - 1) { if (map[x + 1, y - 1].HasElement && map[x + 1, y - 1].GetElementType().GetElementType() == ressourceType) { ressourceCount++; } } } if (y < frameCount - 1) { if (x > 0) { if (map[x - 1, y + 1].HasElement && map[x - 1, y + 1].GetElementType().GetElementType() == ressourceType) { ressourceCount++; } } if (map[x, y + 1].HasElement && map[x, y + 1].GetElementType().GetElementType() == ressourceType) { ressourceCount++; } if (x < frameCount - 1) { if (map[x + 1, y + 1].HasElement && map[x + 1, y + 1].GetElementType().GetElementType() == ressourceType) { ressourceCount++; } } } if (x > 0) { if (map[x - 1, y].HasElement && map[x - 1, y].GetElementType().GetElementType() == ressourceType) { ressourceCount++; } } if (x < frameCount - 1) { if (map[x + 1, y].HasElement && map[x + 1, y].GetElementType().GetElementType() == ressourceType) { ressourceCount++; } } element.NbRessourcesAround = ressourceCount; }