{
	"type": "origins:multiple",
	"cooldown": {
		"type": "origins:resource",
		"min": 30,
		"max": 60,
		"start_value": 60
	},
	"charge": {
		"type": "origins:resource",
		"min": 0,
		"max": 60,
		"start_value": 0,
		"hud_render": {
			"inverted": true,
			"sprite_location": "origins:textures/gui/community/spiderkolo/resource_bar_03.png",
			"bar_index": 16,
			"order": 0,
			"condition": {
				"type": "origins:resource",
				"resource": "drpg:armor_restriction",
				"comparison": "==",
				"compare_to": 0
			}
		}
	},
	"locked": {
		"type": "origins:resource",
		"min": 0,
		"max": 7,
		"start_value": 7,
		"hud_render": {
			"sprite_location": "origins:textures/gui/community/spiderkolo/resource_bar_01.png",
			"bar_index": 23,
			"order": 0,
			"condition": {
				"type": "origins:resource",
				"resource": "drpg:armor_restriction",
				"comparison": ">",
				"compare_to": 0
			}
		}
	},
	"countdown": {
		"type": "origins:action_over_time",
		"entity_action": {
			"type": "origins:change_resource",
			"resource": "drpg:fighter_action_surge_charge",
			"change": -1
		},
		"interval": 20,
		"condition": {
			"type": "origins:resource",
			"resource": "drpg:armor_restriction",
			"comparison": "==",
			"compare_to": 0
		}
	},
	"restore": {
		"type": "origins:action_on_wake_up",
		"entity_action": {
			"type": "origins:side",
			"action": {
				"type": "origins:change_resource",
				"resource": "drpg:fighter_action_surge_charge",
				"operation": "set",
				"change": 0
			},
			"side": "server"
		}
	},
	"active": {
		"type": "origins:active_self",
		"cooldown": 120,
		"entity_action": {
			"type": "origins:and",
			"actions": [
				{
					"type": "origins:delay",
					"ticks": 1,
					"action": {
						"type": "origins:modify_resource",
						"modifier": {
							"operation": "add_base_early",
							"value": 0,
							"resource": "drpg:fighter_action_surge_cooldown"
						},
						"resource": "drpg:fighter_action_surge_charge"
					}
				},
				{
					"type": "origins:play_sound",
					"sound": "irons_spellbooks:spell.sonic_boom.cast",
					"pitch": 2
				}
			]
		},
		"condition": {
			"type": "origins:and",
			"conditions": [
				{
					"type": "origins:resource",
					"resource": "drpg:fighter_action_surge_charge",
					"comparison": "==",
					"compare_to": 0
				},
				{
					"type": "origins:resource",
					"resource": "drpg:armor_restriction",
					"comparison": "==",
					"compare_to": 0
				}
			]
		},
		"condition": {
			"type": "origins:or",
			"conditions": [
				{
					"type": "origins:and",
					"conditions": [
						{
							"type": "origins:resource",
							"resource": "drpg:fighter_action_surge_cooldown",
							"comparison": ">",
							"compare_to": 30
						},
						{
							"type": "origins:resource",
							"resource": "drpg:fighter_action_surge_charge",
							"comparison": "==",
							"compare_to": 0
						},
						{
							"type": "origins:resource",
							"resource": "drpg:armor_restriction",
							"comparison": "==",
							"compare_to": 0
						}
					]
				},
				{
					"type": "origins:and",
					"conditions": [
						{
							"type": "origins:resource",
							"resource": "drpg:fighter_action_surge_cooldown",
							"comparison": "<=",
							"compare_to": 30
						},
						{
							"type": "origins:resource",
							"resource": "drpg:fighter_action_surge_charge",
							"comparison": "<=",
							"compare_to": 30
						},
						{
							"type": "origins:resource",
							"resource": "drpg:armor_restriction",
							"comparison": "==",
							"compare_to": 0
						}
					]
				}
			]
		},
		"hud_render": {
			"should_render": true,
			"inverted": true,
			"sprite_location": "origins:textures/gui/community/spiderkolo/resource_bar_02.png",
			"bar_index": 1,
			"order": 1
		}
	},
	"reset_on_hit": {
		"type": "origins:action_when_damage_taken",
		"entity_action": {
			"type": "origins:modify_resource",
			"modifier": {
				"operation": "set_total",
				"value": 0,
				"resource": "drpg:fighter_action_surge_cooldown"
			},
			"resource": "drpg:fighter_action_surge_charge"
		},
		"condition": {
			"type": "origins:and",
			"conditions": [
				{
					"type": "origins:resource",
					"resource": "drpg:fighter_action_surge_charge",
					"comparison": ">",
					"compare_to": 0
				},
				{
					"type": "origins:or",
					"conditions": [
						{
							"type": "origins:and",
							"conditions": [
								{
									"type": "origins:resource",
									"resource": "drpg:fighter_action_surge_cooldown",
									"comparison": "<=",
									"compare_to": 30
								},
								{
									"type": "origins:resource",
									"resource": "drpg:fighter_action_surge_charge",
									"comparison": "<",
									"compare_to": 30
								}
							]
						},
						{
							"type": "origins:resource",
							"resource": "drpg:fighter_action_surge_cooldown",
							"comparison": ">",
							"compare_to": 30
						}
					]
				}
			]
		}
	},
	"reset_on_hit_secondary": {
		"type": "origins:action_when_damage_taken",
		"entity_action": {
			"type": "origins:modify_resource",
			"modifier": {
				"operation": "set_total",
				"value": 60
			},
			"resource": "drpg:fighter_action_surge_charge"
		},
		"condition": {
			"type": "origins:resource",
			"resource": "drpg:fighter_action_surge_charge",
			"comparison": ">",
			"compare_to": 30
		}
	},
	"reset_on_attack": {
		"type": "origins:active_self",
		"key": {
			"key": "key.attack",
			"continuous": true
		},
		"entity_action": {
			"type": "origins:modify_resource",
			"modifier": {
				"operation": "set_total",
				"value": 0,
				"resource": "drpg:fighter_action_surge_cooldown"
			},
			"resource": "drpg:fighter_action_surge_charge"
		},
		"condition": {
			"type": "origins:and",
			"conditions": [
				{
					"type": "origins:resource",
					"resource": "drpg:fighter_action_surge_charge",
					"comparison": ">",
					"compare_to": 0
				},
				{
					"type": "origins:or",
					"conditions": [
						{
							"type": "origins:and",
							"conditions": [
								{
									"type": "origins:resource",
									"resource": "drpg:fighter_action_surge_cooldown",
									"comparison": "<=",
									"compare_to": 30
								},
								{
									"type": "origins:resource",
									"resource": "drpg:fighter_action_surge_charge",
									"comparison": "<",
									"compare_to": 30
								}
							]
						},
						{
							"type": "origins:resource",
							"resource": "drpg:fighter_action_surge_cooldown",
							"comparison": ">",
							"compare_to": 30
						}
					]
				}
			]
		}
	},
	"reset_on_attack_secondary": {
		"type": "origins:active_self",
		"key": {
			"key": "key.attack",
			"continuous": true
		},
		"entity_action": {
			"type": "origins:modify_resource",
			"modifier": {
				"operation": "set_total",
				"value": 60
			},
			"resource": "drpg:fighter_action_surge_charge"
		},
		"condition": {
			"type": "origins:resource",
			"resource": "drpg:fighter_action_surge_charge",
			"comparison": ">",
			"compare_to": 30
		}
	},
	"reset_on_sprint": {
		"type": "origins:active_self",
		"key": {
			"key": "key.sprint",
			"continuous": true
		},
		"entity_action": {
			"type": "origins:modify_resource",
			"modifier": {
				"operation": "set_total",
				"value": 0,
				"resource": "drpg:fighter_action_surge_cooldown"
			},
			"resource": "drpg:fighter_action_surge_charge"
		},
		"condition": {
			"type": "origins:and",
			"conditions": [
				{
					"type": "origins:resource",
					"resource": "drpg:fighter_action_surge_charge",
					"comparison": ">",
					"compare_to": 0
				},
				{
					"type": "origins:or",
					"conditions": [
						{
							"type": "origins:and",
							"conditions": [
								{
									"type": "origins:resource",
									"resource": "drpg:fighter_action_surge_cooldown",
									"comparison": "<=",
									"compare_to": 30
								},
								{
									"type": "origins:resource",
									"resource": "drpg:fighter_action_surge_charge",
									"comparison": "<",
									"compare_to": 30
								}
							]
						},
						{
							"type": "origins:resource",
							"resource": "drpg:fighter_action_surge_cooldown",
							"comparison": ">",
							"compare_to": 30
						}
					]
				}
			]
		}
	},
	"reset_on_sprint_secondary": {
		"type": "origins:active_self",
		"key": {
			"key": "key.sprint",
			"continuous": true
		},
		"entity_action": {
			"type": "origins:modify_resource",
			"modifier": {
				"operation": "set_total",
				"value": 60
			},
			"resource": "drpg:fighter_action_surge_charge"
		},
		"condition": {
			"type": "origins:resource",
			"resource": "drpg:fighter_action_surge_charge",
			"comparison": ">",
			"compare_to": 30
		}
	},
	"reset_on_jump": {
		"type": "origins:active_self",
		"key": {
			"key": "key.jump",
			"continuous": true
		},
		"entity_action": {
			"type": "origins:modify_resource",
			"modifier": {
				"operation": "set_total",
				"value": 0,
				"resource": "drpg:fighter_action_surge_cooldown"
			},
			"resource": "drpg:fighter_action_surge_charge"
		},
		"condition": {
			"type": "origins:and",
			"conditions": [
				{
					"type": "origins:resource",
					"resource": "drpg:fighter_action_surge_charge",
					"comparison": ">",
					"compare_to": 0
				},
				{
					"type": "origins:or",
					"conditions": [
						{
							"type": "origins:and",
							"conditions": [
								{
									"type": "origins:resource",
									"resource": "drpg:fighter_action_surge_cooldown",
									"comparison": "<=",
									"compare_to": 30
								},
								{
									"type": "origins:resource",
									"resource": "drpg:fighter_action_surge_charge",
									"comparison": "<",
									"compare_to": 30
								}
							]
						},
						{
							"type": "origins:resource",
							"resource": "drpg:fighter_action_surge_cooldown",
							"comparison": ">",
							"compare_to": 30
						}
					]
				}
			]
		}
	},
	"reset_on_jump_secondary": {
		"type": "origins:active_self",
		"key": {
			"key": "key.jump",
			"continuous": true
		},
		"entity_action": {
			"type": "origins:modify_resource",
			"modifier": {
				"operation": "set_total",
				"value": 60
			},
			"resource": "drpg:fighter_action_surge_charge"
		},
		"condition": {
			"type": "origins:resource",
			"resource": "drpg:fighter_action_surge_charge",
			"comparison": ">",
			"compare_to": 30
		}
	},
	"effect_particles": {
		"type": "origins:particle",
		"frequency": 4,
		"particle": {
			"type": "minecraft:flame",
			"params": ""
		},
		"condition": {
			"type": "origins:resource",
			"resource": "drpg:fighter_action_surge_active",
			"comparison": ">",
			"compare_to": 0
		}
	},
	"effect_attributes": {
		"type": "origins:conditioned_attribute",
		"modifiers": [
			{
				"attribute": "minecraft:generic.movement_speed",
				"operation": "multiply_base",
				"value": 0.2
			},
			{
				"attribute": "minecraft:generic.attack_speed",
				"operation": "multiply_total",
				"value": 0.5
			}
		],
		"tick_rate": 10,
		"condition": {
			"type": "origins:resource",
			"resource": "drpg:fighter_action_surge_active",
			"comparison": ">",
			"compare_to": 0
		}
	}
}