Base
Overview
UCAbstractSkill is the abstract base class for C++ skill implementations. It inherits UObject and implements ICSkill. Subclasses must override applySkill to define skill behavior. The manager retains a reference to otherInformation via ungarbaged to prevent garbage collection during execution.
Functions
| Name | Description |
|---|---|
| applySkill | Pure virtual. Implement to define skill execution logic |
| applySkillWithRetain | Calls applySkill after retaining otherInformation from GC |
| withSpecificData | Template helper to retrieve a typed row from specificSkillDataRH |
// Implementing a custom skill
UCLASS()
class UMyFireballSkill : public UCAbstractSkill {
GENERATED_BODY()
public:
virtual bool applySkill(const FCSkillDataStruct& skillDataStruct, AActor* source, UObject* otherInformation) override {
// direct skill logic
return true;
}
};
// Using withSpecificData to access skill-specific DataTable row
virtual bool applySkill(const FCSkillDataStruct& skillDataStruct, AActor* source, UObject* otherInformation) override {
return withSpecificData<FMyFireballDataStruct>(skillDataStruct, [source](FMyFireballDataStruct* data) {
// use data->damage, data->radius, etc.
return true;
});
}