赞 | 8 |
VIP | 0 |
好人卡 | 3 |
积分 | 6 |
经验 | 8536 |
最后登录 | 2024-11-7 |
在线时间 | 165 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 642
- 在线时间
- 165 小时
- 注册时间
- 2012-4-18
- 帖子
- 264
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
如题,从某个RPGMV插件分享站拔了个伤害公式扩展的插件,机翻了一下说明什么的,发觉挺好用,我之前设想的几种技能也许都能够实现,本着好东西要分享的心态,把这个插件发出来,大家看看,脑洞打开,看看能脑洞些什么出来。插件如下:- /*:
- -------------------------------------------------------------------------
- @title Formula Effects
- @author Hime --> HimeWorks (http://himeworks.com)
- @date Feb 11, 2015
- @version 1.0
- @filename HIME_FormulaEffects.js
- @url http://himeworks.com/2016/02/formula-effects-mv/
- If you enjoy my work, consider supporting me on Patreon!
- * https://www.patreon.com/himeworks
- If you have any questions or concerns, you can contact me at any of
- the following sites:
- * Main Website: http://himeworks.com
- * Facebook: https://www.facebook.com/himeworkscom/
- * Twitter: https://twitter.com/HimeWorks
- * Youtube: https://www.youtube.com/c/HimeWorks
- * Tumblr: http://himeworks.tumblr.com/
- -------------------------------------------------------------------------------
- @plugindesc v1.0 - Allows you to execute any formula as an effect
- @help
- -------------------------------------------------------------------------------
- == Description ==
- All items and skills in RPG Maker come with additional "effects".
- RPGMV为所有物品技能提供了额外的效果。
- Effects include gaining HP, learning a skill, gaining a buff in a parameter,
- or running a common event.
- 效果包括获得生命值,学习技能,获得状态,运行公共事件。
- However, what if you would like a skill to do something that isn't provided
- by default?
- 但是,如果你想让一个技能做一些非默认的事情,你会怎样?
- You could use the damage formula, but what if you would like to create conditions on those effects?
- 你可以使用伤害公式,但如果你想获得更多效果呢?
- You could include those conditions in the formula as well,
- but the problem here is you may end up with a very complex damage formula.
- 你可以在公式中包括这些条件,但问题是你可能最终会有一个非常复杂的伤害公式
- Instead of using the damage formula for everything, you can create custom effects that support formulas.
- 你可以创建自定义效果,支持公式,而不是完全依靠伤害公式
- If you already knew how to write the formula,
- then you can just move it from the damage formula into this formula effect.
- 如果你已经知道怎么写公式,那么你就可以把它从损伤公式中移到这个公式中
- Because a formula effect is just another effect, it supports other plugins
- that work with effects, such as Conditional Effects, which allows you to
- determine whether an effect should be executed based on a condition.
- 因为一个公式效应只是另一个效果,它支持其他插件的工作效果,如条件效应,
- 这让你决定是否应该根据一个条件执行效果
- == Terms of Use ==
- - Free for use in non-commercial projects with credits
- - Contact me for commercial use
- == Change Log ==
- Feb 11, 2015 - initial release
- == Usage ==
- To create a formula effect, note-tag items or skills with
- 道具栏,技能栏备注中写下,
- <formula effect>
- FORMULA
- </formula effect>
-
- Where the FORMULA will be evaluated during skill execution and the behavior
- is determined by what you write in the formula.
- 把“FORMULA”替换成你要执行的公式。
- The following formula variables are available
- 可以使用以下变量
- a - attacker //攻击者
- b - target //被击者
- i - current item or skill //当前正在发动使用的技能或道具
- v - game variables //游戏变量
- s - game switches //游戏开关
- t - game troop //游戏敌群
- p - game party //游戏队伍
-
- So for example, if you wanted to reduce the target's HP by 100, you could
- use the formula
- 例:对方扣100点血
- b.gainHp(-100);
- You can access the result of the action on the target using
- 你可以访问目标使用的操作的结果
- var r = b.result()
-
- With this, you can then check how much HP damage or MP damage was dealt
- 有了这个你可以检查已经造成多少生命伤害和法力伤害
- r.hpDamage
- r.mpDamage
-
- And then use this in your effect calculations.
- 然后在你的效果计算中使用这个
- Anything that is defined in the code can be used as an effect.
- 任何在代码中定义的事都可以作为一个技能/物品效果。
- -------------------------------------------------------------------------------
- */
- var Imported = Imported || {} ;
- var TH = TH || {};
- Imported.FormulaEffects = 1;
- TH.FormulaEffects = TH.FormulaEffects || {};
- (function ($) {
- $.Code = "TH_FORMULA_EFFECT";
- $.Regex = /<formula[-_ ]effect:\s*(\w+)\s*\/>/img
- $.ExtRegex = /<formula[-_ ]effect>([\s\S]*?)<\/formula[-_ ]effect>/img
- $.loadEffects = function(obj) {
- if (obj.thFormulaEffectsLoaded) {
- return;
- }
- obj.thFormulaEffectsLoaded = true;
- var res;
- while (res = $.ExtRegex.exec(obj.note)) {
- var formula = res[1];
- var eff = {
- code: $.Code,
- dataId: 0,
- value1: formula,
- value2: 0
- };
- obj.effects.push(eff);
- }
- };
-
- var TH_GameAction_applyItemEffect = Game_Action.prototype.applyItemEffect;
- Game_Action.prototype.applyItemEffect = function(target, effect) {
- if (effect.code === $.Code) {
- this.itemEffectFormulaEffect(target, effect);
- }
- else {
- TH_GameAction_applyItemEffect.call(this, target, effect);
- }
- };
-
- /* Apply custom formula effect to user or target */
- Game_Action.prototype.itemEffectFormulaEffect = function(target, effect) {
- var formula = effect.value1;
- var a = this.subject();
- var b = target;
- var i = this.item();
- var v = $gameVariables;
- var s = $gameSwitches;
- var p = $gameParty;
- var t = $gameTroop;
- eval(formula);
- this.makeSuccess(target);
- };
- var TH_DataManager_onLoad = DataManager.onLoad;
- DataManager.onLoad = function(object) {
- TH_DataManager_onLoad.call(this, object);
- if (object[1] && object[1].effects !== undefined) {
- for (var i = 1, len = object.length; i < len; i++) {
- $.loadEffects(object[i])
- };
- };
- };
- })(TH.FormulaEffects);
复制代码 我想来脑洞几个:
1·斩杀:可以写检查剩余生命值比例,低于25%,就造成大量的伤害。
2·散失:烧蓝,烧点多少蓝就根据比例掉血。
3·奇美拉射击:检查目标中毒状态的剩余回合数(这个= =可能不好获取啊……),取消掉中毒,一次性造成剩余回合数X每一跳伤害。
4·以攻击力或防御力较高的值来造成伤害= =
5·伏击:只能在自身处于潜行状态下才能使用,否则不能使用或者不能造成伤害。
暂时就脑洞这么多,我先研究下具体公式能不能写出来再说,看到的小伙伴们,脑洞起来。 |
|