{
	"format_version": "1.10.0",
	"animation_controllers": {
		"controller.animation.shapescape_mb.mammoth_boss.phase": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"start": "!q.is_illager_captain && q.property('shapescape_mb:mammoth_state') == 'ready'"
						}
					]
				},
				"start": {
					"transitions": [
						{
							"add_mammoth_phase_counter": "q.property('shapescape_mb:mammoth_phase') == 1 && q.state_time > 0.40"
						},
						{
							"add_mammoth_phase_counter": "q.property('shapescape_mb:mammoth_phase') == 2 && q.state_time > 0.40"
						}
					]
				},
				"add_mammoth_phase_counter": {
					"on_entry": ["@s shapescape_mb:add_mammoth_phase_counter"],
					"transitions": [
						{
							"start": "q.property('shapescape_mb:mammoth_phase_counter') < 100"
						},
						{
							"next_phase": "q.property('shapescape_mb:mammoth_state') == 'ready' && q.property('shapescape_mb:mammoth_phase') < 3 && q.property('shapescape_mb:mammoth_phase_counter') == 100"
						}
					]
				},
				"next_phase": {
					"on_entry": ["@s shapescape_mb:change_phase_prep"],
					"transitions": [
						{
							"default": "q.is_illager_captain"
						}
					]
				}
			}
		},
		"controller.animation.shapescape_mb.mammoth_boss.special_attack": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"spawn": "q.property('shapescape_mb:mammoth_state') == 'spawn'"
						},
						{
							"ready": "q.property('shapescape_mb:mammoth_state') == 'ready'"
						},
						{
							"charge": "q.property('shapescape_mb:mammoth_state') == 'charge'"
						},
						{
							"stomp": "q.property('shapescape_mb:mammoth_state') == 'stomp'"
						},
						{
							"magma": "q.property('shapescape_mb:mammoth_state') == 'magma'"
						},
						{
							"earthquake": "q.property('shapescape_mb:mammoth_state') == 'earthquake'"
						},
						{
							"disabled": "q.property('shapescape_mb:mammoth_state') == 'disabled'"
						},
						{
							"death": "q.property('shapescape_mb:mammoth_state') == 'death'"
						}
					]
				},
				"spawn": {
					"on_entry": ["/playsound shapescape_mb.mammoth_boss.emerge @a ~ ~ ~ 1 1 0.3"],
					"transitions": [
						{
							"default": "q.property('shapescape_mb:mammoth_state') != 'spawn'"
						}
					]
				},
				"disabled": {
					"transitions": [
						{
							"default": "q.property('shapescape_mb:mammoth_state') != 'disabled'"
						}
					]
				},
				"ready": {
					"on_entry": ["v.special_attack_delay = math.random(2, 3);", "@s shapescape_mb:special_attack_ready"],
					"transitions": [
						{
							"ready_select_attack": "q.state_time >= v.special_attack_delay && !q.is_delayed_attacking"
						},
						{
							"default": "q.property('shapescape_mb:mammoth_state') != 'ready'"
						}
					]
				},
				"ready_select_attack": {
					"on_entry": ["/scriptevent shapescape_mb:mammoth_boss_special_attack"],
					"transitions": [
						{
							"charge": "q.property('shapescape_mb:mammoth_state') == 'charge' && !q.is_illager_captain"
						},
						{
							"stomp": "q.property('shapescape_mb:mammoth_state') == 'stomp' && !q.is_illager_captain"
						},
						{
							"magma": "q.property('shapescape_mb:mammoth_state') == 'magma' && !q.is_illager_captain"
						},
						{
							"earthquake": "q.property('shapescape_mb:mammoth_state') == 'earthquake' && !q.is_illager_captain"
						},
						{
							"ready_retry_select_attack": "q.state_time >= 1.0 && !q.is_illager_captain"
						},
						{
							"default": "q.property('shapescape_mb:mammoth_state') != 'ready' && !q.is_illager_captain"
						}
					]
				},
				"ready_retry_select_attack": {
					"transitions": [
						{
							"default": "q.property('shapescape_mb:mammoth_state') != 'ready'"
						},
						{
							"ready_select_attack": "1.0"
						}
					]
				},
				"charge": {
					"on_entry": ["v.special_attack_delay = 4;", "@s shapescape_mb:special_attack_charge"],
					"transitions": [
						{
							"charge_end": "q.state_time >= v.special_attack_delay"
						},
						{
							"default": "q.property('shapescape_mb:mammoth_state') != 'charge'"
						}
					]
				},
				"charge_end": {
					"on_entry": ["@s shapescape_mb:special_attack_ready"],
					"transitions": [
						{
							"default": "1.0"
						}
					]
				},
				"stomp": {
					"on_entry": ["v.special_attack_delay = 4;", "@s shapescape_mb:special_attack_stomp"],
					"transitions": [
						{
							"stomp_end": "q.state_time >= v.special_attack_delay"
						},
						{
							"default": "q.property('shapescape_mb:mammoth_state') != 'stomp'"
						}
					]
				},
				"stomp_end": {
					"on_entry": ["@s shapescape_mb:special_attack_ready"],
					"transitions": [
						{
							"default": "1.0"
						}
					]
				},
				"magma": {
					"on_entry": ["v.special_attack_delay = 4;", "@s shapescape_mb:special_attack_magma"],
					"transitions": [
						{
							"magma_end": "q.state_time >= v.special_attack_delay"
						},
						{
							"default": "q.property('shapescape_mb:mammoth_state') != 'magma'"
						}
					]
				},
				"magma_end": {
					"on_entry": ["@s shapescape_mb:special_attack_ready"],
					"transitions": [
						{
							"default": "1.0"
						}
					]
				},
				"earthquake": {
					"on_entry": ["v.special_attack_delay = 4;", "@s shapescape_mb:special_attack_earthquake"],
					"transitions": [
						{
							"earthquake_end": "q.state_time >= v.special_attack_delay"
						},
						{
							"default": "q.property('shapescape_mb:mammoth_state') != 'earthquake'"
						}
					]
				},
				"earthquake_end": {
					"on_entry": ["@s shapescape_mb:special_attack_ready"],
					"transitions": [
						{
							"default": "1.0"
						}
					]
				},
				"death": {
					"transitions": [
						{
							"default": "q.property('shapescape_mb:mammoth_state') != 'death'"
						}
					]
				}
			}
		},
		"controller.animation.shapescape_mb.mammoth_boss.death": {
			"initial_state": "default",
			"states": {
				"default": {
					"transitions": [
						{
							"dying": "q.health <= 1"
						}
					]
				},
				"dying": {
					"on_entry": ["@s shapescape_mb:death", "/scriptevent shapescape_mb:mammoth_boss_cancel_special_attack", "/playsound shapescape_mb.mammoth_boss.death @a ~ ~ ~ 1 1 0.3"],
					"transitions": [
						{
							"death": "q.state_time >= 6.1"
						}
					]
				},
				"death": {
					"on_entry": ["/function shapescape/mb/mammoth_boss/death"],
					"transitions": [
						{
							"despawn": "1.0"
						}
					]
				},
				"despawn": {
					"on_entry": ["/particle shapescape_mb:lava_leaks_explosion ~ ~ ~", "@s shapescape_mb:despawn"]
				}
			}
		},
		"controller.animation.shapescape_mb.mammoth_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"
						}
					]
				}
			}
		}
	}
}