gdjs.evtsExt__TestExtensions__BlueDeleteUnit = {};
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1= [];
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects2= [];
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1= [];
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects2= [];
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1= [];
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects2= [];
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDParticleObjects1= [];
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDParticleObjects2= [];

gdjs.evtsExt__TestExtensions__BlueDeleteUnit.conditionTrue_0 = {val:false};
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition0IsTrue_0 = {val:false};
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition1IsTrue_0 = {val:false};
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition2IsTrue_0 = {val:false};
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition3IsTrue_0 = {val:false};
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition4IsTrue_0 = {val:false};


gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDUnitObjects1Objects = Hashtable.newFrom({"Unit": gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1});gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDNodeObjects1Objects = Hashtable.newFrom({"Node": gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1});gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDUnitColliderObjects1Objects = Hashtable.newFrom({"UnitCollider": gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1});gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDUnitObjects1Objects = Hashtable.newFrom({"Unit": gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1});gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDNodeObjects1Objects = Hashtable.newFrom({"Node": gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1});gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDUnitColliderObjects1Objects = Hashtable.newFrom({"UnitCollider": gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1});gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDParticleObjects1Objects = Hashtable.newFrom({"Particle": gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDParticleObjects1});gdjs.evtsExt__TestExtensions__BlueDeleteUnit.eventsList0 = function(runtimeScene, eventsFunctionContext) {

{

gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.createFrom(eventsFunctionContext.getObjects("Node"));
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.createFrom(eventsFunctionContext.getObjects("Unit"));
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1.createFrom(eventsFunctionContext.getObjects("UnitCollider"));

gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition0IsTrue_0.val = false;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition1IsTrue_0.val = false;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition2IsTrue_0.val = false;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition3IsTrue_0.val = false;
{
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition0IsTrue_0.val = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDUnitObjects1Objects, gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDNodeObjects1Objects, false, runtimeScene, false);
}if ( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition0IsTrue_0.val ) {
{
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition1IsTrue_0.val = gdjs.evtTools.linkedObjects.pickObjectsLinkedTo(runtimeScene, gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDUnitColliderObjects1Objects, (gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.length !== 0 ? gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1[0] : null));
}if ( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition1IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length;i<l;++i) {
    if ( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariableNumber(gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariables().get("WorkerUnits").getChild("Orange")) <= 0 ) {
        gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition2IsTrue_0.val = true;
        gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[k] = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i];
        ++k;
    }
}
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length = k;}if ( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition2IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length;i<l;++i) {
    if ( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariableNumber(gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariables().get("OrangeUnits")) <= 0 ) {
        gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition3IsTrue_0.val = true;
        gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[k] = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i];
        ++k;
    }
}
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length = k;}}
}
}
if (gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition3IsTrue_0.val) {
/* Reuse gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1 */
/* Reuse gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1 */
/* Reuse gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1 */
{for(var i = 0, len = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1[i].deleteFromScene(runtimeScene);
}
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1[i].deleteFromScene(runtimeScene);
}
}{gdjs.evtTools.linkedObjects.removeLinkBetween(runtimeScene, (gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1.length !== 0 ? gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1[0] : null), (gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.length !== 0 ? gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1[0] : null));
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].returnVariable(gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariables().get("WorkerUnits").getChild("Blue")).add(1);
}
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].returnVariable(gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariables().get("BlueUnits")).add(1);
}
}{gdjs.evtTools.sound.playSoundOnChannel(runtimeScene, "sfx\\game_playerCapture.wav", 3, false, gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().get("SFXVolume")), 1);
}}

}


