Search in sources :

Example 1 with Selector

use of org.iaie.btree.task.composite.Selector in project Ecgberht by Jabbo16.

the class Ecgberht method initIslandTree.

private void initIslandTree() {
    CheckIslands chI = new CheckIslands("Check islands", gs);
    CheckExpandingIsland cEI = new CheckExpandingIsland("Check Expanding To Island", gs);
    CheckDropped chD = new CheckDropped("Check Dropped", gs);
    CheckBlockingMinerals cBM = new CheckBlockingMinerals("Check Blocking minerals", gs);
    CheckResourcesIsland cRI = new CheckResourcesIsland("Check resources Island", gs);
    MoveIsland mI = new MoveIsland("Move Island", gs);
    ChooseDropShip cD = new ChooseDropShip("Choose DropShip", gs);
    ChooseIsland cI = new ChooseIsland("Choose Island", gs);
    ChooseWorkerDrop cWD = new ChooseWorkerDrop("Choose Worker Drop", gs);
    SendToDrop sD = new SendToDrop("Send To Drop", gs);
    Sequence chooseThings = new Sequence("Choose things", cD, cI, cWD, sD);
    Sequence expand = new Sequence("Island expand", cEI, chD, cBM, cRI, mI);
    Selector expanding = new Selector("Check if already expanding", expand, cEI, chooseThings);
    Sequence islandExpansion = new Sequence("island expansion", chI, expanding);
    islandTree = new BehavioralTree("islandTree");
    islandTree.addChild(islandExpansion);
}
Also used : Sequence(org.iaie.btree.task.composite.Sequence) BehavioralTree(org.iaie.btree.BehavioralTree) Selector(org.iaie.btree.task.composite.Selector)

Example 2 with Selector

use of org.iaie.btree.task.composite.Selector in project Ecgberht by Jabbo16.

the class Ecgberht method initScoutingTree.

private void initScoutingTree() {
    CheckScout cSc = new CheckScout("Check Scout", gs);
    ChooseScout chSc = new ChooseScout("Choose Scouter", gs);
    SendScout sSc = new SendScout("Send Scout", gs);
    CheckMineralWalk cMW = new CheckMineralWalk("Check Mineral Walk", gs);
    CheckVisibleBase cVB = new CheckVisibleBase("Check visible Base", gs);
    CheckEnemyBaseVisible cEBV = new CheckEnemyBaseVisible("Check Enemy Base Visible", gs);
    Sequence scoutFalse = new Sequence("Scout ", cSc, chSc, sSc);
    Selector EnemyFound = new Selector("Enemy found in base location", cEBV, sSc);
    Sequence scoutTrue = new Sequence("Scout True", cMW, cVB, EnemyFound);
    Selector Scouting = new Selector("Select Scouting Plan", scoutFalse, scoutTrue);
    scoutingTree = new BehavioralTree("Movement Tree");
    scoutingTree.addChild(Scouting);
}
Also used : Sequence(org.iaie.btree.task.composite.Sequence) BehavioralTree(org.iaie.btree.BehavioralTree) Selector(org.iaie.btree.task.composite.Selector)

Example 3 with Selector

use of org.iaie.btree.task.composite.Selector in project Ecgberht by Jabbo16.

the class Ecgberht method initCollectTree.

private void initCollectTree() {
    CollectGas cg = new CollectGas("Collect Gas", gs);
    CollectMineral cm = new CollectMineral("Collect Mineral", gs);
    FreeWorker fw = new FreeWorker("No Union", gs);
    Selector collectResources = new Selector("Collect Melted Cash", cg, cm);
    Sequence collect = new Sequence("Collect", fw, collectResources);
    collectTree = new BehavioralTree("Recollection Tree");
    collectTree.addChild(collect);
}
Also used : CollectGas(ecgberht.BehaviourTrees.Recollection.CollectGas) FreeWorker(ecgberht.BehaviourTrees.Recollection.FreeWorker) Sequence(org.iaie.btree.task.composite.Sequence) CollectMineral(ecgberht.BehaviourTrees.Recollection.CollectMineral) BehavioralTree(org.iaie.btree.BehavioralTree) Selector(org.iaie.btree.task.composite.Selector)

Example 4 with Selector

use of org.iaie.btree.task.composite.Selector in project Ecgberht by Jabbo16.

the class Ecgberht method initTrainTree.

private static void initTrainTree() {
    ChooseSituationalUnit cSU = new ChooseSituationalUnit("Choose situational unit", gs);
    ChooseNothingTrain cNT = new ChooseNothingTrain("Choose Nothing To Train", gs);
    ChooseSCV cSCV = new ChooseSCV("Choose SCV", gs);
    ChooseFireBat cFir = new ChooseFireBat("Choose Firebat", gs);
    ChooseMarine cMar = new ChooseMarine("Choose Marine", gs);
    ChooseMedic cMed = new ChooseMedic("Choose Medic", gs);
    ChooseTank cTan = new ChooseTank("Choose Tank", gs);
    ChooseVulture cVul = new ChooseVulture("Choose vulture", gs);
    ChooseGoliath cGol = new ChooseGoliath("Choose Goliath", gs);
    ChooseWraith cWra = new ChooseWraith("Choose Wraith", gs);
    CheckResourcesUnit cr = new CheckResourcesUnit("Check Cash", gs);
    TrainUnit tr = new TrainUnit("Train Unit", gs);
    Selector chooseUnit = new Selector("Choose Recruit", cNT, cSU, cSCV);
    if (gs.getStrat().trainUnits.contains(UnitType.Terran_Goliath))
        chooseUnit.addChild(cGol);
    if (gs.getStrat().trainUnits.contains(UnitType.Terran_Siege_Tank_Tank_Mode))
        chooseUnit.addChild(cTan);
    if (gs.getStrat().trainUnits.contains(UnitType.Terran_Vulture))
        chooseUnit.addChild(cVul);
    if (gs.getStrat().trainUnits.contains(UnitType.Terran_Wraith))
        chooseUnit.addChild(cWra);
    if (gs.getStrat().trainUnits.contains(UnitType.Terran_Medic))
        chooseUnit.addChild(cMed);
    if (gs.getStrat().trainUnits.contains(UnitType.Terran_Firebat) && gs.enemyRace == Race.Zerg)
        chooseUnit.addChild(cFir);
    if (gs.getStrat().trainUnits.contains(UnitType.Terran_Marine))
        chooseUnit.addChild(cMar);
    Sequence train = new Sequence("Train", chooseUnit, cr, tr);
    trainTree = new BehavioralTree("Training Tree");
    trainTree.addChild(train);
}
Also used : Sequence(org.iaie.btree.task.composite.Sequence) BehavioralTree(org.iaie.btree.BehavioralTree) Selector(org.iaie.btree.task.composite.Selector)

Example 5 with Selector

use of org.iaie.btree.task.composite.Selector in project Ecgberht by Jabbo16.

the class Ecgberht method initUpgradeTree.

private static void initUpgradeTree() {
    CheckResourcesUpgrade cRU = new CheckResourcesUpgrade("Check Resources Upgrade", gs);
    ChooseIrradiate cI = new ChooseIrradiate("Choose Irradiate", gs);
    ChooseEMP cEMP = new ChooseEMP("Choose EMP", gs);
    ChooseArmorMechUp cAMU = new ChooseArmorMechUp("Choose Armor mech upgrade", gs);
    ChooseWeaponMechUp cWMU = new ChooseWeaponMechUp("Choose weapon mech upgrade", gs);
    ChooseArmorInfUp cAIU = new ChooseArmorInfUp("Choose Armor inf upgrade", gs);
    ChooseWeaponInfUp cWIU = new ChooseWeaponInfUp("Choose Weapon inf upgrade", gs);
    ChooseMarineRange cMR = new ChooseMarineRange("Choose Marine Range upgrade", gs);
    ChooseStimUpgrade cSU = new ChooseStimUpgrade("Choose Stimpack upgrade", gs);
    ChooseSiegeMode cSM = new ChooseSiegeMode("Choose Siege Mode", gs);
    ChooseCharonBoosters cCB = new ChooseCharonBoosters("Choose Charon Boosters", gs);
    ChooseVultureSpeed cVS = new ChooseVultureSpeed("Choose Vulture Speed", gs);
    ResearchUpgrade rU = new ResearchUpgrade("Research Upgrade", gs);
    Selector ChooseUP = new Selector("Choose Upgrade");
    ChooseUP.addChild(cI);
    ChooseUP.addChild(cEMP);
    if (gs.getStrat().upgradesToResearch.contains(UpgradeType.Terran_Infantry_Weapons))
        ChooseUP.addChild(cWIU);
    if (gs.getStrat().upgradesToResearch.contains(UpgradeType.Terran_Infantry_Armor))
        ChooseUP.addChild(cAIU);
    if (gs.getStrat().techToResearch.contains(TechType.Stim_Packs))
        ChooseUP.addChild(cSU);
    if (gs.getStrat().upgradesToResearch.contains(UpgradeType.U_238_Shells))
        ChooseUP.addChild(cMR);
    if (gs.getStrat().techToResearch.contains(TechType.Tank_Siege_Mode))
        ChooseUP.addChild(cSM);
    if (gs.getStrat().upgradesToResearch.contains(UpgradeType.Ion_Thrusters))
        ChooseUP.addChild(cVS);
    if (gs.getStrat().upgradesToResearch.contains(UpgradeType.Charon_Boosters))
        ChooseUP.addChild(cCB);
    if (gs.getStrat().upgradesToResearch.contains(UpgradeType.Terran_Vehicle_Weapons))
        ChooseUP.addChild(cWMU);
    if (gs.getStrat().upgradesToResearch.contains(UpgradeType.Terran_Vehicle_Plating))
        ChooseUP.addChild(cAMU);
    Sequence Upgrader = new Sequence("Upgrader", ChooseUP, cRU, rU);
    upgradeTree = new BehavioralTree("Technology");
    upgradeTree.addChild(Upgrader);
}
Also used : Sequence(org.iaie.btree.task.composite.Sequence) BehavioralTree(org.iaie.btree.BehavioralTree) Selector(org.iaie.btree.task.composite.Selector)

Aggregations

BehavioralTree (org.iaie.btree.BehavioralTree)8 Selector (org.iaie.btree.task.composite.Selector)8 Sequence (org.iaie.btree.task.composite.Sequence)8 AddonBuild (ecgberht.BehaviourTrees.AddonBuild)1 Build (ecgberht.BehaviourTrees.Build)1 CollectGas (ecgberht.BehaviourTrees.Recollection.CollectGas)1 CollectMineral (ecgberht.BehaviourTrees.Recollection.CollectMineral)1 FreeWorker (ecgberht.BehaviourTrees.Recollection.FreeWorker)1