Healing Staves and a Skill stat?

HYX1337

Villager
Member
Joined
Apr 20, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
Is there a way to have a "Staff" weapon type that can target either allies or enemies. For example, a healing staff can target allies and restore HP. A hexing staff can target enemies and debuff them. I want to use this in combination with the Weapon Durability plugin by yanfly so that the player has to buy the staves because I want to completely get rid of MP so I can't have healing use MP.


Now, I know I can rename Max MP to "Skill" and use "user.mmp" in ExtraParamFormula plugin by yanfly to use Max MP as a Skill stat affecting hit/crit rates. I wonder though, whether there would be any problems with using Max MP this way? 


Also, I already used SkillCore to hide the MP/TP bars with this:  


<Swap Gauge 2: Null>
<Swap Gauge 3: Null>
 
 But I would like to know how to add "Skill" as simply a numeric stat value below Attack/Defense in the status window? I can probably figure out how to do this if I'm pointed in the right direction. I tried using grep to search the JS files in my game's directory for things such as "user.agi" hoping to find the code for the status window but found nothing.


Please bear with me, I'm new to RPG Maker MV :)
 

HYX1337

Villager
Member
Joined
Apr 20, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
The second part of my question turned out to be extremely easy to implement. I made my own small plugin that handles it:


//=============================================================================
// TTAH Core - Skill Stat in Status Window
// TTAH_SkillInStatusWindow.js
//=============================================================================

//=============================================================================
/*:
* @plugindesc v1.0 This plugin adds a "Skill" (Max MP) stat to the status window
* @author HYX1337
*/

//=============================================================================
// Window_Status
//=============================================================================
Window_Status.prototype.refresh = function() {
this.contents.clear();
if (this._actor) {
var lineHeight = this.lineHeight();
this.drawBlock1(lineHeight * 0);
this.drawHorzLine(lineHeight * 1);
this.drawBlock2(lineHeight * 2);
this.drawHorzLine(lineHeight * 6);
this.drawBlock3(lineHeight * 7);
this.drawHorzLine(lineHeight * 14);
this.drawBlock4(lineHeight * 15);
}
};

Window_Status.prototype.drawParameters = function(x, y) {
var lineHeight = this.lineHeight();
for (var i = 0; i < 7; i++) {
var newOrder = new Array(0,2,4,1,6,7,3,5);
var paramId = newOrder[i + 1];
var y2 = y + lineHeight * i;
this.changeTextColor(this.systemColor());
this.drawText(TextManager.param(paramId), x, y2, 160);
this.resetTextColor();
this.drawText(this._actor.param(paramId), x + 160, y2, 60, 'right');
}
};


With that I can not only add Skill to the status window but also reorder my stats the way I wanted.


But I still can't figure out how to have a healing "weapon." I created a new weapon of type cane, called it "Healing Cane" and gave it only one trait, which is the "Heal" skill. The Heal skill is set to "The User" for target, and 0 for MP usage. Whenever I use it though, I need to Select "Attack" and it only lets me target enemies (and it heals them...) :p


So I see I'd need to rename "Attack" to "Staff" when a staff is equipped, and have the range of a Staff weapon be determined always by its skill? Sounds like this needs a JS solution? Am I right or is there a way to do this within the engine that I'm missing? Thanks!
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Assuming you can only equip the staff in slot one, you can use this snippet:


Game_Action.prototype.setAttack = function() {
if(this.subject().isActor() && this.subject().equips()[0]) {
if(this.subject().equips()[0].meta.sAttack) {
this.setSkill(this.subject().equips()[0].meta.sAttack);
} else {
this.setSkill(this.subject().attackSkillId());
}} else {
this.setSkill(this.subject().attackSkillId());
}
};


Then, in your DB, make a healing skill for the staff and note it's ID. (Make sure it targets allies)


Finally, tag any staff weapons with:


<sAttack: x>


with x being the Id of the skill.


It should work with other skills as well, just make sure they don't have a cost or you could temporally lock your player out of their attack command.


A Final note: I'm fairly sure this won't change the name of the attack on the menu.  For that, you'd likely need a more in-depth plugin. 


EDIT:  That's what I get for not testing...  The snippet doesn't seem to work.


However, I'm sure there is a plugin that can handle this.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,567
Latest member
sashalag
Top