From 51ccf21981a7c0cd7df445053ecdafbed75f3787 Mon Sep 17 00:00:00 2001 From: lzr <1838979562@qq.com> Date: Thu, 8 Jun 2023 23:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A2=AB=E5=8A=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/MapInfos.json | 2 +- data/System.json | 2 +- js/plugins.js | 1 + js/plugins/YEP_AutoPassiveStates.js | 686 ++++++++++++++++++++++++++++ 4 files changed, 689 insertions(+), 2 deletions(-) create mode 100644 js/plugins/YEP_AutoPassiveStates.js diff --git a/data/MapInfos.json b/data/MapInfos.json index 220a30b..8810ad7 100644 --- a/data/MapInfos.json +++ b/data/MapInfos.json @@ -63,7 +63,7 @@ null, {"id":61,"expanded":false,"name":"大漩涡","order":60,"parentId":26,"scrollX":1109,"scrollY":1453.5}, {"id":62,"expanded":false,"name":"伊娃之战","order":7,"parentId":15,"scrollX":819,"scrollY":474.5}, {"id":63,"expanded":true,"name":"大海(过剧情)","order":62,"parentId":23,"scrollX":811,"scrollY":485.5}, -{"id":64,"expanded":true,"name":"塔纳古斯","order":12,"parentId":14,"scrollX":589.8181818181819,"scrollY":676.7272727272727}, +{"id":64,"expanded":true,"name":"塔纳古斯","order":12,"parentId":14,"scrollX":589.8181818181819,"scrollY":670.9090909090909}, {"id":65,"expanded":true,"name":"阿拉曼达广场","order":13,"parentId":64,"scrollX":1088,"scrollY":1406.1818181818182}, {"id":66,"expanded":true,"name":"晋升之塔外","order":14,"parentId":65,"scrollX":1040,"scrollY":636}, {"id":67,"expanded":true,"name":"晋升之塔","order":15,"parentId":66,"scrollX":810.9090909090909,"scrollY":833.8181818181819}, diff --git a/data/System.json b/data/System.json index be0360d..fabc591 100644 --- a/data/System.json +++ b/data/System.json @@ -1 +1 @@ -{"airship":{"bgm":{"name":"Kan R Gao - Floating By","pan":0,"pitch":100,"volume":90},"characterIndex":0,"characterName":"$巨龟岩台号","startMapId":0,"startX":0,"startY":0},"armorTypes":["","轻甲","重甲","魔法护甲","普通饰品","魔法饰品","魔法球","副手匕首","副手枪械","左手爪"],"attackMotions":[{"type":0,"weaponImageId":0},{"type":1,"weaponImageId":2},{"type":1,"weaponImageId":12},{"type":1,"weaponImageId":1},{"type":1,"weaponImageId":4},{"type":1,"weaponImageId":10},{"type":1,"weaponImageId":7},{"type":2,"weaponImageId":21},{"type":1,"weaponImageId":14},{"type":1,"weaponImageId":10},{"type":0,"weaponImageId":2},{"type":0,"weaponImageId":11},{"type":0,"weaponImageId":2}],"battleBgm":{"name":"Battle1","pan":0,"pitch":100,"volume":90},"battleback1Name":"DecorativeTile","battleback2Name":"Temple","battlerHue":0,"battlerName":"Dragon","boat":{"bgm":{"name":"Ship1","pan":0,"pitch":100,"volume":90},"characterIndex":0,"characterName":"Vehicle","startMapId":0,"startX":0,"startY":0},"currencyUnit":"经费","defeatMe":{"name":"Defeat1","pan":0,"pitch":100,"volume":90},"editMapId":64,"elements":["","物理","地","风","水","火","电","冰","圣","暗","精神","力场","混沌","幽能","毒","生命治疗","冰火混伤","真实","生命吸取"],"equipTypes":["","武器","副手","帽子","甲衣","靴子","项链","戒指"],"gameTitle":"异常生物见闻录","gameoverMe":{"name":"Gameover1","pan":0,"pitch":100,"volume":90},"locale":"zh_CN","magicSkills":[2,4],"menuCommands":[true,true,true,true,true,true],"optDisplayTp":true,"optDrawTitle":true,"optExtraExp":false,"optFloorDeath":false,"optFollowers":true,"optSideView":false,"optSlipDeath":true,"optTransparent":false,"partyMembers":[1,2,7,3,9,8,6,5,4],"ship":{"bgm":{"name":"Kan R Gao - Floating By","pan":0,"pitch":100,"volume":100},"characterIndex":1,"characterName":"Vehicle","startMapId":31,"startX":174,"startY":58},"skillTypes":["","特技","魔法","专属技能","神术/天赋","各种普通攻击"],"sounds":[{"name":"Cursor2","pan":0,"pitch":100,"volume":90},{"name":"Decision1","pan":0,"pitch":100,"volume":90},{"name":"Cancel2","pan":0,"pitch":100,"volume":90},{"name":"Buzzer1","pan":0,"pitch":100,"volume":90},{"name":"Equip1","pan":0,"pitch":100,"volume":90},{"name":"Save","pan":0,"pitch":100,"volume":90},{"name":"Load","pan":0,"pitch":100,"volume":90},{"name":"Battle1","pan":0,"pitch":100,"volume":90},{"name":"Run","pan":0,"pitch":100,"volume":90},{"name":"Attack3","pan":0,"pitch":100,"volume":90},{"name":"Damage4","pan":0,"pitch":100,"volume":90},{"name":"Collapse1","pan":0,"pitch":100,"volume":90},{"name":"Collapse2","pan":0,"pitch":100,"volume":90},{"name":"Collapse3","pan":0,"pitch":100,"volume":90},{"name":"Damage5","pan":0,"pitch":100,"volume":90},{"name":"Collapse4","pan":0,"pitch":100,"volume":90},{"name":"Recovery","pan":0,"pitch":100,"volume":90},{"name":"Miss","pan":0,"pitch":100,"volume":90},{"name":"Evasion1","pan":0,"pitch":100,"volume":90},{"name":"Evasion2","pan":0,"pitch":100,"volume":90},{"name":"Reflection","pan":0,"pitch":100,"volume":90},{"name":"Shop1","pan":0,"pitch":100,"volume":90},{"name":"Item3","pan":0,"pitch":100,"volume":90},{"name":"Item3","pan":0,"pitch":100,"volume":90}],"startMapId":65,"startX":18,"startY":31,"switches":["","吃完饭","水管爆了","薇薇安出现","蝙蝠出现","海妖现身","五月海妖形态","出现水泡","水塔剧情借宿","去地下室","治疗海妖","准备出发","苏哈白火出现","击败幽灵船","不明海妖出现","丧尸出现","发现丧尸","击败人鱼","对战冰系怪物","对战老鼠怪","对战蝙蝠怪","对战火系怪物","飞砖对话","豆豆星彩蛋完成","熔岩巨蝎出现","击败巨蝎","收集素材","对战魔族","第一次狗炮时的对话","狗炮彩蛋剧情结束","对战恶灵生物","怪物秒杀开关","阿拉曼达开局剧情完成","希尔妲对话完成","水泵站门前的对话","出发调查水泵站","小纸条对话","冰之鼠王被击杀","郝籽相关的对话","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","偷看","尝试交互","触碰脑和容器","完成研究红球","击败伊娃","出现水花","水花伤害","增加火球1","增加火球2","增加火球3","增加背球","增加左球","增加右球","进入纳萨托恩","进入管道","海妖消失","丧尸复苏","水晶破碎","打败守门海妖哨兵","被海妖围了","击败脑怪","密室","击败密室门卫","支援老王","击败海妖女王","发现大漩涡","前往水涌之核","关闭大护壁","豆豆出现","清理皇宫","清理完成","莎奇拉水泡开","点击w","能召唤飞船","初次进入研究炸","游戏开始","点击Q","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"terms":{"basic":["等级","Lv","HP","HP","MP","MP","TP","TP","经验值","EXP"],"commands":["战斗","逃跑","攻击","防御","物品","技能","装备","状态","整队","保存","游戏结束","设置","武器","护甲","随身杂物","装备","最强装备","清空","开始游戏","继续游戏",null,"回到标题","取消",null,"购买","出售"],"params":["最大 HP","最大 MP","攻击力","防御力","魔法攻击","魔法防御","敏捷","幸运","命中率","回避率"],"messages":{"actionFailure":"对%1没有效果!","actorDamage":"%1受到了 %2 点伤害!","actorDrain":"%1被吸收了 %3 点 %2!","actorGain":"%1的 %2 增加了 %3 点!","actorLoss":"%1的 %2 减少了 %3 点!","actorNoDamage":"%1没有受到伤害!","actorNoHit":"Miss! %1没有受到伤害!","actorRecovery":"%1恢复了 %3 点 %2!","alwaysDash":"始终跑步","bgmVolume":"BGM 音量","bgsVolume":"BGS 音量","buffAdd":"%1的%2上升了!","buffRemove":"%1的%2恢复正常了!","commandRemember":"记住指令","counterAttack":"%1的反击!","criticalToActor":"痛恨一击!","criticalToEnemy":"会心一击!","debuffAdd":"%1的%2下降了!","defeat":"%1被击败了。","emerge":"%1出现了!","enemyDamage":"%1受到了 %2 点伤害!","enemyDrain":"%1被吸收了 %3 点 %2!","enemyGain":"%1的 %2 增加了 %3 点!","enemyLoss":"%1的 %2 减少了 %3 点!","enemyNoDamage":"没有对%1造成伤害!","enemyNoHit":"Miss!没有对%1造成伤害!","enemyRecovery":"%1恢复了 %3 点 %2!","escapeFailure":"但是没有逃跑成功!","escapeStart":"%1开始逃跑了!","evasion":"%1躲开了攻击!","expNext":"距离下一%1","expTotal":"现在的%1","file":"文件","levelUp":"%1升到了 %2 %3!","loadMessage":"读取哪个文件?","magicEvasion":"%1抵消了魔法!","magicReflection":"%1反射了魔法!","meVolume":"ME 音量","obtainExp":"获得了 %1 点%2!","obtainGold":"获得了 %1\\G!","obtainItem":"获得了%1!","obtainSkill":"学会了%1!","partyName":"%1的队伍","possession":"持有数","preemptive":"%1先发制人!","saveMessage":"保存到哪个文件?","seVolume":"SE 音量","substitute":"%1保护了%2!","surprise":"%1被偷袭了!","useItem":"%1使用了%2!","victory":"%1胜利了!"}},"testBattlers":[{"actorId":9,"equips":[20,0,0,0,0],"level":18},{"actorId":0,"equips":[6,14,2,5,8,10],"level":6},{"actorId":0,"equips":[20,0,0,0,0],"level":6},{"actorId":6,"equips":[14,0,0,0,0],"level":18}],"testTroopId":17,"title1Name":"Plain","title2Name":"","titleBgm":{"name":"猫耳开关","pan":0,"pitch":100,"volume":90},"variables":["","技能数值","数据判断","掉落概率随机数","泛用随机数","通用怪物击杀数量","时间推进","计算","","海妖碰撞伤害","火位置X","火位置Y","玩家方向","火距离","BGM编号记录","清理废墟","","","","","","地图ID","玩家位置X","玩家位置Y","图片移动X","图片移动Y","随机数","火1位置X","火1位置Y","火1距离","火2位置X","火2位置Y","火2距离","火3位置X","火3位置Y","火3距离","背火位置X","背火位置Y","背火距离","右火位置X","右火位置Y","右火距离","左火位置X","左火位置Y","左火距离","海妖碰撞伤害1","海妖碰撞伤害2","海妖碰撞伤害3","海妖碰撞伤害背","海妖碰撞伤害右","海妖碰撞伤害左","玩家方向1","玩家方向2","玩家方向3","玩家方向4","玩家方向5","玩家方向6","伊娃血量","","","","史莱姆核心结晶数量","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","熔浆积淀刷新计时","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"versionId":35740226,"victoryMe":{"name":"Victory1","pan":0,"pitch":100,"volume":90},"weaponTypes":["","剑","长柄武器","匕首","斧","爪","弓弩","枪炮","法杖","莉莉的爪子","魔王佩剑","魔导工作手套","宇宙碎片长剑"],"windowTone":[0,0,0,0]} \ No newline at end of file +{"airship":{"bgm":{"name":"Kan R Gao - Floating By","pan":0,"pitch":100,"volume":90},"characterIndex":0,"characterName":"$巨龟岩台号","startMapId":0,"startX":0,"startY":0},"armorTypes":["","轻甲","重甲","魔法护甲","普通饰品","魔法饰品","魔法球","副手匕首","副手枪械","左手爪"],"attackMotions":[{"type":0,"weaponImageId":0},{"type":1,"weaponImageId":2},{"type":1,"weaponImageId":12},{"type":1,"weaponImageId":1},{"type":1,"weaponImageId":4},{"type":1,"weaponImageId":10},{"type":1,"weaponImageId":7},{"type":2,"weaponImageId":21},{"type":1,"weaponImageId":14},{"type":1,"weaponImageId":10},{"type":0,"weaponImageId":2},{"type":0,"weaponImageId":11},{"type":0,"weaponImageId":2}],"battleBgm":{"name":"Battle1","pan":0,"pitch":100,"volume":90},"battleback1Name":"DecorativeTile","battleback2Name":"Temple","battlerHue":0,"battlerName":"Dragon","boat":{"bgm":{"name":"Ship1","pan":0,"pitch":100,"volume":90},"characterIndex":0,"characterName":"Vehicle","startMapId":0,"startX":0,"startY":0},"currencyUnit":"经费","defeatMe":{"name":"Defeat1","pan":0,"pitch":100,"volume":90},"editMapId":64,"elements":["","物理","地","风","水","火","电","冰","圣","暗","精神","力场","混沌","幽能","毒","生命治疗","冰火混伤","真实","生命吸取"],"equipTypes":["","武器","副手","帽子","甲衣","靴子","项链","戒指"],"gameTitle":"异常生物见闻录","gameoverMe":{"name":"Gameover1","pan":0,"pitch":100,"volume":90},"locale":"zh_CN","magicSkills":[2,4],"menuCommands":[true,true,true,true,true,true],"optDisplayTp":true,"optDrawTitle":true,"optExtraExp":false,"optFloorDeath":false,"optFollowers":true,"optSideView":false,"optSlipDeath":true,"optTransparent":false,"partyMembers":[1,2,7,3,9,8,6,5,4],"ship":{"bgm":{"name":"Kan R Gao - Floating By","pan":0,"pitch":100,"volume":100},"characterIndex":1,"characterName":"Vehicle","startMapId":31,"startX":174,"startY":58},"skillTypes":["","特技","魔法","专属技能","神术/天赋","各种普通攻击"],"sounds":[{"name":"Cursor2","pan":0,"pitch":100,"volume":90},{"name":"Decision1","pan":0,"pitch":100,"volume":90},{"name":"Cancel2","pan":0,"pitch":100,"volume":90},{"name":"Buzzer1","pan":0,"pitch":100,"volume":90},{"name":"Equip1","pan":0,"pitch":100,"volume":90},{"name":"Save","pan":0,"pitch":100,"volume":90},{"name":"Load","pan":0,"pitch":100,"volume":90},{"name":"Battle1","pan":0,"pitch":100,"volume":90},{"name":"Run","pan":0,"pitch":100,"volume":90},{"name":"Attack3","pan":0,"pitch":100,"volume":90},{"name":"Damage4","pan":0,"pitch":100,"volume":90},{"name":"Collapse1","pan":0,"pitch":100,"volume":90},{"name":"Collapse2","pan":0,"pitch":100,"volume":90},{"name":"Collapse3","pan":0,"pitch":100,"volume":90},{"name":"Damage5","pan":0,"pitch":100,"volume":90},{"name":"Collapse4","pan":0,"pitch":100,"volume":90},{"name":"Recovery","pan":0,"pitch":100,"volume":90},{"name":"Miss","pan":0,"pitch":100,"volume":90},{"name":"Evasion1","pan":0,"pitch":100,"volume":90},{"name":"Evasion2","pan":0,"pitch":100,"volume":90},{"name":"Reflection","pan":0,"pitch":100,"volume":90},{"name":"Shop1","pan":0,"pitch":100,"volume":90},{"name":"Item3","pan":0,"pitch":100,"volume":90},{"name":"Item3","pan":0,"pitch":100,"volume":90}],"startMapId":65,"startX":18,"startY":31,"switches":["","吃完饭","水管爆了","薇薇安出现","蝙蝠出现","海妖现身","五月海妖形态","出现水泡","水塔剧情借宿","去地下室","治疗海妖","准备出发","苏哈白火出现","击败幽灵船","不明海妖出现","丧尸出现","发现丧尸","击败人鱼","对战冰系怪物","对战老鼠怪","对战蝙蝠怪","对战火系怪物","飞砖对话","豆豆星彩蛋完成","熔岩巨蝎出现","击败巨蝎","收集素材","对战魔族","第一次狗炮时的对话","狗炮彩蛋剧情结束","对战恶灵生物","怪物秒杀开关","阿拉曼达开局剧情完成","希尔妲对话完成","水泵站门前的对话","出发调查水泵站","小纸条对话","冰之鼠王被击杀","郝籽相关的对话","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","偷看","尝试交互","触碰脑和容器","完成研究红球","击败伊娃","出现水花","水花伤害","增加火球1","增加火球2","增加火球3","增加背球","增加左球","增加右球","进入纳萨托恩","进入管道","海妖消失","丧尸复苏","水晶破碎","打败守门海妖哨兵","被海妖围了","击败脑怪","密室","击败密室门卫","支援老王","击败海妖女王","发现大漩涡","前往水涌之核","关闭大护壁","豆豆出现","清理皇宫","清理完成","莎奇拉水泡开","点击w","能召唤飞船","初次进入研究炸","游戏开始","点击Q","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"terms":{"basic":["等级","Lv","HP","HP","MP","MP","TP","TP","经验值","EXP"],"commands":["战斗","逃跑","攻击","防御","物品","技能","装备","状态","整队","保存","游戏结束","设置","武器","护甲","随身杂物","装备","最强装备","清空","开始游戏","继续游戏",null,"回到标题","取消",null,"购买","出售"],"params":["最大 HP","最大 MP","攻击力","防御力","魔法攻击","魔法防御","敏捷","幸运","命中率","回避率"],"messages":{"actionFailure":"对%1没有效果!","actorDamage":"%1受到了 %2 点伤害!","actorDrain":"%1被吸收了 %3 点 %2!","actorGain":"%1的 %2 增加了 %3 点!","actorLoss":"%1的 %2 减少了 %3 点!","actorNoDamage":"%1没有受到伤害!","actorNoHit":"Miss! %1没有受到伤害!","actorRecovery":"%1恢复了 %3 点 %2!","alwaysDash":"始终跑步","bgmVolume":"BGM 音量","bgsVolume":"BGS 音量","buffAdd":"%1的%2上升了!","buffRemove":"%1的%2恢复正常了!","commandRemember":"记住指令","counterAttack":"%1的反击!","criticalToActor":"痛恨一击!","criticalToEnemy":"会心一击!","debuffAdd":"%1的%2下降了!","defeat":"%1被击败了。","emerge":"%1出现了!","enemyDamage":"%1受到了 %2 点伤害!","enemyDrain":"%1被吸收了 %3 点 %2!","enemyGain":"%1的 %2 增加了 %3 点!","enemyLoss":"%1的 %2 减少了 %3 点!","enemyNoDamage":"没有对%1造成伤害!","enemyNoHit":"Miss!没有对%1造成伤害!","enemyRecovery":"%1恢复了 %3 点 %2!","escapeFailure":"但是没有逃跑成功!","escapeStart":"%1开始逃跑了!","evasion":"%1躲开了攻击!","expNext":"距离下一%1","expTotal":"现在的%1","file":"文件","levelUp":"%1升到了 %2 %3!","loadMessage":"读取哪个文件?","magicEvasion":"%1抵消了魔法!","magicReflection":"%1反射了魔法!","meVolume":"ME 音量","obtainExp":"获得了 %1 点%2!","obtainGold":"获得了 %1\\G!","obtainItem":"获得了%1!","obtainSkill":"学会了%1!","partyName":"%1的队伍","possession":"持有数","preemptive":"%1先发制人!","saveMessage":"保存到哪个文件?","seVolume":"SE 音量","substitute":"%1保护了%2!","surprise":"%1被偷袭了!","useItem":"%1使用了%2!","victory":"%1胜利了!"}},"testBattlers":[{"actorId":9,"equips":[20,0,0,0,0],"level":18},{"actorId":0,"equips":[6,14,2,5,8,10],"level":6},{"actorId":0,"equips":[20,0,0,0,0],"level":6},{"actorId":6,"equips":[14,0,0,0,0],"level":18}],"testTroopId":17,"title1Name":"Plain","title2Name":"","titleBgm":{"name":"猫耳开关","pan":0,"pitch":100,"volume":90},"variables":["","技能数值","数据判断","掉落概率随机数","泛用随机数","通用怪物击杀数量","时间推进","计算","","海妖碰撞伤害","火位置X","火位置Y","玩家方向","火距离","BGM编号记录","清理废墟","","","","","","地图ID","玩家位置X","玩家位置Y","图片移动X","图片移动Y","随机数","火1位置X","火1位置Y","火1距离","火2位置X","火2位置Y","火2距离","火3位置X","火3位置Y","火3距离","背火位置X","背火位置Y","背火距离","右火位置X","右火位置Y","右火距离","左火位置X","左火位置Y","左火距离","海妖碰撞伤害1","海妖碰撞伤害2","海妖碰撞伤害3","海妖碰撞伤害背","海妖碰撞伤害右","海妖碰撞伤害左","玩家方向1","玩家方向2","玩家方向3","玩家方向4","玩家方向5","玩家方向6","伊娃血量","","","","史莱姆核心结晶数量","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","熔浆积淀刷新计时","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"versionId":32148197,"victoryMe":{"name":"Victory1","pan":0,"pitch":100,"volume":90},"weaponTypes":["","剑","长柄武器","匕首","斧","爪","弓弩","枪炮","法杖","莉莉的爪子","魔王佩剑","魔导工作手套","宇宙碎片长剑"],"windowTone":[0,0,0,0]} \ No newline at end of file diff --git a/js/plugins.js b/js/plugins.js index 3f6d085..97eed7f 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -52,6 +52,7 @@ var $plugins = {"name":"YEP_ShopMenuCore","status":true,"description":"v1.05 商店菜单核心☁️","parameters":{"---General---":"","Command Order":"Buy Sell Equip Custom Cancel","Shop List Width":"Graphics.boxWidth / 2 + Graphics.boxWidth / 10","Command Alignment":"center","Status Window":"","Default Mode":"nothing","Stat Switching":"false","Cannot Equip":"Can't Equip","Stat Font Size":"20","Cannot Equip Font Size":"20","---Info Window---":"","Show Icon":"true","Icon Size":"128","Font Size":"20","Recovery Format":"%1 Heal","Add State":"+State","Add Buff":"+Buff","Remove State":"-State","Remove Buff":"-Buff","Maximum Icons":"4"}}, {"name":"--------------------","status":true,"description":"------------------------------------------------------------","parameters":{}}, {"name":"SF_CommonAttack","status":true,"description":"v1.0 普攻替换插件","parameters":{}}, +{"name":"YEP_AutoPassiveStates","status":true,"description":"v1.17 This plugin allows for some states to function as\npassives for actors, enemies, skills, and equips.","parameters":{"---Basic---":"","Actor Passives":"0","Enemy Passives":"0","Global Passives":"0","---List---":"...Requires RPG Maker MV 1.5.0+...","Actor Passives List":"[]","Enemy Passives List":"[]","Global Passives List":"[]"}}, {"name":"SF_StatesCustomAddtion","status":false,"description":"状态添加过程自定义插件","parameters":{}}, {"name":"SF_QuestSystem","status":false,"description":"v1.0 Allows you to show quests.","parameters":{"Quest List Window":"","Quest List Window X":"260","Quest List Window Y":"90","Quest List Window Width":"120","Quest List Window Height":"370","Quest List Window Font Size":"18","Quest Detail Window":"","Quest Detail Window X":"380","Quest Detail Window Y":"90","Quest Detail Window Width":"440","Quest Detail Window Height":"370","Quest Detail Window Font Size":"18","Quest Editor":"","Quest Editor Enable":"false","Quest List Info X":"0","Quest List Info Y":"90","Quest List Info Width":"240","Quest List Info Height":"370","Quest List Info Font Size":"18"}}, {"name":"--------------------","status":true,"description":"------------------------------------------------------------","parameters":{}}, diff --git a/js/plugins/YEP_AutoPassiveStates.js b/js/plugins/YEP_AutoPassiveStates.js new file mode 100644 index 0000000..d05aa74 --- /dev/null +++ b/js/plugins/YEP_AutoPassiveStates.js @@ -0,0 +1,686 @@ +//============================================================================= +// Yanfly Engine Plugins - Auto Passive States +// YEP_AutoPassiveStates.js +//============================================================================= + +var Imported = Imported || {}; +Imported.YEP_AutoPassiveStates = true; + +var Yanfly = Yanfly || {}; +Yanfly.APS = Yanfly.APS || {}; +Yanfly.APS.version = 1.17; + +//============================================================================= + /*: + * @plugindesc v1.17 This plugin allows for some states to function as + * passives for actors, enemies, skills, and equips. + * @author Yanfly Engine Plugins + * + * @param ---Basic--- + * @default + * + * @param Actor Passives + * @parent ---Basic--- + * @desc These states will always appear on actors as passives. + * Place a space in between each state ID. + * @default 0 + * + * @param Enemy Passives + * @parent ---Basic--- + * @desc These states will always appear on enemies as passives. + * Place a space in between each state ID. + * @default 0 + * + * @param Global Passives + * @parent ---Basic--- + * @desc These states will always appear on all battlers as passives. + * Place a space in between each state ID. + * @default 0 + * + * @param ---List--- + * @default ...Requires RPG Maker MV 1.5.0+... + * + * @param Actor Passives List + * @parent ---List--- + * @type state[] + * @desc These states will always appear on actors as passives. + * Use with RPG Maker MV 1.5.0+. + * @default [] + * + * @param Enemy Passives List + * @parent ---List--- + * @type state[] + * @desc These states will always appear on enemies as passives. + * Use with RPG Maker MV 1.5.0+. + * @default [] + * + * @param Global Passives List + * @parent ---List--- + * @type state[] + * @desc These states will always appear on all battlers as passives. + * Use with RPG Maker MV 1.5.0+. + * @default [] + * + * @help + * ============================================================================ + * Introduction + * ============================================================================ + * + * Passive states are states that are automatically active. You can think of + * them as an extension of traits but with more flexibility. They will always + * be there as long as the actor or enemy has auto passive state notetags. + * + * ============================================================================ + * Notetags + * ============================================================================ + * + * For those who would like to allocate passive states to your battlers, use + * the notetags below: + * + * Actor, Class, Skills, Weapon, Armor, Enemy Notetags: + * + * + * This will allow the actor or enemy to have state x as a passive state. + * If placed inside a weapon or armor notebox, the user will have that + * passive state. + * + * + * This will add the states x through y (in a sequence) for the actor or + * enemy to have as a passive state. If placed inside a weapon or armor + * notebox, the user will have that passive state. + * + * For those who don't want their passive states to always be on, you can use + * the following notetags to introduce conditions for your passive states. All + * conditions must be fulfilled in order for the passive state to appear. + * + * State Notetags: + * + * + * + * + * If the user's HP or MP is above/below x% of the MaxHP or MaxMP, this + * condition will be met for the passive state to appear. + * + * + * + * Replace 'stat' with 'HP', 'MP', 'TP', 'MAXHP', 'MAXMP', 'ATK', 'DEF', + * 'MAT', 'MDF', 'AGI', 'LUK'. If the above stat is above/below x, then the + * condition is met for the passive state to appear. + * + * + * + * If switch x is either ON/OFF, then the condition is met for the passive + * state to appear. + * + * + * + * Replace x with the variable you wish to check to see if it's above/below + * y, then the condition is met for the passive state to appear. + * + * ============================================================================ + * Lunatic Mode - Conditional Passives + * ============================================================================ + * + * For those who understand a bit of JavaScript and would like for their + * passive states to appear under specific conditions, you can use this notetag + * to accomplish conditional factors. + * + * State Notetags: + * + * if (user.hp / user.mhp <= 0.25) { + * condition = true; + * } else { + * condition = false; + * } + * + * This enables you to input conditions to be met in order for the passive + * state to appear. If the 'condition' variable returns true, the passive + * state will appear. If the 'condition' returns false, it won't appear. If + * condition is not defined, it will return true and the passive state will + * appear on the battler. + * * Note: All non-custom passive conditions must be met before this one can + * be fulfilled and allow the custom condition to appear. + * * Note: If you decide to use a condition that requires the actor to have a + * particular state, it cannot be a passive state to prevent infinite loops. + * + * ============================================================================ + * Changelog + * ============================================================================ + * + * Version 1.17: + * - Optimization update. There should be less lag spikes if there are more + * passive conditions present on a battler. + * + * Version 1.16: + * - Bypass the isDevToolsOpen() error when bad code is inserted into a script + * call or custom Lunatic Mode code segment due to updating to MV 1.6.1. + * + * Version 1.15: + * - Bug fixed that made global passives not apply to actors. + * + * Version 1.14: + * - Updated for RPG Maker MV version 1.5.0. + * - Added parameters: Actor Passives List, Enemy Passives List, and + * Global Passives List + * + * Version 1.13: + * - Lunatic Mode fail safes added. + * + * Version 1.12: + * - Implemented to now affect passive state ID's + * added by Equip Battle Skills. + * + * Version 1.11: + * - Added 'Global Passives' that encompass both actors and enemies. + * + * Version 1.10: + * - Added compatibility functionality for Equip Battle Skills to add the + * equipped passive states during battle test. + * + * Version 1.09: + * - Added 'Actor Passives' and 'Enemy Passives' plugin parameters. This will + * cause all actors and enemies respectively to be affected by the listed + * states as passives. + * + * Version 1.08: + * - Fixed conditional checks to make sure all states are being checked + * properly without conflict with other conditional states. + * + * Version 1.07: + * - Updated for RPG Maker MV version 1.1.0. + * + * Version 1.06: + * - Added a mass member refresh whenever $gamePlayer is refreshed. + * + * Version 1.05a: + * - Added Lunatic Mode - notetag for states. + * - Fixed a bug that would cause infinite loops. + * + * Version 1.04: + * - Added a lot of passive condition notetags for states. + * --- + * --- + * --- + * --- + * + * Version 1.03: + * - Added refreshing whenever a new skill is learned to update passives. + * + * Version 1.02: + * - Optimized passive state calculations to reduce lag. + * + * Version 1.01: + * - Fixed a bug with having multiple passive states of the same ID. + * + * Version 1.00: + * - Finished plugin! + */ +//============================================================================= + +//============================================================================= +// Parameter Variables +//============================================================================= + +Yanfly.SetupParameters = function() { + Yanfly.Parameters = PluginManager.parameters('YEP_AutoPassiveStates'); + Yanfly.Param = Yanfly.Param || {}; + Yanfly.Param.APSActorPas = String(Yanfly.Parameters['Actor Passives']); + Yanfly.Param.APSActorPas = Yanfly.Param.APSActorPas.split(' '); + for (var i = 0; i < Yanfly.Param.APSActorPas.length; ++i) { + Yanfly.Param.APSActorPas[i] = parseInt(Yanfly.Param.APSActorPas[i]); + Yanfly.Param.APSActorPas[i] = Yanfly.Param.APSActorPas[i] || 0; + } + var data = JSON.parse(Yanfly.Parameters['Actor Passives List']); + for (var i = 0; i < data.length; ++i) { + var stateId = parseInt(data[i]); + if (stateId <= 0) continue; + if (Yanfly.Param.APSActorPas.contains(stateId)) continue; + Yanfly.Param.APSActorPas.push(stateId); + } + Yanfly.Param.APSEnemyPas = String(Yanfly.Parameters['Enemy Passives']); + Yanfly.Param.APSEnemyPas = Yanfly.Param.APSEnemyPas.split(' '); + for (var i = 0; i < Yanfly.Param.APSEnemyPas.length; ++i) { + Yanfly.Param.APSEnemyPas[i] = parseInt(Yanfly.Param.APSEnemyPas[i]); + Yanfly.Param.APSEnemyPas[i] = Yanfly.Param.APSEnemyPas[i] || 0; + } + var data = JSON.parse(Yanfly.Parameters['Enemy Passives List']); + for (var i = 0; i < data.length; ++i) { + var stateId = parseInt(data[i]); + if (stateId <= 0) continue; + if (Yanfly.Param.APSEnemyPas.contains(stateId)) continue; + Yanfly.Param.APSEnemyPas.push(stateId); + } + Yanfly.Param.APSGlobalPas = String(Yanfly.Parameters['Global Passives']); + Yanfly.Param.APSGlobalPas = Yanfly.Param.APSGlobalPas.split(' '); + for (var i = 0; i < Yanfly.Param.APSGlobalPas.length; ++i) { + id = parseInt(Yanfly.Param.APSGlobalPas[i]); + Yanfly.Param.APSActorPas.push(id); + Yanfly.Param.APSEnemyPas.push(id); + } + var data = JSON.parse(Yanfly.Parameters['Global Passives List']); + for (var i = 0; i < data.length; ++i) { + var stateId = parseInt(data[i]); + if (stateId <= 0) continue; + if (!Yanfly.Param.APSActorPas.contains(stateId)) { + Yanfly.Param.APSActorPas.push(stateId); + } + if (!Yanfly.Param.APSEnemyPas.contains(stateId)) { + Yanfly.Param.APSEnemyPas.push(stateId); + } + } +}; +Yanfly.SetupParameters(); + +//============================================================================= +// DataManager +//============================================================================= + +Yanfly.APS.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded; +DataManager.isDatabaseLoaded = function() { + if (!Yanfly.APS.DataManager_isDatabaseLoaded.call(this)) return false; + if (!Yanfly._loaded_YEP_AutoPassiveStates) { + this.processAPSNotetags1($dataActors, Yanfly.Param.APSActorPas); + this.processAPSNotetags1($dataClasses); + this.processAPSNotetags1($dataEnemies, Yanfly.Param.APSEnemyPas); + this.processAPSNotetags1($dataSkills); + this.processAPSNotetags1($dataWeapons); + this.processAPSNotetags1($dataArmors); + this.processAPSNotetags2($dataStates); + Yanfly._loaded_YEP_AutoPassiveStates = true; + } + return true; +}; + +DataManager.processAPSNotetags1 = function(group, inheritArray) { + var note1 = /<(?:PASSIVE STATE):[ ]*(\d+(?:\s*,\s*\d+)*)>/i; + var note2 = /<(?:PASSIVE STATE):[ ](\d+)[ ](?:THROUGH|to)[ ](\d+)>/i; + for (var n = 1; n < group.length; n++) { + var obj = group[n]; + var notedata = obj.note.split(/[\r\n]+/); + + obj.passiveStates = []; + if (inheritArray) { + obj.passiveStates = obj.passiveStates.concat(inheritArray); + } + + for (var i = 0; i < notedata.length; i++) { + var line = notedata[i]; + if (line.match(note1)) { + var array = JSON.parse('[' + RegExp.$1.match(/\d+/g) + ']'); + obj.passiveStates = obj.passiveStates.concat(array); + } else if (line.match(note2)) { + var range = Yanfly.Util.getRange(parseInt(RegExp.$1), + parseInt(RegExp.$2)); + obj.passiveStates = obj.passiveStates.concat(range); + } + } + } +}; + +DataManager.processAPSNotetags2 = function(group) { + var note1a = /<(?:PASSIVE CONDITION):[ ](.*)[ ](?:ABOVE)[ ](\d+)([%%])>/i; + var note1b = /<(?:PASSIVE CONDITION):[ ](.*)[ ](?:BELOW)[ ](\d+)([%%])>/i; + var note2a = /<(?:PASSIVE CONDITION):[ ](.*)[ ](?:ABOVE)[ ](\d+)>/i; + var note2b = /<(?:PASSIVE CONDITION):[ ](.*)[ ](?:BELOW)[ ](\d+)>/i; + var note3a = /<(?:PASSIVE CONDITION):[ ]SWITCH[ ](\d+)[ ](.*)>/i; + var notez1 = /<(?:CUSTOM PASSIVE CONDITION)>/i; + var notez2 = /<\/(?:CUSTOM PASSIVE CONDITION)>/i; + for (var n = 1; n < group.length; n++) { + var obj = group[n]; + var notedata = obj.note.split(/[\r\n]+/); + + obj.passiveCondition = ''; + obj.passiveConditionEval = ''; + var evalMode = 'none'; + + for (var i = 0; i < notedata.length; i++) { + var line = notedata[i]; + if (line.match(note1a)) { + var rate = parseFloat(RegExp.$2) * 0.01; + var param = this.getPassiveConditionParamRate(String(RegExp.$1)); + var pass = 'if (' + param + ' <= ' + rate + ') condition = false;'; + obj.passiveCondition = obj.passiveCondition + pass + '\n'; + } else if (line.match(note1b)) { + var rate = parseFloat(RegExp.$2) * 0.01; + var param = this.getPassiveConditionParamRate(String(RegExp.$1)); + var pass = 'if (' + param + ' >= ' + rate + ') condition = false;'; + obj.passiveCondition = obj.passiveCondition + pass + '\n'; + } else if (line.match(note2a)) { + var rate = parseInt(RegExp.$2); + var param = this.getPassiveConditionParam(String(RegExp.$1)); + var pass = 'if (' + param + ' <= ' + rate + ') condition = false;'; + obj.passiveCondition = obj.passiveCondition + pass + '\n'; + } else if (line.match(note2b)) { + var rate = parseInt(RegExp.$2); + var param = this.getPassiveConditionParam(String(RegExp.$1)); + var pass = 'if (' + param + ' >= ' + rate + ') condition = false;'; + obj.passiveCondition = obj.passiveCondition + pass + '\n'; + } else if (line.match(note3a)) { + var id = parseInt(RegExp.$1); + var value = String(RegExp.$2).toUpperCase(); + var pass = '' + if (['ON', 'TRUE', 'ENABLE', 'ENABLED'].contains(value)) { + pass = 'if (!$gameSwitches.value(' + id + ')) condition = false;' + } + if (['OFF', 'FALSE', 'DISABLE', 'DISABLED'].contains(value)) { + pass = 'if ($gameSwitches.value(' + id + ')) condition = false;' + } + if (pass === '') continue; + obj.passiveCondition = obj.passiveCondition + pass + '\n'; + } else if (line.match(notez1)) { + evalMode = 'custom passive condition'; + } else if (line.match(notez2)) { + evalMode = 'none'; + } else if (evalMode === 'custom passive condition') { + obj.passiveConditionEval = obj.passiveConditionEval + line + '\n'; + } + } + + obj.passiveCondition = new Function('condition','a','user','subject','b', + 'target','s','v', obj.passiveCondition + '\nreturn condition;'); + obj.passiveConditionEval = new Function('condition','a','user','subject', + 'b','target','s','v', obj.passiveConditionEval + '\nreturn condition;'); + } +}; + +DataManager.getPassiveConditionParam = function(string) { + string = string.toUpperCase(); + var text = 'user.'; + if (['HP'].contains(string)) text += 'hp'; + if (['MP', 'SP'].contains(string)) text += 'mp'; + if (['TP'].contains(string)) text += 'tp'; + if (['ATK'].contains(string)) text += 'param(2)'; + if (['DEF'].contains(string)) text += 'param(3)'; + if (['MAT', 'INT'].contains(string)) text += 'param(4)'; + if (['MDF', 'RES'].contains(string)) text += 'param(5)'; + if (['AGI'].contains(string)) text += 'param(6)'; + if (['LUK'].contains(string)) text += 'param(7)'; + if (['MAX HP', 'MAXHP'].contains(string)) text += 'mhp'; + if (['MAX MP', 'MAX SP', 'MAXMP', 'MAXSP'].contains(string)) text += 'mmp'; + if (string.match(/VARIABLE[ ](\d+)/i)) { + text = '$gameVariables.value(' + parseInt(RegExp.$1) + ')'; + } + return text; +}; + +DataManager.getPassiveConditionParamRate = function(string) { + string = string.toUpperCase(); + var text = '0'; + if (['HP'].contains(string)) return 'user.hpRate()'; + if (['MP'].contains(string)) return 'user.mpRate()'; + return text; +}; + +//============================================================================= +// Game_BattlerBase +//============================================================================= + +Yanfly.APS.Game_BattlerBase_refresh = Game_BattlerBase.prototype.refresh; +Game_BattlerBase.prototype.refresh = function() { + this._passiveStatesRaw = undefined; + Yanfly.APS.Game_BattlerBase_refresh.call(this); +}; + +Yanfly.APS.Game_BattlerBase_states = Game_BattlerBase.prototype.states; +Game_BattlerBase.prototype.states = function() { + var array = Yanfly.APS.Game_BattlerBase_states.call(this); + array = array.concat(this.passiveStates()); + this.sortPassiveStates(array); + return array; +}; + +Yanfly.APS.Game_BattlerBase_isStateAffected = + Game_BattlerBase.prototype.isStateAffected; +Game_BattlerBase.prototype.isStateAffected = function(stateId) { + if (this.isPassiveStateAffected(stateId)) return true; + return Yanfly.APS.Game_BattlerBase_isStateAffected.call(this, stateId); +}; + +Game_BattlerBase.prototype.passiveStates = function() { + var array = []; + var raw = this.passiveStatesRaw(); + for (var i = 0; i < raw.length; ++i) { + var state = $dataStates[raw[i]]; + if (state && array.contains(state)) continue; + array.push(state); + } + return array; +}; + +Game_BattlerBase.prototype.passiveStatesRaw = function() { + var array = []; + return array.filter(Yanfly.Util.onlyUnique); +}; + +Game_BattlerBase.prototype.getPassiveStateData = function(obj) { + if (!obj) return []; + if (!obj.passiveStates) return []; + var array = []; + for (var i = 0; i < obj.passiveStates.length; ++i) { + var stateId = obj.passiveStates[i]; + if (!this.meetPassiveStateCondition(stateId)) continue; + array.push(stateId); + } + var added = this.addEquipBattleTestSkillPassives(obj); + if (added.length > 0) { + for (var i = 0; i < added.length; ++i) { + var stateId = added[i]; + if (!this.meetPassiveStateCondition(stateId)) continue; + array.push(stateId); + } + } + return array; +}; + +Game_BattlerBase.prototype.addEquipBattleTestSkillPassives = function(obj) { + if (!Imported.YEP_EquipBattleSkills) return []; + if (!DataManager.isBattleTest()) return []; + if (!DataManager.isSkill(obj)) return []; + return obj.equipStates; +}; + +Game_BattlerBase.prototype.meetPassiveStateCondition = function(stateId) { + this._checkPassiveStateCondition = this._checkPassiveStateCondition || []; + if (this._checkPassiveStateCondition.contains(stateId)) return false; + var state = $dataStates[stateId]; + if (!state) return false; + if (state.passiveCondition !== '') { + if (!this.passiveStateConditions(state)) return false; + } + if (state.passiveConditionEval === '') return true; + return this.passiveStateConditionEval(state); +}; + +Game_BattlerBase.prototype.passiveStateConditions = function(state) { + this._checkPassiveStateCondition = this._checkPassiveStateCondition || []; + this._checkPassiveStateCondition.push(state.id); + var condition = true; + var a = this; + var user = this; + var subject = this; + var b = this; + var target = this; + var s = $gameSwitches._data; + var v = $gameVariables._data; + var code = state.passiveCondition; + try { + condition = state.passiveCondition.call(this, condition, a, user, subject, + b, target, s, v); + } catch (e) { + Yanfly.Util.displayError(e, code, 'PASSIVE STATE CUSTOM CONDITION ERROR'); + } + var index = this._checkPassiveStateCondition.indexOf(state.id); + this._checkPassiveStateCondition.splice(index, 1); + return condition; +}; + +Game_BattlerBase.prototype.passiveStateConditionEval = function(state) { + this._checkPassiveStateCondition = this._checkPassiveStateCondition || []; + this._checkPassiveStateCondition.push(state.id); + var condition = true; + var a = this; + var user = this; + var subject = this; + var b = this; + var target = this; + var s = $gameSwitches._data; + var v = $gameVariables._data; + var code = state.passiveConditionEval; + try { + condition = state.passiveConditionEval.call(this, condition, a, user, + subject, b, target, s, v); + } catch (e) { + Yanfly.Util.displayError(e, code, 'PASSIVE STATE CUSTOM CONDITION ERROR'); + } + var index = this._checkPassiveStateCondition.indexOf(state.id); + this._checkPassiveStateCondition.splice(index, 1); + return condition; +}; + +Game_BattlerBase.prototype.sortPassiveStates = function(array) { + array.sort(function(a, b) { + var p1 = a.priority; + var p2 = b.priority; + if (p1 !== p2) return p2 - p1; + return a - b; + }); +}; + +Game_BattlerBase.prototype.isPassiveStateAffected = function(stateId) { + return this.passiveStatesRaw().contains(stateId); +}; + +//============================================================================= +// Game_Battler +//============================================================================= + +Yanfly.APS.Game_Battler_isStateAddable = Game_Battler.prototype.isStateAddable; +Game_Battler.prototype.isStateAddable = function(stateId) { + if (this.isPassiveStateAffected(stateId)) return false; + return Yanfly.APS.Game_Battler_isStateAddable.call(this, stateId); +}; + +Yanfly.APS.Game_Battler_removeState = Game_Battler.prototype.removeState; +Game_Battler.prototype.removeState = function(stateId) { + if (this.isPassiveStateAffected(stateId)) return; + Yanfly.APS.Game_Battler_removeState.call(this, stateId); +}; + +//============================================================================= +// Game_Actor +//============================================================================= + +Game_Actor.prototype.passiveStatesRaw = function() { + if (this._passiveStatesRaw !== undefined) return this._passiveStatesRaw; + var array = Game_BattlerBase.prototype.passiveStatesRaw.call(this); + array = array.concat(this.getPassiveStateData(this.actor())); + array = array.concat(this.getPassiveStateData(this.currentClass())); + for (var i = 0; i < this.equips().length; ++i) { + var equip = this.equips()[i]; + array = array.concat(this.getPassiveStateData(equip)); + } + for (var i = 0; i < this._skills.length; ++i) { + var skill = $dataSkills[this._skills[i]]; + array = array.concat(this.getPassiveStateData(skill)); + } + this._passiveStatesRaw = array.filter(Yanfly.Util.onlyUnique) + return this._passiveStatesRaw; +}; + +Yanfly.APS.Game_Actor_learnSkill = Game_Actor.prototype.learnSkill; +Game_Actor.prototype.learnSkill = function(skillId) { + Yanfly.APS.Game_Actor_learnSkill.call(this, skillId); + this._passiveStatesRaw = undefined; +}; + +Yanfly.APS.Game_Actor_forgetSkill = Game_Actor.prototype.forgetSkill; +Game_Actor.prototype.forgetSkill = function(skillId) { + Yanfly.APS.Game_Actor_forgetSkill.call(this, skillId); + this._passiveStatesRaw = undefined; +}; + +//============================================================================= +// Game_Enemy +//============================================================================= + +Game_Enemy.prototype.passiveStatesRaw = function() { + if (this._passiveStatesRaw !== undefined) return this._passiveStatesRaw; + var array = Game_BattlerBase.prototype.passiveStatesRaw.call(this); + array = array.concat(this.getPassiveStateData(this.enemy())); + for (var i = 0; i < this.skills().length; ++i) { + var skill = this.skills()[i]; + array = array.concat(this.getPassiveStateData(skill)); + } + this._passiveStatesRaw = array.filter(Yanfly.Util.onlyUnique) + return this._passiveStatesRaw; +}; + +if (!Game_Enemy.prototype.skills) { + Game_Enemy.prototype.skills = function() { + var skills = [] + for (var i = 0; i < this.enemy().actions.length; ++i) { + var skill = $dataSkills[this.enemy().actions[i].skillId]; + if (skill) skills.push(skill); + } + return skills; + } +}; + +//============================================================================= +// Game_Unit +//============================================================================= + +Game_Unit.prototype.refreshMembers = function() { + var group = this.allMembers(); + var length = group.length; + for (var i = 0; i < length; ++i) { + var member = group[i]; + if (member) member.refresh(); + } +}; + +Game_Unit.prototype.allMembers = function() { + return this.members(); +}; + +//============================================================================= +// Game_Player +//============================================================================= + +Yanfly.APS.Game_Player_refresh = Game_Player.prototype.refresh; +Game_Player.prototype.refresh = function() { + $gameParty.refreshMembers(); + Yanfly.APS.Game_Player_refresh.call(this); +}; + +//============================================================================= +// Utilities +//============================================================================= + +Yanfly.Util = Yanfly.Util || {}; + +Yanfly.Util.displayError = function(e, code, message) { + console.log(message); + console.log(code || 'NON-EXISTENT'); + console.error(e); + if (Utils.RPGMAKER_VERSION && Utils.RPGMAKER_VERSION >= "1.6.0") return; + if (Utils.isNwjs() && Utils.isOptionValid('test')) { + if (!require('nw.gui').Window.get().isDevToolsOpen()) { + require('nw.gui').Window.get().showDevTools(); + } + } +}; + +Yanfly.Util.getRange = function(n, m) { + var result = []; + for (var i = n; i <= m; ++i) result.push(i); + return result; +}; + +Yanfly.Util.onlyUnique = function(value, index, self) { + return self.indexOf(value) === index; +}; + +//============================================================================= +// End of File +//=============================================================================