# KYVREM'S ARSENAL

This requires the "frontierresourcepack" to work.

If you have feedback, questions, or bugs to report, please message "kyvrem" on Discord. 

Note that this is a passion project, and I have other things going on in my life right now. 

This was also made for a specific private server, and has lore relating to that server. Some mechanics may reflect the lore, but it should be all goods.

# WARNING
Most of this datapack demonstrates mechanics and systems that do not naturally occur within the world. Someone with operator permissions will need to spawn in most of the items.

This datapack is also unfinished, and will have a few bugs. Some parts of the Admin Panel may also not give you anything or lead anywhere - this is content I haven't finished.

The datapack may also not be particularly performant. I have tried my hardest to make it as optimised as possible, but there are limits

# CRUCIAL
## SETUP
The function ``function kyvremsweapons:universalsetup`` must be run when the datapack is set up.

When the datapack and resource pack are properly set up, someone with operator permissions should run /trigger AdminPanel and then click the tellraw that appears. This gives the operator a tag.

## ADMIN PANEL
When someone with this tag runs /trigger AdminPanel again, they should be able to view a dialogue. Here, you can access various useful things, such as ways to summon and give items. THE ADMIN PANEL IS CRUCIAL TO NAVIGATING THE DATAPACK.

## BONFIRES
When you have a campfire in your hand, you can also run /trigger Bonfire to place a Bonfire. THIS IS ALSO CRUCIAL. This allows you to switch out your spells. You will have no spells when you spawn in. You should be able to give yourself all the spells if you go into the MANAGEMENT tab of the admin panel. 

!!!
When picking a selector, choose either self or everyone, as specific doesn't work.
!!!

# TUTORIAL
## MECHANICS
You should have a text UI displaying your stats - a healthbar, HP, MP, P, and various squares such as [DG].

HP represents your health. This naturally regenerates over time, but can be sped up by the regeneration effect, using bonfires, or staying out of combat. 
If you are in combat, your health regeneration is greatly slowed. 
To assist with this, Health Flasks can be acquired from the Admin Panel under "tools". 
They have limited charges, which can be regained by either dying or going to a bonfire. Right click to drink.

MP represents your mana. Mana does not regenerate naturally. To regenerate mana, you can either rest at a bonfire, die, or acquire a MANA FLASK. It is in the same location as a Health
Flask and follows similar mechanics.

P represents your posture. You want this to be as low as possible. If you are hurt when it meets or exceeds your maximum posture, you will be BLOCK BROKEN, and temporarily vulnerable. 
You emit red particles when block broken. Posture is discussed later, but know that in combat it is VERY slow to reduce.

The various squares such as [DG] represent cooldowns. DG is dodge, CR is critical, PR is parrying.

## STATS
Your stats are determined by the armour you are wearing.

Stats also affect how much damage your weapon deals. You can just read the weapons description to see how much it scales with a certain attribute - for example, it might say GRIT.
In general, though:
- Light weapons scale on Deftness
- Medium weapons scale on Grit
- Heavy weapons scale on Strength
- Ranged weapons scale on Precision

And:
- Sorceries scale on Intelligence
- Incantations scale on Charisma
- Heresies scale on Insight

