Skip to main content

Pulse Repeater

Projectiles pierce through enemies.

The first enemy standing behind the initial target receives critical damage.

Implementation​

We need to track the hit count to determine when to deal critical damage. However, the hit count cannot be stored on the source Actor, as this could cause the hit counts of different arrows to interfere with each other.

Therefore, we use ActorEntity for the arrow and add a HitCount Stat to it.

PulseRepeater_Arrow — Stat Repository
Environment: Arrow_Default
  • Arrow_HitCount—Clamped Int

The Effector contains two Effect Definitions: one for damaging the enemy and another for increasing the arrow's HitCount.

To increase the HitCount, the Target option is set to the Effector, which is the arrow's ActorEntity.

PulseRepeater › Effector_OnCollide — Prefab component
Effector_OnCollide: PulseRepeater
Trigger Actors:Enemy
Hit Limitation Type:By Count
Hit Limit:5
Team From:Source
Limit Exceeded Behaviour:Dispose
Do Not Effect Target Twice:true
Effect Pack (target Target, source Source):OnCollide
Effect Pack (target Effector, source Source):IncreaseHitCount

The PulseRepeater_Attack Stat has its own CritRate Stat to define the conditions for modifying the critical hit chance.

PulseRepeater_Attack — Stat (Clamped Float)
Stat (Clamped Float): PulseRepeater_Attack
Stat Key:PulseRepeater / FloatClamped / Attack
Relation: CriticalRate_Applying:PulseRepeater_CritRate

To modify the CritRate value based on the hit count, we use ConditionalModifiers with the CritProcessor.

MASContribution_CriticalHit_Float — MASContribution Critical Hit Float
MASContribution Critical Hit Float: MASContribution_CriticalHit_Float
Required Attributes:Modibifiable|Critable|AttributeStatsProcessable
Receiving Critical Rate Key:CriticalRate_Receiving
Applying Critical Rate Key:CriticalRate_Applying
Receiving Critical Multiplier Key:CriticalMultiplier_Receiving
Applying Critical Multiplier Key:CriticalMultiplier_Applying
Critical Result Attribute:Critical
Use Conditional Rate Modifier:true
Use Conditional Multiplier Modififier:true
Conditional Modifier Processor:ASContribution_ConditionalModifier(Float-Generic)

We can now modify the CritRate through the CritRateModifier Stat.

PulseRepeater_CritRate — Stat (Clamped Float)
Stat (Clamped Float): PulseRepeater_CritRate
Stat Key:PulseRepeater / FloatClamped / CritRate
Relation: ConditionalModifier_ApplyingAS:CritRateModifier

The CritRateModifier adds 1 to CritRate only when the arrow's HitCount is 1.

PulseRepeater_CritRateModifier — Stat (ConditionalModifier Float)
Stat (ConditionalModifier Float): PulseRepeater_CritRateModifier
Stat Key:PulseRepeater / ConditionalModifier / CritRateModifier
Default:1
Max:1
Single Stat Checker › Stat › Actor:Effector
Single Stat Checker › Condition:Is1(Int)