Загрузка данных
//GameMechanics event sheets
<Include Global>
[[Рандомная тема: кромка земли и небо]]
----[[Генерация декораций]]
--------+ System: On start of layout
---------> System: Wait 0.1 seconds (use time scale: False)
| Local number spawnX = 0
------------+ System: For "propX" from 1 to floor(LayoutWidth ÷ 150)
------------+ System: random(100) < 45
-------------> System: Set spawnX to (LoopIndex("propX") × 150) + random(-60, 60)
-------------> System: Set spawnX to clamp(spawnX, 50, LayoutWidth - 50)
-------------> System: Create object PropSprite on layer "Game" at (spawnX, HeightMap.At(spawnX, 0)), create hierarchy: False, template: ""
-------------> PropSprite: Set BaseAngle to clamp((((angle(spawnX-10, HeightMap.At(spawnX-10, 0), spawnX+10, HeightMap.At(spawnX+10, 0)) + 180) % 360) - 180) × 0.15, -10, 10)
-------------> PropSprite: Set angle to PropSprite.BaseAngle degrees
-------------> PropSprite: Set scale to random(0.2, 0.3)
-------------> PropSprite: Move to bottom of layer
----------------+ System: WeatherID = 3
-----------------> PropSprite: Set animation to "Cactus" (play from beginning)
-----------------> PropSprite: Set PropType to 1
-----------------> PropSprite: Set scale to random(0.1, 0.2)
----------------+ System: WeatherID = 4
-----------------> PropSprite: Set animation to "TreeWinter" (play from beginning)
-----------------> PropSprite: Set PropType to 2
----------------+ System: [X] WeatherID = 4
----------------+ System: [X] WeatherID = 3
-----------------> PropSprite: Set animation to "Tree" (play from beginning)
-----------------> PropSprite: Set PropType to 0
----------------+ (no conditions)
-----------------> PropSprite: Set animation frame to int(random(0, PropSprite.AnimationFrameCount))
--------------------+ System: WeatherID = 0
---------------------> PropSprite: Set color to rgb(255, 255, 255)
--------------------+ System: WeatherID = 1
---------------------> PropSprite: Set color to rgb(160, 170, 190)
--------------------+ System: WeatherID = 2
---------------------> PropSprite: Set color to rgb(60, 75, 120)
--------------------+ System: WeatherID = 3
---------------------> PropSprite: Set color to rgb(255, 235, 200)
--------------------+ System: WeatherID = 4
---------------------> PropSprite: Set color to rgb(200, 220, 255)
// [Взаимодействие танков с декорациями]
--------+ System: Every tick
--------+ System: For each PropSprite
---------> PropSprite: Set IsBeingTouched to False
------------+ System: For each Players
------------+ Players: Is overlapping PropSprite
-------------> PropSprite: Set IsBeingTouched to True
------------+ PropSprite: Is IsBeingTouched
------------+ PropSprite: WasTouchedLastTick = 0
-------------> PropSprite: Set WasTouchedLastTick to 1
-------------> PropSprite: Subtract 1 from HP
-------------> PropSprite: Set WobbleTimer to 1.0
----------------+ System: Repeat random(4, 7) times
-----------------> System: Create object BoomPuff on layer "Game" at (PropSprite.X + random(-15, 15), PropSprite.Y - random(20, 50)), create hierarchy: False, template: ""
-----------------> BoomPuff: Set Type to 7
-----------------> BoomPuff: Set Age to 0
-----------------> BoomPuff: Set Life to random(0.8, 1.5)
-----------------> BoomPuff: Set T to 0
-----------------> BoomPuff: Set vx to random(-30, 30)
-----------------> BoomPuff: Set vy to random(-10, 10)
-----------------> BoomPuff: Set PuffScale to random(0.1, 0.2)
-----------------> BoomPuff: Set scale to Self.PuffScale
-----------------> BoomPuff: Set angle to random(0, 360) degrees
-----------------> BoomPuff: Set Spin to random(-100, 100)
-----------------> BoomPuff: Set opacity to 100
-----------------> BoomPuff: Move to top of layer
--------------------+ PropSprite: PropType = 0
---------------------> BoomPuff: Set color to rgb(70, 180, 70)
--------------------+ PropSprite: PropType = 1
---------------------> BoomPuff: Set color to rgb(150, 200, 80)
--------------------+ PropSprite: PropType = 2
---------------------> BoomPuff: Set color to rgb(240, 250, 255)
----------------+ PropSprite: HP ≤ 0
-----------------> Functions: Call DestroyProp (PropUID: PropSprite.UID)
----------------+ (no conditions)
-----------------> (no actions)
------------+ PropSprite: [X] Is IsBeingTouched
------------+ PropSprite: WasTouchedLastTick = 1
-------------> PropSprite: Set WasTouchedLastTick to 0
// [Физика и шатание декораций]
--------+ System: Every tick
--------+ System: For each PropSprite
------------+ PropSprite: WobbleTimer > 0
-------------> PropSprite: Subtract dt from WobbleTimer
-------------> PropSprite: Set angle to PropSprite.BaseAngle + (sin(time × 600) × 12 × PropSprite.WobbleTimer) degrees
------------+ PropSprite: WobbleTimer ≤ 0
-------------> PropSprite: Set angle to PropSprite.BaseAngle degrees
------------+ System: HeightMap.At(clamp(floor(PropSprite.X), 0, LayoutWidth), 0) > PropSprite.Y + 15
-------------> Functions: Call DestroyProp (PropUID: PropSprite.UID)
// [Разрушение декораций (Функция)]
| Local number pSpd = 0
| Local number pAng = 0
--------* On function 'DestroyProp'
--------* Parameter 'PropUID' (Number)
------------+ PropSprite: Pick instance with UID PropUID
-------------> PropSprite: Destroy
----------------+ System: Repeat 15 times
-----------------> System: Set pAng to random(220, 320)
-----------------> System: Set pSpd to random(80, 250)
-----------------> System: Create object BoomPuff on layer "Game" at (PropSprite.X + random(-10, 10), PropSprite.Y - random(10, 40)), create hierarchy: False, template: ""
-----------------> BoomPuff: Set Age to 0
-----------------> BoomPuff: Set Type to 6
-----------------> BoomPuff: Set Life to random(0.3, 0.6)
-----------------> BoomPuff: Set T to 0
-----------------> BoomPuff: Set vx to cos(pAng) × pSpd
-----------------> BoomPuff: Set vy to sin(pAng) × pSpd
-----------------> BoomPuff: Set PuffScale to random(0.2, 0.4)
-----------------> BoomPuff: Set scale to Self.PuffScale
-----------------> BoomPuff: Set opacity to 100
--------------------+ PropSprite: PropType = 0
------------------------+ System: LoopIndex % 3 = 0
-------------------------> BoomPuff: Set color to rgb(101, 67, 33)
------------------------+ System: Else
-------------------------> BoomPuff: Set color to rgb(70, 180, 70)
--------------------+ PropSprite: PropType = 1
------------------------+ System: LoopIndex % 3 = 0
-------------------------> BoomPuff: Set color to rgb(230, 210, 130)
------------------------+ System: Else
-------------------------> BoomPuff: Set color to rgb(150, 200, 80)
--------------------+ PropSprite: PropType = 2
------------------------+ System: LoopIndex % 3 = 0
-------------------------> BoomPuff: Set color to rgb(101, 67, 33)
------------------------+ System: Else
-------------------------> BoomPuff: Set color to rgb(240, 250, 255)
// [Генерация Бочек]
| Local number bX = 0
--------+ System: On start of layout
---------> System: Wait 0.15 seconds (use time scale: False)
------------+ System: For "bStep" from 1 to floor(LayoutWidth ÷ 250)
------------+ System: random(100) < 35
-------------> System: Set bX to (LoopIndex("bStep") × 250) + random(-50, 50)
-------------> System: Set bX to clamp(bX, 50, LayoutWidth - 50)
-------------> System: Create object BarrelSprite on layer "Game" at (bX, HeightMap.At(bX, 0)), create hierarchy: False, template: ""
-------------> BarrelSprite: Set BaseAngle to clamp((((angle(bX-10, HeightMap.At(bX-10, 0), bX+10, HeightMap.At(bX+10, 0)) + 180) % 360) - 180) × 0.15, -15, 15)
-------------> BarrelSprite: Set angle to BarrelSprite.BaseAngle degrees
-------------> BarrelSprite: Set scale to 0.1
-------------> BarrelSprite: Move to bottom of layer
----------------+ System: random(100) < 50
-----------------> BarrelSprite: Set animation to "Red" (play from beginning)
-----------------> BarrelSprite: Set BarrelType to 0
----------------+ System: Else
-----------------> BarrelSprite: Set animation to "Green" (play from beginning)
-----------------> BarrelSprite: Set BarrelType to 1
// [Логика Радиоактивной Зоны]
--------+ System: Every 0.5 seconds
--------+ System: For each Players
--------+ Players: Is overlapping ToxicDrop
--------+ Players: isDestroyed = 0
---------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 3, HeavyHit: 0)
---------> System: Create object BoomPuff on layer "Game" at (Players.X + random(-15, 15), Players.Y + random(-10, 10)), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 7
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to random(0.5, 1.0)
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to random(-10, 10)
---------> BoomPuff: Set vy to -random(20, 40)
---------> BoomPuff: Set color to rgb(50, 255, 50)
---------> BoomPuff: Set opacity to 70
// 2. Кислотные пузыри (визуал)
--------+ System: Every 0.15 seconds
--------+ System: For each ToxicDrop
--------+ System: random(100) < 15
---------> System: Create object BoomPuff on layer "Game" at (ToxicDrop.X + random(-15, 15), ToxicDrop.Y - random(0, 10)), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 7
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to random(0.5, 1.2)
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to random(-10, 10)
---------> BoomPuff: Set vy to -random(15, 35)
---------> BoomPuff: Set PuffScale to random(0.1, 0.3)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set opacity to 70
---------> BoomPuff: Set color to rgb(50, 255, 50)
---------> BoomPuff: Move to bottom of layer
// [Взрыв Бочек (Функция)]
--------* On function 'ExplodeBarrel'
--------* Parameter 'BarrelUID' (Number)
------------+ BarrelSprite: Pick instance with UID BarrelUID
------------+ BarrelSprite: IsExploding = 0
-------------> BarrelSprite: Set IsExploding to 1
-------------> BarrelSprite: Destroy
// ═══ КРАСНАЯ БОЧКА (Мощный взрыв) ═══
----------------+ BarrelSprite: BarrelType = 0
-----------------> Functions: Call VideoBoomFXGround (X: BarrelSprite.X, Y: BarrelSprite.Y, ColorType: 0)
-----------------> Functions: Call Blast (x: BarrelSprite.X, y: BarrelSprite.Y, Radius: 50)
--------------------+ System: For each Players
--------------------+ Players: isDestroyed = 0
--------------------+ System: distance(Players.X, Players.Y, BarrelSprite.X, BarrelSprite.Y) < 60
---------------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 35, HeavyHit: 1)
// ═══ ЗЕЛЕНАЯ БОЧКА (Яд и Кислота) ═══
----------------+ BarrelSprite: BarrelType = 1
-----------------> Functions: Call Blast (x: BarrelSprite.X, y: BarrelSprite.Y, Radius: 35)
-----------------> System: Set ShakePower to 15
--------------------+ System: Repeat 40 times
---------------------> System: Create object ToxicDrop on layer "LiquidLayer" at (BarrelSprite.X + random(-5, 5), BarrelSprite.Y - random(5, 10)), create hierarchy: False, template: ""
---------------------> ToxicDrop: Set vx to random(-150, 150)
---------------------> ToxicDrop: Set vy to random(-100, -300)
---------------------> ToxicDrop: Set Life to random(4.0, 6.0)
---------------------> ToxicDrop: Set scale to random(0.5, 1.0)
// [Физика Токсичной Жидкости]
| Local number dropY = 0
| Local number dropSlope = 0
| Local number dropX = 0
--------+ System: Every tick
--------+ System: For each ToxicDrop
---------> ToxicDrop: Subtract dt from Life
------------+ ToxicDrop: vy ≠ 0
-------------> ToxicDrop: Add 600 × dt to vy
-------------> ToxicDrop: Set X to ToxicDrop.X + ToxicDrop.vx × dt
-------------> ToxicDrop: Set Y to ToxicDrop.Y + ToxicDrop.vy × dt
------------+ ToxicDrop: Life < 1.0
-------------> ToxicDrop: Set scale to ToxicDrop.Life
----------------+ ToxicDrop: Life ≤ 0
-----------------> ToxicDrop: Destroy
------------+ (no conditions)
-------------> System: Set dropX to clamp(floor(ToxicDrop.X), 0, LayoutWidth - 1)
-------------> System: Set dropY to HeightMap.At(dropX, 0)
------------+ System: ToxicDrop.Y ≥ dropY
-------------> ToxicDrop: Set Y to dropY
-------------> ToxicDrop: Set vy to 0
-------------> ToxicDrop: Set vx to ToxicDrop.vx × max(0, 1 - (4 × dt))
-------------> System: Set dropSlope to angle(dropX - 15, HeightMap.At(clamp(dropX - 15, 0, LayoutWidth), 0), dropX + 15, HeightMap.At(clamp(dropX + 15, 0, LayoutWidth), 0))
-------------> System: Set dropSlope to ((dropSlope + 180) % 360) - 180
-------------> ToxicDrop: Set vx to ToxicDrop.vx + (sin(dropSlope) × 300 × dt)
----[[Гроза: молнии и вспышки]]
--------+ System: Every 7 seconds
--------+ System: WeatherID = 1
--------+ System: MatchResult = ""
--------// // ---------- вспышка на весь экран ----------
---------> System: Create object FlashScreen on layer "UI" at (ViewportMidX("UI"), ViewportMidY("UI")), create hierarchy: False, template: ""
---------> FlashScreen: Set size to (ViewportWidth("UI") + 200, ViewportHeight("UI") + 200)
---------> FlashScreen: Set opacity to 70
---------> FlashScreen: Fade: set fade-in time to 0
---------> FlashScreen: Fade: set wait time to 0
---------> FlashScreen: Fade: set fade-out time to 0.4
---------> FlashScreen: Fade: restart fade
--------// ---------- молния в случайном месте неба ----------
---------> System: Create object LightningBeam on layer "Game" at (ScrollX + random(-ViewportWidth("Game") ÷ 2 + 80, ViewportWidth("Game") ÷ 2 - 80), ScrollY - ViewportHeight("Game") ÷ 2 + 150), create hierarchy: False, template: ""
---------> LightningBeam: Set height to 2000
---------> LightningBeam: Fade: set fade-out time to 0.5
---------> LightningBeam: Fade: restart fade
---------> System: Set ShakePower to 5
---------> System: Wait 0.15 seconds (use time scale: True)
--------// ---------- вторая короткая вспышка (мерцание, как у настоящей молнии) ----------
---------> System: Create object FlashScreen on layer "UI" at (ViewportMidX("UI"), ViewportMidY("UI")), create hierarchy: False, template: ""
---------> FlashScreen: Set size to (ViewportWidth("UI") + 200, ViewportHeight("UI") + 200)
---------> FlashScreen: Set opacity to 40
---------> FlashScreen: Fade: set fade-in time to 0
---------> FlashScreen: Fade: set wait time to 0
---------> FlashScreen: Fade: set fade-out time to 0.3
---------> FlashScreen: Fade: restart fade
----+ System: On start of layout
-----> System: Set WeatherID to int(random(0, 5))
-----> SkyGradient: Set size to (LayoutWidth × 2, LayoutHeight × 2)
-----> SkyGradient: Set position to (LayoutWidth ÷ 2, LayoutHeight ÷2)
-----> SkyCanvas: Set size to (LayoutWidth × 2, LayoutHeight × 2)
-----> SkyCanvas: Set position to (LayoutWidth ÷2, LayoutHeight ÷2)
-----> System: Set CloudStyle to int(random(0, 2))
// ══ ПАЛИТРЫ НЕБА ПО ПОГОДЕ ═══
--------+ System: WeatherID = 0
---------> System: Set SkyR1 to 102+ random(-50, 50)
---------> System: Set SkyG1 to 178+ random(-50, 50)
---------> System: Set SkyB1 to 255
---------> System: Set SkyR2 to 180
---------> System: Set SkyG2 to 210
---------> System: Set SkyB2 to 240
---------> System: Set SkyR3 to 215
---------> System: Set SkyG3 to 235
---------> System: Set SkyB3 to 245
---------> System: Set SkyStarCount to 5
---------> System: Set SkyCloudCount to 5
---------> SkyGradient: Set color to rgb(SkyR1, SkyG1, SkyB1)
--------+ System: WeatherID = 1
---------> System: Set SkyR1 to 10 + random(-50, 50)
---------> System: Set SkyG1 to 70 + random(-50, 50)
---------> System: Set SkyB1 to 140 + random(-50, 50)
---------> System: Set SkyR2 to 70
---------> System: Set SkyG2 to 50
---------> System: Set SkyB2 to 95
---------> System: Set SkyR3 to 95
---------> System: Set SkyG3 to 70
---------> System: Set SkyB3 to 125
---------> System: Set SkyStarCount to 50
---------> System: Set SkyCloudCount to 8
---------> SkyGradient: Set color to rgb(SkyR1, SkyG1, SkyB1)
--------+ System: WeatherID = 2
---------> System: Set SkyR1 to 0
---------> System: Set SkyG1 to 25 + random(-25, 70)
---------> System: Set SkyB1 to 112 + random(-100, 50)
---------> System: Set SkyR2 to 35
---------> System: Set SkyG2 to 40
---------> System: Set SkyB2 to 70
---------> System: Set SkyR3 to 55
---------> System: Set SkyG3 to 60
---------> System: Set SkyB3 to 95
---------> System: Set SkyStarCount to 15
---------> System: Set SkyCloudCount to 2
---------> SkyGradient: Set color to rgb(SkyR1, SkyG1, SkyB1)
--------+ System: WeatherID = 3
---------> System: Set SkyR1 to 170+ random(-50, 50)
---------> System: Set SkyG1 to 100+ random(-50, 50)
---------> System: Set SkyB1 to 25
---------> System: Set SkyR2 to 255
---------> System: Set SkyG2 to 220
---------> System: Set SkyB2 to 160
---------> System: Set SkyR3 to 255
---------> System: Set SkyG3 to 235
---------> System: Set SkyB3 to 195
---------> System: Set SkyStarCount to 0
---------> System: Set SkyCloudCount to 3
---------> SkyGradient: Set color to rgb(SkyR1, SkyG1, SkyB1)
--------+ System: WeatherID = 4
---------> System: Set SkyR1 to 180+ random(-180, 50)
---------> System: Set SkyG1 to 210+ random(-60, 15)
---------> System: Set SkyB1 to 240+ random(-15, 15)
---------> System: Set SkyR2 to 200
---------> System: Set SkyG2 to 215
---------> System: Set SkyB2 to 235
---------> System: Set SkyR3 to 220
---------> System: Set SkyG3 to 230
---------> System: Set SkyB3 to 245
---------> System: Set SkyStarCount to 20
---------> System: Set SkyCloudCount to 4
---------> SkyGradient: Set color to rgb(SkyR1, SkyG1, SkyB1)
// ══ РЕНДЕР НЕБА ═══
--------+ (no conditions)
---------> Functions: Call RenderSky
// ---------- эффекты погоды ----------
--------+ System: WeatherID = 1
---------> Rain: Set visibility Visible
---------> snow: Set visibility Invisible
---------> SandWind: Set visibility Invisible
--------+ System: WeatherID = 4
---------> Rain: Set visibility Invisible
---------> snow: Set visibility Visible
---------> SandWind: Set visibility Invisible
--------+ System: [X] WeatherID = 1
--------+ System: [X] WeatherID = 4
---------> Rain: Set visibility Invisible
---------> snow: Set visibility Invisible
--------+ System: WeatherID = 3
---------> SandWind: Set visibility Visible
---------> Rain: Set visibility Invisible
---------> snow: Set visibility Invisible
--------+ System: Else
---------> SandWind: Set visibility Invisible
// ---------- ДЕНЬ: яркая земля, трава ----------
--------+ System: WeatherID = 0
---------> System: Set ThemeHasGrass to 1
---------> System: Set ColGround1 to rgb(124, 90, 60)
---------> System: Set ColGround2 to rgb(110, 78, 50)
---------> System: Set ColGround3 to rgb(95, 66, 42)
---------> System: Set ColOutline to rgb(52, 38, 28)
---------> System: Set ColEdgeTop to rgb(118, 218, 66)
---------> System: Set EdgeTopWidth to 4
---------> System: Set ColEdgeUnder to rgb(62, 145, 40)
---------> System: Set EdgeUnderWidth to 7
---------> System: Set ColBlade to rgb(118, 218, 66)
---------> System: Set ColSpotLight to rgb(150, 112, 78)
---------> System: Set ColSpotDark to rgb(92, 64, 40)
---------> System: Set ColBurnGround to rgb(35, 26, 19)
---------> System: Set ColBurnGlow to rgba(255, 110, 25, 0.3)
---------> System: Set ColDust to rgb(165, 140, 110)
// ---------- ГРОЗА: бордовая земля, розовая кромка ----------
--------+ System: WeatherID = 1
---------> System: Set ThemeHasGrass to 1
---------> System: Set ColGround1 to rgb(139, 80, 94)
---------> System: Set ColGround2 to rgb(126, 70, 84)
---------> System: Set ColGround3 to rgb(111, 60, 74)
---------> System: Set ColOutline to rgb(80, 42, 54)
---------> System: Set ColEdgeTop to rgb(227, 136, 159)
---------> System: Set EdgeTopWidth to 6
---------> System: Set ColEdgeUnder to rgb(176, 98, 117)
---------> System: Set EdgeUnderWidth to 4
---------> System: Set ColSpotLight to rgb(152, 94, 108)
---------> System: Set ColSpotDark to rgb(117, 66, 80)
---------> System: Set ColBurnGround to rgb(60, 32, 42)
---------> System: Set ColBurnGlow to rgba(255, 110, 25, 0.3)
---------> System: Set ColDust to rgb(140, 100, 112)
// ---------- НОЧЬ: тёмная синеватая земля, голубая кромка ----------
--------+ System: WeatherID = 2
---------> System: Set ThemeHasGrass to 1
---------> System: Set ColGround1 to rgb(56, 70, 100)
---------> System: Set ColGround2 to rgb(47, 59, 86)
---------> System: Set ColGround3 to rgb(38, 48, 71)
---------> System: Set ColOutline to rgb(22, 30, 48)
---------> System: Set ColEdgeTop to rgb(140, 176, 226)
---------> System: Set EdgeTopWidth to 5
---------> System: Set ColEdgeUnder to rgb(92, 120, 168)
---------> System: Set EdgeUnderWidth to 6
---------> System: Set ColSpotLight to rgb(70, 86, 120)
---------> System: Set ColSpotDark to rgb(48, 60, 90)
---------> System: Set ColBurnGround to rgb(18, 24, 40)
---------> System: Set ColBurnGlow to rgba(130, 180, 255, 0.25)
---------> System: Set ColDust to rgb(75, 90, 120)
// ---------- ПУСТЫНЯ: песочная земля, жёлтая кромка ----------
--------+ System: WeatherID = 3
---------> System: Set ThemeHasGrass to 1
---------> System: Set ColGround1 to rgb(214, 178, 120)
---------> System: Set ColGround2 to rgb(196, 158, 100)
---------> System: Set ColGround3 to rgb(176, 138, 84)
---------> System: Set ColOutline to rgb(105, 80, 45)
---------> System: Set ColEdgeTop to rgb(246, 218, 150)
---------> System: Set EdgeTopWidth to 5
---------> System: Set ColEdgeUnder to rgb(214, 178, 110)
---------> System: Set EdgeUnderWidth to 6
---------> System: Set ColSpotLight to rgb(228, 194, 136)
---------> System: Set ColSpotDark to rgb(186, 150, 94)
---------> System: Set ColBurnGround to rgb(85, 60, 35)
---------> System: Set ColBurnGlow to rgba(255, 140, 40, 0.35)
---------> System: Set ColDust to rgb(214, 184, 132)
// ---------- ЗИМА: снежная земля, белая кромка ----------
--------+ System: WeatherID = 4
---------> System: Set ThemeHasGrass to 1
---------> System: Set ColGround1 to rgb(190, 210, 230)
---------> System: Set ColGround2 to rgb(170, 192, 214)
---------> System: Set ColGround3 to rgb(150, 172, 196)
---------> System: Set ColOutline to rgb(90, 110, 140)
---------> System: Set ColEdgeTop to rgb(255, 255, 255)
---------> System: Set EdgeTopWidth to 6
---------> System: Set ColEdgeUnder to rgb(215, 232, 248)
---------> System: Set EdgeUnderWidth to 7
---------> System: Set ColSpotLight to rgb(205, 222, 240)
---------> System: Set ColSpotDark to rgb(165, 188, 212)
---------> System: Set ColBurnGround to rgb(70, 85, 110)
---------> System: Set ColBurnGlow to rgba(255, 140, 60, 0.3)
---------> System: Set ColDust to rgb(240, 248, 255)
---------> BoomPuff: Set PuffScale to Self.PuffScale × 1.5
---------> BoomPuff: Set opacity to 85
// [Паралакс: рандомный лес/город + подкраска под погоду]
----+ System: On start of layout
-----> System: Set BackdropID to int(random(0, 2))
--------+ (no conditions)
--------// ---------- дальний план: холмы ИЛИ пустынные горы ----------
---------> FarBackdrop: Set animation speed to 0
------------+ System: WeatherID = 3
-------------> FarBackdrop: Set animation to "DesertMountains" (play from beginning)
-------------> FarBackdrop: Set animation frame to int(random(0, FarBackdrop.AnimationFrameCount))
------------+ System: Else
-------------> FarBackdrop: Set animation to "Hills" (play from beginning)
-------------> FarBackdrop: Set animation frame to int(random(0, FarBackdrop.AnimationFrameCount))
--------+ (no conditions)
---------> FarBackdrop: Set size to (LayoutWidth, LayoutHeight)
---------> FarBackdrop: Set position to (LayoutWidth÷2, LayoutHeight × 0.5)
---------> FarBackdrop: Set opacity to 100
--------// ---------- средний план: лес/город ИЛИ пустыня ----------
---------> MidBackdrop: Set animation speed to 0
------------+ System: WeatherID = 3
-------------> MidBackdrop: Set animation to "DesertDunes" (play from beginning)
-------------> MidBackdrop: Set animation frame to int(random(0, MidBackdrop.AnimationFrameCount))
------------+ System: Else
----------------+ System: BackdropID = 0
-----------------> MidBackdrop: Set animation to "Forest" (play from beginning)
----------------+ System: BackdropID = 1
-----------------> MidBackdrop: Set animation to "City" (play from beginning)
------------+ (no conditions)
-------------> MidBackdrop: Set animation frame to int(random(0, MidBackdrop.AnimationFrameCount))
-------------> MidBackdrop: Set size to (LayoutWidth, LayoutHeight)
-------------> MidBackdrop: Set position to (LayoutWidth÷ 2, LayoutHeight × 0.5)
// ---------- подкраска силуэтов под погоду ----------
------------+ System: WeatherID = 0
-------------> FarBackdrop: Set color to rgb(115, 165, 225)
----------------+ System: BackdropID = 0
-----------------> MidBackdrop: Set color to rgb(70, 145, 95)
----------------+ System: Else
-----------------> MidBackdrop: Set color to rgb(110, 125, 145)
------------+ System: WeatherID = 1
-------------> FarBackdrop: Set color to rgb(75, 85, 115)
-------------> MidBackdrop: Set color to rgb(52, 58, 84)
------------+ System: WeatherID = 2
-------------> FarBackdrop: Set color to rgb(45, 60, 105)
-------------> MidBackdrop: Set color to rgb(24, 34, 68)
------------+ System: WeatherID = 3
-------------> FarBackdrop: Set color to rgb(255, 69, 0)
----------------+ System: BackdropID = 0
-----------------> MidBackdrop: Set color to rgb(150, 135, 70)
----------------+ System: Else
-----------------> MidBackdrop: Set color to rgb(200, 125, 65)
------------+ System: WeatherID = 4
-------------> FarBackdrop: Set color to rgb(140, 175, 220)
----------------+ System: BackdropID = 0
-----------------> MidBackdrop: Set color to rgb(50, 95, 130)
----------------+ System: Else
-----------------> MidBackdrop: Set color to rgb(95, 115, 155)
// ---------- облака только для грозы ----------
------------+ System: WeatherID = 1
-------------> StormClouds: Set visibility Visible
-------------> StormClouds: Set size to (LayoutWidth × 2, LayoutWidth)
-------------> StormClouds: Set position to (LayoutWidth ÷ 2, LayoutHeight × 0.22)
-------------> StormClouds: Set opacity to 50
------------+ System: Else
-------------> StormClouds: Set visibility Invisible
// [Гроза: дрейф облаков]
----+ System: Every tick
----+ System: WeatherID = 1
-----> StormClouds: Set X to StormClouds.X + 15 × dt
--------+ System: StormClouds.X - StormClouds.Width ÷ 2 > LayoutWidth
---------> StormClouds: Set X to -StormClouds.Width ÷ 2
// ═══ 3. ОБЛАКА ═══
| Local number CloudStyle = 0
----+ System: On start of layout
-----> CloudSprite: Destroy
-----> CloudSprite: Set animation speed to 0
--------+ System: WeatherID = 0
--------+ System: Repeat random(5, 8) times
---------> System: Create object CloudSprite on layer "Cloud" at (random(-100, LayoutWidth + 100), random(0, LayoutHeight × 0.5)), create hierarchy: False, template: ""
---------> CloudSprite: Set animation to "Default" (play from beginning)
------------+ System: CloudStyle = 0
-------------> CloudSprite: Set animation frame to int(random(0, 10))
------------+ System: CloudStyle = 1
-------------> CloudSprite: Set animation frame to int(random(31, 45))
--------+ (no conditions)
---------> CloudSprite: Set scale to random(0.8, 1.5)
---------> CloudSprite: Set opacity to random(70, 100)
--------+ System: WeatherID = 1
--------+ System: Repeat random(7, 10) times
---------> System: Create object CloudSprite on layer "Cloud" at (random(-100, LayoutWidth + 100), random(0, LayoutHeight × 0.5)), create hierarchy: False, template: ""
---------> CloudSprite: Set animation to "Default" (play from beginning)
---------> CloudSprite: Set animation frame to int(random(11, 20))
---------> CloudSprite: Set scale to random(0.8, 1.5)
---------> CloudSprite: Set opacity to random(70, 100)
--------+ [DISABLED] System: WeatherID = 2
--------+ [DISABLED] System: Repeat random(6, 9) times
---------> [DISABLED] System: Create object CloudSprite on layer "Cloud" at (random(-150, LayoutWidth + 150), random(0, LayoutHeight × 0.5)), create hierarchy: False, template: ""
---------> [DISABLED] CloudSprite: Set animation to "Default" (play from beginning)
---------> [DISABLED] CloudSprite: Set animation frame to int(random(11, 20))
---------> [DISABLED] CloudSprite: Set scale to random(0.8, 1.5)
---------> [DISABLED] CloudSprite: Set opacity to random(70, 100)
--------+ System: WeatherID = 3
--------+ System: Repeat random(5, 8) times
---------> System: Create object CloudSprite on layer "Cloud" at (random(-100, LayoutWidth + 100), random(0, LayoutHeight × 0.5)), create hierarchy: False, template: ""
---------> CloudSprite: Set animation to "Default" (play from beginning)
---------> CloudSprite: Set animation frame to int(random(21, 30))
---------> CloudSprite: Set scale to random(0.8, 1.5)
---------> CloudSprite: Set opacity to random(70, 100)
--------+ System: WeatherID = 4
--------+ System: Repeat random(5, 8) times
---------> System: Create object CloudSprite on layer "Cloud" at (random(-100, LayoutWidth + 100), random(0, LayoutHeight × 0.5)), create hierarchy: False, template: ""
---------> CloudSprite: Set animation to "Default" (play from beginning)
---------> CloudSprite: Set animation frame to int(random(31, 45))
---------> CloudSprite: Set scale to random(0.8, 1.2)
---------> CloudSprite: Set opacity to random(70, 100)
// [Облака: медленный дрейф]
----+ System: Every tick
----+ System: For each CloudSprite
-----> CloudSprite: Set X to CloudSprite.X + 3 × dt
--------+ System: CloudSprite.X - CloudSprite.Width ÷ 2 > LayoutWidth + 200
---------> CloudSprite: Set X to -CloudSprite.Width ÷ 2 - 100
---------> CloudSprite: Set Y to random(LayoutHeight × 0.05, LayoutHeight × 0.35)
----[═══ ФУНКЦИЯ: Рендер процедурного неба ══]
| Local number sy = 0
| Local number cy = 0
| Local number cw = 0
| Local number hueR = 0
| Local number cloudAlpha = 0
| Local number starAlpha = 0
| Local number ch = 0
| Local number r = 0
| Local number g = 0
| Local number b = 0
| Local number t = 0
| Local number cx = 0
| Local number row = 0
| Local number stepY = 0
| Local number sx = 0
--------* On function 'RenderSky'
---------> SkyCanvas: Clear canvas rgba(0, 0, 0, 0)
--------// ═══ 1. ОСНОВНОЙ ГРАДИЕНТ (3 полосы с перекрытием) ═══
---------> System: Set stepY to SkyCanvas.Height ÷ 100
------------+ System: For "row" from 0 to 99
-------------> System: Set t to LoopIndex("row") ÷ 99
----------------+ System: t < 0.5
-----------------> System: Set r to lerp(SkyR1, SkyR2, t × 2)
-----------------> System: Set g to lerp(SkyG1, SkyG2, t × 2)
-----------------> System: Set b to lerp(SkyB1, SkyB2, t × 2)
----------------+ System: Else
-----------------> System: Set r to lerp(SkyR2, SkyR3, (t - 0.5) × 2)
-----------------> System: Set g to lerp(SkyG2, SkyG3, (t - 0.5) × 2)
-----------------> System: Set b to lerp(SkyB2, SkyB3, (t - 0.5) × 2)
------------+ (no conditions)
-------------> SkyCanvas: Fill rectangle (0, LoopIndex("row") × stepY) to (SkyCanvas.Width, (LoopIndex("row") × stepY) + stepY + 1) with rgb(r, g, b)
// ══ 2. СОЛНЦЕ И ЛУНА (Отдельные спрайты) ═══
------------+ (no conditions)
-------------> SunSprite: Set visibility Invisible
-------------> MoonSprite: Set visibility Invisible
// ═══ 4. СОЛНЦЕ (только днём/пустыня) ═══
------------+ System: WeatherID = 0
-------------> SunSprite: Set visibility Visible
-------------> SunSprite: Set position to (random(LayoutWidth × 0.2, LayoutWidth × 0.8), random(LayoutHeight × 0.1, LayoutHeight × 0.3))
-------------> SunSprite: Set scale to random (1.0, 1.35)
-------------> SunSprite: Set color to rgb(224, 200, 100)
------------+ System: WeatherID = 3
-------------> SunSprite: Set visibility Visible
-------------> SunSprite: Set position to (random(LayoutWidth × 0.2, LayoutWidth × 0.8), random(LayoutHeight × 0.1, LayoutHeight × 0.3))
-------------> SunSprite: Set color to rgb(255, 200, 100)
-------------> SunSprite: Set scale to random (0.75, 1.5)
------------+ System: WeatherID = 4
-------------> SunSprite: Set visibility Visible
-------------> SunSprite: Set position to (random(LayoutWidth × 0.2, LayoutWidth × 0.8), random(LayoutHeight × 0.1, LayoutHeight × 0.3))
-------------> SunSprite: Set color to rgb(255, 255, 230)
-------------> SunSprite: Set scale to random (0.55, 1.0)
// ══ 5. ЛУНА (только ночью) ═══
------------+ System: WeatherID = 2
-------------> MoonSprite: Set visibility Visible
-------------> MoonSprite: Set position to (random(LayoutWidth × 0.2, LayoutWidth × 0.8), random(LayoutHeight × 0.1, LayoutHeight × 0.3))
-------------> MoonSprite: Set color to rgb(230, 240, 255)
-------------> MoonSprite: Set scale to random (0.75, 1.1)
// ═══ 2. ЗВЁЗДЫ (только для ночи/зимы) ═══
------------+ (no conditions)
-------------> StarSprite: Destroy
----------------+ System: WeatherID = 2
-----------------> System: Set SkyStarCount to 80
----------------+ System: WeatherID = 4
-----------------> System: Set SkyStarCount to 20
----------------+ System: WeatherID = 0
----------------+ System: WeatherID = 1
----------------+ System: WeatherID = 3
-----------------> System: Set SkyStarCount to 0
----------------+ System: SkyStarCount > 0
----------------+ System: Repeat SkyStarCount times
-----------------> System: Create object StarSprite on layer "Tileback" at (random(0, LayoutWidth), random(0, LayoutHeight × 0.6)), create hierarchy: False, template: ""
-----------------> StarSprite: Set scale to random(0.1, 1.0)
// ═══ Мерцание звёзд ночью ═══
----+ System: Every tick
----+ System: For each StarSprite
-----> StarSprite: Set opacity to 85 + 45 × sin(time × 300 + StarSprite.UID × 77)
[дебаг]
----+ System: Every tick
-----> [DISABLED] DebugText: Set text to "TankAng=" & round(PlayerTank.Angle) & " | Facing=" & FacingDirection & " | target=" & round(targetAngle) & " | aimDiff=" & round(aimDiff) & " | local=" & round(localAngle) & " | Barrel=" & round(PlayerBarrel.Angle)
-----> DebugText: Set text to "Charge: " & Power & " | Shooting: " & IsShooting & " | Player: " & ActivePlayer
-----> [DISABLED] DebugText: Set text to "Active=" & ActivePlayer & " | Shoot=" & IsShooting & " | Menu=" & int(IsWeaponMenuOpen) & " | Weapon=" & CurrentProjectileType & " | Saved=" & P1_SavedWeapon & " | AmmoCount=" & AmmosFamily.Count & " | Cluster=" & int(IsClusterActive) & " | MG=" & int(IsMachineGunActive) & " | BotState=" & BotState & " | Result=" & MatchResult & " | SwapPending=" & SwapPending & " | trail=" & trail.Count & " | Ammo=" & AmmosFamily.Count
-----> [DISABLED] DebugText: Set text to "Dist=" & round(distance(BotTank.X,BotTank.Y, PlayerTank.X,PlayerTank.Y)) & " Power=" & round(BotPowerTarget) & " Angle=" & round(botLocalAngle)
-----> [DISABLED] DebugText: Set text to "Count: " & FireParticle.Count & " | Timer: " & FireParticle.SpreadTimer & " | HasSpread: " & FireParticle.HasSpread & " | MaxR: " & FireParticle.MaxRadius
[[Красивая земля]]
| Local number x = 0
| Local number sy = 0
| Local number nt = 0
| Local number sx = 0
| Local number h = 0
| Local number bx = 0
| Local number by = 0
| Local number t1 = 0
| Local number b1 = 0
| Local number nl = 0
| Local number nr = 0
| Local number b2 = 0
| Local number t2 = 0
| Local number h2 = 0
| Local number solid = 0
| Local number crackLen = 0
| Local number crackAng = 0
| Local number scanStart = 0
| Local number segTop = 0
| Local number oldH = 0
| Local number found = 0
----* On function 'RenderTerrain'
----* Parameter 'FromX' (Number)
----* Parameter 'ToX' (Number)
-----> TerrainCanvas: Clear canvas rgba(0, 0, 0, 0)
// ═══ 1. ЗЕМЛЯ (столбцы по HeightMap) ═══
--------+ System: For "cx" from 0 to LayoutWidth
---------> System: Set x to LoopIndex("cx")
---------> System: Set t1 to HeightMap.At(x, 0)
---------> System: Set b1 to LayoutHeight
---------> System: Set t2 to -1
---------> System: Set b2 to -1
------------+ System: t1 ≠ -1
-------------> TerrainCanvas: Fill rectangle (x, t1) to (x + 1, b1) with ColGround1
----------------+ System: b1 > t1 + 120
-----------------> TerrainCanvas: Fill rectangle (x, t1 + 120) to (x + 1, b1) with ColGround2
----------------+ System: b1 > t1 + 350
-----------------> TerrainCanvas: Fill rectangle (x, t1 + 350) to (x + 1, b1) with ColGround3
------------+ System: t2 ≠ -1
-------------> TerrainCanvas: Fill rectangle (x, t2) to (x + 1, b2) with ColGround1
----------------+ System: b2 > t2 + 120
-----------------> TerrainCanvas: Fill rectangle (x, t2 + 120) to (x + 1, b2) with ColGround2
----------------+ System: b2 > t2 + 350
-----------------> TerrainCanvas: Fill rectangle (x, t2 + 350) to (x + 1, b2) with ColGround3
------------+ (no conditions)
-------------> TerrainCanvas: Draw line from (x, t2) to (x + 1, t2) with ColOutline, thickness 4, cap Butt
-------------> TerrainCanvas: Draw line from (x, b1) to (x + 1, b1) with ColOutline, thickness 3, cap Butt
// эллипсы на слоях земли
--------+ System: Repeat 160 times
---------> System: Set sx to abs((sin(LoopIndex × 12.9898) × 43758.5453) % 1) × LayoutWidth
---------> System: Set sy to HeightMap.At(floor(sx), 0) + 15 + abs((sin(LoopIndex × 78.233) × 43758.5453) % 1) × max(50, LayoutHeight - HeightMap.At(floor(sx), 0) - 20)
------------+ System: GroundTilemap.TileAt(floor(sx), floor(sy)) ≠ -1
------------+ System: GroundTilemap.TileAt(floor(sx - 14), floor(sy - 8)) ≠ -1
------------+ System: GroundTilemap.TileAt(floor(sx + 14), floor(sy - 8)) ≠ -1
------------+ System: GroundTilemap.TileAt(floor(sx - 14), floor(sy + 8)) ≠ -1
------------+ System: GroundTilemap.TileAt(floor(sx + 14), floor(sy + 8)) ≠ -1
-------------> TerrainCanvas: Fill ellipse at (sx, sy) radius (5 + abs((sin(LoopIndex × 39.425) × 43758.5453) % 1) × 8, 3 + abs((sin(LoopIndex × 93.711) × 43758.5453) % 1) × 5) with ColSpotLight (Smooth edge)
--------+ System: Repeat 120 times
---------> System: Set sx to abs((sin((LoopIndex + 1000) × 12.9898) × 43758.5453) % 1) × LayoutWidth
---------> System: Set sy to HeightMap.At(floor(sx), 0) + 15 + abs((sin((LoopIndex + 1000) × 78.233) × 43758.5453) % 1) × max(50, LayoutHeight - HeightMap.At(floor(sx), 0) - 20)
------------+ System: GroundTilemap.TileAt(floor(sx), floor(sy)) ≠ -1
------------+ System: GroundTilemap.TileAt(floor(sx - 11), floor(sy - 7)) ≠ -1
------------+ System: GroundTilemap.TileAt(floor(sx + 11), floor(sy - 7)) ≠ -1
------------+ System: GroundTilemap.TileAt(floor(sx - 11), floor(sy + 7)) ≠ -1
------------+ System: GroundTilemap.TileAt(floor(sx + 11), floor(sy + 7)) ≠ -1
-------------> TerrainCanvas: Fill ellipse at (sx, sy) radius (4 + abs((sin((LoopIndex + 1000) × 39.425) × 43758.5453) % 1) × 6, 2 + abs((sin((LoopIndex + 1000) × 93.711) × 43758.5453) % 1) × 4) with ColSpotDark (Smooth edge)
// ═══ 4. ТРАВИНКИ (зелёные палочки) ═══
--------+ System: Repeat 350 times
--------+ System: ThemeHasGrass = 1
---------> System: Set bx to abs((sin((LoopIndex + 900) × 12.9898) × 43758.5453) % 1) × LayoutWidth
---------> System: Set by to HeightMap.At(floor(bx), 0)
------------+ System: BurnMap.At(bx, 0) = 0
-------------> TerrainCanvas: Draw line from (bx, by + 1) to (bx + (abs((sin((LoopIndex + 900) × 78.233) × 43758.5453) % 1) - 0.5) × 10, by - 2 - abs((sin((LoopIndex + 900) × 39.425) × 43758.5453) % 1) × 8) with ColEdgeTop, thickness 0.5, cap Butt
// ═══ 3. ЗЕЛЁНАЯ ТРАВА-КРОМКА ═══
--------+ System: For "ex" from 0 to LayoutWidth
---------> System: Set x to LoopIndex("ex")
---------> System: Set h to HeightMap.At(x, 0)
---------> System: Set h2 to HeightMap.At(min(x + 1, LayoutWidth), 0)
------------+ System: BurnMap.At(x, 0) = 0
------------+ System: BurnMap.At(min(x + 1, LayoutWidth), 0) = 0
-------------> TerrainCanvas: Draw line from (x, h+4) to (x + 1, h2 + 4) with ColEdgeUnder, thickness EdgeUnderWidth, cap Butt
-------------> TerrainCanvas: Draw line from (x, h) to (x + 1, h2) with ColEdgeTop, thickness EdgeTopWidth, cap Butt
------------+ System: Else
-------------> TerrainCanvas: Draw line from (x, h+3) to (x + 1, h2 + 3) with ColBurnGround, thickness 6, cap Butt
-------------> TerrainCanvas: Draw line from (x, h) to (x + 1, h2) with ColBurnGlow, thickness 2, cap Butt
// ═══ 5. ГОРИЗОНТАЛЬНЫЕ ПОЛОСКИ С ОКРУГЛЫМИ КРАЯМИ ═══
--------+ [DISABLED] System: For "row" from 0 to 10
------------+ [DISABLED] System: For "slot" from 0 to floor(LayoutWidth ÷ 70) - 1
-------------> [DISABLED] System: Set bx to LoopIndex("slot") × 70 + 4 + abs((sin((LoopIndex("row") × 517 + LoopIndex("slot") × 131 + 300) × 39.425) × 43758.5453) % 1) × 6
-------------> [DISABLED] System: Set h to HeightMap.At(floor(bx), 0)
-------------> [DISABLED] System: Set h2 to HeightMap.At(min(floor(bx + 60), LayoutWidth), 0)
-------------> [DISABLED] System: Set by to max(h, h2) + 24 + LoopIndex("row") × 45
-------------> [DISABLED] System: Set solid to 0
----------------+ [DISABLED] System: by < LayoutHeight - 8
--------------------+ [DISABLED] System: 24 + LoopIndex("row") × 45 ≤ 113
--------------------+ [DISABLED] System: abs(h - h2) ≤ 113 - (24 + LoopIndex("row") × 45)
---------------------> [DISABLED] System: Set t1 to 112
---------------------> [DISABLED] System: Set b1 to 83
---------------------> [DISABLED] System: Set nt to 53
---------------------> [DISABLED] System: Set solid to 1
--------------------+ [DISABLED] System: 24 + LoopIndex("row") × 45 ≥ 127
--------------------+ [DISABLED] System: 24 + LoopIndex("row") × 45 ≤ 343
--------------------+ [DISABLED] System: abs(h - h2) ≤ 343 - (24 + LoopIndex("row") × 45)
---------------------> [DISABLED] System: Set t1 to 92
---------------------> [DISABLED] System: Set b1 to 64
---------------------> [DISABLED] System: Set nt to 41
---------------------> [DISABLED] System: Set solid to 1
--------------------+ [DISABLED] System: 24 + LoopIndex("row") × 45 ≥ 357
---------------------> [DISABLED] System: Set t1 to 78
---------------------> [DISABLED] System: Set b1 to 53
---------------------> [DISABLED] System: Set nt to 33
---------------------> [DISABLED] System: Set solid to 1
----------------+ [DISABLED] System: solid = 1
----------------+ [DISABLED] System: abs((sin((LoopIndex("row") × 517 + LoopIndex("slot") × 131 + 300) × 12.9898) × 43758.5453) % 1) ≥ 0.15
----------------+ [DISABLED] System: abs((sin((LoopIndex("row") × 517 + LoopIndex("slot") × 131 + 300) × 12.9898) × 43758.5453) % 1) < 0.55
-----------------> [DISABLED] System: Set crackLen to 12 + abs((sin((LoopIndex("row") × 517 + LoopIndex("slot") × 131 + 300) × 78.233) × 43758.5453) % 1) × 22
-----------------> [DISABLED] TerrainCanvas: Draw line from (bx, by) to (bx + crackLen, by) with rgb(t1, b1, nt), thickness 14, cap Butt
-----------------> [DISABLED] TerrainCanvas: Fill ellipse at (bx, by+0.5) radius (5, 7) with rgb(t1, b1, nt) (Smooth edge)
-----------------> [DISABLED] TerrainCanvas: Fill ellipse at (bx + crackLen, by+0.5) radius (5, 7) with rgb(t1, b1, nt) (Smooth edge)
----------------+ [DISABLED] System: solid = 1
----------------+ [DISABLED] System: abs((sin((LoopIndex("row") × 517 + LoopIndex("slot") × 131 + 300) × 12.9898) × 43758.5453) % 1) ≥ 0.55
----------------+ [DISABLED] System: abs((sin((LoopIndex("row") × 517 + LoopIndex("slot") × 131 + 300) × 12.9898) × 43758.5453) % 1) < 0.8
-----------------> [DISABLED] System: Set crackLen to 10 + abs((sin((LoopIndex("row") × 517 + LoopIndex("slot") × 131 + 300) × 78.233) × 43758.5453) % 1) × 12
-----------------> [DISABLED] TerrainCanvas: Draw line from (bx, by) to (bx + crackLen, by) with rgb(t1, b1, nt), thickness 14, cap Butt
-----------------> [DISABLED] TerrainCanvas: Fill ellipse at (bx, by+0.5) radius (5, 7) with rgb(t1, b1, nt) (Smooth edge)
-----------------> [DISABLED] TerrainCanvas: Fill ellipse at (bx + crackLen, by+0.5) radius (5, 7) with rgb(t1, b1, nt) (Smooth edge)
-----------------> [DISABLED] System: Set bx to bx + crackLen + 7
-----------------> [DISABLED] System: Set crackLen to 10 + abs((sin((LoopIndex("row") × 517 + LoopIndex("slot") × 131 + 300) × 93.989) × 43758.5453) % 1) × 12
-----------------> [DISABLED] TerrainCanvas: Draw line from (bx, by) to (bx + crackLen, by) with rgb(t1, b1, nt), thickness 14, cap Butt
-----------------> [DISABLED] TerrainCanvas: Fill ellipse at (bx, by+0.5) radius (5, 7) with rgb(t1, b1, nt) (Smooth edge)
-----------------> [DISABLED] TerrainCanvas: Fill ellipse at (bx + crackLen, by+0.5) radius (5, 7) with rgb(t1, b1, nt) (Smooth edge)
----------------+ [DISABLED] System: solid = 1
----------------+ [DISABLED] System: abs((sin((LoopIndex("row") × 517 + LoopIndex("slot") × 131 + 300) × 12.9898) × 43758.5453) % 1) ≥ 0.8
-----------------> [DISABLED] System: Set crackLen to 44 + abs((sin((LoopIndex("row") × 517 + LoopIndex("slot") × 131 + 300) × 78.233) × 43758.5453) % 1) × 16
-----------------> [DISABLED] TerrainCanvas: Draw line from (bx, by) to (bx + crackLen, by) with rgb(t1, b1, nt), thickness 14, cap Butt
-----------------> [DISABLED] TerrainCanvas: Fill ellipse at (bx, by+0.5) radius (5, 7) with rgb(t1, b1, nt) (Smooth edge)
-----------------> [DISABLED] TerrainCanvas: Fill ellipse at (bx + crackLen, by+0.5) radius (5, 7) with rgb(t1, b1, nt) (Smooth edge)
// ═══ СНЕЖНЫЕ СУГРОБЫ (зима) ═══
--------+ System: Repeat 140 times
--------+ System: WeatherID = 4
---------> System: Set bx to abs((sin((LoopIndex + 4200) × 12.9898) × 43758.5453) % 1) × LayoutWidth
---------> System: Set by to HeightMap.At(floor(bx), 0)
------------+ System: BurnMap.At(floor(bx), 0) = 0
-------------> TerrainCanvas: Fill ellipse at (bx, by + 2) radius (3 + abs((sin((LoopIndex + 4300) × 78.233) × 43758.5453) % 1) × 14, 3 + abs((sin((LoopIndex + 4400) × 39.425) × 43758.5453) % 1) × 4) with rgb(255, 255, 255) (Smooth edge)
-------------> TerrainCanvas: Fill ellipse at (bx + 3, by + 1) radius (3 + abs((sin((LoopIndex + 4500) × 93.711) × 43758.5453) % 1) × 7, 2 + abs((sin((LoopIndex + 4600) × 51.7) × 43758.5453) % 1) × 3) with rgb(255, 255, 255) (Smooth edge)
[[Процедурный ландшафт] ]
| Local number h = 0
| Local number noiseVal = 0
| Local number seed = 0
| Local number colP = 0
| Local number colB = 0
| Local number amp = 0
| Local number baseY = 0
| Local number bumpP = 0
| Local number bumpB = 0
| Local number featX1 = 0
| Local number featX2 = 0
| Local number featX3 = 0
| Local number featX4 = 0
| Local number featW1 = 0
| Local number featW2 = 0
| Local number featW3 = 0
| Local number featW4 = 0
| Local number featH1 = 0
| Local number featH2 = 0
| Local number featH3 = 0
| Local number featH4 = 0
| Local number heightDiff = 0
| Local number freq = 0
| Local number freq2 = 0
| Local number freq3 = 0
| Local number ampMul2 = 0
| Local number ampMul3 = 0
| Local number halfDist = 0
// Выше холмы
amp ↑ (500-700)
Больше холмов
freq ↑ (0.008-0.016)
Живее склоны
множители октав ↑ (0.6 / 0.3)
Площадки танков выше
bumpP/bumpB ↑
Глубже случайные ямы
featH1/featH2 ↑
----+ System: On start of layout
-----> GroundTilemap: Set visibility Invisible
-----> System: Set seed to random(0, 100000)
-----> AdvancedRandom: Update seed to str(seed)
-----> AdvancedRandom: Set octaves to int(random(2, 9))
-----> System: Set amp to random(60, 220)
-----> System: Set freq to random(0.008, 0.16)
-----> System: Set freq2 to random(0.002, 0.008)
-----> System: Set freq3 to random(0.008, 0.025)
-----> System: Set ampMul2 to random(0.5, 1.2)
-----> System: Set ampMul3 to random(0.15, 0.5)
-----> System: Set baseY to LayoutHeight × random(0.42, 0.68)
-----> System: Set halfDist to random(200, 420)
-----> System: Set colP to LayoutWidth ÷ 2 - halfDist
-----> System: Set colB to LayoutWidth ÷ 2 + halfDist
-----> System: Set heightDiff to choose(-1, 1) × random(30, 80)
-----> System: Set bumpP to clamp(random(20, 90) + heightDiff ÷ 2, -60, 120)
-----> System: Set bumpB to clamp(random(20, 90) + heightDiff ÷ 2, -60, 120)
-----> System: Set featX1 to random(colP + 150, colB - 150)
-----> System: Set featX2 to random(colP + 150, colB - 150)
-----> System: Set featX3 to random(colP + 100, colB - 100)
-----> System: Set featX4 to random(100, LayoutWidth - 100)
-----> System: Set featW1 to random(250, 400)
-----> System: Set featW2 to random(200, 320)
-----> System: Set featW3 to random(120, 350)
-----> System: Set featW4 to random(150, 400)
-----> System: Set featH1 to choose(-1, 1) × random(60, 130)
-----> System: Set featH2 to choose(-1, 1) × random(40, 90)
-----> System: Set featH3 to choose(-1, 1) × random(40, 160)
-----> System: Set featH4 to choose(-1, 1) × random(50, 180)
-----> HeightMap: Set size to (LayoutWidth + 1, 1, 1)
-----> BurnMap: Set size to (LayoutWidth + 1, 1, 1)
--------+ System: For "x" from 0 to LayoutWidth
---------> System: Set noiseVal to AdvancedRandom.Classic2d(LoopIndex("x") × freq, 0)
---------> System: Set h to baseY + (noiseVal - 0.5) × amp
---------> System: Set h to h + (AdvancedRandom.Classic2d(LoopIndex("x") × freq2, 0) - 0.5) × amp × ampMul2
---------> System: Set h to h + (AdvancedRandom.Classic2d(LoopIndex("x") × freq3 + 371, 0) - 0.5) × amp × ampMul3
---------> System: Set h to h - bumpP × max(0, 1 - (abs(LoopIndex("x") - colP) ÷ 140) ^ 2) ^ 2 - bumpB × max(0, 1 - (abs(LoopIndex("x") - colB) ÷ 140) ^ 2) ^ 2
---------> System: Set h to h - featH1 × max(0, 1 - (abs(LoopIndex("x") - featX1) ÷ featW1) ^ 2) ^ 2 - featH2 × max(0, 1 - (abs(LoopIndex("x") - featX2) ÷ featW2) ^ 2) ^ 2
---------> System: Set h to h - featH3 × max(0, 1 - (abs(LoopIndex("x") - featX3) ÷ featW3) ^ 2) ^ 2
---------> System: Set h to h - featH4 × max(0, 1 - (abs(LoopIndex("x") - featX4) ÷ featW4) ^ 2) ^ 2
---------> System: Set h to clamp(h, LayoutHeight × 0.4, LayoutHeight × 0.72)
---------> HeightMap: Set value at (LoopIndex("x"), 0) to h
------------+ System: h < 250
-------------> System: Set h to 250 + (h - 250) × 0.25
------------+ System: h < LayoutHeight - 150
-------------> System: Set h to (LayoutHeight - 150) + (h - (LayoutHeight - 150)) × 0.25
--------+ System: Repeat 2 times
------------+ System: For "x" from 1 to LayoutWidth - 1
-------------> System: Set h to (HeightMap.At(LoopIndex("x") - 1, 0) + HeightMap.At(LoopIndex("x"), 0) × 2 + HeightMap.At(LoopIndex("x") + 1, 0)) ÷ 4
-------------> HeightMap: Set value at (LoopIndex("x"), 0) to h
--------+ System: For "x" from 0 to LayoutWidth
---------> GroundTilemap: Set tiles at (LoopIndex("x"), floor(HeightMap.At(LoopIndex("x"), 0))) with area 1 x (LayoutHeight - floor(HeightMap.At(LoopIndex("x"), 0))) to tile 0 (normal)
----+ System: On start of layout
-----> PlayerTank: Set position to (colP, HeightMap.At(colP, 0) - 25)
-----> BotTank: Set position to (colB, HeightMap.At(colB, 0) - 25)
-----> Functions: Call RenderTerrain (FromX: 0, ToX: LayoutWidth)
[обнуление]
----+ System: On start of layout
-----> HPBars: Set maxWidth to Self.Width
-----> playerHP: Set Owner to "Player1"
-----> botHP: Set Owner to "Player2"
-----> PlayerTank: Set Owner to "Player1"
-----> BotTank: Set Owner to "Player2"
-----> Joy: Set StartX to Self.X
-----> botFuelBar: Set Owner to "Player2"
-----> playerFuelBar: Set Owner to "Player1"
-----> PlayerTank: Set maxHP to 100 + (CurrentTankID × 10) + ((TankStats.At(CurrentTankID, 0) - 1) × 6)
-----> PlayerTank: Set HP to PlayerTank.MaxHP
-----> BotTank: Set maxHP to 100 + (CurrentTankID × 10) + ((TankStats.At(CurrentTankID, 0) - 1) × 4)
-----> BotTank: Set HP to BotTank.MaxHP
-----> PlayerTank: Set MaxFuel to 10.0 + (CurrentTankID × 0.2) + ((TankStats.At(CurrentTankID, 1) - 1) × 0.2)
-----> PlayerTank: Set Fuel to PlayerTank.MaxFuel
-----> BotTank: Set MaxFuel to 1.0 + (CurrentTankID × 0.2) + ((TankStats.At(CurrentTankID, 1) - 1) × 0.1)
-----> BotTank: Set Fuel to BotTank.MaxFuel
-----> System: Set TurnsCount to 0
-----> System: Set IsShooting to 0
-----> System: Set ActivePlayer to "Player1"
-----> System: Set BotDidHit to False
-----> System: Set BotGotHit to False
-----> System: Set time scale to 1.0
-----> System: Set scroll X to (PlayerTank.X + BotTank.X) ÷ 2
-----> System: Set scroll Y to (PlayerTank.Y + BotTank.Y) ÷ 2
-----> System: Set MatchTime to 0
-----> System: Set ManualZoom to 1
-----> System: Set TargetManualZoom to 1
-----> System: Set IsPinching to False
-----> System: Set CurrentProjectileType to 0
-----> System: Set BotWeapon1 to 0
-----> System: Set BotWeapon2 to 0
-----> System: Set BotWeapon3 to 0
-----> System: Set BotWeapon4 to 0
-----> System: Set P1_SavedWeapon to CurrentProjectileType
-----> WeaponMainButton: Set animation speed to 0
-----> WeaponMainButton: Set animation frame to CurrentProjectileType
-----> System: Set MatchResult to ""
-----> System: Set LastUiClickTime to -10
-----> System: Set SwapPending to 0
-----> PlayerTank: Set isGrounded to 1
-----> PlayerTank: Set VelX to 0
-----> PlayerTank: Set VelY to 0
-----> PlayerTank: Set Not mirrored
-----> System: Set Surrendered to 0
[[[Умная Камера (Smart Camera)]]]
----+ System: On start of layout
----// // <-- ИЗМЕНИЛИ 9 НА 0
-----> System: Set CamState to 0
----// <-- ИЗМЕНИЛИ 1 НА ОБЗОР ТАНКОВ ПЕРЕД БОЕМ
-----> System: Set IsShooting to 0
-----> System: Set IntroTimer to 0
-----> System: Set ManualZoom to 1
-----> System: Set TargetManualZoom to 1
-----> [DISABLED] System: Scroll to (BotTank.X, BotTank.Y)
-----> System: Set layout scale to max(1.4, (WindowWidth ÷ LayoutWidth) × 1.1)
-----> System: Set MinZoom to max(1, (WindowWidth ÷ LayoutWidth) × 1.1)
// ═══ ГЛАВНЫЙ ДРАЙВЕР: скролл+зум+тряска (КАЖДЫЙ ТИК, БЕЗ TOUCH!) ═══
----+ System: Every tick
-----> System: Scroll to (clamp(lerp(ScrollX, CamTargetX, CamSpeed × dt), ViewportWidth("Game") ÷ (2 × LayoutScale), LayoutWidth - ViewportWidth("Game") ÷ (2 × LayoutScale)) + random(-ShakePower, ShakePower), clamp(lerp(ScrollY, CamTargetY, CamSpeed × dt), ViewportHeight("Game") ÷ (2 × LayoutScale), LayoutHeight - ViewportHeight("Game") ÷ (2 × LayoutScale)) + random(-ShakePower, ShakePower))
-----> System: Set layout scale to lerp(LayoutScale, CamTargetZoom, 1.8 × dt)
-----> System: Set ShakePower to lerp(ShakePower, 0, 0.15)
----+ System: Every tick
----+ System: CamState = 9
-----> System: Add dt to IntroTimer
-----> System: Set CamTargetX to (PlayerTank.X + BotTank.X) ÷ 2
-----> System: Set CamTargetY to (PlayerTank.Y + BotTank.Y) ÷ 2
-----> System: Set CamSpeed to 5
-----> System: Set CamTargetZoom to clamp((ViewportWidth("Game") ÷ max(260, distance(PlayerTank.X, PlayerTank.Y, BotTank.X, BotTank.Y) + 90)) × ManualZoom, MinZoom, MaxZoom)
--------+ System: IntroTimer ≥ 1.0
---------> System: Set IntroTimer to 0
---------> System: Set CamState to 7
// ═══ ИНТРО 1: показываем БОТА ═══
----+ System: Every tick
----+ System: CamState = 7
-----> System: Add dt to IntroTimer
-----> System: Set CamTargetX to BotTank.X
-----> System: Set CamTargetY to BotTank.Y
-----> System: Set CamTargetZoom to 1.6
-----> System: Set CamSpeed to 4
--------+ System: IntroTimer ≥ 1.2
---------> System: Set IntroTimer to 0
---------> System: Set CamState to 8
// ═══ ИНТРО 2: показываем ИГРОКА ═══
----+ System: Every tick
----+ System: CamState = 8
-----> System: Add dt to IntroTimer
-----> System: Set CamTargetX to PlayerTank.X
-----> System: Set CamTargetY to PlayerTank.Y
-----> System: Set CamTargetZoom to 1.6
-----> System: Set CamSpeed to 8
--------+ System: IntroTimer ≥ 1.2
---------> System: Set CamState to 0
---------> System: Set IsShooting to 0
// ═══ ДУЭЛЬ: ход игрока ═══
----+ System: Every tick
----+ System: CamState = 0
-----> System: Set CamTargetX to (PlayerTank.X + BotTank.X) ÷ 2
-----> System: Set CamTargetY to (PlayerTank.Y + BotTank.Y) ÷ 2
-----> System: Set CamSpeed to 3
-----> [DISABLED] System: Set CamTargetZoom to clamp(min(1.2, ViewportWidth("Game") ÷ (distance(PlayerTank.X, PlayerTank.Y, BotTank.X, BotTank.Y) + 250)) × ManualZoom, MinZoom, MaxZoom)
-----> [DISABLED] System: Set CamTargetZoom to clamp((ViewportWidth("Game") ÷ max(260, distance(PlayerTank.X, PlayerTank.Y, BotTank.X, BotTank.Y) + 90)) × ManualZoom, MinZoom, MaxZoom)
-----> System: Set CamTargetZoom to clamp(min(1.4, ViewportWidth("Game") ÷ max(260, distance(PlayerTank.X, PlayerTank.Y, BotTank.X, BotTank.Y) + 100)) × ManualZoom, MinZoom, MaxZoom)
// ═══ ДУЭЛЬ: ход бота (ВМЕСТО OR — просто копия события) ═══
----+ System: Every tick
----+ System: CamState = 3
-----> System: Set CamTargetX to (PlayerTank.X + BotTank.X) ÷ 2
-----> System: Set CamTargetY to (PlayerTank.Y + BotTank.Y) ÷ 2
-----> System: Set CamSpeed to 3
-----> [DISABLED] System: Set CamTargetZoom to clamp(min(1.2, ViewportWidth("Game") ÷ (distance(PlayerTank.X, PlayerTank.Y, BotTank.X, BotTank.Y) + 250)) × ManualZoom, MinZoom, MaxZoom)
-----> [DISABLED] System: Set CamTargetZoom to clamp((ViewportWidth("Game") ÷ max(260, distance(PlayerTank.X, PlayerTank.Y, BotTank.X, BotTank.Y) + 90)) × ManualZoom, MinZoom, MaxZoom)
-----> System: Set CamTargetZoom to clamp(min(1.4, ViewportWidth("Game") ÷ max(260, distance(PlayerTank.X, PlayerTank.Y, BotTank.X, BotTank.Y) + 100)) × ManualZoom, MinZoom, MaxZoom)
----+ [DISABLED] System: Every tick
----+ [DISABLED] Touch: [X] Is in touch
----+ [DISABLED] Touch: Is touching Joy
----+ [DISABLED] Touch: [X] Is touching JoyAim
----+ [DISABLED] Touch: [X] Is touching BtnFire
----+ [DISABLED] Touch: [X] Is touching BtnAimSwitch
----+ [DISABLED] Touch: [X] Is touching WeaponMainButton
----+ [DISABLED] Touch: [X] Is touching WeaponPanel
----+ [DISABLED] Touch: [X] Is touching WeaponIcon
----+ [DISABLED] System: CamState = 0
----+ [DISABLED] System: ActivePlayer = "Player1"
-----> [DISABLED] System: Set CamTargetY to PlayerTank.Y
-----> [DISABLED] System: Set CamSpeed to 4
-----> [DISABLED] System: Set CamTargetZoom to clamp((ViewportWidth("Game") ÷ max(260, distance(PlayerTank.X, PlayerTank.Y, BotTank.X, BotTank.Y) + 90)) × ManualZoom, MinZoom, MaxZoom)
// ═══ Полёт снаряда ═══
----+ System: Every tick
----+ System: CamState = 1
----+ System: ammosFamily.Count > 0
-----> System: Set CamSpeed to 2
-----> System: Set CamTargetX to ammosFamily.X
-----> System: Set CamTargetY to ammosFamily.Y
-----> System: Set CamTargetZoom to 1.4
// ═══ После удара ═══
----+ System: Every tick
----+ System: CamState = 2
--------+ System: Trigger once
---------> System: Wait 1.0 seconds (use time scale: True)
------------+ Players: isDestroyed = 0
------------+ BotTank: isDestroyed = 0
-------------> System: Set CamSpeed to 3
-------------> System: Set CamTargetX to (PlayerTank.X + BotTank.X) ÷ 2
-------------> System: Set CamTargetY to (PlayerTank.Y + BotTank.Y) ÷ 2
-------------> System: Set CamTargetZoom to clamp(clamp(ViewportWidth("Game") ÷ (distance(PlayerTank.X, PlayerTank.Y, BotTank.X, BotTank.Y) + 200), 1, 1.2) × ManualZoom, MinZoom, MaxZoom)
// ═══ Огонь, портал, аирдроп, маяк — без изменений ═══
----+ System: Every tick
----+ Players: Is overlapping FireZone
----+ System: CamState ≠ 1
-----> System: Set CamTargetX to Players.X
-----> System: Set CamTargetY to Players.Y
-----> System: Set CamTargetZoom to 1.4
-----> System: Set CamSpeed to 3
----+ System: Every tick
----+ System: Portal.Count > 0
----+ System: CamState ≠ 5
-----> System: Set CamTargetX to Portal.X
-----> System: Set CamTargetY to Portal.Y
-----> System: Set CamTargetZoom to 1.5
-----> System: Set CamSpeed to 10
----+ System: Every tick
----+ System: AirDrop.Count > 0
----+ AirDrop: DropState = 0
----+ System: CamState ≠ 5
-----> System: Set CamTargetX to AirDrop.X
-----> System: Set CamTargetY to AirDrop.Y
-----> System: Set CamTargetZoom to 1.5
-----> System: Set CamSpeed to 5
----+ System: Every tick
----+ System: CamState = 5
-----> System: Set CamSpeed to 5
[SwapPlayer]
----* On function 'SwapPlayer'
----+ System: wallclocktime > LastSwapTime + 0.15
-----> System: Set LastSwapTime to wallclocktime
-----> System: Set SwapPending to 1
-----> Players: Set Fuel to Players.MaxFuel
-----> System: Set IsShooting to 1
-----> System: Set IsClusterActive to False
-----> System: Set IsMachineGunActive to False
-----> System: Set IsFountainActive to False
-----> System: Set IsBoomerangActive to False
-----> System: Set IsTripleBurstActive to False
-----> System: Set BotTimer to 0
-----> System: Set ShotTimer to 0
-----> Joy: Set X to Joy.StartX
-----> Joy: Set VectorJoy to 0
-----> Joy: Set Перетаскивание Disabled
-----> PlayerTank: Set VelX to 0
-----> BotTank: Set VelX to 0
-----> [DISABLED] System: Set Power to 0
-----> System: Set Charging to False
-----> System: Wait 1.5 seconds (use time scale: True)
-----> System: Set IsShooting to 0
-----> System: Set CamState to 0
-----> System: Add 1 to TurnsCount
--------+ System: ActivePlayer = "Player2"
--------+ System: [X] Is BotDidHit
---------> System: Set EmotionID to 2
---------> Functions: Call ShowBotEmotion
--------+ System: ActivePlayer = "Player1"
---------> System: Set P1_SavedPower to Power
---------> System: Set ActivePlayer to "Player2"
---------> System: Set CamState to 3
---------> System: Set BotPowerTarget to clamp( 35 + DistX × 0.12 + random(-BotPowerError,BotPowerError), 30, 100 )
---------> System: Set BotState to 5
---------> System: Set SwapPending to 0
---------> System: Set LastShotError to LastShotError × 0.5
---------> System: Set EmotionID to 0
---------> Functions: Call ShowBotEmotion
------------+ System: For each ShieldDome
------------+ ShieldDome: TargetUID = BotTank.UID
-------------> ShieldDome: Subtract 1 from ShieldTurns
----------------+ ShieldDome: ShieldTurns ≤ 0
-----------------> System: Create object Shockwave on layer "Game" at (ShieldDome.X, ShieldDome.Y), create hierarchy: False, template: ""
-----------------> Shockwave: Set width to 40
-----------------> Shockwave: Set height to 40
-----------------> ShieldDome: Fade: set fade-in time to 0
-----------------> ShieldDome: Fade: set wait time to 0
-----------------> ShieldDome: Fade: set fade-out time to 0.3
-----------------> ShieldDome: Fade: restart fade
--------+ System: Else
---------> System: Set ActivePlayer to "Player1"
---------> System: Set BotState to 0
---------> System: Set Power to P1_SavedPower
---------> System: Set CurrentProjectileType to P1_SavedWeapon
---------> System: Set SwapPending to 0
------------+ System: For each ShieldDome
------------+ ShieldDome: TargetUID = PlayerTank.UID
-------------> ShieldDome: Subtract 1 from ShieldTurns
----------------+ ShieldDome: ShieldTurns ≤ 0
-----------------> System: Create object Shockwave on layer "Game" at (ShieldDome.X, ShieldDome.Y), create hierarchy: False, template: ""
-----------------> Shockwave: Set width to 40
-----------------> Shockwave: Set height to 40
-----------------> ShieldDome: Fade: set fade-in time to 0
-----------------> ShieldDome: Fade: set wait time to 0
-----------------> ShieldDome: Fade: set fade-out time to 0.3
-----------------> ShieldDome: Fade: restart fade
--------+ System: For each Players
--------+ Players: Owner = ActivePlayer
------------+ Players: Is IsFrozen
-------------> Players: Set IsFrozen to False
-------------> System: Set IsShooting to 1
-------------> System: Set BotState to 0
-------------> System: Set SwapPending to 1
-------------> System: Create object DamageText on layer "Game" at (Players.X, Players.Y - 60), create hierarchy: False, template: ""
------------// ПРОПУСК ХОДА!
-------------> DamageText: Set text to ArrayLang.At(Lang, 25)
-------------> DamageText: Set font color to rgbEx(0, 50, 105)
-------------> DamageText: Fade: set wait time to 1.5
-------------> DamageText: Fade: set fade-out time to 1
-------------> DamageText: Set Bullet gravity to 0
-------------> DamageText: Set Bullet speed to 50
-------------> DamageText: Set Rotate Disabled
-------------> DamageText: Set Bullet angle of motion to 270 degrees
-------------> System: Wait 1.5 seconds (use time scale: True)
-------------> Functions: Call SwapPlayer
------------+ System: Else
-------------> System: Set CamState to 0
-------------> System: Set IsShooting to 1
----------------+ System: For each IceBlock
----------------+ IceBlock: TargetUID = Players.UID
-----------------> IceBlock: Destroy
-----------------> System: Create object explosion on layer "Game" at (Players.X, Players.Y), create hierarchy: False, template: ""
-----------------> explosion: Set animation to "ice_boom" (play from beginning)
-----------------> System: Wait 0.8 seconds (use time scale: True)
----------------+ (no conditions)
-----------------> System: Set IsShooting to 0
| Local number DropType = 0
--------------------+ System: TurnsCount ≥ 6
---------------------> System: Set TurnsCount to 0
---------------------> System: Set DropType to choose(1, 2)
------------------------+ System: DropType = 1
-------------------------> System: Set IsShooting to 1
-------------------------> System: Set BotState to 0
-------------------------> System: Create object AirDrop on layer "Game" at (random(100, LayoutWidth - 100), -50), create hierarchy: False, template: ""
-------------------------> AirDrop: Set Platform max fall speed to 500
-------------------------> AirDrop: Set Platform gravity to 100
-------------------------> AirDrop: Spawn Parachute on layer "Game" (image point 0, create hierarchy: False, template: "")
-------------------------> Parachute: Pin Pin to AirDrop (image point 0, angle: True, width: No, height: No, Z: False)
-------------------------> AirDrop: Set DropState to 0
------------------------+ System: DropType = 2
-------------------------> System: Set IsShooting to 1
-------------------------> System: Set BotState to 0
-------------------------> System: Create object Portal on layer "Game" at (random(100, LayoutWidth - 100), random(50, 150)), create hierarchy: False, template: ""
-------------------------> Portal: Set animation to "open" (play from beginning)
-------------------------> Audio: Play portal-otkryivaetsya.webm not looping at volume -20 dB (stereo pan 0, tag "")
-------------------------> Portal: Move to top of layer
----------------+ (no conditions)
-----------------> System: Set BotDidHit to False
-----------------> System: Set BotGotHit to False
[Blast]
----+ System: On start of layout
-----> Debris: Destroy
| Local number dy = 0
| Local number dx = 0
| Local number craterBottom = 0
| Local number w = 0
| Local number rim = 0
| Local number adx = 0
| Local number h = 0
| Local number bx = 0
| Local number toX = 0
| Local number fromX = 0
| Local number dig = 0
| Local number open = 0
| Local number shielded = 0
----* On function 'Blast'
----* Parameter 'x' (Number)
----* Parameter 'y' (Number)
----* Parameter 'Radius' (Number)
-----> System: Set shielded to 0
--------+ System: For each ShieldDome
--------+ System: distance(ShieldDome.X, ShieldDome.Y, x, y) < ShieldDome.ShieldRadius+20
---------> System: Set shielded to 1
--------+ System: shielded = 0
---------> System: Set fromX to max(0, floor(x - Radius))
---------> System: Set toX to min(LayoutWidth, ceil(x + Radius))
// ═══ ФАЗА 1: Опускаем столбцы по кругу ═══
--------+ System: For "bx" from fromX to toX
---------> System: Set dx to LoopIndex("bx") - x
---------> System: Set adx to abs(dx)
---------> System: Set dy to √(max(0, Radius × Radius - dx × dx))
---------> System: Set h to HeightMap.At(LoopIndex("bx"), 0)
---------> System: Set dig to (y + dy) - h
------------+ System: dig > 0
-------------> System: Set rim to max(12, Radius × 0.5)
-------------> System: Set w to clamp((Radius - adx) ÷ rim, 0, 1)
-------------> System: Set w to w × w × (3 - 2 × w)
-------------> HeightMap: Set value at (LoopIndex("bx"), 0) to h + dig × w
-------------> BurnMap: Set value at (LoopIndex("bx"), 0) to 0
// ═══ ФАЗА 1.5: СГЛАЖИВАНИЕ КРАЁВ (3 прохода) ═══
--------+ System: Repeat 5 times
--------+ System: For "bx" from fromX + 1 to toX - 1
---------> System: Set h to (HeightMap.At(LoopIndex("bx") - 1, 0) + HeightMap.At(LoopIndex("bx"), 0) + HeightMap.At(LoopIndex("bx") + 1, 0)) ÷ 3
---------> HeightMap: Set value at (LoopIndex("bx"), 0) to h
// ═══ ФАЗА 2: Перестраиваем тайлы ═══
--------+ System: For "bx" from fromX to toX
---------> System: Set h to floor(HeightMap.At(LoopIndex("bx"), 0))
---------> GroundTilemap: Erase tile range (LoopIndex("bx"), 0) area 1 x ceil(LayoutHeight ÷ GroundTilemap.TileHeight)
---------> GroundTilemap: Set tiles at (LoopIndex("bx"), h) with area 1 x (LayoutHeight - h) to tile 0 (normal)
---------> System: Set ShakePower to Radius
// ═══ ФАЗА 3: Эффекты ═══
--------+ System: Repeat floor(Radius × 0.8) times
---------> System: Create object Debris on layer "Game" at (X, Y), create hierarchy: False, template: ""
---------> Debris: Set Bullet speed to random(50, 200)
---------> Debris: Set Bullet angle of motion to random(240, 300) degrees
---------> Debris: Set scale to random(0.2, 1.0)
// ═══ ФАЗА 4: Мины ═══
--------+ System: For each LandMine
--------+ System: distance(LandMine.X, LandMine.Y, x, y) ≤ Radius + 30
--------+ LandMine: IsDetonated = 0
---------> LandMine: Set IsDetonated to 1
---------> Functions: Call ExplodeMine (UID: LandMine.UID)
------------+ System: For each Players
------------+ System: distance(LandMine.X, LandMine.Y, Players.X, Players.Y) ≤ 40
-------------> Players: Subtract 50 from HP
-------------> Players: Set HP to max(0, Players.HP)
// ═══ ФАЗА 4.5: ВЗРЫВ БОЧЕК ═══
--------+ System: For each BarrelSprite
--------+ System: distance(BarrelSprite.X, BarrelSprite.Y, x, y) ≤ Radius + 30
--------+ BarrelSprite: IsExploding = 0
---------> Functions: Call ExplodeBarrel (BarrelUID: BarrelSprite.UID)
// [Проверка падения бочек]
--------+ System: Every tick
--------+ System: For each BarrelSprite
--------+ BarrelSprite: IsExploding = 0
------------+ System: HeightMap.At(clamp(floor(BarrelSprite.X), 0, LayoutWidth), 0) > BarrelSprite.Y + 15
-------------> Functions: Call ExplodeBarrel (BarrelUID: BarrelSprite.UID)
// [Снаряд попадает в бочку]
--------+ AmmosFamily: Is overlapping BarrelSprite
--------+ BarrelSprite: IsExploding = 0
---------> Functions: Call ExplodeBarrel (BarrelUID: BarrelSprite.UID)
---------> Functions: Call Blast (x: BarrelSprite.X, y: BarrelSprite.Y, Radius: 15)
---------> AmmosFamily: Destroy
// ═══ ФАЗА 5: Рендер ═══
--------+ (no conditions)
---------> Functions: Call RenderTerrain (FromX: 0, ToX: LayoutWidth)
// ═══ ФАЗА 6: СПЛЭШ-УРОН (Осколочный урон от взрыва рядом) ═══
--------+ System: For each Players
--------+ Players: isDestroyed = 0
--------+ System: distance(Players.X, Players.Y, x, y) ≤ Radius + 15
--------+ System: distance(Players.X, Players.Y, x, y) > 12
--------+ System: Players.UID ≠ BlastExcludeUID
---------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: ceil(Radius × 0.3), HeavyHit: 0)
---------> Players: Set VelY to -(Radius × 2)
------------+ System: Players.X < x
-------------> Players: Set VelX to -(Radius × 1.5)
------------+ System: Else
-------------> Players: Set VelX to Radius × 1.5
--------+ (no conditions)
---------> System: Set BlastExcludeUID to 0
----* On function 'ExplodeMine'
----* Parameter 'UID' (Number)
| Local number my = 0
| Local number mx = 0
--------+ LandMine: Pick instance with UID UID
---------> System: Wait 0.08 seconds (use time scale: True)
---------> System: Create object explosion on layer "Game" at (LandMine.X, LandMine.Y), create hierarchy: False, template: ""
---------> explosion: Set animation to "boom" (play from beginning)
---------> Functions: Call Blast (x: LandMine.X, y: LandMine.Y, Radius: 30)
---------> LandMine: Destroy
[player spawn]
----+ System: On start of layout
-----> barrel: Destroy
-----> PlayerTank: Spawn PlayerBarrel on layer "Game" (image point 0, create hierarchy: False, template: "")
-----> PlayerBarrel: Set scale to 0.025
-----> PlayerBarrel: Pin Pin to PlayerTank (image point 1, angle: False, width: No, height: No, Z: False)
-----> BotTank: Spawn BotBarrel on layer "Game" (image point 0, create hierarchy: False, template: "")
-----> System: Set botLocalAngle to BotBarrel.Angle
-----> BotBarrel: Pin Pin to BotTank (image point 1, angle: False, width: No, height: No, Z: False)
-----> BotBarrel: Set scale to 0.025
-----> System: Set localAngle to PlayerBarrel.Angle
-----> System: Set targetAngle to PlayerBarrel.Angle
-----> System: Set botTargetAngle to BotBarrel.Angle
-----> PlayerTank: Set animation to "Tank" & CurrentTankID (play from beginning)
-----> PlayerBarrel: Set animation to "Barrel" & CurrentTankID (play from beginning)
----+ System: Every tick
----+ System: ActivePlayer = "Player1"
----+ System: [X] Is IsAimingTouch
----+ JoyAim: [X] Перетаскивание is dragging
----+ Touch: [X] Is in touch
----+ System: [X] Is IsAimingJoy
--------+ System: Mouse.X < PlayerTank.X
---------> System: Set FacingDirection to -1
---------> PlayerTank: Set Mirrored
--------+ System: Mouse.X > PlayerTank.X
---------> System: Set FacingDirection to 1
---------> PlayerTank: Set Not mirrored
--------+ (no conditions)
---------> System: Set targetAngle to angle(PlayerBarrel.X, PlayerBarrel.Y, Mouse.X, Mouse.Y)
------------+ System: FacingDirection = 1
-------------> System: Set aimDiff to ((targetAngle - PlayerTank.Angle + 560) % 360) - 200
-------------> System: Set aimDiff to clamp(aimDiff, -180, 5)
-------------> System: Set targetAngle to PlayerTank.Angle + aimDiff
------------+ System: FacingDirection = -1
-------------> System: Set aimDiff to ((targetAngle - (PlayerTank.Angle - 180) + 450) % 360) - 90
-------------> System: Set aimDiff to clamp(aimDiff, -5, 180)
-------------> System: Set targetAngle to (PlayerTank.Angle + 180) + aimDiff
--------+ (no conditions)
---------> System: Set localAngle to anglelerp(localAngle, targetAngle, 10 × dt)
---------> System: Set recoilAmount to lerp(recoilAmount, 0, 0.05)
---------> PlayerBarrel: Set angle to localAngle - recoilAmount degrees
---------> PlayerTank: Set X to Self.X - cos(Self.Angle) × slideRecoil
---------> PlayerTank: Set Y to Self.Y - sin(Self.Angle) × slideRecoil
---------> System: Set slideRecoil to lerp(slideRecoil, 0, 0.1)
---------> System: Set Power to clamp(distance(PlayerBarrel.X, PlayerBarrel.Y, Mouse.X, Mouse.Y) × 0.3, 0, MaxPower)
------------+ System: abs(recoilAmount) < 0.1
-------------> System: Set recoilAmount to 0
-------------> System: Set isRecoiling to False
----+ [DISABLED] System: Every tick
----+ [DISABLED] System: ActivePlayer = "Player2"
----+ [DISABLED] System: BotState ≥ 3
----+ [DISABLED] BotTank: isDestroyed = 0
----+ [DISABLED] PlayerTank: isDestroyed = 0
-----> [DISABLED] System: Set botTargetAngle to angle(BotBarrel.X, BotBarrel.Y, PlayerTank.X, PlayerTank.Y - 20) + BotAimOffset
-----> [DISABLED] System: Set botAimDiff to ((botTargetAngle - (BotTank.Angle + 180) + 540) % 360) - 180
-----> [DISABLED] System: Set botAimDiff to clamp(botAimDiff, -5, 90)
-----> [DISABLED] System: Set botTargetAngle to angle( BotBarrel.X, BotBarrel.Y, PlayerTank.X, PlayerTank.Y - clamp(DistX × 0.45, 50, 250) ) + BotAimOffset
-----> [DISABLED] System: Set botLocalAngle to anglelerp(botLocalAngle, botTargetAngle, BotAimSpeed)
-----> [DISABLED] System: Set recoilAmount to lerp(recoilAmount, 0, 0.05)
-----> [DISABLED] BotBarrel: Set angle to botLocalAngle + 180 + recoilAmount degrees
-----> [DISABLED] BotTank: Set X to Self.X - cos(Self.Angle+ 180) × slideRecoil
-----> [DISABLED] BotTank: Set Y to Self.Y - sin(Self.Angle+ 180) × slideRecoil
-----> [DISABLED] System: Set slideRecoil to lerp(slideRecoil, 0, 0.1)
-----> [DISABLED] System: Set DistX to abs(PlayerTank.X - BotTank.X)
--------+ [DISABLED] System: abs(recoilAmount) < 0.1
---------> [DISABLED] System: Set recoilAmount to 0
---------> [DISABLED] System: Set isRecoiling to False
[Стрельба , Виды Снарядов ]
----+ System: On start of layout
-----> AmmosFamily: Destroy
-----> BoomerangProjectile: Destroy
----[Стреляем ЛЕВЫМ КЛИКОМ (одиночное нажатие)]
--------+ Touch: On any touch start
--------+ System: IsShooting = 0
--------+ System: ActivePlayer = "Player1"
--------+ System: [X] Is IsWeaponMenuOpen
--------+ System: wallclocktime > LastUiClickTime + 0.2
--------+ Touch: [X] Is touching WeaponPanel
--------+ Touch: [X] Is touching WeaponMainButton
--------+ Touch: [X] Is touching WeaponIcon
--------+ Touch: [X] Is touching Joy
--------+ Touch: [X] Is touching JoyAim
--------+ Touch: [X] Is touching BtnFire
--------+ Touch: [X] Is touching BtnAimSwitch
--------+ Touch: [X] Is touching BtnSelfDestruct
--------+ Touch: [X] Is touching BtnSettings
--------+ Touch: [X] Is touching SettingsPanel
--------+ System: IsSettingsOpen = 0
--------+ Touch: [X] Is touching DockBG
--------+ Touch: [X] Is touching BtnDockExpand
--------+ Mouse: [X] Right button is down
---------> Functions: Call FireWeapon
---------> System: Set IsAimingJoy to False
----[[Управление с Мобилки (Свайп-Рогатка)]]
// [Кнопка Огонь Touch]
--------+ Touch: On any touch start
--------+ System: distance(Touch.X, Touch.Y, BtnFire.X, BtnFire.Y) < max(BtnFire.Width, BtnFire.Height) ÷ 2 + 40
--------+ System: IsShooting = 0
--------+ System: ActivePlayer = "Player1"
--------+ System: [X] Is IsWeaponMenuOpen
--------+ Touch: [X] Is touching WeaponMainButton
--------+ Touch: [X] Is touching WeaponPanel
--------+ Touch: [X] Is touching DockBG
--------+ Touch: [X] Is touching BtnDockExpand
--------+ System: wallclocktime > LastUiClickTime + 0.2
---------> System: Set LastUiClickTime to wallclocktime
---------> Functions: Call FireWeapon
----[[Отрисовка пунктирной линии]]
| Local number startSpeed = 0
| Local number tStep = 0.08
| Local number vX = 0
| Local number vY = 0
| Local number pX = 0
| Local number pY = 0
| Local number currentGravity = 0
| Local number dotTime = 0
| Local number dotIndex = 0
--------+ System: Every tick
---------> TrajectoryDot: Destroy
--------+ System: Every tick
--------+ System: IsShooting = 0
--------+ System: ActivePlayer = "Player1"
--------+ System: Power > 0
---------> TrajectoryDot: Destroy
---------> System: Set startSpeed to 7 + (Power × 3)
---------> System: Set currentGravity to 100
---------> System: Set TrajOffset to (TrajOffset + 1.5 × dt) % 1
------------+ System: CurrentProjectileType = 0
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 1
-------------> System: Set startSpeed to 6 + (Power × 2.5)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 2
-------------> System: Set startSpeed to 6 + (Power × 3)
-------------> System: Set currentGravity to 110
------------+ System: CurrentProjectileType = 3
-------------> System: Set startSpeed to 6 + (Power × 3.3)
-------------> System: Set currentGravity to 150
------------+ System: CurrentProjectileType = 4
-------------> System: Set startSpeed to 7 + (Power × 2.5)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 5
-------------> System: Set startSpeed to 300
-------------> System: Set currentGravity to 0
------------+ System: CurrentProjectileType = 6
-------------> System: Set startSpeed to 6 + (Power × 2.8)
-------------> System: Set currentGravity to 80
------------+ System: CurrentProjectileType = 7
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 120
------------+ System: CurrentProjectileType = 9
-------------> System: Set currentGravity to 0
------------+ System: CurrentProjectileType = 10
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 11
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 12
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 13
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 14
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 15
-------------> System: Set startSpeed to 5 + (Power × 2)
-------------> System: Set currentGravity to 150
------------+ System: CurrentProjectileType = 16
-------------> System: Set startSpeed to 5 + (Power × 2.7)
-------------> System: Set currentGravity to 120
------------+ System: CurrentProjectileType = 17
-------------> System: Set startSpeed to 7 + (Power × 2.5)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 18
-------------> System: Set currentGravity to 0
------------+ System: CurrentProjectileType = 19
-------------> System: Set currentGravity to 0
------------+ System: CurrentProjectileType = 20
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 21
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 22
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 23
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 24
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: CurrentProjectileType = 25
-------------> System: Set startSpeed to 7 + (Power × 3)
-------------> System: Set currentGravity to 100
------------+ System: For "Traj" from 1 to ceil((Power ÷ MaxPower) × TrajDotsCount)
-------------> System: Set dotIndex to LoopIndex("Traj") + TrajOffset
-------------> System: Set dotTime to dotIndex × tStep
-------------> System: Set vX to cos(PlayerBarrel.Angle) × startSpeed
-------------> System: Set vY to sin(PlayerBarrel.Angle) × startSpeed
-------------> System: Set pX to PlayerBarrel.ImagePointX(1) + (vX × dotTime)
-------------> System: Set pY to PlayerBarrel.ImagePointY(1) + (vY × dotTime) + (0.5 × currentGravity × (dotTime^2))
----------------+ System: pY < -500
----------------+ OR System: pX < -1000
----------------+ OR System: pX > LayoutWidth + 1000
-----------------> System: Stop loop
----------------+ System: Else
-----------------> System: Create object TrajectoryDot on layer "Game" at (pX, pY), create hierarchy: False, template: ""
-----------------> TrajectoryDot: Set scale to 0.8 - (dotIndex ÷TrajDotsCount) × 0.1
-----------------> TrajectoryDot: Set opacity to 100 - (dotIndex ÷ TrajDotsCount) × 70
--------------------+ System: GroundTilemap.TileAt(GroundTilemap.PositionToTileX(pX), GroundTilemap.PositionToTileY(pY)) ≠ -1
--------------------+ System: LoopIndex("Traj") > 2
---------------------> System: Stop loop
----* On function 'FireWeapon'
-----> System: Set recoilAmount to 10
-----> System: Set isRecoiling to True
-----> System: Set CamState to 1
-----> System: Set ShakePower to Power × 0.1
----// Вспышка из дула
-----> System: Create object BoomPuff on layer "Game" at (PlayerBarrel.ImagePointX(1), PlayerBarrel.ImagePointY(1)), create hierarchy: False, template: ""
-----> BoomPuff: Set Type to 10
-----> BoomPuff: Set Age to 0
-----> BoomPuff: Set Life to 1
-----> BoomPuff: Set T to 0
-----> BoomPuff: Set vx to 0
-----> BoomPuff: Set vy to 0
-----> BoomPuff: Set PuffScale to 0.35
-----> BoomPuff: Set scale to Self.PuffScale
-----> BoomPuff: Set color to rgb(210, 105, 30)
-----> BoomPuff: Set opacity to 100
----//
-----> System: Set SwapPending to 1
-----> Joy: Set opacity to 0
-----> Joy: Set Перетаскивание Disabled
-----> Joy: Set X to Joy.StartX
-----> Joy: Set VectorJoy to 0
-----> JoyAim: Set opacity to 0
-----> JoyAim: Set Перетаскивание Disabled
-----> JoyAim: Set position to (JoyAim.StartX, JoyAim.StartY)
-----> JoyAim: Set VectorJoy to 0
-----> BtnFire: Set opacity to 0
// // Кольца дыма из дула
--------+ System: Repeat 10 times
---------> System: Create object BoomPuff on layer "Game" at (PlayerBarrel.ImagePointX(1) + cos(PlayerBarrel.Angle) × LoopIndex×5, PlayerBarrel.ImagePointY(1) + sin(PlayerBarrel.Angle) × LoopIndex×5), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 7
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to 0.5 + LoopIndex × 0.08
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to cos(PlayerBarrel.Angle) × random(30, 70)
---------> BoomPuff: Set vy to sin(PlayerBarrel.Angle) × random(30, 70) - random(10, 20)
---------> BoomPuff: Set PuffScale to random(0.05, 0.2)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set angle to random(0, 360) degrees
---------> BoomPuff: Set Spin to random(-120, 120)
---------> BoomPuff: Set color to rgb(169, 169, 169)
---------> BoomPuff: Set opacity to 70
--------+ System: Repeat 10 times
---------> System: Create object BoomPuff on layer "Game" at (PlayerBarrel.ImagePointX(1) + cos(PlayerBarrel.Angle) , PlayerBarrel.ImagePointY(1) + sin(PlayerBarrel.Angle)), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 7
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to 0.3 + LoopIndex × 0.1
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to cos(PlayerBarrel.Angle) × random(30, 70)
---------> BoomPuff: Set vy to sin(PlayerBarrel.Angle) × random(30, 70) - random(10, 20)
---------> BoomPuff: Set PuffScale to random(0.03, 0.1)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set angle to random(0, 360) degrees
---------> BoomPuff: Set Spin to random(-120, 120)
---------> BoomPuff: Set color to rgb(210, 105, 30)
---------> BoomPuff: Set opacity to 100
--------+ System: ActivePlayer = "Player1"
--------+ PlayerTank: isDestroyed = 0
---------> WeaponAmmo: Set value at CurrentProjectileType to WeaponAmmo.At(CurrentProjectileType)-1
------------[[Оружие 1:Projectile]]
----------------+ System: CurrentProjectileType = 0
-----------------> PlayerBarrel: Spawn Projectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> Projectile: Set Пуля speed to 7 + (Power × 3)
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 2:FireProjectile]]
----------------+ System: CurrentProjectileType = 1
-----------------> PlayerBarrel: Spawn FireProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> FireProjectile: Set Bullet speed to 6 + (Power × 2.5)
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> [DISABLED] System: Set Power to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> [DISABLED] System: Set Charging to False
-----------------> [DISABLED] ChargeEffect: Set animation frame to 0
-----------------> [DISABLED] ChargeEffect: Set visibility Invisible
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 3:HomingProjectile]]
----------------+ System: CurrentProjectileType = 2
-----------------> PlayerBarrel: Spawn HomingProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> HomingProjectile: Set Bullet speed to 6+ (Power × 3)
-----------------> System: Set HomingTimer to 0
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> Joy: Set X to Joy.StartX
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 4:MineProjectile]]
----------------+ System: CurrentProjectileType = 3
-----------------> PlayerBarrel: Spawn MineProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> MineProjectile: Set Bullet speed to 6+ (Power × 3.3)
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> [DISABLED] System: Set Power to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> [DISABLED] System: Set Charging to False
-----------------> [DISABLED] ChargeEffect: Set animation frame to 0
-----------------> [DISABLED] ChargeEffect: Set visibility Invisible
-----------------> Joy: Set X to Joy.StartX
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 5:ClusterProjectile]]
----------------+ System: CurrentProjectileType = 4
-----------------> PlayerBarrel: Spawn ClusterProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> ClusterProjectile: Set Bullet speed to 7+ (Power × 2.5)
-----------------> System: Set ClusterPeakY to ClusterProjectile.Y
-----------------> System: Set IsShooting to 1
-----------------> System: Set IsClusterActive to True
-----------------> System: Set ShotTimer to 0
-----------------> [DISABLED] System: Set Power to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> [DISABLED] System: Set Charging to False
-----------------> [DISABLED] ChargeEffect: Set animation frame to 0
-----------------> [DISABLED] ChargeEffect: Set visibility Invisible
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 6:Пулемет]]
----------------+ System: CurrentProjectileType = 5
-----------------> System: Set MG_SavedPower to Power
-----------------> System: Set MG_SavedAngle to PlayerBarrel.Angle
-----------------> System: Set MG_BulletsLeft to 10
-----------------> System: Set IsMachineGunActive to True
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> [DISABLED] System: Set Power to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> [DISABLED] System: Set Charging to False
-----------------> [DISABLED] ChargeEffect: Set animation frame to 0
-----------------> [DISABLED] ChargeEffect: Set visibility Invisible
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 7:Прыгучая бомба (Bouncer)]]
----------------+ System: CurrentProjectileType = 6
-----------------> PlayerBarrel: Spawn BouncerProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> BouncerProjectile: Set Bullet speed to 6 + (Power × 2.8)
-----------------> BouncerProjectile: Set BounceCount to 0
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> [DISABLED] System: Set Power to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> [DISABLED] System: Set Charging to False
-----------------> [DISABLED] ChargeEffect: Set animation frame to 0
-----------------> [DISABLED] ChargeEffect: Set visibility Invisible
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 8:Грязевая бомба]]
----------------+ System: CurrentProjectileType = 7
-----------------> PlayerBarrel: Spawn DirtProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> DirtProjectile: Set Bullet speed to 7 + (Power × 3)
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 9: Бур (Расчистка вокруг себя)]]
----------------+ System: CurrentProjectileType = 8
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
-----------------> System: Create object explosion on layer "Game" at (PlayerBarrel.X, PlayerBarrel.Y), create hierarchy: False, template: ""
-----------------> explosion: Set animation to "boom" (play from beginning)
-----------------> System: Create object SmokeParticles2 on layer "Game" at (PlayerBarrel.X, PlayerBarrel.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles2: Set spraying
-----------------> Functions: Call Blast (x: PlayerBarrel.X, y: PlayerBarrel.Y - 30, Radius: 60)
-----------------> System: Wait 1.0 seconds (use time scale: True)
-----------------> Functions: Call SwapPlayer
------------[[Оружие 11: Замораживающий снаряд]]
----------------+ System: CurrentProjectileType = 10
-----------------> PlayerBarrel: Spawn FreezeProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> FreezeProjectile: Set Bullet speed to 7 + (Power × 3)
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 12: Роллер (Road Runner)]]
----------------+ System: CurrentProjectileType = 11
-----------------> PlayerBarrel: Spawn RollerProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> RollerProjectile: Set IsRolling to False
-----------------> RollerProjectile: Set Platform Disabled
-----------------> RollerProjectile: Set Bullet Enabled
-----------------> RollerProjectile: Set Bullet speed to 7 + (Power × 3)
-----------------> RollerProjectile: Set Bullet gravity to 100
-----------------> RollerProjectile: Set angle to PlayerBarrel.Angle degrees
-----------------> RollerProjectile: Set Bullet angle of motion to PlayerBarrel.Angle degrees
--------------------+ System: cos(PlayerBarrel.Angle) > 0
---------------------> RollerProjectile: Set RollDir to -1
--------------------+ System: Else
---------------------> RollerProjectile: Set RollDir to 1
--------------------+ (no conditions)
---------------------> System: Set IsShooting to 1
---------------------> System: Set ShotTimer to 0
---------------------> System: Set slideRecoil to 0.1
---------------------> PlayerTank: Set VelX to 0
---------------------> Joy: Set X to Joy.StartX
---------------------> Joy: Set VectorJoy to 0
------------[[Оружие 13: Ионная пушка (Маяк)]]
----------------+ System: CurrentProjectileType = 12
-----------------> PlayerBarrel: Spawn BeaconProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> BeaconProjectile: Set Bullet speed to 7+ (Power × 2.5)
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 14: Удар по площади]]
----------------+ System: CurrentProjectileType = 13
-----------------> PlayerBarrel: Spawn AreaProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> AreaProjectile: Set Bullet speed to 7+ (Power × 3)
-----------------> AreaProjectile: Set Bullet gravity to 100
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 15: Двойной залп (Спираль)]]
----------------+ System: CurrentProjectileType = 14
-----------------> PlayerBarrel: Spawn HelixCenter on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> HelixCenter: Set TracerType to -1
-----------------> HelixCenter: Set Bullet speed to 6+ (Power × 3)
-----------------> HelixCenter: Set Bullet gravity to 100
-----------------> PlayerBarrel: Spawn DoubleProj on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> DoubleProj: Set Phase to 0
-----------------> PlayerBarrel: Spawn DoubleProj on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> DoubleProj: Set Phase to 180
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 16: Телепорт]]
----------------+ System: CurrentProjectileType = 15
-----------------> PlayerBarrel: Spawn TeleportProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> TeleportProjectile: Set Bullet speed to 5+ (Power × 2)
-----------------> TeleportProjectile: Set Bullet gravity to 150
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 17: ЯДЕРНАЯ БОМБА]]
----------------+ System: CurrentProjectileType = 16
-----------------> PlayerBarrel: Spawn NukeProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> NukeProjectile: Set Bullet speed to 5+ (Power × 2.7)
-----------------> NukeProjectile: Set Bullet gravity to 120
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 18: ФОНТАН]]
----------------+ System: CurrentProjectileType = 17
-----------------> PlayerBarrel: Spawn FountainProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> FountainProjectile: Set Bullet speed to 7+ (Power × 2.5)
-----------------> System: Set IsShooting to 1
-----------------> System: Set IsFountainActive to True
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 19: ЭНЕРГОКУПОЛ]]
----------------+ System: CurrentProjectileType = 18
-----------------> System: Set IsShooting to 1
-----------------> System: Set IsFountainActive to True
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
--------------------+ System: For each ShieldDome
--------------------+ ShieldDome: TargetUID = PlayerTank.UID
---------------------> ShieldDome: Destroy
--------------------+ (no conditions)
---------------------> System: Create object ShieldDome on layer "Game" at (PlayerTank.X, PlayerTank.Y), create hierarchy: False, template: ""
---------------------> ShieldDome: Set opacity to 100
---------------------> ShieldDome: Set TargetUID to PlayerTank.UID
---------------------> ShieldDome: Set ShieldLife to 8
---------------------> ShieldDome: Set ShieldRadius to 90
---------------------> ShieldDome: Fade: set wait time to 999
---------------------> ShieldDome: Set ShieldTurns to 2
---------------------> ShieldDome: Pin Pin to PlayerTank (X: True, Y: True, angle: False, width: No, height: No, Z: False)
---------------------> System: Create object Shockwave on layer "Game" at (PlayerTank.X, PlayerTank.Y), create hierarchy: False, template: ""
---------------------> Shockwave: Set width to 40
---------------------> Shockwave: Set height to 40
---------------------> Shockwave: Set opacity to 60
---------------------> System: Wait 1.0 seconds (use time scale: True)
---------------------> Functions: Call SwapPlayer
------------[[Оружие 20: Авиабомбардировка]]
----------------+ System: CurrentProjectileType = 19
-----------------> System: Set IsShooting to 1
-----------------> System: Set IsAirstrikeActive to True
-----------------> System: Set ShotTimer to 0
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
-----------------> System: Create object Airplane on layer "Game" at (-200, 50), create hierarchy: False, template: ""
-----------------> Airplane: Set angle to 0 degrees
-----------------> Airplane: Set Not mirrored
-----------------> Airplane: Set scale to 0.15
-----------------> Airplane: Set IsBombed to 0
-----------------> System: Set CamState to 5
------------[[Оружие 21: Маяк НЛО]]
----------------+ System: CurrentProjectileType = 20
-----------------> PlayerBarrel: Spawn UFO_Beacon on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> UFO_Beacon: Set Bullet speed to 7 + (Power × 3)
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 22: Дрон-Машинка (Капсула)]
----------------+ System: CurrentProjectileType = 21
-----------------> PlayerBarrel: Spawn RC_Capsule on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> RC_Capsule: Set Bullet speed to 7 + (Power × 3)
-----------------> RC_Capsule: Set Bullet gravity to 100
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 23: Дрон-камикадзе ]]
----------------+ System: CurrentProjectileType = 22
-----------------> PlayerBarrel: Spawn HiveCapsule on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> HiveCapsule: Set Bullet angle of motion to PlayerBarrel.Angle degrees
-----------------> HiveCapsule: Set Bullet speed to 7 + (Power × 3)
-----------------> HiveCapsule: Set Bullet gravity to 100
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 24: Бумеранг]]
----------------+ System: CurrentProjectileType = 23
-----------------> System: Set IsBoomerangActive to True
-----------------> BoomerangProjectile: Set BounceCount to 0
-----------------> PlayerBarrel: Spawn BoomerangProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> BoomerangProjectile: Set Bullet angle of motion to localAngle degrees
-----------------> BoomerangProjectile: Set angle to localAngle degrees
-----------------> BoomerangProjectile: Set Bullet speed to 7 + (Power × 3)
-----------------> BoomerangProjectile: Set Bullet gravity to 100
-----------------> BoomerangProjectile: Set BoomerangTimer to 0.9
-----------------> BoomerangProjectile: Set Returning to 0
-----------------> BoomerangProjectile: Set HasHit to 0
-----------------> BoomerangProjectile: Set OwnerTag to "Player1"
-----------------> BoomerangProjectile: Set scale to 0.05
-----------------> BoomerangProjectile: Set PeakY to BoomerangProjectile.Y
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 25: Тройной заряд]]
----------------+ System: CurrentProjectileType = 24
-----------------> System: Set TB_SavedPower to Power
-----------------> System: Set TB_SavedAngle to localAngle
-----------------> System: Set TB_ShotsLeft to 3
-----------------> System: Set IsTripleBurstActive to True
-----------------> System: Set IsShooting to 1
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
------------[[Оружие 26: ВУЛКАН]]
----------------+ System: CurrentProjectileType = 25
-----------------> PlayerBarrel: Spawn VolcanoProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> VolcanoProjectile: Set Bullet speed to 7+ (Power × 3)
-----------------> VolcanoProjectile: Set Bullet gravity to 100
-----------------> VolcanoProjectile: Set scale to 0.05
-----------------> System: Set IsShooting to 1
-----------------> System: Set IsVolcanoActive to True
-----------------> System: Set ShotTimer to 0
-----------------> System: Set slideRecoil to 0.1
-----------------> PlayerTank: Set VelX to 0
-----------------> Joy: Set X to Joy.StartX
-----------------> Joy: Set VectorJoy to 0
--------[[Оружие 10: Лазер]]
------------+ System: CurrentProjectileType = 9
-------------> System: Set IsShooting to 1
-------------> PlayerBarrel: Spawn LaserBeam on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> LaserBeam: Set angle to PlayerBarrel.Angle degrees
-------------> LaserBeam: Set width to 2000
-------------> LaserBeam: Set Physics enabled
----------------+ System: For each Players
----------------+ Players: isDestroyed = 0
----------------+ Players: Is overlapping LaserBeam
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 40, HeavyHit: 0)
----------------+ (no conditions)
-----------------> LaserBeam: Set Physics disabled
-----------------> Functions: Call BurnLine (startX: PlayerBarrel.ImagePointX(1), startY: PlayerBarrel.ImagePointY(1), endX: PlayerBarrel.ImagePointX(1) + cos(PlayerBarrel.Angle) × 2000, endY: PlayerBarrel.ImagePointY(1) + sin(PlayerBarrel.Angle) × 2000)
-----------------> Functions: Call SwapPlayer
----[[Попадание снаряда по GroundTileMap и прямое попадание по Танку]]
--------[Projectile попадание по земле и танку ]
------------+ Projectile: On collision with GroundTilemap
-------------> Functions: Call VideoBoomFXGround (X: AmmosFamily.X, Y: AmmosFamily.Y, ColorType: 0)
-------------> Functions: Call Blast (x: Projectile.X, y: Projectile.Y -5, Radius: 15)
-------------> Projectile: Destroy
-------------> Functions: Call SwapPlayer
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - Projectile.X) × 1
------------[обычный снаряд]
----------------+ Players: On collision with Projectile
----------------+ Players: isDestroyed = 0
-----------------> Projectile: Destroy
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Functions: Call Blast (x: Players.X, y: Players.Y-7, Radius: 10)
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 30, HeavyHit: 1)
--------[FireProjectile попадание по земле и танку]
------------+ FireProjectile: On collision with GroundTilemap
-------------> Functions: Call VideoBoomFXGround (X: FireProjectile.X, Y: FireProjectile.Y, ColorType: 0)
-------------> Functions: Call Blast (x: FireProjectile.X, y: FireProjectile.Y-5, Radius: FireRadius)
-------------> System: Create object SmokeParticles2 on layer "Game" at (FireProjectile.X, FireProjectile.Y), create hierarchy: False, template: ""
-------------> SmokeParticles2: Set spraying
-------------> SmokeParticles2: Set rate to 100
-------------> FireProjectile: Destroy
-------------> Functions: Call SwapPlayer
----------------+ System: Repeat 12 times
-----------------> System: Create object NapalmDrop on layer "Game" at (FireProjectile.X, FireProjectile.Y-5), create hierarchy: False, template: ""
-----------------> NapalmDrop: Set Bullet angle of motion to random(-160, -20) degrees
-----------------> NapalmDrop: Set Bullet speed to random(75, 100)
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - FireProjectile.X) × 0.7
------------[огненный снаряд]
----------------+ Players: On collision with FireProjectile
----------------+ Players: isDestroyed = 0
-----------------> FireProjectile: Destroy
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Functions: Call Blast (x: Players.X, y: Players.Y-7, Radius: 10)
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 20, HeavyHit: 1)
--------------------+ System: Repeat 8 times
---------------------> System: Create object BoomPuff on layer "Game" at (FireProjectile.X + random(-12, 12), FireProjectile.Y + random(-8, 4)), create hierarchy: False, template: ""
---------------------> BoomPuff: Set Type to 5
---------------------> BoomPuff: Set Age to 0
---------------------> BoomPuff: Set Life to random(0.5, 1.0)
---------------------> BoomPuff: Set T to 0
---------------------> BoomPuff: Set vx to random(-35, 35)
---------------------> BoomPuff: Set vy to -random(25, 65)
---------------------> BoomPuff: Set PuffScale to random(0.3, 0.6)
---------------------> BoomPuff: Set scale to Self.PuffScale
---------------------> BoomPuff: Set opacity to 100
--------------------+ System: Repeat 4 times
---------------------> System: Create object BoomPuff on layer "Game" at (FireProjectile.X + random(-15, 15), FireProjectile.Y + random(-10, 2)), create hierarchy: False, template: ""
---------------------> BoomPuff: Set Type to 7
---------------------> BoomPuff: Set Age to 0
---------------------> BoomPuff: Set Life to random(0.6, 1.1)
---------------------> BoomPuff: Set T to 0
---------------------> BoomPuff: Set vx to random(-20, 20)
---------------------> BoomPuff: Set vy to -random(30, 55)
---------------------> BoomPuff: Set PuffScale to random(0.25, 0.45)
---------------------> BoomPuff: Set scale to Self.PuffScale
---------------------> BoomPuff: Set color to rgb(60, 55, 50)
---------------------> BoomPuff: Set opacity to 100
--------[HomingProjectile попадание по земле и танку]
------------[[Самонаведение в полете]]
----------------+ System: For each HomingProjectile
-----------------> System: Set HomingTimer to HomingTimer + dt
-----------------> HomingProjectile: Set angle to HomingProjectile.Bullet.AngleOfMotion degrees
--------------------+ System: HomingTimer ≥ 1.5
--------------------+ System: ActivePlayer = "Player1"
--------------------+ BotTank: isDestroyed = 0
---------------------> HomingProjectile: Set Bullet gravity to 0
---------------------> HomingProjectile: Set Bullet angle of motion to anglelerp(HomingProjectile.Bullet.AngleOfMotion, angle(HomingProjectile.X, HomingProjectile.Y, BotTank.X, BotTank.Y), 5 × dt) degrees
--------------------+ System: HomingTimer ≥ 1.5
--------------------+ System: ActivePlayer = "Player2"
--------------------+ PlayerTank: isDestroyed = 0
---------------------> HomingProjectile: Set Bullet gravity to 0
---------------------> HomingProjectile: Set Bullet angle of motion to anglelerp(HomingProjectile.Bullet.AngleOfMotion, angle(HomingProjectile.X, HomingProjectile.Y, PlayerTank.X, PlayerTank.Y), 5 × dt) degrees
--------------------+ System: Repeat 24 times
---------------------> System: Create object BoomPuff on layer "Game" at (HomingProjectile.ImagePointX(1), HomingProjectile.ImagePointY(1)), create hierarchy: False, template: ""
---------------------> BoomPuff: Set Type to 5
---------------------> BoomPuff: Set Age to 0
---------------------> BoomPuff: Set Life to random(0.25, 0.5)
---------------------> BoomPuff: Set T to 0
---------------------> BoomPuff: Set vx to random(-15, 15)
---------------------> BoomPuff: Set vy to random(-15, 15)
---------------------> BoomPuff: Set PuffScale to random(0.02, 0.1)
---------------------> BoomPuff: Set scale to Self.PuffScale
---------------------> BoomPuff: Set opacity to 75
------------+ HomingProjectile: On collision with GroundTilemap
-------------> Functions: Call Blast (x: HomingProjectile.X, y: HomingProjectile.Y-5, Radius: 20)
-------------> System: Create object SmokeParticles2 on layer "Game" at (HomingProjectile.X, HomingProjectile.Y), create hierarchy: False, template: ""
-------------> SmokeParticles2: Set spraying
-------------> SmokeParticles2: Set rate to 100
-------------> HomingProjectile: Destroy
-------------> Functions: Call SwapPlayer
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - HomingProjectile.X) × 0.7
------------[[Самонаводящаяся ракета]]
----------------+ Players: On collision with HomingProjectile
----------------+ Players: isDestroyed = 0
-----------------> System: Create object SmokeParticles on layer "Game" at (Projectile.X, Projectile.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles: Set spraying
-----------------> SmokeParticles: Set rate to 100
-----------------> HomingProjectile: Destroy
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Functions: Call Blast (x: Players.X, y: Players.Y-7, Radius: 20)
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 30, HeavyHit: 1)
--------[MineProjectile попадание по земле и танку]
------------+ MineProjectile: On collision with GroundTilemap
-------------> System: Create object LandMine on layer "Game" at (MineProjectile.X, MineProjectile.Y - 2), create hierarchy: False, template: ""
-------------> MineProjectile: Destroy
-------------> Functions: Call SwapPlayer
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - MineProjectile.X) × 0.7
------------[[Мина: Прямое попадание]]
----------------+ Players: On collision with MineProjectile
----------------+ Players: isDestroyed = 0
-----------------> System: Create object SmokeParticles on layer "Game" at (MineProjectile.X, MineProjectile.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles: Set spraying
-----------------> SmokeParticles: Set rate to 100
-----------------> MineProjectile: Destroy
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Functions: Call Blast (x: Players.X, y: Players.Y-7, Radius: 25)
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 40, HeavyHit: 1)
------------[[Срабатывание Мины]]
----------------+ LandMine: On collision with Players
----------------+ LandMine: IsDetonated = 0
-----------------> LandMine: Set IsDetonated to 1
-----------------> System: Create object SmokeParticles on layer "Game" at (LandMine.X, LandMine.Y), create hierarchy: False, template: ""
-----------------> System: Create object SmokeParticles2 on layer "Game" at (LandMine.X, LandMine.Y), create hierarchy: False, template: ""
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Functions: Call Blast (x: LandMine.X, y: LandMine.Y, Radius: 30)
-----------------> Players: Subtract 40 from HP
-----------------> Players: Set HP to max(0, Players.HP)
-----------------> LandMine: Destroy
------------[(столкновение снарядов с миной)]
----------------+ AmmosFamily: On collision with LandMine
----------------+ LandMine: IsDetonated = 0
----------------+ System: AmmosFamily.ObjectTypeName ≠ "MineProjectile"
-----------------> LandMine: Set IsDetonated to 1
-----------------> AmmosFamily: Destroy
-----------------> Functions: Call ExplodeMine (UID: LandMine.UID)
--------------------+ System: [X] Is IsClusterActive
---------------------> Functions: Call SwapPlayer
--------[ClusterProjectile попадание по земле и танку]
------------+ ClusterProjectile: On collision with GroundTilemap
-------------> Functions: Call Blast (x: ClusterProjectile.X, y: ClusterProjectile.Y-5, Radius: 20)
-------------> System: Create object SmokeParticles2 on layer "Game" at (ClusterProjectile.X, ClusterProjectile.Y), create hierarchy: False, template: ""
-------------> SmokeParticles2: Set spraying
-------------> ClusterProjectile: Destroy
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - ClusterProjectile.X) × 0.7
------------[[Кластерная бомба: Прямое попадание]]
----------------+ Players: On collision with ClusterProjectile
----------------+ Players: isDestroyed = 0
-----------------> System: Create object SmokeParticles on layer "Game" at (ClusterProjectile.X, ClusterProjectile.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles: Set spraying
-----------------> SmokeParticles: Set rate to 100
-----------------> ClusterProjectile: Destroy
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Players: Subtract 60 from HP
-----------------> Players: Set HP to max(0, Players.HP)
-----------------> Functions: Call Blast (x: Players.X, y: Players.Y-7, Radius: 25)
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 60, HeavyHit: 1)
------------[[Cluster Mini Bomb]]
----------------+ MiniBomb: On collision with GroundTilemap
-----------------> Functions: Call VideoBoomFXGround (X: MiniBomb.X, Y: MiniBomb.Y, ColorType: 0)
-----------------> System: Create object SmokeParticles on layer "Game" at (MiniBomb.X, MiniBomb.Y), create hierarchy: False, template: ""
-----------------> System: Create object SmokeParticles2 on layer "Game" at (MiniBomb.X, MiniBomb.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles: Set spraying
-----------------> SmokeParticles2: Set spraying
-----------------> Functions: Call Blast (x: MiniBomb.X, y: MiniBomb.Y-5, Radius: 10)
-----------------> MiniBomb: Destroy
----------------+ Players: On collision with MiniBomb
----------------+ Players: isDestroyed = 0
-----------------> System: Create object SmokeParticles on layer "Game" at (MiniBomb.X, MiniBomb.Y), create hierarchy: False, template: ""
-----------------> System: Create object SmokeParticles2 on layer "Game" at (MiniBomb.X, MiniBomb.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles: Set spraying
-----------------> SmokeParticles2: Set spraying
-----------------> Functions: Call Blast (x: MiniBomb.X, y: MiniBomb.Y, Radius: 10)
-----------------> MiniBomb: Destroy
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 15, HeavyHit: 1)
------------[Функция SplitCluster]
----------------* On function 'SplitCluster'
-----------------> Functions: Call VideoBoomFXGround (X: ClusterProjectile.X, Y: ClusterProjectile.Y, ColorType: 0)
-----------------> ClusterProjectile: Destroy
--------------------+ System: Repeat 5 times
---------------------> System: Create object MiniBomb on layer "Game" at (ClusterProjectile.X, ClusterProjectile.Y), create hierarchy: False, template: ""
---------------------> MiniBomb: Set Bullet speed to ClusterProjectile.Bullet.Speed × random(0.8, 1)
---------------------> MiniBomb: Set Bullet angle of motion to ClusterProjectile.Bullet.AngleOfMotion - 20 + (LoopIndex × 10) degrees
------------[[Передача хода после Кластерной Бомбы]]
----------------+ System: Every tick
----------------+ System: Is IsClusterActive
----------------+ System: ClusterProjectile.Count = 0
----------------+ System: MiniBomb.Count = 0
----------------+ System: Trigger once
-----------------> System: Wait 1.0 seconds (use time scale: True)
-----------------> Functions: Call SwapPlayer
-----------------> System: Set IsClusterActive to False
------------[[Разделение Кластерной Бомбы]]
----------------+ System: Every tick
----------------+ System: IsShooting = 1
-----------------> System: Set ShotTimer to ShotTimer + dt
----------------+ System: Every tick
----------------+ System: ClusterProjectile.Count > 0
----------------+ System: ClusterProjectile.Bullet.AngleOfMotion > 0
----------------+ System: ClusterProjectile.Bullet.AngleOfMotion < 180
----------------+ System: ShotTimer > 0.3
-----------------> Functions: Call SplitCluster
--------------------+ System: ClusterProjectile.Y < ClusterPeakY
---------------------> System: Set ClusterPeakY to ClusterProjectile.Y
--------------------+ System: ShotTimer > 0.5
--------------------+ System: ClusterProjectile.Y > ClusterPeakY + 60
---------------------> Functions: Call SplitCluster
--------[MachineGunBullet попадание по земле и танку]
------------[[Передача хода после Пулемета (Очередь)]]
----------------+ System: Every tick
----------------+ System: Is IsMachineGunActive
----------------+ System: MG_BulletsLeft = 0
----------------+ System: MachineGunBullet.Count = 0
----------------+ System: Trigger once
-----------------> System: Wait 1.0 seconds (use time scale: True)
-----------------> Functions: Call SwapPlayer
-----------------> System: Set IsMachineGunActive to False
------------[[Стрельба Пулеметом (Очередь)]]
----------------+ System: Every 0.1 seconds
----------------+ System: MG_BulletsLeft > 0
----------------+ System: ActivePlayer = "Player1"
-----------------> PlayerBarrel: Spawn MachineGunBullet on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> MachineGunBullet: Set Bullet speed to 500 × random(0.85, 1)
-----------------> MachineGunBullet: Set angle to MG_SavedAngle + random(-5, 3) degrees
-----------------> MachineGunBullet: Set Bullet angle of motion to MachineGunBullet.Angle degrees
-----------------> System: Subtract 1 from MG_BulletsLeft
-----------------> System: Set recoilAmount to 10
-----------------> System: Set isRecoiling to True
----------------+ System: Every 0.1 seconds
----------------+ System: MG_BulletsLeft > 0
----------------+ System: ActivePlayer = "Player2"
-----------------> BotBarrel: Spawn MachineGunBullet on layer "Game" (image point 1, create hierarchy: False, template: "")
-----------------> MachineGunBullet: Set Bullet speed to 500 × random(0.85, 1)
-----------------> MachineGunBullet: Set angle to MG_SavedAngle + random(-5, 3) degrees
-----------------> MachineGunBullet: Set Bullet angle of motion to MachineGunBullet.Angle degrees
-----------------> System: Subtract 1 from MG_BulletsLeft
-----------------> System: Set recoilAmount to 10
-----------------> System: Set isRecoiling to True
------------+ MachineGunBullet: On collision with GroundTilemap
-------------> System: Create object "explosion" on layer "Game" at (MachineGunBullet.X, MachineGunBullet.Y), create hierarchy: False, template: ""
-------------> explosion: Set animation to "boom" (play from beginning)
-------------> Functions: Call Blast (x: MachineGunBullet.X, y: MachineGunBullet.Y-5, Radius: 10)
-------------> System: Create object SmokeParticles2 on layer "Game" at (MachineGunBullet.X, MachineGunBullet.Y), create hierarchy: False, template: ""
-------------> SmokeParticles2: Set spraying
-------------> MachineGunBullet: Destroy
-------------> System: Set ShotTimer to 0
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - MachineGunBullet.X) × 0.7
------------[[Пулемет: Попадание]]
----------------+ Players: On collision with MachineGunBullet
----------------+ Players: isDestroyed = 0
-----------------> System: Create object explosion on layer "Game" at (MachineGunBullet.X, MachineGunBullet.Y), create hierarchy: False, template: ""
-----------------> explosion: Set animation to "boom" (play from beginning)
-----------------> System: Create object SmokeParticles on layer "Game" at (MachineGunBullet.X, MachineGunBullet.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles: Set spraying
-----------------> MachineGunBullet: Destroy
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 5, HeavyHit: 0)
--------[NapalmDrop попадание по земле и танку]
------------+ NapalmDrop: On collision with GroundTilemap
-------------> Functions: Call Blast (x: NapalmDrop.X, y: NapalmDrop.Y, Radius: 7)
-------------> System: Create object FireZone on layer "Game" at (NapalmDrop.X, NapalmDrop.Y), create hierarchy: False, template: ""
-------------> FireZone: Set scale to FireRadius ÷20
-------------> FireZone: Set opacity to 30
-------------> FireZone: Set BurnTimer to BurnDuration
-------------> System: Create object FireParticle on layer "Game" at (NapalmDrop.X, NapalmDrop.Y), create hierarchy: False, template: ""
-------------> NapalmDrop: Destroy
------------[Зона горения]
----------------+ System: Every 0.5 seconds
----------------+ System: For each Players
----------------+ FireZone: Is overlapping Players
----------------+ Players: isDestroyed = 0
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 1, HeavyHit: 0)
----------------+ System: Every tick
-----------------> FireZone: Subtract dt from BurnTimer
-----------------> FireZone: Set opacity to 20 × (FireZone.BurnTimer ÷ BurnDuration)
-----------------> FireZone: Set scale to FireRadius ÷ 10
--------------------+ FireZone: BurnTimer ≤ 0
---------------------> FireZone: Destroy
--------[[BouncerProjectile Прыгучка: попадание по земле и танку]]
------------+ BouncerProjectile: On collision with GroundTilemap
-------------> BouncerProjectile: Add 1 to BounceCount
-------------> System: Create object SmokeParticles2 on layer "Game" at (BouncerProjectile.X, BouncerProjectile.Y), create hierarchy: False, template: ""
-------------> SmokeParticles2: Set spraying
------------// степень прыгучести бомбы
-------------> BouncerProjectile: Set Bullet speed to BouncerProjectile.Bullet.Speed × 0.3
----------------+ BouncerProjectile: BounceCount ≥ 3
-----------------> Functions: Call VideoBoomFXGround (X: BouncerProjectile.X, Y: BouncerProjectile.Y, ColorType: 0)
-----------------> Functions: Call Blast (x: BouncerProjectile.X, y: BouncerProjectile.Y-5, Radius: 20)
-----------------> BouncerProjectile: Destroy
-----------------> Functions: Call SwapPlayer
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - BouncerProjectile.X) × 0.7
------------[[Прыгучка: Прямое попадание]]
----------------+ Players: On collision with BouncerProjectile
----------------+ Players: isDestroyed = 0
-----------------> System: Create object SmokeParticles on layer "Game" at (BouncerProjectile.X, BouncerProjectile.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles: Set spraying
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Functions: Call Blast (x: BouncerProjectile.X, y: BouncerProjectile.Y, Radius: 25)
-----------------> BouncerProjectile: Destroy
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 45, HeavyHit: 1)
--------[DirtProjectile Грязевая бомба: попадание по земле и танку]
------------+ DirtProjectile: On collision with GroundTilemap
-------------> DirtBuilder: Set visibility Invisible
-------------> System: Create object DirtBuilder on layer "Game" at (DirtProjectile.X, DirtProjectile.Y), create hierarchy: False, template: ""
-------------> DirtBuilder: Set RadiusMax to 50
-------------> DirtBuilder: Set CurrentRadius to 0
-------------> DirtProjectile: Destroy
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - DirtProjectile.X) × 0.7
------------+ System: Every tick
------------+ System: For each DirtBuilder
-------------> (no actions)
------------[DirtProjectile прямое попадание]
----------------+ Players: On collision with DirtProjectile
-----------------> System: Create object DirtBuilder on layer "Game" at (DirtProjectile.X, DirtProjectile.Y), create hierarchy: False, template: ""
-----------------> DirtBuilder: Set RadiusMax to 50
-----------------> DirtBuilder: Set CurrentRadius to 0
-----------------> DirtProjectile: Destroy
--------------------+ System: For each Players
--------------------+ System: distance(Players.X, Players.Y, DirtProjectile.X, DirtProjectile.Y) < 70
---------------------> DirtProjectile: Destroy
------------[[Плавный рост земли]]
----------------+ System: On start of layout
-----------------> DirtBuilder: Destroy
| Local number dy = 0
| Local number w = 0
| Local number rim = 0
| Local number dx = 0
| Local number adx = 0
| Local number dig = 0
| Local number h = 0
| Local number moundTop = 0
| Local number bx = 0
| Local number tileRad = 0
----------------+ System: Every tick
----------------+ System: For each DirtBuilder
-----------------> DirtBuilder: Set visibility Invisible
-----------------> DirtBuilder: Add 50 × dt to CurrentRadius
-----------------> System: Set ShakePower to DirtBuilder.CurrentRadius × 0.2
// ═══ Поднимаем столбцы по кругу ═══
--------------------+ System: For "bx" from max(0, floor(DirtBuilder.X - DirtBuilder.CurrentRadius)) to min(LayoutWidth, ceil(DirtBuilder.X + DirtBuilder.CurrentRadius))
---------------------> System: Set dx to LoopIndex("bx") - DirtBuilder.X
---------------------> System: Set adx to abs(dx)
---------------------> System: Set dy to √(max(0, DirtBuilder.CurrentRadius × DirtBuilder.CurrentRadius - dx × dx))
---------------------> System: Set h to HeightMap.At(LoopIndex("bx"), 0)
---------------------> System: Set dig to h - (DirtBuilder.Y - dy)
------------------------+ System: dig > 0
-------------------------> System: Set rim to max(12, DirtBuilder.CurrentRadius × 0.5)
-------------------------> System: Set w to clamp((DirtBuilder.CurrentRadius - adx) ÷ rim, 0, 1)
-------------------------> System: Set w to w × w × (3 - 2 × w)
-------------------------> HeightMap: Set value at (LoopIndex("bx"), 0) to h - dig × w
// ═══ Перестраиваем тайлы ═══
----------------+ System: For "bx" from max(0, floor(DirtBuilder.X - DirtBuilder.CurrentRadius)) to min(LayoutWidth, ceil(DirtBuilder.X + DirtBuilder.CurrentRadius))
----------------+ System: distance(0, 0, LoopIndex("TX"), LoopIndex("TY")) ≤ tileRad
-----------------> System: Set h to floor(HeightMap.At(LoopIndex("bx"), 0))
-----------------> GroundTilemap: Erase tile range (LoopIndex("bx"), 0) area 1 x ceil(LayoutHeight ÷ GroundTilemap.TileHeight)
-----------------> GroundTilemap: Set tiles at (LoopIndex("bx"), h) with area 1 x (LayoutHeight - h) to tile 0 (normal)
-----------------> DirtBuilder: Add dt to RenderTimer
// ═══ Рендерим раз в 0.15 сек ═══
----------------+ System: Every tick
----------------+ System: For each DirtBuilder
----------------+ DirtBuilder: RenderTimer ≥ 0.15
-----------------> DirtBuilder: Set RenderTimer to 0
-----------------> Functions: Call RenderTerrain (FromX: DirtBuilder.X - 60, ToX: DirtBuilder.X + 60)
// ═══ Завершение роста ═══
----------------+ System: Every tick
----------------+ System: For each DirtBuilder
--------------------+ System: For each Players
--------------------+ System: distance(Players.X, Players.Y, DirtBuilder.X, DirtBuilder.Y) < DirtBuilder.RadiusMax + 100
---------------------> Players: Set VelX to 0
---------------------> Players: Set VelY to 0
---------------------> Players: Set Y to Self.Y - 5
----------------+ System: Every tick
----------------+ System: For each DirtBuilder
----------------+ System: DirtBuilder.CurrentRadius ≥ DirtBuilder.RadiusMax
-----------------> Functions: Call RenderTerrain (FromX: DirtBuilder.X - 60, ToX: DirtBuilder.X + 60)
-----------------> DirtBuilder: Destroy
-----------------> Functions: Call SwapPlayer
--------[FreezeProjectile попадание по graund tilemap ]
------------+ FreezeProjectile: On collision with GroundTilemap
-------------> Functions: Call VideoBoomFXGround (X: FreezeProjectile.X, Y: FreezeProjectile.Y, ColorType: 1)
-------------> Functions: Call Blast (x: FreezeProjectile.X, y: FreezeProjectile.Y-5, Radius: 10)
-------------> FreezeProjectile: Destroy
-------------> Functions: Call SwapPlayer
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - FreezeProjectile.X) × 0.7
------------[[Замораживающий снаряд: Прямое попадание]]
----------------+ FreezeProjectile: Is overlapping Players
----------------+ Players: isDestroyed = 0
--------------------+ (no conditions)
---------------------> Functions: Call VideoBoomFXGround (X: FreezeProjectile.X, Y: FreezeProjectile.Y, ColorType: 1)
------------------------+ System: Repeat 10 times
-------------------------> System: Create object BoomPuff on layer "Game" at (FreezeProjectile.X, FreezeProjectile.Y + random(-8, 8)), create hierarchy: False, template: ""
-------------------------> BoomPuff: Set Type to 7
-------------------------> BoomPuff: Set Age to 0
-------------------------> BoomPuff: Set Life to random(0.2, 0.6)
-------------------------> BoomPuff: Set T to 0
-------------------------> BoomPuff: Set vx to random(-80, 80)
-------------------------> BoomPuff: Set vy to random(-120, 30)
-------------------------> BoomPuff: Set PuffScale to random(0.2, 0.5)
-------------------------> BoomPuff: Set scale to Self.PuffScale
-------------------------> BoomPuff: Set angle to random(0, 360) degrees
-------------------------> BoomPuff: Set Spin to random(-150, 150)
-------------------------> BoomPuff: Set color to rgb(180, 230, 255)
-------------------------> BoomPuff: Set opacity to 90
--------------------+ (no conditions)
---------------------> Players: Set IsFrozen to True
---------------------> System: Create object IceBlock on layer "Game" at (Players.X, Players.Y), create hierarchy: False, template: ""
---------------------> IceBlock: Pin Pin to Players (X: True, Y: True, angle: True, width: No, height: No, Z: False)
---------------------> IceBlock: Set opacity to 30
---------------------> IceBlock: Set TargetUID to Players.UID
---------------------> FreezeProjectile: Destroy
---------------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 5, HeavyHit: 0)
---------------------> Functions: Call SwapPlayer
--------[[Роллер]]
// [Роллер: Касание земли → режим машинки (без физики)]
------------+ RollerProjectile: On collision with GroundTilemap
------------+ RollerProjectile: [X] Is IsRolling
-------------> RollerProjectile: Set IsRolling to True
-------------> RollerProjectile: Set Bullet Disabled
-------------> RollerProjectile: Set Platform Disabled
-------------> RollerProjectile: Set Y to HeightMap.At(clamp(floor(RollerProjectile.X), 0, LayoutWidth), 0) - 8
-------------> RollerProjectile: Set RollLife to 6
-------------> System: Set ShakePower to 5
-------------> System: Create object SmokeParticles2 on layer "Game" at (RollerProjectile.X, RollerProjectile.Y), create hierarchy: False, template: ""
----------------+ System: ActivePlayer = "Player1"
-----------------> RollerProjectile: Set RollDir to sign(BotTank.X - RollerProjectile.X)
----------------+ System: Else
-----------------> RollerProjectile: Set RollDir to sign(PlayerTank.X - RollerProjectile.X)
----------------+ System: RollerProjectile.RollDir = 0
-----------------> RollerProjectile: Set RollDir to 1
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - RollerProjectile.X) × 0.7
// [Роллер: езда по HeightMap (как RCDrone)]
------------+ System: Every tick
------------+ System: For each RollerProjectile
------------+ RollerProjectile: Is IsRolling
-------------> RollerProjectile: Set X to RollerProjectile.X + (RollerProjectile.RollDir × 180 × dt)
-------------> RollerProjectile: Set Y to HeightMap.At(clamp(floor(RollerProjectile.X), 0, LayoutWidth), 0) - 8
-------------> System: Set SampleX to clamp(floor(RollerProjectile.X), 10, LayoutWidth - 10)
-------------> System: Set localAngle to angle(SampleX - 10, HeightMap.At(SampleX - 10, 0), SampleX + 10, HeightMap.At(SampleX + 10, 0))
-------------> RollerProjectile: Add RollerProjectile.RollDir × 1400 × dt to WheelAngle
-------------> RollerProjectile: Set angle to anglelerp(RollerProjectile.Angle, localAngle + RollerProjectile.WheelAngle, 10 × dt) degrees
-------------> RollerProjectile: Subtract dt from RollLife
----------------+ RollerProjectile: RollDir > 0
-----------------> RollerProjectile: Set Mirrored
----------------+ RollerProjectile: RollDir < 0
-----------------> RollerProjectile: Set Not mirrored
----------------+ (no conditions)
-----------------> System: Set CamState to 5
-----------------> System: Set CamTargetX to RollerProjectile.X
-----------------> System: Set CamTargetY to RollerProjectile.Y
// [Роллер: пыль из-под колёс]
------------+ System: Every 0.06 seconds
------------+ System: For each RollerProjectile
------------+ RollerProjectile: Is IsRolling
-------------> System: Create object BoomPuff on layer "Game" at (RollerProjectile.X - (RollerProjectile.RollDir × 12) + random(-3, 3), RollerProjectile.Y + 6), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 7
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to random(0.3, 0.6)
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to -RollerProjectile.RollDir × random(20, 50)
-------------> BoomPuff: Set vy to -random(10, 30)
-------------> BoomPuff: Set PuffScale to random(0.15, 0.3)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set angle to random(0, 360) degrees
-------------> BoomPuff: Set Spin to random(-120, 120)
-------------> BoomPuff: Set color to ColDust
-------------> BoomPuff: Set opacity to 80
// [Роллер: уехал за край карты — взрыв]
------------+ System: Every tick
------------+ System: For each RollerProjectile
------------+ RollerProjectile: Is IsRolling
------------+ System: abs(RollerProjectile.X - (LayoutWidth ÷ 2)) > (LayoutWidth ÷ 2) - 15
-------------> Functions: Call VideoBoomFXGround (X: RollerProjectile.X, Y: RollerProjectile.Y, ColorType: 0)
-------------> Functions: Call Blast (x: RollerProjectile.X, y: RollerProjectile.Y, Radius: 20)
-------------> RollerProjectile: Destroy
-------------> System: Set CamState to 2
-------------> Functions: Call SwapPlayer
------------[[Роллер: Прямое попадание в танк (Взрыв!)]]
----------------+ Players: On collision with RollerProjectile
----------------+ Players: isDestroyed = 0
-----------------> System: Create object SmokeParticles2 on layer "Game" at (RollerProjectile.X, RollerProjectile.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles2: Set spraying
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Functions: Call Blast (x: RollerProjectile.X, y: RollerProjectile.Y-7, Radius: 25)
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 35, HeavyHit: 1)
-----------------> RollerProjectile: Destroy
-----------------> System: Set CamState to 2
------------[[Роллер: Полет до касания земли]]
----------------+ System: Every tick
----------------+ System: For each RollerProjectile
----------------+ RollerProjectile: [X] Is IsRolling
-----------------> RollerProjectile: Set angle to RollerProjectile.Bullet.AngleOfMotion degrees
------------[[Роллер: Взрыв по таймеру]]
----------------+ RollerProjectile: RollLife ≤ 0
----------------+ RollerProjectile: Is IsRolling
-----------------> Functions: Call VideoBoomFXGround (X: RollerProjectile.X, Y: RollerProjectile.Y, ColorType: 0)
-----------------> Functions: Call Blast (x: RollerProjectile.X, y: RollerProjectile.Y-5, Radius: 20)
-----------------> RollerProjectile: Destroy
-----------------> System: Set CamState to 2
-----------------> Functions: Call SwapPlayer
--------------------+ System: ActivePlayer = "Player2"
---------------------> System: Set LastShotError to (PlayerTank.X - RollerProjectile.X) × 0.7
--------[[ИОННАЯ ПУШКА: Удар по Земле или Танку]]
------------[[ФИКС КАМЕРЫ ДЛЯ МАЯКА]]
----------------+ System: Every tick
----------------+ System: For each BeaconProjectile
----------------+ System: BeaconProjectile.Count > 0
-----------------> System: Set CamState to 5
-----------------> System: Set CamTargetX to BeaconProjectile.X
-----------------> System: Set CamTargetY to BeaconProjectile.Y
-----------------> System: Set CamTargetZoom to 1.5
------------[[ИОННАЯ ПУШКА: Удар по Земле]]
----------------+ BeaconProjectile: On collision with GroundTilemap
----------------+ BeaconProjectile: Bullet is enabled
-----------------> BeaconProjectile: Set Bullet Disabled
-----------------> BeaconProjectile: Set animation to "Deployed" (play from beginning)
-----------------> BeaconProjectile: Set Y to BeaconProjectile.Y + 5
-----------------> BeaconProjectile: Set angle to 0 degrees
-----------------> Functions: Call IonStrike (BeaconUID: BeaconProjectile.UID)
--------------------+ System: ActivePlayer = "Player2"
---------------------> System: Set LastShotError to (PlayerTank.X - BeaconProjectile.X) × 0.7
------------[[ИОННАЯ ПУШКА: Удар по Танку]]
----------------+ BeaconProjectile: On collision with Players
----------------+ Players: isDestroyed = 0
----------------+ BeaconProjectile: Bullet is enabled
-----------------> BeaconProjectile: Set Bullet Disabled
-----------------> BeaconProjectile: Set animation to "Deployed" (play from beginning)
-----------------> BeaconProjectile: Set angle to 0 degrees
-----------------> Functions: Call IonStrike (BeaconUID: BeaconProjectile.UID)
------------[[IonStrike] Функция Удара Молнии]
----------------* On function 'IonStrike'
----------------* Parameter 'BeaconUID' (Number)
--------------------+ BeaconProjectile: Pick instance with UID BeaconUID
---------------------> System: Set CamState to 5
---------------------> System: Set CamTargetX to BeaconProjectile.X
---------------------> System: Set CamTargetY to BeaconProjectile.Y
---------------------> System: Set CamTargetZoom to 1.6
---------------------> System: Set CamSpeed to 10
// Луч света вверх
------------------------+ (no conditions)
-------------------------> System: Create object LaserBeamBlue on layer "Game" at (BeaconProjectile.X-4, BeaconProjectile.Y), create hierarchy: False, template: ""
-------------------------> LaserBeamBlue: Set angle to 270 degrees
-------------------------> LaserBeamBlue: Set size to (2000, 5)
-------------------------> LaserBeamBlue: Set blend mode to Additive
-------------------------> LaserBeamBlue: Set color to rgb(255, 0, 0)
-------------------------> LaserBeamBlue: Set opacity to 100
-------------------------> LaserBeamBlue: Set Physics disabled
------------------------+ System: For "Pulse" from 0 to 4
-------------------------> System: Wait (LoopIndex("Pulse") × 0.25) seconds (use time scale: True)
-------------------------> System: Create object GlowPuff on layer "Game" at (BeaconProjectile.X, BeaconProjectile.Y - 5), create hierarchy: False, template: ""
-------------------------> GlowPuff: Set Age to 0
-------------------------> GlowPuff: Set Life to 0.2
-------------------------> GlowPuff: Set T to 0
-------------------------> GlowPuff: Set vx to 0
-------------------------> GlowPuff: Set vy to 0
-------------------------> GlowPuff: Set PuffScale to 1.2
-------------------------> GlowPuff: Set scale to 1.2
-------------------------> GlowPuff: Set Grow to 0.5
-------------------------> GlowPuff: Set color to rgb(205, 92, 92)
-------------------------> GlowPuff: Set opacity to 25
-------------------------> GlowPuff: Move in front GroundTilemap
------------------------+ (no conditions)
-------------------------> System: Wait 1.5 seconds (use time scale: True)
-------------------------> LaserBeamBlue: Destroy
-------------------------> System: Create object FlashScreen on layer "UI" at (ViewportMidX("UI"), ViewportMidY("UI")), create hierarchy: False, template: ""
-------------------------> FlashScreen: Set size to (ViewportWidth("UI") + 200, ViewportHeight("UI") + 200)
-------------------------> System: Create object LightningBeam on layer "Game" at (BeaconProjectile.X, BeaconProjectile.Y), create hierarchy: False, template: ""
-------------------------> LightningBeam: Set height to 2000
-------------------------> LightningBeam: Fade: set fade-out time to 0.5
-------------------------> System: Set ShakePower to 40
-------------------------> System: Create object SmokeParticles2 on layer "Game" at (BeaconProjectile.X, BeaconProjectile.Y), create hierarchy: False, template: ""
-------------------------> SmokeParticles2: Set spraying
-------------------------> SmokeParticles2: Set rate to 500
-------------------------> GroundTilemap: Erase tile range (GroundTilemap.PositionToTileX(BeaconProjectile.X) - 3, GroundTilemap.PositionToTileY(BeaconProjectile.Y) + 2) area 6 x 6
-------------------------> Functions: Call HitStop
----------------------------+ System: Repeat 5 times
-----------------------------> Functions: Call VideoBoomFX (X: BeaconProjectile.X, Y: BeaconProjectile.Y + (LoopIndex × 30))
-----------------------------> Functions: Call Blast (x: BeaconProjectile.X, y: BeaconProjectile.Y + (LoopIndex × 30), Radius: 30)
-----------------------------> Functions: Call RenderTerrain (FromX: max(0, BeaconProjectile.X - 40), ToX: min(LayoutWidth, BeaconProjectile.X + 40))
----------------------------+ System: For each Players
----------------------------+ Players: isDestroyed = 0
----------------------------+ System: abs(Players.X - BeaconProjectile.X) < 60
----------------------------+ System: Players.Y < BeaconProjectile.Y + 50
-----------------------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 70, HeavyHit: 1)
-----------------------------> Players: Set VelY to -500
-----------------------------> Players: Set isGrounded to 0
----------------------------+ (no conditions)
-----------------------------> BeaconProjectile: Destroy
-----------------------------> System: Wait 1.0 seconds (use time scale: True)
-----------------------------> Functions: Call IonFinish
----------------+ System: On start of layout
-----------------> FlashScreen: Destroy
------------[[IonStrike] Функция Удара Молнии2]
----------------* On function 'IonFinish'
--------------------+ System: MatchResult = ""
--------------------+ PlayerTank: isDestroyed = 0
--------------------+ BotTank: isDestroyed = 0
---------------------> Functions: Call SwapPlayer
--------[[УДАР ПО ПЛОЩАДИ: Касание Земли или Танка]]
------------+ AreaProjectile: On collision with GroundTilemap
------------+ AreaProjectile: Bullet is enabled
-------------> AreaProjectile: Set Bullet Disabled
-------------> AreaProjectile: Set visibility Invisible
-------------> System: Set CamState to 5
-------------> System: Set CamTargetX to AreaProjectile.X
-------------> System: Set CamTargetY to AreaProjectile.Y
----------------+ System: For "Bombing" from 0 to 4
-----------------> System: Wait (LoopIndex("Bombing") × 0.25) seconds (use time scale: True)
-----------------> Functions: Call AreaBlast (CenterX: AreaProjectile.X, CenterY: AreaProjectile.Y)
----------------+ (no conditions)
-----------------> System: Wait 1.5 seconds (use time scale: True)
--------------------+ System: ActivePlayer = "Player2"
---------------------> System: Set LastShotError to (PlayerTank.X - AreaProjectile.X) × 0.7
--------------------+ (no conditions)
---------------------> AreaProjectile: Destroy
---------------------> Functions: Call SwapPlayer
------------[[УДАР ПО ПЛОЩАДИ: Касание Танка]]
----------------+ Players: On collision with AreaProjectile
----------------+ Players: isDestroyed = 0
----------------+ AreaProjectile: Bullet is enabled
-----------------> AreaProjectile: Set Bullet Disabled
-----------------> System: Set CamState to 5
-----------------> System: Set CamTargetX to AreaProjectile.X
-----------------> System: Set CamTargetY to AreaProjectile.Y
--------------------+ System: For "Bombing" from 0 to 2
---------------------> System: Wait (LoopIndex("Bombing") × 0.25) seconds (use time scale: True)
---------------------> Functions: Call AreaBlast (CenterX: AreaProjectile.X, CenterY: AreaProjectile.Y)
--------------------+ (no conditions)
---------------------> System: Wait 1.5 seconds (use time scale: True)
---------------------> AreaProjectile: Destroy
---------------------> Functions: Call SwapPlayer
------------[[Функция случайного взрыва]]
| Local number randX = 0
| Local number randY = 0
----------------* On function 'AreaBlast'
----------------* Parameter 'CenterX' (Number)
----------------* Parameter 'CenterY' (Number)
-----------------> System: Set randX to CenterX + random(-75, 75)
-----------------> System: Set randY to CenterY + random(-10, 40)
-----------------> System: Set ShakePower to 25
-----------------> Functions: Call VideoBoomFXGround (X: randX, Y: randY, ColorType: 0)
-----------------> System: Create object SmokeParticles2 on layer "Game" at (randX, randY), create hierarchy: False, template: ""
-----------------> SmokeParticles2: Set spraying
-----------------> SmokeParticles2: Set rate to 200
-----------------> Functions: Call Blast (x: randX, y: randY, Radius: 20)
--------------------+ System: For each Players
--------------------+ Players: isDestroyed = 0
--------------------+ System: distance(Players.X, Players.Y, randX, randY) < 50
---------------------> System: Set BlastExcludeUID to Players.UID
---------------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 10, HeavyHit: 1)
--------[[ДВОЙНОЙ ЗАЛП: Столкновение]]
------------[[ДВОЙНОЙ ЗАЛП: Касание Танка]]
----------------+ HelixCenter: On collision with Players
----------------+ Players: isDestroyed = 0
----------------+ HelixCenter: Bullet speed > 0
----------------+ HelixCenter: Used = 0
-----------------> HelixCenter: Set Used to 1
-----------------> HelixCenter: Set Bullet speed to 0
-----------------> System: Set CamState to 2
--------------------+ System: For each DoubleProj
---------------------> System: Create object SmokeParticles2 on layer "Game" at (DoubleProj.X, DoubleProj.Y), create hierarchy: False, template: ""
---------------------> SmokeParticles2: Set spraying
---------------------> Functions: Call Blast (x: DoubleProj.X, y: DoubleProj.Y, Radius: 20)
------------------------+ System: For each Players
------------------------+ Players: isDestroyed = 0
------------------------+ System: distance(Players.X, Players.Y, DoubleProj.X, DoubleProj.Y) < 50
-------------------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 17, HeavyHit: 1)
--------------------+ (no conditions)
---------------------> HelixCenter: Destroy
---------------------> DoubleProj: Destroy
---------------------> System: Wait 1.0 seconds (use time scale: True)
---------------------> Functions: Call SwapPlayer
------------+ HelixCenter: On collision with GroundTilemap
------------+ HelixCenter: Bullet speed > 0
------------+ HelixCenter: Used = 0
-------------> HelixCenter: Set Used to 1
-------------> HelixCenter: Set Bullet speed to 0
-------------> System: Set CamState to 2
----------------+ System: For each DoubleProj
-----------------> System: Create object SmokeParticles2 on layer "Game" at (DoubleProj.X, DoubleProj.Y), create hierarchy: False, template: ""
-----------------> Functions: Call VideoBoomFXGround (X: DoubleProj.X, Y: DoubleProj.Y, ColorType: 0)
-----------------> SmokeParticles2: Set spraying
-----------------> Functions: Call Blast (x: DoubleProj.X, y: DoubleProj.Y, Radius: 20)
--------------------+ System: For each Players
--------------------+ Players: isDestroyed = 0
--------------------+ System: distance(Players.X, Players.Y, DoubleProj.X, DoubleProj.Y) < 50
---------------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 10, HeavyHit: 1)
----------------+ (no conditions)
--------------------+ System: ActivePlayer = "Player2"
---------------------> System: Set LastShotError to (PlayerTank.X - HelixCenter.X) × 0.7
--------------------+ (no conditions)
---------------------> HelixCenter: Destroy
---------------------> DoubleProj: Destroy
---------------------> System: Wait 1.0 seconds (use time scale: True)
---------------------> Functions: Call SwapPlayer
------------[[Математика Двойного Залпа (Спираль)]]
----------------+ System: Every tick
----------------+ System: HelixCenter.Count > 0
----------------+ System: For each DoubleProj
-----------------> System: Set SampleX to sin(time × 250 + DoubleProj.Phase) × 5
-----------------> DoubleProj: Set X to HelixCenter.X + (cos(HelixCenter.Bullet.AngleOfMotion - 90) × SampleX)
-----------------> DoubleProj: Set Y to HelixCenter.Y + (sin(HelixCenter.Bullet.AngleOfMotion - 90) × SampleX)
-----------------> DoubleProj: Set angle to HelixCenter.Bullet.AngleOfMotion degrees
--------[[ТЕЛЕПОРТ: Касание Земли или Танка]]
| Local number pAng = 0
------------+ TeleportProjectile: On collision with GroundTilemap
------------+ TeleportProjectile: Bullet speed > 0
-------------> TeleportProjectile: Set Bullet speed to 0
-------------> TeleportProjectile: Set Bullet Disabled
-------------> System: Set CamState to 2
----------------+ System: For each Players
----------------+ Players: Owner = ActivePlayer
----------------+ barrel: Is ActivePlayer
--------------------+ System: Repeat 20 times
---------------------> System: Set pAng to LoopIndex × -7
---------------------> System: Create object BoomPuff on layer "Game" at (Players.X + cos(pAng) × random(10, 25), Players.Y + sin(pAng) × random(10, 25)), create hierarchy: False, template: ""
---------------------> BoomPuff: Set Type to 7
---------------------> BoomPuff: Set Age to 0
---------------------> BoomPuff: Set Life to 1
---------------------> BoomPuff: Set T to 0
---------------------> BoomPuff: Set vx to cos(pAng) × random(40, 80)
---------------------> BoomPuff: Set vy to sin(pAng) × random(40, 80)
---------------------> BoomPuff: Set PuffScale to random(0.3, 0.5)
---------------------> BoomPuff: Set scale to Self.PuffScale
---------------------> BoomPuff: Set angle to random(0, 360) degrees
---------------------> BoomPuff: Set Spin to random(-150, 150)
---------------------> BoomPuff: Set color to rgb(100, 200, 255)
---------------------> BoomPuff: Set opacity to 90
---------------------> Players: Set visibility Invisible
---------------------> barrel: Set visibility Invisible
---------------------> Players: Set VelX to 0
---------------------> Players: Set VelY to 0
---------------------> System: Set ShakePower to 15
----------------+ (no conditions)
-----------------> System: Wait 1.0 seconds (use time scale: True)
--------------------+ System: For each Players
--------------------+ Players: Owner = ActivePlayer
---------------------> Players: Set position to (TeleportProjectile.X, TeleportProjectile.Y-15)
---------------------> Players: Set isGrounded to 0
---------------------> Players: Set visibility Visible
---------------------> barrel: Set visibility Visible
--------------------+ System: Repeat 20 times
---------------------> System: Set pAng to LoopIndex × -7
---------------------> System: Create object BoomPuff on layer "Game" at (Players.X + cos(pAng) × random(10, 25), Players.Y + sin(pAng) × random(10, 25)), create hierarchy: False, template: ""
---------------------> BoomPuff: Set Type to 7
---------------------> BoomPuff: Set Age to 0
---------------------> BoomPuff: Set Life to 1
---------------------> BoomPuff: Set T to 0
---------------------> BoomPuff: Set vx to cos(pAng) × random(40, 80)
---------------------> BoomPuff: Set vy to sin(pAng) × random(40, 80)
---------------------> BoomPuff: Set PuffScale to random(0.3, 0.5)
---------------------> BoomPuff: Set scale to Self.PuffScale
---------------------> BoomPuff: Set angle to random(0, 360) degrees
---------------------> BoomPuff: Set Spin to random(-150, 150)
---------------------> BoomPuff: Set color to rgb(100, 200, 255)
---------------------> BoomPuff: Set opacity to 90
------------------------+ System: ActivePlayer = "Player2"
-------------------------> System: Set LastShotError to (PlayerTank.X - TeleportProjectile.X) × 0.8
------------------------+ (no conditions)
-------------------------> TeleportProjectile: Destroy
-------------------------> Functions: Call SwapPlayer
------------[[ТЕЛЕПОРТ: Касание Танка (Врага) - ОБМЕН МЕСТАМИ]]
----------------+ TeleportProjectile: On collision with Players
----------------+ Players: isDestroyed = 0
----------------+ TeleportProjectile: Bullet speed > 0
-----------------> TeleportProjectile: Set Bullet speed to 0
-----------------> TeleportProjectile: Set Bullet Disabled
-----------------> System: Set CamState to 2
----------------// --- 1. Сохраняем координаты игрока во временные переменные --
-----------------> System: Set SampleX to PlayerTank.X
-----------------> System: Set SampleY to PlayerTank.Y
----------------// --- 2. Эффекты исчезновения на СТАРЫХ позициях обоих танков ---
-----------------> Functions: Call VideoBoomFXGround (X: Players.X, Y: Players.Y, ColorType: 0)
-----------------> System: Create object SmokeParticles2 on layer "Game" at (Players.X, Players.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles2: Set spraying
-----------------> Functions: Call VideoBoomFXGround (X: Players.X, Y: Players.Y, ColorType: 0)
-----------------> System: Create object SmokeParticles2 on layer "Game" at (Players.X, Players.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles2: Set spraying
----------------// --- 3. Меняем танки местами ---
-----------------> PlayerTank: Set position to (BotTank.X, BotTank.Y)
-----------------> BotTank: Set position to (SampleX, SampleY)
----------------// --- 4. Сбрасываем физику, чтобы они не застряли в земле и не улетели по инерции ---
-----------------> PlayerTank: Set isGrounded to 0
-----------------> PlayerTank: Set VelX to 0
-----------------> PlayerTank: Set VelY to 0
-----------------> BotTank: Set isGrounded to 0
-----------------> BotTank: Set VelX to 0
-----------------> BotTank: Set VelY to 0
----------------// --- 5. Эффекты появления на НОВЫХ позициях ---
-----------------> Functions: Call VideoBoomFXGround (X: Players.X, Y: Players.Y, ColorType: 0)
-----------------> System: Create object SmokeParticles2 on layer "Game" at (Players.X, Players.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles2: Set spraying
-----------------> Functions: Call VideoBoomFXGround (X: Players.X, Y: Players.Y, ColorType: 0)
-----------------> System: Create object SmokeParticles2 on layer "Game" at (Players.X, Players.Y), create hierarchy: False, template: ""
-----------------> System: Set ShakePower to 15
--------------------+ (no conditions)
---------------------> System: Wait 1.0 seconds (use time scale: True)
---------------------> TeleportProjectile: Destroy
---------------------> Functions: Call SwapPlayer
--------[[ЯДЕРНАЯ БОМБА: Столкновение с Землей и Танком]]
------------[[ЯДЕРНАЯ БОМБА: Столкновение с Землей]]
----------------+ NukeProjectile: On collision with GroundTilemap
----------------+ NukeProjectile: Bullet is enabled
-----------------> NukeProjectile: Set Bullet Disabled
-----------------> Functions: Call NukeStrike (NukeUID: NukeProjectile.UID)
--------------------+ System: ActivePlayer = "Player2"
---------------------> System: Set LastShotError to (PlayerTank.X - NukeProjectile.X) × 0.8
------------[[ЯДЕРНАЯ БОМБА: Столкновение с Танком]]
----------------+ NukeProjectile: On collision with Players
----------------+ Players: isDestroyed = 0
----------------+ NukeProjectile: Bullet is enabled
-----------------> NukeProjectile: Set Bullet Disabled
-----------------> Functions: Call NukeStrike (NukeUID: NukeProjectile.UID)
------------[Функция [ЯДЕРНЫЙ ВЗРЫВ]]
----------------* On function 'NukeStrike'
----------------* Parameter 'NukeUID' (Number)
--------------------+ NukeProjectile: Pick instance with UID NukeUID
---------------------> NukeProjectile: Set Bullet Disabled
---------------------> System: Set CamState to 5
---------------------> System: Scroll to (NukeProjectile.X, NukeProjectile.Y)
---------------------> System: Set CamTargetZoom to 1
---------------------> System: Wait 0.5 seconds (use time scale: True)
---------------------> System: Create object FlashScreen on layer "UI" at (ViewportMidX("UI"), ViewportMidY("UI")), create hierarchy: False, template: ""
---------------------> FlashScreen: Set size to (ViewportWidth("UI") + 200, ViewportHeight("UI") + 200)
---------------------> System: Set ShakePower to 60
---------------------> NukeProjectile: Set visibility Invisible
---------------------> Functions: Call NuclearBlast (X: NukeProjectile.X, Y: NukeProjectile.Y, Radius: 90)
---------------------> Functions: Call HitStop
------------------------+ System: For each Players
------------------------+ Players: isDestroyed = 0
------------------------+ System: distance(Players.X, Players.Y, NukeProjectile.X, NukeProjectile.Y) ≤ 150
-------------------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 70, HeavyHit: 1)
-------------------------> Players: Set VelY to -500
----------------------------+ System: Players.X < NukeProjectile.X
-----------------------------> Players: Set VelX to -300
----------------------------+ System: Else
-----------------------------> Players: Set VelX to 300
------------------------+ (no conditions)
-------------------------> NukeProjectile: Destroy
-------------------------> System: Wait 2.5 seconds (use time scale: True)
-------------------------> Functions: Call SwapPlayer
------------[[Ядерный взрыв (процедурный)]]
| Local number pY = 0
| Local number pX = 0
| Local number d = 0
| Local number pSpd = 0
| Local number pAng = 0
----------------* On function 'NuclearBlast'
----------------* Parameter 'X' (Number)
----------------* Parameter 'Y' (Number)
----------------* Parameter 'Radius' (Number)
--------------------+ (no conditions)
---------------------> System: Set ShakePower to 60
---------------------> System: Create object TrailPuffFire on layer "UI" at (X, Y), create hierarchy: False, template: ""
---------------------> [DISABLED] TrailPuffFire: Set size to (X, Y)
---------------------> TrailPuffFire: Set opacity to 100
---------------------> TrailPuffFire: Fade: set fade-in time to 0
---------------------> TrailPuffFire: Fade: set wait time to 0
---------------------> TrailPuffFire: Fade: set fade-out time to 0.7
---------------------> TrailPuffFire: Fade: restart fade
---------------------> System: Create object Shockwave on layer "Ground" at (X, Y), create hierarchy: False, template: ""
---------------------> Shockwave: Set width to 140
---------------------> Shockwave: Set height to 140
---------------------> Shockwave: Set opacity to 100
---------------------> Functions: Call Blast (x: X, y: Y, Radius: Radius)
--------------------// ---------- ВСПЫШКА-ЗВЕЗДА (кадр 2 референса) ----------
---------------------> System: Create object GlowPuff on layer "Game" at (X, Y), create hierarchy: False, template: ""
---------------------> GlowPuff: Set Age to 0
---------------------> GlowPuff: Set Life to 0.35
---------------------> GlowPuff: Set T to 0
---------------------> GlowPuff: Set vx to 0
---------------------> GlowPuff: Set vy to 0
---------------------> GlowPuff: Set PuffScale to 0.6
---------------------> GlowPuff: Set Grow to 6
---------------------> GlowPuff: Set angle to random(0, 90) degrees
--------------------// ---------- большое ядро-свечение ----------
---------------------> System: Create object GlowPuff on layer "Game" at (X, Y), create hierarchy: False, template: ""
---------------------> GlowPuff: Set Age to 0
---------------------> GlowPuff: Set Life to 0.9
---------------------> GlowPuff: Set T to 0
---------------------> GlowPuff: Set vx to 0
---------------------> GlowPuff: Set vy to -20
---------------------> GlowPuff: Set PuffScale to 1.2
---------------------> GlowPuff: Set Grow to 3
// ---------- ПУНКТИРНЫЕ ЛУЧИ во все стороны ----------
------------------------+ System: Repeat 18 times
-------------------------> System: Set pAng to LoopIndex × 20 + random(-5, 5)
------------------------+ System: For "d" from 1 to 6
-------------------------> System: Create object GlowPuff on layer "Game" at (X + cos(pAng) × d × 30, Y + sin(pAng) × d × 30), create hierarchy: False, template: ""
-------------------------> GlowPuff: Set animation to "Glow" (play from beginning)
-------------------------> GlowPuff: Set Age to 0
-------------------------> GlowPuff: Set Life to 0.4 + d × 0.07
-------------------------> GlowPuff: Set T to 0
-------------------------> GlowPuff: Set vx to 0
-------------------------> GlowPuff: Set vy to 0
-------------------------> GlowPuff: Set PuffScale to 0.14 - d × 0.015
-------------------------> GlowPuff: Set Grow to 3
// ---------- СВЕТЯЩИЙСЯ СТОЛБ ----------
------------------------+ System: For "steam" from 0 to 14
-------------------------> System: Create object GlowPuff on layer "Game" at (X + random(-8, 8), Y - LoopIndex("stem") × 14), create hierarchy: False, template: ""
-------------------------> GlowPuff: Set animation to "Glow" (play from beginning)
-------------------------> GlowPuff: Set Age to 0
-------------------------> GlowPuff: Set Life to random(1.0, 1.8)
-------------------------> GlowPuff: Set T to 0
-------------------------> GlowPuff: Set vx to random(-6, 6)
-------------------------> GlowPuff: Set vy to -random(60, 140)
-------------------------> GlowPuff: Set PuffScale to 0.45 + LoopIndex("stem") × 0.03
-------------------------> GlowPuff: Set Grow to 0.7
// ---------- СВЕТЯЩИЙСЯ КУПОЛ ----------
------------------------+ System: Repeat 10 times
-------------------------> System: Set pAng to LoopIndex × 36
-------------------------> System: Create object GlowPuff on layer "Game" at (X + cos(pAng) × 45, Y - 210 + sin(pAng) × 28), create hierarchy: False, template: ""
-------------------------> GlowPuff: Set animation to "Glow" (play from beginning)
-------------------------> GlowPuff: Set Age to 0
-------------------------> GlowPuff: Set Life to random(1.8, 2.8)
-------------------------> GlowPuff: Set T to 0
-------------------------> GlowPuff: Set vx to cos(pAng) × 12
-------------------------> GlowPuff: Set vy to -random(10, 30)
-------------------------> GlowPuff: Set PuffScale to 0.9
-------------------------> GlowPuff: Set Grow to 1.1
// ---------- 2. Белое ядро (крупное и живёт долго) ----------
------------------------+ System: Repeat 6 times
-------------------------> System: Create object BoomPuff on layer "Game" at (X + random(-25, 25), Y + random(-25, 10)), create hierarchy: False, template: ""
-------------------------> BoomPuff: Set Type to 10
-------------------------> BoomPuff: Set Age to 0
-------------------------> BoomPuff: Set Life to 1.4 + LoopIndex × 0.3
-------------------------> BoomPuff: Set T to 0
-------------------------> BoomPuff: Set vx to 0
-------------------------> BoomPuff: Set vy to -random(5, 20)
-------------------------> BoomPuff: Set PuffScale to 2.2 + LoopIndex × 0.5
-------------------------> BoomPuff: Set scale to Self.PuffScale
-------------------------> BoomPuff: Set color to rgb(255, 255, 245)
-------------------------> BoomPuff: Set opacity to 100
// ---------- 3. Искры (много и быстрые) ----------
------------------------+ System: Repeat 45 times
-------------------------> System: Set pAng to random(190, 350)
-------------------------> System: Set pSpd to random(150, 650)
-------------------------> System: Create object BoomPuff on layer "Game" at (X + random(-25, 25), Y + random(-15, 10)), create hierarchy: False, template: ""
-------------------------> BoomPuff: Set Type to 6
-------------------------> BoomPuff: Set Age to 0
-------------------------> BoomPuff: Set Life to random(1.4, 3.1)
-------------------------> BoomPuff: Set T to 0
-------------------------> BoomPuff: Set vx to cos(pAng) × pSpd
-------------------------> BoomPuff: Set vy to sin(pAng) × pSpd
-------------------------> BoomPuff: Set PuffScale to random(0.06, 0.16)
-------------------------> BoomPuff: Set scale to Self.PuffScale
-------------------------> BoomPuff: Set opacity to 100
----------------------------+ System: LoopIndex % 4 = 0
-----------------------------> BoomPuff: Set color to rgb(255, 255, 230)
----------------------------+ System: Else
-----------------------------> BoomPuff: Set color to rgb(255, 190, 40)
// ---------- 4. Обломки ----------
------------------------+ System: Repeat 16 times
-------------------------> System: Create object Debris on layer "Game" at (X, Y), create hierarchy: False, template: ""
-------------------------> Debris: Set Bullet speed to random(100, 450)
-------------------------> Debris: Set Bullet angle of motion to random(-160, -20) degrees
-------------------------> Debris: Set scale to random(0.5, 2.2)
// ---------- 5. Ножка гриба: растёт снизу вверх ----------
------------------------+ System: For "steam" from 0 to 14
-------------------------> System: Set pY to Y - LoopIndex("stem") × 18
-------------------------> System: Set pX to X + sin(LoopIndex("stem") × 1.7) × 8
----------------------------+ System: Repeat 4 times
-----------------------------> System: Create object BoomPuff on layer "Game" at (pX, pY), create hierarchy: False, template: ""
-----------------------------> BoomPuff: Set Type to 5
-----------------------------> BoomPuff: Set Age to 0
-----------------------------> BoomPuff: Set Life to random(4.0, 6.0)
-----------------------------> BoomPuff: Set T to 0
-----------------------------> BoomPuff: Set vx to random(-8, 8)
-----------------------------> BoomPuff: Set vy to random(-25, -8)
-----------------------------> BoomPuff: Set PuffScale to 0.6 + LoopIndex("stem") × 0.05 + random(-0.1, 0.1)
-----------------------------> BoomPuff: Set scale to Self.PuffScale
-----------------------------> BoomPuff: Set opacity to 100
-----------------------------> System: Wait 0.04 seconds (use time scale: True)
// ---------- 5b. Дополнительное кольцо вокруг ножки (объём) ----------
------------------------+ System: For "ring" from 0 to 10
-------------------------> System: Set pAng to LoopIndex("ring") × 36
-------------------------> System: Set pY to Y - 100 - LoopIndex("ring") × 15
-------------------------> System: Set pX to X + cos(pAng) × random(15, 35)
-------------------------> System: Create object BoomPuff on layer "Game" at (pX, pY), create hierarchy: False, template: ""
-------------------------> BoomPuff: Set Type to 5
-------------------------> BoomPuff: Set Age to 0
-------------------------> BoomPuff: Set Life to random(3.5, 5.0)
-------------------------> BoomPuff: Set T to 0
-------------------------> BoomPuff: Set vx to cos(pAng + 180) × random(5, 15)
-------------------------> BoomPuff: Set vy to -random(10, 30)
-------------------------> BoomPuff: Set PuffScale to random(0.5, 0.9)
-------------------------> BoomPuff: Set scale to Self.PuffScale
-------------------------> BoomPuff: Set opacity to 90
// ---------- 6. Купол: плотное кольцо ----------
------------------------+ System: Repeat 24 times
-------------------------> System: Set pAng to (LoopIndex × 15) + random(-8, 8)
-------------------------> System: Create object BoomPuff on layer "Game" at (X + cos(pAng) × random(20, 90), Y - 200 + sin(pAng) × random(15, 55)), create hierarchy: False, template: ""
-------------------------> BoomPuff: Set Type to 5
-------------------------> BoomPuff: Set Age to 0
-------------------------> BoomPuff: Set Life to random(5.0, 7.0)
-------------------------> BoomPuff: Set T to 0
-------------------------> BoomPuff: Set vx to cos(pAng) × random(8, 35)
-------------------------> BoomPuff: Set vy to -random(10, 45)
-------------------------> BoomPuff: Set PuffScale to random(1.2, 2.2)
-------------------------> BoomPuff: Set scale to Self.PuffScale
-------------------------> BoomPuff: Set opacity to 100
-------------------------> System: Wait 0.25 seconds (use time scale: True)
// ---------- 7. Вторая волна купола (объём) ----------
------------------------+ System: Repeat 12 times
-------------------------> System: Set pAng to random(0, 360)
-------------------------> System: Create object BoomPuff on layer "Game" at (X + cos(pAng) × random(0, 70), Y - 220 + sin(pAng) × random(0, 40)), create hierarchy: False, template: ""
-------------------------> BoomPuff: Set Type to 5
-------------------------> BoomPuff: Set Age to 0
-------------------------> BoomPuff: Set Life to random(4.5, 6.5)
-------------------------> BoomPuff: Set T to 0
-------------------------> BoomPuff: Set vx to cos(pAng) × random(5, 25)
-------------------------> BoomPuff: Set vy to -random(15, 50)
-------------------------> BoomPuff: Set PuffScale to random(1.0, 1.8)
-------------------------> BoomPuff: Set scale to Self.PuffScale
-------------------------> BoomPuff: Set opacity to 100
// ---------- 8. Пылевое кольцо по земле (base surge) ----------
------------------------+ System: Repeat 20 times
-------------------------> System: Set pAng to choose(-1, 1)
-------------------------> System: Create object BoomPuff on layer "Game" at (X + random(-30, 30), Y - random(0, 20)), create hierarchy: False, template: ""
-------------------------> BoomPuff: Set Type to 5
-------------------------> BoomPuff: Set Age to 0
-------------------------> BoomPuff: Set Life to random(1.8, 2.8)
-------------------------> BoomPuff: Set T to 0
-------------------------> BoomPuff: Set vx to pAng × random(60, 160)
-------------------------> BoomPuff: Set vy to -random(5, 25)
-------------------------> BoomPuff: Set PuffScale to random(0.7, 1.3)
-------------------------> BoomPuff: Set scale to Self.PuffScale
-------------------------> BoomPuff: Set opacity to 100
// ---------- 9. Тлеющие угли в кратере ----------
------------------------+ System: Repeat 8 times
-------------------------> System: Create object BoomPuff on layer "Game" at (X + random(-70, 70), Y + random(-15, 5)), create hierarchy: False, template: ""
-------------------------> BoomPuff: Set Type to 5
-------------------------> BoomPuff: Set Age to 0
-------------------------> BoomPuff: Set Life to random(1.5, 2.5)
-------------------------> BoomPuff: Set T to 0
-------------------------> BoomPuff: Set vx to random(-8, 8)
-------------------------> BoomPuff: Set vy to -random(10, 35)
-------------------------> BoomPuff: Set PuffScale to random(0.4, 0.8)
-------------------------> BoomPuff: Set scale to Self.PuffScale
-------------------------> BoomPuff: Set opacity to 100
------------------------// ---------- 10. Повторная вспышка (двойной блик, как у реального взрыва) ----------
-------------------------> [DISABLED] System: Wait 0.12 seconds (use time scale: True)
-------------------------> [DISABLED] System: Create object FlashScreen on layer "UI" at (ViewportMidX("UI"), ViewportMidY("UI")), create hierarchy: False, template: ""
-------------------------> [DISABLED] FlashScreen: Set size to (ViewportWidth("UI") + 200, ViewportHeight("UI") + 200)
-------------------------> [DISABLED] FlashScreen: Set opacity to 40
-------------------------> [DISABLED] FlashScreen: Fade: set fade-in time to 0
-------------------------> [DISABLED] FlashScreen: Fade: set wait time to 0
-------------------------> [DISABLED] FlashScreen: Fade: set fade-out time to 0.2
-------------------------> [DISABLED] FlashScreen: Fade: restart fade
------------[[GlowPuff: аддитивное свечение]]
----------------+ System: Every tick
----------------+ System: For each GlowPuff
-----------------> GlowPuff: Set Age to Self.Age + (dt ÷ timescale)
-----------------> GlowPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
-----------------> GlowPuff: Set X to Self.X + Self.vx × (dt ÷ timescale)
-----------------> GlowPuff: Set Y to Self.Y + Self.vy × (dt ÷ timescale)
-----------------> GlowPuff: Set PuffScale to Self.PuffScale + Self.Grow × (dt ÷ timescale)
-----------------> GlowPuff: Set scale to Self.PuffScale
-----------------> GlowPuff: Set opacity to 100 × clamp((1 - Self.T) ÷ 0.5, 0, 1)
--------------------+ GlowPuff: Age ≥ Self.Life
---------------------> GlowPuff: Destroy
--------[[FountainProjectile попадание по земле и танку]]
| Local number fx = 0
| Local number fy = 0
------------+ FountainProjectile: On collision with GroundTilemap
-------------> Functions: Call VideoBoomFXGround (X: FountainProjectile.X, Y: FountainProjectile.Y, ColorType: 0)
-------------> System: Set fx to FountainProjectile.X
-------------> System: Set fy to FountainProjectile.Y
-------------> System: Create object SmokeParticles2 on layer "Game" at (FountainProjectile.X, FountainProjectile.Y), create hierarchy: False, template: ""
-------------> SmokeParticles2: Set spraying
-------------> Functions: Call SplitFountain (x: fx, y: fy-5)
-------------> Functions: Call Blast (x: fx, y: fy-5, Radius: 12)
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - fx) × 0.7
----------------+ (no conditions)
-----------------> FountainProjectile: Destroy
------------[[[Фонтан: Прямое попадание]]]
----------------+ Players: On collision with FountainProjectile
----------------+ Players: isDestroyed = 0
-----------------> System: Create object SmokeParticles on layer "Game" at (FountainProjectile.X, FountainProjectile.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles: Set spraying
-----------------> Functions: Call SplitFountain (x: FountainProjectile.X, y: FountainProjectile.Y)
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Functions: Call Blast (x: Players.X, y: Players.Y-7, Radius: 12)
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 15, HeavyHit: 1)
-----------------> FountainProjectile: Destroy
------------[[FountainBomb: попадание по земле и танку]]
----------------+ FountainBomb: On collision with GroundTilemap
-----------------> Functions: Call VideoBoomFXGround (X: FountainBomb.X, Y: FountainBomb.Y, ColorType: 0)
-----------------> System: Create object SmokeParticles on layer "Game" at (FountainBomb.X, FountainBomb.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles: Set spraying
-----------------> System: Create object SmokeParticles2 on layer "Game" at (FountainBomb.X, FountainBomb.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles2: Set spraying
-----------------> Functions: Call Blast (x: FountainBomb.X, y: FountainBomb.Y-5, Radius: 12)
-----------------> FountainBomb: Destroy
----------------+ Players: On collision with FountainBomb
----------------+ Players: isDestroyed = 0
-----------------> System: Create object SmokeParticles on layer "Game" at (FountainBomb.X, FountainBomb.Y), create hierarchy: False, template: ""
-----------------> Functions: Call VideoBoomFX (X: FountainBomb.X, Y: FountainBomb.Y)
-----------------> SmokeParticles: Set spraying
-----------------> System: Create object SmokeParticles2 on layer "Game" at (FountainBomb.X, FountainBomb.Y), create hierarchy: False, template: ""
-----------------> SmokeParticles2: Set spraying
-----------------> Functions: Call Blast (x: FountainBomb.X, y: FountainBomb.Y-7, Radius: 12)
-----------------> FountainBomb: Destroy
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 15, HeavyHit: 1)
------------[[Функция SplitFountain]]
| Local number fAng = 0
| Local number fSpeed = 0
----------------* On function 'SplitFountain'
----------------* Parameter 'x' (Number)
----------------* Parameter 'y' (Number)
-----------------> System: Set ShakePower to 8
-----------------> Functions: Call VideoBoomFX (X: x, Y: y)
-----------------> FountainProjectile: Destroy
--------------------+ System: Repeat 4 times
---------------------> System: Set fAng to 270 + (-15 + (LoopIndex × 10))
---------------------> System: Set fSpeed to random(110, 150)
---------------------> System: Create object FountainBomb on layer "Game" at (x, y), create hierarchy: False, template: ""
---------------------> FountainBomb: Set angle to fAng degrees
---------------------> FountainBomb: Set Bullet angle of motion to fAng + random(-2, 2) degrees
---------------------> FountainBomb: Set Bullet speed to fSpeed
---------------------> FountainBomb: Set Bullet gravity to 220
------------[[Передача хода после Фонтана]]
----------------+ System: Every tick
----------------+ System: Is IsFountainActive
----------------+ System: FountainProjectile.Count = 0
----------------+ System: FountainBomb.Count = 0
----------------+ System: Trigger once
-----------------> System: Wait 1.0 seconds (use time scale: True)
-----------------> Functions: Call SwapPlayer
-----------------> System: Set IsFountainActive to False
--------[[[Умная Камера: Реакция на попадание]]]
------------+ AmmosFamily: On collision with GroundTilemap
------------+ AmmosFamily: [X] Is IsRoller
------------+ System: CurrentProjectileType ≠ 12
------------+ System: CurrentProjectileType ≠ 13
------------+ System: CurrentProjectileType ≠ 16
------------+ System: CurrentProjectileType ≠ 17
-------------> System: Set CamState to 2
-------------> System: Set CamTargetX to ammosFamily.X
-------------> System: Set CamTargetY to ammosFamily.Y
-------------> System: Set CamTargetZoom to 1.5
------------+ AmmosFamily: On collision with Players
------------+ System: CurrentProjectileType ≠ 12
------------+ System: CurrentProjectileType ≠ 16
------------+ System: CurrentProjectileType ≠ 17
-------------> System: Set CamState to 2
-------------> System: Set CamTargetX to ammosFamily.X
-------------> System: Set CamTargetY to ammosFamily.Y
-------------> System: Set CamTargetZoom to 1.5
--------[[Энергокупол: пульсация]]
------------+ System: Every tick
------------+ System: For each ShieldDome
-------------> ShieldDome: Set opacity to 50+ (sin(time × 200) × 10)
------------[[Энергокупол: индикация прочности]]
----------------+ [DISABLED] System: Every tick
----------------+ [DISABLED] System: For each ShieldDome
-----------------> [DISABLED] ShieldDome: Set opacity to clamp(20 + (ShieldDome.ShieldTurns × 20), 20, 60)
--------[[АВИАБОМБАРДИРОВКА]]
------------+ System: Every tick
------------+ System: Airplane.Count > 0
-------------> Airplane: Set X to Airplane.X + (cos(Airplane.Angle) × 300 × dt)
-------------> System: Set CamState to 5
-------------> System: Set CamTargetX to Airplane.X
-------------> System: Set CamTargetY to Airplane.Y + 50
-------------> System: Set CamTargetZoom to 1.2
// 1. ИГРОК нажимает Левую кнопку мыши для сброса
------------+ Touch: On any touch start
------------+ System: Is IsAirstrikeActive
------------+ System: ActivePlayer = "Player1"
------------+ Airplane: IsBombed = 0
------------+ System: Airplane.X > 0
------------+ System: Airplane.X < LayoutWidth
------------+ System: ShotTimer > 0.5
-------------> Airplane: Set IsBombed to 1
----------------+ System: For "b" from 0 to 4
-----------------> System: Create object AirstrikeBomb on layer "Game" at (Airplane.X - (cos(Airplane.Angle) × LoopIndex("b") × 50), Airplane.Y), create hierarchy: False, template: ""
-----------------> AirstrikeBomb: Set scale to 0.1
-----------------> AirstrikeBomb: Set Bullet speed to 50
-----------------> AirstrikeBomb: Set Bullet angle of motion to Airplane.Angle + 30 degrees
// 2. БОТ сбрасывает бомбы автоматически над Игроком
------------+ System: Every tick
------------+ System: Is IsAirstrikeActive
------------+ System: ActivePlayer = "Player2"
------------+ Airplane: IsBombed = 0
------------+ System: abs(Airplane.X - PlayerTank.X) < 150
-------------> Airplane: Set IsBombed to 1
----------------+ System: For "b" from 0 to 4
-----------------> System: Create object AirstrikeBomb on layer "Game" at (Airplane.X - (cos(Airplane.Angle) × LoopIndex("b") × 50), Airplane.Y), create hierarchy: False, template: ""
-----------------> AirstrikeBomb: Set scale to 0.1
-----------------> AirstrikeBomb: Set Bullet speed to 300
-----------------> AirstrikeBomb: Set Bullet angle of motion to Airplane.Angle - 30 degrees
// 3. УДАЛЕНИЕ САМОЛЕТА, ЕСЛИ УЛЕТЕЛ ЗА КРАЙ
------------+ Airplane: X < -300
-------------> Airplane: Destroy
------------+ Airplane: X > LayoutWidth + 300
-------------> Airplane: Destroy
------------+ System: Every tick
------------+ System: Is IsAirstrikeActive
------------+ System: AirstrikeBomb.Count = 0
------------+ System: Airplane.Count = 0
------------+ System: Trigger once
-------------> System: Wait 1.0 seconds (use time scale: True)
-------------> Functions: Call SwapPlayer
-------------> System: Set IsAirstrikeActive to False
------------[СТОЛКНОВЕНИЕ БОМБЫ С ЗЕМЛЕЙ]
----------------+ AirstrikeBomb: On collision with GroundTilemap
-----------------> Functions: Call Blast (x: AirstrikeBomb.X, y: AirstrikeBomb.Y, Radius: 35)
-----------------> Functions: Call VideoBoomFXGround (X: AirstrikeBomb.X, Y: AirstrikeBomb.Y, ColorType: 0)
-----------------> AirstrikeBomb: Destroy
-----------------> System: Set ShakePower to 15
-----------------> System: Set CamState to 2
----------------[СТОЛКНОВЕНИЕ БОМБЫ С ТАНКОМ]
--------------------+ Players: On collision with AirstrikeBomb
--------------------+ Players: isDestroyed = 0
---------------------> System: Set BlastExcludeUID to Players.UID
---------------------> Functions: Call Blast (x: Players.X, y: Players.Y, Radius: 35)
---------------------> Functions: Call VideoBoomFX (X: Players.X, Y: Players.Y)
---------------------> AirstrikeBomb: Destroy
---------------------> System: Set ShakePower to 15
---------------------> System: Set CamState to 2
---------------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 30, HeavyHit: 1)
---------------------> AirstrikeBomb: Destroy
---------------------> System: Set CamState to 2
--------[[НЛО: ОРБИТАЛЬНЫЙ УДАР]]
// 1. МАЯК ПАДАЕТ НА ЗЕМЛЮ ИЛИ В ТАНК
------------+ UFO_Beacon: On collision with GroundTilemap
------------+ UFO_Beacon: Bullet is enabled
-------------> UFO_Beacon: Set Bullet Disabled
-------------> UFO_Beacon: Set angle to 270 degrees
-------------> Functions: Call UFOStrike (BeaconUID: UFO_Beacon.UID)
------------+ UFO_Beacon: On collision with Players
------------+ Players: isDestroyed = 0
------------+ UFO_Beacon: Bullet is enabled
-------------> UFO_Beacon: Set Bullet Disabled
-------------> UFO_Beacon: Set angle to 270 degrees
-------------> Functions: Call UFOStrike (BeaconUID: UFO_Beacon.UID)
------------* On function 'UFOStrike'
------------* Parameter 'BeaconUID' (Number)
----------------+ UFO_Beacon: Pick instance with UID BeaconUID
-----------------> System: Set CamState to 5
-----------------> System: Set CamTargetX to clamp(UFO_Beacon.X, ViewportWidth("Game") ÷ (2 × LayoutScale), LayoutWidth - ViewportWidth("Game") ÷ (2 × LayoutScale))
-----------------> System: Set CamTargetY to UFO_Beacon.Y - 150
-----------------> System: Set CamTargetZoom to clamp(1.2, MinZoom, MaxZoom)
-----------------> System: Create object LaserBeamBlue on layer "Game" at (UFO_Beacon.X, UFO_Beacon.Y), create hierarchy: False, template: ""
-----------------> LaserBeamBlue: Set angle to 270 degrees
-----------------> LaserBeamBlue: Set size to (2000, 5)
-----------------> LaserBeamBlue: Set blend mode to Additive
-----------------> LaserBeamBlue: Set color to rgb(30, 144, 255)
-----------------> LaserBeamBlue: Set opacity to 100
-----------------> LaserBeamBlue: Set Physics disabled
-----------------> LaserBeamBlue: Pin Pin to UFO_Beacon (X: True, Y: True, angle: False, width: No, height: No, Z: False)
--------------------+ System: For "Pulse" from 0 to 4
---------------------> System: Wait (LoopIndex("Pulse") × 0.25) seconds (use time scale: True)
---------------------> System: Create object GlowPuff on layer "Game" at (UFO_Beacon.X, UFO_Beacon.Y - 5), create hierarchy: False, template: ""
---------------------> GlowPuff: Set Age to 0
---------------------> GlowPuff: Set Life to 0.2
---------------------> GlowPuff: Set T to 0
---------------------> GlowPuff: Set vx to 0
---------------------> GlowPuff: Set vy to 0
---------------------> GlowPuff: Set PuffScale to 1.2
---------------------> GlowPuff: Set scale to 1.2
---------------------> GlowPuff: Set Grow to 0.5
---------------------> GlowPuff: Set color to rgb(30, 144, 255)
---------------------> GlowPuff: Set opacity to 25
---------------------> GlowPuff: Move in front GroundTilemap
--------------------+ (no conditions)
---------------------> System: Wait 1.5 seconds (use time scale: True)
---------------------> LaserBeamBlue: Destroy
---------------------> System: Create object FlashScreen on layer "UI" at (ViewportMidX("UI"), ViewportMidY("UI")), create hierarchy: False, template: ""
---------------------> FlashScreen: Set size to (ViewportWidth("UI") + 200, ViewportHeight("UI") + 200)
----------------+ (no conditions)
-----------------> System: Wait 1.5 seconds (use time scale: True)
-----------------> System: Create object UFO_Ship on layer "Game" at (clamp(UFO_Beacon.X + choose(-400, 400), 100, LayoutWidth - 100), -300), create hierarchy: False, template: ""
-----------------> UFO_Ship: Set scale to 0.5
-----------------> UFO_Ship: Set TargetUID to UFO_Beacon.UID
-----------------> UFO_Ship: Tween "FlyInY" property Y to UFO_Beacon.Y - 250 in 2.2 seconds (Out Cubic, destroy: No, loop: No, ping pong: No, repeat count: 1)
-----------------> UFO_Ship: Tween "FlyInX" property X to UFO_Beacon.X in 1.2 seconds (Out Cubic, destroy: No, loop: No, ping pong: No, repeat count: 1)
------------+ UFO_Ship: On any Tween finished
-------------> Functions: Call UFO_FireLaser (ShipUID: UFO_Ship.UID, Depth: 0)
-------------> System: Wait 0.3 seconds (use time scale: True)
-------------> Functions: Call UFO_FireLaser (ShipUID: UFO_Ship.UID, Depth: 20)
-------------> System: Wait 0.3 seconds (use time scale: True)
-------------> Functions: Call UFO_FireLaser (ShipUID: UFO_Ship.UID, Depth: 40)
-------------> System: Wait 0.3 seconds (use time scale: True)
----------------+ UFO_Ship: Pick instance with UID UFO_Ship.UID
-----------------> UFO_Ship: Tween "FlyOutY" property Y to -400 in 0.8 seconds (In Cubic, destroy: Yes, loop: No, ping pong: No, repeat count: 1)
-----------------> UFO_Ship: Tween "FlyOutX" property X to UFO_Ship.X + choose(-300, 300) in 0.8 seconds (In Cubic, destroy: Yes, loop: No, ping pong: No, repeat count: 1)
----------------+ UFO_Beacon: Pick instance with UID UFO_Ship.TargetUID
-----------------> UFO_Beacon: Destroy
-----------------> System: Wait 1.0 seconds (use time scale: True)
-----------------> Functions: Call SwapPlayer
------------+ System: Every tick
------------+ System: For each UFO_Beacon
------------+ UFO_Beacon: [X] Bullet is enabled
-------------> UFO_Beacon: Set opacity to 60 + (40 × sin(time × 1000))
------------+ System: Every tick
------------+ System: UFO_Ship.Count > 0
-------------> System: Set CamState to 5
-------------> System: Set CamTargetX to clamp(UFO_Ship.X, ViewportWidth("Game") ÷ (2 × LayoutScale), LayoutWidth - ViewportWidth("Game") ÷ (2 × LayoutScale))
-------------> System: Set CamTargetY to clamp(UFO_Ship.Y + 150, ViewportHeight("Game") ÷ (2 × LayoutScale), LayoutHeight - ViewportHeight("Game") ÷ (2 × LayoutScale))
-------------> System: Set CamTargetZoom to clamp(1.2, MinZoom, MaxZoom)
| Local number currentGroundY = 0
------------* On function 'UFO_FireLaser'
------------* Parameter 'ShipUID' (Number)
------------* Parameter 'Depth' (Number)
----------------+ UFO_Ship: Pick instance with UID ShipUID
----------------+ UFO_Beacon: Pick instance with UID UFO_Ship.TargetUID
-----------------> UFO_Beacon: Set visibility Invisible
-----------------> System: Create object LaserBeamBlue on layer "Game" at (UFO_Ship.ImagePointX(1), UFO_Ship.ImagePointY(1)), create hierarchy: False, template: ""
-----------------> LaserBeamBlue: Set blend mode to Additive
-----------------> LaserBeamBlue: Set angle to 0 degrees
-----------------> System: Set currentGroundY to HeightMap.At(clamp(floor(UFO_Beacon.X), 0, LayoutWidth), 0)
-----------------> LaserBeamBlue: Set height to distance(UFO_Ship.X, UFO_Ship.Y, UFO_Beacon.X, currentGroundY) + 20
-----------------> LaserBeamBlue: Set width to 10
-----------------> LaserBeamBlue: Fade: set fade-out time to 0.2
-----------------> LaserBeamBlue: Fade: restart fade
-----------------> System: Set ShakePower to 25
-----------------> Functions: Call Blast (x: UFO_Beacon.X, y: UFO_Beacon.Y + Depth, Radius: 75)
-----------------> Functions: Call VideoBoomFXGround (X: UFO_Beacon.X, Y: currentGroundY, ColorType: 1)
--------------------+ System: For each Players
--------------------+ Players: isDestroyed = 0
--------------------+ System: distance(Players.X, Players.Y, UFO_Beacon.X, UFO_Beacon.Y) < 70
---------------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 15, HeavyHit: 1)
---------------------> Players: Set VelY to -300
------------------------+ System: Players.X < UFO_Beacon.X
-------------------------> Players: Set VelX to -400
------------------------+ System: Else
-------------------------> Players: Set VelX to 400
--------[[ДРОН-МАШИНКА (КАМИКАДЗЕ)]]
// 1. КАПСУЛА ПАДАЕТ НА ЗЕМЛЮ И ВЫПУСКАЕТ МАШИНКУ
------------+ RC_Capsule: On collision with GroundTilemap
-------------> RC_Capsule: Destroy
-------------> System: Create object RCDrone on layer "Game" at (RC_Capsule.X, RC_Capsule.Y - 10), create hierarchy: False, template: ""
-------------> RCDrone: Set scale to 0.1
-------------> RCDrone: Set Timer to 3
-------------> System: Create object SmokeParticles2 on layer "Game" at (RCDrone.X, RCDrone.Y), create hierarchy: False, template: ""
----------------+ System: ActivePlayer = "Player1"
-----------------> RCDrone: Set MoveDir to sign(BotTank.X - RCDrone.X)
----------------+ System: ActivePlayer = "Player2"
-----------------> RCDrone: Set MoveDir to sign(PlayerTank.X - RCDrone.X)
----------------+ (no conditions)
-----------------> System: Set CamState to 5
-----------------> System: Set CamTargetX to RCDrone.X
-----------------> System: Set CamTargetY to RCDrone.Y
----------------+ RCDrone: MoveDir > 0
-----------------> RCDrone: Set Mirrored
----------------+ RCDrone: MoveDir < 0
-----------------> RCDrone: Set Not mirrored
------------+ System: Every tick
------------+ System: For each RCDrone
-------------> RCDrone: Set VelX to RCDrone.MoveDir × 150
-------------> RCDrone: Set X to RCDrone.X + (RCDrone.VelX × dt)
-------------> RCDrone: Set Y to HeightMap.At(clamp(floor(RCDrone.X), 0, LayoutWidth), 0) - 8
-------------> System: Set SampleX to RCDrone.X
-------------> System: Set localAngle to angle(SampleX - 10, HeightMap.At(SampleX - 10, 0), SampleX + 10, HeightMap.At(SampleX + 10, 0))
-------------> RCDrone: Set angle to anglelerp(RCDrone.Angle, localAngle, 10 × dt) degrees
-------------> System: Create object TrailPuff on layer "Game" at (RCDrone.X, RCDrone.Y + 5), create hierarchy: False, template: ""
-------------> RCDrone: Subtract dt from Timer
-------------> System: Set CamState to 5
-------------> System: Set CamTargetX to RCDrone.X
-------------> System: Set CamTargetY to RCDrone.Y
------------+ System: Every tick
------------+ System: For each RCDrone
------------+ RCDrone: Timer ≤ 0
-------------> Functions: Call Blast (x: RCDrone.X, y: RCDrone.Y, Radius: 30)
-------------> Functions: Call VideoBoomFXGround (X: RCDrone.X, Y: RCDrone.Y, ColorType: 0)
-------------> RCDrone: Destroy
-------------> System: Set CamState to 2
-------------> System: Wait 1.0 seconds (use time scale: True)
-------------> Functions: Call SwapPlayer
------------+ RCDrone: On collision with Players
------------+ Players: isDestroyed = 0
-------------> Functions: Call Blast (x: RCDrone.X, y: RCDrone.Y, Radius: 35)
-------------> Functions: Call VideoBoomFX (X: RCDrone.X, Y: RCDrone.Y)
-------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 30, HeavyHit: 1)
-------------> RCDrone: Destroy
------------+ RC_Capsule: On collision with Players
------------+ Players: isDestroyed = 0
-------------> System: Set BlastExcludeUID to Players.UID
-------------> Functions: Call Blast (x: RCDrone.X, y: RCDrone.Y, Radius: 35)
-------------> Functions: Call VideoBoomFX (X: RCDrone.X, Y: RCDrone.Y)
-------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 30, HeavyHit: 1)
-------------> RC_Capsule: Destroy
--------[[ БЕШЕНЫЙ УЛЕЙ / РОЙ ДРОНОВ]]
| Local number TargetY = 0
| Local number distB = 0
| Local number distP = 0
| Local number beeTargetAngle = 0
| Local number TargetX = 0
------------+ HiveCapsule: On collision with GroundTilemap
------------+ OR HiveCapsule: Is overlapping Players
-------------> System: Set IsSwarmActive to 1
-------------> System: Set BlastExcludeUID to Players.UID
-------------> Functions: Call Blast (x: HiveCapsule.X, y: HiveCapsule.Y, Radius: 20)
----------------+ System: Repeat 5 times
-----------------> System: Create object AngryBee on layer "Game" at (HiveCapsule.X + random(-5,5), HiveCapsule.Y - 30), create hierarchy: False, template: ""
-----------------> AngryBee: Set scale to 0.1
-----------------> AngryBee: Set angle to 0 degrees
-----------------> AngryBee: Set HoverX to HiveCapsule.X - 100 + (LoopIndex × 40)
-----------------> AngryBee: Set HoverY to clamp(HiveCapsule.Y - 200, 50, LayoutHeight - 100)
-----------------> AngryBee: Set Bullet speed to random(200, 300)
-----------------> AngryBee: Set Bullet gravity to 0
-----------------> AngryBee: Set timer to 7+ (LoopIndex × 0.4)
-----------------> HiveCapsule: Destroy
// 2. Логика наведения и дерганого полета (Каждый тик)
------------+ System: Every tick
------------+ System: For each AngryBee
-------------> AngryBee: Subtract dt from timer
-------------> System: Create object TrailPuff on layer "Game" at (AngryBee.X + random(-3,3), AngryBee.Y + random(-3,3)), create hierarchy: False, template: ""
-------------> TrailPuff: Set scale to 0.15
-------------> AngryBee: Set angle to 0 degrees
----------------+ AngryBee: timer > 5
-----------------> AngryBee: Set Bullet angle of motion to angle(AngryBee.X, AngryBee.Y, AngryBee.HoverX, AngryBee.HoverY) degrees
-----------------> AngryBee: Set Bullet speed to distance(AngryBee.X, AngryBee.Y, AngryBee.HoverX, AngryBee.HoverY) × 4
-----------------> AngryBee: Set Y to AngryBee.Y + sin(time × 500 + AngryBee.UID × 20) × 0.5
----------------+ AngryBee: timer ≤ 5
-----------------> System: Set distP to 99999
-----------------> System: Set distB to 99999
--------------------+ PlayerTank: isDestroyed = 0
---------------------> System: Set distP to distance(AngryBee.X, AngryBee.Y, PlayerTank.X, PlayerTank.Y)
--------------------+ BotTank: isDestroyed = 0
---------------------> System: Set distB to distance(AngryBee.X, AngryBee.Y, BotTank.X, BotTank.Y)
--------------------+ (no conditions)
---------------------> System: Set TargetX to AngryBee.X + cos(AngryBee.Angle) × 200
---------------------> System: Set TargetY to AngryBee.Y + sin(AngryBee.Angle) × 200
--------------------+ System: distP ≤ distB
--------------------+ PlayerTank: isDestroyed = 0
---------------------> System: Set TargetX to PlayerTank.X
---------------------> System: Set TargetY to PlayerTank.Y
--------------------+ System: Else
--------------------+ BotTank: isDestroyed = 0
---------------------> System: Set TargetX to BotTank.X
---------------------> System: Set TargetY to BotTank.Y
--------------------+ (no conditions)
---------------------> System: Set beeTargetAngle to angle(AngryBee.X, AngryBee.Y, TargetX, TargetY)
---------------------> AngryBee: Set Bullet angle of motion to anglelerp(AngryBee.Bullet.AngleOfMotion, beeTargetAngle + random(-15, 15), 6 × dt) degrees
---------------------> AngryBee: Set Bullet speed to lerp(AngryBee.Bullet.Speed, 350, 4 × dt)
------------+ AngryBee: On collision with Players
------------+ Players: isDestroyed = 0
-------------> Functions: Call Blast (x: AngryBee.X, y: AngryBee.Y, Radius: 15)
-------------> Functions: Call VideoBoomFX (X: AngryBee.X, Y: AngryBee.Y)
-------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 10, HeavyHit: 0)
-------------> AngryBee: Destroy
------------+ AngryBee: On collision with GroundTilemap
------------+ AngryBee: timer ≤ 5
-------------> Functions: Call Blast (x: AngryBee.X, y: AngryBee.Y, Radius: 15)
-------------> Functions: Call VideoBoomFXGround (X: AngryBee.X, Y: AngryBee.Y, ColorType: 0)
-------------> AngryBee: Destroy
------------+ System: Every tick
------------+ System: For each AngryBee
------------+ AngryBee: timer ≤ 0
-------------> Functions: Call Blast (x: AngryBee.X, y: AngryBee.Y, Radius: 15)
-------------> AngryBee: Destroy
------------+ System: IsSwarmActive = 1
------------+ System: AngryBee.Count = 0
------------+ System: Trigger once
-------------> System: Set IsSwarmActive to 0
-------------> System: Set CamState to 2
-------------> System: Wait 3.0 seconds (use time scale: True)
-------------> Functions: Call SwapPlayer
--------[[Бумеранг]]
// ═══ ФАЗА 1: ПОЛЁТ ВПЕРЁД ═══
------------+ System: Every tick
------------+ System: For each BoomerangProjectile
------------+ BoomerangProjectile: Returning = 0
-------------> BoomerangProjectile: Set angle to BoomerangProjectile.Angle + (900 × dt) degrees
-------------> BoomerangProjectile: Set PeakY to min(BoomerangProjectile.PeakY, BoomerangProjectile.Y)
----------------+ System: ShotTimer > 0.35
----------------+ BoomerangProjectile: Y > BoomerangProjectile.PeakY + 15
-----------------> BoomerangProjectile: Set Returning to 1
-----------------> BoomerangProjectile: Set HasHit to 0
-----------------> System: Set ShakePower to 3
--------------------+ System: Repeat 8 times
---------------------> System: Create object BoomPuff on layer "Game" at (BoomerangProjectile.X + random(-6,6), BoomerangProjectile.Y + random(-6,6)), create hierarchy: False, template: ""
---------------------> BoomPuff: Set Type to 7
---------------------> BoomPuff: Set Age to 0
---------------------> BoomPuff: Set Life to random(0.3, 0.6)
---------------------> BoomPuff: Set T to 0
---------------------> BoomPuff: Set vx to random(-40, 40)
---------------------> BoomPuff: Set vy to random(-40, 40)
---------------------> BoomPuff: Set PuffScale to random(0.15, 0.3)
---------------------> BoomPuff: Set scale to Self.PuffScale
---------------------> BoomPuff: Set color to rgb(255, 255, 0)
---------------------> BoomPuff: Set opacity to 100
// ═══ ФАЗА 2: ПЛАВНО ЗАВОРАЧИВАЕТ И ПАДАЕТ ПО ДУГЕ (как в Worms) ═══
------------+ System: Every tick
------------+ System: For each BoomerangProjectile
------------+ BoomerangProjectile: Returning = 1
-------------> BoomerangProjectile: Set angle to BoomerangProjectile.Angle + (1100 × dt) degrees
-------------> BoomerangProjectile: Add dt to ReturnTimer
-------------> BoomerangProjectile: Set Bullet gravity to 100
----------------+ System: BoomerangProjectile.OwnerTag = "Player1"
----------------+ PlayerTank: isDestroyed = 0
-----------------> System: Set SampleX to angle(BoomerangProjectile.X, BoomerangProjectile.Y, PlayerTank.X, PlayerTank.Y - 40)
-----------------> BoomerangProjectile: Set Bullet angle of motion to anglelerp(BoomerangProjectile.Bullet.AngleOfMotion, SampleX, 2.0 × dt) degrees
----------------+ System: BoomerangProjectile.OwnerTag = "Player2"
----------------+ BotTank: isDestroyed = 0
-----------------> System: Set SampleX to angle(BoomerangProjectile.X, BoomerangProjectile.Y, BotTank.X, BotTank.Y - 40)
-----------------> BoomerangProjectile: Set Bullet angle of motion to anglelerp(BoomerangProjectile.Bullet.AngleOfMotion, SampleX, 1.3 × dt) degrees
----------------+ (no conditions)
-----------------> System: Create object TrailPuff on layer "Game" at (BoomerangProjectile.X + random(-3,3), BoomerangProjectile.Y + random(-3,3)), create hierarchy: False, template: ""
-----------------> TrailPuff: Set scale to 0.15
-----------------> TrailPuff: Set color to rgb (255, 255, 0)
--------------------+ BoomerangProjectile: ReturnTimer > 6
---------------------> BoomerangProjectile: Destroy
// ═══ УПАЛ НА ЗЕМЛЮ → небольшой взрыв ═══
------------+ BoomerangProjectile: On collision with GroundTilemap
-------------> BoomerangProjectile: Add 1 to BounceCount
-------------> System: Set ShakePower to 4
----------------+ System: Repeat 6 times
-----------------> System: Create object BoomPuff on layer "Game" at (BoomerangProjectile.X + random(-8, 8), BoomerangProjectile.Y + random(-4, 2)), create hierarchy: False, template: ""
-----------------> BoomPuff: Set Type to 7
-----------------> BoomPuff: Set Age to 0
-----------------> BoomPuff: Set Life to random(0.3, 0.5)
-----------------> BoomPuff: Set T to 0
-----------------> BoomPuff: Set vx to random(-40, 40)
-----------------> BoomPuff: Set vy to -random(20, 60)
-----------------> BoomPuff: Set PuffScale to random(0.15, 0.3)
-----------------> BoomPuff: Set scale to Self.PuffScale
-----------------> BoomPuff: Set color to ColDust
-----------------> BoomPuff: Set opacity to 90
----------------+ BoomerangProjectile: BounceCount ≥ 2
-----------------> Functions: Call VideoBoomFXGround (X: BoomerangProjectile.X, Y: BoomerangProjectile.Y, ColorType: 0)
-----------------> Functions: Call Blast (x: BoomerangProjectile.X, y: BoomerangProjectile.Y, Radius: 25)
-----------------> BoomerangProjectile: Destroy
----------------+ BoomerangProjectile: BounceCount ≥ 1
-----------------> BoomerangProjectile: Set Y to BoomerangProjectile.Y - 6
-----------------> BoomerangProjectile: Set Bullet speed to max(BoomerangProjectile.Bullet.Speed × 0.45, 180)
-----------------> BoomerangProjectile: Set Bullet gravity to 220
--------------------+ System: cos(BoomerangProjectile.Bullet.AngleOfMotion) > 0
---------------------> BoomerangProjectile: Set Bullet angle of motion to -35 + random(-8, 8) degrees
--------------------+ System: Else
---------------------> BoomerangProjectile: Set Bullet angle of motion to -145 + random(-8, 8) degrees
// ═══ УДАР ПО ВРАГУ (проходит сквозь, бьёт 1 раз за фазу) ═══
------------+ System: Every tick
------------+ System: For each BoomerangProjectile
------------+ BoomerangProjectile: HasHit = 0
----------------+ Players: Is overlapping BoomerangProjectile
----------------+ Players: isDestroyed = 0
----------------+ System: Players.Owner ≠ BoomerangProjectile.OwnerTag
-----------------> BoomerangProjectile: Set HasHit to 1
-----------------> BoomerangProjectile: Destroy
-----------------> System: Set BlastExcludeUID to Players.UID
-----------------> Functions: Call VideoBoomFX (X: BoomerangProjectile.X, Y: BoomerangProjectile.Y)
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 20, HeavyHit: 1)
-----------------> System: Set ShakePower to 8
// ═══ КАМЕРА ═══
------------+ System: Every tick
------------+ System: BoomerangProjectile.Count > 0
-------------> System: Set CamState to 5
-------------> System: Set CamTargetX to BoomerangProjectile.X
-------------> System: Set CamTargetY to BoomerangProjectile.Y
-------------> System: Set CamTargetZoom to 1.4
// ═══ ЕДИНАЯ СМЕНА ХОДА (по аналогии с роем/авиаударом) ═══
------------+ System: Every tick
------------+ System: Is IsBoomerangActive
------------+ System: BoomerangProjectile.Count = 0
------------+ System: Trigger once
-------------> System: Set IsBoomerangActive to False
-------------> System: Set CamState to 2
-------------> System: Wait 1.0 seconds (use time scale: True)
-------------> Functions: Call SwapPlayer
// ═══ ПОЙМАЛ БУМЕРАНГ ═══
------------+ System: Every tick
------------+ System: For each BoomerangProjectile
------------+ BoomerangProjectile: Returning = 1
----------------+ System: BoomerangProjectile.OwnerTag = "Player1"
----------------+ PlayerTank: isDestroyed = 0
----------------+ System: distance(BoomerangProjectile.X, BoomerangProjectile.Y, PlayerTank.X, PlayerTank.Y) < 35
-----------------> BoomerangProjectile: Destroy
----------------+ System: BoomerangProjectile.OwnerTag = "Player2"
----------------+ BotTank: isDestroyed = 0
----------------+ System: distance(BoomerangProjectile.X, BoomerangProjectile.Y, BotTank.X, BotTank.Y) < 35
-----------------> BoomerangProjectile: Destroy
--------[[ТРОЙНОЙ ЗАРЯД: Очередь]]
------------+ System: Every 0.18 seconds
------------+ System: TB_ShotsLeft > 0
------------+ System: ActivePlayer = "Player1"
------------+ PlayerTank: isDestroyed = 0
-------------> PlayerBarrel: Spawn BurstProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> System: Set SampleX to TB_SavedAngle + random(-2.5, 2.5)
-------------> BurstProjectile: Set angle to SampleX degrees
-------------> BurstProjectile: Set Bullet angle of motion to SampleX degrees
-------------> BurstProjectile: Set Bullet speed to 7 + (Power × 3)
-------------> BurstProjectile: Set Bullet gravity to 100
-------------> BurstProjectile: Set ShotIndex to 3 - TB_ShotsLeft
-------------> BurstProjectile: Set scale to 0.05
-------------> System: Subtract 1 from TB_ShotsLeft
-------------> System: Set recoilAmount to 7
-------------> System: Set isRecoiling to True
-------------> System: Set ShakePower to 4
-------------> System: Create object BoomPuff on layer "Game" at (PlayerBarrel.ImagePointX(1), PlayerBarrel.ImagePointY(1)), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 7
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to 0.35
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to cos(TB_SavedAngle) × random(40, 80)
-------------> BoomPuff: Set vy to sin(TB_SavedAngle) × random(40, 80)
-------------> BoomPuff: Set PuffScale to random(0.1, 0.25)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set color to rgb(210, 105, 30)
-------------> BoomPuff: Set opacity to 100
------------+ System: Every 0.18 seconds
------------+ System: TB_ShotsLeft > 0
------------+ System: ActivePlayer = "Player2"
------------+ BotTank: isDestroyed = 0
-------------> BotBarrel: Spawn BurstProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> System: Set SampleX to TB_SavedAngle + random(-2.5, 2.5)
-------------> BurstProjectile: Set angle to SampleX degrees
-------------> BurstProjectile: Set Bullet angle of motion to SampleX degrees
-------------> BurstProjectile: Set Bullet speed to 7 + (Power × 3)
-------------> BurstProjectile: Set Bullet gravity to 100
-------------> BurstProjectile: Set ShotIndex to 3 - TB_ShotsLeft
-------------> BurstProjectile: Set scale to 0.05
-------------> System: Subtract 1 from TB_ShotsLeft
-------------> System: Set recoilAmount to 7
-------------> System: Set isRecoiling to True
-------------> System: Set ShakePower to 4
-------------> System: Create object BoomPuff on layer "Game" at (BotBarrel.ImagePointX(1), BotBarrel.ImagePointY(1)), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 7
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to 0.35
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to cos(TB_SavedAngle) × random(40, 80)
-------------> BoomPuff: Set vy to sin(TB_SavedAngle) × random(40, 80)
-------------> BoomPuff: Set PuffScale to random(0.1, 0.25)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set color to rgb(210, 105, 30)
-------------> BoomPuff: Set opacity to 100
// [BurstProjectile: попадание по земле]
------------+ BurstProjectile: On collision with GroundTilemap
-------------> Functions: Call VideoBoomFXGround (X: BurstProjectile.X, Y: BurstProjectile.Y, ColorType: 0)
-------------> Functions: Call Blast (x: BurstProjectile.X, y: BurstProjectile.Y, Radius: 20)
-------------> BurstProjectile: Destroy
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - BurstProjectile.X) × 0.7
// [BurstProjectile: попадание по танку]
------------+ Players: Is overlapping BurstProjectile
------------+ Players: isDestroyed = 0
-------------> Functions: Call VideoBoomFX (X: BurstProjectile.X, Y: BurstProjectile.Y)
-------------> System: Set BlastExcludeUID to Players.UID
-------------> Functions: Call Blast (x: Players.X, y: Players.Y, Radius: 20)
-------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 15, HeavyHit: 1)
-------------> BurstProjectile: Destroy
// [Передача хода после Тройного заряда]
------------+ System: Every tick
------------+ System: Is IsTripleBurstActive
------------+ System: TB_ShotsLeft = 0
------------+ System: BurstProjectile.Count = 0
------------+ System: Trigger once
-------------> System: Wait 1.0 seconds (use time scale: True)
-------------> Functions: Call SwapPlayer
-------------> System: Set IsTripleBurstActive to False
--------[[VolcanoProjectile: попадание по земле]]
------------+ VolcanoProjectile: On collision with GroundTilemap
-------------> Functions: Call VideoBoomFXGround (X: VolcanoProjectile.X, Y: VolcanoProjectile.Y, ColorType: 0)
-------------> Functions: Call Blast (x: VolcanoProjectile.X, y: VolcanoProjectile.Y, Radius: 12)
-------------> Functions: Call SpawnVolcanoRocks (X: VolcanoProjectile.X, GroundY: HeightMap.At(clamp(floor(VolcanoProjectile.X), 0, LayoutWidth), 0))
----------------+ System: ActivePlayer = "Player2"
-----------------> System: Set LastShotError to (PlayerTank.X - VolcanoProjectile.X) × 0.7
----------------+ (no conditions)
-----------------> VolcanoProjectile: Destroy
// VolcanoProjectile: прямое попадание в танк
------------+ Players: On collision with VolcanoProjectile
------------+ Players: isDestroyed = 0
-------------> Functions: Call VideoBoomFX (X: VolcanoProjectile.X, Y: VolcanoProjectile.Y)
-------------> System: Set BlastExcludeUID to Players.UID
-------------> Functions: Call Blast (x: Players.X, y: Players.Y, Radius: 15)
-------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 30, HeavyHit: 1)
-------------> VolcanoProjectile: Destroy
-------------> System: Set IsVolcanoActive to False
-------------> Functions: Call SwapPlayer
| Local number startY = 0
| Local number targetY = 0
| Local number travelDist = 0
| Local number launchSpeed = 0
------------* On function 'SpawnVolcanoRocks'
------------* Parameter 'X' (Number)
------------* Parameter 'GroundY' (Number)
----------------+ System: Repeat 3 times
-----------------> System: Set startY to ScrollY + ViewportHeight("Game") ÷ 2 + 120
-----------------> System: Set targetY to GroundY - 200
-----------------> System: Set travelDist to startY - targetY
-----------------> System: Set launchSpeed to √(2 × 600 × travelDist)
-----------------> System: Create object VolcanoRock on layer "Game" at (X + random(-150, 150), startY), create hierarchy: False, template: ""
-----------------> VolcanoRock: Set State to 0
-----------------> VolcanoRock: Set GroundY to GroundY
-----------------> VolcanoRock: Set vx to random(-25, 25)
-----------------> VolcanoRock: Set vy to -launchSpeed
-----------------> VolcanoRock: Set scale to random(0.05, 0.08)
-----------------> VolcanoRock: Set angle to random(0, 360) degrees
-----------------> VolcanoRock: Move to top of layer
-----------------> System: Set ShakePower to 12
// [Вулканические камни: физика]
------------+ System: Every tick
------------+ System: For each VolcanoRock
----------------+ VolcanoRock: State = 0
-----------------> VolcanoRock: Add 600 × dt to vy
-----------------> VolcanoRock: Set X to VolcanoRock.X + VolcanoRock.vx × dt
-----------------> VolcanoRock: Set Y to VolcanoRock.Y + VolcanoRock.vy × dt
-----------------> VolcanoRock: Set angle to VolcanoRock.Angle + (300 × dt) degrees
-----------------> System: Create object TrailPuff on layer "Game" at (VolcanoRock.X + random(-3, 3), VolcanoRock.Y + random(-3, 3)), create hierarchy: False, template: ""
-----------------> TrailPuff: Set scale to 0.12
-----------------> TrailPuff: Set color to rgb(255, 120, 30)
--------------------+ VolcanoRock: vy ≥ 0
---------------------> VolcanoRock: Set State to 1
----------------+ VolcanoRock: State = 1
-----------------> VolcanoRock: Add 600 × dt to vy
-----------------> VolcanoRock: Set X to VolcanoRock.X + VolcanoRock.vx × dt
-----------------> VolcanoRock: Set Y to VolcanoRock.Y + VolcanoRock.vy × dt
-----------------> VolcanoRock: Set angle to VolcanoRock.Angle + (400 × dt) degrees
--------------------+ VolcanoRock: Y ≥ HeightMap.At(clamp(floor(VolcanoRock.X), 0, LayoutWidth), 0)
---------------------> Functions: Call VideoBoomFX (X: VolcanoRock.X, Y: VolcanoRock.Y)
---------------------> Functions: Call Blast (x: VolcanoRock.X, y: VolcanoRock.Y, Radius: 20)
---------------------> VolcanoRock: Destroy
------------------------+ System: For each Players
------------------------+ Players: isDestroyed = 0
------------------------+ System: distance(Players.X, Players.Y, VolcanoRock.X, VolcanoRock.Y) < 55
-------------------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 20, HeavyHit: 1)
// [Передача хода после Вулкана]
------------+ System: Every tick
------------+ System: Is IsVolcanoActive
-------------> System: Set VolcanoTimer to VolcanoTimer + dt
------------+ System: [X] Is IsVolcanoActive
-------------> System: Set VolcanoTimer to 0
------------+ System: Every tick
------------+ System: Is IsVolcanoActive
------------+ System: VolcanoProjectile.Count = 0
------------+ System: VolcanoRock.Count = 0
------------+ System: VolcanoTimer ≥ 1.0
-------------> Functions: Call SwapPlayer
-------------> System: Set IsVolcanoActive to False
-------------> System: Set VolcanoTimer to 0
------------+ System: On start of layout
-------------> VolcanoRock: Destroy
-------------> System: Set ShakePower to 0
-------------> System: Set IsVolcanoActive to False
// [[Вулкан: попадание камня в танк (раньше отсутствовало)]]
------------+ VolcanoRock: On collision with Players
------------+ Players: isDestroyed = 0
-------------> Functions: Call Blast (x: VolcanoRock.X, y: VolcanoRock.Y, Radius: 15)
-------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 25, HeavyHit: 1)
-------------> VolcanoRock: Destroy
// [Вулкан: страховка от «залипшего» камня]
------------+ System: Every tick
------------+ System: For each VolcanoRock
-------------> VolcanoRock: Add dt to Age
----------------+ VolcanoRock: Age > 8
----------------+ OR VolcanoRock: Y > LayoutHeight + 400
-----------------> VolcanoRock: Destroy
----[ движение танка и стрельба на кнопку , смена хода P]
--------+ System: Every tick
--------+ System: IsShooting = 1
---------> PlayerTank: Set VelX to 0
---------> BotTank: Set VelX to 0
--------+ Keyboard: On P pressed
--------+ System: IsShooting = 0
---------> Functions: Call SwapPlayer
--------+ [DISABLED] Mouse: On Left button released
--------+ [DISABLED] System: Is CancelShot
---------> [DISABLED] System: Set CancelShot to False
---------> [DISABLED] System: Set Power to 0
---------> [DISABLED] System: Set Charging to False
---------> [DISABLED] ChargeEffect: Set animation frame to 0
---------> [DISABLED] ChargeEffect: Set visibility Invisible
--------+ [DISABLED] Mouse: Left button is down
--------+ [DISABLED] System: ActivePlayer = "Player2"
--------+ [DISABLED] System: IsBotControlled = 1
--------+ [DISABLED] System: Every tick
--------+ [DISABLED] System: IsShooting = 0
--------+ [DISABLED] System: [X] Is CancelShot
---------> [DISABLED] System: Set Charging to True
---------> [DISABLED] System: Set Power to Power + ChargeSpeed × dt
---------> [DISABLED] System: Set Power to clamp(Power, 0, MaxPower)
---------> [DISABLED] ChargeEffect: Set visibility Visible
---------> [DISABLED] ChargeEffect: Set animation frame to floor((Power ÷ MaxPower) × 8)
---------> [DISABLED] ChargeEffect: Set position to (botBarrel.X, BotBarrel.Y)
--------[Блокировка управления мертвым танком]
------------+ Players: isDestroyed = 1
-------------> Players: Set VelX to 0
-------------> Players: Set VelY to 0
----[[Вылет снаряда за экран]]
--------+ AmmosFamily: X < ViewportLeft("Game")-100
--------+ OR AmmosFamily: X > ViewportRight("Game")+100
--------+ OR AmmosFamily: Y > LayoutHeight + 200
--------+ OR AmmosFamily: Y < LayoutHeight - 900
---------> AmmosFamily: Destroy
---------> System: Set CamState to 0
---------> System: Set SwapPending to 0
------------+ System: [X] Is IsClusterActive
------------+ System: [X] Is IsMachineGunActive
------------+ System: [X] Is IsAirstrikeActive
------------+ System: [X] Is IsBoomerangActive
------------+ System: [X] Is IsTripleBurstActive
------------+ System: [X] Is IsVolcanoActive
------------+ System: IsSwarmActive = 0
-------------> Functions: Call SwapPlayer
------------+ System: Else
------------+ System: [X] Is IsMachineGunActive
------------+ System: AmmosFamily.Count = 0
------------+ System: IsSwarmActive = 0
-------------> Functions: Call SwapPlayer
[[Замуровывание в земле]]
----+ System: Every tick
----+ System: For each Players
----+ Players: isDestroyed = 0
--------+ Players: Is overlapping GroundTilemap at offset (0, -5)
---------> Players: Set VelX to 0
---------> Players: Set VelX to 0
---------> Players: Set Y to Self.Y - 10
[HP BAR]
----+ System: Every tick
----+ System: For each HPBars
----+ Players: Owner = HPBars.Owner
-----> HPBars: Set width to 150 × Players.HP ÷Players.MaxHP
--------+ System: Players.HP > Players.MaxHP × 0.5
--------+ HPBars: [X] Is animation "green" playing
---------> HPBars: Set animation to "green" (play from beginning)
--------+ System: Players.HP ≤ Players.MaxHP × 0.5
--------+ System: Players.HP > Players.MaxHP × 0.25
--------+ HPBars: [X] Is animation "yellow" playing
---------> HPBars: Set animation to "yellow" (play from beginning)
--------+ System: Players.HP ≤ Players.MaxHP × 0.25
--------+ HPBars: [X] Is animation "red" playing
---------> HPBars: Set animation to "red" (play from beginning)
----+ System: Every tick
-----> BtnAimSwitch: Set position to (ViewportRight("UI") - (BtnAimSwitch.Width ÷ 2) - 25, ViewportTop("UI") - (BtnAimSwitch.Height ÷ 2) + 25)
-----> BtnSelfDestruct: Set position to (ViewportLeft("UI") - (BtnSelfDestruct.Width ÷ 2) + 30, ViewportTop("UI") - (BtnSelfDestruct.Height ÷ 2) + 25)
-----> BtnSettings: Set position to (ViewportLeft("UI") + (BtnSettings.Width ÷ 2) + 20, ViewportTop("UI") + (BtnSettings.Height ÷ 2) + 95)
-----> WeaponMainButton: Set position to (ViewportMidX("UI") - (WeaponMainButton.Width ÷ 2) +50, ViewportBottom("UI") - (WeaponMainButton.Height ÷ 2) - 120)
-----> playerHP: Set position to (ViewportLeft("UI") + (playerHP.Width ÷ 2) + 150, ViewportTop("UI") + 60)
-----> botHP: Set position to (ViewportRight("UI") + (botHP.Width ÷ 2) - 300, ViewportTop("UI") + 60)
----+ Joy: [X] Перетаскивание is dragging
-----> Joy: Set position to (ViewportLeft("UI") - (Joy.Width ÷ 2) + 250, ViewportBottom("UI") - (Joy.Height ÷ 2) - 120)
-----> Joy: Set StartX to Joy.X
----+ System: Every tick
-----> playerFuelBar: Set X to Joy.StartX - (playerFuelBar.ImagePointX(1) - playerFuelBar.X)
-----> playerFuelBar: Set Y to (Joy.Y - 40) - (playerFuelBar.ImagePointY(1) - playerFuelBar.Y)
----+ System: Every tick
----+ JoyAim: [X] Перетаскивание is dragging
-----> JoyAim: Set position to (ViewportRight("UI") - (JoyAim.Width ÷ 2) - 200, ViewportBottom("UI") - (JoyAim.Height ÷ 2) - 120)
-----> JoyAim: Set StartX to JoyAim.X
-----> JoyAim: Set StartY to JoyAim.Y
// [Закрепление каждый тик]
----+ System: Every tick
----+ System: IsSettingsOpen = 1
-----> SettingsPanel: Set position to (ViewportMidX(SettingsLayer), ViewportMidY(SettingsLayer))
-----> BtnSound: Set position to (SettingsPanel.BBoxMidX - 50, SettingsPanel.Y)
-----> BtnLang: Set position to (SettingsPanel.BBoxMidX + 50, SettingsPanel.Y)
-----> BtnSurrender: Set position to (SettingsPanel.BBoxMidX + 50, SettingsPanel.Y)
-----> BtnCloseSettings: Set position to (SettingsPanel.X + (SettingsPanel.Width ÷ 2) - 25, SettingsPanel.Y - (SettingsPanel.Height ÷ 2) + 25)
----+ System: Every tick
----+ System: IsSettingsOpen = 0
-----> SettingsPanel: Set position to (ViewportMidX(SettingsLayer), ViewportMidY(SettingsLayer)+500)
-----> BtnSound: Set position to (SettingsPanel.BBoxMidX - 50, SettingsPanel.Y)
-----> BtnLang: Set position to (SettingsPanel.BBoxMidX + 50, SettingsPanel.Y)
-----> BtnSurrender: Set position to (SettingsPanel.BBoxMidX + 50, SettingsPanel.Y)
-----> BtnCloseSettings: Set position to (SettingsPanel.X + (SettingsPanel.Width ÷ 2) - 25, SettingsPanel.Y - (SettingsPanel.Height ÷ 2) + 25)
----[[[HTML-бары в бою]]]
--------+ System: On start of layout
---------> HPBars: Set visibility Invisible
---------> FuelBar: Set visibility Invisible
---------> AirBar_BG: Set visibility Invisible
---------> AirBar_Fill: Set visibility Invisible
--------+ System: Every tick
--------+ System: PlayerTank.Count > 0
--------+ PlayerTank: isDestroyed = 0
---------> System: Set ProgressPlayerHP to (PlayerTank.HP ÷ PlayerTank.MaxHP) × 100
--------+ System: Else
---------> System: Set ProgressPlayerHP to 0
--------+ System: Every tick
--------+ System: BotTank.Count > 0
--------+ BotTank: isDestroyed = 0
---------> System: Set ProgressBotHP to (BotTank.HP ÷ BotTank.MaxHP) × 100
--------+ System: Else
---------> System: Set ProgressBotHP to 0
--------+ System: Every tick
--------+ System: PlayerTank.Count > 0
--------+ PlayerTank: isDestroyed = 0
---------> System: Set ProgressFuelGame to (PlayerTank.Fuel ÷ max(0.1, PlayerTank.MaxFuel)) × 100
--------+ System: Else
---------> System: Set ProgressFuelGame to 0
--------+ System: Every tick
---------> HtmlBotHP: Set position to (ViewportRight("UI") - 400, ViewportTop("UI") + 40)
---------> HtmlPlayerHP: Set position to (ViewportLeft("UI") + 150, ViewportTop("UI") + 40)
------------+ System: [X] Is IsWeaponMenuOpen
-------------> HtmlFuelGame: Set visibility Visible
-------------> HtmlFuelGame: Set position to (ViewportLeft("UI") + 170, ViewportBottom("UI") - 230)
-------------> BtnFire: Set visibility Visible
-------------> BtnFire: Set position to (WeaponMainButton.BBoxRight + 50 + (BtnFire.Width ÷ 2), ViewportBottom("UI") - (BtnFire.Height ÷ 2) - 120)
------------+ System: Else
-------------> HtmlFuelGame: Set visibility Invisible
-------------> BtnFire: Set visibility Invisible
--------+ System: Every tick
--------+ System: For each Players
--------+ Players: Owner = "Player1"
--------+ Players: Is overlapping water
---------> System: Set ProgressAir to (Players.AirTimer ÷ 5.0) × 100
--------+ System: Every tick
---------> Run JavaScript: if(window.setCombatBar){setCombatBar('fillPlayerHP','textPlayerHP',runtime.globalVars.ProgressPlayerHP,'hp');setCombatBar('fillBotHP','textBotHP',runtime.globalVars.ProgressBotHP,'hp');setCombatBar('fillFuelGame','',runtime.globalVars.ProgressFuelGame,'fuel');setCombatBar('fillAir','textAir',runtime.globalVars.ProgressAir,'air');}
// [воздух: показать/скрыть]
| Local number tankScreenY = 0
| Local number tankScreenX = 0
--------+ System: Every tick
--------+ Players: Is overlapping water
--------+ PlayerTank: isDestroyed = 0
---------> HtmlAirBar: Set visibility Visible
---------> HtmlAirBar: Set position to ((PlayerTank.X - ScrollX) × LayoutScale, (PlayerTank.Y - ScrollY - 70) × LayoutScale)
--------+ Players: [X] Is overlapping water
---------> HtmlAirBar: Set visibility Invisible
// [HTML-бары: Позиционирование и Воздух]
[[Визуальный урон танков] дым огонь]
----+ System: Every 0.15 seconds
----+ System: For each Players
----+ Players: isDestroyed = 0
--------+ System: Players.HP ≤ Players.MaxHP × 0.5
--------+ System: Players.HP > Players.MaxHP × 0.2
---------> System: Create object BoomPuff on layer "Game" at (Players.ImagePointX(7), Players.ImagePointY(7)), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 8
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to random(0.6, 1.0)
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to random(-15, 15)
---------> BoomPuff: Set vy to random(-30, -50)
---------> BoomPuff: Set PuffScale to random(0.2, 0.4)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set color to rgb(80, 80, 85)
---------> BoomPuff: Set opacity to 80
---------> BoomPuff: Move to top of layer
--------+ System: Players.HP ≤ Players.MaxHP × 0.2
--------+ System: Players.HP > 0
---------> System: Create object BoomPuff on layer "Game" at (Players.ImagePointX(7) + random(-5, 5), Players.ImagePointY(7)), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 8
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to random(0.8, 1.2)
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to random(-20, 20)
---------> BoomPuff: Set vy to random(-40, -70)
---------> BoomPuff: Set PuffScale to random(0.3, 0.6)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set color to rgb(30, 30, 30)
---------> BoomPuff: Set opacity to 90
---------> BoomPuff: Move to top of layer
---------> System: Create object BoomPuff on layer "Game" at (Players.ImagePointX(7) + random(-8, 8), Players.ImagePointY(7) + random(-5, 5)), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 8
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to random(0.3, 0.5)
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to random(-10, 10)
---------> BoomPuff: Set vy to random(-20, -50)
---------> BoomPuff: Set PuffScale to random(0.2, 0.5)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set color to rgb(255, random(100, 180), 20)
---------> BoomPuff: Set opacity to 100
---------> BoomPuff: Move to top of layer
[угол пушки]
----+ System: Every tick
--------+ System: ActivePlayer = "Player1"
---------> HUD_Background: Set position to (PlayerTank.X, PlayerTank.Y - 70)
---------> Text_AngleValue: Set text to round(PlayerBarrel.Angle > 180 ? 360 - PlayerBarrel.Angle : -PlayerBarrel.Angle) & "°"
---------> Text_PowerValue: Set text to round(Power)
---------> Text_AngleLabel: Set position to (HUD_Background.X - 20, HUD_Background.Y - 20)
---------> Text_AngleValue: Set position to (HUD_Background.X - 20, HUD_Background.Y - 3)
---------> Text_PowerLabel: Set position to (HUD_Background.X + 25, HUD_Background.Y - 20)
---------> Text_PowerValue: Set position to (HUD_Background.X + 25, HUD_Background.Y -3)
--------+ System: ActivePlayer = "Player2"
---------> HUD_Background: Set position to (BotTank.X, BotTank.Y - 70)
---------> Text_AngleValue: Set text to round(BotBarrel.Angle > 180 ? BotBarrel.Angle - 360 : BotBarrel.Angle) & "°"
---------> Text_PowerValue: Set text to round(Power)
---------> Text_AngleLabel: Set position to (HUD_Background.X - 20, HUD_Background.Y - 20)
---------> Text_AngleValue: Set position to (HUD_Background.X - 20, HUD_Background.Y - 3)
---------> Text_PowerLabel: Set position to (HUD_Background.X + 25, HUD_Background.Y - 20)
---------> Text_PowerValue: Set position to (HUD_Background.X + 25, HUD_Background.Y -3)
--------+ System: IsShooting = 0
---------> HUD_Background: Set visibility Visible
---------> HUD_Background2: Set visibility Visible
---------> Text_AngleLabel: Set visibility Visible
---------> Text_AngleValue: Set visibility Visible
---------> Text_PowerLabel: Set visibility Visible
---------> Text_PowerValue: Set visibility Visible
--------+ System: IsShooting = 1
---------> HUD_Background: Set visibility Invisible
---------> HUD_Background2: Set visibility Invisible
---------> Text_AngleLabel: Set visibility Invisible
---------> Text_AngleValue: Set visibility Invisible
---------> Text_PowerLabel: Set visibility Invisible
---------> Text_PowerValue: Set visibility Invisible
[Bot функции]
----[[сложность бота]]
--------+ System: On start of layout
--------+ System: LayoutName = "Level1"
---------> System: Set BotDifficulty to 0
--------+ System: On start of layout
--------+ System: LayoutName = "Level2"
---------> System: Set BotDifficulty to 1
--------+ System: On start of layout
--------+ System: BotDifficulty = 0
---------> System: Set BotAimError to 25
---------> System: Set BotPowerError to 35
---------> System: Set BotShootDelay to 2.0
---------> System: Set BotMoveRange to 70
---------> System: Set BotMoveSpeed to 80
---------> System: Set BotAimSpeed to 0.12
---------> System: Set BotFireAngleTolerance to 15
--------+ System: On start of layout
--------+ System: BotDifficulty = 1
---------> System: Set BotAimError to 12
---------> System: Set BotPowerError to 18
---------> System: Set BotShootDelay to 1.3
---------> System: Set BotMoveRange to 120
---------> System: Set BotMoveSpeed to 110
---------> System: Set BotAimSpeed to 0.15
---------> System: Set BotFireAngleTolerance to 7
---------> System: Set PredictFactor to 0.5
--------+ System: On start of layout
--------+ System: BotDifficulty = 2
---------> System: Set BotAimError to 5
---------> System: Set BotPowerError to 8
---------> System: Set BotShootDelay to 0.8
---------> System: Set BotMoveRange to 170
---------> System: Set BotMoveSpeed to 140
---------> System: Set BotAimSpeed to 0.25
---------> System: Set BotFireAngleTolerance to 3
---------> System: Set PredictFactor to 0.8
--------+ System: On start of layout
--------+ System: BotDifficulty = 3
---------> System: Set BotAimError to 1
---------> System: Set BotPowerError to 3
---------> System: Set BotShootDelay to 0.45
---------> System: Set BotMoveRange to 220
---------> System: Set BotMoveSpeed to 170
---------> System: Set BotAimSpeed to 0.35
---------> System: Set BotFireAngleTolerance to 1
---------> System: Set PredictFactor to 1.0
----[цикл бота]
| Local number flightTime = 0
| Local number predictX = 0
| Local number predictY = 0
| Local number BallisticDrop = 0
| Local number playerVelX = 0
| Local number playerVelY = 0
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 5
--------+ System: FireZone.Count = 0
--------+ System: NapalmDrop.Count = 0
---------> System: Set DistX to abs(PlayerTank.X - BotTank.X)
---------> System: Set BotPowerTarget to clamp( 35 + DistX × 0.12 + random(-BotPowerError,BotPowerError), 30, 100 )
---------> System: Set Power to 0
---------> System: Set BotState to 1
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 1
--------+ System: IsShooting = 0
--------+ BotTank: isDestroyed = 0
--------+ System: Trigger once
--------+ PlayerTank: isDestroyed = 0
---------> System: Set BotAimOffset to clamp(random(-BotAimError, BotAimError) + LastShotError × 0.4, -5, 90)
---------> System: Set BotPowerTarget to clamp(distance(BotTank.X, BotTank.Y, PlayerTank.X, PlayerTank.Y) ÷ 6 + random(-BotPowerError, BotPowerError), 25, 90)
---------> System: Set BotMoveTargetX to clamp(BotTank.X + random(-BotMoveRange, BotMoveRange), 80, LayoutWidth - 80)
------------+ System: Is BotShouldHoldPosition
-------------> System: Set BotAimOffset to clamp(random(-BotAimError, BotAimError) + LastShotError × 0.4, -5, 90)
-------------> System: Set BotPowerTarget to clamp(distance(BotTank.X, BotTank.Y, PlayerTank.X, PlayerTank.Y) ÷ 6 + random(-BotPowerError, BotPowerError), 25, 90)
-------------> System: Set BotMoveTargetX to clamp(BotTank.X + random(-BotMoveRange, BotMoveRange), 80, LayoutWidth - 80)
----------------+ System: AirDrop.Count > 0
----------------+ AirDrop: DropState ≠ 0
--------------------+ System: BotTank.HP < (BotTank.MaxHP × 0.6)
--------------------+ OR System: random(100) < 40
---------------------> System: Set BotMoveTargetX to clamp(AirDrop.X, 80, LayoutWidth - 80)
--------------------+ System: Else
---------------------> System: Set BotMoveTargetX to clamp(BotTank.X + random(-BotMoveRange, BotMoveRange), 80, LayoutWidth - 80)
----------------+ System: abs(BotMoveTargetX - BotTank.X) < 30
-----------------> System: Set BotState to 3
-----------------> System: Set BotTimer to 0
----------------+ System: Else
-----------------> System: Set BotMoveDir to sign(BotMoveTargetX - BotTank.X)
-----------------> System: Set BotState to 2
-----------------> System: Set BotTimer to 0
------------+ System: [X] Is BotShouldHoldPosition
-------------> System: Set BotShouldHoldPosition to False
-------------> System: Set BotState to 3
-------------> System: Set BotTimer to 0
--------[[МОЗГИ БОТА: Защита от самоубийства (Обрывы и Вода)]]
------------+ System: Every tick
------------+ System: ActivePlayer = "Player2"
------------+ System: BotState = 2
------------+ System: BotMoveDir ≠ 0
----------------+ BotTank: [X] Is overlapping GroundTilemap at offset (BotMoveDir × 60, 60)
----------------+ OR BotTank: Is overlapping water at offset (BotMoveDir × 60, 30)
-----------------> BotTank: Set VelX to 0
-----------------> BotTank: Set animation speed to 0
-----------------> System: Set BotTimer to 0
-----------------> System: Set BotState to 3
-----------------> System: Set BotMoveDir to -BotMoveDir
-----------------> System: Set BotMoveTargetX to clamp(BotTank.X + (BotMoveDir × 150), 80, LayoutWidth - 80)
-----------------> System: Create object SmokeParticles2 on layer "Game" at (BotTank.X + (BotMoveDir × 40), BotTank.Y ), create hierarchy: False, template: ""
-----------------> SmokeParticles2: Set spraying
----------------+ System: BotTimer > 1.5
----------------+ System: abs(BotTank.MaxSpeed) < 10
-----------------> System: Set BotWasStuck to True
-----------------> System: Set BotState to 3
-----------------> System: Set BotTimer to 0
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 2
--------+ System: IsShooting = 0
--------+ BotTank: isDestroyed = 0
--------+ PlayerTank: isDestroyed = 0
--------+ BotTank: Fuel > 0
---------> System: Add dt to BotTimer
---------> System: Set BotMoveDir to sign(BotMoveTargetX - BotTank.X)
---------> BotTank: Add BotMoveDir × BotTank.Accel × dt to VelX
---------> BotTank: Set VelX to clamp(BotTank.VelX, -BotTank.MaxSpeed, BotTank.MaxSpeed)
---------> BotTank: Set animation speed to abs(BotTank.VelX) ÷ 22
---------> BotTank: Set IsThrottling to 1
------------+ System: abs(BotTank.X - BotMoveTargetX) ≤ 10
------------+ OR System: BotTimer ≥ BotMoveMaxTime
-------------> BotTank: Set VelX to 0
-------------> BotTank: Set animation speed to 0
-------------> System: Set BotTimer to 0
-------------> System: Set BotState to 3
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState ≠ 2
---------> BotTank: Set IsThrottling to 0
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 2
--------+ BotTank: Fuel ≤ 0
---------> BotTank: Set VelX to 0
---------> System: Set BotTimer to 0
---------> System: Set BotState to 3
--------+ System: BotState = 0
---------> (no actions)
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 3
--------+ System: Trigger once
---------> Functions: Call BotChooseWeapon
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 3
--------+ System: BotDifficulty ≥ 1
---------> System: Set playerVelX to PlayerTank.VelX
---------> System: Set playerVelY to PlayerTank.VelY
---------> System: Set DistX to distance(BotTank.X, BotTank.Y, PlayerTank.X, PlayerTank.Y)
---------> System: Set flightTime to DistX ÷ (7 + BotPowerTarget × 3)
---------> System: Set predictX to PlayerTank.X + playerVelX × flightTime × PredictFactor
---------> System: Set predictY to PlayerTank.Y + playerVelY × flightTime × PredictFactor
---------> System: Set botTargetAngle to angle(BotBarrel.X, BotBarrel.Y, predictX, predictY) + BotAimOffset
---------> System: Set BallisticDrop to DistX × DistX × 0.005 ÷ (BotPowerTarget ÷ 40)
---------> System: Set botTargetAngle to angle(BotBarrel.X, BotBarrel.Y, PlayerTank.X, PlayerTank.Y - clamp(DistX × 0.45, 50, 250) - BallisticDrop) + BotAimOffset
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 3
--------+ System: BotDifficulty = 0
---------> System: Set DistX to abs(PlayerTank.X - BotTank.X)
---------> System: Set botTargetAngle to angle(BotBarrel.X, BotBarrel.Y, PlayerTank.X, PlayerTank.Y - clamp(DistX × 0.45, 50, 250)) + BotAimOffset
---------> System: Set BallisticDrop to DistX × DistX × 0.008 ÷ (BotPowerTarget ÷ 40)
---------> System: Set botTargetAngle to angle(BotBarrel.X, BotBarrel.Y, PlayerTank.X, PlayerTank.Y - clamp(DistX × 0.45, 50, 250) - BallisticDrop) + BotAimOffset
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 3
--------+ System: BotDirectAim = 1
---------> System: Set botTargetAngle to angle(BotBarrel.X, BotBarrel.Y, PlayerTank.X, PlayerTank.Y - clamp(DistX × 0.05, 2, 18)) + (BotAimOffset × 0.25)
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 3
---------> HUDText: Set text to "Local:" & round(botLocalAngle) & " | Target:" & round(botTargetAngle) & " | Diff:" & round(botAimDiff) & " | Tol:" & BotFireAngleTolerance & " | Timer:" & round(BotTimer)
---------> System: Add dt to BotTimer
---------> System: Set botAimDiff to ((botLocalAngle - botTargetAngle + 540) % 360) - 180
---------> System: Set botLocalAngle to anglelerp(botLocalAngle, botTargetAngle, BotAimSpeed)
---------> System: Set recoilAmount to lerp(recoilAmount, 0, 0.05)
---------> BotBarrel: Set angle to botLocalAngle + 180 + recoilAmount degrees
---------> BotTank: Set X to Self.X - cos(Self.Angle + 180) × slideRecoil
---------> BotTank: Set Y to Self.Y - sin(Self.Angle + 180) × slideRecoil
---------> System: Set slideRecoil to lerp(slideRecoil, 0, 0.1)
---------> System: Set DistX to abs(PlayerTank.X - BotTank.X)
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 3
--------+ System: BotTimer ≥ BotShootDelay
--------+ System: abs(botAimDiff) ≤ BotFireAngleTolerance
--------+ System: abs(((botLocalAngle - angle(BotBarrel.X, BotBarrel.Y, PlayerTank.X, PlayerTank.Y) + 540) % 360) - 180) ≤ 180
---------> System: Set BotTimer to 0
---------> System: Set BotState to 4
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 3
--------+ System: BotTimer ≥ BotShootDelay + 2.5
---------> System: Set BotTimer to 0
---------> System: Set BotState to 4
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
--------+ System: BotState = 4
--------+ System: IsShooting = 0
--------+ System: BotTank.isDestroyed = 0
--------+ System: PlayerTank.isDestroyed = 0
---------> System: Add dt to BotTimer
---------> System: Set Charging to True
---------> System: Set Power to Power + ChargeSpeed × dt
---------> System: Set Power to clamp(Power, 0, BotPowerTarget)
---------> ChargeEffect: Set visibility Visible
---------> ChargeEffect: Set animation frame to floor((Power ÷ MaxPower) × 8)
---------> ChargeEffect: Set position to (BotBarrel.X, BotBarrel.Y)
------------+ System: Power ≥ BotPowerTarget - 0.1
-------------> System: Set recoilAmount to 10
-------------> System: Set isRecoiling to True
-------------> System: Set CamState to 1
-------------> Functions: Call BotFireSelected (W: BotCurrentWeapon, P: Power)
-------------> System: Set IsShooting to 1
-------------> System: Set ShotTimer to 0
-------------> System: Set Power to 0
-------------> System: Set slideRecoil to 0.1
-------------> System: Set Charging to False
-------------> ChargeEffect: Set animation frame to 0
-------------> ChargeEffect: Set visibility Invisible
-------------> System: Set BotState to 0
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
---------> (no actions)
--------+ System: Every tick
--------+ System: ActivePlayer = "Player2"
------------+ System: BotState = 1
-------------> Sprite: Set color to rgb(255, 255, 150)
------------+ System: BotState = 2
-------------> Sprite: Set color to rgb(150, 255, 150)
------------+ System: BotState = 3
-------------> Sprite: Set color to rgb(150, 0, 0)
------------+ System: BotState = 4
-------------> Sprite: Set color to rgb(255, 0, 0)
------------+ System: BotState = 0
-------------> Sprite: Set color to rgb(255, 255, 255)
--------[[Бот поворачивается к игроку]]
------------+ System: Every tick
------------+ System: ActivePlayer = "Player2"
------------+ BotTank: isDestroyed = 0
------------+ PlayerTank: isDestroyed = 0
----------------+ System: PlayerTank.X < BotTank.X
-----------------> BotTank: Set Not mirrored
----------------+ System: Else
-----------------> BotTank: Set Mirrored
[TerrianCanvas]
----+ [DISABLED] System: On start of layout
--------+ [DISABLED] System: For "X" from 0 to ceil(LayoutWidth ÷ GroundTilemap.TileWidth)
------------+ [DISABLED] System: For "Y" from 0 to ceil(LayoutHeight ÷ GroundTilemap.TileHeight)
-------------> [DISABLED] Dot: Set position to (GroundTilemap.TileToPositionX(LoopIndex("X")) + (GroundTilemap.TileWidth ÷ 2), GroundTilemap.TileToPositionY(LoopIndex("Y")) + (GroundTilemap.TileHeight ÷ 2))
----------------+ [DISABLED] Dot: Is overlapping GroundFamily
-----------------> [DISABLED] GroundTilemap: Set tile (LoopIndex("X"), LoopIndex("Y")) to tile 0 (normal)
[[Топливо Танков]]
----+ System: Every tick
----+ System: For each Players
----+ Players: Owner = ActivePlayer
----+ Players: IsThrottling = 1
--------+ Players: Owner = ActivePlayer
---------> Players: Subtract dt from Fuel
---------> Players: Set Fuel to max(0, Players.Fuel)
----+ System: Every tick
----+ System: For each Players
----+ Touch: Is touching Joy
----+ Players: IsThrottling = 1
-----> Players: Subtract dt from Fuel
-----> Players: Set Fuel to max(0, Players.Fuel)
[Новые Эффекты (Урон и Хит-Стоп)]
----* On function 'HitStop'
-----> System: Set time scale to 0.1
-----> System: Wait 0.05 seconds (use time scale: True)
-----> System: Set time scale to 1.0
| Local number piece = 0
| Local number rem = 0
----* On function 'ShowDamage'
----* Parameter 'dmgX' (Number)
----* Parameter 'dmgY' (Number)
----* Parameter 'Amount' (Number)
-----> System: Set rem to Amount
--------+ System: Amount > 15
------------+ System: Repeat 3 times
----------------+ System: LoopIndex < 2
-----------------> System: Set piece to round(rem × random(0.25, 0.45))
-----------------> System: Set rem to rem - piece
-----------------> System: Create object DamageText on layer "Game" at (dmgX + random(-25, 25), dmgY - random(20, 50)), create hierarchy: False, template: ""
-----------------> DamageText: Set text to "-" & piece
-----------------> DamageText: Set font size to 8 pt
----------------// // 1.Случайная сила "выброса" текста
-----------------> DamageText: Set Bullet speed to random(100, 180)
----------------// // 2.Случайное направление разлета (от 240 до 300 градусов — это веер вверх)
-----------------> DamageText: Set Bullet angle of motion to random(240, 300) degrees
----------------// // 3.Кручение! От -100 до 100 градусов в секунду (будет крутиться либо вправо, либо влево)
-----------------> DamageText: Set Rotate speed to random(-100, 100) degrees per second
----------------+ System: Else
-----------------> System: Set piece to rem
-----------------> System: Create object DamageText on layer "Game" at (dmgX + random(-25, 25), dmgY - random(20, 50)), create hierarchy: False, template: ""
-----------------> DamageText: Set text to "-" & piece
-----------------> DamageText: Set font size to 9 pt
-----------------> DamageText: Set font color to rgbEx(135, 15, 15)
----------------// // 1.Случайная сила "выброса" текста
-----------------> DamageText: Set Bullet speed to random(100, 180)
----------------// // 2.Случайное направление разлета (от 240 до 300 градусов — это веер вверх)
-----------------> DamageText: Set Bullet angle of motion to random(260, 280) degrees
----------------// // 3.Кручение! От -100 до 100 градусов в секунду (будет крутиться либо вправо, либо влево)
-----------------> DamageText: Set Rotate speed to random(-100, 100) degrees per second
--------+ System: Amount ≤ 15
---------> System: Create object DamageText on layer "Game" at (dmgX + random(-15, 15), dmgY -40), create hierarchy: False, template: ""
---------> DamageText: Set text to "-" & Amount
--------// // 1.Случайная сила "выброса" текста
---------> DamageText: Set Bullet speed to random(100, 180)
--------// // 2.Случайное направление разлета (от 240 до 300 градусов — это веер вверх)
---------> DamageText: Set Bullet angle of motion to random(240, 300) degrees
--------// // 3.Кручение! От -100 до 100 градусов в секунду (будет крутиться либо вправо, либо влево)
---------> DamageText: Set Rotate speed to random(-100, 100) degrees per second
[[Универсальный Урон]]
| Local number IncomingDmg = 0
| Local number FinalDamage = 0
----* On function 'TakeDamage'
----* Parameter 'TargetUID' (Number)
----* Parameter 'Damage' (Number)
----* Parameter 'HeavyHit' (Number)
----+ Players: Pick instance with UID TargetUID
-----> System: Set IncomingDmg to Damage
--------+ ShieldDome: TargetUID = Players.UID
---------> System: Set IncomingDmg to IncomingDmg × 0.3
--------+ System: Players.Owner = "Player2"
---------> System: Set FinalDamage to IncomingDmg + (IncomingDmg × (CurrentTankID × 0.1)) + (IncomingDmg × ((TankStats.At(CurrentTankID, 2) - 1) × 0.1))
---------> Players: Subtract FinalDamage from HP
--------+ System: Players.Owner = "Player1"
---------> System: Set FinalDamage to IncomingDmg + (IncomingDmg × (CurrentTankID × 0.1)) + (IncomingDmg × ((TankStats.At(CurrentTankID, 2) - 1) × 0.08))
---------> Players: Subtract FinalDamage from HP
--------+ (no conditions)
---------> Players: Set HP to max(0, Players.HP)
---------> Functions: Call ShowDamage (dmgX: Players.X, dmgY: Players.Y, Amount: FinalDamage)
--------+ System: ActivePlayer = "Player2"
--------+ Players: Owner = "Player1"
--------+ System: [X] Is BotDidHit
---------> System: Set BotDidHit to True
---------> System: Set BotShouldHoldPosition to True
---------> System: Set BotLastHitAngle to botLocalAngle
---------> System: Set BotLastHitPower to BotPowerTarget
---------> System: Set EmotionID to 3
---------> Functions: Call ShowBotEmotion
---------> Players: Set VelX to 0
---------> Players: Set VelY to -350
---------> Players: Set isGrounded to 0
--------+ Players: Owner = "Player2"
--------+ System: [X] Is BotGotHit
---------> System: Set BotGotHit to True
---------> System: Set BotShouldHoldPosition to True
---------> System: Set EmotionID to 2
---------> Functions: Call ShowBotEmotion
--------+ System: HeavyHit = 1
---------> [DISABLED] Players: Flash: Flash 0.05 on 0.05 off for 0.01 seconds
---------> Functions: Call HitStop
---------> Functions: Call VideoBoomFX (X: Players.X, Y: Players.Y)
--------+ System: Players.HP ≤ 0
--------+ Players: isDestroyed = 0
---------> Players: Set isDestroyed to 1
---------> System: Set IsShooting to 1
------------+ System: For each ShieldDome
------------+ ShieldDome: TargetUID = Players.UID
-------------> ShieldDome: Destroy
------------+ System: Players.Owner = "Player1"
-------------> PlayerBarrel: Destroy
-------------> System: Set MatchResult to "Defeat"
------------+ System: Players.Owner = "Player2"
-------------> BotBarrel: Destroy
-------------> System: Set MatchResult to "Victory"
------------+ (no conditions)
-------------> System: Set DeathUID to Players.UID
-------------> System: Set DeathPointX to Players.X
-------------> System: Set DeathPointY to Players.Y
-------------> System: Set DeathOwner to Players.Owner
-------------> System: Set time scale to 0.2
-------------> System: Set CamState to 4
-------------> System: Set CamTargetX to DeathPointX
-------------> System: Set CamTargetY to DeathPointY
-------------> System: Set CamTargetZoom to 2
-------------> System: Wait 1 seconds (use time scale: False)
-------------> Functions: Call FinishDeathFX
-------------> System: Wait 1.5 seconds (use time scale: False)
-------------> System: Set CamTargetZoom to 1
-------------> System: Set layout scale to 2.0
-------------> System: Set CamState to 4
-------------> AmmosFamily: Destroy
-------------> EndPanel: Set visibility Visible
-------------> EndText: Set visibility Visible
-------------> BtnHome: Set visibility Visible
-------------> BtnRestart: Set visibility Visible
-------------> Text_MatchTime: Set visibility Visible
------------// "Время боя: "
-------------> Text_MatchTime: Set text to ArrayLang.At(Lang, 24) & " " & floor(MatchTime ÷ 60) & ":" & zeropad(floor(MatchTime % 60), 2)
-------------> Text_Reward: Set visibility Visible
------------+ System: Players.Owner = "Player2"
------------// победа
-------------> EndText: Set text to ArrayLang.At(Lang, 19)
-------------> Text_Reward: Set text to ArrayLang.At(Lang, 22) & " +100 " & ArrayLang.At(Lang, 23)
-------------> System: Add 100 to Coins
-------------> System: Add 1 to LevelToPlay
-------------> System: Set JustWonBattle to True
-------------> Functions: Call SaveProgress
------------+ System: Players.Owner = "Player1"
----------------+ System: ActivePlayer = "Player1"
----------------// "САМОУНИЧТОЖЕНИЕ!"
-----------------> EndText: Set text to ArrayLang.At(Lang, 21)
-----------------> Text_Reward: Set text to ArrayLang.At(Lang, 22) & " 0 " & ArrayLang.At(Lang, 23)
-----------------> Functions: Call SaveProgress
----------------+ System: Else
----------------// "ПОРАЖЕНИЕ!"
-----------------> EndText: Set text to ArrayLang.At(Lang, 20)
-----------------> Text_Reward: Set text to ArrayLang.At(Lang, 22) & " +30 " & ArrayLang.At(Lang, 23)
-----------------> System: Add 30 to Coins
-----------------> Functions: Call SaveProgress
--------+ System: Else
--------+ System: HeavyHit = 1
--------+ System: [X] Is IsClusterActive
--------+ System: [X] Is IsMachineGunActive
--------+ System: [X] Is IsFountainActive
--------+ System: [X] Is IsTripleBurstActive
--------+ System: [X] Is IsAirstrikeActive
--------+ System: [X] Is IsVolcanoActive
--------+ System: IsSwarmActive = 0
--------+ System: CurrentProjectileType ≠ 12
--------+ System: CurrentProjectileType ≠ 13
--------+ System: CurrentProjectileType ≠ 14
--------+ System: CurrentProjectileType ≠ 15
--------+ System: CurrentProjectileType ≠ 16
--------+ System: CurrentProjectileType ≠ 19
--------+ System: CurrentProjectileType ≠ 23
--------+ System: CurrentProjectileType ≠ 24
--------+ System: CurrentProjectileType ≠ 25
---------> Functions: Call SwapPlayer
----[[Падение памятника RIP]]
--------+ System: Every tick
--------+ System: For each Tombstone
--------+ Tombstone: [X] Is HasLanded
--------+ Tombstone: Is overlapping GroundTilemap
---------> Tombstone: Set HasLanded to True
---------> Tombstone: Set Platform Disabled
---------> Tombstone: Set angle to 0 degrees
---------> System: Set ShakePower to 15
---------> System: Create object SmokeParticles2 on layer "Game" at (Tombstone.X, Tombstone.Y), create hierarchy: False, template: ""
---------> SmokeParticles2: Set spraying
---------> SmokeParticles2: Set rate to 150
[[Эффект ударной волны]]
----+ System: Every tick
----+ System: For each Shockwave
-----> Shockwave: Set height to Shockwave.Height + (500 × dt)
-----> Shockwave: Set width to Shockwave.Width + (500 × dt)
-----> Shockwave: Set opacity to Shockwave.Opacity - (250 × dt)
--------+ Shockwave: Opacity ≤ 0
---------> Shockwave: Destroy
[[Кнопки конца боя]]
----+ Touch: On any touch start
----+ Touch: Is touching BtnRestart
----+ BtnRestart: Is visible
-----> System: Restart layout
----+ Touch: On any touch start
----+ Touch: Is touching BtnHome
----+ BtnHome: Is visible
-----> System: Go to Hangar
----+ Touch: On any touch start
----+ Touch: Is touching BtnSelfDestruct
----+ PlayerTank: isDestroyed = 0
-----> System: Set LastUiClickTime to wallclocktime
-----> Functions: Call TakeDamage (TargetUID: PlayerTank.UID, Damage: 9999, HeavyHit: 1)
----[[Смерть при падении за карту]]
--------+ System: Every tick
--------+ System: For each Players
--------+ Players: Y > LayoutHeight + 100
--------+ Players: isDestroyed = 0
---------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 9999, HeavyHit: 0)
[--- ТАЙМЕР БОЯ ---]
----+ System: Every tick
----+ PlayerTank: isDestroyed = 0
----+ BotTank: isDestroyed = 0
-----> System: Add dt to MatchTime
[[Эффекты Воды (Всплески)]]
----+ System: On start of layout
-----> splash: Destroy
-----> WaterSplash: Destroy
----+ System: Every tick
----+ System: For each Players
--------+ Players: Is overlapping water
--------+ Players: [X] Is inWater
---------> Players: Set inWater to True
---------> System: Create object splash on layer "Game" at (Players.X, Water.BBoxTop), create hierarchy: False, template: ""
------------+ [DISABLED] System: Repeat 200 times
-------------> [DISABLED] WaterSplash: Set Bullet speed to random(100, 250)
-------------> [DISABLED] WaterSplash: Set Bullet angle of motion to random(220, 320) degrees
-------------> [DISABLED] WaterSplash: Set scale to random(0.5, 0.8)
----+ System: Every tick
----+ System: For each Players
--------+ Players: [X] Is overlapping water
--------+ Players: Is inWater
---------> Players: Set inWater to False
---------> System: Create object splash on layer "water" at (Players.X, Water.BBoxTop), create hierarchy: False, template: ""
------------+ [DISABLED] System: Repeat 200 times
-------------> [DISABLED] System: Create object WaterSplash on layer "Game" at (Players.X + random(-20, 20), Water.BBoxTop), create hierarchy: False, template: ""
-------------> [DISABLED] WaterSplash: Set Bullet speed to random(150, 400)
-------------> [DISABLED] WaterSplash: Set Bullet angle of motion to random(220, 320) degrees
-------------> [DISABLED] WaterSplash: Set scale to random(0.8, 0.1)
----+ WaterSplash: On collision with water
-----> WaterSplash: Destroy
----+ AmmosFamily: On collision with water
--------+ System: Repeat 100 times
---------> System: Create object WaterSplash on layer "water" at (ammosFamily.X + random(-10, 10), Water.BBoxTop), create hierarchy: False, template: ""
---------> WaterSplash: Set Bullet speed to random(50, 200)
---------> WaterSplash: Set Bullet angle of motion to random(220, 320) degrees
---------> WaterSplash: Set scale to random(0.8, 0.1)
----[[Фоновые Пузырьки]]
--------+ System: Every 0.2 seconds
------------+ System: Repeat 4 times
-------------> System: Create object Bubble on layer "Game" at (random(water.BBoxLeft, water.BBoxRight), water.BBoxBottom), create hierarchy: False, template: ""
-------------> Bubble: Tween "Float" property Y to water.BBoxTop + Self.Height ÷ 2 in random(0.5, 1.5) seconds (Linear, destroy: No, loop: No, ping pong: No, repeat count: 1)
-------------> Bubble: Move in front water
-------------> Bubble: Set opacity to random(25, 70)
--------+ Bubble: On Tween "Float" finished
---------> Bubble: Set animation to "Burst" (play from beginning)
--------+ Bubble: On animation "Burst" finished
---------> Bubble: Destroy
----[утопление танка]
--------+ System: Every tick
---------> AirBar_BG: Set visibility Invisible
---------> AirBar_Fill: Set visibility Invisible
---------> AirBar_Fill: Set width to AirBar_BG.Width
--------+ System: Every tick
--------+ System: For each Players
--------+ Players: isDestroyed = 0
------------+ Players: Is overlapping water
-------------> Players: Subtract dt from AirTimer
-------------> AirBar_BG: Set visibility Visible
-------------> AirBar_Fill: Set visibility Visible
-------------> AirBar_BG: Set position to (Players.X - (AirBar_BG.Width ÷ 2), Players.Y - 50)
-------------> AirBar_Fill: Set position to (AirBar_BG.BBoxLeft, AirBar_BG.Y)
-------------> AirBar_Fill: Set width to (Players.AirTimer ÷ 5.0) × AirBar_BG.Width
-------------> AirBar_BG: Move to top of layer
-------------> AirBar_Fill: Move to top of layer
----------------+ Players: AirTimer ≤ 0
-----------------> Players: Set isDestroyed to 1
-----------------> Players: Set VelX to 0
-----------------> Players: Set VelY to 0
-----------------> System: Set IsShooting to 1
-----------------> AirBar_BG: Set visibility Invisible
-----------------> AirBar_Fill: Set visibility Invisible
--------------------+ System: Players.Owner = "Player1"
---------------------> EndPanel: Set visibility Visible
---------------------> EndText: Set visibility Visible
--------------------// "ВАШ ТАНК ПОТОПЛЕН ВАМИ"
---------------------> EndText: Set text to ArrayLang.At(Lang, 26)
---------------------> Text_Reward: Set visibility Visible
---------------------> Text_Reward: Set text to " 0 "
---------------------> BtnHome: Set visibility Visible
---------------------> BtnRestart: Set visibility Visible
---------------------> Functions: Call SaveProgress
--------------------+ System: Players.Owner = "Player2"
---------------------> EndPanel: Set visibility Visible
---------------------> EndText: Set visibility Visible
---------------------> EndText: Set text to ArrayLang.At(Lang, 27)
---------------------> Text_Reward: Set visibility Visible
---------------------> Text_Reward: Set text to " +50 "
---------------------> BtnHome: Set visibility Visible
---------------------> BtnRestart: Set visibility Visible
---------------------> System: Add 50 to Coins
---------------------> System: Add 1 to LevelToPlay
---------------------> Functions: Call SaveProgress
------------+ System: Else
-------------> Players: Set AirTimer to 5
[[РУЧНОЙ ЗУМ - Колесо и Пинч]]
| Local number TouchStartX = 0
| Local number TouchStartY = 0
----[ПК: Колесико]
--------+ Mouse: On mouse wheel up
--------+ System: ActivePlayer = "Player1"
--------+ System: [X] Is IsWeaponMenuOpen
---------> System: Set TargetManualZoom to clamp(TargetManualZoom + 0.15, MinZoom, MaxZoom)
--------+ Mouse: On mouse wheel down
--------+ System: ActivePlayer = "Player1"
--------+ System: [X] Is IsWeaponMenuOpen
---------> System: Set TargetManualZoom to clamp(TargetManualZoom - 0.15, MinZoom, MaxZoom)
----[Телефон: Пинч двумя пальцами]
| Local number CurrDist = 0
--------+ System: Every tick
--------+ Touch: Has touch 2
--------+ System: [X] Is IsWeaponMenuOpen
---------> System: Set CurrDist to distance(Touch.XAt(0), Touch.YAt(0), Touch.XAt(1), Touch.YAt(1))
------------+ System: [X] Is IsPinching
-------------> System: Set IsPinching to True
-------------> System: Set PrevPinchDist to CurrDist
-------------> System: Set IsAimingTouch to False
------------+ System: Else
-------------> System: Set TargetManualZoom to clamp(TargetManualZoom + (CurrDist - PrevPinchDist) × 0.004, MinZoom, MaxZoom)
-------------> System: Set PrevPinchDist to CurrDist
--------+ Touch: On any touch start
--------+ Touch: Has touch 1
--------+ System: [X] Is IsAimingTouch
---------> System: Set TouchStartX to Touch.X
---------> System: Set TouchStartY to Touch.Y
--------+ Touch: Is in touch
--------+ Touch: Has touch 1
--------+ System: [X] Is IsAimingTouch
---------> System: Scroll to ((TouchStartX - Touch.X) ÷ LayoutScale, (TouchStartY - Touch.Y) ÷ LayoutScale)
---------> System: Set TouchStartX to Touch.X
---------> System: Set TouchStartY to Touch.Y
--------+ System: Every tick
--------+ Touch: [X] Has touch 2
---------> System: Set IsPinching to False
----[Плавность]
--------+ System: Every tick
---------> System: Set ManualZoom to lerp(ManualZoom, TargetManualZoom, 9 × dt)
----[Сброс зума двойным тапом -]
--------+ Touch: On double-tap gesture on GroundTilemap
--------+ Mouse: [X] Cursor is over GroundTilemap
---------> System: Set TargetManualZoom to 1
---------> [DISABLED] System: Set layout scale to 1.0
[[Эмоции] Функция]
----* On function 'ShowBotEmotion'
-----> BotEmotion: Destroy
-----> System: Create object BotEmotion on layer "Game" at (BotTank.X, BotTank.Y -80), create hierarchy: False, template: ""
-----> BotEmotion: Pin Pin to BotTank (X: True, Y: True, angle: True, width: No, height: No, Z: False)
--------+ System: EmotionID = 0
---------> BotEmotion: Set animation to "Think" (play from beginning)
--------+ System: EmotionID = 1
---------> BotEmotion: Set animation to "Hit" (play from beginning)
--------+ System: EmotionID = 2
---------> BotEmotion: Set animation to "Miss" (play from beginning)
--------+ (no conditions)
---------> System: Wait 2 seconds (use time scale: True)
---------> BotEmotion: Destroy
[[Лазерный луч] Функция]
| Local number currentY = 0
| Local number currentX = 0
| Local number surfY = 0
| Local number maxX = 0
| Local number burnDepth = 0
| Local number minX = 0
| Local number step = 0
| Local number h = 0
| Local number stepIncrement = 0
----* On function 'BurnLine'
----* Parameter 'startX' (Number)
----* Parameter 'startY' (Number)
----* Parameter 'endX' (Number)
----* Parameter 'endY' (Number)
--------+ (no conditions)
---------> System: Set step to 0
---------> System: Set burnDepth to 25
---------> System: Set stepIncrement to 1 ÷ max(1, abs(endX - startX))
---------> System: Set minX to LayoutWidth
---------> System: Set maxX to -1
------------+ System: While
------------+ System: step ≤ 1
-------------> System: Set currentX to lerp(startX, endX, step)
-------------> System: Set currentY to lerp(startY, endY, step)
-------------> System: Set h to HeightMap.At(clamp(floor(currentX), 0, LayoutWidth), 0)
-------------> System: Add stepIncrement to step
----------------+ System: currentY ≥ h - 5
-----------------> HeightMap: Set value at (clamp(floor(currentX), 0, LayoutWidth), 0) to h + burnDepth
-----------------> BurnMap: Set value at (clamp(floor(currentX), 0, LayoutWidth), 0) to 0
-----------------> System: Create object SmokeParticles2 on layer "Game" at (currentX, currentY), create hierarchy: False, template: ""
-----------------> SmokeParticles2: Set spraying
-----------------> System: Create object LaserRing on layer "Game" at (currentX, currentY), create hierarchy: False, template: ""
-----------------> System: Set minX to min(minX, floor(currentX))
-----------------> System: Set maxX to max(maxX, floor(currentX))
------------+ System: maxX ≥ minX
----------------+ System: Repeat 5 times
--------------------+ System: For "bx" from max(0, minX + 1) to min(LayoutWidth, maxX - 1)
---------------------> System: Set h to (HeightMap.At(LoopIndex("bx") - 1, 0) + HeightMap.At(LoopIndex("bx"), 0) + HeightMap.At(LoopIndex("bx") + 1, 0)) ÷ 3
---------------------> HeightMap: Set value at (LoopIndex("bx"), 0) to h
------------+ System: maxX ≥ minX
----------------+ System: For "bx" from max(0, minX - 2) to min(LayoutWidth, maxX + 2)
-----------------> System: Set h to floor(HeightMap.At(LoopIndex("bx"), 0))
-----------------> GroundTilemap: Erase tile range (LoopIndex("bx"), 0) area 1 x ceil(LayoutHeight ÷ GroundTilemap.TileHeight)
-----------------> GroundTilemap: Set tiles at (LoopIndex("bx"), h) with area 1 x (LayoutHeight - h) to tile 0 (normal)
------------+ System: maxX ≥ minX
-------------> Functions: Call RenderTerrain (FromX: max(0, minX - 20), ToX: min(LayoutWidth, maxX + 20))
[анимации и партиклы]
----+ explosion: On animation "boom" finished
-----> explosion: Destroy
----+ explosion: On animation "Ice_boom" finished
-----> explosion: Destroy
----+ SmokeParticles: On created
-----> System: Wait 0.2 seconds (use time scale: True)
-----> SmokeParticles: Set not spraying
-----> System: Wait 1.5 seconds (use time scale: True)
-----> SmokeParticles: Destroy
----+ SmokeParticles2: On created
-----> System: Wait 0.2 seconds (use time scale: True)
-----> SmokeParticles2: Set not spraying
-----> System: Wait 1.5 seconds (use time scale: True)
-----> SmokeParticles2: Destroy
[[Аирдроп]]
----[[Аирдроп: Логика Портала]]
--------+ System: On start of layout
---------> Portal: Destroy
--------+ Portal: On animation "open" finished
---------> Portal: Spawn AirDrop on layer "Game" (image point 0, create hierarchy: False, template: "")
---------> AirDrop: Set DropState to 1
---------> AirDrop: Set Platform maximum speed to 1500
---------> AirDrop: Set Platform gravity to 1500
---------> Portal: Destroy
----[[Аирдроп: Логика Парашюта]]
--------+ System: On start of layout
---------> AirDrop: Destroy
---------> Parachute: Destroy
--------+ System: Every tick
--------+ System: For each AirDrop
--------+ AirDrop: DropState = 0
---------> AirDrop: Set Platform vector X to sin(time × 150) × 40
---------> AirDrop: Set angle to sin(time × 150) × 10 degrees
--------+ AirDrop: Is overlapping GroundTilemap
---------> AirDrop: Set DropState to 1
---------> AirDrop: Set Platform max fall speed to 1500
---------> AirDrop: Set Platform gravity to 1500
---------> AirDrop: Set angle to 0 degrees
---------> AirDrop: Set Platform vector X to 0
--------+ AirDrop: Is overlapping GroundTilemap
--------+ Parachute: Landed = 0
---------> Parachute: Pin Unpin
---------> Parachute: Set Landed to 1
--------+ System: Every tick
--------+ System: For each Parachute
--------+ Parachute: Landed = 1
---------> Parachute: Set height to max(0, Parachute.Height - (200 × dt))
---------> Parachute: Set opacity to Parachute.Opacity - (100 × dt)
------------+ Parachute: Opacity ≤ 0
-------------> Parachute: Destroy
--------+ AirDrop: Platform is on floor
--------+ AirDrop: HasLanded = 0
--------+ System: SwapPending = 0
---------> AirDrop: Set HasLanded to 1
---------> System: Wait 1.0 seconds (use time scale: True)
---------> System: Set IsShooting to 0
------------+ System: ActivePlayer = "Player2"
-------------> System: Set BotState to 5
--------+ AirDrop: Y > LayoutHeight + 100
--------+ System: SwapPending = 0
---------> AirDrop: Destroy
---------> System: Set IsShooting to 0
------------+ System: ActivePlayer = "Player2"
-------------> System: Set BotState to 5
----[[[ЯЩИК: Плавание на воде]]]
--------+ AirDrop: Is overlapping water
--------+ AirDrop: DropState ≠ 2
--------+ System: SwapPending = 0
---------> AirDrop: Set DropState to 2
---------> AirDrop: Set Platform Disabled
---------> AirDrop: Set HasLanded to 1
---------> System: Create object splash on layer "water" at (AirDrop.X, Water.BBoxTop), create hierarchy: False, template: ""
---------> System: Wait 1.0 seconds (use time scale: True)
---------> System: Set IsShooting to 0
------------+ System: ActivePlayer = "Player2"
-------------> System: Set BotState to 5
--------+ System: Every tick
--------+ System: For each AirDrop
--------+ AirDrop: DropState = 2
---------> AirDrop: Set Y to Water.BBoxTop + (sin(time × 150) × 6)
---------> AirDrop: Set angle to sin(time × 100) × 5 degrees
----[[[ЯЩИК: Взрыв от попадания снаряда]]]
--------+ AirDrop: On collision with AmmosFamily
---------> System: Set ShakePower to 20
---------> System: Create object explosion on layer "Game" at (AirDrop.X, AirDrop.Y), create hierarchy: False, template: ""
---------> explosion: Set animation to "boom" (play from beginning)
---------> explosion: Set scale to 0.3
---------> System: Create object SmokeParticles2 on layer "Game" at (AirDrop.X, AirDrop.Y), create hierarchy: False, template: ""
---------> SmokeParticles2: Set spraying
---------> Functions: Call Blast (x: AirDrop.X, y: AirDrop.Y, Radius: 45)
------------+ System: For each Players
------------+ Players: isDestroyed = 0
------------+ System: distance(Players.X, Players.Y, AirDrop.X, AirDrop.Y) < 70
-------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 30, HeavyHit: 1)
------------+ (no conditions)
-------------> AirDrop: Destroy
[[СБОР АИРДРОПА И ВЫПАДЕНИЕ ОРУЖИЯ]]
| Local string LootWeaponName =
| Local number LootAmount = 0
| Local number LootWeaponID = 0
| Local number LootRoll = 0
----+ Players: On collision with AirDrop
----+ Players: isDestroyed = 0
----+ AirDrop: DropState ≠ 0
-----> System: Create object SmokeParticles2 on layer "Game" at (AirDrop.X, AirDrop.Y), create hierarchy: False, template: ""
-----> SmokeParticles2: Set spraying
-----> System: Set ShakePower to 5
-----> AirDrop: Destroy
-----> System: Set LootRoll to random(1, 100)
-----> System: Set IsShooting to 0
// // 3% шанс (1-3) -> ЯДЕРНАЯ БОМБА (ID 16) - 1 штука
--------+ System: LootRoll ≤ 3
---------> System: Set LootWeaponID to 16
---------> System: Set LootAmount to 1
---------> System: Set LootWeaponName to "ЯДЕРНАЯ БОМБА!"
// // 4% шанс (4-7) -> ИОННАЯ ПУШКА (ID 12) - 1 штуки
--------+ System: LootRoll > 3
--------+ System: LootRoll ≤ 7
---------> System: Set LootWeaponID to 12
---------> System: Set LootAmount to 1
---------> System: Set LootWeaponName to "ИОННАЯ ПУШКА!"
// // 5% шанс (8-12) -> ЛАЗЕР (ID 9) - 2 штуки
--------+ System: LootRoll > 7
--------+ System: LootRoll ≤ 12
---------> System: Set LootWeaponID to 9
---------> System: Set LootAmount to 1
---------> System: Set LootWeaponName to "ЛАЗЕР!"
// // 6% шанс (13-18) -> ТЕЛЕПОРТ (ID 15) - 2 штуки
--------+ System: LootRoll > 12
--------+ System: LootRoll ≤ 18
---------> System: Set LootWeaponID to 15
---------> System: Set LootAmount to 1
---------> System: Set LootWeaponName to "ТЕЛЕПОРТ!"
// 7% шанс (19-26) -> КЛАСТЕРНАЯ БОМБА (ID 4) - 3 штуки
--------+ System: LootRoll > 18
--------+ System: LootRoll ≤ 25
---------> System: Set LootWeaponID to 4
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "КЛАСТЕРНАЯ БОМБА!"
// 7% шанс (27-34) -> УДАР ПО ПЛОЩАДИ (ID 13) - 3 штуки
--------+ System: LootRoll > 25
--------+ System: LootRoll ≤ 32
---------> System: Set LootWeaponID to 13
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "УДАР ПО ПЛОЩАДИ!"
// 7% шанс (35-42) -> РОЛЛЕР (ID 11) - 3 штуки
--------+ System: LootRoll > 32
--------+ System: LootRoll ≤ 39
---------> System: Set LootWeaponID to 11
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "РОЛЛЕР!"
// 7% шанс (43-50) -> ПУЛЕМЕТ (ID 5) - 3 штуки
--------+ System: LootRoll > 39
--------+ System: LootRoll ≤ 46
---------> System: Set LootWeaponID to 5
---------> System: Set LootAmount to 3
---------> System: Set LootWeaponName to "ПУЛЕМЕТ!"
// 7% шанс (от 46 до 70) -> ДВОЙНОЙ ЗАЛП (ID 14) - 4 штуки
--------+ System: LootRoll > 46
--------+ System: LootRoll ≤ 53
---------> System: Set LootWeaponID to 14
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "ДВОЙНОЙ ЗАЛП!"
// 8% шанс (59-67) -> ПРЫГУЧКА (Bouncer) (ID 6) - 3 штуки
--------+ System: LootRoll > 53
--------+ System: LootRoll ≤ 61
---------> System: Set LootWeaponID to 6
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "ПРЫГУЧАЯ БОМБА!"
// 8% шанс (68-76) -> НАПАЛМ (ID 1) - 3 штуки
--------+ System: LootRoll > 61
--------+ System: LootRoll ≤ 69
---------> System: Set LootWeaponID to 1
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "НАПАЛМ!"
// 8% шанс (77-85) -> ЗАМОРОЗКА (ID 10) - 3 штуки
--------+ System: LootRoll > 69
--------+ System: LootRoll ≤ 77
---------> System: Set LootWeaponID to 10
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "ЗАМОРОЗКА!"
// 5% шанс (78-85) -> САМОНАВЕДЕНИЕ (ID 2) - 5 штук
--------+ System: LootRoll > 77
--------+ System: LootRoll ≤ 81
---------> System: Set LootWeaponID to 2
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "САМОНАВЕДЕНИЕ!"
// 5% шанс (82-86) -> АВИАУДАР (ID 19) - 2 штуки
--------+ System: LootRoll > 81
--------+ System: LootRoll ≤ 84
---------> System: Set LootWeaponID to 19
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "АВИАУДАР!"
// 4% шанс (86-90) -> БУР (Побег) (ID 8) - 3 штуки
--------+ System: LootRoll > 84
--------+ System: LootRoll ≤ 88
---------> System: Set LootWeaponID to 8
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "БУР!"
// 4% шанс (91-95) -> ГРЯЗЕВАЯ БОМБА (Строитель) (ID 7) - 3 штуки
--------+ System: LootRoll > 88
--------+ System: LootRoll ≤ 91
---------> System: Set LootWeaponID to 7
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "СТРОИТЕЛЬ!"
// 4% шанс (96-100) -> МИНА (ID 3) - 3 штуки
--------+ System: LootRoll > 91
--------+ System: LootRoll ≤ 94
---------> System: Set LootWeaponID to 3
---------> System: Set LootAmount to 2
---------> System: Set LootWeaponName to "МИНА!"
// // 6% шанс (95-100) -> АПТЕЧКА (+30% ЖИЗНИ) (ID 99)
--------+ System: LootRoll > 94
---------> System: Set LootWeaponID to 99
---------> System: Set LootAmount to 30
---------> System: Set LootWeaponName to "% ЖИЗНИ!"
--------+ (no conditions)
------------+ System: LootWeaponID = 99
-------------> Players: Set HP to min(Players.MaxHP, Players.HP + (Players.MaxHP × 0.3))
------------+ System: Else
-------------> WeaponAmmo: Set value at LootWeaponID to WeaponAmmo.At(LootWeaponID) + LootAmount
--------+ (no conditions)
---------> WeaponAmmo: Set value at (LootWeaponID) to WeaponAmmo.At(LootWeaponID) + LootAmount
---------> System: Create object DamageText on layer "UI" at (Players.X, Players.Y - 80), create hierarchy: False, template: ""
---------> DamageText: Set text to "+" & LootAmount & " " & (LootWeaponID = 99 ? ArrayLang.At(Lang, 28) : (WepDesc.At(Lang, LootWeaponID × 3) & "!"))
---------> DamageText: Set font color to rgbEx(0, 0, 0)
---------> DamageText: Fade: set wait time to 2
---------> DamageText: Fade: set fade-out time to 1
---------> DamageText: Set Bullet gravity to 0
---------> DamageText: Set Bullet speed to 50
---------> DamageText: Set Rotate Disabled
---------> DamageText: Set Bullet angle of motion to 270 degrees
---------> System: Wait 1.5 seconds (use time scale: True)
--------+ System: ActivePlayer = "Player2"
---------> System: Set BotState to 5
----+ System: Players.Owner = "Player2"
-----> System: Set BotWeapon1 to LootWeaponID
-----> System: Set BotWeapon1 to choose(0, 1, 4, 6)
----+ AirDrop: On destroyed
----+ System: IsShooting = 1
----+ System: MatchResult = ""
----+ System: AmmosFamily.Count = 0
----+ System: Portal.Count = 0
----+ System: SwapPending = 0
-----> System: Set IsShooting to 0
--------+ System: ActivePlayer = "Player2"
---------> System: Set BotState to 5
----+ System: Every tick
----+ System: IsShooting = 1
----+ System: MatchResult = ""
----+ System: AmmosFamily.Count = 0
----+ System: Portal.Count = 0
----+ System: AirDrop.Count = 0
----+ System: SwapPending = 0
----+ System: IsSwarmActive = 0
----+ System: [X] Is IsMachineGunActive
----+ System: [X] Is IsClusterActive
----+ System: [X] Is IsFountainActive
----+ System: [X] Is IsAirstrikeActive
----+ System: [X] Is IsBoomerangActive
----+ System: [X] Is IsTripleBurstActive
----+ System: [X] Is IsVolcanoActive
----+ System: Trigger once
-----> System: Wait 0.3 seconds (use time scale: False)
-----> System: Set IsShooting to 0
--------+ System: ActivePlayer = "Player2"
---------> System: Set BotState to 5
----+ System: Every tick
----+ System: IsShooting = 1
----+ System: MatchResult = ""
----+ System: AmmosFamily.Count = 0
----+ System: Portal.Count = 0
----+ System: AirDrop.Count > 0
----+ AirDrop: DropState = 2
----+ System: SwapPending = 0
----+ System: Trigger once
-----> System: Wait 1.5 seconds (use time scale: False)
-----> System: Set IsShooting to 0
--------+ System: ActivePlayer = "Player2"
---------> System: Set BotState to 5
----+ System: Every tick
----+ System: IsShooting = 1
----+ System: MatchResult = ""
----+ System: AmmosFamily.Count = 0
----+ System: Portal.Count = 0
----+ System: AirDrop.Count > 0
----+ AirDrop: HasLanded = 1
----+ System: SwapPending = 0
----+ System: Trigger once
-----> System: Wait 2.0 seconds (use time scale: False)
-----> System: Set IsShooting to 0
--------+ System: ActivePlayer = "Player2"
---------> System: Set BotState to 5
[BotAmmo]
----+ System: On start of layout
-----> BotAmmo: Set size to (26, 1, 1)
-----> BotAmmo: Set value at (0) to 999
----// огненный
-----> BotAmmo: Set value at (1) to 3
----// ракета
-----> BotAmmo: Set value at (2) to 3
----// мина
-----> BotAmmo: Set value at (3) to 3
----// кластерный
-----> BotAmmo: Set value at (4) to 3
----// пулемет
-----> BotAmmo: Set value at (5) to 3
----// Прыгучка
-----> BotAmmo: Set value at (6) to 3
----// грязевая
-----> BotAmmo: Set value at (7) to 3
----// бур
-----> BotAmmo: Set value at (8) to 3
----// лазер
-----> BotAmmo: Set value at (9) to 3
----// заморозка
-----> BotAmmo: Set value at (10) to 3
----// Роллер / Ездок (Roller / Road Runner)
-----> BotAmmo: Set value at (11) to 3
----// молния
-----> BotAmmo: Set value at (12) to 3
----// УДАР ПО ПЛОЩАДИ
-----> BotAmmo: Set value at (13) to 3
----// двойной снаряд
-----> BotAmmo: Set value at (14) to 3
----// телепорт
-----> BotAmmo: Set value at (15) to 3
----// ядерная
-----> BotAmmo: Set value at (16) to 3
----// фонтан
-----> BotAmmo: Set value at (17) to 3
----// энергокупол
-----> BotAmmo: Set value at (18) to 3
----// Авиаудар
-----> BotAmmo: Set value at (19) to 3
----// НЛО
-----> BotAmmo: Set value at (20) to 3
----// RC
-----> BotAmmo: Set value at (21) to 3
----// RC DRON
-----> BotAmmo: Set value at (22) to 3
----// бумеранг
-----> WeaponAmmo: Set value at (23) to 3
----// тройной залп
-----> WeaponAmmo: Set value at (24) to 3
----// вулкан
-----> WeaponAmmo: Set value at (25) to 3
----[BotChooseWeapon]
--------* On function 'BotChooseWeapon'
---------> System: Set BotCurrentWeapon to 0
---------> System: Set BotDirectAim to 0
---------> System: Set DistX to abs(PlayerTank.X - BotTank.X)
---------> [DISABLED] System: Set BotCurrentWeapon to 9
---------> [DISABLED] System: Set BotDirectAim to 1
---------> [DISABLED] BotAmmo: Set value at 9 to 99
// 1. БУР: если замурован
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 8
------------+ System: BotAmmo.At(8) > 0
------------+ BotTank: Is overlapping GroundTilemap at offset (0, -15)
-------------> System: Set BotCurrentWeapon to 8
-------------> System: Set BotDirectAim to 0
-------------> System: Set BotLastWeapon to 8
-------------> BotAmmo: Set value at 8 to BotAmmo.At(8) - 1
// 2. БУР: если застрял
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 8
------------+ System: BotAmmo.At(8) > 0
------------+ System: Is BotWasStuck
-------------> System: Set BotCurrentWeapon to 8
-------------> System: Set BotDirectAim to 0
-------------> System: Set BotWasStuck to False
-------------> System: Set BotLastWeapon to 8
-------------> BotAmmo: Set value at 8 to BotAmmo.At(8) - 1
// // --------------------------------------------------
// 1. БЛИЗКО: ПРЯМОЙ ОГОНЬ
// --------------------------------------------------
// Заморозка в упор
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 10
------------+ System: DistX < 180
------------+ System: abs(PlayerTank.Y - BotTank.Y) < 80
------------+ System: BotAmmo.At(10) > 0
------------+ System: random(100) < 45
-------------> System: Set BotCurrentWeapon to 10
-------------> System: Set BotLastWeapon to 10
-------------> System: Set BotDirectAim to 1
-------------> BotAmmo: Set value at 10 to BotAmmo.At(10) - 1
// Пулемёт в упор
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 5
------------+ System: DistX < 160
------------+ System: abs(PlayerTank.Y - BotTank.Y) < 70
------------+ System: BotAmmo.At(5) > 0
------------+ System: random(100) < 50
-------------> System: Set BotCurrentWeapon to 5
-------------> System: Set BotLastWeapon to 5
-------------> System: Set BotDirectAim to 1
-------------> BotAmmo: Set value at 5 to BotAmmo.At(5) - 1
// Напалм близко
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 1
------------+ System: DistX < 220
------------+ System: BotAmmo.At(1) > 0
------------+ System: random(100) < 40
-------------> System: Set BotCurrentWeapon to 1
-------------> System: Set BotLastWeapon to 1
-------------> System: Set BotDirectAim to 1
-------------> BotAmmo: Set value at 1 to BotAmmo.At(1) - 1
// Мина рядом
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 3
------------+ System: DistX < 240
------------+ System: BotAmmo.At(3) > 0
------------+ System: random(100) < 40
-------------> System: Set BotCurrentWeapon to 3
-------------> System: Set BotLastWeapon to 3
-------------> System: Set BotDirectAim to 1
-------------> BotAmmo: Set value at 3 to BotAmmo.At(3) - 1
// // --------------------------------------------------
// 2. ИГРОК ВНИЗУ / В ЯМЕ
//
// Кластер
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 4
------------+ System: PlayerTank.Y < BotTank.Y + 60
------------+ System: BotAmmo.At(4) > 0
------------+ System: random(100) < 25
-------------> System: Set BotCurrentWeapon to 4
-------------> System: Set BotLastWeapon to 4
-------------> BotAmmo: Set value at 4 to BotAmmo.At(4) - 1
// Удар по площади
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 13
------------+ System: PlayerTank.Y < BotTank.Y + 60
------------+ System: BotAmmo.At(13) > 0
------------+ System: random(100) < 40
-------------> System: Set BotCurrentWeapon to 13
-------------> System: Set BotLastWeapon to 13
-------------> BotAmmo: Set value at 13 to BotAmmo.At(13) - 1
// Ионка по яме
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 12
------------+ System: PlayerTank.Y < BotTank.Y + 80
------------+ System: BotAmmo.At(12) > 0
------------+ System: random(100) < 25
-------------> System: Set BotCurrentWeapon to 12
-------------> System: Set BotLastWeapon to 12
-------------> BotAmmo: Set value at 12 to BotAmmo.At(12) - 1
// Фонтан по яме
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 17
------------+ System: PlayerTank.Y < BotTank.Y + 60
------------+ System: BotAmmo.At(17) > 0
------------+ System: random(100) < 35
-------------> System: Set BotCurrentWeapon to 17
-------------> System: Set BotLastWeapon to 17
-------------> BotAmmo: Set value at 17 to BotAmmo.At(17) - 1
// Авиаудар (Ковровая бомбардировка)
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 19
------------+ System: PlayerTank.Y < BotTank.Y + 60
------------+ System: BotAmmo.At(19) > 0
------------+ System: random(100) < 40
-------------> System: Set BotCurrentWeapon to 19
-------------> System: Set BotLastWeapon to 19
-------------> BotAmmo: Set value at 19 to BotAmmo.At(19) - 1
// вулкан
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 25
------------+ System: BotAmmo.At(25) > 0
------------+ System: random(100) < 20
-------------> System: Set BotCurrentWeapon to 25
-------------> System: Set BotLastWeapon to 25
-------------> BotAmmo: Set value at 25 to BotAmmo.At(25) - 1
// // --------------------------------------------------
// 3. ДАЛЕКО
// --------------------------------------------------
// Самонаведение
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 0
------------+ System: DistX > 420
------------+ System: BotAmmo.At(0) > 0
------------+ System: random(100) < 50
-------------> System: Set BotCurrentWeapon to 0
-------------> System: Set BotLastWeapon to 0
-------------> BotAmmo: Set value at 0 to BotAmmo.At(0) - 1
// Самонаведение
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 2
------------+ System: DistX > 420
------------+ System: BotAmmo.At(2) > 0
------------+ System: random(100) < 35
-------------> System: Set BotCurrentWeapon to 2
-------------> System: Set BotLastWeapon to 2
-------------> BotAmmo: Set value at 2 to BotAmmo.At(2) - 1
// Двойной залп
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 14
------------+ System: DistX > 450
------------+ System: BotAmmo.At(14) > 0
------------+ System: random(100) < 35
-------------> System: Set BotCurrentWeapon to 14
-------------> System: Set BotLastWeapon to 14
-------------> BotAmmo: Set value at 14 to BotAmmo.At(14) - 1
// Удар по площади далеко
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 13
------------+ System: DistX > 480
------------+ System: BotAmmo.At(13) > 0
------------+ System: random(100) < 25
-------------> System: Set BotCurrentWeapon to 13
-------------> System: Set BotLastWeapon to 13
-------------> System: Set BotPowerTarget to clamp(BotPowerTarget × 0.5, 20, 45)
-------------> BotAmmo: Set value at 13 to BotAmmo.At(13) - 1
// Ядерная редко и далеко
------------+ System: BotCurrentWeapon = 0
------------+ System: DistX > 550
------------+ System: BotAmmo.At(16) > 0
------------+ System: random(100) < 15
-------------> System: Set BotCurrentWeapon to 16
-------------> BotAmmo: Set value at 16 to BotAmmo.At(16) - 1
// Дрон камикадзе
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 22
------------+ System: DistX > 440
------------+ System: BotAmmo.At(22) > 0
------------+ System: random(100) < 30
-------------> System: Set BotCurrentWeapon to 22
-------------> System: Set BotLastWeapon to 22
-------------> BotAmmo: Set value at 22 to BotAmmo.At(22) - 1
// бумеранг
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 23
------------+ System: DistX > 350
------------+ System: BotAmmo.At(23) > 0
------------+ System: random(100) < 25
-------------> System: Set BotCurrentWeapon to 23
-------------> System: Set BotLastWeapon to 23
-------------> BotAmmo: Set value at 23 to BotAmmo.At(23) - 1
// // --------------------------------------------------
// 4. СЛУЧАЙНЫЕ НЕПРИЯТНЫЕ СНАРЯДЫ
//
// Прыгучка
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 6
------------+ System: BotAmmo.At(6) > 0
------------+ System: random(100) < 25
-------------> System: Set BotCurrentWeapon to 6
-------------> System: Set BotLastWeapon to 6
-------------> BotAmmo: Set value at 6 to BotAmmo.At(6) - 1
// Роллер
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 11
------------+ System: BotAmmo.At(11) > 0
------------+ System: random(100) < 20
-------------> System: Set BotCurrentWeapon to 11
-------------> System: Set BotLastWeapon to 11
-------------> BotAmmo: Set value at 11 to BotAmmo.At(11) - 1
// Тройной заряд
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 24
------------+ System: BotAmmo.At(24) > 0
------------+ System: random(100) < 25
-------------> System: Set BotCurrentWeapon to 24
-------------> System: Set BotLastWeapon to 24
-------------> BotAmmo: Set value at 24 to BotAmmo.At(24) - 1
// // --------------------------------------------------
// 5. БОТУ ПЛОХО
// --------------------------------------------------
// Грязевая защита
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 7
------------+ System: BotTank.HP < BotTank.MaxHP × 0.4
------------+ System: BotAmmo.At(7) > 0
------------+ System: random(100) < 35
-------------> System: Set BotCurrentWeapon to 7
-------------> System: Set BotLastWeapon to 7
-------------> BotAmmo: Set value at 7 to BotAmmo.At(7) - 1
// Телепорт отступление
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 15
------------+ System: BotTank.HP < BotTank.MaxHP × 0.3
------------+ System: BotAmmo.At(15) > 0
------------+ System: random(100) < 25
-------------> System: Set BotCurrentWeapon to 15
-------------> System: Set BotLastWeapon to 15
-------------> BotAmmo: Set value at 15 to BotAmmo.At(15) - 1
// БУР
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 8
------------+ System: BotTank.HP < BotTank.MaxHP × 0.3
------------+ BotTank: Is overlapping GroundTilemap at offset (0, -15)
------------+ System: BotAmmo.At(8) > 0
------------+ System: random(100) < 20
-------------> System: Set BotCurrentWeapon to 8
-------------> System: Set BotLastWeapon to 8
-------------> System: Set BotDirectAim to 0
-------------> BotAmmo: Set value at 8 to BotAmmo.At(8) - 1
// Энергокупол при низком HP
------------+ System: BotCurrentWeapon = 0
------------+ System: BotLastWeapon ≠ 18
------------+ System: BotTank.HP < BotTank.MaxHP × 0.5
------------+ System: BotAmmo.At(18) > 0
------------+ System: random(100) < 35
-------------> System: Set BotCurrentWeapon to 18
-------------> System: Set BotLastWeapon to 18
-------------> BotAmmo: Set value at 18 to BotAmmo.At(18) - 1
// // --------------------------------------------------
// 6. ЕСЛИ НИЧЕГО НЕ ВЫБРАЛ — ОБЫЧНЫЙ СНАРЯД
// -
// Телепорт отступление
------------+ System: BotCurrentWeapon = 0
-------------> System: Set BotCurrentWeapon to 0
----------------+ System: DistX < 150
----------------+ System: abs(PlayerTank.Y - BotTank.Y) < 70
-----------------> System: Set BotDirectAim to 1
----------------+ System: Else
-----------------> System: Set BotDirectAim to 0
// // --------------------------------------------------
// ЛАЗЕР: средняя и близкая дистанция
// --------------------------------------------------
------------+ System: BotCurrentWeapon = 0
------------+ System: DistX < 400
------------+ System: BotAmmo.At(9) > 0
------------+ System: random(100) < 35
-------------> System: Set BotCurrentWeapon to 9
-------------> BotAmmo: Set value at 9 to BotAmmo.At(9) - 1
-------------> System: Set BotDirectAim to 1
----[BotFireSelected]
// W — номер оружия
P — сила выстрела
| Local number A = 0
--------* On function 'BotFireSelected'
--------* Parameter 'W' (Number)
--------* Parameter 'P' (Number)
---------> System: Set A to BotBarrel.Angle + 180
---------> System: Set CurrentProjectileType to W
---------> System: Set SwapPending to 1
--------// Вспышка из дула
---------> System: Create object BoomPuff on layer "Game" at (BotBarrel.ImagePointX(1), BotBarrel.ImagePointY(1)), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 10
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to 1
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to 0
---------> BoomPuff: Set vy to 0
---------> BoomPuff: Set PuffScale to 0.35
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set color to rgb(210, 105, 30)
---------> BoomPuff: Set opacity to 100
// // Кольца дыма из дула
------------+ System: Repeat 10 times
-------------> System: Create object BoomPuff on layer "Game" at (BotBarrel.ImagePointX(1) + cos(BotBarrel.Angle + 180) × (LoopIndex×5), BotBarrel.ImagePointY(1) + sin(BotBarrel.Angle + 180) × (LoopIndex×5)), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 7
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to 0.5 + LoopIndex × 0.08
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to cos(BotBarrel.Angle + 180) × random(30, 70)
-------------> BoomPuff: Set vy to sin(BotBarrel.Angle + 180) × random(30, 70) - random(10, 20)
-------------> BoomPuff: Set PuffScale to random(0.05, 0.2)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set angle to random(0, 360) degrees
-------------> BoomPuff: Set Spin to random(-120, 120)
-------------> BoomPuff: Set color to rgb(169, 169, 169)
-------------> BoomPuff: Set opacity to 70
------------+ System: Repeat 10 times
-------------> System: Create object BoomPuff on layer "Game" at (BotBarrel.ImagePointX(1) + cos(BotBarrel.Angle + 180) , BotBarrel.ImagePointY(1) + sin(BotBarrel.Angle + 180)), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 7
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to 0.3 + LoopIndex × 0.1
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to cos(BotBarrel.Angle + 180) × random(30, 70)
-------------> BoomPuff: Set vy to sin(BotBarrel.Angle + 180) × random(30, 70) - random(10, 20)
-------------> BoomPuff: Set PuffScale to random(0.03, 0.1)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set angle to random(0, 360) degrees
-------------> BoomPuff: Set Spin to random(-120, 120)
-------------> BoomPuff: Set color to rgb(210, 105, 30)
-------------> BoomPuff: Set opacity to 100
// // --------------------------------------------------
// 0: ОБЫЧНЫЙ СНАРЯД
// --------------------------------------------------
------------+ System: W = 0
-------------> BotBarrel: Spawn Projectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> Projectile: Set angle to A degrees
-------------> Projectile: Set Пуля angle of motion to A degrees
-------------> Projectile: Set Пуля speed to 7 + (P × 3)
// // --------------------------------------------------
// 1: НАПАЛМ
// --------------------------------------------------
------------+ System: W = 1
-------------> BotBarrel: Spawn FireProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> FireProjectile: Set angle to A degrees
-------------> FireProjectile: Set Bullet angle of motion to A degrees
-------------> FireProjectile: Set Bullet speed to 6 + (P × 2.5)
// // --------------------------------------------------
// 2: САМОНАВЕДЕНИЕ
// --------------------------------------------------
------------+ System: W = 2
-------------> BotBarrel: Spawn HomingProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> HomingProjectile: Set angle to A degrees
-------------> HomingProjectile: Set Bullet angle of motion to A degrees
-------------> HomingProjectile: Set Bullet speed to 6 + (P × 3)
// // --------------------------------------------------
// 3: МИНА
// --------------------------------------------------
------------+ System: W = 3
-------------> BotBarrel: Spawn MineProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> MineProjectile: Set angle to A degrees
-------------> MineProjectile: Set Bullet angle of motion to A degrees
-------------> MineProjectile: Set Bullet speed to 6 + (P × 3.3)
// // --------------------------------------------------
// 4: КЛАСТЕР
// --------------------------------------------------
------------+ System: W = 4
-------------> BotBarrel: Spawn ClusterProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> ClusterProjectile: Set angle to A degrees
-------------> ClusterProjectile: Set Bullet angle of motion to A degrees
-------------> ClusterProjectile: Set Bullet speed to 7 + (P × 2.5)
-------------> System: Set IsClusterActive to True
-------------> System: Set ClusterPeakY to ClusterProjectile.Y
// // --------------------------------------------------
// 5: ПУЛЕМЁТ
// --------------------------------------------------
------------+ System: W = 5
-------------> System: Set MG_SavedAngle to A
-------------> System: Set MG_BulletsLeft to 6
-------------> System: Set IsMachineGunActive to True
// // --------------------------------------------------
6: ПРЫГУЧКА
// --------------------------------------------------
------------+ System: W = 6
-------------> BotBarrel: Spawn BouncerProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> BouncerProjectile: Set angle to A degrees
-------------> BouncerProjectile: Set Bullet angle of motion to A degrees
-------------> BouncerProjectile: Set Bullet speed to 6 + (P × 2.8)
// // --------------------------------------------------
//7: ГРЯЗЕВАЯ
// --------------------------------------------------
------------+ System: W = 7
-------------> BotBarrel: Spawn DirtProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> DirtProjectile: Set angle to A degrees
-------------> DirtProjectile: Set Bullet angle of motion to A degrees
-------------> DirtProjectile: Set Bullet speed to 7 + (P × 3)
// // --------------------------------------------------
// 8: БУР
// --------------------------------------------------
------------+ System: W = 8
-------------> System: Set CurrentProjectileType to 8
-------------> System: Set CamState to 3
-------------> System: Set IsShooting to 1
-------------> System: Set ShotTimer to 0
-------------> System: Create object explosion on layer "Game" at (BotBarrel.X, BotBarrel.Y), create hierarchy: False, template: ""
-------------> explosion: Set animation to "boom" (play from beginning)
-------------> System: Create object SmokeParticles2 on layer "Game" at (BotBarrel.X, BotBarrel.Y), create hierarchy: False, template: ""
-------------> SmokeParticles2: Set spraying
-------------> Functions: Call Blast (x: BotBarrel.X, y: BotBarrel.Y - 30, Radius: 60)
-------------> System: Wait 1.0 seconds (use time scale: True)
----------------+ System: PlayerTank.isDestroyed = 0
----------------+ System: BotTank.isDestroyed = 0
-----------------> Functions: Call SwapPlayer
// // --------------------------------------------------
// 9: ЛАЗЕР// --------------------------------------------------
------------+ System: W = 9
-------------> System: Set CurrentProjectileType to 9
-------------> System: Set CamState to 3
-------------> System: Set IsShooting to 1
-------------> System: Set ShotTimer to 0
-------------> BotBarrel: Spawn LaserBeam on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> LaserBeam: Set angle to A degrees
-------------> LaserBeam: Set width to 2000
-------------> LaserBeam: Set Physics enabled
----------------+ System: For each Players
----------------+ Players: isDestroyed = 0
----------------+ Players: Owner ≠ ActivePlayer
----------------+ Players: Is overlapping LaserBeam
-----------------> Functions: Call TakeDamage (TargetUID: Players.UID, Damage: 40, HeavyHit: 0)
----------------+ (no conditions)
-----------------> LaserBeam: Set Physics disabled
-----------------> Functions: Call BurnLine (startX: BotBarrel.ImagePointX(1), startY: BotBarrel.ImagePointY(1), endX: BotBarrel.ImagePointX(1) + cos(A) × 2000, endY: BotBarrel.ImagePointY(1) + sin(A) × 2000)
-----------------> System: Wait 0.35 seconds (use time scale: True)
-----------------> LaserBeam: Destroy
--------------------+ System: PlayerTank.isDestroyed = 0
--------------------+ System: BotTank.isDestroyed = 0
---------------------> Functions: Call SwapPlayer
// // --------------------------------------------------
// 10: ЗАМОРОЗКА
// --------------------------------------------------
------------+ System: W = 10
-------------> BotBarrel: Spawn FreezeProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> FreezeProjectile: Set angle to A degrees
-------------> FreezeProjectile: Set Bullet angle of motion to A degrees
-------------> FreezeProjectile: Set Bullet speed to 7 + (P × 3)
// // --------------------------------------------------
// 11: РОЛЛЕР
// --------------------------------------------------
------------+ System: W = 11
-------------> BotBarrel: Spawn RollerProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> RollerProjectile: Set IsRolling to False
-------------> RollerProjectile: Set Platform Disabled
-------------> RollerProjectile: Set Bullet Enabled
-------------> RollerProjectile: Set angle to A degrees
-------------> RollerProjectile: Set Bullet angle of motion to A degrees
-------------> RollerProjectile: Set Bullet speed to 7 + (P × 3)
-------------> RollerProjectile: Set Bullet gravity to 100
----------------+ System: cos(A) > 0
-----------------> RollerProjectile: Set RollDir to -1
----------------+ System: Else
-----------------> RollerProjectile: Set RollDir to 1
// // --------------------------------------------------
// 12: ИОННАЯ ПУШКА
// --------------------------------------------------
------------+ System: W = 12
-------------> BotBarrel: Spawn BeaconProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> BeaconProjectile: Set angle to A degrees
-------------> BeaconProjectile: Set Bullet angle of motion to A degrees
-------------> BeaconProjectile: Set Bullet speed to 7 + (P × 2.5)
// // --------------------------------------------------
// 13: УДАР ПО ПЛОЩАДИ
// --------------------------------------------------
------------+ System: W = 13
-------------> BotBarrel: Spawn AreaProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> AreaProjectile: Set angle to A degrees
-------------> AreaProjectile: Set Bullet angle of motion to A degrees
-------------> AreaProjectile: Set Bullet speed to 7+ (P × 3)
-------------> AreaProjectile: Set Bullet gravity to 100
// // --------------------------------------------------
// 14: ДВОЙНОЙ ЗАЛП
// --------------------------------------------------
------------+ System: W = 14
-------------> BotBarrel: Spawn HelixCenter on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> HelixCenter: Set TracerType to -1
-------------> HelixCenter: Set angle to A degrees
-------------> HelixCenter: Set Bullet angle of motion to A degrees
-------------> HelixCenter: Set Bullet speed to 6 + (P × 3)
-------------> HelixCenter: Set Bullet gravity to 100
-------------> BotBarrel: Spawn DoubleProj on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> DoubleProj: Set Phase to 0
-------------> BotBarrel: Spawn DoubleProj on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> DoubleProj: Set Phase to 180
// // --------------------------------------------------
// 15: ТЕЛЕПОРТ
// --------------------------------------------------
------------+ System: W = 15
-------------> BotBarrel: Spawn TeleportProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> TeleportProjectile: Set angle to A degrees
-------------> TeleportProjectile: Set Bullet angle of motion to A degrees
-------------> TeleportProjectile: Set Bullet speed to 5 + (P × 2)
-------------> TeleportProjectile: Set Bullet gravity to 150
// // --------------------------------------------------
// 16: ЯДЕРНАЯ
// --------------------------------------------------
------------+ System: W = 16
-------------> BotBarrel: Spawn NukeProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> NukeProjectile: Set angle to A degrees
-------------> NukeProjectile: Set Bullet angle of motion to A degrees
-------------> NukeProjectile: Set Bullet speed to 5 + (P × 2.7)
-------------> NukeProjectile: Set Bullet gravity to 120
// // --------------------------------------------------
// 17: ФОНТАН
// --------------------------------------------------
------------+ System: W = 17
-------------> BotBarrel: Spawn FountainProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> FountainProjectile: Set angle to A degrees
-------------> FountainProjectile: Set Bullet angle of motion to A degrees
-------------> FountainProjectile: Set Bullet speed to 7 + (P × 2.5)
-------------> System: Set IsFountainActive to True
// // --------------------------------------------------
//18: ЭНЕРГОКУПОЛ
// --------------------------------------------------
------------+ System: W = 18
-------------> BotBarrel: Spawn FountainProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> FountainProjectile: Set angle to A degrees
-------------> FountainProjectile: Set Bullet angle of motion to A degrees
-------------> FountainProjectile: Set Bullet speed to 7 + (P × 2.5)
-------------> System: Set IsFountainActive to True
-------------> System: Set CurrentProjectileType to 18
-------------> System: Set CamState to 3
-------------> System: Set IsShooting to 1
-------------> System: Set ShotTimer to 1
----------------+ System: For each ShieldDome
----------------+ ShieldDome: TargetUID = BotTank.UID
-----------------> ShieldDome: Destroy
----------------+ (no conditions)
-----------------> System: Create object ShieldDome on layer "Game" at (BotTank.X, BotTank.Y), create hierarchy: False, template: ""
-----------------> ShieldDome: Set opacity to 100
-----------------> ShieldDome: Set TargetUID to PlayerTank.UID
-----------------> ShieldDome: Set ShieldLife to 8
-----------------> ShieldDome: Set ShieldRadius to 90
-----------------> ShieldDome: Fade: set wait time to 999
-----------------> ShieldDome: Set ShieldTurns to 2
-----------------> ShieldDome: Pin Pin to BotTank (X: True, Y: True, angle: False, width: No, height: No, Z: False)
-----------------> System: Create object Shockwave on layer "Game" at (BotTank.X, BotTank.Y), create hierarchy: False, template: ""
-----------------> Shockwave: Set width to 40
-----------------> Shockwave: Set height to 40
-----------------> System: Wait 1.0 seconds (use time scale: True)
--------------------+ System: PlayerTank.isDestroyed = 0
--------------------+ System: BotTank.isDestroyed = 0
---------------------> Functions: Call SwapPlayer
// // --------------------------------------------------
// 19: АВИАБОМБАРДИРОВКА (БОТ)
// --------------------------------------------------
------------+ System: W = 19
-------------> System: Set IsAirstrikeActive to True
-------------> System: Create object Airplane on layer "Game" at (LayoutWidth + 200, 100), create hierarchy: False, template: ""
-------------> Airplane: Set angle to 180 degrees
-------------> Airplane: Set Flipped
-------------> Airplane: Set scale to 0.15
-------------> Airplane: Set IsBombed to 0
-------------> System: Set CamState to 5
// // --------------------------------------------------
// 20: ОРБИТАЛЬНЫЙ УДАР НЛО (UFO Strike)
// --------------------------------------------------
------------+ System: W = 20
-------------> BotBarrel: Spawn UFO_Beacon on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> UFO_Beacon: Set angle to A degrees
-------------> UFO_Beacon: Set Bullet angle of motion to A degrees
-------------> UFO_Beacon: Set Bullet speed to 7 + (P × 3)
// // --------------------------------------------------
// 21: Дрон-Машинка RC
// --------------------------------------------------
------------+ System: W = 21
-------------> BotBarrel: Spawn RC_Capsule on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> RC_Capsule: Set angle to A degrees
-------------> RC_Capsule: Set Bullet angle of motion to A degrees
-------------> RC_Capsule: Set Bullet speed to 7+ (P × 3)
-------------> RC_Capsule: Set Bullet gravity to 100
// // --------------------------------------------------
// 22: Дрон-камикадзе DRON
// --------------------------------------------------
------------+ System: W = 22
-------------> BotBarrel: Spawn HiveCapsule on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> HiveCapsule: Set angle to A degrees
-------------> HiveCapsule: Set Bullet angle of motion to A degrees
-------------> HiveCapsule: Set Bullet speed to 7+ (P × 3)
-------------> HiveCapsule: Set Bullet gravity to 100
// // --------------------------------------------------
// 23: БУМЕРАНГ
// --------------------------------------------------
------------+ System: W = 23
-------------> System: Set IsBoomerangActive to True
-------------> BoomerangProjectile: Set BounceCount to 0
-------------> BotBarrel: Spawn BoomerangProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> BoomerangProjectile: Set angle to A degrees
-------------> BoomerangProjectile: Set Bullet angle of motion to A degrees
-------------> BoomerangProjectile: Set Bullet speed to 7 + (Power × 3.5)
-------------> BoomerangProjectile: Set Bullet gravity to 100
-------------> BoomerangProjectile: Set PeakY to BoomerangProjectile.Y
-------------> BoomerangProjectile: Set BoomerangTimer to 0.9
-------------> BoomerangProjectile: Set Returning to 0
-------------> BoomerangProjectile: Set HasHit to 0
-------------> BoomerangProjectile: Set OwnerTag to "Player1"
-------------> BoomerangProjectile: Set scale to 0.1
// // --------------------------------------------------
// 24 ТРОЙНОЙ ЗАРЯД
// --------------------------------------------------
------------+ System: W = 24
-------------> System: Set TB_SavedPower to P
-------------> System: Set TB_SavedAngle to botLocalAngle + 180
-------------> System: Set TB_ShotsLeft to 3
-------------> System: Set IsTripleBurstActive to True
-------------> System: Set IsShooting to 1
-------------> System: Set ShotTimer to 0
-------------> System: Set slideRecoil to 0.1
-------------> BotTank: Set VelX to 0
// // --------------------------------------------------
// 25: Вулкан
// --------------------------------------------------
------------+ System: W = 25
-------------> BotBarrel: Spawn VolcanoProjectile on layer "Game" (image point 1, create hierarchy: False, template: "")
-------------> VolcanoProjectile: Set angle to A degrees
-------------> VolcanoProjectile: Set Bullet angle of motion to A degrees
-------------> VolcanoProjectile: Set Bullet speed to 7+ (P × 3)
-------------> VolcanoProjectile: Set Bullet gravity to 100
-------------> VolcanoProjectile: Set scale to 0.05
-------------> System: Set IsVolcanoActive to True
[[Tracer за снарядом]]
----+ System: On start of layout
-----> NapalmDrip: Destroy
-----> trail: Destroy
----+ System: Every tick
----+ System: For each AmmosFamily
--------+ AmmosFamily: TracerType = 0
--------+ AmmosFamily: HasTrail = 0
---------> AmmosFamily: Set HasTrail to 1
---------> System: Create object trail on layer "Game" at (AmmosFamily.X, AmmosFamily.Y), create hierarchy: False, template: ""
---------> trail: Set HeadUID to AmmosFamily.UID
---------> trail: Attach trail to AmmosFamily | angle from movement: True | image point 0 | destroy with parent: False
---------> trail: Set opacity to 50
---------> [DISABLED] trail: Set trail head width to 14
---------> [DISABLED] trail: Set trail tail width to 0
---------> [DISABLED] trail: Set trail length to 60
---------> trail: Reset trail
--------+ [DISABLED] AmmosFamily: TracerType = 2
---------> [DISABLED] AmmosFamily: Spawn HomingSmoke on layer "Game" (image point 1, create hierarchy: False, template: "")
---------> [DISABLED] HomingSmoke: Set angle to random(0.5, 1.2) degrees
--------+ AmmosFamily: TracerType = 6
------------+ System: Repeat 8 times
-------------> System: Create object BoomPuff on layer "Game" at (DirtProjectile.X + random(-3, 3), DirtProjectile.Y + random(-3, 3)), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 7
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to random(0.25, 0.5)
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to random(-12, 12)
-------------> BoomPuff: Set vy to random(-12, 12)
-------------> BoomPuff: Set PuffScale to random(0.15, 0.3)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set angle to random(0, 360) degrees
-------------> BoomPuff: Set Spin to random(-120, 120)
-------------> BoomPuff: Set color to rgb(139, 90, 43)
-------------> BoomPuff: Set opacity to 80
----[[[Trail: снаряд умер → убить ленту]]]
--------+ AmmosFamily: On destroyed
--------+ trail: HeadUID = AmmosFamily.UID
---------> trail: Destroy
----+ System: For each DoubleProj
----+ DoubleProj: HasTrail = 0
-----> DoubleProj: Set HasTrail to 1
-----> System: Create object trail on layer "Game" at (DoubleProj.X, DoubleProj.Y), create hierarchy: False, template: ""
-----> trail: Set HeadUID to DoubleProj.UID
-----> trail: Attach trail to DoubleProj | angle from movement: True | image point 0 | destroy with parent: False
-----> trail: Set opacity to 50
-----> trail: Reset trail
----[[[Trail: спираль умерла → убить ленту]]]
--------+ DoubleProj: On destroyed
--------+ trail: HeadUID = DoubleProj.UID
---------> trail: Destroy
----[[Пушистый трейсер: круглые облачка (TrailPuff)]]
--------+ System: On start of layout
---------> TrailPuff: Destroy
--------+ TrailPuff: On created
---------> TrailPuff: Set scale to random(0.09, 0.2)
---------> TrailPuff: Set opacity to 35
---------> TrailPuff: Set angle to random(0, 360) degrees
---------> TrailPuff: Move to bottom of layer
---------> TrailPuff: Fade: set fade-in time to 0
---------> TrailPuff: Fade: set wait time to 0
---------> TrailPuff: Fade: set fade-out time to random(0.3, 0.5)
---------> TrailPuff: Fade: restart fade
--------+ System: Every tick
--------+ System: For each TrailPuff
---------> TrailPuff: Set size to (Self.Width × (1 - 3.5 × dt), Self.Height × (1 - 3.5 × dt))
--------+ System: Every 0.3 seconds
--------+ System: For each AmmosFamily
--------+ System: AmmosFamily.ObjectTypeName ≠ "MachineGunBullet"
---------> System: Create object TrailPuff on layer "Game" at (AmmosFamily.X + random(-2, 2), AmmosFamily.Y + random(-2, 2)), create hierarchy: False, template: ""
--------+ System: Every 0.1 seconds
--------+ System: For each DoubleProj
---------> System: Create object TrailPuff on layer "Game" at (DoubleProj.X + random(-2, 2), DoubleProj.Y + random(-2, 2)), create hierarchy: False, template: ""
----[[Пушистый ОГНЕННЫЙ трейсер (TrailPuffFire)]
--------+ System: On start of layout
---------> TrailPuffFire: Destroy
---------> BoomPuff: Destroy
--------+ TrailPuffFire: On created
--------+ TrailPuffFire: PuffType = 0
---------> TrailPuffFire: Set scale to random(0.08, 0.2)
---------> TrailPuffFire: Set angle to random(0, 360) degrees
---------> TrailPuffFire: Set opacity to 100
---------> TrailPuffFire: Set color to rgb(255, 235, 170)
---------> TrailPuffFire: Fade: set fade-in time to 0
---------> TrailPuffFire: Fade: set wait time to 0
---------> TrailPuffFire: Fade: set fade-out time to random(0.35, 0.6)
---------> TrailPuffFire: Fade: restart fade
--------+ System: Every tick
--------+ System: For each TrailPuffFire
--------+ TrailPuffFire: PuffType = 0
---------> TrailPuffFire: Set color to rgb( lerp(255, 70, 1 - Self.Opacity ÷ 100), lerp(235, 30, √(1 - Self.Opacity ÷ 100)), lerp(170, 20, 1 - Self.Opacity ÷ 100) )
--------+ System: Every 0.025 seconds
--------+ System: For each AmmosFamily
--------+ AmmosFamily: TracerType = 1
---------> System: Create object TrailPuffFire on layer "Game" at (AmmosFamily.X + random(-3, 3), AmmosFamily.Y + random(-3, 3)), create hierarchy: False, template: ""
---------> TrailPuffFire: Set scale to random(0.08, 0.2)
---------> TrailPuffFire: Fade: set fade-out time to random(0.35, 0.6)
--------+ System: Every 0.045 seconds
--------+ System: For each FountainBomb
---------> System: Create object TrailPuffFire on layer "Game" at (FountainBomb.X + random(-3, 3), FountainBomb.Y + random(-3, 3)), create hierarchy: False, template: ""
--------+ System: Every 0.05 seconds
--------+ System: For each NapalmDrop
---------> System: Create object TrailPuffFire on layer "Game" at (NapalmDrop.X + random(-2, 2), NapalmDrop.Y + random(-2, 2)), create hierarchy: False, template: ""
----[Полёт искры + оставление кружков за ней]
--------+ System: Every tick
--------+ System: For each BoomPuff
--------+ BoomPuff: Type = 1
---------> BoomPuff: Set Age to Self.Age + (dt ÷ timescale)
---------> BoomPuff: Set vy to Self.vy + 550 × (dt ÷ timescale)
---------> BoomPuff: Set X to Self.X + Self.vx × (dt ÷ timescale)
---------> BoomPuff: Set Y to Self.Y + Self.vy × (dt ÷ timescale)
---------> BoomPuff: Add dt ÷ timescale to SpawnTimer
---------> BoomPuff: Set opacity to 100 × clamp((Self.Life - Self.Age) ÷ 0.1, 0, 1)
------------+ BoomPuff: SpawnTimer ≥ 0.01
-------------> BoomPuff: Set SpawnTimer to 0
-------------> System: Create object BoomPuff on layer "Game" at (BoomPuff.X + random(-2, 2), BoomPuff.Y + random(-2, 2)), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 2
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to random(0.7, 1.2)
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set PuffScale to random(0.3, 0.6)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set color to rgb(255, 250, 215)
-------------> BoomPuff: Set opacity to 100 × clamp((Self.Life - Self.Age) ÷ 0.12, 0, 1)
------------+ BoomPuff: Age ≥ Self.Life
-------------> BoomPuff: Destroy
----[Старение кружков: белый → оранжевый → красный → чёрный]
--------+ System: Every tick
--------+ System: For each BoomPuff
--------+ BoomPuff: Type = 2
---------> BoomPuff: Set Age to Self.Age + (dt ÷ timescale)
---------> BoomPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
---------> BoomPuff: Set PuffScale to max(0.25, Self.PuffScale - 0.3 × (dt ÷ timescale))
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set opacity to 100 × clamp((1 - Self.T) ÷ 0.5, 0, 1)
------------+ BoomPuff: T < 0.12
-------------> BoomPuff: Set color to rgb(255, lerp(250, 245, Self.T ÷ 0.12), lerp(215, 30, Self.T ÷ 0.12))
------------+ BoomPuff: T ≥ 0.12
------------+ BoomPuff: T < 0.30
-------------> BoomPuff: Set color to rgb(255, lerp(245, 150, (Self.T - 0.12) ÷ 0.18), lerp(30, 10, (Self.T - 0.12) ÷ 0.18))
------------+ BoomPuff: T ≥ 0.30
------------+ BoomPuff: T < 0.5
-------------> BoomPuff: Set color to rgb(lerp(255, 200, (Self.T - 0.3) ÷ 0.2), lerp(150, 30, (Self.T - 0.3) ÷ 0.2), 10)
------------+ BoomPuff: T ≥ 0.5
-------------> BoomPuff: Set color to rgb(lerp(200, 70, clamp((Self.T - 0.5) ÷ 0.2, 0, 1)), lerp(30, 55, clamp((Self.T - 0.5) ÷ 0.2, 0, 1)), lerp(10, 45, clamp((Self.T - 0.5) ÷ 0.2, 0, 1)))
------------+ BoomPuff: Age ≥ Self.Life
-------------> BoomPuff: Destroy
------------+ BoomPuff: Spin = 0
-------------> BoomPuff: Set angle to random(0, 360) degrees
-------------> BoomPuff: Set Spin to random(-150, 150)
[[ВЗРЫВ ТАНКА: многоступенчатый финал (чистый VFX в точке X,Y)]]
----[[Вспышка смерти: гаснет по РЕАЛЬНОМУ времени ]
--------+ System: Every tick
--------+ System: MatchResult ≠ ""
--------+ System: For each FlashScreen
---------> FlashScreen: Set opacity to FlashScreen.Opacity - (300 × dt ÷ timescale)
------------+ FlashScreen: Opacity ≤ 0
-------------> FlashScreen: Destroy
| Local number pAng = 0
| Local number pSpd = 0
| Local number pLife = 0
----* On function 'TankDeathFX'
----* Parameter 'X' (Number)
----* Parameter 'Y' (Number)
--------+ (no conditions)
---------> System: Create object FlashScreen on layer "UI" at (ViewportMidX("UI"), ViewportMidY("UI")), create hierarchy: False, template: ""
---------> FlashScreen: Set size to (ViewportWidth("UI") + 200, ViewportHeight("UI") + 200)
---------> FlashScreen: Set opacity to 85
---------> FlashScreen: Fade: set fade-in time to 0
---------> FlashScreen: Fade: set wait time to 0
---------> FlashScreen: Fade: set fade-out time to 0.6
---------> FlashScreen: Fade: restart fade
---------> System: Set ShakePower to 55
---------> System: Create object Shockwave on layer "Game" at (X, Y), create hierarchy: False, template: ""
---------> Shockwave: Set width to 50
---------> Shockwave: Set height to 50
---------> System: Create object SmokeParticles2 on layer "Game" at (X, Y), create hierarchy: False, template: ""
---------> SmokeParticles2: Set spraying
---------> SmokeParticles2: Set rate to 100
---------> SmokeParticles2: Set initial particle size to 150
---------> Functions: Call Blast (x: X, y: Y, Radius: 75)
------------+ System: For "DeathSpark" from 0 to 7
-------------> System: Set pAng to random(-190, 10)
-------------> System: Set pSpd to random(400, 750)
-------------> System: Set pLife to random(0.35, 0.65)
-------------> System: Create object BoomPuff on layer "Game" at (X + random(-6, 6), Y + random(-8, 4)), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 1
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to pLife
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set SpawnTimer to 0
-------------> BoomPuff: Set vx to cos(pAng) × pSpd
-------------> BoomPuff: Set vy to sin(pAng) × pSpd
-------------> BoomPuff: Set PuffScale to random(0.7, 1.1)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set angle to random(0, 360) degrees
-------------> BoomPuff: Set color to rgb(255, 250, 215)
-------------> BoomPuff: Set opacity to 100
-------------> BoomPuff: Move to top of layer
------------+ System: Repeat 18 times
-------------> System: Create object Debris on layer "Game" at (X, Y), create hierarchy: False, template: ""
-------------> Debris: Set Bullet speed to random(120, 420)
-------------> Debris: Set Bullet angle of motion to random(0, 360) degrees
-------------> Debris: Set scale to random(0.3, 1.0)
------------+ (no conditions)
-------------> System: Wait 0.15 seconds (use time scale: False)
-------------> System: Create object explosion on layer "Game" at (X + random(-30, 30), Y - random(0, 30)), create hierarchy: False, template: ""
-------------> explosion: Set opacity to 50
-------------> explosion: Set scale to random(0.1, 0.3)
-------------> explosion: Set animation to "boom" (play from beginning)
-------------> explosion: Set opacity to 50
-------------> System: Set ShakePower to 40
-------------> System: Wait 0.2 seconds (use time scale: False)
-------------> System: Create object explosion on layer "Game" at (X + random(-25, 25), Y - random(0, 25)), create hierarchy: False, template: ""
-------------> explosion: Set opacity to 50
-------------> explosion: Set scale to random(0.1, 0.4)
-------------> explosion: Set animation to "boom" (play from beginning)
-------------> System: Create object Shockwave on layer "Game" at (X, Y), create hierarchy: False, template: ""
-------------> Shockwave: Set width to 50
-------------> Shockwave: Set height to 50
[[ТЕСТ взрыва — ВРЕМЕННО, потом удалить]]
----+ Keyboard: On E pressed
-----> Functions: Call TankDeathFX (X: PlayerTank.X, Y: PlayerTank.Y)
----+ Mouse: On Right button Clicked
-----> Functions: Call Blast (x: Mouse.X, y: Mouse.Y, Radius: 30)
-----> Functions: Call VideoBoomFX (X: Mouse.X, Y: Mouse.Y)
----+ Keyboard: On W pressed
----+ BotTank: isDestroyed = 0
-----> Functions: Call TakeDamage (TargetUID: BotTank.UID, Damage: 9999, HeavyHit: 1)
[[Финал смерти танка]]
----* On function 'FinishDeathFX'
--------+ (no conditions)
---------> System: Create object explosion on layer "Game" at (DeathPointX, DeathPointY), create hierarchy: False, template: ""
---------> explosion: Set scale to 0.5
---------> Functions: Call TankDeathFX (X: DeathPointX, Y: DeathPointY)
---------> System: Set time scale to 0.5
--------+ Players: Pick instance with UID DeathUID
---------> Players: Set visibility Invisible
---------> System: Create object Tombstone on layer "Game" at (DeathPointX, DeathPointY), create hierarchy: False, template: ""
---------> Tombstone: Set Platform vector Y to 800
[[Взрыв как в видео]]
| Local number pAng = 0
| Local number pSpd = 0
----* On function 'VideoBoomFX'
----* Parameter 'X' (Number)
----* Parameter 'Y' (Number)
--------+ (no conditions)
---------> System: Set ShakePower to 20
---------> System: Create object Shockwave on layer "Ground" at (X, Y), create hierarchy: False, template: ""
---------> Shockwave: Set width to 90
---------> Shockwave: Set height to 90
---------> Shockwave: Set opacity to 100
---------> Shockwave: Move to bottom of layer
---------> System: Create object BoomPuff on layer "Game" at (X, Y), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 10
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to 1.4
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to 0
---------> BoomPuff: Set vy to 0
---------> BoomPuff: Set PuffScale to 1.6
---------> BoomPuff: Set scale to 1.6
---------> BoomPuff: Set color to rgb(255, 255, 240)
---------> BoomPuff: Set opacity to 100
------------+ System: Repeat 8 times
-------------> System: Set pAng to random(0, 360)
-------------> System: Create object BoomPuff on layer "Game" at (X + cos(pAng) × random(0, 12), Y + sin(pAng) × random(0, 12)), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 10
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to random(1.0, 1.5)
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to 0
-------------> BoomPuff: Set vy to 0
-------------> BoomPuff: Set PuffScale to random(0.8, 1.3)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set color to rgb(255, 255, 240)
-------------> BoomPuff: Set opacity to 100
-------------> System: Wait 0.25 seconds (use time scale: True)
------------+ System: Repeat 16 times
-------------> System: Set pAng to random(0, 360)
-------------> System: Set pSpd to random(5, 35)
-------------> System: Create object BoomPuff on layer "Game" at (X + cos(pAng) × random(10, 30), Y + sin(pAng) × random(10, 30)), create hierarchy: False, template: ""
-------------> BoomPuff: Set angle to random(0, 360) degrees
-------------> BoomPuff: Set Spin to random(-150, 150)
-------------> BoomPuff: Set Type to 5
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to random(0.5, 1.0)
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to cos(pAng) × pSpd
-------------> BoomPuff: Set vy to sin(pAng) × pSpd - random(10, 40)
-------------> BoomPuff: Set PuffScale to random(0.5, 1.0)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set opacity to 100
------------+ System: Repeat 24 times
-------------> System: Set pAng to random(0, 360)
-------------> System: Set pSpd to random(120, 420)
-------------> System: Create object BoomPuff on layer "Game" at (X, Y), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 6
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to random(0.2, 0.7)
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to cos(pAng) × pSpd
-------------> BoomPuff: Set vy to sin(pAng) × pSpd
-------------> BoomPuff: Set PuffScale to random(0.06, 0.14)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set opacity to 100
----------------+ System: LoopIndex % 3 = 0
-----------------> BoomPuff: Set color to rgb(245, 250, 225)
----------------+ System: Else
-----------------> BoomPuff: Set color to rgb(250, 220, 90)
------------+ System: For "DeadthSpark" from 0 to 5
-------------> System: Set pAng to random(-190, 10)
-------------> System: Set pSpd to random(180, 380)
-------------> BoomPuff: Set angle to random(0, 360) degrees
-------------> BoomPuff: Set Spin to random(-150, 150)
-------------> System: Create object BoomPuff on layer "Game" at (X + random(-4, 4), Y + random(-6, 2)), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 1
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to random(0.25, 0.45)
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set SpawnTimer to 0
-------------> BoomPuff: Set vx to cos(pAng) × pSpd
-------------> BoomPuff: Set vy to sin(pAng) × pSpd
-------------> BoomPuff: Set PuffScale to random(0.4, 0.7)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set angle to random(0, 360) degrees
-------------> BoomPuff: Set color to rgb(255, 250, 215)
-------------> BoomPuff: Set opacity to 100
------------+ System: Repeat 12 times
-------------> System: Create object Debris on layer "Game" at (X, Y), create hierarchy: False, template: ""
-------------> Debris: Set Bullet speed to random(60, 200)
-------------> Debris: Set Bullet angle of motion to random(-160, -20) degrees
-------------> Debris: Set scale to random(0.3, 1.0)
----* On function 'VideoBoomFXGround'
----* Parameter 'X' (Number)
----* Parameter 'Y' (Number)
----* Parameter 'ColorType' (Number)
--------+ (no conditions)
---------> System: Create object BoomPuff on layer "Game" at (X, Y), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 10
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to 1.4
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to 0
---------> BoomPuff: Set vy to 0
---------> BoomPuff: Set PuffScale to 1.6
---------> BoomPuff: Set scale to 1.6
---------> BoomPuff: Set color to rgb(255, 255, 240)
---------> BoomPuff: Set opacity to 100
------------+ System: Repeat 8 times
-------------> System: Set pAng to random(0, 360)
-------------> System: Create object BoomPuff on layer "Game" at (X + cos(pAng) × random(0, 12), Y + sin(pAng) × random(0, 12)), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 10
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to random(1.0, 1.5)
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to 0
-------------> BoomPuff: Set vy to 0
-------------> BoomPuff: Set PuffScale to random(0.8, 1.3)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set color to rgb(255, 255, 240)
-------------> BoomPuff: Set opacity to 100
-------------> System: Wait 0.25 seconds (use time scale: True)
-------------> System: Set ShakePower to 10
------------+ System: Repeat 16 times
-------------> System: Set pAng to random(0, 360)
-------------> System: Set pSpd to random(5, 35)
-------------> System: Create object BoomPuff on layer "Game" at (X + cos(pAng) × random(10, 30), Y + sin(pAng) × random(10, 30)), create hierarchy: False, template: ""
-------------> BoomPuff: Set angle to random(0, 360) degrees
-------------> BoomPuff: Set Spin to random(-150, 150)
----------------+ System: ColorType = 0
-----------------> BoomPuff: Set Type to 5
--------------------+ (no conditions)
---------------------> BoomPuff: Set Age to 0
---------------------> BoomPuff: Set Life to random(0.5, 1.0)
---------------------> BoomPuff: Set T to 0
---------------------> BoomPuff: Set vx to cos(pAng) × pSpd
---------------------> BoomPuff: Set vy to sin(pAng) × pSpd - random(10, 40)
---------------------> BoomPuff: Set PuffScale to random(0.5, 1.0)
---------------------> BoomPuff: Set scale to Self.PuffScale
---------------------> BoomPuff: Set opacity to 100
----------------+ System: ColorType = 1
-----------------> BoomPuff: Set Type to 11
--------------------+ (no conditions)
---------------------> BoomPuff: Set Age to 0
---------------------> BoomPuff: Set Life to random(0.5, 1.0)
---------------------> BoomPuff: Set T to 0
---------------------> BoomPuff: Set vx to cos(pAng) × pSpd
---------------------> BoomPuff: Set vy to sin(pAng) × pSpd - random(10, 40)
---------------------> BoomPuff: Set PuffScale to random(0.5, 1.0)
---------------------> BoomPuff: Set scale to Self.PuffScale
---------------------> BoomPuff: Set opacity to 100
------------+ System: Repeat 24 times
-------------> System: Set pAng to random(0, 360)
-------------> System: Set pSpd to random(120, 420)
-------------> System: Create object BoomPuff on layer "Game" at (X, Y), create hierarchy: False, template: ""
-------------> BoomPuff: Set Type to 6
-------------> BoomPuff: Set Age to 0
-------------> BoomPuff: Set Life to random(0.2, 0.7)
-------------> BoomPuff: Set T to 0
-------------> BoomPuff: Set vx to cos(pAng) × pSpd
-------------> BoomPuff: Set vy to sin(pAng) × pSpd
-------------> BoomPuff: Set PuffScale to random(0.06, 0.14)
-------------> BoomPuff: Set scale to Self.PuffScale
-------------> BoomPuff: Set opacity to 100
----------------+ System: ColorType = 0
--------------------+ System: LoopIndex % 3 = 0
---------------------> BoomPuff: Set color to rgb(245, 250, 225)
--------------------+ System: Else
---------------------> BoomPuff: Set color to rgb(250, 220, 90)
----------------+ System: ColorType = 1
--------------------+ System: LoopIndex % 3 = 0
---------------------> BoomPuff: Set color to rgb(200, 255, 255)
--------------------+ System: Else
---------------------> BoomPuff: Set color to rgb(50, 150, 255)
------------+ System: Repeat 12 times
-------------> System: Create object Debris on layer "Game" at (X, Y), create hierarchy: False, template: ""
-------------> Debris: Set Bullet speed to random(60, 200)
-------------> Debris: Set Bullet angle of motion to random(-160, -20) degrees
-------------> Debris: Set scale to random(0.3, 1.0)
----[[Облако Type 5: жёлтый → красный → бордовый, рост и подъём]]
--------+ System: Every tick
--------+ System: For each BoomPuff
--------+ BoomPuff: Type = 5
---------> BoomPuff: Set Age to Self.Age + (dt ÷ timescale)
---------> BoomPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
---------> BoomPuff: Set X to Self.X + Self.vx × (dt ÷ timescale)
---------> BoomPuff: Set Y to Self.Y + Self.vy × (dt ÷ timescale)
---------> BoomPuff: Set vy to lerp(Self.vy, -45, 2 × (dt ÷ timescale))
---------> BoomPuff: Set PuffScale to Self.PuffScale + (0.25 × (dt ÷ timescale))
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set opacity to 100 × clamp((1 - Self.T) ÷ 0.85, 0, 1)
------------+ BoomPuff: T < 0.15
-------------> BoomPuff: Set color to rgb(255, lerp(250, 220, Self.T ÷ 0.15), lerp(170, 80, Self.T ÷ 0.15))
------------+ BoomPuff: T ≥ 0.15
------------+ BoomPuff: T < 0.4
-------------> BoomPuff: Set color to rgb(lerp(255, 240, (Self.T - 0.15) ÷ 0.25), lerp(220, 130, (Self.T - 0.15) ÷ 0.25), lerp(80, 50, (Self.T - 0.15) ÷ 0.25))
------------+ BoomPuff: T ≥ 0.4
------------+ BoomPuff: T < 0.65
-------------> BoomPuff: Set color to rgb(lerp(240, 190, (Self.T - 0.4) ÷ 0.25), lerp(130, 60, (Self.T - 0.4) ÷ 0.25), 50)
------------+ BoomPuff: T ≥ 0.65
-------------> BoomPuff: Set color to rgb(lerp(190, 30, (Self.T - 0.65) ÷ 0.35), lerp(60, 26, (Self.T - 0.65) ÷ 0.35), lerp(50, 24, (Self.T - 0.65) ÷ 0.35))
------------+ BoomPuff: Age ≥ Self.Life
-------------> BoomPuff: Destroy
----[[Точки Type 6: разлёт с гравитацией]]
--------+ System: Every tick
--------+ System: For each BoomPuff
--------+ BoomPuff: Type = 6
---------> BoomPuff: Set Age to Self.Age + (dt ÷ timescale)
---------> BoomPuff: Set vy to Self.vy + 600 × (dt ÷ timescale)
---------> BoomPuff: Set X to Self.X + Self.vx × (dt ÷ timescale)
---------> BoomPuff: Set Y to Self.Y + Self.vy × (dt ÷ timescale)
---------> BoomPuff: Set opacity to 100 × clamp((Self.Life - Self.Age) ÷ 0.2, 0, 1)
------------+ BoomPuff: Age ≥ Self.Life
-------------> BoomPuff: Destroy
----[[Точки Type 8: [Визуальный урон танков]]
--------+ System: Every tick
--------+ System: For each BoomPuff
--------+ BoomPuff: Type = 8
---------> BoomPuff: Set Age to Self.Age + (dt ÷ timescale)
---------> BoomPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
---------> BoomPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
---------> BoomPuff: Set X to Self.X + Self.vx × (dt ÷ timescale)
---------> BoomPuff: Set Y to Self.Y + Self.vy × (dt ÷ timescale)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set opacity to 100 × (1 - Self.T)
------------+ BoomPuff: Age ≥ Self.Life
-------------> BoomPuff: Destroy
----[[Лучи (Type 9): растянутые спицы, быстрый фейд]]
--------+ System: Every tick
--------+ System: For each BoomPuff
--------+ BoomPuff: Type = 9
---------> BoomPuff: Set Age to Self.Age + (dt ÷ timescale)
---------> BoomPuff: Set X to Self.X + cos(Self.Angle) × 250 × (dt ÷ timescale)
---------> BoomPuff: Set Y to Self.Y + sin(Self.Angle) × 250 × (dt ÷ timescale)
---------> BoomPuff: Set width to Self.Width + (150 × (dt ÷ timescale))
---------> BoomPuff: Set opacity to 50 × clamp((Self.Life - Self.Age) ÷ 0.12, 0, 1)
------------+ BoomPuff: Age ≥ Self.Life
-------------> BoomPuff: Destroy
----[[Белое ядро (Type 10): держит белый, потом темнеет к чёрному]]
--------+ System: Every tick
--------+ System: For each BoomPuff
--------+ BoomPuff: Type = 10
---------> BoomPuff: Set Age to Self.Age + (dt ÷ timescale)
---------> BoomPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
---------> BoomPuff: Set PuffScale to Self.PuffScale + (0.2 × (dt ÷ timescale))
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set opacity to 50 × clamp((1 - Self.T) ÷ 0.6, 0, 1)
---------> BoomPuff: Set color to rgb(lerp(255, 15, clamp((Self.T - 0.45) ÷ 0.4, 0, 1)), lerp(255, 12, clamp((Self.T - 0.45) ÷ 0.4, 0, 1)), lerp(240, 10, clamp((Self.T - 0.45) ÷ 0.4, 0, 1)))
------------+ BoomPuff: Age ≥ Self.Life
-------------> BoomPuff: Destroy
----[[Облако Type 11: Ледяной дым (Белый → Голубой → Тёмно-синий)]]
--------+ System: Every tick
--------+ System: For each BoomPuff
--------+ BoomPuff: Type = 11
---------> BoomPuff: Set Age to Self.Age + (dt ÷ timescale)
---------> BoomPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
---------> BoomPuff: Set X to Self.X + Self.vx × (dt ÷ timescale)
---------> BoomPuff: Set Y to Self.Y + Self.vy × (dt ÷ timescale)
---------> BoomPuff: Set vy to lerp(Self.vy, -45, 2 × (dt ÷ timescale))
---------> BoomPuff: Set PuffScale to Self.PuffScale + (0.25 × (dt ÷ timescale))
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set opacity to 100 × clamp((1 - Self.T) ÷ 0.85, 0, 1)
------------+ BoomPuff: T < 0.15
-------------> BoomPuff: Set color to rgb(lerp(255, 180, Self.T ÷ 0.15), lerp(255, 240, Self.T ÷ 0.15), 255)
------------+ BoomPuff: T ≥ 0.15
------------+ BoomPuff: T < 0.4
-------------> BoomPuff: Set color to rgb(lerp(180, 80, (Self.T - 0.15) ÷ 0.25), lerp(240, 180, (Self.T - 0.15) ÷ 0.25), 255)
------------+ BoomPuff: T ≥ 0.4
------------+ BoomPuff: T < 0.65
-------------> BoomPuff: Set color to rgb(lerp(80, 40, (Self.T - 0.4) ÷ 0.25), lerp(180, 80, (Self.T - 0.4) ÷ 0.25), lerp(255, 140, (Self.T - 0.4) ÷ 0.25))
------------+ BoomPuff: T ≥ 0.65
-------------> BoomPuff: Set color to rgb(lerp(40, 15, (Self.T - 0.65) ÷ 0.35), lerp(80, 25, (Self.T - 0.65) ÷ 0.35), lerp(140, 45, (Self.T - 0.65) ÷ 0.35))
------------+ BoomPuff: Age ≥ Self.Life
-------------> BoomPuff: Destroy
----+ System: Every tick
----+ System: For each BoomPuff
----+ BoomPuff: Spin ≠ 0
-----> BoomPuff: Set angle to Self.Angle + (Self.Spin × (dt ÷ timescale)) degrees
[[Пыль из-под гусениц]]
| Local number dustY = 0
| Local number dustDir = 0
| Local number localX = 0
| Local number dustSpeed = 0
| Local number dustAng = 0
| Local number dustX = 0
----+ System: Every tick
----+ PlayerTank: isDestroyed = 0
----+ System: abs(PlayerTank.VelX) > 20
----+ System: sign(PlayerTank.VelX) ≠ DustLastDirP
-----> System: Set DustLastDirP to sign(PlayerTank.VelX)
-----> System: Set DustBurstP to 0.5
----+ System: Every tick
----+ PlayerTank: isDestroyed = 0
----+ System: DustBurstP > 0
----+ System: abs(PlayerTank.VelX) > 20
-----> System: Subtract dt from DustBurstP
-----> System: Set dustDir to sign(PlayerTank.VelX)
--------+ PlayerTank: Is mirrored
---------> System: Set localX to dustDir × (PlayerTank.Width ÷ 2 + 4)
--------+ PlayerTank: [X] Is mirrored
---------> System: Set localX to -dustDir × (PlayerTank.Width ÷ 2 + 4)
--------+ System: Repeat 2 times
---------> System: Set dustX to PlayerTank.X + cos(PlayerTank.Angle) × localX - sin(PlayerTank.Angle) ×10 + random(-8, 8)
---------> System: Set dustY to PlayerTank.Y + sin(PlayerTank.Angle) × localX + cos(PlayerTank.Angle) × -6 + random(-4, 2)
---------> System: Set dustAng to PlayerTank.groundAngle + (dustDir > 0 ? 180 : 0) + random(-40, 40)
---------> System: Set dustSpeed to random(25, 70)
---------> System: Create object BoomPuff on layer "Game" at (dustX, dustY), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 7
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to random(0.3, 0.6)
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to cos(dustAng) × dustSpeed
---------> BoomPuff: Set vy to sin(dustAng) × dustSpeed - random(10, 25)
---------> BoomPuff: Set PuffScale to random(0.2, 0.4)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set angle to random(0, 360) degrees
---------> BoomPuff: Set Spin to random(-160, 160)
---------> BoomPuff: Set color to ColDust
---------> BoomPuff: Set opacity to 90
---------> BoomPuff: Move to bottom of layer
----+ System: Every tick
----+ BotTank: isDestroyed = 0
----+ System: abs(BotTank.VelX) > 20
----+ System: sign(BotTank.VelX) ≠ DustLastDirB
-----> System: Set DustLastDirB to sign(BotTank.VelX)
-----> System: Set DustBurstB to 0.5
----+ System: Every tick
----+ BotTank: isDestroyed = 0
----+ System: DustBurstB > 0
----+ System: abs(BotTank.VelX) > 20
-----> System: Subtract dt from DustBurstB
-----> System: Set dustDir to sign(BotTank.VelX)
--------+ BotTank: Is mirrored
---------> System: Set localX to dustDir × (BotTank.Width ÷ 2 + 4)
--------+ BotTank: [X] Is mirrored
---------> System: Set localX to -dustDir × (BotTank.Width ÷ 2 + 4)
--------+ System: Repeat 2 times
---------> System: Set dustX to BotTank.X + cos(BotTank.Angle) × localX - sin(BotTank.Angle) ×10 + random(-8, 8)
---------> System: Set dustY to BotTank.Y + sin(BotTank.Angle) × localX + cos(BotTank.Angle) × -6 + random(-4, 2)
---------> System: Set dustAng to BotTank.groundAngle + (dustDir > 0 ? 180 : 0) + random(-40, 40)
---------> System: Set dustSpeed to random(20, 60)
---------> System: Create object BoomPuff on layer "Game" at (dustX, dustY), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 7
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to random(0.3, 0.6)
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to cos(dustAng) × dustSpeed
---------> BoomPuff: Set vy to sin(dustAng) × dustSpeed - random(10, 25)
---------> BoomPuff: Set PuffScale to random(0.2, 0.4)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set angle to random(0, 360) degrees
---------> BoomPuff: Set Spin to random(-160, 160)
---------> BoomPuff: Set color to ColDust
---------> BoomPuff: Set opacity to 90
---------> BoomPuff: Move to bottom of layer
----+ System: Every tick
----+ System: abs(PlayerTank.VelX) < 10
-----> System: Set DustLastDirP to 0
-----> System: Set DustBurstP to 0
----+ System: Every tick
----+ System: abs(BotTank.VelX) < 10
-----> System: Set DustLastDirB to 0
-----> System: Set DustBurstB to 0
----+ System: Every tick
----+ System: For each BoomPuff
----+ BoomPuff: Type = 7
-----> BoomPuff: Set Age to Self.Age + dt
-----> BoomPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
-----> BoomPuff: Set X to Self.X + Self.vx × dt
-----> BoomPuff: Set Y to Self.Y + Self.vy × dt
-----> [DISABLED] BoomPuff: Set vy to Self.vy + 40 × dt
-----> BoomPuff: Set vy to Self.vy + Self.Grav × dt
-----> BoomPuff: Set vx to Self.vx × max(0, 1 - 2.5 × dt)
-----> BoomPuff: Set angle to Self.Angle + Self.Spin × dt degrees
-----> BoomPuff: Set PuffScale to Self.PuffScale + 0.4 × dt
-----> BoomPuff: Set scale to Self.PuffScale
-----> BoomPuff: Set opacity to 85 × (1 - Self.T)
--------+ BoomPuff: Age ≥ Self.Life
---------> BoomPuff: Destroy
// // Выхлопной дым
----+ System: Every tick
----+ System: For each Players
----+ Players: isDestroyed = 0
----+ System: random(100) < 30
-----> System: Create object BoomPuff on layer "Game" at (Players.ImagePointX(6), Players.ImagePointY(6)), create hierarchy: False, template: ""
-----> BoomPuff: Set Type to 7
-----> BoomPuff: Set Age to 0
-----> BoomPuff: Set Life to random(0.4, 0.7)
-----> BoomPuff: Set T to 0
-----> BoomPuff: Set PuffScale to random(0.1, 0.2)
-----> BoomPuff: Set scale to Self.PuffScale
-----> BoomPuff: Set angle to random(0, 360) degrees
-----> BoomPuff: Set Spin to random(-80, 80)
-----> BoomPuff: Set color to rgb(70, 70, 75)
-----> BoomPuff: Set opacity to 90
--------+ Players: Owner = "Player1"
------------+ Players: Is mirrored
-------------> BoomPuff: Set vx to cos(Players.Angle) × random(15, 35) + random(-8, 8)
-------------> BoomPuff: Set vy to -sin(Players.Angle) × random(15, 35) - random(15, 30)
------------+ Players: [X] Is mirrored
-------------> BoomPuff: Set vx to -cos(Players.Angle) × random(15, 35) + random(-8, 8)
-------------> BoomPuff: Set vy to -sin(Players.Angle) × random(15, 35) - random(15, 30)
--------+ Players: Owner = "Player2"
------------+ Players: [X] Is mirrored
-------------> BoomPuff: Set vx to cos(Players.Angle) × random(15, 35) + random(-8, 8)
-------------> BoomPuff: Set vy to -sin(Players.Angle) × random(15, 35) - random(15, 30)
------------+ Players: Is mirrored
-------------> BoomPuff: Set vx to -cos(Players.Angle) × random(15, 35) + random(-8, 8)
-------------> BoomPuff: Set vy to -sin(Players.Angle) × random(15, 35) - random(15, 30)
[джойстик]
| Local number MoveDir = 0
----[[Правый джойстик: инициализация]]
--------+ System: On start of layout
---------> JoyAim: Set StartX to Self.X
---------> JoyAim: Set StartY to Self.Y
---------> JoyAim: Set MaxX to 90
---------> JoyAim: Set position to (Self.StartX, Self.StartY)
// ═══ ЖЁСТКИЙ КЛАМП КАЖДЫЙ ТИК — джойстик НЕ может уехать ═══
--------+ System: Every tick
---------> Joy: Set X to clamp(Joy.X, Joy.StartX - Joy.MaxX, Joy.StartX + Joy.MaxX)
----+ System: Every tick
----+ System: ActivePlayer = "Player1"
----+ System: IsShooting = 0
----+ PlayerTank: isDestroyed = 0
----+ PlayerTank: isGrounded = 1
----+ PlayerTank: Fuel > 0
-----> System: Set MoveDir to (Joy.X - Joy.StartX) ÷ Joy.MaxX
--------+ Keyboard: ← is down
--------+ OR Keyboard: A is down
---------> System: Set MoveDir to -1
--------+ Keyboard: → is down
--------+ OR Keyboard: D is down
---------> System: Set MoveDir to 1
--------+ System: MoveDir > 0.2
---------> PlayerTank: Add MoveDir × PlayerTank.Accel × dt to VelX
---------> PlayerTank: Set VelX to clamp(PlayerTank.VelX, -PlayerTank.MaxSpeed, PlayerTank.MaxSpeed)
---------> PlayerTank: Set animation speed to abs(PlayerTank.VelX) ÷ 22
---------> PlayerTank: Set IsThrottling to 1
------------+ System: MoveDir > 0
------------+ System: FacingDirection = -1
-------------> System: Set ShakePower to 0
-------------> System: Set FacingDirection to 1
-------------> PlayerTank: Set Not mirrored
-------------> System: Set SampleX to 180 - localAngle
-------------> System: Set aimDiff to clamp(((SampleX - PlayerTank.Angle + 560) % 360) - 200, -180, 5)
-------------> System: Set targetAngle to PlayerTank.Angle + aimDiff
------------+ System: MoveDir < 0
------------+ System: FacingDirection = 1
-------------> System: Set ShakePower to 0
-------------> System: Set FacingDirection to -1
-------------> PlayerTank: Set Mirrored
-------------> System: Set SampleX to 180 - localAngle
-------------> System: Set aimDiff to clamp(((SampleX - (PlayerTank.Angle + 180) + 450) % 360) - 90, -5, 180)
-------------> System: Set targetAngle to PlayerTank.Angle + aimDiff
--------+ System: MoveDir < -0.2
---------> PlayerTank: Add MoveDir × PlayerTank.Accel × dt to VelX
---------> PlayerTank: Set VelX to clamp(PlayerTank.VelX, -PlayerTank.MaxSpeed, PlayerTank.MaxSpeed)
---------> PlayerTank: Set animation speed to abs(PlayerTank.VelX) ÷ 22
---------> PlayerTank: Set IsThrottling to 1
--------+ System: abs(MoveDir) ≤ 0.2
--------+ System: abs(PlayerTank.VelX) > 1
---------> PlayerTank: Set VelX to lerp(PlayerTank.VelX, 0, PlayerTank.Friction × dt)
---------> PlayerTank: Set IsThrottling to 0
------------+ System: abs(PlayerTank.VelX) < 1
-------------> PlayerTank: Set VelX to 0
-------------> PlayerTank: Set animation speed to 0
----+ Joy: Перетаскивание is dragging
----+ System: ActivePlayer = "Player1"
----+ PlayerTank: Fuel ≤ 0
-----> PlayerTank: Set VelX to lerp(PlayerTank.VelX, 0, PlayerTank.Friction × 2 × dt)
-----> PlayerTank: Set animation speed to 0
----+ Joy: On Перетаскивание drop
-----> Joy: Set X to Joy.StartX
-----> PlayerTank: Set animation speed to 0
----[джойстик активность]
--------+ System: Every tick
--------+ System: ActivePlayer = "Player1"
--------+ System: IsShooting = 0
--------+ PlayerTank: isDestroyed = 0
---------> Joy: Set Перетаскивание Enabled
---------> Joy: Set opacity to 100
---------> JoyAim: Set Перетаскивание Enabled
---------> JoyAim: Set opacity to 100
---------> BtnFire: Set opacity to 100
--------+ System: Every tick
---------> PlayerTank: Set X to clamp(Self.X, 20, LayoutWidth - 60)
---------> BotTank: Set X to clamp(Self.X, 20, LayoutWidth - 60)
----[[Правый джойстик: Прицеливание и Сила]]
--------+ System: Every tick
--------+ JoyAim: Перетаскивание is dragging
--------+ System: ActivePlayer = "Player1"
--------+ System: IsShooting = 0
--------+ PlayerTank: isDestroyed = 0
---------> JoyAim: Set Перетаскивание Enabled
---------> System: Set IsAimingJoy to True
------------+ System: distance(JoyAim.StartX, JoyAim.StartY, JoyAim.X, JoyAim.Y) > 8
----------------+ System: JoyAim.X ≥ JoyAim.StartX
-----------------> System: Set FacingDirection to 1
-----------------> PlayerTank: Set Not mirrored
----------------+ System: Else
-----------------> System: Set FacingDirection to -1
-----------------> PlayerTank: Set Mirrored
----------------+ (no conditions)
-----------------> System: Set targetAngle to angle(JoyAim.StartX, JoyAim.StartY, JoyAim.X, JoyAim.Y)
--------------------+ System: FacingDirection = 1
---------------------> System: Set aimDiff to ((targetAngle - PlayerTank.Angle + 560) % 360) - 200
---------------------> System: Set aimDiff to clamp(aimDiff, -180, 5)
---------------------> System: Set targetAngle to PlayerTank.Angle + aimDiff
--------------------+ System: FacingDirection = -1
---------------------> System: Set aimDiff to ((targetAngle - (PlayerTank.Angle - 180) + 450) % 360) - 90
---------------------> System: Set aimDiff to clamp(aimDiff, -5, 180)
---------------------> System: Set targetAngle to (PlayerTank.Angle + 180) + aimDiff
----------------+ (no conditions)
-----------------> System: Set Power to clamp(distance(JoyAim.StartX, JoyAim.StartY, JoyAim.X, JoyAim.Y) ÷ max(1, JoyAim.MaxX) × MaxPower, 0, MaxPower)
----[[Ограничение правого джойстика]]
// [Правый джойстик: ограничить радиус]
--------+ JoyAim: Перетаскивание is dragging
--------+ System: distance(JoyAim.StartX, JoyAim.StartY, JoyAim.X, JoyAim.Y) > JoyAim.MaxX
---------> JoyAim: Set position to (JoyAim.StartX + cos(angle(JoyAim.StartX, JoyAim.StartY, JoyAim.X, JoyAim.Y)) × JoyAim.MaxX, JoyAim.StartY + sin(angle(JoyAim.StartX, JoyAim.StartY, JoyAim.X, JoyAim.Y)) × JoyAim.MaxX)
--------+ JoyAim: On Перетаскивание drop
---------> JoyAim: Set position to (JoyAim.StartX, JoyAim.StartY)
---------> System: Set LastUiClickTime to wallclocktime
----[[Обновление дула (Визуал)]]
--------+ System: Every tick
--------+ System: IsShooting = 0
--------+ System: ActivePlayer = "Player1"
------------+ System: [X] Is IsAimingTouch
----------------+ System: FacingDirection = 1
-----------------> System: Set targetAngle to PlayerTank.Angle + aimDiff
----------------+ System: FacingDirection = -1
-----------------> System: Set targetAngle to (PlayerTank.Angle + 180) + aimDiff
--------+ (no conditions)
---------> System: Set localAngle to anglelerp(localAngle, targetAngle, 10 × dt)
---------> System: Set recoilAmount to lerp(recoilAmount, 0, 0.05)
---------> PlayerBarrel: Set angle to localAngle - recoilAmount degrees
----[[Стреляем по кнопке FIRE]]
--------+ Touch: On any touch start
--------+ Touch: Is touching BtnFire
--------+ System: IsShooting = 0
--------+ System: ActivePlayer = "Player1"
--------+ System: [X] Is IsWeaponMenuOpen
--------+ Touch: [X] Is touching DockBG
--------+ Touch: [X] Is touching BtnDockExpand
--------+ System: IsSettingsOpen = 0
--------+ System: wallclocktime > LastUiClickTime + 0.2
--------+ PlayerTank: isDestroyed = 0
---------> System: Set LastUiClickTime to wallclocktime
---------> Functions: Call FireWeapon
----+ Touch: On any touch start
----+ Touch: Is touching BtnAimSwitch
--------+ System: Is IsAimingJoy
---------> System: Set IsAimingJoy to False
---------> BtnAimSwitch: Set animation frame to 0
--------+ System: Else
---------> System: Set IsAimingJoy to True
---------> BtnAimSwitch: Set animation frame to 1
---------> System: Set LastUiClickTime to wallclocktime
--------+ (no conditions)
---------> LocalStorage: Set item "AimJoyMode" to int(IsAimingJoy)
----+ Keyboard: On M pressed
--------+ System: Is IsAimingJoy
---------> System: Set IsAimingJoy to False
---------> BtnAimSwitch: Set animation frame to 0
--------+ System: Else
---------> System: Set IsAimingJoy to True
---------> BtnAimSwitch: Set animation frame to 1
---------> System: Set LastUiClickTime to wallclocktime
--------+ (no conditions)
---------> LocalStorage: Set item "AimJoyMode" to int(IsAimingJoy)
----+ System: Every tick
--------+ System: Is IsAimingJoy
---------> BtnAimSwitch: Set animation frame to 0
--------+ System: Else
---------> BtnAimSwitch: Set animation frame to 1
----+ System: On start of layout
-----> (no actions)
[[Кастомная физика танков и следование за рельефом]]
| Local number cx = 0
| Local number cy = 0
| Local number lx = 0
| Local number ly = 0
| Local number rx = 0
| Local number ry = 0
| Local number groundAngle = 0
| Local number MoveDir = 0
| Local number frontX = 0
| Local number frontY = 0
| Local number tankBottom = 0
// ═══ 1. ПРИМЕНЕНИЕ ГРАВИТАЦИИ И СКОРОСТИ ═══
----+ System: Every tick
----+ System: For each Players
----+ Players: isDestroyed = 0
-----> System: Set tankBottom to Players.Y + 25
-----> Players: Add Self.Gravity × dt to VelY
-----> Players: Set X to Self.X + Self.VelX × dt
-----> Players: Set Y to Self.Y + Self.VelY × dt
--------+ (no conditions)
--------// ═══ 2. ПРОВЕРКА ЗЕМЛИ И ПРИЛИПАНИЕ К HeightMap ═══
---------> System: Set cx to clamp(Players.X, 0, LayoutWidth - 1)
---------> System: Set cy to lerp(HeightMap.At(floor(cx), 0), HeightMap.At(floor(cx) + 1, 0), cx - floor(cx))
---------> System: Set lx to clamp(Players.X - 10, 0, LayoutWidth - 1)
---------> System: Set ly to lerp(HeightMap.At(floor(lx), 0), HeightMap.At(floor(lx) + 1, 0), lx - floor(lx))
---------> System: Set rx to clamp(Players.X + 10, 0, LayoutWidth - 1)
---------> System: Set ry to lerp(HeightMap.At(floor(rx), 0), HeightMap.At(floor(rx) + 1, 0), rx - floor(rx))
--------+ System: tankBottom ≥ cy - 2
---------> Players: Set isGrounded to 1
---------> Players: Set VelY to 0
---------> Players: Set Y to cy
--------// Расчёт угла наклона поверхности
---------> System: Set groundAngle to angle(lx, ly, rx, ry)
---------> System: Set groundAngle to ((groundAngle + 180) % 360) - 180
---------> Players: Set groundAngle to groundAngle
--------// ВЛИЯНИЕ СКЛОНА: Гравитация тянет танк вниз по склону
// Если танк на подъеме, sin(groundAngle) замедляет его. На спуске - ускоряет.
---------> [DISABLED] PlayerTank: Subtract sin(Players.groundAngle) × Self.Gravity × dt × 0.5 from VelX
--------// Плавный поворот танка по склону + инерция (swayAng)
---------> Players: Set angle to anglelerp(Players.Angle, Players.baseAngle + groundAngle + Players.swayAng, 0.2) degrees
------------+ System: abs(Players.groundAngle) > 55
----------------+ System: sign(Players.VelX) = sign(sin(Players.groundAngle))
-----------------> Players: Set VelX to 0
--------+ System: Else
---------> Players: Set isGrounded to 0
---------> Players: Set angle to anglelerp(Players.Angle, Players.baseAngle + Players.swayAng, 0.05) degrees
// ═══ПРОВЕРКА "СТЕНЫ" (защита от врезания в крутые горки) ═══
--------+ Players: isGrounded = 1
--------+ System: abs(Players.VelX) > 5
---------> System: Set frontX to clamp(floor(Players.X + sign(Players.VelX) × 15), 0, LayoutWidth)
---------> System: Set frontY to HeightMap.At(frontX, 0)
------------+ System: frontY < tankBottom - 55
-------------> Players: Set VelX to 0
-------------> Players: Set X to Self.X - sign(Players.VelX) × 2
[[Оружейное меню B2]]
// выезжающий sheet
| Local number TargetScale = 0.1
| Local number TargetOpacity = 50
----+ System: On start of layout
-----> WeaponAmmo: Set size to (26, 1, 1)
-----> WeaponAmmo: Set value at (0) to 999
----// огненный
-----> WeaponAmmo: Set value at (1) to 3
----// ракета
-----> WeaponAmmo: Set value at (2) to 3
----// мина
-----> WeaponAmmo: Set value at (3) to 3
----// кластерный
-----> WeaponAmmo: Set value at (4) to 3
----// пулемет
-----> WeaponAmmo: Set value at (5) to 3
----// Прыгучка
-----> WeaponAmmo: Set value at (6) to 3
----// грязевая
-----> WeaponAmmo: Set value at (7) to 3
----// бур
-----> WeaponAmmo: Set value at (8) to 3
----// лазер
-----> WeaponAmmo: Set value at (9) to 3
----// заморозка
-----> WeaponAmmo: Set value at (10) to 3
----// Роллер / Ездок (Roller / Road Runner)
-----> WeaponAmmo: Set value at (11) to 3
----// молния
-----> WeaponAmmo: Set value at (12) to 3
----// УДАР ПО ПЛОЩАДИ
-----> WeaponAmmo: Set value at (13) to 3
----// двойной снаряд
-----> WeaponAmmo: Set value at (14) to 3
----// телепорт
-----> WeaponAmmo: Set value at (15) to 3
----// ядерная
-----> WeaponAmmo: Set value at (16) to 3
----// фонтан
-----> WeaponAmmo: Set value at (17) to 3
----// энергокупол
-----> WeaponAmmo: Set value at (18) to 3
----// Авиаудар
-----> WeaponAmmo: Set value at (19) to 3
----// NLO
-----> WeaponAmmo: Set value at (20) to 3
----// RC
-----> WeaponAmmo: Set value at (21) to 3
----// RC DRON
-----> WeaponAmmo: Set value at (22) to 3
----// бумеранг
-----> WeaponAmmo: Set value at (23) to 3
----// тройной залп
-----> WeaponAmmo: Set value at (24) to 3
----// вулкан
-----> WeaponAmmo: Set value at (25) to 3
-----> DockBG: Set visibility Visible
-----> Text_DockAmmo: Set visibility Visible
-----> BtnDockExpand: Set visibility Visible
-----> WeaponPanel: Set visibility Invisible
-----> WeaponPanel: Set size to (min(ViewportWidth("UI") - 16, 980), ViewportHeight("UI") × 0.45)
-----> WeaponPanel: Set position to (ViewportMidX("UI"), ViewportBottom("UI") + (WeaponPanel.Height ÷ 2) + 20)
-----> Text_WeaponDesc: Set size to (WeaponPanel.Width - 40, WeaponPanel.Height × 0.45)
-----> System: Set WeaponScrollX to 0
-----> System: Set WeaponMaxScrollX to 0
-----> System: Set DescWeaponID to CurrentProjectileType
// Док: закреплён внизу, патроны рядом с кнопкой
----+ System: Every tick
----+ System: MatchResult = ""
-----> DockBG: Set visibility Visible
-----> Text_DockAmmo: Set visibility Visible
-----> BtnDockExpand: Set visibility Visible
-----> DockBG: Set position to (ViewportMidX("UI"), ViewportBottom("UI") - 58)
-----> WeaponMainButton: Set position to (DockBG.X - 60, DockBG.Y)
-----> WeaponMainButton: Set animation frame to CurrentProjectileType
-----> Text_DockAmmo: Set position to (DockBG.X + 10, DockBG.Y)
-----> Text_DockAmmo: Set text to "×" & WeaponAmmo.At(CurrentProjectileType)
-----> BtnDockExpand: Set position to (DockBG.X + 78, DockBG.Y)
--------+ System: Is IsWeaponMenuOpen
---------> WeaponMainButton: Set opacity to 20
---------> BtnDockExpand: Set opacity to 20
---------> Text_DockAmmo: Set opacity to 5
------------+ System: CurrentProjectileType ≠ 0
------------+ System: WeaponAmmo.At(CurrentProjectileType) = 0
-------------> Text_DockAmmo: Set color to rgbEx(220, 60, 60)
-------------> WeaponMainButton: Set opacity to 60
--------+ System: Else
---------> Text_DockAmmo: Set color to rgbEx(255, 255, 255)
---------> WeaponMainButton: Set opacity to 100
---------> BtnDockExpand: Set opacity to 100
---------> Text_DockAmmo: Set opacity to 100
----+ System: Every tick
----+ System: MatchResult ≠ ""
-----> DockBG: Set visibility Invisible
-----> Text_DockAmmo: Set visibility Invisible
-----> BtnDockExpand: Set visibility Invisible
-----> WeaponMainButton: Set visibility Invisible
// Открытие/закрытие sheet тапом по доку
----+ Touch: On any touch start
----+ Touch: Is touching DockBG
-----> Functions: Call UiWeaponMenuToggle
----+ [DISABLED] Touch: On any touch start
----+ [DISABLED] Touch: [X] Is touching WeaponPanel
----+ [DISABLED] System: [X] Is IsWeaponMenuOpen
----+ [DISABLED] Touch: Is touching BtnDockExpand
-----> [DISABLED] Functions: Call UiWeaponMenuToggle
----+ Touch: On any touch end
----+ System: Is IsWeaponMenuOpen
----+ System: MenuDidScroll = 0
----+ Touch: [X] Is touching WeaponPanel
----+ Touch: [X] Is touching WeaponIcon
----+ Touch: [X] Is touching WeaponMainButton
----+ Touch: [X] Is touching BtnDockExpand
----+ Touch: [X] Is touching DockBG
-----> Functions: Call UiWeaponMenuClose
----* On function 'UiWeaponMenuToggle'
-----> System: Set LastUiClickTime to wallclocktime
--------+ System: [X] Is IsWeaponMenuOpen
---------> System: Set IsWeaponMenuOpen to True
---------> System: Set DescWeaponID to CurrentProjectileType
---------> WeaponPanel: Set visibility Visible
---------> WeaponPanel: Tween "" property Y to ViewportBottom("UI") - (WeaponPanel.Height ÷ 2) in 0.3 seconds (In Sinusoidal, destroy: No, loop: No, ping pong: No, repeat count: 1)
--------+ System: Else
---------> Functions: Call UiWeaponMenuClose
----* On function 'UiWeaponMenuClose'
-----> System: Set LastUiClickTime to wallclocktime
-----> System: Set IsWeaponMenuOpen to False
-----> System: Set WeaponScrollY to 0
-----> Text_WeaponDesc: Set visibility Invisible
-----> WeaponPanel: Tween "" property Y to ViewportBottom("UI") + (WeaponPanel.Height ÷ 2) + 20 in 0.3 seconds (Out Sinusoidal, destroy: No, loop: No, ping pong: No, repeat count: 1)
// Sheet уехал вниз — скрыть всё
----+ System: Every tick
----+ System: [X] Is IsWeaponMenuOpen
----+ WeaponPanel: Y ≥ ViewportBottom("UI") + 10
-----> WeaponPanel: Set visibility Invisible
-----> WeaponIcon: Set visibility Invisible
-----> WeaponAmmoText: Set visibility Invisible
-----> Text_WeaponDesc: Set visibility Invisible
// Sheet: лента иконок + описание над ней
----+ System: Every tick
----+ WeaponPanel: Is visible
--------+ System: For each WeaponIcon
--------+ WeaponAmmoText: WeaponID = WeaponIcon.WeaponID
---------> System: Set WeaponMaxScrollX to max(0, (25 × 110) + 120 - WeaponPanel.Width)
---------> WeaponIcon: Set visibility Visible
---------> WeaponIcon: Set position to (WeaponPanel.BBoxLeft +100 + (WeaponIcon.WeaponID × 110) - WeaponScrollX, WeaponPanel.BBoxBottom - 180)
---------> WeaponAmmoText: Set position to (WeaponIcon.X, WeaponIcon.Y + 50)
---------> WeaponAmmoText: Move to top of layer
---------> System: Set TargetScale to 0.15
---------> System: Set TargetOpacity to 70
------------+ WeaponIcon: WeaponID = CurrentProjectileType
-------------> System: Set TargetScale to 0.2
-------------> System: Set TargetOpacity to 100
------------+ Mouse: Cursor is over WeaponIcon
-------------> System: Set TargetScale to 0.18
-------------> System: Set TargetOpacity to 100
-------------> System: Set DescWeaponID to WeaponIcon.WeaponID
------------+ (no conditions)
-------------> WeaponIcon: Set scale to lerp(WeaponIcon.Width ÷ WeaponIcon.ImageWidth, TargetScale, 15 × dt)
-------------> WeaponIcon: Set opacity to lerp(WeaponIcon.Opacity, TargetOpacity, 15 × dt)
----------------+ System: WeaponIcon.X < WeaponPanel.BBoxLeft + 25
----------------+ OR System: WeaponIcon.X > WeaponPanel.BBoxRight - 25
-----------------> WeaponIcon: Set visibility Invisible
-----------------> WeaponAmmoText: Set visibility Invisible
----------------+ System: Else
-----------------> WeaponAmmoText: Set visibility Visible
-----------------> WeaponAmmoText: Set text to WeaponAmmo.At(WeaponAmmoText.WeaponID)
--------+ System: WepLoaded = 1
---------> Text_WeaponDesc: Set visibility Visible
---------> Text_WeaponDesc: Set position to (WeaponPanel.BBoxLeft + 20, WeaponPanel.BBoxTop + 30)
---------> Text_WeaponDesc: Set text to WepDesc.At(Lang, DescWeaponID × 3) & newline & WepDesc.At(Lang, DescWeaponID × 3 + 1) & newline & WepDesc.At(Lang, DescWeaponID × 3 + 2)
// Sheet: горизонтальный скролл (колесо + свайп)
----+ Mouse: On mouse wheel up
----+ System: Is IsWeaponMenuOpen
----+ Mouse: Cursor is over WeaponPanel
-----> System: Set WeaponScrollX to clamp(WeaponScrollX - 80, 0, WeaponMaxScrollX)
----+ Mouse: On mouse wheel down
----+ System: Is IsWeaponMenuOpen
----+ Mouse: Cursor is over WeaponPanel
-----> System: Set WeaponScrollX to clamp(WeaponScrollX + 80, 0, WeaponMaxScrollX)
----+ Touch: On any touch start
----+ System: Is IsWeaponMenuOpen
----+ Touch: Is touching WeaponPanel
-----> System: Set TouchStartX_Menu to Touch.X
-----> System: Set MenuDidScroll to 0
----+ Touch: On any touch start
----+ System: Is IsWeaponMenuOpen
----+ Touch: Is touching WeaponIcon
-----> System: Set TouchStartX_Menu to Touch.X
-----> System: Set MenuDidScroll to 0
----+ Touch: Is in touch
----+ System: Is IsWeaponMenuOpen
----+ Touch: Is touching WeaponPanel
----+ System: abs(Touch.X - TouchStartX_Menu) > 10
-----> System: Set WeaponScrollX to clamp(WeaponScrollX + (TouchStartX_Menu - Touch.X), 0, WeaponMaxScrollX)
-----> System: Set TouchStartX_Menu to Touch.X
-----> System: Set MenuDidScroll to 1
----+ Touch: Is in touch
----+ System: Is IsWeaponMenuOpen
----+ Touch: Is touching WeaponIcon
----+ System: abs(Touch.X - TouchStartX_Menu) > 10
-----> System: Set WeaponScrollX to clamp(WeaponScrollX + (TouchStartX_Menu - Touch.X), 0, WeaponMaxScrollX)
-----> System: Set TouchStartX_Menu to Touch.X
-----> System: Set MenuDidScroll to 1
// Быстрый скролл тапом по стрелкам
----+ Touch: On any touch start
----+ System: Is IsWeaponMenuOpen
----+ Touch: Is touching ScrollArrowLeft
-----> System: Set WeaponScrollX to clamp(WeaponScrollX - 160, 0, WeaponMaxScrollX)
-----> System: Set MenuDidScroll to 1
----+ Touch: On any touch start
----+ System: Is IsWeaponMenuOpen
----+ Touch: Is touching ScrollArrowRight
-----> System: Set WeaponScrollX to clamp(WeaponScrollX + 160, 0, WeaponMaxScrollX)
-----> System: Set MenuDidScroll to 1
// [Выбор иконки]
----+ Touch: On any touch end
----+ Touch: Is touching WeaponIcon
----+ System: Is IsWeaponMenuOpen
----+ System: MenuDidScroll = 0
-----> System: Set LastUiClickTime to wallclocktime
--------+ System: WeaponAmmo.At(WeaponIcon.WeaponID) > 0
--------+ OR WeaponIcon: WeaponID = 0
---------> System: Set P1_SavedWeapon to WeaponIcon.WeaponID
---------> System: Set DescWeaponID to WeaponIcon.WeaponID
---------> WeaponMainButton: Set animation frame to WeaponIcon.WeaponID
------------+ System: ActivePlayer = "Player1"
------------+ System: IsShooting = 0
-------------> System: Set CurrentProjectileType to WeaponIcon.WeaponID
--------+ (no conditions)
---------> Functions: Call UiWeaponMenuClose
// [Закрытие тапом вне sheet и дока]
----+ Touch: On any touch end
----+ System: Is IsWeaponMenuOpen
----+ Touch: [X] Is touching WeaponPanel
----+ Touch: [X] Is touching WeaponIcon
----+ Touch: [X] Is touching WeaponMainButton
----+ Touch: [X] Is touching BtnDockExpand
----+ Touch: [X] Is touching DockBG
-----> Functions: Call UiWeaponMenuClose
// ═══ СВАЙП ВВЕРХ: ОТКРЫТИЕ МЕНЮ ═══
----+ Touch: On any touch start
----+ System: [X] Is IsWeaponMenuOpen
----+ System: Touch.Y > ViewportBottom("UI") - 150
----+ Touch: [X] Is touching WeaponIcon
----+ Touch: [X] Is touching WeaponMainButton
----+ Touch: [X] Is touching BtnDockExpand
----+ Touch: [X] Is touching WeaponPanel
----+ Touch: [X] Is touching BtnFire
----+ Touch: [X] Is touching Joy
----+ Touch: [X] Is touching JoyAim
----+ Touch: [X] Is touching BtnAimSwitch
----+ Touch: [X] Is touching BtnSelfDestruct
----+ Touch: [X] Is touching DockBG
-----> System: Set MenuSwipeStartY to Touch.Y
-----> System: Set MenuSwipeStartX to Touch.X
-----> System: Set MenuIsSwiping to 1
// Проверяем движение пальца вверх (порог 60px, вертикальнее 40px)
----+ Touch: Is in touch
----+ System: MenuIsSwiping = 1
----+ System: [X] Is IsWeaponMenuOpen
----+ System: MenuSwipeStartY - Touch.Y > 60
----+ System: abs(Touch.X - MenuSwipeStartX) < 40
-----> System: Set MenuIsSwiping to 0
-----> Functions: Call UiWeaponMenuToggle
// Сброс флага при отпускании пальца
----+ Touch: On any touch end
----+ System: MenuIsSwiping = 1
-----> System: Set MenuIsSwiping to 0
// ═══ СВАЙП ВНИЗ: ЗАКРЫТИЕ МЕНЮ ═══
----+ Touch: On any touch start
----+ System: Is IsWeaponMenuOpen
----+ Touch: Is touching WeaponPanel
----+ Touch: [X] Is touching WeaponIcon
-----> System: Set MenuSwipeStartY to Touch.Y
-----> System: Set MenuSwipeStartX to Touch.X
-----> System: Set MenuIsSwiping to 1
// Проверяем движение пальца вниз (порог 80px, чтобы не конфликтовать со скроллом иконок)
----+ Touch: Is in touch
----+ System: MenuIsSwiping = 1
----+ System: Is IsWeaponMenuOpen
----+ System: Touch.Y - MenuSwipeStartY > 80
----+ System: abs(Touch.X - MenuSwipeStartX) < 50
-----> System: Set MenuIsSwiping to 0
-----> Functions: Call UiWeaponMenuClose
// Сброс флага при отпускании пальца (дубль для надёжности)
----+ Touch: On any touch end
----+ System: MenuIsSwiping = 1
-----> System: Set MenuIsSwiping to 0
// ═══ СТРЕЛКИ-ПОДСКАЗКИ СКРОЛЛА ═══
----+ System: Every tick
----+ WeaponPanel: Is visible
-----> ScrollArrowLeft: Set position to (WeaponPanel.BBoxLeft + 18, WeaponPanel.BBoxBottom - 180)
-----> ScrollArrowRight: Set position to (WeaponPanel.BBoxRight - 40, WeaponPanel.BBoxBottom - 180)
-----> ScrollArrowLeft: Move to top of layer
-----> ScrollArrowRight: Move to top of layer
--------+ System: WeaponScrollX > 5
---------> ScrollArrowLeft: Set visibility Visible
---------> ScrollArrowLeft: Set opacity to 60 + (sin(time × 400) × 30)
---------> ScrollArrowLeft: Set scale to 0.8 + (sin(time × 300) × 0.1)
--------+ System: Else
---------> ScrollArrowLeft: Set visibility Invisible
--------+ System: WeaponScrollX < WeaponMaxScrollX - 5
---------> ScrollArrowRight: Set visibility Visible
---------> ScrollArrowRight: Set opacity to 60 + (sin(time × 400) × 30)
---------> ScrollArrowRight: Set scale to 0.8 + (sin(time × 300) × 0.1)
--------+ System: Else
---------> ScrollArrowRight: Set visibility Invisible
----+ System: Every tick
----+ WeaponPanel: [X] Is visible
-----> ScrollArrowLeft: Set visibility Invisible
-----> ScrollArrowRight: Set visibility Invisible
//maplayout sheet
[[Генерация Карты Уровней]]
----+ System: Every tick
----+ System: Is IsDataLoaded
----+ System: Trigger once
-----> LevelNode: Destroy
-----> NodeText: Destroy
-----> LineSprite: Destroy
-----> System: Wait 0.0 seconds (use time scale: False)
-----> Functions: Call GenerateMap
----[GenerateMap]
| Local number currX = 0
| Local number currY = 0
| Local number prevX = 0
| Local number prevY = 0
| Local number x1 = 0
| Local number x2 = 0
| Local number y1 = 0
| Local number y2 = 0
| Local number propY = 0
| Local number propX = 0
| Local number startX = 0
| Local number startY = 0
| Local number targetX = 0
| Local number targetY = 0
| Local number zoneB = 255
| Local number zoneG = 255
| Local number zoneR = 255
| Local number leftB = 0
| Local number leftG = 0
| Local number leftR = 0
| Local number rightB = 0
| Local number rightG = 0
| Local number rightR = 0
| Local string currentBiome = ""
| Local number centerY = 0
| Local number blobY = 0
| Local number blobX = 0
| Local number roadB = 255
| Local number roadG = 255
| Local number roadR = 255
| Local number borderX = 0
--------* On function 'GenerateMap'
---------> System: Set centerY to LayoutHeight ÷ 2
------------+ System: For "lvl" from 1 to 100
-------------> System: Set currX to 100 + (LoopIndex("lvl") - 1) × 150
-------------> System: Set currY to (LayoutHeight ÷ 2) + (sin(LoopIndex("lvl") × 35) × 120) + (cos(LoopIndex("lvl") × 15) × 40)
----------------+ System: LoopIndex("lvl") ≤ 10
-----------------> System: Set currentBiome to "Forest"
-----------------> System: Set zoneR to 65
-----------------> System: Set zoneG to 185
-----------------> System: Set zoneB to 115
-----------------> System: Set roadR to 40
-----------------> System: Set roadG to 75
-----------------> System: Set roadB to 55
-----------------> System: Set layer "MapDeepBG" background color to rgb(zoneR × 0.7, zoneG × 0.7, zoneB × 0.7)
----------------+ System: LoopIndex("lvl") > 10
----------------+ System: LoopIndex("lvl") ≤ 20
-----------------> System: Set currentBiome to "Forest"
-----------------> System: Set zoneR to 90
-----------------> System: Set zoneG to 60
-----------------> System: Set zoneB to 190
-----------------> System: Set roadR to 45
-----------------> System: Set roadG to 35
-----------------> System: Set roadB to 95
-----------------> System: Set layer "MapDeepBG" background color to rgb(zoneR × 0.7, zoneG × 0.7, zoneB × 0.7)
----------------+ System: LoopIndex("lvl") > 20
----------------+ System: LoopIndex("lvl") ≤ 30
-----------------> System: Set currentBiome to "Desert"
-----------------> System: Set zoneR to 240
-----------------> System: Set zoneG to 175
-----------------> System: Set zoneB to 60
-----------------> System: Set roadR to 115
-----------------> System: Set roadG to 65
-----------------> System: Set roadB to 30
-----------------> System: Set layer "MapDeepBG" background color to rgb(zoneR × 0.7, zoneG × 0.7, zoneB × 0.7)
----------------+ System: LoopIndex("lvl") > 30
-----------------> System: Set currentBiome to "Forest"
-----------------> System: Set zoneR to 65
-----------------> System: Set zoneG to 185
-----------------> System: Set zoneB to 115
-----------------> System: Set roadR to 40
-----------------> System: Set roadG to 75
-----------------> System: Set roadB to 55
-----------------> System: Set layer "MapDeepBG" background color to rgb(zoneR × 0.7, zoneG × 0.7, zoneB × 0.7)
----------------+ (no conditions)
-----------------> System: Create object BgStripe on layer "MapDeepBG" at (currX, LayoutHeight ÷ 2), create hierarchy: False, template: ""
-----------------> BgStripe: Set size to (310, ViewportHeight(0) + 1500)
-----------------> BgStripe: Set color to rgb(zoneR, zoneG, zoneB)
-----------------> BgStripe: Move to bottom of layer
// =============== НОВЫЙ БЛОК: ЖИВОЙ ФОН ===============
----------------+ System: Repeat random(2, 3) times
-----------------> System: Create object BgSpot on layer "MapDeepBG" at (currX + random(-200, 200), centerY + random(-400, 400)), create hierarchy: False, template: ""
-----------------> BgSpot: Set size to (random(200, 500), random(200, 500))
-----------------> BgSpot: Set color to rgb(zoneR + random(-15, 15), zoneG + random(-15, 15), zoneB + random(-15, 15))
-----------------> BgSpot: Set opacity to random(20, 40)
----------------+ System: Repeat random(3, 5) times
-----------------> System: Create object BiomeBlob on layer "MapBG" at (currX + random(-180, 180), centerY + random(-350, 350)), create hierarchy: False, template: ""
-----------------> BiomeBlob: Set Y_sort to BiomeBlob.Y
-----------------> BiomeBlob: Set animation to currentBiome (play from beginning)
-----------------> BiomeBlob: Set animation frame to int(random(0, BiomeBlob.AnimationFrameCount))
-----------------> BiomeBlob: Set color to rgb(zoneR, zoneG, zoneB)
-----------------> BiomeBlob: Set scale to random(0.5, 0.8)
----------------+ System: LoopIndex("lvl") > 1
--------------------+ System: For "step" from 1 to 15
---------------------> System: Set x1 to lerp(prevX, currX, (LoopIndex("step") - 1) ÷ 15.0)
---------------------> System: Set y1 to lerp(prevY, currY, (1 - cos(((LoopIndex("step") - 1) ÷ 15.0) × 180)) ÷ 2.0)
---------------------> System: Set x2 to lerp(prevX, currX, LoopIndex("step") ÷ 15.0)
---------------------> System: Set y2 to lerp(prevY, currY, (1 - cos((LoopIndex("step") ÷ 15.0) × 180)) ÷ 2.0)
---------------------> System: Create object RoadSprite on layer "MapRoad" at (x1, y1), create hierarchy: False, template: ""
---------------------> RoadSprite: Set width to distance(x1, y1, x2, y2) + 10
---------------------> RoadSprite: Set height to 50
---------------------> RoadSprite: Set angle to angle(x1, y1, x2, y2) degrees
------------------------+ System: LoopIndex("step") % 2 = 0
-------------------------> System: Create object DashSprite on layer "MapRoad" at (x1, y1), create hierarchy: False, template: ""
-------------------------> DashSprite: Set angle to angle(x1, y1, x2, y2) degrees
-------------------------> DashSprite: Move to top of layer
--------------------+ System: Repeat random(5, 9) times
---------------------> System: Set propX to currX + random(-150, 50)
---------------------> System: Set propY to currY + choose(-1, 1) × random(80, 300)
---------------------> System: Create object MapProp on layer "MapProps" at (currX + choose(-1, 1) × random(70, 140), currY + choose(-1, 1) × random(90, 160)), create hierarchy: False, template: ""
---------------------> MapProp: Set Y_sort to MapProp.Y
---------------------> MapProp: Set animation to currentBiome (play from beginning)
---------------------> MapProp: Set scale to random(0.2, 0.3)
// Лес (Зеленая зона)
------------------------+ System: LoopIndex("lvl") ≤ 10
-------------------------> MapProp: Set animation to "Forest" (play from beginning)
// Зима (Белая зона)
------------------------+ System: LoopIndex("lvl") > 10
------------------------+ System: LoopIndex("lvl") ≤ 20
-------------------------> MapProp: Set animation to "Winter" (play from beginning)
// Пустыня (Песчаная зона)
------------------------+ System: LoopIndex("lvl") > 20
------------------------+ System: LoopIndex("lvl") ≤ 30
-------------------------> MapProp: Set animation to "Desert" (play from beginning)
------------------------+ System: LoopIndex("lvl") > 30
-------------------------> MapProp: Set animation to "Forest" (play from beginning)
------------------------+ (no conditions)
-------------------------> MapProp: Set animation frame to int(random(0, MapProp.AnimationFrameCount))
----------------+ (no conditions)
-----------------> System: Create object LevelNode on layer "MapNodes" at (currX, currY), create hierarchy: False, template: ""
-----------------> LevelNode: Set ID to LoopIndex("lvl")
-----------------> System: Create object NodeText on layer "MapNodes" at (currX, currY - 5), create hierarchy: False, template: ""
-----------------> NodeText: Set text to str(LoopIndex("lvl"))
-----------------> System: Create object NodeFlag on layer "MapNodes" at (currX, currY - 30), create hierarchy: False, template: ""
--------------------+ System: LevelNode.ID < int(LevelToPlay)
---------------------> LevelNode: Set color to rgb(190, 130, 255)
---------------------> NodeText: Set font color to rgbEx(0, 0, 0)
---------------------> NodeFlag: Set visibility Visible
--------------------+ System: LevelNode.ID = int(LevelToPlay)
---------------------> LevelNode: Set color to rgb(255, 215, 0)
---------------------> NodeText: Set font color to rgbEx(200, 200, 200)
---------------------> NodeFlag: Set visibility Visible
---------------------> LevelNode: Tween "Scale" property X Scale to 1.15 in 0.8 seconds (Default, destroy: No, loop: Yes, ping pong: Yes, repeat count: 1)
---------------------> System: Set targetX to currX
---------------------> System: Set targetY to currY
--------------------+ System: LevelNode.ID > int(LevelToPlay)
---------------------> LevelNode: Set color to rgb(120, 120, 130)
---------------------> NodeText: Set font color to rgbEx(200, 200, 200)
---------------------> NodeFlag: Set visibility Invisible
--------------------+ System: LevelNode.ID = int(LevelToPlay) - 1
---------------------> System: Set startX to currX
---------------------> System: Set startY to currY
----------------+ (no conditions)
-----------------> System: Set prevX to currX
-----------------> System: Set prevY to currY
// [Анимация Танка на Карте]
------------+ (no conditions)
-------------> MapTank: Move to layer "MapNodes"
-------------> MapTank: Move to top of layer
-------------> MapTank: Set position to (targetX, targetY - 40)
-------------> System: Set MapScrollX to targetX
----------------+ System: Is JustWonBattle
--------------------+ System: LevelToPlay > 1
---------------------> MapTank: Set position to (startX, startY - 20)
---------------------> MapTank: Tween "MoveX" property X to targetX in 1.5 seconds (Out Cubic, destroy: No, loop: No, ping pong: No, repeat count: 1)
---------------------> MapTank: Tween "MoveY" property Y to targetY- 20 in 1.5 seconds (Out Cubic, destroy: No, loop: No, ping pong: No, repeat count: 1)
---------------------> System: Set JustWonBattle to False
--------------------+ System: Else
------------------------+ LevelNode: ID = LevelToPlay
-------------------------> MapTank: Tween: Stop all
-------------------------> MapTank: Set position to (targetX, targetY - 50)
-------------------------> System: Set JustWonBattle to False
--------+ (no conditions)
---------> System: Sort BiomeBlob Z order by Y_sort
---------> System: Sort MapProp Z order by Y_sort
----[[Камера Карты (Слежение)]]
--------+ System: Every tick
---------> System: Set scroll X to lerp(ScrollX, MapScrollX, 5 × dt)
---------> System: Set scroll Y to LayoutHeight ÷ 2
[[Клик по уровню для игры]]
----+ Touch: On any touch start
----+ Touch: Is touching LevelNode
----+ System: LevelNode.ID = LevelToPlay
-----> LevelNode: Set scale to 0.9
-----> System: Wait 0.15 seconds (use time scale: True)
-----> LevelNode: Set scale to 1.0
-----> System: Set MatchResult to ""
-----> System: Go to Game
----[Управление фоном и биомами]
| Local number camLvl = 0
--------+ System: Every tick
---------> System: Set camLvl to round(ScrollX ÷ 150)
---------> MapFog: Set position to (ScrollX - (ViewportWidth(0) ÷ 2), ScrollY - (ViewportHeight(0) ÷ 2))
---------> MapFog: Set size to (ViewportWidth(0), ViewportHeight(0))
---------> MapFog: Set image X offset to (ScrollX × 0.2) + (time × 20)
---------> MapFog: Set opacity to 45 + (sin(time × 80) × 15)
---------> MapFog: Move in front BgStripe
// БИОМ 1: ЛЕС (Уровни 1-10) - Темно-зеленый / Изумрудный
------------+ System: camLvl ≤ 10
-------------> System: Set TargetBgR to 25
-------------> System: Set TargetBgG to 80
-------------> System: Set TargetBgB to 50
// БИОМ 2: ЗИМА (Уровни 11-20) - Ледяной / Голубовато-белый
------------+ System: camLvl > 10
------------+ System: camLvl ≤ 20
-------------> System: Set TargetBgR to 170
-------------> System: Set TargetBgG to 210
-------------> System: Set TargetBgB to 240
// БИОМ 3: ПУСТЫНЯ (Уровни 21-30) - Песчаный / Оранжевый
------------+ System: camLvl > 20
------------+ System: camLvl ≤ 30
-------------> System: Set TargetBgR to 190
-------------> System: Set TargetBgG to 120
-------------> System: Set TargetBgB to 40
// БИОМ 4: ВУЛКАН ИЛИ НОЧЬ (Уровни 31-40) - Бордовый / Фиолетовый
------------+ System: camLvl > 30
------------+ System: camLvl ≤ 40
-------------> System: Set TargetBgR to 70
-------------> System: Set TargetBgG to 20
-------------> System: Set TargetBgB to 90
------------+ (no conditions)
-------------> (no actions)
//Hangar events
<Include Global>
[[ЕДИНЫЙ ВВОД: АНГАР]]
----+ Touch: On any touch start
----+ Touch: Is touching BtnPlay
-----> System: Set ViewTankID to CurrentTankID
-----> System: Go to layout "MapLayout"
// прокрутка танков
----+ Touch: On any touch start
----+ Touch: Is touching BtnArrowRight
-----> Functions: Call UiBtnRight
----+ Touch: On any touch start
----+ Touch: Is touching BtnArrowLeft
-----> Functions: Call UiBtnLeft
// ПОКУПКА улучшений
----+ Touch: On any touch start
----+ Touch: Is touching BtnUpgradeArmor
-----> Functions: Call UiUpgradeArmor
----+ Touch: On any touch start
----+ Touch: Is touching BtnUpgradeDamage
-----> Functions: Call UiUpgradeDamage
----+ Touch: On any touch start
----+ Touch: Is touching BtnUpgradeFuel
-----> Functions: Call UiUpgradeFuel
// ПОКУПКА танка
----+ Touch: On any touch start
----+ Touch: Is touching BtnTankAction
-----> Functions: Call UiTankAction
// сброс
----+ Touch: On any touch start
----+ Touch: Is touching BtnResetProgress
-----> Functions: Call UiResetProgress
[[полоски] и [ЗАДАЕМ ЛИМИТЫ]]
----+ System: Is IsDataLoaded
--------+ System: Every tick
---------> Text_Coins: Set text to RegexReplace(str(Coins), "(\\d)(?=(\\d{3})+(?!\\d))", "g", "$1 ")
------------+ System: ViewTankID < AvailableTanks
-------------> BtnUpgradeArmor: Set visibility Visible
-------------> BtnUpgradeDamage: Set visibility Visible
-------------> BtnUpgradeFuel: Set visibility Visible
-------------> BtnTankAction: Set visibility Visible
// "ВЫБРАН/ВЫБРАТЬ/КУПИТЬ"
----------------+ System: Every tick
-----------------> PlayerTank: Set animation to "Tank" & ViewTankID (play from beginning)
-----------------> PlayerBarrel: Set animation to "Barrel" & ViewTankID (play from beginning)
--------------------+ System: ViewTankID = CurrentTankID
--------------------// "ВЫБРАН"
---------------------> Text_TankAction: Set text to ArrayLang.At(Lang, 6)
--------------------+ System: Else
------------------------+ System: TankStats.At(ViewTankID, 3) = 1
------------------------// "ВЫБРАТЬ"
-------------------------> Text_TankAction: Set text to ArrayLang.At(Lang, 7)
------------------------+ System: Else
------------------------// "КУПИТЬ: 10000"
-------------------------> Text_TankAction: Set text to ArrayLang.At(Lang, 8) & ": 10000"
// ЗАДАЕМ ЛИМИТЫ ДЛЯ ВЫБРАННОГО ТАНКА
----------------+ System: ViewTankID = 0
----------------// "БАЗОВЫЙ ТАНК"
-----------------> Text_TankName: Set text to ArrayLang.At(Lang, 29)
-----------------> System: Set MaxLvl_Armor to 5
-----------------> System: Set MaxLvl_Fuel to 5
-----------------> System: Set MaxLvl_Damage to 5
----------------+ System: ViewTankID = 1
----------------// "ТЯЖЕЛЫЙ ШТУРМОВИК"
-----------------> Text_TankName: Set text to ArrayLang.At(Lang, 30)
-----------------> System: Set MaxLvl_Armor to 7
-----------------> System: Set MaxLvl_Fuel to 7
-----------------> System: Set MaxLvl_Damage to 7
----------------+ System: ViewTankID = 2
----------------// "ПЛАЗМЕННЫЙ УНИЧТОЖИТЕЛЬ"
-----------------> Text_TankName: Set text to ArrayLang.At(Lang, 31)
-----------------> System: Set MaxLvl_Armor to 10
-----------------> System: Set MaxLvl_Fuel to 10
-----------------> System: Set MaxLvl_Damage to 10
// полоски
----------------+ (no conditions)
--------------------+ System: TankStats.At(ViewTankID, 0) < MaxLvl_Armor
--------------------// уровень
---------------------> Text_Armor: Set text to ArrayLang.At(Lang, 9)
---------------------> Text_ArmorLvl: Set text to ArrayLang.At(Lang, 13) & " " & TankStats.At(ViewTankID, 0)
--------------------// улучшить
---------------------> Text_ArmorPrice: Set text to ArrayLang.At(Lang, 12) & newline & " " & RegexReplace(str(TankStats.At(ViewTankID, 0) × 100), "(\d)(?=(\d{3})+(?!\d))", "g", "$1 ")
--------------------+ System: Else
--------------------// "Броня: MAX"
---------------------> Text_ArmorLvl: Set text to ArrayLang.At(Lang, 9) & ": " & ArrayLang.At(Lang, 14)
---------------------> Text_ArmorPrice: Set text to ""
--------------------+ System: TankStats.At(ViewTankID, 1) < MaxLvl_Fuel
---------------------> Text_Fuel: Set text to ArrayLang.At(Lang, 10)
---------------------> Text_FuelLvl: Set text to ArrayLang.At(Lang, 13) & " " & TankStats.At(ViewTankID, 1)
---------------------> Text_FuelPrice: Set text to ArrayLang.At(Lang, 12) & newline & " " & RegexReplace(str(TankStats.At(ViewTankID, 1) × 100), "(\d)(?=(\d{3})+(?!\d))", "g", "$1 ")
--------------------+ System: Else
---------------------> Text_FuelLvl: Set text to ArrayLang.At(Lang, 10) & ": " & ArrayLang.At(Lang, 14)
---------------------> Text_FuelPrice: Set text to ""
--------------------+ System: TankStats.At(ViewTankID, 2) < MaxLvl_Damage
---------------------> Text_Damage: Set text to ArrayLang.At(Lang, 11)
---------------------> Text_DamageLvl: Set text to ArrayLang.At(Lang, 13) & " " & TankStats.At(ViewTankID, 2)
---------------------> Text_DamagePrice: Set text to ArrayLang.At(Lang, 12) & newline & " " & RegexReplace(str(TankStats.At(ViewTankID, 2) × 100), "(\d)(?=(\d{3})+(?!\d))", "g", "$1 ")
--------------------+ System: Else
---------------------> Text_DamageLvl: Set text to ArrayLang.At(Lang, 11) & ": " & ArrayLang.At(Lang, 14)
---------------------> Text_DamagePrice: Set text to ""
------------+ System: Else
------------// "СЕКРЕТНЫЙ ЧЕРТЕЖ"
-------------> Text_TankName: Set text to ArrayLang.At(Lang, 15)
------------// "В РАЗРАБОТКЕ..."
-------------> Text_TankAction: Set text to ArrayLang.At(Lang, 16)
-------------> Text_ArmorLvl: Set text to "?"
-------------> Text_DamageLvl: Set text to "?"
-------------> Text_FuelLvl: Set text to "?"
-------------> Text_ArmorPrice: Set text to ""
-------------> Text_DamagePrice: Set text to ""
-------------> Text_FuelPrice: Set text to ""
[ ─── ФУНКЦИИ ───]
----* On function 'UiUpgradeArmor'
--------+ System: ViewTankID < AvailableTanks
--------+ System: TankStats.At(ViewTankID, 3) = 1
--------+ System: TankStats.At(ViewTankID, 0) < MaxLvl_Armor
------------+ System: Coins ≥ TankStats.At(ViewTankID, 0) × 100
-------------> System: Subtract TankStats.At(ViewTankID, 0) × 100 from Coins
-------------> TankStats: Set value at (ViewTankID, 0) to TankStats.At(ViewTankID, 0) + 1
-------------> Functions: Call SaveProgress
------------+ System: Coins < TankStats.At(ViewTankID, 0) × 100
-------------> (no actions)
----* On function 'UiUpgradeFuel'
--------+ System: ViewTankID < AvailableTanks
--------+ System: TankStats.At(ViewTankID, 3) = 1
--------+ System: TankStats.At(ViewTankID, 1) < MaxLvl_Fuel
------------+ System: Coins ≥ TankStats.At(ViewTankID, 1) × 100
-------------> System: Subtract TankStats.At(ViewTankID, 1) × 100 from Coins
-------------> TankStats: Set value at (ViewTankID, 1) to TankStats.At(ViewTankID, 1) + 1
-------------> Functions: Call SaveProgress
------------+ System: Coins < TankStats.At(ViewTankID, 1) × 100
-------------> (no actions)
----* On function 'UiUpgradeDamage'
----+ System: ViewTankID < AvailableTanks
--------+ System: TankStats.At(ViewTankID, 3) = 1
--------+ System: TankStats.At(ViewTankID, 2) < MaxLvl_Damage
------------+ System: Coins ≥ TankStats.At(ViewTankID, 2) × 100
-------------> System: Subtract TankStats.At(ViewTankID, 2) × 100 from Coins
-------------> TankStats: Set value at (ViewTankID, 2) to TankStats.At(ViewTankID, 2) + 1
-------------> Functions: Call SaveProgress
------------+ System: Coins < TankStats.At(ViewTankID, 2) × 100
-------------> (no actions)
----* On function 'UiTankAction'
--------+ System: TankStats.At(ViewTankID, 3) = 0
------------+ System: Coins ≥ 10000
-------------> System: Subtract 10000 from Coins
-------------> TankStats: Set value at (ViewTankID, 3) to 1
--------+ System: TankStats.At(ViewTankID, 3) = 1
---------> System: Set CurrentTankID to ViewTankID
---------> Functions: Call SaveProgress
----* On function 'UiResetProgress'
-----> System: Set Coins to 30000
-----> System: Set LevelToPlay to 1
-----> System: Set CurrentTankID to 0
-----> System: Set ViewTankID to 0
-----> TankStats: Set size to (10, 4, 1)
--------+ System: For "TankID" from 0 to 9
--------// // Armor
---------> TankStats: Set value at (LoopIndex("TankID"), 0) to 1
--------// // Fuel
---------> TankStats: Set value at (LoopIndex("TankID"), 1) to 1
--------// // Damage
---------> TankStats: Set value at (LoopIndex("TankID"), 2) to 1
--------// // OwnsTank (0 = не куплен)
---------> TankStats: Set value at (LoopIndex("TankID"), 3) to 0
--------+ (no conditions)
---------> TankStats: Set value at (0, 3) to 1
---------> LocalStorage: Clear storage
---------> Functions: Call SaveProgress
----* On function 'UiBtnRight'
-----> System: Set ViewTankID to min(ViewTankID + 1, AvailableTanks - 1)
----* On function 'UiBtnLeft'
-----> System: Set ViewTankID to max(ViewTankID - 1, 0)
[МАГАЗИН]
// [ИНИЦИАЛИЗАЦИЯ КАРУСЕЛИ И ГЕНЕРАЦИЯ КАРТОЧЕК]
----+ System: On start of layout
-----> System: Set CarouselAnchorX to ViewportMidX("HUD") - 220
-----> UI_TankSlot: Destroy
-----> MenuTank: Destroy
-----> MenuBarrel: Destroy
--------+ System: For "i" from 0 to TotalTanks - 1
---------> System: Create object UI_TankSlot on layer "HUD" at (0, ViewportHeight("HUD") ÷ 1.2), create hierarchy: False, template: ""
---------> UI_TankSlot: Set ID to LoopIndex("i")
------------+ System: LoopIndex("i") < AvailableTanks
-------------> System: Create object MenuTank on layer "HUD" at (UI_TankSlot.X, UI_TankSlot.Y), create hierarchy: False, template: ""
-------------> [DISABLED] MenuTank: Pin Pin to UI_TankSlot (X: True, Y: True, angle: False, width: No, height: No, Z: False)
-------------> MenuTank: Set ID to LoopIndex("i")
-------------> MenuTank: Set animation to "Tank" & LoopIndex("i") (play from beginning)
-------------> [DISABLED] MenuTank: Set scale to 0.3
-------------> System: Create object MenuBarrel on layer "HUD" at (MenuTank.ImagePointX(1), MenuTank.ImagePointY(1)), create hierarchy: False, template: ""
-------------> [DISABLED] MenuBarrel: Pin Pin to MenuTank (X: True, Y: True, angle: True, width: No, height: No, Z: False)
-------------> MenuBarrel: Set ID to LoopIndex("i")
-------------> MenuBarrel: Set animation to "Barrel" & LoopIndex("i") (play from beginning)
-------------> [DISABLED] MenuBarrel: Set scale to 0.09
-------------> MenuBarrel: Set angle to 350 degrees
// ПЛАВНЫЙ СКРОЛЛ КАРУСЕЛИ И ВИЗУАЛ ВЫДЕЛЕНИЯ
| Local number targetX = 0
| Local number distFromCenter = 0
----+ System: Every tick
-----> System: Set CarouselAnchorX to ViewportMidX("HUD") - 220
----+ System: Every tick
----+ System: For each UI_TankSlot
--------+ System: Is IsCarouselDragging
---------> System: Set targetX to CarouselAnchorX + ((UI_TankSlot.ID - CarouselStartViewID) × CarouselSpacing) + CarouselDragOffsetX
--------+ System: Else
---------> System: Set targetX to CarouselAnchorX + ((UI_TankSlot.ID - ViewTankID) × CarouselSpacing)
--------+ (no conditions)
---------> UI_TankSlot: Set Y to ViewportBottom("HUD") - CarouselFromBottom
---------> UI_TankSlot: Set height to lerp(UI_TankSlot.Height, 150 × HangarS, 10 × dt)
---------> UI_TankSlot: Set X to lerp(UI_TankSlot.X, targetX, 15 × dt)
---------> System: Set distFromCenter to abs(UI_TankSlot.X - CarouselAnchorX)
--------+ System: distFromCenter < 20
---------> UI_TankSlot: Set scale to lerp(UI_TankSlot.Width ÷ UI_TankSlot.ImageWidth, 0.4, 10 × dt)
---------> UI_TankSlot: Set opacity to lerp(UI_TankSlot.Opacity, 100, 10 × dt)
--------+ System: distFromCenter ≥ 20
--------+ System: distFromCenter < 200
---------> UI_TankSlot: Set scale to lerp(UI_TankSlot.Width ÷ UI_TankSlot.ImageWidth, 0.3, 10 × dt)
---------> UI_TankSlot: Set opacity to lerp(UI_TankSlot.Opacity, 75, 10 × dt)
--------+ System: distFromCenter ≥ 200
--------+ System: distFromCenter < 380
---------> UI_TankSlot: Set scale to lerp(UI_TankSlot.Width ÷ UI_TankSlot.ImageWidth, 0.25, 10 × dt)
---------> UI_TankSlot: Set opacity to lerp(UI_TankSlot.Opacity, 50, 10 × dt)
--------+ System: distFromCenter ≥ 380
---------> UI_TankSlot: Set scale to lerp(UI_TankSlot.Width ÷ UI_TankSlot.ImageWidth, 0.2, 10 × dt)
---------> UI_TankSlot: Set opacity to lerp(UI_TankSlot.Opacity, 0, 10 × dt)
--------+ MenuTank: ID = UI_TankSlot.ID
--------+ MenuBarrel: ID = UI_TankSlot.ID
---------> MenuTank: Set position to (UI_TankSlot.X, UI_TankSlot.Y+30)
---------> MenuTank: Set scale to (UI_TankSlot.Width ÷ UI_TankSlot.ImageWidth) × 0.75
---------> MenuTank: Set opacity to UI_TankSlot.Opacity
---------> MenuBarrel: Set position to (MenuTank.ImagePointX(1), MenuTank.ImagePointY(1))
---------> MenuBarrel: Set scale to (UI_TankSlot.Width ÷ UI_TankSlot.ImageWidth) × 0.225
---------> MenuBarrel: Set opacity to UI_TankSlot.Opacity
[Запуск]
----+ System: Is IsDataLoaded
--------+ System: Every tick
---------> PlayerBarrel: Set position to PlayerTank (image point 1)
---------> PlayerBarrel: Pin Pin to PlayerTank (X: True, Y: True, angle: True, width: No, height: No, Z: False)
---------> PlayerBarrel: Set angle to 350 degrees
----+ System: Every tick
-----> PlayerTank: Set animation to "Tank" & ViewTankID (play from beginning)
-----> PlayerBarrel: Set animation to "Barrel" & ViewTankID (play from beginning)
----+ System: On start of layout
-----> LocalStorage: Check item "Coins" exists
-----> LocalStorage: Check item "TankStats" exists
----+ LocalStorage: On item "TankStats" missing
-----> TankStats: Set size to (10, 4, 1)
----+ LocalStorage: On item "TankStats" exists
-----> LocalStorage: Get item "TankStats"
----+ LocalStorage: On item "TankStats" get
-----> TankStats: Load from JSON string LocalStorage.ItemValue
[[КЛИК ПО ИКОНКЕ]]
----+ Touch: On any touch start
----+ Touch: Is touching UI_TankSlot
-----> System: Set ViewTankID to UI_TankSlot.ID
+ System: On start of layout
-> Rain: Destroy
-> SandWind: Destroy
-> snow: Destroy
-> SmokeTank: Destroy
-> DirtParticles: Destroy
-> tracer: Destroy
-> HomingSmoke: Destroy
[[[СВАЙП КАРУСЕЛИ]]]
// ═══ НАЧАЛО ПЕРЕТАСКИВАНИЯ (ТАЧ) ═══
----+ Touch: On any touch start
----+ Touch: Is touching UI_TankSlot
----+ System: [X] Is IsCarouselDragging
-----> System: Set IsCarouselDragging to True
-----> System: Set CarouselDragStartX to Touch.X
-----> System: Set CarouselDragOffsetX to 0
-----> System: Set CarouselStartViewID to ViewTankID
// ═══ НАЧАЛО ПЕРЕТАСКИВАНИЯ (МЫШЬ) ═══
----+ Mouse: Left button is down
----+ Mouse: Cursor is over UI_TankSlot
----+ System: [X] Is IsCarouselDragging
-----> System: Set IsCarouselDragging to True
-----> System: Set CarouselDragStartX to Mouse.X
-----> System: Set CarouselDragOffsetX to 0
-----> System: Set CarouselStartViewID to ViewTankID
// ═══ ПРОЦЕСС ПЕРЕТАСКИВАНИЯ ═══
----+ System: Every tick
----+ System: Is IsCarouselDragging
--------+ Touch: Is in touch
---------> System: Set CarouselDragOffsetX to Touch.X - CarouselDragStartX
--------+ Mouse: Left button is down
---------> System: Set CarouselDragOffsetX to Mouse.X - CarouselDragStartX
// ═══ ЗАВЕРШЕНИЕ: ТАЧ ═══
----+ Touch: On any touch end
----+ System: Is IsCarouselDragging
-----> System: Set IsCarouselDragging to False
--------+ System: abs(CarouselDragOffsetX) < 30
---------> System: Set ViewTankID to clamp(round((Touch.X - CarouselAnchorX) ÷ CarouselSpacing) + CarouselStartViewID, 0, TotalTanks - 1)
---------> System: Set CarouselDragOffsetX to 0
--------+ System: Else
------------+ System: CarouselDragOffsetX < -40
-------------> Functions: Call UiBtnRight
------------+ System: Else
-------------> Functions: Call UiBtnLeft
--------+ (no conditions)
---------> System: Set CarouselDragOffsetX to 0
// ═══ ЗАВЕРШЕНИЕ: МЫШЬ ═══
----+ Mouse: On Left button released
----+ System: Is IsCarouselDragging
-----> System: Set IsCarouselDragging to False
--------+ System: abs(CarouselDragOffsetX) < 30
---------> System: Set ViewTankID to clamp(round((Mouse.X - CarouselAnchorX) ÷ CarouselSpacing) + CarouselStartViewID, 0, TotalTanks - 1)
---------> System: Set CarouselDragOffsetX to 0
--------+ System: Else
------------+ System: CarouselDragOffsetX < -40
-------------> Functions: Call UiBtnRight
------------+ System: Else
-------------> Functions: Call UiBtnLeft
--------+ (no conditions)
---------> System: Set CarouselDragOffsetX to 0
[[[Ангар: старт]]]
----+ System: On start of layout
-----> BoomPuff: Destroy
-----> GlowPuff: Destroy
-----> Shockwave: Destroy
-----> FlashScreen: Destroy
-----> System: Set HangarMX to 0
-----> System: Set HangarMY to 0
-----> System: Set HangarShake to 0
-----> System: Set HangarRecoil to 0
-----> System: Set HangarSmokeTimer to 0
-----> System: Set recoilAmount to 0
-----> PlayerTank: Set animation to "Tank" (play from beginning)
-----> PlayerTank: Set Not mirrored
-----> PlayerTank: Set angle to 0 degrees
-----> PlayerTank: Spawn PlayerBarrel on layer "HObjects|" (image point 0, create hierarchy: False, template: "")
-----> PlayerBarrel: Set animation to "Barrel" (play from beginning)
-----> PlayerBarrel: Set scale to 0.2
-----> PlayerBarrel: Pin Pin to PlayerTank (image point 1, angle: False, width: No, height: No, Z: False)
-----> PlayerBarrel: Set angle to 0 degrees
[[Ангар: источник параллакса (мышь или палец)]]
----+ System: Every tick
----+ Touch: Is in touch
-----> System: Set SampleX to Touch.X
-----> System: Set SampleY to Touch.Y
----+ System: Every tick
----+ Touch: [X] Is in touch
-----> System: Set SampleX to Mouse.X
-----> System: Set SampleY to Mouse.Y
----+ System: Every tick
-----> System: Set HangarMX to lerp(HangarMX, clamp((SampleX - ViewportMidX("HUD")) ÷ (ViewportWidth("HUD") ÷ 2), -1, 1), 4 × dt)
-----> System: Set HangarMY to lerp(HangarMY, clamp((SampleY - ViewportMidY("HUD")) ÷ (ViewportHeight("HUD") ÷ 2), -1, 1), 4 × dt)
[[[Ангар: общий трансформ (cover — полоски невозможны)]]]
----+ System: Every tick
-----> System: Set HangarS to max(ViewportWidth("HObjects") ÷ HangarBG.ImageWidth, ViewportHeight("HObjects") ÷ HangarBG.ImageHeight) × 1.06
-----> System: Set HangarCX to ViewportMidX("HUD") + random(-HangarShake, HangarShake) × 0.4
-----> System: Set HangarCY to ViewportBottom("HUD") - (HangarBG.ImageHeight × HangarS) ÷ 2 + random(-HangarShake, HangarShake) × 0.4
-----> System: Set HangarShake to lerp(HangarShake, 0, 0.12)
-----> System: Set HangarRecoil to lerp(HangarRecoil, 0, 8 × dt)
-----> System: Set recoilAmount to lerp(recoilAmount, 0, 6 × dt)
[[Ангар: танк и дуло (дуло поднято на 15 градусов)]]
----+ System: Every tick
-----> PlayerTank: Set position to (HangarCX + 50 - 270 - HangarRecoil, (ViewportBottom("HUD") - 180) - 25)
-----> PlayerTank: Set angle to 0 degrees
-----> PlayerBarrel: Set angle to (-15 - recoilAmount) degrees
[[Ангар: гарантия существования танка и платформы]]
----+ System: On start of layout
----+ System: HangarPlatform.Count = 0
-----> System: Create object HangarPlatform on layer "HangarPlatform" at (640, 460), create hierarchy: False, template: ""
----+ System: On start of layout
----+ System: PlayerTank.Count = 0
-----> System: Create object PlayerTank on layer "HObjects" at (640, 460), create hierarchy: False, template: ""
----+ System: On start of layout
----+ System: PlayerBarrel.Count = 0
-----> PlayerTank: Spawn PlayerBarrel on layer "HObjects" (image point 0, create hierarchy: False, template: "")
-----> PlayerBarrel: Pin Pin to PlayerTank (image point 1, angle: False, width: No, height: No, Z: False)
-----> PlayerBarrel: Set angle to -15 degrees
[[Ангар: 7 слоёв параллакса (глубина растёт к камере)]]
----+ System: Every tick
-----> HangarBG: Set scale to HangarS
-----> HangarBG: Set position to (HangarCX - HangarMX × 5, HangarCY - HangarMY × 2)
-----> HangarPillarsFar: Set scale to HangarS
-----> HangarPillarsFar: Set position to (HangarCX - HangarMX × 9, HangarCY - HangarMY × 3)
-----> HangarPipes: Set scale to HangarS
-----> HangarPipes: Set position to (HangarCX - HangarMX × 14, HangarCY - HangarMY × 5)
-----> HangarPillars: Set scale to HangarS
-----> HangarPillars: Set position to (HangarCX - HangarMX × 19, HangarCY - HangarMY × 7)
-----> HangarLamps: Set scale to HangarS
-----> HangarLamps: Set position to (HangarCX - HangarMX × 24, HangarCY - HangarMY × 8)
-----> HangarBench: Set scale to HangarS
-----> HangarBench: Set position to (HangarCX - HangarMX × 30, HangarCY - HangarMY × 10)
-----> HangarPlatform: Set scale to HangarS
-----> HangarPlatform: Set position to (HangarCX + 50, (ViewportBottom("HUD") - 200))
[[Ангар: большие клубы пыли (дальний план)]]
----+ System: Every 0.7 seconds
----+ System: random(100) < 70
-----> System: Create object BoomPuff on layer "HDustBack" at (ViewportLeft("HDustBack") + random(0, ViewportWidth("HDustBack")), ViewportTop("HDustBack") + random(ViewportHeight("HDustBack") × 0.2, ViewportHeight("HDustBack") × 0.95)), create hierarchy: False, template: ""
-----> BoomPuff: Set Type to 7
-----> BoomPuff: Set Age to 0
-----> BoomPuff: Set Life to random(8, 14)
-----> BoomPuff: Set T to 0
-----> BoomPuff: Set vx to random(-18, 18)
-----> BoomPuff: Set vy to random(-3, 3)
-----> BoomPuff: Set Grav to random(-5, -0)
-----> BoomPuff: Set PuffScale to random(5.6, 8.4)
-----> BoomPuff: Set scale to Self.PuffScale
-----> BoomPuff: Set MaxOp to random(20, 40)
-----> BoomPuff: Set angle to random(0, 360) degrees
-----> BoomPuff: Set Spin to random(-10, 10)
-----> BoomPuff: Set color to rgb(140, 125, 135)
-----> BoomPuff: Move to bottom of layer
[[Ангар: выхлоп из трубы]]
----+ System: Every 0.15 seconds
-----> System: Create object BoomPuff on layer "HObjects" at (PlayerTank.ImagePointX(6) + random(-2, 2), PlayerTank.ImagePointY(6) + random(-2, 2)), create hierarchy: False, template: ""
-----> BoomPuff: Set Type to 7
-----> BoomPuff: Set Age to 0
-----> BoomPuff: Set Life to random(2.0, 3.5)
-----> BoomPuff: Set T to 0
-----> BoomPuff: Set vx to random(-35, -0)
-----> BoomPuff: Set vy to -random(50, 75)
-----> BoomPuff: Set PuffScale to random(0.5, 1.5)
-----> BoomPuff: Set scale to Self.PuffScale
-----> BoomPuff: Set MaxOp to 50
-----> BoomPuff: Set angle to random(0, 360) degrees
-----> BoomPuff: Set Spin to random(-60, 60)
-----> BoomPuff: Set color to rgb(70, 70, 75)
-----> BoomPuff: Move to top of layer
[[Ангар: выстрел по тапу вне кнопок]]
----+ Touch: On any touch start
----+ System: wallclocktime > LastHangarShot + 0.9
----+ Touch: [X] Is touching BtnPlay
----+ Touch: [X] Is touching BtnSettings
----+ Touch: [X] Is touching Btn_coins
----+ Touch: [X] Is touching BtnUpgradeArmor
----+ Touch: [X] Is touching BtnUpgradeDamage
----+ Touch: [X] Is touching BtnUpgradeFuel
----+ Touch: [X] Is touching BtnTankAction
----+ Touch: [X] Is touching BtnArrowRight
----+ Touch: [X] Is touching BtnArrowLeft
----+ Touch: [X] Is touching BtnResetProgress
----+ Touch: [X] Is touching UI_TankSlot
----+ Touch: [X] Is touching UI_menu
----+ Touch: [X] Is touching BtnLang
----+ Touch: [X] Is touching BtnSound
----+ Touch: [X] Is touching BtnCloseSettings
----+ Touch: [X] Is touching SettingsPanel
----+ System: IsSettingsOpen = 0
-----> System: Set LastHangarShot to wallclocktime
-----> System: Set HangarShake to 14
-----> System: Set HangarRecoil to 26
-----> System: Set HangarSmokeTimer to 1.5
-----> System: Set recoilAmount to 10
-----> System: Create object FlashScreen on layer "HUD" at (ViewportMidX("HUD"), ViewportMidY("HUD")), create hierarchy: False, template: ""
-----> FlashScreen: Set size to (ViewportWidth("HUD") + 200, ViewportHeight("HUD") + 200)
-----> FlashScreen: Set opacity to 10
----// белое ядро вспышки
-----> System: Create object BoomPuff on layer "HObjects" at (PlayerBarrel.ImagePointX(1), PlayerBarrel.ImagePointY(1)), create hierarchy: False, template: ""
-----> BoomPuff: Set Type to 10
-----> BoomPuff: Set Age to 0
-----> BoomPuff: Set Life to 1
-----> BoomPuff: Set T to 0
-----> BoomPuff: Set vx to 0
-----> BoomPuff: Set vy to 0
-----> BoomPuff: Set PuffScale to 0.6
-----> BoomPuff: Set scale to Self.PuffScale
-----> BoomPuff: Set color to rgb(210, 105, 30)
-----> BoomPuff: Set opacity to 100
----// аддитивная звезда-зарево
-----> System: Create object GlowPuff on layer "HObjects" at (PlayerBarrel.ImagePointX(1), PlayerBarrel.ImagePointY(1)), create hierarchy: False, template: ""
-----> GlowPuff: Set Age to 0
-----> GlowPuff: Set Life to 0.25
-----> GlowPuff: Set T to 0
-----> GlowPuff: Set vx to 0
-----> GlowPuff: Set vy to 0
-----> GlowPuff: Set PuffScale to 0.9
-----> GlowPuff: Set Grow to 8
-----> GlowPuff: Set color to rgb(255, 190, 80)
-----> GlowPuff: Set opacity to 90
----// ударная волна
-----> System: Create object Shockwave on layer "HObjects" at (PlayerBarrel.ImagePointX(1), PlayerBarrel.ImagePointY(1)), create hierarchy: False, template: ""
-----> Shockwave: Set width to 30
-----> Shockwave: Set height to 30
-----> Shockwave: Set opacity to 80
// клубы дыма вдоль дула
--------+ System: Repeat 14 times
---------> System: Create object BoomPuff on layer "HObjects" at (PlayerBarrel.ImagePointX(1) + cos(PlayerBarrel.Angle) × LoopIndex × 12, PlayerBarrel.ImagePointY(1) + sin(PlayerBarrel.Angle) × LoopIndex × 12), create hierarchy: False, template: ""
---------> BoomPuff: Set Type to 7
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to 0.5 + LoopIndex × 0.09
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to cos(PlayerBarrel.Angle) × random(60, 140)
---------> BoomPuff: Set vy to sin(PlayerBarrel.Angle) × random(60, 140) - random(10, 25)
---------> BoomPuff: Set PuffScale to random(1.35, 1.7)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set angle to random(0, 360) degrees
---------> BoomPuff: Set Spin to random(-160, 160)
---------> BoomPuff: Set color to rgb(169, 169, 169)
---------> BoomPuff: Set MaxOp to 70
// огненные искры
--------+ System: Repeat 20 times
---------> System: Create object BoomPuff on layer "HObjects" at (PlayerBarrel.ImagePointX(1), PlayerBarrel.ImagePointY(1)), create hierarchy: False, template: ""
---------> BoomPuff: Set blend mode to Additive
---------> BoomPuff: Set Type to 6
---------> BoomPuff: Set Age to 0
---------> BoomPuff: Set Life to random(0.2, 0.5)
---------> BoomPuff: Set T to 0
---------> BoomPuff: Set vx to cos(PlayerBarrel.Angle + random(-14, 14)) × random(250, 550)
---------> BoomPuff: Set vy to sin(PlayerBarrel.Angle + random(-14, 14)) × random(250, 550)
---------> BoomPuff: Set PuffScale to random(0.12, 0.4)
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set color to rgb(250, 220, 90)
---------> BoomPuff: Set MaxOp to 100
// [[Ангар: затухание вспышки]]
----+ System: Every tick
----+ System: For each FlashScreen
-----> FlashScreen: Set opacity to FlashScreen.Opacity - (5000 × dt)
--------+ FlashScreen: Opacity ≤ 0
---------> FlashScreen: Destroy
// [Ангар: дымление дула после выстрела]
----+ System: Every 0.06 seconds
----+ System: HangarSmokeTimer > 0
-----> System: Subtract 0.06 from HangarSmokeTimer
-----> System: Create object BoomPuff on layer "HObjects" at (PlayerBarrel.ImagePointX(1) + random(-3, 3), PlayerBarrel.ImagePointY(1) + random(-3, 3)), create hierarchy: False, template: ""
-----> BoomPuff: Set Type to 7
-----> BoomPuff: Set Age to 0
-----> BoomPuff: Set Life to random(0.8, 1.5)
-----> BoomPuff: Set T to 0
-----> BoomPuff: Set vx to random(-10, 10)
-----> BoomPuff: Set vy to -random(15, 35)
-----> BoomPuff: Set PuffScale to random(0.25, 0.45)
-----> BoomPuff: Set scale to Self.PuffScale
-----> BoomPuff: Set angle to random(0, 360) degrees
-----> BoomPuff: Set Spin to random(-90, 90)
-----> BoomPuff: Set color to rgb(90, 90, 95)
-----> BoomPuff: Set MaxOp to 45
// [Ангар: апдейтеры партиклов (копия боевых типов 6/7/10)]
----+ System: Every tick
----+ System: For each BoomPuff
--------+ BoomPuff: Type = 7
---------> BoomPuff: Set Age to Self.Age + dt
---------> BoomPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
---------> BoomPuff: Set X to Self.X + Self.vx × dt
---------> BoomPuff: Set Y to Self.Y + Self.vy × dt
---------> BoomPuff: Set vy to Self.vy + Self.Grav × dt
---------> BoomPuff: Set vx to Self.vx × max(0, 1 - 2.5 × dt)
---------> BoomPuff: Set angle to Self.Angle + Self.Spin × dt degrees
---------> BoomPuff: Set PuffScale to Self.PuffScale + 0.4 × dt
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set opacity to Self.MaxOp × sin(Self.T × 180)
------------+ BoomPuff: Age ≥ Self.Life
-------------> BoomPuff: Destroy
--------+ BoomPuff: Type = 6
---------> BoomPuff: Set Age to Self.Age + (dt ÷ timescale)
---------> BoomPuff: Set vy to Self.vy + 600 × (dt ÷ timescale)
---------> BoomPuff: Set X to Self.X + Self.vx × (dt ÷ timescale)
---------> BoomPuff: Set Y to Self.Y + Self.vy × (dt ÷ timescale)
---------> BoomPuff: Set opacity to 100 × clamp((Self.Life - Self.Age) ÷ 0.2, 0, 1)
--------+ BoomPuff: Type = 10
---------> BoomPuff: Set Age to Self.Age + (dt ÷ timescale)
---------> BoomPuff: Set PuffScale to Self.PuffScale + (0.2 × (dt ÷ timescale))
---------> BoomPuff: Set scale to Self.PuffScale
---------> BoomPuff: Set opacity to 50 × clamp((1 - Self.T) ÷ 0.6, 0, 1)
---------> BoomPuff: Set color to rgb(lerp(255, 15, clamp((Self.T - 0.45) ÷ 0.4, 0, 1)), lerp(255, 12, clamp((Self.T - 0.45) ÷ 0.4, 0, 1)), lerp(240, 10, clamp((Self.T - 0.45) ÷ 0.4, 0, 1)))
--------+ BoomPuff: Age ≥ Self.Life
---------> BoomPuff: Destroy
+ System: Every tick
+ System: For each BoomPuff
+ BoomPuff: Spin ≠ 0
-> BoomPuff: Set angle to Self.Angle + (Self.Spin × (dt ÷ timescale)) degrees
+ System: Every tick
+ System: For each GlowPuff
-> GlowPuff: Set Age to Self.Age + (dt ÷ timescale)
-> GlowPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
-> GlowPuff: Set X to Self.X + Self.vx × (dt ÷ timescale)
-> GlowPuff: Set Y to Self.Y + Self.vy × (dt ÷ timescale)
-> GlowPuff: Set PuffScale to Self.PuffScale + Self.Grow × (dt ÷ timescale)
-> GlowPuff: Set scale to Self.PuffScale
-> GlowPuff: Set opacity to 100 × clamp((1 - Self.T) ÷ 0.5, 0, 1)
----+ GlowPuff: Age ≥ Self.Life
-----> GlowPuff: Destroy
+ System: Every tick
+ System: For each Shockwave
-> Shockwave: Set height to Shockwave.Height + (1000 × dt)
-> Shockwave: Set width to Shockwave.Width + (1000 × dt)
-> Shockwave: Set opacity to Shockwave.Opacity - (250 × dt)
----+ Shockwave: Opacity ≤ 0
-----> Shockwave: Destroy
[[Ангар: гало ламп (image points)]]
----+ System: On start of layout
--------+ System: For "lamp" from 1 to HangarLamps.ImagePointCount
--------+ System: LoopIndex("lamp") ≠ 7
---------> System: Create object GlowPuff on layer "HangarLamps" at (HangarLamps.ImagePointX(LoopIndex("lamp")), HangarLamps.ImagePointY(LoopIndex("lamp"))), create hierarchy: False, template: ""
---------> GlowPuff: Set animation to "Cone" (play from beginning)
---------> GlowPuff: Set Age to 0
---------> GlowPuff: Set Life to 9999
---------> GlowPuff: Set T to 0
---------> GlowPuff: Set vx to LoopIndex("lamp")
---------> GlowPuff: Set vy to 0
---------> GlowPuff: Set PuffScale to 1
---------> GlowPuff: Set Grow to 0
---------> GlowPuff: Set blend mode to Normal
---------> GlowPuff: Set color to rgb(255, 200, 120)
---------> GlowPuff: Set opacity to 30
---------> GlowPuff: Set angle to 0 degrees
----+ System: On start of layout
-----> System: Create object GlowPuff on layer "HangarLamps" at (HangarLamps.ImagePointX(7), HangarLamps.ImagePointY(7)), create hierarchy: False, template: ""
-----> GlowPuff: Set animation to "Cone2" (play from beginning)
-----> GlowPuff: Set Age to 0
-----> GlowPuff: Set Life to 9999
-----> GlowPuff: Set T to 0
-----> GlowPuff: Set vx to 707
-----> GlowPuff: Set vy to 0
-----> GlowPuff: Set PuffScale to 1
-----> GlowPuff: Set Grow to 0
-----> GlowPuff: Set blend mode to Normal
-----> GlowPuff: Set color to rgb(255, 200, 120)
-----> GlowPuff: Set opacity to 30
-----> GlowPuff: Set angle to 0 degrees
// [Ангар: дельта смещения слоя ламп]
----+ System: Every tick
-----> System: Set LampDX to (HangarCX - HangarMX × 24) - LampPrevX
-----> System: Set LampDY to (HangarCY - HangarMY × 8) - LampPrevY
-----> System: Set LampPrevX to HangarCX - HangarMX × 24
-----> System: Set LampPrevY to HangarCY - HangarMY × 8
// [Ангар: пылинки приклеены к лампе]
----+ System: Every tick
----+ System: For each BoomPuff
----+ BoomPuff: Grav = 12
-----> BoomPuff: Set X to Self.X + LampDX
-----> BoomPuff: Set Y to Self.Y + LampDY
// [Ангар: пылинки в конусе]
| Local number lampI = 0
----+ System: Every 0.12 seconds
----+ System: random(100) < 100
-----> System: Set lampI to int(random(1, HangarLamps.ImagePointCount))
-----> System: Create object BoomPuff on layer "HangarLamps" at (HangarLamps.ImagePointX(lampI) + random(-2, 2), HangarLamps.ImagePointY(lampI) + random(0, 2)), create hierarchy: False, template: ""
-----> BoomPuff: Set Type to 7
-----> BoomPuff: Set Age to 0
-----> BoomPuff: Set Life to random(1.2, 2.2)
-----> BoomPuff: Set T to 0
-----> BoomPuff: Set vx to random(-4, 4)
-----> BoomPuff: Set vy to random(4, 10)
-----> BoomPuff: Set Grav to 12
-----> BoomPuff: Set PuffScale to random(0.01, 0.01)
-----> BoomPuff: Set scale to Self.PuffScale
-----> BoomPuff: Set MaxOp to random(35, 60)
-----> BoomPuff: Set angle to random(0, 360) degrees
-----> BoomPuff: Set Spin to random(-40, 40)
-----> BoomPuff: Set blend mode to Additive
-----> BoomPuff: Set color to rgb(255, 210, 140)
-----> BoomPuff: Set opacity to 10
// [Ангар: конус приклеен к лампе]
----+ System: Every tick
----+ System: For each GlowPuff
-----> GlowPuff: Set Age to Self.Age + (dt ÷ timescale)
-----> GlowPuff: Set T to clamp(Self.Age ÷ Self.Life, 0, 1)
--------+ GlowPuff: Life < 1000
---------> GlowPuff: Set X to Self.X + Self.vx × (dt ÷ timescale)
---------> GlowPuff: Set Y to Self.Y + Self.vy × (dt ÷ timescale)
---------> GlowPuff: Set PuffScale to Self.PuffScale + Self.Grow × (dt ÷ timescale)
---------> GlowPuff: Set scale to Self.PuffScale
---------> GlowPuff: Set opacity to 100 × clamp((1 - Self.T) ÷ 0.5, 0, 1)
----+ System: Every tick
----+ System: For each GlowPuff
----+ GlowPuff: Age ≥ Self.Life
-----> GlowPuff: Destroy
// [Ангар: конус приклеен к лампе]
----+ System: Every tick
----+ System: For each GlowPuff
----+ GlowPuff: vx < 100
-----> GlowPuff: Set angle to 0 degrees
-----> GlowPuff: Set position to (HangarLamps.ImagePointX(Self.vx), HangarLamps.ImagePointY(Self.vx))
-----> GlowPuff: Set size to (500 × HangarS, 350 × HangarS)
-----> GlowPuff: Set opacity to 10
// [Ангар: конус 7 — широкий]
----+ System: Every tick
----+ System: For each GlowPuff
----+ GlowPuff: vx = 707
-----> GlowPuff: Set angle to 0 degrees
-----> GlowPuff: Set position to (HangarLamps.ImagePointX(7), HangarLamps.ImagePointY(7))
-----> GlowPuff: Set size to (500 × HangarS, 540 × HangarS)
-----> GlowPuff: Set opacity to 20 × Lamp7Dim
----[[Ангар: мерцание светильников]]
--------+ System: Every 0.12 seconds
--------+ System: random(100) < 25
---------> System: Set Lamp7Dim to choose(0.00, 0.15, 0.3, 1.5)
--------+ System: Else
---------> System: Set Lamp7Dim to 1
[[Ангар: кнопки закреплены]]
----+ System: Every tick
-----> BtnArrowLeft: Set position to (ViewportMidX("HUD") - 300 - ArrowDist × HangarS, ViewportBottom("HUD") - 300)
-----> BtnArrowRight: Set position to (ViewportMidX("HUD") - 180 + ArrowDist × HangarS, ViewportBottom("HUD") - 300)
-----> BtnSettings: Set position to (ViewportLeft("HUD") + BtnSettings.Width ÷ 2 + 20, ViewportTop("HUD") + BtnSettings.Height ÷ 2 + 20)
-----> BtnPlay: Set position to (ViewportRight("HUD") - BtnPlay.Width ÷ 2 - 30, ViewportBottom("HUD") - BtnPlay.Height ÷ 2 - 30)
-----> img_coin: Set position to (ViewportRight("HUD") - (img_coin.Width ÷ 2) - 20, ViewportTop("HUD") + (img_coin.Height ÷ 2) + 20)
-----> fon_nameTank: Set position to (ViewportMidX("HUD") - 220 - 210, PlayerTank.Y - 300)
-----> BtnTankAction: Set position to (ViewportMidX("HUD") - 220 + 50, PlayerTank.Y - 300)
-----> UI_menu: Set position to (ViewportRight("HUD") - UI_menu.Width ÷ 2 - 20, ViewportMidY("HUD") - UI_menu.Height ÷ 2+10)
[[[Ангар: HTML-бары статов]]]
----+ System: On start of layout
-----> ArmorBar_BG: Set visibility Invisible
-----> ArmorBar_Fill: Set visibility Invisible
-----> FuelBar_BG: Set visibility Invisible
-----> FuelBar_Fill: Set visibility Invisible
-----> DamageBar_BG: Set visibility Invisible
-----> DamageBar_Fill: Set visibility Invisible
----+ System: Is IsDataLoaded
--------+ System: Every tick
---------> System: Set ProgressArmor to min((ViewTankID × 4) + TankStats.At(ViewTankID, 0), 50) ÷ 50 × 100
---------> System: Set ProgressFuel to min((ViewTankID × 4) + TankStats.At(ViewTankID, 1), 50) ÷ 50 × 100
---------> System: Set ProgressDamage to min((ViewTankID × 4) + TankStats.At(ViewTankID, 2), 50) ÷ 50 × 100
---------> System: Set ArmorMaxed to TankStats.At(ViewTankID, 0) >= MaxLvl_Armor
---------> System: Set FuelMaxed to TankStats.At(ViewTankID, 1) >= MaxLvl_Fuel
---------> System: Set DamageMaxed to TankStats.At(ViewTankID, 2) >= MaxLvl_Damage
---------> Run JavaScript: if(window.setBarProgress){setBarProgress('fillArmor','textArmor',runtime.globalVars.ProgressArmor,runtime.globalVars.ArmorMaxed);setBarProgress('fillFuel','textFuel',runtime.globalVars.ProgressFuel,runtime.globalVars.FuelMaxed);setBarProgress('fillDamage','textDamage',runtime.globalVars.ProgressDamage,runtime.globalVars.DamageMaxed);}
// [Закрепление каждый тик]
+ System: Every tick
+ System: IsSettingsOpen = 1
-> SettingsPanel: Set position to (ViewportMidX(SettingsLayer), ViewportMidY(SettingsLayer))
-> BtnSound: Set position to (SettingsPanel.BBoxMidX - 100, SettingsPanel.Y + 10)
-> BtnLang: Set position to (SettingsPanel.BBoxMidX + 100, SettingsPanel.Y + 10)
-> BtnSurrender: Set position to (SettingsPanel.BBoxMidX + 100, SettingsPanel.Y + 10)
-> BtnCloseSettings: Set position to (SettingsPanel.X + (SettingsPanel.Width ÷ 2) - 25, SettingsPanel.Y - (SettingsPanel.Height ÷ 2) + 25)
+ System: Every tick
+ System: IsSettingsOpen = 0
-> SettingsPanel: Set position to (ViewportMidX(SettingsLayer), ViewportMidY(SettingsLayer)+500)
-> BtnSound: Set position to (SettingsPanel.BBoxMidX - 100, SettingsPanel.Y + 10)
-> BtnLang: Set position to (SettingsPanel.BBoxMidX + 100, SettingsPanel.Y + 10)
-> BtnSurrender: Set position to (SettingsPanel.BBoxMidX + 100, SettingsPanel.Y + 10)
-> BtnCloseSettings: Set position to (SettingsPanel.X + (SettingsPanel.Width ÷ 2) - 25, SettingsPanel.Y - (SettingsPanel.Height ÷ 2) + 25)
//Global sheet
| Global number obstacleHeight = 0
| Global number midY = 0
| Global number terrainTop = 0
| Global number scanX = 0
| Global number BlastExcludeUID = 0
| Global number ProgressAir = 0
| Global number ProgressFuelGame = 0
| Global number ProgressBotHP = 0
| Global number ProgressPlayerHP = 0
| Global number MenuIsSwiping = 0
| Global number MenuSwipeStartX = 0
| Global number MenuSwipeStartY = 0
| Global number MenuDidScroll = 0
| Global number WeaponMaxScrollX = 0
| Global number DescWeaponID = 0
| Global number TouchStartX_Menu = 0
| Global number WeaponScrollX = 0
| Global number WepLoaded = 0
| Global number IsSettingsOpen = 0
| Global string SettingsLayer = "UI"
| Global number Surrendered = 0
| Global number SoundEnabled = 1
| Global number LangLoaded = 0
| Global number Lang = 1
| Global number DamageMaxed = 0
| Global number FuelMaxed = 0
| Global number ArmorMaxed = 0
| Global number ProgressDamage = 0
| Global number ProgressFuel = 0
| Global number ProgressArmor = 0
| Global number CarouselFromBottom = 100
| Global number ArrowDist = 300
| Global number Lamp7Dim = 0
| Global number LampPrevY = 0
| Global number LampDX = 0
| Global number LampDY = 0
| Global number LampPrevX = 0
| Global number LampDim = 0
| Global number PlatformFromBottom = 200
| Global number LastHangarShot = -10
| Global number HangarSmokeTimer = 0
| Global number HangarShake = 0
| Global number HangarRecoil = 0
| Global number HangarFloorY = 0
| Global number HangarMY = 0
| Global number HangarMX = 0
| Global number HangarCY = 0
| Global number HangarCX = 0
| Global number HangarS = 0
| Global number VolcanoTimer = 0
| Global number CarouselStartViewID = 0
| Global number CarouselDragOffsetX = 0
| Global number CarouselDragStartX = 0
| Global boolean IsCarouselDragging = false
| Global boolean IsVolcanoActive = false
| Global boolean IsTripleBurstActive = false
| Global number TB_ShotsLeft = 0
| Global number TB_SavedAngle = 0
| Global number TB_SavedPower = 0
| Global boolean IsBoomerangActive = false
| Global number IsSwarmActive = 0
| Global number TouchStartY_Menu = 0
| Global number WeaponScrollY = 0
| Global boolean IsAirstrikeActive = false
| Global number ShotTimer = 0
| Global string ActivePlayer = Player1
| Global number localAngle = 0
| Global number BotAimSpeed = 0.1
| Global number IsShooting = 0
| Global number recoilAmount = 0
| Global boolean isRecoiling = false
| Global number slideRecoil = 0
| Global number BotTimer = 0
| Global number BotPowerTarget = 60
| Global number BotMoveTargetX = 0
| Global number BotAimOffset = 0
| Global number BotMoveDir = 0
| Global number BotDifficulty = 1
| Global number BotPowerError = 18
| Global number BotState = 0
| Global number BotShootDelay = 1.2
| Global number BotMoveRange = 120
| Global number BotMoveSpeed = 120
| Global number BotMoveMaxTime = 1.2
| Global number BotFireAngleTolerance = 6
| Global number BotAimError = 12
| Global number BotCalculatedPower = 0
| Global number LastShotError = 0
| Global number BotCalculatedAngle = 0
| Global number PredictFactor = 0
| Global number BotLastHitX = 0
| Global number BotLastError = 0
| Global number IsBotControlled = 0
| Global number TX = 0
| Global number TY = 0
| Global number SampleX = 0
| Global number SampleY = 0
| Global number DistX = 0
| Global number HomingTimer = 0
// камера
| Global number CamTargetX = 0
| Global number CamTargetY = 0
| Global number CamState = 0
| Global number CamSpeed = 5
// // Насколько сильно приблизить (1 = норм, 0.5 = отдалить, 1.5 = приблизить)
| Global number ShakePower = 0
// тряска экрана
| Global number CamTargetZoom = 1
// сколько ходов сделали игроки, чтобы на 3-й ход сбросить ящик
| Global number TurnsCount = 0
// эмоция ссмайлики
| Global boolean BotDidHit = false
| Global boolean BotGotHit = false
| Global number EmotionID = 0
| Global number targetAngle = 0
| Global number botAngle = 0
| Global number botLocalAngle = 0
| Global number botTargetAngle = 0
| Global number aimDiff = 0
| Global number botAimDiff = 0
| Global boolean IsAimingTouch = false
| Global number AimStartX = 0
| Global number AimStartY = 0
| Global boolean Charging = false
| Global number Power = 50
| Global number MaxPower = 100
| Global number ChargeSpeed = 150
| Global boolean CancelShot = false
// // переменные огня
| Global number FireRadius = 5
| Global number BurnDuration = 3
| Global number FireDamage = 5
| Global number FireSpreadRate = 0.5
| Global number FireSpreadX = 0
| Global number FireSpreadY = 0
| Global number FireDist = 0
| Global number TileX = 0
| Global number TileY = 0
| Global number CheckDist = 0
| Global number TilesPerCheck = 8
| Global number ClusterPeakY = 0
| Global boolean IsClusterActive = false
// Пулеметная очередь
| Global number MG_SavedPower = 0
| Global number MG_SavedAngle = 0
| Global number MG_BulletsLeft = 0
| Global boolean IsMachineGunActive = false
// Отдельная настройка силы (Запоминание Power)
| Global number P1_SavedPower = 50
| Global number P2_SavedPower = 50
| Global number TrajDotsCount = 15
// пунктирная линия
| Global number TrajOffset = 0
// система экономики
| Global number Lvl_Armor = 1
| Global number Lvl_Fuel = 1
| Global number Lvl_Damage = 1
| Global number Coins = 30000
| Global number CurrentProjectileType = 0
| Global boolean IsWeaponMenuOpen = false
// результат боя
| Global string MatchResult =
| Global string CurrentLevel =
| Global number LevelToPlay = 1
// уровень танков
| Global number MaxLvl_Fuel = 5
| Global number MaxLvl_Damage = 5
| Global number MaxLvl_Armor = 5
// (0 — базовый танк, 1 — продвинутый, 2 — тяжелый и т.д.)
| Global number CurrentTankID = 0
// время раунда
| Global number MatchTime = 0
// покупка танков
| Global number ViewTankID = 0
| Global boolean OwnsTank_1 = false
// меню оружии
| Global number MenuTargetX = 0
// флаг загрузки
| Global boolean IsDataLoaded = false
// напрвление танка
| Global number FacingDirection = 1
// Умный бот: арсенал
| Global number BotWeapon1 = 0
| Global number BotWeapon2 = 0
| Global number BotWeapon3 = 0
| Global boolean BotShouldHoldPosition = false
| Global number BotLastHitPower = 0
| Global number BotDirectAim = 0
| Global number BotLastHitAngle = 0
| Global number BotCurrentWeapon = 0
| Global number P1_SavedWeapon = 0
| Global number BotShotPower = 0
| Global boolean BotWasStuck = false
| Global number BotLastWeapon = -1
| Global number LastSwapTime = -10
| Global number LastUiClickTime = -10
| Global number SwapPending = 0
| Global number BotWeapon4 = 0
// снаряд фонтан
| Global boolean IsFountainActive = false
| Global string DeathOwner = ""
| Global number DeathUID = 0
| Global number DeathPointY = 0
| Global number DeathPointX = 0
// ваываы
| Global number TextureScale = 2
// камера
| Global number MaxDuelDist = 0
// ручной зум
| Global number TargetManualZoom = 1
| Global number MinZoom = 1
| Global number MaxZoom = 2
| Global number PrevPinchDist = 0
| Global boolean IsPinching = false
| Global number ManualZoom = 1
| Global number IntroTimer = 0
// темы оформления
| Global number SkyID = 0
| Global number ThemeHasGrass = 0
| Global number ColGround1 = 0
| Global number ColGround2 = 0
| Global number ColBurnGlow = 0
| Global number ColBurnGround = 0
| Global number ColSpotDark = 0
| Global number ColSpotLight = 0
| Global number ColBlade = 0
| Global number EdgeUnderWidth = 7
| Global number EdgeTopWidth = 4
| Global number ColEdgeUnder = 0
| Global number ColEdgeTop = 0
| Global number ColOutline = 0
| Global number ColGround3 = 0
| Global number WeatherID = 0
| Global number ThemeID = 0
// параллакс
| Global number BackdropID = 0
// облачко из гусениц
| Global number ColDust = 0
| Global number DustLastDirP = 0
| Global number DustBurstB = 0
| Global number DustBurstP = 0
| Global number DustLastDirB = 0
// джойстик
| Global boolean IsAimingJoy = false
// ═══ ПРОЦЕДУРНОЕ НЕБО ═══
| Global number SkyR1 = 0
| Global number SkyG1 = 0
| Global number SkyB1 = 0
| Global number SkyR2 = 0
| Global number SkyG2 = 0
| Global number SkyB2 = 0
| Global number SkyR3 = 0
| Global number SkyG3 = 0
| Global number SkyB3 = 0
| Global number SkyCloudCount = 0
| Global number SkyStarCount = 0
// MapLayout
| Global boolean JustWonBattle = false
| Global number MapScrollX = 150
| Global number LastMapLevel = 0
| Global number TargetBgR = 25
| Global number TargetBgB = 50
| Global number TargetBgG = 80
| Global number CurrentBgR = 25
| Global number CurrentBgB = 50
| Global number CurrentBgG = 80
//
| Global number TeleportProjUID = 0
// карусель танков
| Global number CarouselSpacing = 180
| Global number CarouselAnchorX = 0
| Global number AvailableTanks = 2
| Global number TotalTanks = 5
* On function 'SaveProgress'
----+ System: Is IsDataLoaded
-----> SaveDict: Clear
-----> SaveDict: Add key "Coins" with value Coins
-----> SaveDict: Add key "LevelToPlay" with value LevelToPlay
-----> SaveDict: Add key "CurrentTankID" with value CurrentTankID
-----> SaveDict: Add key "ViewTankID" with value ViewTankID
-----> SaveDict: Add key "OwnsTank_1" with value int(OwnsTank_1)
--------+ System: TankStats.Width > 0
---------> SaveDict: Add key "TankStats" with value TankStats.AsJSON
--------+ (no conditions)
---------> LocalStorage: Set item "GameSave_v2" to SaveDict.AsJSON
[сохранение]
----+ System: On start of layout
-----> System: Set IsDataLoaded to False
-----> LocalStorage: Check item "GameSave_v2" exists
-----> System: Set ViewTankID to CurrentTankID
-----> LocalStorage: Check item "AimJoyMode" exists
----+ LocalStorage: On item "AimJoyMode" exists
-----> LocalStorage: Get item "AimJoyMode"
----+ LocalStorage: On item "AimJoyMode" get
--------+ System: int(LocalStorage.ItemValue) = 1
---------> System: Set IsAimingJoy to True
--------+ System: Else
---------> System: Set IsAimingJoy to False
----+ LocalStorage: On item "AimJoyMode" missing
-----> System: Set IsAimingJoy to False
----+ LocalStorage: On item "GameSave_v2" exists
-----> LocalStorage: Get item "GameSave_v2"
----+ LocalStorage: On item "GameSave_v2" get
-----> SaveDict: Load from JSON string LocalStorage.ItemValue
-----> System: Set Coins to SaveDict.Get("Coins")
-----> System: Set LevelToPlay to SaveDict.Get("LevelToPlay")
-----> System: Set CurrentTankID to SaveDict.Get("CurrentTankID")
-----> System: Set ViewTankID to SaveDict.Get("ViewTankID")
-----> TankStats: Load from JSON string SaveDict.Get("TankStats")
-----> System: Set IsDataLoaded to True
--------+ System: SaveDict.Get("OwnsTank_1") = 1
---------> System: Set OwnsTank_1 to True
--------+ System: Else
---------> System: Set OwnsTank_1 to False
----+ LocalStorage: On item "GameSave_v2" missing
-----> TankStats: Set size to (10, 4, 1)
-----> System: Set IsDataLoaded to True
--------+ System: For "TankID" from 0 to 9
---------> TankStats: Set value at (LoopIndex("TankID"), 0) to 1
---------> TankStats: Set value at (LoopIndex("TankID"), 1) to 1
---------> TankStats: Set value at (LoopIndex("TankID"), 2) to 1
---------> TankStats: Set value at (LoopIndex("TankID"), 3) to 0
--------+ (no conditions)
---------> TankStats: Set value at (0, 3) to 1
---------> Functions: Call SaveProgress
[[Лок: загрузка и определение языка]]
----+ System: On start of layout
----+ System: LangLoaded = 0
-----> AJAX: Request ArrayLang.json (tag "Lang")
-----> System: Wait for previous actions to complete
-----> ArrayLang: Load from JSON string AJAX.LastData
-----> AJAX: Request WepDesc.json (tag "WepDesc")
-----> System: Wait for previous actions to complete
-----> WepDesc: Load from JSON string AJAX.LastData
-----> System: Set LangLoaded to 1
-----> System: Set WepLoaded to 1
-----> System: Set Lang to (left(Browser.Language, 2) = "ru" ? 0 : 1)
-----> LocalStorage: Check item "Lang" exists
----+ LocalStorage: On item "Lang" exists
-----> LocalStorage: Get item "Lang"
----+ LocalStorage: On item "Lang" get
-----> System: Set Lang to int(LocalStorage.ItemValue)
----+ (no conditions)
-----> Functions: Call LangApply
-----> BtnLang: Set animation frame to Lang
// [Лок: функция перевода]
----* On function 'LangApply'
----+ Texts: Lang > 0
-----> Texts: Set text to ArrayLang.At(Lang, Self.Lang)
[[Окно настроек]]
----+ System: On start of layout
-----> System: Set IsSettingsOpen to 0
-----> System: Set Surrendered to 0
-----> SettingsPanel: Set visibility Invisible
-----> BtnSound: Set visibility Invisible
-----> BtnLang: Set visibility Invisible
-----> BtnSurrender: Set visibility Invisible
-----> BtnCloseSettings: Set visibility Invisible
--------+ System: LayoutName = "Hangar"
---------> System: Set SettingsLayer to "HUD"
--------+ System: Else
---------> System: Set SettingsLayer to "UI"
// [Открытие по BtnSettings]
----+ Touch: On any touch start
----+ Touch: Is touching BtnSettings
----+ System: IsSettingsOpen = 0
-----> System: Set IsSettingsOpen to 1
-----> System: Set LastUiClickTime to wallclocktime
-----> SettingsPanel: Set visibility Visible
-----> BtnSound: Set visibility Visible
-----> BtnLang: Set visibility Visible
-----> BtnSurrender: Set visibility Visible
-----> BtnCloseSettings: Set visibility Visible
-----> BtnSound: Set animation frame to 1 - SoundEnabled
-----> BtnLang: Set animation frame to Lang
--------+ System: LayoutName = "Hangar"
---------> BtnSurrender: Set visibility Invisible
--------+ System: Else
---------> BtnSurrender: Set visibility Visible
// [Крестик: закрыть]
----+ Touch: On any touch start
----+ Touch: Is touching BtnCloseSettings
----+ System: IsSettingsOpen = 1
-----> Functions: Call UiSettingsClose
----* On function 'UiSettingsClose'
-----> System: Set IsSettingsOpen to 0
-----> System: Set LastUiClickTime to wallclocktime
-----> SettingsPanel: Set visibility Invisible
-----> BtnSound: Set visibility Invisible
-----> BtnLang: Set visibility Invisible
-----> BtnSurrender: Set visibility Invisible
-----> BtnCloseSettings: Set visibility Invisible
// [Звук вкл/выкл]
----+ Touch: On any touch start
----+ Touch: Is touching BtnSound
----+ System: IsSettingsOpen = 1
-----> System: Set SoundEnabled to 1 - SoundEnabled
-----> BtnSound: Set animation frame to 1 - SoundEnabled
-----> LocalStorage: Set item "Sound" to SoundEnabled
-----> System: Set LastUiClickTime to wallclocktime
--------+ System: SoundEnabled = 1
---------> Audio: Set not silent
--------+ System: Else
---------> Audio: Set silent
// [Звук: загрузка сохранения]
----+ System: On start of layout
-----> LocalStorage: Check item "Sound" exists
----+ LocalStorage: On item "Sound" missing
-----> System: Set SoundEnabled to 1
----+ LocalStorage: On item "Sound" exists
-----> LocalStorage: Get item "Sound"
----+ LocalStorage: On item "Sound" get
-----> System: Set SoundEnabled to int(LocalStorage.ItemValue)
----+ (no conditions)
--------+ System: SoundEnabled = 1
---------> Audio: Set not silent
--------+ System: Else
---------> Audio: Set silent
----+ (no conditions)
-----> BtnSound: Set animation frame to 1 - SoundEnabled
// [Смена языка (кнопка в окне настроек)]
----+ Touch: On any touch start
----+ Touch: Is touching BtnLang
----+ System: IsSettingsOpen = 1
-----> System: Set Lang to (Lang = 0)
-----> BtnLang: Set animation frame to Lang
-----> LocalStorage: Set item "Lang" to Lang
-----> Functions: Call LangApply
-----> System: Set LastUiClickTime to wallclocktime
// [Флаг: сдаться (только бой)]
----+ Touch: On any touch start
----+ Touch: Is touching BtnSurrender
----+ System: IsSettingsOpen = 1
----+ System: LayoutName ≠ "Hangar"
----+ System: MatchResult = ""
----+ PlayerTank: isDestroyed = 0
-----> Functions: Call UiSettingsClose
-----> System: Set Surrendered to 1
-----> System: Set ActivePlayer to "Player1"
-----> Functions: Call TakeDamage (TargetUID: PlayerTank.UID, Damage: 9999, HeavyHit: 0)
----+ System: Every tick
----+ System: Surrendered = 1
----+ EndPanel: Is visible
-----> EndText: Set text to ArrayLang.At(Lang, 18)
-----> Text_Reward: Set text to ArrayLang.At(Lang, 22) & " 0 " & ArrayLang.At(Lang, 23)