Epic Fight

Epic Fight

13M Downloads

[Suggestion]: "Stun animation" attribute for weapons.

Raccffy opened this issue ยท 1 comments

commented

Have you checked if there's any similar suggestions ?

  • I checked, there are no similar suggestions that have been reported.

Are you using the latest Epic Fight ?

  • I checked I'm using latest Epic Fight version.

Is this suggestion related to another mod? (i.e: add animations for X mod)

  • This is related to other mods.

The mod

Epic Fight 20.7.4

Minecraft Version

1.20.1

What's your suggestion?

Currently there's no options to override default weapons' stun attribute. I suggest to add them.

Why?

This allows for developers to customize their datapacks or per-item weapons even further by specifying stun animation attributes.

Examples

  • Let's take a fight between a regular player with iron-clad knight, which is holding a greatsword. Warrior performs an attack against opponent while sprinting, ground slams, but not the armorless player. Nobody can stand on legs after this. Developer can fix this behavior by providing "knockdown" stun attribute to a greatsword;
  • Datapack creator wants to knockdown players with any weapon. If stun attributes will be implemented, then he will go for it!

Implementation

As of Epic Fight 20.7.4, there are four stun animations avaliable:

  1. short [Reveal language file];
  2. long [Reveal language file];
  3. hold [Reveal language file];
  4. knockdown [Reveal language file].

Because we're working with attributes, we need to enumerate list above, because strings are not supported. By providing valid stun animation, developer can change weapon behavior.

Example 1

Let's extrapolate second example. Developer wants to knockdown entities using iron sword, no matter which attack animation was used. The result will be looking like this:

Datapack

[Datapack Name]/data/minecraft/capabilities/weapons/iron_sword.json

{
    "type": "epicfight:sword",
    "attributes": {
        "stun_animation": 3
    }
}
In-game command

/give @s iron_sword{AttributeModifiers:[{AttributeName:"epicfight:stun_animation",Amount:3,Name:"epicfight:stun_animation",UUID:[I;0,0,0,0]}]}

Note, that attribute UUID is zeroed. It must be randomized in the code.

Example 2

Let's take greatsword again. This time developer wants to invoke short stun animation for affected entities, if player used this weapon.

Datapack

[Datapack Name]/data/epicfight/capabilities/weapons/iron_greatsword.json

{
    "type": "epicfight:greatsword",
    "attributes": {
        "stun_animation": 0
    }
}
In-game command

/give @s iron_sword{AttributeModifiers:[{AttributeName:"epicfight:stun_animation",Amount:0,Name:"epicfight:stun_animation",UUID:[I;0,0,0,0]}]}

Note, that attribute UUID is zeroed. It must be randomized in the code.

Side effects

Because we're adding new attribute, players can change base value by using /attribute command. For example, player wants to invoke "hold targets" stun animation with every hit. This side effect can be applied by using /attribute @s epicfight:stun_animation base set 2 command.

Error handling

  • Out of range values will yield in "short" stun animation;
  • Floating point numbers will be rounded down (e.g. 3.6 will become 3).
commented

Players can change the stun type between Short and Long stun by increasing the Impact value. And those Hold and Knockdown stun types are for special cases that must keep the entity in a location (Relentless Combo, Innate skill of Glove), or make players feel overwhelmed (Ender Dragon). It would be bad to allow players to configure the stun type of weapons, which makes the game too loose and ruins the balance significantly.