{
	"format_version": "1.17.0",
	"animation_controllers": {
		"controller.animation.shapescape_mb.phantom_boss.death": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"death": "q.health == 1"
						}
					]
				},
				"death": {
					"on_entry": ["@s death", "/effect @s slowness 13000 255 true", "/playsound shapescape_mb.phantom_boss.death @a ~~~ 30 1", "variable.death = q.life_time + 3.05;"],
					"transitions": [
						{
							"despawn": "(variable.death < q.life_time)"
						}
					],
					"on_exit": ["/function shapescape/mb/phantom_boss/death"]
				},
				"despawn": {
					"on_entry": ["@s despawn"]
				}
			}
		},
		"controller.animation.shapescape_mb.phantom_boss.melee_attack": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"start": "1.0"
						}
					],
					"on_exit": ["@s move"]
				},
				"start": {
					"transitions": [
						{
							"melee_attack": "q.is_delayed_attacking && !q.is_sheared && q.variant != 11 && q.variant != 12 && q.variant != 100"
						}
					]
				},
				"melee_attack": {
					"on_entry": ["@s not_move"],
					"transitions": [
						{
							"start": "q.is_sheared || q.variant == 11 || q.variant == 100"
						},
						{
							"stop_melee_attack": "!q.is_delayed_attacking && !q.is_sheared"
						}
					]
				},
				"stop_melee_attack": {
					"on_entry": ["@s move"],
					"transitions": [
						{
							"start": "1.0"
						}
					]
				}
			}
		},
		"controller.animation.shapescape_mb.phantom_boss.choose_attack": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"start": "q.variant != 100 && q.variant == 10 && q.is_delayed_attacking && !q.is_sheared"
						}
					]
				},
				"start": {
					"transitions": [
						{
							"end": "!q.is_delayed_attacking"
						}
					]
				},
				"end": {
					"on_entry": ["@s choose_attack"],
					"transitions": [
						{
							"default": "1.0"
						}
					]
				}
			}
		},
		"controller.animation.shapescape_mb.phantom_boss.wing_attack_prep": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"start": "q.variant != 100 && q.variant == 11 && !q.is_sheared && q.is_charged"
						},
						{
							"start": "q.variant != 100 && q.variant == 12 && !q.is_sheared"
						}
					]
				},
				"start": {
					"on_entry": ["@s wing_attack_exec", "/execute if entity @s[family=shapescape_mb_boss_class_common] run summon shapescape_mb:wing_attack ~~~ ~~ shapescape_mb:common_entity_spawned", "/execute if entity @s[family=shapescape_mb_boss_class_uncommon] run summon shapescape_mb:wing_attack ~~~ ~~ shapescape_mb:uncommon_entity_spawned", "/execute if entity @s[family=shapescape_mb_boss_class_rare] run summon shapescape_mb:wing_attack ~~~ ~~ shapescape_mb:rare_entity_spawned", "/execute if entity @s[family=shapescape_mb_boss_class_epic] run summon shapescape_mb:wing_attack ~~~ ~~ shapescape_mb:epic_entity_spawned", "/execute if entity @s[family=shapescape_mb_boss_class_legendary] run summon shapescape_mb:wing_attack ~~~ ~~ shapescape_mb:legendary_entity_spawned", "/execute if entity @s[family=shapescape_mb_boss_class_impossible] run summon shapescape_mb:wing_attack ~~~ ~~ shapescape_mb:impossible_entity_spawned", "variable.wing_attack_prep = q.life_time + 3.0;"],
					"transitions": [
						{
							"end": "variable.wing_attack_prep < q.life_time"
						}
					]
				},
				"end": {
					"transitions": [
						{
							"default": "1.0"
						}
					],
					"on_exit": ["@s choose_attack"]
				}
			}
		},
		"controller.animation.shapescape_mb.phantom_boss.phase_change_prep": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"phase_change_prep": "q.variant != 100 && (!q.is_delayed_attacking && !q.is_charged && q.variant != 12) && !q.is_sheared && q.health > 1 && ((q.health < q.max_health*0.70) && q.mark_variant == 1) || ((q.health < q.max_health*0.30) && q.mark_variant == 2)"
						},
						{
							"summon_damage": "q.variant == 100"
						}
					]
				},
				"phase_change_prep": {
					"on_entry": ["@s phase_change_prep", "v.phase_change_prep = q.life_time + 2.5;"],
					"transitions": [
						{
							"summon_damage": "v.phase_change_prep < q.life_time"
						}
					]
				},
				"summon_damage": {
					"on_entry": ["/execute if entity @s[family=shapescape_mb_boss_class_common] run summon shapescape_mb:dive_attack ~~~ ~~ shapescape_mb:common_entity_spawned", "/execute if entity @s[family=shapescape_mb_boss_class_uncommon] run summon shapescape_mb:dive_attack ~~~ ~~ shapescape_mb:uncommon_entity_spawned", "/execute if entity @s[family=shapescape_mb_boss_class_rare] run summon shapescape_mb:dive_attack ~~~ ~~ shapescape_mb:rare_entity_spawned", "/execute if entity @s[family=shapescape_mb_boss_class_epic] run summon shapescape_mb:dive_attack ~~~ ~~ shapescape_mb:epic_entity_spawned", "/execute if entity @s[family=shapescape_mb_boss_class_legendary] run summon shapescape_mb:dive_attack ~~~ ~~ shapescape_mb:legendary_entity_spawned", "/execute if entity @s[family=shapescape_mb_boss_class_impossible] run summon shapescape_mb:dive_attack ~~~ ~~ shapescape_mb:impossible_entity_spawned", "v.phase_change_prep = q.life_time + 3.7;"],
					"transitions": [
						{
							"phase_change_exec": "v.phase_change_prep < q.life_time"
						}
					]
				},
				"phase_change_exec": {
					"on_entry": ["@s phase_change_exec"],
					"transitions": [
						{
							"default": "1.0"
						}
					]
				}
			}
		},
		"controller.animation.shapescape_mb.phantom_boss.resist_suffocation": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"resist": "q.property('shapescape_mb:boss_class') == 'epic'"
						},
						{
							"resist": "q.property('shapescape_mb:boss_class') == 'legendary'"
						},
						{
							"resist": "q.property('shapescape_mb:boss_class') == 'impossible'"
						}
					]
				},
				"resist": {
					"on_entry": ["/effect @s water_breathing 1 0 true"],
					"transitions": [
						{
							"default": "q.state_time >= 0.9"
						}
					]
				}
			}
		}
	}
}