Bro Code logoBRO CODE CRINDEPENDENT GAME DEV TOOLS
← All abilities
ABILITY 06

LifeSteal

Attack the nearest valid target and request healing based on the configured damage amount and life-steal fraction.

Activation

LifeStealButton

Example use

Recover health by dealing damage during an encounter.

Ability documentation
CHARACTER ABILITY
SETUP GUIDE

Set up this ability

Component
CharacterLifeSteal
Source
Scripts/Abilities/CharacterLifeSteal.cs
Animator bools
LifeSteal

Component dependencies

Requirements for this ability and its targets
ComponentWhere to add or assign itPurpose / setup
HealthCharacter GameObjectRequired for restoring character health.

Visual component dependencies

These components support the associated effect. A missing optional visual does not by itself imply that the gameplay mechanic cannot run.

Visual dependencies
ComponentWhere to add or assign itPurpose / setup
LifeStealRadiusEffect + SpriteRendererRadiusEffectPrefab rootRequired for the supplied expanding-radius visual. Assign LifeStealRadiusEffect.
  1. Add CharacterLifeSteal to a CharacterPlus character with Health.
  2. Set the ability range and target layer mask for your scene.
  3. Place a valid target within the configured range.
  4. Set DamageAmount, Range and LifeStealPercentage. Optionally assign LifeStealRadiusEffect to RadiusEffectPrefab.
  5. Press LifeStealButton near a living valid target. The nearest valid target is cached before ActivationDelay.

Inspector reference

These are C# field declaration defaults. Existing prefab and scene values can override them. Shared fields are documented under Ability Configuration.

CharacterLifeSteal fields
FieldTypeDeclared default
DamageAmountfloat10f
LifeStealPercentagefloat0.5f
Rangefloat2f
TargetLayerMaskLayerMaskNot assigned in declaration
TargetFlickerDurationfloat0.2f
TargetInvincibilityDurationfloat0.5f
RadiusEffectPrefabGameObjectNot assigned in declaration

Usage notes

  • Healing is calculated as DamageAmount × LifeStealPercentage, rather than measured damage actually lost by the target. With declaration defaults, this requests 5 health from a 10-damage attack.
  • If no valid target is found, activation returns without starting.