AbilityTargeting - DragonSurvivalTeam/DragonSurvival GitHub Wiki

Description

AbilityTargeting is the core structure for handling all of the effects and targeting logic for abilities. It contains various ways to target entities or blocks (area, breath weapon, look direction, etc...) as well as all of the potential effects that could be applied to those entities or blocks.

Parents

This object is used by the following objects:

  1. ActionContainer

Dependencies

The object references the following objects:

  1. AbilityEntityEffect
  2. AbilityBlockEffect
  3. Predicate (mod specific predicates here)

Schema

{
    "applied_effects": [AbilityEntityEffect or AbilityBlockEffect]     // [Mandatory] || A list of the effects to apply.
    "target_conditions": [Predicate]                                   // [Mandatory] || The conditions that must be met for the effects to apply.
    "target_type": [AbilityTargetingType]                              // [Mandatory] || The type of targeting to use.
    ... data based off of type of targeting
}

Targeting Types

Area

Targets blocks or entities in a radius around the caster. The type name is "area".

Schema

{
    "radius": [LevelBasedValue]     // [Mandatory] || The radius where the effects apply.
}

Dragon Breath

Targets blocks or entities in a box in front of the player. The type name is "dragon_breath".

The breath weapon range is already calculated based off of the size of dragon and the "dragon_breath_range" attribute. You can only multiply that range in this definition.

Schema

{
    "range_multiplier": [LevelBasedValue]     // [Mandatory] || How much to multiply the breath weapon range by.
}

Looking At

Targets a single block or entity that is being looked at by the player. The type name is "looking_at".

Schema

{
    "range": [LevelBasedValue]               // [Mandatory]  || How much distance can blocks or entities still be targeted.
}

Self

Targets the caster. The type name is "self".

Schema

{
    "remove_automatically": [bool]           // [Optional]  || Whether the effects remove themselves automatically if the conditions are no longer met. Defaults to true.
}