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

Berserker

Activate a low-health buff once per life, with configurable melee damage and incoming-damage refunds. Automatic or button mode.

Activation

Automatic / BerserkerButton

Example use

A last stand when a fight reaches critical health.

Ability documentation
CHARACTER ABILITY
SETUP GUIDE

Set up this ability

Component
CharacterBerserker
Source
Scripts/Abilities/CharacterBerserker.cs
Animator bools
BerserkerTransform, BerserkerActive

Component dependencies

Requirements for this ability and its targets
ComponentWhere to add or assign itPurpose / setup
HealthCharacterRequired for the health threshold and incoming-damage refund.
DamageOnTouchCharacter hierarchyRequired on the attacks that should receive the damage bonus. Components under a non-melee Weapon are excluded.

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
BerserkerAuraCharacter, or explicitly linked to the abilityOptional visual component. Assign Ability, TargetSprite and AuraShader; missing references disable the aura component, not the Berserker mechanic.
  1. Add CharacterBerserker to a CharacterPlus character with Health.
  2. Set ActivationMode to Automatic or Button. Both modes require living health at or below HealthThresholdPercent (default 0.25).
  3. Choose a positive ActiveTime for a temporary buff; the inherited default 0 is indefinite.
  4. DamageMultiplier defaults to 1.5 for eligible DamageOnTouch components in the character hierarchy. Non-melee Weapon parents are excluded.
  5. In Button mode select BerserkerButton and verify the matching Legacy input names for your PlayerID.
  6. Configure BerserkerTransform and BerserkerActive bools in the Animator; exercise damage, transformation and respawn in Play Mode.

Inspector reference

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

CharacterBerserker fields
FieldTypeDeclared default
ActivationModeBerserkerActivationModeBerserkerActivationMode.Automatic
HealthThresholdPercentfloat0.25f
DamageMultiplierfloat1.5f
DamageTakenMultiplierfloat0.5f
DamageApplyModeBerserkerDamageApplyModeBerserkerDamageApplyMode.OnTransformEnd
IsTransformingbool> _transforming

Usage notes

  • Only one activation is allowed per life; ResetAbility clears the used flag.
  • DamageTakenMultiplier defaults to 0.5 and controls the damage refund applied through Health.OnHit.