
[ai]



[action_upgradeLevel_up]
text: Upgrade Up
setUnitMemory: upgradeLevel=(memory.upgradeLevel + 1)

[action_upgradeLevel_zero]
text: Upgrade Zero
setUnitMemory: upgradeLevel = 0

[turret_cannon_right]
x:5
y:-1
image: turret.png
projectile: universal
delay: 0.25s

[turret_cannon_left]
invisible: if memory.upgradeLevel == 0
canAttackCondition: if memory.upgradeLevel >= 1
x:-5
y:-1
@copyFromSection: turret_cannon_right

[projectile_universal]
life: 200
speed: 5
targetSpeed: 1.5
turnSpeed: 0.25
areaDamage: 1
areaRadius: 14
explodeOnEndOfLife: true
areaDamageNoFalloff: true
areaRadiusFromEdge: true
areaHitAirAndLandAtSameTime: true
explodeEffect: NONE
tags: primary
image: ROOT:drawable\projectile\cannon.png
#teamColorRatio: 1
drawSize: 1.5
mutatorAll_directDamageMultiplier: 0.1
mutatorAll_areaDamageMultiplier: 0.1
mutatorAll_ifUnitWithoutTags: null
color: #FFF000




#defineUnitMemory: number test, number lastResult
#[action_numberVar]
#text: %{memory.test}
#setUnitMemory: test=int(rnd(1, 50)), lastResult=memory.test
#[action_numberVarResult]
#text: %{memory.lastResult}
#addResources: 1
#[action_randomstuff1]
#autoTrigger: if memory.test > 12 and memory.test < 24
#addResources: 500
#setUnitMemory: test=0
#[action_randomstuff2]
#autoTrigger: if memory.test > 25 and memory.test < 40
#addResources: 750
#setUnitMemory: test=0


[hiddenAction_orbit]
requireConditional: if numberOfUnitsInTeam(withinRange=400, withTag='mainship', greaterThan=0)
#autoTrigger: if self.customTimer(laterThanSeconds=1) and not numberOfUnitsInEnemyTeam(withinRange=550, withTag='ship', greaterThan=0)
resetCustomTimer: true
@define dirOffset: 25
@define distOffset: 150
clearAllWaypoints: true
addWaypoint_type: move
addWaypoint_prepend: true
setCustomTarget1: nearestUnit(withTag='mainship', relation='own', withinRange=1500)
addWaypoint_target_fromReference: """createMarker(
  x=customTarget1.x+cos(directionBetween(customTarget1,self)+${dirOffset})*${distOffset},
  y=customTarget1.y+sin(directionBetween(customTarget1,self)+${dirOffset})*${distOffset}
)
"""
[hiddenAction_aggro_left]
@define dirOffset: 15
@define distOffset: 250
#autoTrigger: if numberOfUnitsInEnemyTeam(withinRange=550, withTag='ship', greaterThan=0)
clearAllWaypoints: true
addWaypoint_maxTime: 60
addWaypoint_type: move
addWaypoint_prepend: true
setCustomTarget1: nearestUnit(withTag='ship', relation='enemy', withinRange=550)
addWaypoint_target_fromReference: """createMarker(
  x=customTarget1.x+cos(directionBetween(customTarget1,self)+${dirOffset})*${distOffset},
  y=customTarget1.y+sin(directionBetween(customTarget1,self)+${dirOffset})*${distOffset}
)
"""

[hiddenAction_getCloser]
requireConditional: if numberOfUnitsInTeam(withinRange=400, withTag='ship', lessThan=1)
#autoTrigger: if numberOfUnitsInTeam(withinRange=400, withTag='mainship', lessThan=1) and not numberOfUnitsInEnemyTeam(withinRange=900, withTag='ship', greaterThan=0)
addWaypoint_type: move
addWaypoint_prepend: true
addWaypoint_target_nearestUnit_team: own
addWaypoint_target_nearestUnit_tagged: mainship