{

gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.createFrom(eventsFunctionContext.getObjects("Node"));
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.createFrom(eventsFunctionContext.getObjects("Unit"));
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1.createFrom(eventsFunctionContext.getObjects("UnitCollider"));

gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition0IsTrue_0.val = false;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition1IsTrue_0.val = false;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition2IsTrue_0.val = false;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition3IsTrue_0.val = false;
{
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition0IsTrue_0.val = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDUnitObjects1Objects, gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDNodeObjects1Objects, false, runtimeScene, false);
}if ( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition0IsTrue_0.val ) {
{
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition1IsTrue_0.val = gdjs.evtTools.linkedObjects.pickObjectsLinkedTo(runtimeScene, gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDUnitColliderObjects1Objects, (gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.length !== 0 ? gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1[0] : null));
}if ( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition1IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length;i<l;++i) {
    if ( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariableNumber(gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariables().get("WorkerUnits").getChild("Orange")) >= 1 ) {
        gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition2IsTrue_0.val = true;
        gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[k] = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i];
        ++k;
    }
}
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length = k;}if ( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition2IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length;i<l;++i) {
    if ( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariableNumber(gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariables().get("OrangeUnits")) >= 1 ) {
        gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition3IsTrue_0.val = true;
        gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[k] = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i];
        ++k;
    }
}
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length = k;}}
}
}
if (gdjs.evtsExt__TestExtensions__BlueDeleteUnit.condition3IsTrue_0.val) {
/* Reuse gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1 */
/* Reuse gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1 */
/* Reuse gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1 */
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDParticleObjects1.length = 0;

{for(var i = 0, len = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1[i].deleteFromScene(runtimeScene);
}
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1[i].deleteFromScene(runtimeScene);
}
}{gdjs.evtTools.linkedObjects.removeLinkBetween(runtimeScene, (gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1.length !== 0 ? gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1[0] : null), (gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.length !== 0 ? gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1[0] : null));
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].returnVariable(gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariables().get("WorkerUnits").getChild("Orange")).sub(1);
}
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].returnVariable(gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1[i].getVariables().get("OrangeUnits")).sub(1);
}
}{gdjs.evtTools.object.createObjectOnScene((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : runtimeScene), gdjs.evtsExt__TestExtensions__BlueDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95BlueDeleteUnit_46GDParticleObjects1Objects, (( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.length === 0 ) ? 0 :gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1[0].getPointX("")), (( gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.length === 0 ) ? 0 :gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1[0].getPointY("")), "Units");
}{gdjs.evtTools.sound.playSoundOnChannel(runtimeScene, "sfx\\game_unitdeath.wav", 3, false, gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().get("SFXVolume")), 1);
}}

}


};

gdjs.evtsExt__TestExtensions__BlueDeleteUnit.func = function(runtimeScene, Unit, UnitCollider, Node, Particle, parentEventsFunctionContext) {
var eventsFunctionContext = {
  _objectsMap: {
"Unit": Unit
, "UnitCollider": UnitCollider
, "Node": Node
, "Particle": Particle
},
  _objectArraysMap: {
"Unit": gdjs.objectsListsToArray(Unit)
, "UnitCollider": gdjs.objectsListsToArray(UnitCollider)
, "Node": gdjs.objectsListsToArray(Node)
, "Particle": gdjs.objectsListsToArray(Particle)
},
  _behaviorNamesMap: {
},
  getObjects: function(objectName) {
    return eventsFunctionContext._objectArraysMap[objectName] || [];
  },
  getObjectsLists: function(objectName) {
    return eventsFunctionContext._objectsMap[objectName] || null;
  },
  getBehaviorName: function(behaviorName) {
    return eventsFunctionContext._behaviorNamesMap[behaviorName];
  },
  createObject: function(objectName) {
    var objectsList = eventsFunctionContext._objectsMap[objectName];
    if (objectsList) {
      return parentEventsFunctionContext ?
        parentEventsFunctionContext.createObject(objectsList.firstKey()) :
        runtimeScene.createObject(objectsList.firstKey());
    }
    return null;
  },
  getArgument: function(argName) {
    return "";
  },
  getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); }
};

gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects1.length = 0;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitObjects2.length = 0;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects1.length = 0;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDUnitColliderObjects2.length = 0;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects1.length = 0;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDNodeObjects2.length = 0;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDParticleObjects1.length = 0;
gdjs.evtsExt__TestExtensions__BlueDeleteUnit.GDParticleObjects2.length = 0;

gdjs.evtsExt__TestExtensions__BlueDeleteUnit.eventsList0(runtimeScene, eventsFunctionContext);
return;
}

