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

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


gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95OrangeDeleteUnit_46GDUnitObjects1Objects = Hashtable.newFrom({"Unit": gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1});gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95OrangeDeleteUnit_46GDNodeObjects1Objects = Hashtable.newFrom({"Node": gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1});gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95OrangeDeleteUnit_46GDUnitObjects1Objects = Hashtable.newFrom({"Unit": gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1});gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95OrangeDeleteUnit_46GDNodeObjects1Objects = Hashtable.newFrom({"Node": gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1});gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95OrangeDeleteUnit_46GDParticleObjects1Objects = Hashtable.newFrom({"Particle": gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDParticleObjects1});gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.eventsList0 = function(runtimeScene, eventsFunctionContext) {

{

gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.createFrom(eventsFunctionContext.getObjects("Node"));
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1.createFrom(eventsFunctionContext.getObjects("Unit"));

gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition0IsTrue_0.val = false;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition1IsTrue_0.val = false;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition2IsTrue_0.val = false;
{
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition0IsTrue_0.val = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95OrangeDeleteUnit_46GDUnitObjects1Objects, gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95OrangeDeleteUnit_46GDNodeObjects1Objects, false, runtimeScene, false);
}if ( gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition0IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length;i<l;++i) {
    if ( gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariableNumber(gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariables().get("WorkerUnits").getChild("Blue")) <= 0 ) {
        gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition1IsTrue_0.val = true;
        gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[k] = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i];
        ++k;
    }
}
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length = k;}if ( gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition1IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length;i<l;++i) {
    if ( gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariableNumber(gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariables().get("BlueUnits")) <= 0 ) {
        gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition2IsTrue_0.val = true;
        gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[k] = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i];
        ++k;
    }
}
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length = k;}}
}
if (gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition2IsTrue_0.val) {
/* Reuse gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1 */
/* Reuse gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1 */
{for(var i = 0, len = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1[i].deleteFromScene(runtimeScene);
}
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].returnVariable(gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariables().get("WorkerUnits").getChild("Orange")).add(1);
}
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].returnVariable(gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariables().get("OrangeUnits")).add(1);
}
}{gdjs.evtTools.sound.playSoundOnChannel(runtimeScene, "sfx\\game_enemyCapture.wav", 3, false, gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().get("SFXVolume")), 1);
}}

}


{

gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.createFrom(eventsFunctionContext.getObjects("Node"));
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1.createFrom(eventsFunctionContext.getObjects("Unit"));

gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition0IsTrue_0.val = false;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition1IsTrue_0.val = false;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition2IsTrue_0.val = false;
{
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition0IsTrue_0.val = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95OrangeDeleteUnit_46GDUnitObjects1Objects, gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95OrangeDeleteUnit_46GDNodeObjects1Objects, false, runtimeScene, false);
}if ( gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition0IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length;i<l;++i) {
    if ( gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariableNumber(gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariables().get("WorkerUnits").getChild("Blue")) >= 1 ) {
        gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition1IsTrue_0.val = true;
        gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[k] = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i];
        ++k;
    }
}
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length = k;}if ( gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition1IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length;i<l;++i) {
    if ( gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariableNumber(gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariables().get("BlueUnits")) >= 1 ) {
        gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition2IsTrue_0.val = true;
        gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[k] = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i];
        ++k;
    }
}
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length = k;}}
}
if (gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.condition2IsTrue_0.val) {
/* Reuse gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1 */
/* Reuse gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1 */
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDtxtIndicatorObjects1.createFrom(eventsFunctionContext.getObjects("txtIndicator"));
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDParticleObjects1.length = 0;

{for(var i = 0, len = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1[i].deleteFromScene(runtimeScene);
}
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].returnVariable(gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariables().get("WorkerUnits").getChild("Blue")).sub(1);
}
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].returnVariable(gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[i].getVariables().get("BlueUnits")).sub(1);
}
}{gdjs.evtTools.object.createObjectOnScene((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : runtimeScene), gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.mapOfGDgdjs_46evtsExt_95_95TestExtensions_95_95OrangeDeleteUnit_46GDParticleObjects1Objects, (( gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1.length === 0 ) ? 0 :gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1[0].getPointX("")), (( gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1.length === 0 ) ? 0 :gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects1[0].getPointY("")), "Units");
}{for(var i = 0, len = gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDtxtIndicatorObjects1.length ;i < len;++i) {
    gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDtxtIndicatorObjects1[i].setString((gdjs.RuntimeObject.getVariableString(((gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length === 0 ) ? gdjs.VariablesContainer.badVariablesContainer : gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1[0].getVariables()).get("WorkerUnits").getChild("Blue"))));
}
}{gdjs.evtTools.sound.playSoundOnChannel(runtimeScene, "sfx\\game_unitdeath.wav", 3, false, gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().get("SFXVolume")), 1);
}}

}


};

gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.func = function(runtimeScene, Unit, UnitCollider, Node, Particle, txtIndicator, parentEventsFunctionContext) {
var eventsFunctionContext = {
  _objectsMap: {
"Unit": Unit
, "UnitCollider": UnitCollider
, "Node": Node
, "Particle": Particle
, "txtIndicator": txtIndicator
},
  _objectArraysMap: {
"Unit": gdjs.objectsListsToArray(Unit)
, "UnitCollider": gdjs.objectsListsToArray(UnitCollider)
, "Node": gdjs.objectsListsToArray(Node)
, "Particle": gdjs.objectsListsToArray(Particle)
, "txtIndicator": gdjs.objectsListsToArray(txtIndicator)
},
  _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__OrangeDeleteUnit.GDUnitObjects1.length = 0;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitObjects2.length = 0;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitColliderObjects1.length = 0;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDUnitColliderObjects2.length = 0;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects1.length = 0;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDNodeObjects2.length = 0;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDParticleObjects1.length = 0;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDParticleObjects2.length = 0;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDtxtIndicatorObjects1.length = 0;
gdjs.evtsExt__TestExtensions__OrangeDeleteUnit.GDtxtIndicatorObjects2.length = 0;

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

