Skip to content

CCEffect

SilicDev edited this page Feb 21, 2024 · 1 revision

CCEffect

Class: CCEffect

Inherits: Resource < RefCounted < Object

Base class for all Crowd Control effects.

Description

Note: The methods in this class will not notify Crowd Control of any changes when called manually.

Properties

type name default
PackedStringArray categories PackedStringArray()
String description ""
String display_name ""
Texture2D icon null
Color icon_color Color(1, 1, 1)
StringName id &""
int max_retries 3
Morality morality Moraility.NEUTRAL
float pending_delay 0.5
bool pooling_disabled false
int price 10
float retry_delay 5.0
bool sellable true
int session_max 0
bool visible true

Methods

type signature
bool _can_run() virtual const
EffectResult _trigger(effect: CCEffectInstance) virtual
bool can_run()
EffectResult trigger(effect: CCEffectInstance)

Enumerations

EffectResult

  • SUCCESS = 0
  • FAILURE = 1
  • UNAVAILABLE = 2
  • RETRY = 3
  • QUEUE = 4
  • RUNNING = 5

Morality

  • NEUTRAL = 0
  • GOOD = 1
  • EVIL = 2

Property Descriptions

PackedStringArray categories [default: PackedStringArray()] : set_categories(value) setter : get_categories() getter

The effect categories this effect is assigned to. Used as filters in the Crowd Control menu.

String description [default: ""] : set_description(value) setter : get_description() getter

The description of this effect.

String display_name [default: ""] : set_display_name(value) setter : get_display_name() getter

The name that should be displayed for this effect.

Texture2D icon [default: null] : set_icon(value) setter : get_icon() getter

The icon to display for this effect.

Color icon_color [default: Color(1, 1, 1)] : set_icon_color(value) setter : get_icon_color() getter

The color to tint the effect icon with.

StringName id [default: &""] : set_id(value) setter : get_id() getter

The id used to identify this effect.

int max_retries [default: 3] : set_max_retries(value) setter : get_max_retries() getter

The maximum amount of times the engine should retry an effect before sending a failure response.

Morality morality [default: Morality.NEUTRAL] : set_morality(value) setter : get_morality() getter

The morality of this effect, i.e. if this effect hurts or helps the player.

float pending_delay [default: 0.5] : set_pending_delay(value) setter : get_pending_delay() getter

The delay the engine should wait for before triggering this effect.

bool pooling_disabled [default: false] : set_pooling_disabled(value) setter : is_pooling_disabled() getter

If true users are unable to pool coins to trigger this effect.

Note: When changed a request is send to Crowd Control to adjust the price.

int price [default: 10] : set_price(value) setter : get_price() getter

The price in coins of this effect. Must be greater than 0.

Note: When changed a request is send to Crowd Control to adjust the price.

float retry_delay [default: 5.0] : set_retry_delay(value) setter : get_retry_delay() getter

The delay the engine should wait for before retrying this effect.

bool sellable [default: true] : set_sellable(value) setter : is_sellable() getter

If false users are unable to purchase this effect.

Note: When changed a request is send to Crowd Control to adjust the price.

int session_max [default: 0] : set_session_max(value) setter : get_session_max() getter

The maximum amount of instances of this effect that can be triggered per session.

Note: When changed a request is send to Crowd Control to adjust the price.

bool visible [default: true] : set_visible(value) setter : is_visible() getter

If false this effect is hidden in the Crowd Control menu.

Note: When changed a request is send to Crowd Control to adjust the price.

Method Descriptions

bool _can_run() virtual const : Virtual override to customize when this effect can be triggered.

EffectResult _trigger(effect: CCEffectInstance) virtual : Virtual override to override the behaviour of this effect.

bool can_run() : Returns false if the effect is unable to run.

EffectResult trigger(effect: CCEffectInstance) : Triggers this effect.

Clone this wiki locally