## DODGING
You can quickly crouch and uncrouch (tapping shift once very quickly should do the trick, provided toggle isn't on) to DODGE.

Dodging an attack allows you to entirely avoid damage. However, it always goes on cooldown - regardless of if you dodge an attack or not.
Dodging is thus best saved for mobility. You can also dodge midair to launch yourself forwards.

Your Deftness stat increases the amount of time your dodge lasts.

## BEING KNOCKED
If you reach zero health and don't meet circumstances that would instantly kill you, you become KNOCKED.

During this time, other players can right click you to pick you up. To drop the player, shift right click with a weapon. I am aware this is a very clunky system.

Other players can also simply shift left click with a weapon to perform an execution. If you are hit by this, they will begin executing you. Once the timer is complete, you DIE.
This timer can be interrupted with damage.

## WEAPONS
Weapons can be acquired through the admin panel, but the mace, swords, and trident should automatically convert to their custom datapack version when held in your hand.

When holding MOST WEAPONS, you can left click to do a melee attack and right click to parry. Parrying allows you to ignore damage if you time it successfully.
If you parry but are not hit by an attack, your parry will GO ON COOLDOWN. 

If you parry an attack, you lose posture and your enemy gains posture. This amount of posture is determined by the average of you and your enemies weapons WEIGHT stat.

Hold down right click to initiate a block. If hit while blocking, you take an amount of damage determined by the attacking weapons CHIP DAMAGE. This is a percentage.
Being hit while blocking also makes you take Posture damage.

Your weapon also has PEN. This is a percentage of your weapon damage that, to make a long story short, bypasses your enemies armour stats.

Weapons typically have unique abilities. Press F, or whatever your switch hands keybind is set to, to perform a CRITICAL ATTACK. This is a special weapon ability. 
Not all weapons have unique abilities, unfortunately.

### GUNS
Guns do not follow this system. Instead, guns are very... complicated.

Guns display an ammo counter. Shift right click to reload the gun. Some guns reload magazines, others do it bullet by bullet.

There are two states for guns. In the standard state, you are RELAXED. Left clicking allows you to gun bash, and right clicking allows you to change your state to AIMING.
When aiming, you can left click to shoot the gun. Note automatic guns will fire in large bursts, and that all guns have windup for balancing sake. Right clicking when AIMING allows you to switch back to RELAXED.

Bullets should have fairly accurate hitboxes, able to pass through doors and stairs pretty easily, thanks to a system Cloudwolf made.

If you are using a gun, YOU CANNOT PARRY. Keep this in mind. If you are using a melee weapon and fighting a gun user, simply parry most of their attacks.

### BOWS
Bows - specifically White Death, my prototype (found in the Admin Panel) - have a unique system. You can right click to use the bow like you would in Vanilla. 

But if you left click, you fire off a quick hitscan arrow. This is ideal for short range combat, but bad for long range.

### AXES, TRIDENTS, AND THE MACE
Some weapons allow you to shift right click to switch "modes". By some weapons, I mean specifically axes. You can shift between a woodcutting mode (for survival stuff!) and a combat mode (FOR MURDER!).

Tridents can switch between stabbing mode (where they can also parry attacks) and vanilla mode (where they can be thrown) by simply using their critical attack.

Maces will automatically switch between vanilla mode and datapack mode by simply falling. If you fall for long enough, you will enable vanilla mode and be able to annihilate your enemies as you regularly do.
Note maces heavily synergise with their critical attack, as it launches you into the air.

## SPELLS
To use spells, you first need to go into weapons and give yourself CATALYSTS. Catalysts are lapis lazuli. You should have two. 

Provided you have put spells in these in the bonfire, you can switch between them with right click and use them with left click. This is a clunky system, but it works for now.

### MODIFICATION
By going to summoning => services => spell modification table in the Admin Panel, you can spawn in a table for modifying spells. Simply hold out a catalyst on the spell slot you want and right click the air above the table. This places the spell in.

When a spell is cast, it goes into cooldown - displayed by a timer.

Then, get spell modifiers (which you can find in the Admin Panel) and place them into the spell modification table.

Left click or right click the table again to choose if you want to dismantle (remove all the current spell modifiers), cancel (add no new ones), or forge (add all the new ones to the spell).

NOTES:
- The colour of their name corresponds to what type of modifier they are.
- Normal modifiers affect the stats. Note these ALWAYS increase the mana cooldown.
- Ancient Modifiers add special effects to the spell, like refunding half your cooldown if you hit an attack.
- Echo Modifiers modify the effects of a spell. Most spells cannot be changed by modifiers.

#### SPECIFIC MODIFIERS
Echo Modifiers that change how spells work.
Flamestrike: Blasting Stone
Ball Lightning: Seaglass
Tempest Cloak: Dead Rock
Floral Breeze: Dead Rock

## ENEMIES
These aren't in the admin panel for some reason, but these are my SMART ENEMIES. They should be able to parry you, cast spells, and invent 500 new bugs!

function kyvremsweapons:summon/debugging/spellsword
function kyvremsweapons:summon/debugging/ranger
function kyvremsweapons:summon/debugging/mage
function kyvremsweapons:summon/debugging/advancedmage

You can also find more of them under Combustion Empire's tab in the Smart AI section of summoning.

## COOL STUFF
All damage from vanilla Minecraft is translated into datapack damage, meaning that most forms of damage should work. 
There are also systems in place to automatically kill you if you say, start drowning, BUT THEY ARE NOT PERFECT.

You can also technically parry regular mobs. If you are parrying when a regular mob hits you, said mob will stunned and given slowness.

If you parry an attack but another one hits you right afterwards, you will automatically parry it - these are AUTOPARRY FRAMES. Note some spells can sometimes prevent auto-parry frames - such as the Hundred Spears spell. 

## FINAL NOTES
There's a bit more I haven't mentioned, but I'm sure it'll be fine for now -w-

Thanks for trying this out!