Deadeye String
Landing the shot within a specific timing window deals a critical hit.
The critical damage multiplier depends on how accurately the shot is released within that window.
Implementation
Our skill has two phases: charging and shooting.
We need to track the charge value during the charging phase. However, we cannot store this value directly on the Actor because multiple arrows can be fired in sequence. In that case, storing the charge value on the Actor could cause the charge values of different arrows to interfere with each other.
Therefore, we attach the charge value to each arrow. For this, we use ActorEntity for the arrow prefab, allowing us to store and access the charge value through the arrow's Stats.
The arrow also has other Stats for properties such as direction, speed, and distance.
Arrow_Default — Environment
Arrow_DefaultDeadeyeString_ArrowCharge—
Clamped FloatDeadeyeString_Arrow_TravelDistance—
Clamped FloatDeadeyeString_Arrow_MoveSpeed—
Clamped FloatDeadeyeString_Arrow_Direction—
Vector3SourceActor—
ActorHitCount—
Clamped IntTeamNo—
Int
Our Skill Targeter contains a SkillInitializer Effect Pack that applies the required initialization effects to the arrow's ActorEntity.
DeadeyeString_Targeting_2 — Skill Targeting Skill Shot
DeadeyeString_Targeting_2DeadeyeStringSkillParenter_GlobalSkillPositioner_OffsetToSourceBodySkillRotator_OffsetToSourceBodySkillProjectileLayouter_ForwardtrueDeadeyeString_SkillInitializerNow, let's see what the Deadeye String skill delivers to its target.
DeadeyeString_Attack — Float Stat Effect (MAS)
DeadeyeString_AttackStandard_FloatEverythingHealth-5AttackDeadeyeString_AttackRangedAttackWe use the DeadeyeString_Attack Stat to apply skill specific behaviors. Let's take a look at its configuration.
DeadeyeString_Attack — Stat (Clamped Float)
DeadeyeString_AttackDeadEyeString / FloatClamped / AttackDeadeyeString_CritRateDeadeyeString_CritMultiplier1100As you can see, we have skill specific CritRate and CritMultiplier Stats.
We want both of these values to change based on the arrow's charge value. Therefore, we enable UseConditionalModifier for both CritRate and CritMultiplier in the CritProcessor, allowing their values to be conditionally modified.
MASContribution_CriticalHit_Float — MASContribution Critical Hit Float
MASContribution_CriticalHit_FloatModibifiable|Critable|AttributeStatsProcessableCriticalRate_ReceivingCriticalRate_ApplyingCriticalMultiplier_ReceivingCriticalMultiplier_ApplyingCriticaltruetrueASContribution_ConditionalModifier(Float-Generic)We also need to add ConditionalModifier_ApplyingAS relations to the CritRate and CritMultiplier Stats.
DeadeyeString_CritRate — Stat (Clamped Float)
DeadeyeString_CritRateDeadEyeString / FloatClamped / CritRateDeadeyeString_CritRateModifierByChargetrue1DeadeyeString_CritMultiplier — Stat (Clamped Float)
DeadeyeString_CritMultiplierDeadEyeString / FloatClamped / CritMultiplierDeadeyeString_CritMultiplierModifierByChargetrue3The CritRateModifier Stat adds 1 to CritRate as a flat contribution when the charge value is between 0.41 and 0.59.
DeadeyeString_CritRateModifierByCharge — Stat (ConditionalModifier Float)
DeadeyeString_CritRateModifierByChargeDeadEyeString / ConditionalModifier / CritRateModifier11EffectorIn0.41To0.59(Float)EffectorStatToMultiplier_ArrowCritMultiplierModifierByChargeThe CritMultiplierModifier Stat scales the CritMultiplier value based on the charge value's closeness to 0.41.
DeadeyeString_CritMultiplierModifierByCharge — Stat (ConditionalModifier Float)
DeadeyeString_CritMultiplierModifierByChargeDeadEyeString / ConditionalModifier / CritMultiplierModifier11EffectorIn0.41To0.59(Float)trueEffectorStatToMultiplier_ArrowCritMultiplierModifierByCharge