Bishop Charge
Based on game build 714014 | Last updated: 2026-03-04
Overview
bishop_charge defines three prefabs used to simulate the Bishop chesspiece's attack in DST's Clockwork Arena: two deprecated projectile/hit variants (bishop_charge, bishop_charge_hit) and one current area-of-effect variant (bishop_charge2_fx). The current variant (bishop_charge2_fx) uses an entity-based AoE explosion with dynamic target detection, light effects, and electric damage application. It relies on the combat, updatelooper, and projectile components for behavior, and integrates with clockwork_common for AoE target acquisition.
Usage example
-- Create the current Bishop attack effect entity
local inst = SpawnPrefab("bishop_charge2_fx")
-- Assign the entity responsible for this attack
if inst.SetupCaster then
inst:SetupCaster(bishop_entity)
end
Dependencies & tags
Components used: combat, updatelooper, network, soundemitter, light, animator, transform, physics
Tags: Adds projectile (deprecated), FX, NOCLICK, notarget; checks electricdamageimmune.
Properties
No public properties are initialized in the constructor. Runtime state is stored on the instance (e.g., inst.caster, inst.targets, inst.fadet, inst.fadeflicker).
Main functions
SetupCaster(inst, caster)
- Description: Assigns the attacking entity as
caster, sets the prefab override for death announcements, plays the explosion sound once, and triggers an immediate AoE check if attacks have already occurred (e.g., if reattached). - Parameters:
inst(Entity) – Thebishop_charge2_fxinstance.
caster(Entity) – The entity performing the attack (typically a Bishop chesspiece). - Returns: Nothing.
OnUpdate(inst, dt)
- Description: Periodic function called via
updatelooperthat applies electric AoE damage to nearby entities within radiusRADIUS, plays sound once, animates light fade/flicker usingeasing.inQuad, and ensures targets are only hit once. Ignores hit range checks on thecombatcomponent while active. - Parameters:
inst(Entity) – Thebishop_charge2_fxinstance.
dt(number) – Delta time in seconds since last frame. - Returns: Nothing.
- Error states: Does nothing if
casteris invalid or not attached (falls back toinst.components.combat).
DisableHits(inst)
- Description: Removes the
OnUpdatecallback fromupdatelooper, disables the entity's light, and clears thetargetstable to stop further damage application. - Parameters:
inst(Entity) – Thebishop_charge2_fxinstance. - Returns: Nothing.
KeepTargetFn(inst)
- Description: Used by the
combatcomponent; always returnsfalseto prevent the Bishop attack from maintaining target lock. - Parameters:
inst(Entity) – The entity (unused). - Returns:
false.
Events & listeners
- Listens to:
animover(on deprecatedbishop_chargeand FX entities) – triggers delayed removal. - Pushes:
electrocute(viaPushEventImmediate) to each affected target with{ attacker = combat.inst, stimuli = "electric", numforks = 0 }.