Spike Trap Component
This component belongs to the following package:
- com.yahaha.props.traps
Description
The Spike Trap Component activates based on a combination of time intervals and probability weights. It can continuously fall and damage any colliding objects, or it can be triggered when players enter its designated area.
Properties
| Properties | Description |
|---|---|
| Stun Time | The length of time in seconds that colliding objects will be stunned when the trap is activated. Default value: 0. |
| Damage Trigger Object | The YahahaObject that serves as the trigger for the trap, activating damage when an object enters its detection area. |
| Loop Mode | Determines if the trap will continuously activate over time. Mode Weights: The relative probability of the loop mode being selected. Higher weights increase the likelihood of continuous activation. A weight of 0 means this mode will not be activated. Ranges from 0 to 10000. Default value: 0. |
| Loop Config | Weights: The relative probability of each loop configuration being activated. A weight of 0 means that configuration will not be triggered. Default value: 0. Cooldown Time: The duration that must pass after the Spike Trap activates before it can be activated again. |
| Trigger Mode | Determines how the trap will inflict damage when players enter its trigger area. Mode Weights: The relative probability of the trigger mode being selected. Higher weights increase the likelihood of triggering damage upon player entry. A weight of 0 means this mode will not be activated. Ranges from 0 to 10000. Default value: 0. |
| Trigger Object | The YahahaObject that acts as the trigger for the trap, activating damage when a player enters its trigger box. |
Trigger
Events:
- SpikeTrap.OnSpikeTrapActivate
- Description:
- Triggers when Spike Trap is activated
- EventArgs:
- Description:
- SpikeTrap.OnSpikyTrapStun
- Description:
- Triggered when the Spike Trap is turned off, it reactivates after a certain cooldown
- EventArgs:
- Description:
- SpikeTrap.OnSpikeTrapStunEnd
- Description:
- Triggered when the Spike Trap is reactivated
- EventArgs:
- Description:
Action:
- SpikeTrapActivate
- Description:
- Trigger the Spike Trap
- Description:
- SpikeTrapStun
- Description:
- Disabling the Spike Trap will retrigger after a certain cooldown
- Description: