Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*:
- * @plugindesc Provides a tag that allows you to unseal particular skill types with a state
- * Also grays out the skill type in the command window when the skill type is unavailable
- *
- * @help
- * Use the tag <unsealskilltype:3> for example, to unseal skilltype #3
- *
- * No warranty, express or implied. I can't guarantee that it will
- * work at all. If it's useful to you, credit is appreciated.
- * You may redistribute, but do not remove any of the above.
- */
- (function(){
- Game_BattlerBase.prototype.isSkillTypeSealed = function(stypeId) {
- var unseals = [];
- this._states.forEach(function(state) {
- meta = $dataStates[state].meta.unsealskilltype;
- if (meta){
- unseals.push(Number(meta));
- }
- });
- if (unseals.contains(stypeId)){
- return false;
- }
- return this.traitsSet(Game_BattlerBase.TRAIT_STYPE_SEAL).contains(stypeId);
- };
- Window_ActorCommand.prototype.addSkillCommands = function() {
- var skillTypes = this._actor.addedSkillTypes();
- skillTypes.sort(function(a, b) {
- return a - b;
- });
- skillTypes.forEach(function(stypeId) {
- var name = $dataSystem.skillTypes[stypeId];
- this.addCommand(name, 'skill', !this._actor.isSkillTypeSealed(stypeId), stypeId);
- }, this);
- };
- })();
Advertisement
Add Comment
Please, Sign In to add comment