[
////////////////////////////////////////////////////////////////
//
//  initialization
//
////////////////////////////////////////////////////////////////
{
	"Default" : 
	{
		"$type" : "ConfigAbility",
		"abilityName" : "Monster_Apparatus_Enigma_BionicNettler_Initialization",
		"onAdded":
		[
			{
				"$type":"SetGlobalValue",
				"key":"_GLOBALVALUE_EnigmaType",
				"value" : 4,
			},
		],
		"abilityMixins":
		[
			{
				"$type": "AttachToAIAlertnessMixin",
				"alertness": [0],
				"modifierName": "Reset_EnergyLineState",
			},
		],
		"modifiers":
		{
			"Reset_EnergyLineState":
			{
				"onAdded":
				[
					//重置单轮技能放了几次的计数
					{
						"$type" : "AddGlobalValue",
						"value"  : -9999,
						"key"  : "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_TimesCounter",
						"useLimitRange"  : true,
						"minValue"  : 0,
					},
					{
						"$type" : "KillGadget",
						"gadgetInfo":
						{
							"$type": "SelectTargetsByChildren",
			 				"configID": 42401009,
			 				"sortType": "Reversed",
			 			}
					},
				],
			},
		},

	},
},
////////////////////////////////////////////////////////////////
//
//  CoreActive
//
////////////////////////////////////////////////////////////////
//技能前后摇时触发
{
	"Default" : 
	{
		"$type" : "ConfigAbility",
		"abilityName" : "Monster_Apparatus_Enigma_BionicNettler_CoreActive",
		"abilityMixins":
		[
			{
				"$type" : "AttachToNormalizedTimeMixin",
				"stateID"  : "Sting",
				"modifierName"  : "UNIQUE_Monster_Apparatus_Enigma_BionicNettler_CoreState",
				"target"  : "Self",
				"normalizeStart"  : 0.15,
				"normalizeEnd"  : 0.8,
			},
			{
				"$type": "AttachToPoseIDMixin",
				"poseIDs": [202],
				"modifierName": "Enigma_BionicNettler_Weak",
			},
		],
		"onKill":
		[
			{
				"$type" : "SetGlobalValue",
				"target": "Owner",
				"value"  : 1,
				"key"  : "_WATCHER_80105_",
			},
		],
		"modifiers":
		{
			"UNIQUE_Monster_Apparatus_Enigma_BionicNettler_CoreState":
			{
				"isUnique": true,
				"onAdded":
				[
					{
						"$type" : "AddGlobalValue",
						"value"  : 1,
						"key"  : "_MONSTER_Apparatus_Enigma_CoreActive",
						"useLimitRange"  : true,
						"maxValue"  : 1,
						"minValue"  : 0,
					},
					{
						"$type" : "SetAnimatorInt",
						"intID"  : "PowerStage",
						"value"  : 2,
					},
					{
						"$type": "EnableHitBoxByName",
						"hitBoxNames": ["CoreBox"],
						"setEnable": true,
					},
				],
				"onRemoved":
				[
					{
						"$type": "EnableHitBoxByName",
						"hitBoxNames": ["CoreBox"],
						"setEnable": false,
					},
					{
						"$type" : "SetAnimatorInt",
						"intID"  : "PowerStage",
						"value"  : 1,
						"predicates":
						[
							{
								"$type" : "ByAnimatorInt",
								"value"  : 0,
								"parameter"  : "PowerStage",
								"logic"  : "Greater",
							},
						],
					},
					{
						"$type" : "AddGlobalValue",
						"value"  : -1,
						"key"  : "_MONSTER_Apparatus_Enigma_CoreActive",
						"useLimitRange"  : true,
						"maxValue"  : 1,
						"minValue"  : 0,
					},			
				],
			},
			"Enigma_BionicNettler_Weak":
			{
				"onAdded":
				[
					{
						"$type" : "SetGlobalValue",
						"target": "Owner",
						"value"  : 1,
						"key"  : "_WATCHER_80104_4",
					},
				],
			},
		},
	},
},
////////////////////////////////////////////////////////////////
//
//  CounterAtk
//
////////////////////////////////////////////////////////////////
{
	"Default" : 
	{
		"$type" : "ConfigAbility",
		"abilityName" : "Monster_Apparatus_Enigma_BionicNettler_CounterAtk",
		"onAbilityStart":
		[
			{
				"$type" : "TriggerAttackEvent",
				"targetType" : "Enemy",
				"attackEvent":
				{
					"attackPattern" :
					{
						"$type": "ConfigAttackCircle",
						"triggerType": "TriggerNoRepeat",
						"height": 3.0,
						"fanAngle": 360.0,
						"radius": 3.5,
						"born":
						{
							"$type": "ConfigBornBySelf",
						},
					},
					"attackInfo":
					{
						"attackProperty":
						{
							"damagePercentage": 0.307,
							"strikeType": "None",
							"enbreak": 20,
						},
						"hitPattern" :
						{
							"hitImpulseType":"LV1",
							"reboundRatio" : 0,
							"hitHaltTime" : 0.0,
							"hitHaltTimeScale" : 0.05,
							"muteHitText" : false,
						},
					},
				},
			},
		],
	},
},
////////////////////////////////////////////////////////////////
//
//  Sting
//
////////////////////////////////////////////////////////////////
{
	"Default" : 
	{
		"$type" : "ConfigAbility",
		"abilityName" : "Monster_Apparatus_Enigma_BionicNettler_Sting",
		"abilityMixins":
		[
			{
				"$type" : "AttachToStateIDMixin",
				"stateIDs"  : ["Sting"],
				"modifierName"  : "Monster_Apparatus_Enigma_BionicNettler_Sting_ResetCD",
			},
		],
		"modifiers":
		{
			"Monster_Apparatus_Enigma_BionicNettler_Sting_ResetCD":
			{
				"onAdded":
				[
					{
						"$type":"SetGlobalValue",
						"key":"_MONSTER_Apparatus_Enigma_BionicNettler_Reset",
						"useLimitRange":true,
						"randomInRange":true,
						"maxValue"  : 3,
						"minValue"  : 0,
					},
					{
						"$type" : "ApplyModifier",
						"modifierName"  : "Monster_Apparatus_Enigma_BionicNettler_StingCombo",
					},
				],
				"onRemoved":
				[
					{
						"$type":"SetAISkillCDAvailableNow",
						"skillIDs":[202],
						"predicates":
						[
							{
								"$type" : "ByTargetGlobalValue",
								"key"  : "_MONSTER_Apparatus_Enigma_BionicNettler_Reset",
								"value"  : 2,
								"compareType"  : "LessAndEqual",
							},
							{
								"$type" : "ByTargetGlobalValue",
								"key"  : "_MONSTER_Apparatus_Enigma_BionicNettler_Reset",
								"value"  : 0,
								"compareType"  : "MoreThanAndEqual",
							},
						],
					},
					{
						"$type": "ReTriggerAISkillInitialCD",
						"skillIDs": [212],
						"predicates":
						[
							{
								"$type" : "ByTargetGlobalValue",
								"key"  : "_MONSTER_Apparatus_Enigma_BionicNettler_Reset",
								"value"  : 2,
								"compareType"  : "LessAndEqual",
							},
							{
								"$type" : "ByTargetGlobalValue",
								"key"  : "_MONSTER_Apparatus_Enigma_BionicNettler_Reset",
								"value"  : 0,
								"compareType"  : "MoreThanAndEqual",
							},
						],
					},
					{
						"$type":"SetAISkillCDAvailableNow",
						"skillIDs":[212],
						"predicates":
						[
							{
								"$type" : "ByTargetGlobalValue",
								"key"  : "_MONSTER_Apparatus_Enigma_BionicNettler_Reset",
								"value"  : 2,
								"compareType"  : "MoreThan",
							},
						],
					},
					{
						"$type":"ReTriggerAISkillInitialCD",
						"skillIDs":[202],
						"predicates":
						[
							{
								"$type" : "ByTargetGlobalValue",
								"key"  : "_MONSTER_Apparatus_Enigma_BionicNettler_Reset",
								"value"  : 2,
								"compareType"  : "MoreThan",
							},
						],
					},
				],
			},
			"Monster_Apparatus_Enigma_BionicNettler_StingCombo":
			{
				"duration": 8,
				"onAdded":
				[
					{
						"$type" : "SetPoseBool",
						"boolID"  : "StingCombo",
						"value"  : true,
					},
				],
				"onRemoved":
				[
					{
						"$type" : "SetPoseBool",
						"boolID"  : "StingCombo",
						"value"  : false,
					},
				],
			},
		},
	},
},
////////////////////////////////////////////////////////////////
//
//  EnergyLine
//
////////////////////////////////////////////////////////////////
{
	"Default":
	{
		"$type": "ConfigAbility",
		"abilityName": "Monster_Apparatus_Enigma_BionicNettler_EnergyLine_CreateGadget",
		"abilityMixins":
		[
			{
				"$type" : "AttachToStateIDMixin",
				"stateIDs"  : ["CounterAtk", "Discharge", "Sting"],
				"modifierName"  : "Monster_Apparatus_Enigma_BionicNettler_EnergyLine_CDReset",
			},
			{
				"$type" : "AttachToStateIDMixin",
				"stateIDs"  : ["EnergyLineRushMove"],
				"modifierName"  : "Monster_Apparatus_Enigma_BionicNettler_EnergyLine_RushMove",
			},
		],
		"onAbilityStart":
		[
			{
				"$type" : "AddGlobalValue",
				"value"  : 1,
				"key"  : "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_TimesCounter",
			},
			{
				"$type" : "CreateGadget",
				"gadgetID"  : 42401009,
				"campID"  : 4001,
				"lifeByOwnerV2": true,
				"campTargetType"  : "Alliance",
				"born":
				{
					"$type": "ConfigBornBySelf",
					"offset" :
					{
						"x" : 0.0,
						"y" : 0.8,
						"z" : 0.0,
					},
				},
			},
			// {
			// 	"$type" : "TriggerAbility",
			// 	"abilityName"  : "Monster_Apparatus_Enigma_BionicNettler_EnergyLine_StateCheck",
			// },
			// {
			// 	"$type" : "TriggerAbility",
			// 	"abilityName"  : "Monster_Apparatus_Enigma_BionicNettler_EnergyLine_FindNext",
			// 	"predicates":
			// 	[
			// 		{
			// 			"$type" : "ByTargetGlobalValue",
			// 			"key"  : "_MONSTER_Apparatus_Enigma_BionicNettler_EnergLine_End",
			// 			"value"  : 0,
			// 			"compareType"  : "Equal",
			// 		},
			// 	],
			// },
		],
		"modifiers":
		{
			"Monster_Apparatus_Enigma_BionicNettler_EnergyLine_CDReset":
			{
				"onAdded":
				[
					{
						"$type" : "AddGlobalValue",
						"value"  : -1,
						"key"  : "_HAS_NearTarget",
						"useLimitRange"  : true,
						"maxValue"  : 1,
						"minValue"  : 0,
						"target"  : "Self",
					},
					{
						"$type": "Predicated",
						"otherTargets":
						{
							"$type": "SelectTargetsByShape",
							"shapeName": "CircleR10",
							"centerBasedOn": "Self",
							"campTargetType": "SelfCamp",
							"campBasedOn": "Self",
						},
						"targetPredicates":
						[
							{
								"$type": "ByEntityTypes",
								"entityTypes": ["Gadget"],
							},
							{
								"$type": "ByTargetGlobalValue",
								"key": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_GadgetID",
								"value": 0,
								"compareType": "MoreThan",
							},
						],
						"successActions":
						[
							{
								"$type" : "AddGlobalValue",
								"value"  : 1,
								"key"  : "_HAS_NearTarget",
								"useLimitRange"  : true,
								"maxValue"  : 1,
								"minValue"  : 0,
								"target"  : "Self",
							},
						],
					},
					{
						"$type":"SetAISkillCDAvailableNow",
						"skillIDs":[221],
						"predicates":
						[
							{
								"$type" : "ByTargetGlobalValue",
								"key"  : "_HAS_NearTarget",
								"value"  : 0,
								"compareType"  : "Equal",
							},
						],
					},
				],
			},
			"Monster_Apparatus_Enigma_BionicNettler_EnergyLine_RushMove":
			{
				"onAdded":
				[
					{
						"$type": "Predicated",
						"target": "SelfAttackTarget",
						"targetPredicates":
						[
							{
								"$type": "ByTargetPositionToSelfPosition",
								"compareType": "XZ",
								"value": 5,
								"logic": "GreaterOrEqual",
							},
						],
						"successActions":
						[
							{
								"$type":"FixedMonsterRushMove",
								"animatorStateIDs": ["EnergyLineRushMove"],
								"target": "SelfAttackTarget",
								"timeRange": 1.833,
								"minRange": 5.0,
								"maxRange": 10.0,
								"toPos":
								{
									"$type": "ConfigBornByTarget",
									"offset": 
									{
										"x": 0.0,
										"y": 0.0,
										"z": 0.0,
									},
									"onGround": true,
								},
							},
						],
						"failActions":
						[
							{
								"$type": "SetAnimatorTrigger",
								"triggerID": "NoRushMoveTrigger",
							},
						],
					},
				],
			},
		},
	},
},
{
	"Default":
	{
		"$type": "ConfigAbility",
		"abilityName": "Monster_Apparatus_Enigma_BionicNettler_EnergyLine_Gadget",
		"onAdded":
		[
			{
				"$type" : "AttachModifier",
				"modifierName"  : "Monster_Apparatus_Enigma_BionicNettler_EnergyLine_Gadget",
			},
		],
		"onKill":
		[
			{
				"$type" : "RemoveModifier",
				"modifierName"  : "Monster_Apparatus_Enigma_BionicNettler_EnergyLine_Gadget",
			},
			{
				"$type" : "FireEffect",
				"effectPattern"  : "Eff_Monster_Apparatus_Enigma_BionicNettler_EnergyBallAS",
			},
			{
				"$type" : "RemoveUniqueModifier",
				"modifierName"  : "UNIQUE_Monster_Apparatus_Enigma_BionicNettler_Line_Effect",
			},
			{
				"$type" : "RemoveUniqueModifier",
				"modifierName"  : "UNIQUE_Monster_Apparatus_Enigma_BionicNettler_Line_Effect",
				"otherTargets":
				{
					"$type": "SelectTargetsByShape",
					"shapeName": "CircleR30",
					"centerBasedOn": "Self",
					"campTargetType": "All",
					"campBasedOn": "Self",
				},
				"predicates":
				[
					{
						"$type": "ByTargetGlobalValue",
						"target": "Target",
						"key": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_GadgetID",
						"value": "%temp_sort_id+1",
						"compareType": "Equal",
					},
				],
			},
		],
		"modifiers":
		{
			"Monster_Apparatus_Enigma_BionicNettler_EnergyLine_Gadget":
			{
				"onAdded":
				[
					{
						"$type" : "AttachEffect",
						"effectPattern"  : "Eff_Monster_Apparatus_Enigma_BionicNettler_EnergyBall",
						"born":
						{
							"$type": "ConfigBornByTarget",
							"offset" : 
							{
								"x": 0.0,
								"y": -0.8,
								"z": 0.0,
							},
						},
					},
					{
						"$type" : "ApplyModifier",
						"modifierName"  : "Effect_Latency",
					},
					{
						"$type": "CopyGlobalValue",
						"srcTarget": "Owner",
						"dstTarget": "Self",
						"srcKey": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_TimesCounter",
						"dstKey": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_GadgetID",
					},
					{
						"$type" : "SetGlobalValueToOverrideMap",
						"globalValueKey"  : "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_GadgetID",
						"overrideMapKey"  : "temp_sort_id",
					},
				],
				"thinkInterval": 0.3,
				"onThinkInterval":
				[
					{
						"$type": "TriggerAttackEvent",
						"targetType": "Enemy",
						"attackEvent": 
						{
							"attackPattern": 
							{
								"$type": "ConfigAttackCircle",
								"triggerType": "TriggerNoRepeat",
								"height": 1.0,
								"fanAngle": 360.0,
								"detectDirection": "CenterToSide",
								"radius": 1.2,
								"born": 
								{
									"$type": "ConfigBornBySelf",
									"offset": 
									{
										"x": 0.0,
										"y": -0.6,
										"z": 0.0,
									}
								},
							},
							"attackInfo": 
							{
								"canBeModifiedBy":"OriginOwner",
								"attenuationTag": "Monster_Konungmathr_Attenuation_1",
								"attenuationGroup":"Monster_Konungmathr_Attenuation_1",
								"attackProperty":
								{
									"damagePercentage": 0.384,
									"elementType": "None",
									"strikeType": "Default",
									"ignoreAttackerProperty": false,
								},
								"hitPattern":
								{
									"onHitEffectName": "default",
									"hitImpulseType": "LV1",
									"retreatType": "ByOriginOwner",
									"reboundRatio": 0,
									"hitHaltTime": 0.0,
									"hitHaltTimeScale" : 0.0,
									"muteHitText": false,
								},
							},
						},
					},
					//目前部分关卡逻辑会以remove方式将怪物回收，导致无法触发lifeByOwnerIsAlive，所以要手动销毁。
					{
						"$type": "KillSelf",
						"predicates": 
						[
							{
								"$type": "ByNot",
								"predicates": 
								[
									{
										"$type": "ByEntityIsAlive",
										"target": "Owner",
									},
								],
							},
						],
					},
				],
			},
			"Effect_Latency":
			{
				"duration": 0.5,
				"onRemoved":
				[
					{
						"$type" : "ApplyModifier",
						"modifierName"  : "UNIQUE_Monster_Apparatus_Enigma_BionicNettler_Line_Effect",
					},
				],
			},
			"UNIQUE_Monster_Apparatus_Enigma_BionicNettler_Line_Effect":
			{
				"isUnique": true,
				"onAdded":
				[
					{
						"$type" : "AttachEffect",
						"effectPattern"  : "Eff_Monster_Apparatus_Enigma_BionicNettler_EnergyBall_Line",
						"otherTargets":
						{
							"$type": "SelectTargetsByShape",
							"shapeName": "CircleR30",
							"centerBasedOn": "Self",
							"campTargetType": "All",
							"campBasedOn": "Self",
						},
						"setSelfAsEffectPluginTarget":true,
						"predicates":
						[
							{
								"$type": "ByTargetGlobalValue",
								"target": "Target",
								"key": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_GadgetID",
								"value": "%temp_sort_id+%minus_one",
								"compareType": "Equal",
							},
						],
					},
					{
						"$type": "SetGlobalValueByTargetDistance",
						"key": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_Distance",
						"otherTargets":
						{
							"$type": "SelectTargetsByShape",
							"shapeName": "CircleR30",
							"centerBasedOn": "Self",
							"campTargetType": "All",
							"campBasedOn": "Self",
						},
						"predicates":
						[
							{
								"$type": "ByTargetGlobalValue",
								"target": "Target",
								"key": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_GadgetID",
								"value": "%temp_sort_id+%minus_one",
								"compareType": "Equal",
							},
						],
					},
				],
				"thinkInterval": 0.3,
				"onThinkInterval":
				[
					{
						"$type": "Predicated",
						"otherTargets":
						{
							"$type": "SelectTargetsByShape",
							"shapeName": "CircleR30",
							"centerBasedOn": "Self",
							"campTargetType": "SelfCamp",
							"campBasedOn": "Self",
						},
						"targetPredicates":
						[
							{
								"$type": "ByEntityTypes",
								"entityTypes": ["Gadget"],
							},
							{
								"$type": "ByTargetGlobalValue",
								"key": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_GadgetID",
								"value": "%temp_sort_id+%minus_one",
								"compareType": "Equal",
							},
						],
						"successActions":
						[
							{
								"$type" : "SetSelfAttackTarget",
								"turnToTargetImmediately" : false,
								"target": "Target",
							},
							{
								"$type": "TriggerBullet",
								"bulletID": 42401010,
								"campID"  : 4001,
								"born": 
								{
									"$type": "ConfigBornByAttachPoint",
									"attachPointName": "RootNode",
									"direction":
									{
										"$type": "ConfigDirectionByAttackTarget",
									}
								},
							},
						],
					},
				],
			},
		},
		"abilitySpecials":
		{
			"temp_sort_id": 0,
			"minus_one": -1,
		},
	},
},
{
	"Default":
	{
		"$type": "ConfigAbility",
		"abilityName": "Monster_Apparatus_Enigma_BionicNettler_EnergyLine_TriggerBullet",
		"onAdded":
		[
			{
				"$type": "CopyGlobalValue",
				"srcTarget": "Owner",
				"dstTarget": "Self",
				"srcKey": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_Distance",
				"dstKey": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_Distance",
			},
			{
				"$type": "SetGlobalValueToOverrideMap",
				"globalValueKey": "_MONSTER_Apparatus_Enigma_BionicNettler_EnergyLine_Distance",
				"overrideMapKey": "DischargeTargetDistance",
			},
			{
				"$type" : "SetSelfAttackTarget",
				"turnToTargetImmediately"  : false,
				"target"  : "Owner",
			},
			{
				"$type": "TriggerAttackEvent",
				"targetType": "Enemy",
				"attackEvent": 
				{
					"attackPattern": 
					{
						"$type" : "ConfigAttackBox",
						"triggerType" : "TriggerNoRepeat",
						"born":
						{
							"$type": "ConfigBornBySelf",
							"direction":
							{
								"$type": "ConfigDirectionByAttackTarget",
							},
							"offset":
							{
								"x": 0.0,
								"y": 0.0,
								"z": 0.0,
							},
						},
						"size" : 
						{
							"x" : 0.6,
							"y" : 1.2,
							"z" : "%DischargeTargetDistance",
						},
					},
					"attackInfo":
					{
						"canBeModifiedBy":"OriginOwner",
						"attenuationTag": "Monster_Konungmathr_Attenuation_1",
						"attenuationGroup":"Monster_Konungmathr_Attenuation_1",
						"attackProperty":
						{
							"damagePercentage": 0.384,
							"elementType": "None",
							"strikeType": "Default",
							"ignoreAttackerProperty": false,
						},
						"hitPattern":
						{
							"onHitEffectName": "default",
							"hitImpulseType": "LV1",
							"retreatType": "ByOriginOwner",
							"reboundRatio": 0,
							"hitHaltTime": 0.0,
							"hitHaltTimeScale" : 0.0,
							"muteHitText": false,
						},
					},
				},
			},
			// {
			// 	"$type": "KillSelf",
			// },
		],
		"abilitySpecials":
		{
			"DischargeTargetDistance": 10.0,
		},
	},
},
////////////////////////////////////////////////////////////////
//
//  Steer
//
////////////////////////////////////////////////////////////////
{
	"Default" : 
	{
		"$type" : "ConfigAbility",
		"abilityName" : "Monster_Apparatus_Enigma_BionicNettler_Steer",
		"abilityMixins": 
		[
			{
				"$type": "SteerAttackMixin",
				"steerStateIDs": ["EnergyLine"],
				"startNormalizedTime" : 0.0,
				"endNormalizedTime" : 0.3,
				"angularSpeed" : 180,
				"attackTrigger" : "",
				"attackDistance" : 0,
			},
			{
				"$type": "SteerAttackMixin",
				"steerStateIDs": ["Sting"],
				"startNormalizedTime" : 0.0,
				"endNormalizedTime" : 0.5,
				"angularSpeed" : 180,
				"attackTrigger" : "",
				"attackDistance" : 0,
			},
			{
				"$type": "SteerAttackMixin",
				"steerStateIDs": ["EnergyLineRushMove"],
				"startNormalizedTime" : 0.0,
				"endNormalizedTime" : 1,
				"angularSpeed" : 180,
				"attackTrigger" : "",
				"attackDistance" : 0,
			},
		],
	},
},
]