HitProps
HitProps.new(damage, flags, element, secondary_element, context?, drag?)
damage: integerflags: See flagselement: Elementsecondary_element: Elementcontext: An AttackContext (obtained by entity:context())drag: Drag defaults to Drag.None
Returns a new HitProps instance.
HitProps.new(damage, flags, element, context?, drag?)
Returns a new HitProps instance.
HitProps.from_card(card_properties, context?, drag?)
Returns a new HitProps instance.
hit_props.damage
A number, used to calculate how much health to take away from entities hit by the attack.
hit_props.flags
Any of the values below, or combined using bitwise or (|)
Hit.NoneHit.RetainIntangibleprevents intangibility from being lost if the attack pierces.Hit.NoCounterprevents the attack from countering.Hit.DragAllows the drag property to drag the entity.Hit.Draindisables the hit flash and countering, most defense rules should check for Drain to ignore hits.Hit.Flinchread by the hit entity to cancel attacks and play a flinch animation.Hit.Flashapplies the default intangible rule to the hit entity and flickers the entity's sprite.Hit.PierceInvisread by defense rules to pierce defenses.Hit.PierceGuardread by defense rules to pierce defenses.Hit.PierceGroundread by defense rules to pierce defenses.Hit.Freezeapplies freeze status on hit.Hit.Paralyzeapplies paralyze status on hit.Hit.Rootapplies root status on hit.Hit.Blindapplies blindness status on hit.Hit.Confuseapplies confusion status on hit.- Hit.[flag_name]
hit_props.status_durations
A table that maps frame durations for status hit flags.
hit_props.element
An Element. If element or secondary_element is super effective against an entity's element, this attack will deal 2x damage.
hit_props.secondary_element
An Element. If element or secondary_element is super effective against an entity's element, this attack will deal 2x damage.
hit_props.drag
hit_props.context
The AttackContext obtained by entity:context()
Hit
Hit.duration_for(hit_flag, level)
-level: Starts at level 1, clamps to valid (defined) duration levels.
Durations are specified in Status Packages
Returns the duration in frames for a status effect at a specific level, or 1 if no durations are specified.
Hit.mutual_exclusions_for(hit_flag)
Returns a number, representing all of the mutually exclusive hit flags for bit manipulation.
Element
Element.NoneElement.FireElement.AquaElement.ElecElement.WoodElement.SwordElement.WindElement.CursorElement.SummonElement.PlusElement.Break
Element.is_weak_to(element_a, element_b)
Returns true if element_a is weak to element_b.
Drag
Drag.new(direction?, distance?)
Returns a new Drag instance.
Drag.None
Returns a new Drag instance.
Same as Drag.new()
drag.direction
Direction, the direction to move the entity.
drag.distance
Number, the amount of tiles to drag the entity.
AttackContext
Data tracking the attacker and HitProps overrides. Obtained by entity:context() and passed through HitProps. Updates when a player or character starts an attack, or when HitProps are set on an entity. By default, the context is used by the engine to pass flags related to countering, see living:set_counterable().
context.aggressor
The EntityId of the attacking entity.
context.flags
See HitProps.flags
context.status_durations
A table that maps frame durations for status hit flags.