Adding a New Attack Skill
Step 1: Create Skill Configuration
Option A: Duplicate Existing Skill

Navigate to:
Assets/RGame/RoguelikeKit/ScriptableObjects/DataSO/Skill/AttackSkill/BothSideSkill.assetRight-click an existing skill → Duplicate
Rename (e.g.,
FireWhirlwind_Skill.asset)
Option B: Create New Skill
Right-click in folder → Create → RGame → RoguelikeKit → Skill → BothSideSkill
Name it with clear convention (e.g.,
IceSpear_Skill.asset)
Step 2: Configure Skill Parameters
Open the new skill config in Inspector and modify:
SkillType
Attack/Attribute
SkillIcon
UI display icon
Key
Unique identifier
MixAttributeSkillKey
Required attribute skill for super-weapon upgrade
SkillPrefab
Velocity
Movement speed
Duration
Active time (seconds)
CD
Cooldown time
Damage
Base damage value
Amount
Initial projectiles
Area
Effect size/scale
UpgradeAttribute
Enhanced stat per level

Step 3: Add Motion/Visual Effects of Attack Skills
Since it's difficult to modify the attack mode of the skill without writing code. Then, I will teach you how to quickly write different attack modes with the help of AI. I believe that even if you have no coding experience, you can quickly create the motion effects you want.
All you need to do is copy the following paragraph and specify the motion effect you want to write. As well as the names of the two scripts, it is best to name one ending in SkillCast and the other in Skill.
Here's the skill launcher that's already available,
and the script for the skill itself, which I'd like you to modify to get a
different motion effectusing. I hope you can give me the full code and tell
me how to use it.
UnityEngine;
namespace RGame.RoguelikeKit
{
public class CircularAttackSkillCast : SkillCast
{
[SerializeField] private float _midAngle;
private float _angle = -45;
public override void Cast(SkillDataSO skillData)
{
base.Cast(skillData);
int amount = _stat.GetValue("Amount") + skillData.Amount;
int damage = (int)(_stat.GetValue("Might") * skillData.Damage * 0.01f) + 1;
float velocity = skillData.Velocity * _stat.GetValue("SkillSpeed") * 0.01f;
float duration = skillData.Duration * _stat.GetValue("Duration") * 0.01f;
if (skillData.CurrentState is SkillCurrentState.Mixed)
{
for (int i = 0; i < 16; i++)
{
var go = _pool.Request(Key);
var skill = go.GetComponent<CircularAttackSkill>();
skill.transform.position = _globalConfig.GlobalPlayer.transform.position;
skill.transform.localScale = skill.transform.localScale * (_stat.GetValue("Area") + skillData.Area) * 0.01f * 2f;
_angle += 22.5f;
var rad = _angle * Mathf.Deg2Rad;
Vector2 dir = new Vector2(Mathf.Cos(rad), -Mathf.Sin(rad));
skill.OnDeath += HandleSkillDeath;
skill.Init(velocity,damage, duration, dir.normalized);
}
}
else
{
for (int i = 0; i < amount; i++)
{
var go = _pool.Request(Key);
var skill = go.GetComponent<CircularAttackSkill>();
skill.transform.position = _globalConfig.GlobalPlayer.transform.position;
skill.transform.localScale = skill.transform.localScale * (_stat.GetValue("Area") + skillData.Area) * 0.01f;
_angle += 45;
var rad = _angle * Mathf.Deg2Rad;
Vector2 dir = new Vector2(Mathf.Cos(rad), -Mathf.Sin(rad));
skill.OnDeath += HandleSkillDeath;
skill.Init(velocity,damage, duration, dir.normalized);
}
}
}
}
}
using UnityEngine;
namespace RGame.RoguelikeKit
{
public class CircularAttackSkill : SkillBase
{
private float _velocity;
private int _damage;
private float _duration = 1;
private float _timer;
private Vector3 _dir;
private void FixedUpdate()
{
_timer += Time.fixedDeltaTime;
if (_timer >= _duration)
{
_timer = 0;
OnDeath?.Invoke(this);
}
transform.position += _dir * (_velocity * Time.fixedDeltaTime);
}
public void Init(float velocity, int damage, float duration, Vector3 dir)
{
_velocity = velocity;
_damage = damage;
_duration = duration;
_dir = dir;
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("EnemyHit"))
{
other.GetComponent<EnemyHit>().Hit(_damage);
}
}
}
}
You will then get two scripts, one with SkillCast named at the end and the other with Skill named at the end.
Step 1: Generate Skill Scripts with AI
Copy the provided
CircularAttackSkillCastandCircularAttackSkillscriptsAsk your AI assistant to:
"Modify these scripts to create a [describe your desired motion effect] pattern"
Example requests:
"Make projectiles spiral outward"
"Create a boomerang return effect"
"Make skills orbit around the player"
Step 2: Implement the Scripts
Create New Components:
In Unity, navigate to:
Assets/RGame/RoguelikeKit/Scripts/Create two new C# scripts named:
[YourEffectName]SkillCast.cs(e.g.SpiralSkillCast.cs)[YourEffectName]Skill.cs(e.g.SpiralSkill.cs)
Paste AI-Generated Code:
Replace all content in both files with the AI-modified versions
RGame.RoguelikeKit(e.g.SpiralSkillCast.cs SpiralSkill.cs)
Step 3: Attach to Game Objects
Open the gameplay scene:

Assets/RGame/RoguelikeKit/Scenes/Managers/GamePlay.unitySet up Skill Manager:
Right-click
SkillManager→ Create EmptyName it (e.g. "SpiralAttack_Manager")
Drag your
[YourEffectName]SkillCastscript onto itKey is the logo name of your customized skill Other configurations are the same as the picture below

Configure Prefab:
Locate your skill prefab
Remove any existing skill script
Add your
[YourEffectName]Skillcomponent
Step 4: Final Configuration
Link components:
Assign your prefab to the
SkillPrefabfield in your SkillConfigSOAdd the SkillConfigSO to
SkillManager'sSkillDataarray
Set identifiers:
Ensure the
Keyfield matches in:SkillConfigSO
SkillCast component
ObjectPool settings
Testing & Iteration
Enter Play Mode to test
Common adjustments via AI:
"Increase projectile spread by 30%"
"Add gradual size scaling"
"Make projectiles accelerate over time"
Troubleshooting Tips:
If skills don't appear:
Verify all
Keyfields match exactlyCheck SkillManager's
SkillDataarray has your config
If movement behaves oddly:
Ask AI to "debug velocity calculation in [script name]"
Pro Tip: Use these exact phrases for AI modifications:
"Make the projectiles home toward enemies"
"Add wave pattern to movement"
"Create 8-way directional attack"
Last updated