SRPG Studio

SRPG Studio

评价数不足
Custom Skill Creation
由 SapphireSoft 制作
This guide will show you how to create custom skills for your game only.
   
奖励
收藏
已收藏
取消收藏
Setting custom parameters
1. Create a skill that increases attack power when activated. First, select "Custom" and then "Skill Effects".


2. In the "Skill Effects" dialog, set the name that identifies this custom skill with Plugin. The name is arbitrary, but in this guide it is set to "myskill".


3. Set the value that increases attack power with "Custom Parameters" button.


4. In the custom parameter dialog, be sure to describe {}. "rate: 150" means that the increasing rate is 1.5 times. If you want to double, change it to 200.


5. Set the created skill to unit or class.

Create Plugin
1. Skill setting is completed. Next we will create a plugin and activate the skill. Copy the following program code.

(function() { var alias1 = SkillRandomizer.isCustomSkillInvokedInternal; SkillRandomizer.isCustomSkillInvokedInternal = function(active, passive, skill, keyword) { if (keyword === 'myskill') { return this._isSkillInvokedInternal(active, passive, skill); } return alias1.call(this, active, passive, skill, keyword); }; var alias2 = AttackEvaluator.HitCritical.calculateDamage; AttackEvaluator.HitCritical.calculateDamage = function(virtualActive, virtualPassive, entry) { var skill; var damage = alias2.call(this, virtualActive, virtualPassive, entry); // Add custom skill. skill = SkillControl.checkAndPushCustomSkill(virtualActive.unitSelf, virtualPassive.unitSelf, entry, true, 'myskill'); if (skill !== null) { // Increase damage. damage = Math.floor(damage * (skill.custom.rate / 100)) } return damage; }; })();

2. Create a text file and paste the above code. Place the file in the Plugin folder. The file name can be determined freely.

Let's run the map test
1. Make sure that the custom skill activates correctly. The damage displayed is 10.


2. The skill was activated by Plugin.


3. Damage has become 1.5 times.

3 条留言
Alice_Ravenholm 2024 年 10 月 8 日 上午 11:14 
would it be possible to make a skill that simple adds to you stats only when it's equiped? ie the defense +2 skill from awakening?
Dungeonmind 2020 年 5 月 25 日 下午 6:59 
Thanks for showing us this.
Phoenix Jam 2020 年 5 月 4 日 下午 3:54 
Nice