Yo! So, I'll just get to the meat of things.
I've got a character who summons allies into battle. This is done using SRD's Summon Core, but that's mostly irrelevant.
Basically, I have certain skills designed specifically for supporting these summoned allies. Things like damage buffs, restoring HP to increase longevity, stuff like this. Thing is, these moves are specifically designed to target only the summoned ally, and I don't want the user to be able to give these support moves to regular party members (at risk of being too powerful and making the summons obsolete). Obviously, there isn't exactly a way to normally set a skill to only target specific party members, but I'm wondering if there's some sort of backwards way to accomplish this.
An idea I briefly considered is utilizing the "Ally (Dead)" target and find some way to keep the summons active while be classified as "dead", but I'm unsure if that's even possible. Any ideas?
Skills that can only target a specific class/actor
● ARCHIVED · READ-ONLY
-
-
Do the summoned characters have classes specific to them? You could set the abilities to only work if the class matches one of the viable types.
-
They do each have their own class, however I'd like to make it so the skill can only target these classes instead of merely making the skill ineffective on anything but the characters with this class.Do the summoned characters have classes specific to them? You could set the abilities to only work if the class matches one of the viable types.
-
An idea I briefly considered is utilizing the "Ally (Dead)" target and find some way to keep the summons active while be classified as "dead", but I'm unsure if that's even possible. Any ideas?
you could put a twist on that, and mark the skill as it's own new type of targetting.
that, plus a couple of checks in the item apply function, and that should validate as any other skill.... only, dropping out through it's own routine.
the targetting type itself is actually based on skill properties, each selection listed under the editor's menu for ease of access........ but nothing prevents you from accessing (or creating) those routines directly, or through a script call. -
I'm a little stumped - never tried to expand or alter the scope before. I got the skill to target... nothing XD.
If anyone knows how to finish this, feel free to take and do with it what you will. Change the labeling and have at it. Giving me a headache, been coding darn near all day XD
Draft code:
SpoilerCode:var ZAM = ZAM || {}; ZAM.ClassTarget = ZAM.ClassTarget || {}; (function() { "use strict"; ZAM.ClassTarget.dataLoaded = false; ZAM.ClassTarget.DataManager_isDataLoaded = DataManager.isDatabaseLoaded; DataManager.isDatabaseLoaded = function() { if (!ZAM.ClassTarget.DataManager_isDataLoaded.call(this)) return false; if (!ZAM.ClassTarget.dataLoaded) { this.loadSkillNoteTags_classTarget(); ZAM.ClassTarget.dataLoaded = true; } return true; }; DataManager.loadSkillNoteTags_classTarget = function() { let length = $dataSkills.length; for (let i = 1; i < length; i++) { if ($dataSkills.note.match(/<class\s*:\s*(.*)\s*>/im)) { $dataSkills.classTarget = parseInt(RegExp.$1); } if ($dataSkills.note.match(/<scope\s*:\s*(.*)\s*>/im)) { $dataSkills.scope = parseInt(RegExp.$1); } } }; Game_Unit.prototype.summonMembers = function(smnClass) { return this.members().filter(function(summon) { return summon.currentClass() === smnClass; }); } Game_Action.prototype.isForSummon = function() { return this.checkItemScope([12]); }; Game_Action.prototype.itemTargetCandidates = function() { let actionTarget = $dataSkills[this.item().itemId()].classTarget; if (!this.isValid()) { return []; } else if (this.isForOpponent()) { return this.opponentsUnit().aliveMembers(); } else if (this.isForUser()) { return [this.subject()]; } else if (this.isForDeadFriend()) { return this.friendsUnit().deadMembers(); } else if (this.isForSummon()) { return this.summonMembers(actionTarget); } else { return this.friendsUnit().aliveMembers(); } };