新增技能点和技能学习系统

main
戴面具的乐子人 12 months ago
parent 0193a7aaa4
commit 689a9c5f52

@ -2,7 +2,7 @@
异常生物见闻录 rpg 第二版 仓库
## 使用者锁
乐子人
## 使用流程
1. 在你进行你的内容更新之前先执行一次拉取操作。正常情况下不会提示内容冲突如果有则VS code右上角点击文件选择关闭文件夹。然后再把你本地那个同步文件夹删掉重新从Github克隆。
@ -22,7 +22,7 @@
## 更新记录
- **2023/12/30****乐子人**;技能优化,新增战斗统计;修改部分技能冷却机制;
- **2023/12/30****乐子人**;技能优化,新增战斗统计;修改部分技能冷却机制;新增技能点和技能学习系统;
- **2023/12/24****乐子人**配置主界面UI开场效果优化
- **2023/12/11****乐子人**一些数值削弱和BUG修复
- **2023/12/07****乐子人**精准机制再次测试优化精英怪事件避免被卡BUG

@ -64,7 +64,7 @@ null,
{"id":62,"expanded":false,"name":"伊娃之战","order":7,"parentId":15,"scrollX":1139,"scrollY":627},
{"id":63,"expanded":true,"name":"大海(过剧情)","order":62,"parentId":23,"scrollX":1139,"scrollY":627},
{"id":64,"expanded":true,"name":"塔纳古斯","order":12,"parentId":14,"scrollX":1769.3333333333333,"scrollY":1844.6666666666667},
{"id":65,"expanded":true,"name":"阿拉曼达广场","order":13,"parentId":64,"scrollX":1081.3333333333333,"scrollY":1714},
{"id":65,"expanded":true,"name":"阿拉曼达广场","order":13,"parentId":64,"scrollX":1081.3333333333333,"scrollY":1844.6666666666667},
{"id":66,"expanded":true,"name":"晋升之塔外","order":14,"parentId":65,"scrollX":1092,"scrollY":632.6666666666666},
{"id":67,"expanded":true,"name":"晋升之塔","order":15,"parentId":66,"scrollX":1081.3333333333333,"scrollY":855.3333333333334},
{"id":68,"expanded":false,"name":"阿拉曼达城墙顶部","order":16,"parentId":65,"scrollX":1092,"scrollY":632.6666666666666},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,874 @@
//=============================================================================
// Yanfly Engine Plugins - Job Points
// YEP_JobPoints.js
//=============================================================================
var Imported = Imported || {};
Imported.YEP_JobPoints = true;
var Yanfly = Yanfly || {};
Yanfly.JP = Yanfly.JP || {};
Yanfly.JP.version = 1.09;
//=============================================================================
/*:
* @plugindesc v1.09 这个插件本身并没有多大作用但它可以让参与者获得用于其他插件的JP工作点数
* @author Yanfly Engine Plugins
*
* @param ---General---
* @default
*
* @param JP Text
* @parent ---General---
* @desc 这会改变你希望JP出现在游戏中的方式
* @default JP
*
* @param JP Icon
* @parent ---General---
* @type number
* @min 0
* @desc 这是用于JP的图标如果不想使用图标请使用0
* @default 188
*
* @param Max JP
* @parent ---General---
* @type number
* @min 0
* @desc 这是职业能拥有的最大JP如果希望没有限制请使用0
* @default 0
*
* @param JP Per Action
* @parent ---General---
* @desc 战斗中增加的JP值
* @default 10 + Math.randomInt(10)
*
* @param JP Per Level
* @parent ---General---
* @desc 这是演员每升一级获得的JP值
* @default 100 + Math.randomInt(100)
*
* @param JP Per Enemy
* @parent ---General---
* @desc 这是每个被击败的敌人获得的JP值
* @default 50 + Math.randomInt(10)
*
* @param Show Results
* @parent ---General---
* @type boolean
* @on Show
* @off Hide
* @desc 获胜后是否显示JP金额
* NO - false YES - true
* @default true
*
* @param JP Gained in Battle
* @parent ---General---
* @desc 整战斗后获得的JP文本的显示方式
* %1 - Actor %2 Value %3 JP
* @default %1 gains %2%3!
*
* @param Alive Actors
* @parent ---General---
* @type boolean
* @on Alive Requirement
* @off No Requirement
* @desc 主角们必须活着才能从敌人那里获得JP
* NO - false YES - true
* @default true
*
* @param ---Menu---
* @default
*
* @param Show In Menu
* @parent ---Menu---
* @type boolean
* @on Show
* @off Hide
* @desc 在主菜单中显示JP
* NO - false YES - true
* @default true
*
* @param Menu Format
* @parent ---Menu---
* @desc 菜单中JP文本格式的显示方式
* %1 - Value %2 - Amount %3 - Icon
* @default %1\c[4]%2\c[0]%3
*
* @param ---Victory Aftermath---
* @default
*
* @param Enable Aftermath
* @parent ---Victory Aftermath---
* @type boolean
* @on Enable
* @off Disable
* @desc 是否开启胜利JP窗口
* NO - false YES - true
* @default true
*
* @param Aftermath Text
* @parent ---Victory Aftermath---
* @desc 用于描述JP收入的文本
* @default JP Earned
*
* @param Aftermath Format
* @parent ---Victory Aftermath---
* @desc 如何去描述收入文本的内容
* %1 - Value %2 - Amount %3 - Icon
* @default +%1\c[4]%2\c[0]%3
*
* @param Aftermath JP Earned
* @parent ---Victory Aftermath---
* @desc 描述每个演员能挣多少JP
* @default JP Earned in Battle
*
* @help
*
*
* 魔改作者: 流逝的岁月
* 魔改版本: v1.00
*
* 魔改内容: v1.00 将JP的概念提升到每个角色级,而并不是原本的职业级,因此涉及到角色职业级的功能将自动向上安排,谨记!
*
*
*
* 可以使用脚本 Zzy.CYJP.GetJP(actorId) 返回值为指定角色的JP值,actorId是角色的ID值
* 可以使用脚本 Zzy.CYJP.SetJP(actorId,value) 设置一个角色的JP点,为指定值,actorId是角色ID值,value是一个固定的数值
* 可以使用脚本 Zzy.CYJP.GainJP(actorId,value) 增加一个角色的JP点,为指定值,actorId是角色ID值,value是一个固定的数值
* 可以使用脚本 Zzy.CYJP.LoseJP(actorId,value) 减少一个角色的JP点,为指定值,actorId是角色ID值,value是一个固定的数值
*
*
*
*
*
*
* ============================================================================
* 介绍
* ============================================================================
*
* 这个插件本身不会改变任何主要的游戏功能但是如果你决定在游戏中加入工作点数它会与其他插件一起使用这个插件的功能
*
* 当获得工作分数时会将其分配给演员当前的班级如果参与者要切换类那么作业点将更改为该类的作业点直到恢复
*
* ============================================================================
* 胜利后的兼容性
* ============================================================================
*
* 如果你安装了YEP_VictoryAffairs插件并希望使用JP windows请在插件管理器中将该插件放置在YEP_VictoryAffairs之下
*
* 之后如果您希望定义JP窗口在某个时间点出现的时间而不是插件自动执行该操作请在希望JP窗口出现的Victory Founder内的Victory Order参数中插入JP
*
* ============================================================================
* Notetags
* ============================================================================
*
* 以下是一些与工作点相关的标签
*
* Actor Notetags
* <Starting JP: x>
* 对于参与者的初始类将参与者的起始JP值设置为x
*
* <Class x Starting JP: y>
* 将类x的演员起始JP值设置为y
*
* <JP Rate: x%>
*这改变了JP上涨x%的速度默认情况下所有对象的默认比率均为100%将这一比例提高到200%将使获得的JP增加两倍而50%将使获得的JP减半
*
* Skill and Item Notetags
* <JP Gain: x>
* 这使得使用此技能或物品的演员将获得x数量的JP而不是参数中的默认JP
*
* <Target JP Gain: x>
* 这使得受此技能或物品影响的目标演员获得x点JP
*
* Class, Weapon, Armor, and State Notetag
* <JP Rate: x%>
*这改变了日元上涨x%的速度默认情况下所有对象的默认比率均为100%将这一比例提高到200%将使获得的日元增加两倍而50%将使获得的日元减半
*
* Enemy Notetag
* <JP: x>
* 当敌人被击败时在场的党员每人将获得x日元
*
* ============================================================================
* Plugin Commands
* ============================================================================
*
* 对于那些想知道如何手动为演员提供删除或设置JP的人可以使用lowing Plugin Commands.
*
* Plugin Commands:
*
* gainJp actorId jp
* gainJp actorId jp classId
* actorId替换为您希望更改其JP的演员的IDjp替换为您希望更改的jp金额如果您使用的是classId请将其替换为您希望更改的参与者类的ID此命令将使演员获得JP
*
* loseJp actorId jp
* loseJp actorId jp classId
*actorId替换为您希望更改其JP的演员的IDjp替换为您希望更改的jp金额如果您使用的是classId请将其替换为您希望更改的参与者类的ID此命令将导致演员失去JP
*
* setJp actorId jp
* setJp actorId jp classId
*actorId替换为您希望更改其JP的演员的IDjp替换为您希望更改的jp金额如果您使用的是classId请将其替换为您希望更改的参与者类的ID此命令将演员的JP设置为特定值
*
* ============================================================================
* Changelog
* ============================================================================
*
* Version 1.09:
* - Updated for RPG Maker MV version 1.5.0.
*
* Version 1.08:
* - Lunatic Mode fail safes added.
*
* Version 1.07:
* - Updated for RPG Maker MV version 1.1.0.
*
* Version 1.06:
* - Added 'Alive Actors' plugin parameter to prevent dead actors from gaining
* JP from enemies. Any JP that currently dead actors earned in battle from
* actions will still be 'earned' at the end of battle.
*
* Version 1.05:
* - Updated compatibility for Subclasses gaining JP.
*
* Version 1.04a:
* - Added failsafes to prevent JP from turning into NaN midbattle.
* - Added failsafes to prevent no-target scopes from crashing the game.
*
* Version 1.03:
* - Added 'Show Results' parameter to show/hide JP earned after battle for
* those who aren't using the Victory Aftermath plugin.
*
* Version 1.02:
* - Fixed a bug that would gain JP for changing classes of a higher level.
*
* Version 1.01:
* - Added failsafes to prevent JP from turning into NaN.
*
* Version 1.00:
* - Finished Plugin!
*/
//=============================================================================
//=============================================================================
// Parameter Variables
//=============================================================================
Yanfly.Parameters = PluginManager.parameters('YEP_JobPoints');
Yanfly.Param = Yanfly.Param || {};
Yanfly.Icon = Yanfly.Icon || {};
Yanfly.Param.Jp = String(Yanfly.Parameters['JP Text']);
Yanfly.Icon.Jp = Number(Yanfly.Parameters['JP Icon']);
Yanfly.Param.JpMax = Number(Yanfly.Parameters['Max JP']);
Yanfly.Param.JpPerAction = String(Yanfly.Parameters['JP Per Action']);
Yanfly.Param.JpPerEnemy = String(Yanfly.Parameters['JP Per Enemy']);
Yanfly.Param.JpShowResults = eval(String(Yanfly.Parameters['Show Results']));
Yanfly.Param.JpTextFormat = String(Yanfly.Parameters['JP Gained in Battle']);
Yanfly.Param.JpAliveActors = eval(String(Yanfly.Parameters['Alive Actors']));
Yanfly.Param.JpShowMenu = String(Yanfly.Parameters['Show In Menu']);
Yanfly.Param.JpShowMenu = eval(Yanfly.Param.JpShowMenu);
Yanfly.Param.JpMenuFormat = String(Yanfly.Parameters['Menu Format']);
Yanfly.Param.JpPerLevel = String(Yanfly.Parameters['JP Per Level']);
Yanfly.Param.JpEnableAftermath = String(Yanfly.Parameters['Enable Aftermath']);
Yanfly.Param.JpAftermathText = String(Yanfly.Parameters['Aftermath Text']);
Yanfly.Param.JpAftermathFmt = String(Yanfly.Parameters['Aftermath Format']);
Yanfly.Param.JpAftermathEarn = String(Yanfly.Parameters['Aftermath JP Earned']);
//=============================================================================
// DataManager
//=============================================================================
var Zzy = Zzy || {};
Zzy.CYJP = Zzy.CYJP || {};
Yanfly.JP.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
DataManager.isDatabaseLoaded = function() {
if (!Yanfly.JP.DataManager_isDatabaseLoaded.call(this)) return false;
if (!Yanfly._loaded_YEP_JobPoints) {
this.processJPNotetags1($dataActors);
this.processJPNotetags2($dataSkills);
this.processJPNotetags2($dataItems);
this.processJPNotetags3($dataEnemies);
this.processJPNotetags4($dataClasses);
this.processJPNotetags4($dataWeapons);
this.processJPNotetags4($dataArmors);
this.processJPNotetags4($dataStates);
Yanfly._loaded_YEP_JobPoints = true;
}
return true;
};
DataManager.processJPNotetags1 = function(group) {
var note1 = /<(?:STARTING JP):[ ](\d+)>/i;
var note2 = /<(?:CLASS)[ ](\d+)[ ](?:STARTING JP):[ ](\d+)>/i;
var note3 = /<(?:JP RATE):[ ](\d+)([%])>/i;
for (var n = 1; n < group.length; n++) {
var obj = group[n];
var notedata = obj.note.split(/[\r\n]+/);
obj.startingJp = {};
obj.jpRate = 1.0;
for (var i = 0; i < notedata.length; i++) {
var line = notedata[i];
if (line.match(note1)) {
obj.startingJp[obj.classId] = parseInt(RegExp.$1);
} else if (line.match(note2)) {
obj.startingJp[parseInt(RegExp.$1)] = parseInt(RegExp.$2);
} else if (line.match(note3)) {
obj.jpRate = parseFloat(RegExp.$1 * 0.01);
}
}
}
};
DataManager.processJPNotetags2 = function(group) {
var note1 = /<(?:GAIN JP|JP GAIN):[ ](\d+)>/i;
var note2 = /<(?:TARGET GAIN JP|TARGET JP GAIN):[ ](\d+)>/i;
for (var n = 1; n < group.length; n++) {
var obj = group[n];
var notedata = obj.note.split(/[\r\n]+/);
obj.gainJp = Yanfly.Param.JpPerAction;
obj.targetGainJp = 0;
for (var i = 0; i < notedata.length; i++) {
var line = notedata[i];
if (line.match(note1)) {
obj.gainJp = parseInt(RegExp.$1);
} else if (line.match(note2)) {
obj.targetGainJp = parseInt(RegExp.$1);
}
}
}
};
DataManager.processJPNotetags3 = function(group) {
var note1 = /<(?:JP):[ ](\d+)>/i;
for (var n = 1; n < group.length; n++) {
var obj = group[n];
var notedata = obj.note.split(/[\r\n]+/);
obj.jp = Yanfly.Param.JpPerEnemy;
for (var i = 0; i < notedata.length; i++) {
var line = notedata[i];
if (line.match(note1)) {
obj.jp = parseInt(RegExp.$1);
}
}
}
};
DataManager.processJPNotetags4 = function(group) {
var note1 = /<(?:JP RATE):[ ](\d+)([%])>/i;
for (var n = 1; n < group.length; n++) {
var obj = group[n];
var notedata = obj.note.split(/[\r\n]+/);
obj.jpRate = 1.0;
for (var i = 0; i < notedata.length; i++) {
var line = notedata[i];
if (line.match(note1)) {
obj.jpRate = parseFloat(RegExp.$1 * 0.01);
}
}
}
};
//=============================================================================
// BattleManager
//=============================================================================
Yanfly.JP.BattleManager_makeRewards = BattleManager.makeRewards;
BattleManager.makeRewards = function() {
Yanfly.JP.BattleManager_makeRewards.call(this);
this._rewards.jp = $gameTroop.jpTotal();
this.gainJp();
};
BattleManager.gainJp = function() {
var jp = $gameTroop.jpTotal();
$gameMessage.newPage();
if (Yanfly.Param.JpAliveActors) {
var members = $gameParty.aliveMembers();
} else {
var members = $gameParty.members();
}
members.forEach(function(actor) {
actor.gainJp(jp);
});
};
Yanfly.JP.BattleManager_displayRewards = BattleManager.displayRewards;
BattleManager.displayRewards = function() {
Yanfly.JP.BattleManager_displayRewards.call(this);
this.displayJpGain();
};
BattleManager.displayJpGain = function() {
if (!Yanfly.Param.JpShowResults) return;
var jp = $gameTroop.jpTotal();
$gameMessage.newPage();
$gameParty.members().forEach(function(actor) {
var fmt = Yanfly.Param.JpTextFormat;
var text = fmt.format(actor.name(), Yanfly.Util.toGroup(actor.battleJp()),
Yanfly.Param.Jp);
$gameMessage.add('\\.' + text);
});
};
//=============================================================================
// Game_Battler
//=============================================================================
Yanfly.JP.Game_Battler_useItem = Game_Battler.prototype.useItem;
Game_Battler.prototype.useItem = function(item) {
Yanfly.JP.Game_Battler_useItem.call(this, item);
if (!$gameParty.inBattle()) return;
if (this.isActor()) this.gainJp(eval(item.gainJp), this.currentClass().id);
};
Yanfly.JP.Game_Battler_onBattleStart = Game_Battler.prototype.onBattleStart;
Game_Battler.prototype.onBattleStart = function() {
Yanfly.JP.Game_Battler_onBattleStart.call(this);
this._battleJp = 0;
};
Yanfly.JP.Game_Battler_onBattleEnd = Game_Battler.prototype.onBattleEnd;
Game_Battler.prototype.onBattleEnd = function() {
Yanfly.JP.Game_Battler_onBattleEnd.call(this);
this._battleJp = 0;
};
//=============================================================================
// Game_Actor
//=============================================================================
//此处将会对GP进行调整,不再使用原版的JP功能,而是调用一个统一的JP功能
Yanfly.JP.Game_Actor_setup = Game_Actor.prototype.setup;
Game_Actor.prototype.setup = function(actorId)
{
Yanfly.JP.Game_Actor_setup.call(this, actorId);
this.initJp();
};
Game_Actor.prototype.jp = function(classId)
{
//---魔改--- v1.00 输出修改后的jp
if(this._ZzyCYTPJP === undefined)
{this.initJp();}
return this._ZzyCYTPJP;
if (!this._jp) this.initJp();
if (!this._jp) return 0;
if (classId === undefined) classId = this.currentClass().id;
if (!this._jp[classId]) this._jp[classId] = 0;
return this._jp[classId];
};
Game_Actor.prototype.initJp = function() //初始化JP效果
{
var actor = this.actor();
for (var i = 0; i < $dataClasses.length; i++) {
if (actor.startingJp) {
var jp = actor.startingJp[i] || 0;
this.setJp(jp, i);
}
}
//---魔改--- v1.00 设置JP点数为当前职业的JP点
var cid = this.currentClass().id;
var initJP = this._jp[cid] ? this._jp[cid] : 0;
this._ZzyCYTPJP = initJP;//获取初始化JP的效果
};
Game_Actor.prototype.setJp = function(value, classId) //设置JP值
{
value = parseInt(value);
if (value === NaN) value = 0;
classId = classId || this.currentClass().id;
if (!this._jp) this._jp = {};
if (!this._jp[classId]) this._jp[classId] = 0;
this._jp[classId] = Math.max(0, value);
if (Yanfly.Param.JpMax > 0) {
this._jp[classId] = Math.min(Yanfly.Param.JpMax, value);
}
//---魔改--- v1.00 将忽略classId的参数调整
if (Yanfly.Param.JpMax > 0)this._ZzyCYTPJP = Math.min(Yanfly.Param.JpMax, value);
else this._ZzyCYTPJP = value;
};
Game_Actor.prototype.jpRate = function() //jp增加的倍数
{
var rate = 1.0;
rate *= this.actor().jpRate;
rate *= this.currentClass().jpRate;
var equips = this.equips();
for (var i = 0; i < equips.length; i++) {
var item = equips[i];
if (item) rate *= item.jpRate;
}
var states = this.states();
for (var i = 0; i < states.length; i++) {
var state = states[i];
if (state) rate *= state.jpRate;
}
return rate;
};
Game_Actor.prototype.gainJp = function(value, classId)
{
value = parseInt(value);
if (value === NaN) value = 0;
classId = classId || this.currentClass().id;
value = Math.floor(value * this.jpRate());
if ($gameParty.inBattle()) {
this._battleJp = this._battleJp || 0;
this._battleJp += value;
}
this.setJp(this.jp(classId) + value, classId);
if (classId === this.currentClass().id && this.isSublcassEarnJp())
{
this.gainJpSubclass(value);
}
};
Game_Actor.prototype.isSublcassEarnJp = function() {
if (!Imported.YEP_X_Subclass) return false;
if (!this.subclass()) return false;
return Yanfly.Param.SubclassJp;
};
Game_Actor.prototype.gainJpSubclass = function(value) {
var classId = this.subclass().id;
value = Math.round(value * Yanfly.Param.SubclassJp);
this.setJp(this.jp(classId) + value, classId);
};
Game_Actor.prototype.loseJp = function(value, classId) {
classId = classId || this.currentClass().id;
this.setJp(this.jp(classId) - value, classId);
};
Game_Actor.prototype.battleJp = function() {
this._battleJp = this._battleJp || 0;
return this._battleJp;
};
Yanfly.JP.Game_Actor_changeClass = Game_Actor.prototype.changeClass;
Game_Actor.prototype.changeClass = function(classId, keepExp) {
this._preventJpLevelUpGain = true;
Yanfly.JP.Game_Actor_changeClass.call(this, classId, keepExp);
this._preventJpLevelUpGain = false;
};
Yanfly.JP.Game_Actor_levelUp = Game_Actor.prototype.levelUp;
Game_Actor.prototype.levelUp = function() {
Yanfly.JP.Game_Actor_levelUp.call(this);
if (this._preventJpLevelUpGain) return;
var user = this;
var target = this;
var a = this;
var b = this;
var level = this.level;
var code = Yanfly.Param.JpPerLevel;
try {
var value = eval(code)
} catch (e) {
var value = 0;
Yanfly.Util.displayError(e, code, 'LEVEL UP JP FORMULA ERROR');
}
this.gainJp(value, this.currentClass().id);
};
//=============================================================================
// Game_Enemy
//=============================================================================
Game_Enemy.prototype.jp = function() {
var user = this;
var target = this;
var a = this;
var b = this;
var code = this.enemy().jp;
try {
return eval(code);
} catch (e) {
Yanfly.Util.displayError(e, code, 'ENEMY JP FORMULA ERROR');
return 0;
}
};
//=============================================================================
// Game_Action
//=============================================================================
Yanfly.JP.Game_Action_applyItemUserEffect =
Game_Action.prototype.applyItemUserEffect;
Game_Action.prototype.applyItemUserEffect = function(target) {
Yanfly.JP.Game_Action_applyItemUserEffect.call(this, target);
if (target) this.applyItemJpEffect(target);
};
Game_Action.prototype.applyItemJpEffect = function(target) {
var item = this.item();
if (!item) return;
if (target.isActor()) target.gainJp(item.targetGainJp);
};
Yanfly.JP.Game_Action_hasItemAnyValidEffects =
Game_Action.prototype.hasItemAnyValidEffects;
Game_Action.prototype.hasItemAnyValidEffects = function(target) {
var item = this.item();
if (!item) return;
if (target.isActor() && item.targetGainJp !== 0) return true;
return Yanfly.JP.Game_Action_hasItemAnyValidEffects.call(this, target);
};
//=============================================================================
// Game_Troop
//=============================================================================
Game_Troop.prototype.jpTotal = function() {
return this.deadMembers().reduce(function(r, enemy) {
return r + enemy.jp();
}, 0);
};
//=============================================================================
// Game_Interpreter
//=============================================================================
Yanfly.JP.Game_Interpreter_pluginCommand =
Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
Yanfly.JP.Game_Interpreter_pluginCommand.call(this, command, args)
if (command === 'gainJp') this.modifyJp('gain', args);
if (command === 'loseJp') this.modifyJp('lose', args);
if (command === 'setJp') this.modifyJp('set', args);
};
Game_Interpreter.prototype.modifyJp = function(type, args) {
if (!args) return;
var actorId = parseInt(args[0]);
var actor = $gameActors.actor(actorId);
var jpValue = args[1] || 0;
jpValue = parseInt(jpValue);
var classId = args[2] || 0;
classId = parseInt(classId);
if (jpValue <= 0) return;
if (classId <= 0) classId = actor.currentClass().id;
if (type === 'gain') {
actor.gainJp(jpValue, classId);
} else if (type === 'lose') {
actor.loseJp(jpValue, classId);
} else if (type === 'set') {
actor.setJp(jpValue, classId);
}
};
//=============================================================================
// Window_Base
//=============================================================================
Yanfly.JP.Window_Base_dASS = Window_Base.prototype.drawActorSimpleStatus;
Window_Base.prototype.drawActorSimpleStatus = function(actor, wx, wy, ww) {
this._drawMenuJP = Yanfly.Param.JpShowMenu;
Yanfly.JP.Window_Base_dASS.call(this, actor, wx, wy, ww);
this._drawMenuJP = undefined;
};
Yanfly.JP.Window_Base_drawActorClass = Window_Base.prototype.drawActorClass;
Window_Base.prototype.drawActorClass = function(actor, wx, wy, ww) {
ww = ww || 168;
Yanfly.JP.Window_Base_drawActorClass.call(this, actor, wx, wy, ww);
if (!this._drawMenuJP) return;
var classId = actor.currentClass().id;
this.drawActorJp(actor, classId, wx, wy, ww, 'right');
};
Window_Base.prototype.drawActorJp = function(actor, id, wx, wy, ww, align) {
var jp = actor.jp(id);
var icon = '\\i[' + Yanfly.Icon.Jp + ']';
var fmt = Yanfly.Param.JpMenuFormat;
var text = fmt.format(Yanfly.Util.toGroup(jp), Yanfly.Param.Jp, icon);
if (align === 'left') {
wx = 0;
} else if (align === 'center') {
wx += (ww - this.textWidthEx(text)) / 2;
} else {
wx += ww - this.textWidthEx(text);
}
this.drawTextEx(text, wx, wy);
};
Window_Base.prototype.textWidthEx = function(text) {
return this.drawTextEx(text, 0, this.contents.height);
};
//=============================================================================
// Window_VictoryJp
//=============================================================================
if (Imported.YEP_VictoryAftermath && Yanfly.Param.JpEnableAftermath) {
function Window_VictoryJp() {
this.initialize.apply(this, arguments);
}
Window_VictoryJp.prototype = Object.create(Window_VictoryExp.prototype);
Window_VictoryJp.prototype.constructor = Window_VictoryJp;
Window_VictoryJp.prototype.drawActorGauge = function(actor, index) {
this.clearGaugeRect(index);
var rect = this.gaugeRect(index);
this.changeTextColor(this.normalColor());
this.drawActorName(actor, rect.x + 2, rect.y);
this.drawLevel(actor, rect);
this.drawJpGained(actor, rect);
};
Window_VictoryJp.prototype.drawJpGained = function(actor, rect) {
var wy = rect.y + this.lineHeight() * 1;
this.changeTextColor(this.systemColor());
this.drawText(Yanfly.Param.JpAftermathEarn, rect.x + 2, wy, rect.width - 4,
'left');
var bonusJp = 1.0 * actor.battleJp() * this._tick /
Yanfly.Param.VAGaugeTicks;
var value = Yanfly.Util.toGroup(parseInt(bonusJp));
var fmt = Yanfly.Param.JpAftermathFmt;
var icon = '\\i[' + Yanfly.Icon.Jp + ']';
var JpText = fmt.format(value, Yanfly.Param.Jp, icon);
this.changeTextColor(this.normalColor());
wx = rect.x + rect.width - this.textWidthEx(JpText);
this.drawTextEx(JpText, wx, wy);
};
//=============================================================================
// Scene_Battle
//=============================================================================
Yanfly.JP.Scene_Battle_addCustomVictorySteps =
Scene_Battle.prototype.addCustomVictorySteps;
Scene_Battle.prototype.addCustomVictorySteps = function(array) {
array = Yanfly.JP.Scene_Battle_addCustomVictorySteps.call(this, array);
if (!array.contains('JP')) array.push('JP');
return array;
};
Yanfly.JP.Scene_Battle_updateVictorySteps =
Scene_Battle.prototype.updateVictorySteps;
Scene_Battle.prototype.updateVictorySteps = function() {
Yanfly.JP.Scene_Battle_updateVictorySteps.call(this);
if (this.isVictoryStep('JP')) this.updateVictoryJp();
};
Scene_Battle.prototype.updateVictoryJp = function() {
if (!this._victoryJpWindow) {
this.createVictoryJp();
} else if (this._victoryJpWindow.isReady()) {
if (this.victoryTriggerContinue()) this.finishVictoryJp();
}
};
Scene_Battle.prototype.createVictoryJp = function() {
this._victoryTitleWindow.refresh(Yanfly.Param.JpAftermathText);
this._victoryJpWindow = new Window_VictoryJp();
this.addWindow(this._victoryJpWindow);
this._victoryJpWindow.open();
};
Scene_Battle.prototype.finishVictoryJp = function() {
SoundManager.playOk();
this._victoryJpWindow.close();
this.processNextVictoryStep();
};
}; // Imported.YEP_VictoryAftermath
//=============================================================================
// Utilities
//=============================================================================
Yanfly.Util = Yanfly.Util || {};
if (!Yanfly.Util.toGroup) {
Yanfly.Util.toGroup = function(inVal) {
return inVal;
}
};
Yanfly.Util.displayError = function(e, code, message) {
console.log(message);
console.log(code || 'NON-EXISTENT');
console.error(e);
if (Utils.isNwjs() && Utils.isOptionValid('test')) {
if (!require('nw.gui').Window.get().isDevToolsOpen()) {
require('nw.gui').Window.get().showDevTools();
}
}
};
//=============================================================================
// End of File
//=============================================================================
Zzy.CYJP.SetJP = function(actorId,value)
{
var actor = $gameActors.actor(actorId);
value = value ? value : 0;
if(actor)
{
actor.setJp(value);return true;
}
return false;
}
Zzy.CYJP.GainJP = function(actorId,value)
{
var actor = $gameActors.actor(actorId);
value = value ? value : 0;
if(actor)
{
actor.gainJp(value);return true;
}
return false;
}
Zzy.CYJP.LoseJP = function(actorId,value)
{
var actor = $gameActors.actor(actorId);
value = value ? value : 0;
if(actor)
{
actor.loseJp(value);return true;
}
return false;
}
Zzy.CYJP.GetJP = function(actorId)
{
var actor = $gameActors.actor(actorId);
if(actor)return actor.jp();
return 0;
}

@ -15,6 +15,21 @@ Yanfly.SLS.version = 1.13;
* @plugindesc v1.13 技能学习系统
* @author Yanfly Engine Plugins
*
* @param ---魔改---
* @default
*
*
* @param ShowGoldWindowFormat
* @text 显示金币窗口的文本
* @desc 文本样式,其中%1会被替换为角色的JP值,%2会被替换为当前的金币数值,支持转义字符
* @default %1\c[1]JP\i[188] \c[0]%2\c[1]\i[313]
*
*
*
*
*
*
*
* @param ---命令---
* @default
*
@ -113,6 +128,14 @@ Yanfly.SLS.version = 1.13;
* @default 100
*
* @help
*
* 魔改作者: 流逝的岁月
* 魔改版本: v1.00
*
* 魔改内容: v1.00 将对界面进行调整
*
*
*
* ============================================================================
* Introduction
* ============================================================================
@ -314,6 +337,17 @@ Yanfly.SLS.version = 1.13;
Yanfly.Parameters = PluginManager.parameters("YEP_SkillLearnSystem");
Yanfly.Param = Yanfly.Param || {};
var Zzy = Zzy || {};
Zzy.CYSLS = Zzy.CYSLS || {};
Zzy.CYSLS.ShowGoldWindowFormat = Yanfly.Parameters['ShowGoldWindowFormat'] ? String(Yanfly.Parameters['ShowGoldWindowFormat']) : '%1\\c[1]JP\\i[188] \\c[0]%2\\c[1]金\\i[313]';
Yanfly.Param.SLSCommand = String(Yanfly.Parameters["Learn Command"]);
Yanfly.Param.SLSShowLearn = String(Yanfly.Parameters["Show Command"]);
Yanfly.Param.SLSShowLearn = eval(Yanfly.Param.SLSShowLearn);
@ -1473,7 +1507,10 @@ Scene_Skill.prototype.createSkillLearnWindow = function () {
Scene_Skill.prototype.createGoldWindow = function () {
if (!Yanfly.Param.SLSGoldWindow) return;
var wx = Graphics.boxWidth / 2;
this._goldWindow = new Window_Gold(wx, 0);
//---魔改--- v1.00 金币窗口修改
this._goldWindow = new Window_ZzyCYSLSGold(wx, 0);
this._goldWindow.width = Graphics.boxWidth / 2;
this._goldWindow.y = Graphics.boxHeight - this._goldWindow.height;
this._skillTypeWindow.setGoldWindow(this._goldWindow);
@ -1726,7 +1763,10 @@ Scene_LearnSkill.prototype.createSkillLearnWindow = function () {
Scene_LearnSkill.prototype.createGoldWindow = function () {
if (!eval(Yanfly.Param.SLSGoldWindow)) return;
var wx = Graphics.boxWidth / 2;
this._goldWindow = new Window_Gold(wx, 0);
//---魔改--- v1.00 金币窗口修改
this._goldWindow = new Window_ZzyCYSLSGold(wx, 0);
this._goldWindow.width = Graphics.boxWidth / 2;
this._goldWindow.y = Graphics.boxHeight - this._goldWindow.height;
this._goldWindow.createContents();
@ -1874,6 +1914,76 @@ Scene_LearnSkill.prototype.onConfirmCancel = function () {
this._skillLearnWindow.activate();
};
//---魔改--- v1.00 新的窗口类型
//=============================================================================
// Window_ZzyCYSLSGold
//=============================================================================
function Window_ZzyCYSLSGold() {
this.initialize.apply(this, arguments);
}
Window_ZzyCYSLSGold.prototype = Object.create(Window_Gold.prototype);
Window_ZzyCYSLSGold.prototype.constructor = Window_ZzyCYSLSGold;
Window_ZzyCYSLSGold.prototype.initialize = function(x, y)
{
Window_Gold.prototype.initialize.call(this, x, y);
};
Window_ZzyCYSLSGold.prototype.refresh = function()
{
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
//绘制文本信息
var actor = SceneManager._scene.actor();
var jp = actor.jp();
var gold = $gameParty.gold();
var tf = Zzy.CYSLS.ShowGoldWindowFormat;//获取文本格式
var text = tf.format(jp,gold);
var wex = this.textWidthEx(text);
var ofx = 0;
if(wex > width)ofx = 0;
else
{ofx = (width-wex)/2;}
//绘制JP--位于中心
this.drawTextEx(text,x+ofx,0);
}
Window_ZzyCYSLSGold.prototype.textWidthEx = function(text) //计算宽高
{
return this.drawTextEx(text, 0, this.contents.height);
};
//---魔改--- v1.00 关闭Scene_Skill界面下的Window_SkillStatus界面的JP绘制
Window_SkillStatus.prototype.drawActorJp = function(actor, id, wx, wy, ww, align)
{
if(SceneManager._scene instanceof Scene_Skill)return undefined;//不进行绘制
// var jp = actor.jp(id);
// var icon = '\\i[' + Yanfly.Icon.Jp + ']';
// var fmt = Yanfly.Param.JpMenuFormat;
// var text = fmt.format(Yanfly.Util.toGroup(jp), Yanfly.Param.Jp, icon);
// if (align === 'left') {
// wx = 0;
// } else if (align === 'center') {
// wx += (ww - this.textWidthEx(text)) / 2;
// } else {
// wx += ww - this.textWidthEx(text);
// }
// this.drawTextEx(text, wx, wy);
};
//=============================================================================
// Utilities
//=============================================================================

Loading…
Cancel
Save