From cb804c8b694d758e793972ace881b0e449f2005b Mon Sep 17 00:00:00 2001 From: alexpolo1 Date: Mon, 10 Apr 2023 22:08:20 +0200 Subject: [PATCH] 2 --- data/DataEX.json | 1 + data/DistributionStats.json | 1 + data/Map004.json | 9 +- data/Map005.json | 9 + data/MapInfos.json | 9 +- data/Notes.json | 1 + data/System.json | 2 +- data/Windows.json | 1 + js/plugins.js | 12 +- js/plugins/BatchText.js | 113 + js/plugins/FROG_TriggerDistance.js | 343 ++ js/plugins/GALV_EventSpawnTimers.js | 285 ++ js/plugins/HIME_DisabledChoiceConditions.js | 159 + js/plugins/JIF_MoveStaling.js | 103 + js/plugins/MOG_TrPopUpBattle.js | 356 ++ js/plugins/SRD_HUDMaker.js | 3853 +++++++++++++++++++ js/plugins/SRD_SuperToolsEngine.js | 3114 +++++++++++++++ js/plugins/TDDP_MouseSystemEx.js | 928 +++++ js/plugins/YEP_EventMiniLabel.js | 557 +++ js/plugins/YEP_Extra_Enemy_Drops.js | 77 + js/plugins/YEP_JobPoints.js | 804 ++++ save/config.rpgsave | 1 + supertoolsengine.html | 1 + 23 files changed, 10726 insertions(+), 13 deletions(-) create mode 100644 data/DataEX.json create mode 100644 data/DistributionStats.json create mode 100644 data/Map005.json create mode 100644 data/Notes.json create mode 100644 data/Windows.json create mode 100644 js/plugins/BatchText.js create mode 100644 js/plugins/FROG_TriggerDistance.js create mode 100644 js/plugins/GALV_EventSpawnTimers.js create mode 100644 js/plugins/HIME_DisabledChoiceConditions.js create mode 100644 js/plugins/JIF_MoveStaling.js create mode 100644 js/plugins/MOG_TrPopUpBattle.js create mode 100644 js/plugins/SRD_HUDMaker.js create mode 100644 js/plugins/SRD_SuperToolsEngine.js create mode 100644 js/plugins/TDDP_MouseSystemEx.js create mode 100644 js/plugins/YEP_EventMiniLabel.js create mode 100644 js/plugins/YEP_Extra_Enemy_Drops.js create mode 100644 js/plugins/YEP_JobPoints.js create mode 100644 save/config.rpgsave create mode 100644 supertoolsengine.html diff --git a/data/DataEX.json b/data/DataEX.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/data/DataEX.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/data/DistributionStats.json b/data/DistributionStats.json new file mode 100644 index 0000000..3afd27b --- /dev/null +++ b/data/DistributionStats.json @@ -0,0 +1 @@ +{"mhp":{"name":"Max HP","description":"The maximum amount of HP for the actor.","cost":"1","gain":"5","max":"500","min_col":"#ffa655","max_col":"#ea7000","@c":2},"mmp":{"name":"Max MP","description":"The maximum amount of MP for the actor.","cost":"1","gain":"2","max":"200","min_col":"#6666ff","max_col":"#0000ff","@c":3},"atk":{"name":"Attack","description":"Strengthens the damage of physical skills used by \nthe actor.","cost":"1","gain":"1","max":"100","min_col":"#ff7777","max_col":"#f90000","@c":4},"def":{"name":"Defense","description":"Reduces the damage of physical skills the actor is \ntargeted with.","cost":"1","gain":"1","max":"100","min_col":"#52ff33","max_col":"#12b700","@c":5},"mat":{"name":"Magic Attack","description":"Strengthens the damage of magical skills used by \nthe actor.","cost":"1","gain":"1","max":"100","min_col":"#b355ff","max_col":"#a300d9","@c":6},"mdf":{"name":"Magic Defense","description":"Reduces the damage of magical skills the actor is \ntargeted with.","cost":"1","gain":"1","max":"100","min_col":"#55ffe6","max_col":"#00d7b7","@c":7},"agi":{"name":"Agility","description":"Determines how soon the actor will be able to \npreform a turn in battle.","cost":"1","gain":"1","max":"100","min_col":"#fbff55","max_col":"#d9d300","@c":8},"luk":{"name":"Luck","description":"Influences various luck factors for the actor in \ntheir favor.","cost":"1","gain":"1","max":"100","min_col":"#ff55e6","max_col":"#cc00ad","@c":9},"hit":{"name":"Hit Rate","description":"Increases the chance of skills hitting their \ntarget.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":10},"eva":{"name":"Evasion Rate","description":"Increases the likely-hood of an actor evading\na physical skill.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":11},"cri":{"name":"Critical Rate","description":"Determines how likely an actor will preform \na critical hit.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":12},"cev":{"name":"Critical Evasion Rate","description":"Decreases the likely-hood of skills targeting \nthe actor being critical.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":13},"mev":{"name":"Magic Evasion Rate","description":"Increases the likely-hood of an actor evading \na magical skill.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":14},"mrf":{"name":"Magic Reflection Rate","description":"The higher the value, the more likely magical \nreflection will occur.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":15},"cnt":{"name":"Counter Attack Rate","description":"The higher the value, the more likely physical \nreflection will occur.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":16},"hrg":{"name":"Hp Regeneration","description":"The rate in which the actor gains HP each turn.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":17},"mrg":{"name":"Mp Regeneration","description":"The rate in which the actor gains MP each turn.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":18},"trg":{"name":"Tp Regeneration","description":"The rate in which the actor gains TP each turn.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":19},"tgr":{"name":"Target Rate","description":"Increases the chance of the actor being attacked.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":20},"grd":{"name":"Guard Effect Rate","description":"Increases the effectiveness of the actor's guard","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":21},"rec":{"name":"Recovery Effect Rate","description":"Determines the effectiveness of recovery skills.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":22},"pha":{"name":"Pharmacology","description":"Determines the effectiveness of recovery items.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":23},"mcr":{"name":"Mp Cost Rate","description":"The rate in which MP skills cost.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":24},"tcr":{"name":"Tp Charge Rate","description":"The rate in which TP skills cost.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":25},"pdr":{"name":"Physical Damage Rate","description":"The rate in which physical damage occurs.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":26},"mdr":{"name":"Magical Damage Rate","description":"The rate in which magical damage occurs.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":27},"fdr":{"name":"Floor Damage Rate","description":"The rate in which floor damage occurs.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":28},"exr":{"name":"Experience Rate","description":"The rate in which the actor gains experience.","cost":"2","gain":"0.005","max":"0.5","min_col":"#aaaaaa","max_col":"#ffffff","@c":29},"@c":1} \ No newline at end of file diff --git a/data/Map004.json b/data/Map004.json index 1f4954e..b715233 100644 --- a/data/Map004.json +++ b/data/Map004.json @@ -1,9 +1,12 @@ { "autoplayBgm":false,"autoplayBgs":false,"battleback1Name":"Wood2","battleback2Name":"Room1","bgm":{"name":"","pan":0,"pitch":100,"volume":90},"bgs":{"name":"","pan":0,"pitch":100,"volume":90},"disableDashing":false,"displayName":"","encounterList":[],"encounterStep":30,"height":17,"note":"","parallaxLoopX":false,"parallaxLoopY":false,"parallaxName":"","parallaxShow":true,"parallaxSx":0,"parallaxSy":0,"scrollType":0,"specifyBattleback":true,"tilesetId":3,"width":21, -"data":[1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,6834,6820,6820,6820,6821,6833,6833,6833,6833,6833,6833,6833,6823,6833,6833,6833,6833,6833,6837,1536,1536,6816,6800,6800,6800,6824,7187,7186,7186,7186,7186,7186,7190,6832,7187,7186,7186,7186,7190,6832,1536,1536,6816,6800,6800,6800,6824,7193,7192,7192,7192,7192,7192,7196,6832,7193,7192,7192,7192,7196,6832,1536,1536,6818,6828,6828,6828,6838,3234,3220,3220,3220,3220,3220,3236,6832,3234,3236,2946,2932,2948,6832,1536,1536,6832,7187,7186,7186,7190,3216,3200,3200,3200,3200,3200,3224,6844,3216,3224,2928,2912,2936,6832,1536,1536,6832,7193,7192,7192,7196,3216,3200,3200,3200,3200,3200,3224,7191,3216,3224,2952,2940,2950,6832,1536,1536,6832,3618,3604,3604,3620,3216,3200,3200,3200,3200,3200,3224,7197,3216,3202,3220,3220,3236,6832,1536,1536,6832,3624,3612,3612,3622,3216,3200,3200,3200,3200,3200,3206,3233,3229,3228,3228,3228,3238,6832,1536,1536,6832,3234,3220,3220,3220,3201,3200,3200,3200,3200,3200,3224,6835,6833,6833,6833,6833,6833,6827,1536,1536,6832,3216,3200,3200,3200,3200,3200,3200,3200,3200,3200,3224,6832,7187,7186,7186,7186,7190,6832,1536,1536,6832,3216,3200,3200,3200,3200,3200,3200,3200,3200,3200,3224,6844,7193,7192,7192,7192,7196,6832,1536,1536,6832,3240,3228,3208,3200,3200,3200,3200,3200,3200,3200,3224,7191,3234,3220,3220,3220,3236,6832,1536,1536,6817,6820,6836,3216,3200,3200,3200,3200,3200,3200,3200,3224,7197,3216,3200,3200,3200,3224,6832,1536,1536,6816,6800,6824,3240,3228,3228,3228,3228,3228,3212,3228,3230,3233,3229,3228,3228,3228,3238,6832,1536,1536,6840,6828,6830,6833,6833,6833,6833,6833,6837,3232,6835,6833,6833,6833,6833,6833,6833,6833,6839,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,6832,3232,6832,1536,1536,1536,1536,1536,1536,1536,1536,1536,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3186,3172,3188,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3168,3152,3176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3192,3180,3190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3187,3197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3196,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,131,0,32,0,0,166,167,0,33,0,0,0,0,0,0,0,0,0,69,40,0,139,0,40,0,0,69,50,0,41,0,0,0,0,0,0,0,0,0,77,0,0,0,0,0,0,0,77,58,0,81,82,0,0,0,0,38,0,16,20,0,0,0,104,0,0,0,0,0,0,0,89,90,0,0,0,0,46,121,24,28,64,0,0,0,0,0,0,0,104,96,0,0,0,0,0,0,0,112,113,114,115,72,104,0,0,0,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,0,0,0,0,0,0,104,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,341,328,77,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,315,104,0,0,88,0,0,0,0,0,0,209,209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,5,5,0,0,0,0,0,0,5,0,5,0,0,0,5,0,0,0,0,0,0,5,0,0,0,0,0,0,0,5,0,0,0,0,0,5,0,0,0,0,0,0,5,0,0,0,0,0,0,0,5,0,0,0,0,0,5,0,0,5,0,0,0,0,5,0,0,0,0,0,0,5,0,0,0,0,0,5,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,5,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,5,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], +"data":[1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,6835,6833,6833,6833,6823,6833,6833,6833,6833,6833,6833,6833,6833,6833,6833,6833,6833,6833,6837,1536,1536,6832,7186,7186,7190,6832,7187,7186,7186,7186,7186,7186,7186,7186,7186,7186,7186,7186,7186,6832,1536,1536,6832,7192,7192,7192,6832,7192,7192,7192,7192,7192,7192,7192,7192,7192,7192,7192,7192,7192,6832,1536,1536,6832,3234,3220,3236,6832,3234,3220,3220,3220,3220,3220,3220,3220,3220,3220,3220,3220,3236,6832,1536,1536,6832,3216,3200,3224,6832,3216,3200,3200,3200,3200,3200,3200,3204,3228,3228,3208,3200,3224,6832,1536,1536,6832,3216,3200,3224,6832,3216,3200,3200,3200,3200,3200,3200,3224,4098,4100,3216,3200,3224,6832,1536,1536,6832,3216,3200,3224,6832,3216,3200,3200,3200,3200,3200,3200,3224,4104,4102,3216,3200,3224,6832,1536,1536,6832,3216,3200,3224,6832,3216,3200,3200,3200,3200,3200,3204,3230,3233,3233,3229,3228,3238,6832,1536,1536,6832,3216,3200,3224,6844,3216,3200,3200,3200,3200,3200,3224,6835,6833,6833,6833,6833,6833,6827,1536,1536,6832,3240,3228,3230,3233,3229,3228,3228,3228,3208,3200,3224,6832,7186,7186,7186,7186,7186,6832,1536,1536,6819,6833,6833,6833,6833,6833,6833,6833,6837,3216,3200,3224,6832,7192,7192,7192,7192,7192,6832,1536,1536,6832,3234,3220,3220,3220,3220,3220,3236,6832,3216,3200,3224,6832,3618,3604,3604,3604,3620,6832,1536,1536,6832,3216,3200,3200,3200,3200,3200,3224,6844,3216,3200,3224,6844,3600,3584,3584,3584,3608,6832,1536,1536,6832,3240,3228,3228,3228,3228,3228,3230,3233,3213,3228,3230,3245,3624,3612,3612,3612,3622,6832,1536,1536,6841,6833,6833,6833,6833,6833,6833,6833,6837,3232,6835,6833,6833,6833,6833,6833,6833,6833,6839,1536,1536,1536,1536,1536,1536,1536,1536,1536,1536,6832,3232,6832,1536,1536,1536,1536,1536,1536,1536,1536,1536,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3187,3197,0,0,0,0,0,0,0,3186,3188,0,0,0,0,0,0,0,0,0,0,3196,0,0,0,0,0,0,0,0,3192,3190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,388,389,387,32,391,166,167,0,0,131,5,0,0,0,0,0,0,69,0,0,40,0,0,0,40,0,0,403,0,0,139,13,0,0,0,0,341,328,77,0,0,0,0,0,104,0,0,0,0,0,0,0,194,0,0,0,0,315,104,0,0,0,0,0,0,104,0,0,0,0,0,0,0,416,0,0,0,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,0,0,0,0,0,0,104,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,392,0,121,0,0,0,0,0,0,52,53,54,55,209,209,209,0,0,0,0,0,114,112,113,114,115,0,0,0,0,60,61,62,63,209,209,360,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,0,0,0,0,5,0,0,0,5,0,0,0,0,0,5,0,0,5,0,0,0,0,0,0,0,5,0,0,0,5,0,0,0,0,0,5,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,5,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "events":[ null, -{"id":1,"name":"EV001","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":true,"image":{"tileId":0,"characterName":"!Flame","direction":4,"pattern":1,"characterIndex":1},"list":[{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":1,"stepAnime":true,"through":false,"trigger":0,"walkAnime":true}],"x":13,"y":6}, -null +{"id":1,"name":"EV001","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":true,"image":{"tileId":0,"characterName":"!Flame","direction":4,"pattern":1,"characterIndex":1},"list":[{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":1,"stepAnime":true,"through":false,"trigger":0,"walkAnime":true}],"x":15,"y":2}, +{"id":2,"name":"sink","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":false,"image":{"characterIndex":0,"characterName":"","direction":2,"pattern":0,"tileId":0},"list":[{"code":101,"indent":0,"parameters":["Actor1",6,0,2]},{"code":401,"indent":0,"parameters":["its a sink"]},{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":1,"stepAnime":false,"through":false,"trigger":0,"walkAnime":true}],"x":3,"y":7}, +{"id":3,"name":"EV003","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":false,"image":{"characterIndex":0,"characterName":"","direction":2,"pattern":0,"tileId":0},"list":[{"code":101,"indent":0,"parameters":["",0,0,2]},{"code":401,"indent":0,"parameters":["wake up"]},{"code":123,"indent":0,"parameters":["A",0]},{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":0,"stepAnime":false,"through":false,"trigger":4,"walkAnime":true},{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":true,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":false,"image":{"characterIndex":0,"characterName":"","direction":2,"pattern":0,"tileId":0},"list":[{"code":101,"indent":0,"parameters":["",0,0,2]},{"code":401,"indent":0,"parameters":["time to get going"]},{"code":201,"indent":0,"parameters":[0,4,17,13,4,0]},{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":0,"stepAnime":false,"through":false,"trigger":0,"walkAnime":true}],"x":1,"y":1}, +{"id":4,"name":"EV004","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":true,"image":{"tileId":0,"characterName":"!Flame","direction":4,"pattern":1,"characterIndex":1},"list":[{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":1,"stepAnime":true,"through":false,"trigger":0,"walkAnime":true}],"x":18,"y":10}, +{"id":5,"name":"EV005","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":true,"image":{"tileId":0,"characterName":"!Flame","direction":4,"pattern":1,"characterIndex":1},"list":[{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":1,"stepAnime":true,"through":false,"trigger":0,"walkAnime":true}],"x":3,"y":2} ] } \ No newline at end of file diff --git a/data/Map005.json b/data/Map005.json new file mode 100644 index 0000000..7fe3c52 --- /dev/null +++ b/data/Map005.json @@ -0,0 +1,9 @@ +{ +"autoplayBgm":true,"autoplayBgs":false,"battleback1Name":"Wood2","battleback2Name":"Room1","bgm":{"name":"Theme2","pan":0,"pitch":100,"volume":10},"bgs":{"name":"","pan":0,"pitch":100,"volume":90},"disableDashing":false,"displayName":"Intro","encounterList":[],"encounterStep":30,"height":17,"note":"","parallaxLoopX":false,"parallaxLoopY":false,"parallaxName":"","parallaxShow":true,"parallaxSx":0,"parallaxSy":0,"scrollType":3,"specifyBattleback":false,"tilesetId":1,"width":21, +"data":[3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3296,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,3344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], +"events":[ +null, +{"id":1,"name":"intro","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":false,"image":{"characterIndex":0,"characterName":"","direction":2,"pattern":0,"tileId":0},"list":[{"code":221,"indent":0,"parameters":[]},{"code":105,"indent":0,"parameters":[2,false]},{"code":405,"indent":0,"parameters":["\"In a world of magic and mystery, a hero awakens in a"]},{"code":405,"indent":0,"parameters":["dark and foreboding cave with no memory of their past"]},{"code":405,"indent":0,"parameters":["As they venture out into the unknown, they discover "]},{"code":405,"indent":0,"parameters":["that the land is plagued by darkness and danger. Evil "]},{"code":405,"indent":0,"parameters":["sorcerers summon demons from the underworld, and vile "]},{"code":405,"indent":0,"parameters":["monsters roam the land, preying on the innocent."]},{"code":405,"indent":0,"parameters":["With no one to turn to and nothing but their wits and "]},{"code":405,"indent":0,"parameters":["skills, the hero sets out on a quest to uncover the "]},{"code":405,"indent":0,"parameters":["truth about their past and put an end to the evil that"]},{"code":405,"indent":0,"parameters":["threatens the land. Along the way, they will face"]},{"code":405,"indent":0,"parameters":["treacherous dungeons filled with deadly traps and "]},{"code":405,"indent":0,"parameters":["fierce enemies, uncover hidden secrets and ancient "]},{"code":405,"indent":0,"parameters":["artifacts, and forge powerful alliances with other "]},{"code":405,"indent":0,"parameters":["heroes and adventurers."]},{"code":405,"indent":0,"parameters":["The fate of the land rests in the hero's hands. "]},{"code":405,"indent":0,"parameters":["Will they rise to the challenge and become the savior "]},{"code":405,"indent":0,"parameters":["that the land needs, or will they succumb to the "]},{"code":405,"indent":0,"parameters":["darkness and despair that threatens to consume them? "]},{"code":405,"indent":0,"parameters":["Only time will tell in this epic dungeon-crawling"]},{"code":405,"indent":0,"parameters":[" adventure.\""]},{"code":123,"indent":0,"parameters":["A",0]},{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":2,"priorityType":1,"stepAnime":false,"through":false,"trigger":3,"walkAnime":true},{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":true,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":false,"image":{"characterIndex":0,"characterName":"","direction":2,"pattern":0,"tileId":0},"list":[{"code":201,"indent":0,"parameters":[0,4,17,13,4,0]},{"code":222,"indent":0,"parameters":[]},{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":0,"stepAnime":false,"through":false,"trigger":3,"walkAnime":true}],"x":1,"y":1}, +null +] +} \ No newline at end of file diff --git a/data/MapInfos.json b/data/MapInfos.json index 7dde832..9619a3f 100644 --- a/data/MapInfos.json +++ b/data/MapInfos.json @@ -1,7 +1,8 @@ [ null, -{"id":1,"expanded":false,"name":"MAP001","order":4,"parentId":3,"scrollX":4094.1818181818185,"scrollY":2764.3636363636365}, -{"id":2,"expanded":true,"name":"MAP002","order":2,"parentId":4,"scrollX":4094.1818181818185,"scrollY":2797.090909090909}, -{"id":3,"expanded":true,"name":"MAP003","order":3,"parentId":2,"scrollX":4094.1818181818185,"scrollY":2764.3636363636365}, -{"id":4,"expanded":true,"name":"House 2","order":1,"parentId":0,"scrollX":1242.5454545454545,"scrollY":699.2727272727273} +{"id":1,"expanded":false,"name":"MAP001","order":5,"parentId":3,"scrollX":4094.1818181818185,"scrollY":2764.3636363636365}, +{"id":2,"expanded":true,"name":"MAP002","order":3,"parentId":4,"scrollX":4094.1818181818185,"scrollY":2797.090909090909}, +{"id":3,"expanded":true,"name":"MAP003","order":4,"parentId":2,"scrollX":4094.1818181818185,"scrollY":2764.3636363636365}, +{"id":4,"expanded":true,"name":"House","order":2,"parentId":5,"scrollX":832,"scrollY":640}, +{"id":5,"expanded":true,"name":"Intro","order":1,"parentId":0,"scrollX":1139,"scrollY":641} ] \ No newline at end of file diff --git a/data/Notes.json b/data/Notes.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/data/Notes.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/data/System.json b/data/System.json index b0d08cf..2eb41f9 100644 --- a/data/System.json +++ b/data/System.json @@ -1 +1 @@ -{"airship":{"bgm":{"name":"Ship3","pan":0,"pitch":100,"volume":90},"characterIndex":3,"characterName":"Vehicle","startMapId":0,"startX":0,"startY":0},"armorTypes":["","General Armor","Magic Armor","Light Armor","Heavy Armor","Small Shield","Large Shield"],"attackMotions":[{"type":0,"weaponImageId":0},{"type":1,"weaponImageId":1},{"type":1,"weaponImageId":2},{"type":1,"weaponImageId":3},{"type":1,"weaponImageId":4},{"type":1,"weaponImageId":5},{"type":1,"weaponImageId":6},{"type":2,"weaponImageId":7},{"type":2,"weaponImageId":8},{"type":2,"weaponImageId":9},{"type":0,"weaponImageId":10},{"type":0,"weaponImageId":11},{"type":0,"weaponImageId":12}],"battleBgm":{"name":"Battle1","pan":0,"pitch":100,"volume":90},"battleback1Name":"Grassland","battleback2Name":"Grassland","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":"G","defeatMe":{"name":"Defeat1","pan":0,"pitch":100,"volume":90},"editMapId":4,"elements":["","Physical","Fire","Ice","Thunder","Water","Earth","Wind","Light","Darkness"],"equipTypes":["","Weapon","Shield","Head","Body","Accessory"],"gameTitle":"Superproject1","gameoverMe":{"name":"Gameover1","pan":0,"pitch":100,"volume":90},"locale":"en_US","magicSkills":[1],"menuCommands":[true,true,true,true,true,true],"optDisplayTp":true,"optDrawTitle":true,"optExtraExp":false,"optFloorDeath":false,"optFollowers":true,"optSideView":true,"optSlipDeath":false,"optTransparent":false,"partyMembers":[1],"ship":{"bgm":{"name":"Ship2","pan":0,"pitch":100,"volume":90},"characterIndex":1,"characterName":"Vehicle","startMapId":0,"startX":0,"startY":0},"skillTypes":["","Magic","Special"],"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":4,"startX":4,"startY":9,"switches":["","","","","","","","","","","","","","","","","","","","",""],"terms":{"basic":["Level","Lv","HP","HP","MP","MP","TP","TP","EXP","EXP"],"commands":["Fight","Escape","Attack","Guard","Item","Skill","Equip","Status","Formation","Save","Game End","Options","Weapon","Armor","Key Item","Equip","Optimize","Clear","New Game","Continue",null,"To Title","Cancel",null,"Buy","Sell"],"params":["Max HP","Max MP","Attack","Defense","M.Attack","M.Defense","Agility","Luck","Hit","Evasion"],"messages":{"actionFailure":"There was no effect on %1!","actorDamage":"%1 took %2 damage!","actorDrain":"%1 was drained of %2 %3!","actorGain":"%1 gained %2 %3!","actorLoss":"%1 lost %2 %3!","actorNoDamage":"%1 took no damage!","actorNoHit":"Miss! %1 took no damage!","actorRecovery":"%1 recovered %2 %3!","alwaysDash":"Always Dash","bgmVolume":"BGM Volume","bgsVolume":"BGS Volume","buffAdd":"%1's %2 went up!","buffRemove":"%1's %2 returned to normal!","commandRemember":"Command Remember","counterAttack":"%1 counterattacked!","criticalToActor":"A painful blow!!","criticalToEnemy":"An excellent hit!!","debuffAdd":"%1's %2 went down!","defeat":"%1 was defeated.","emerge":"%1 emerged!","enemyDamage":"%1 took %2 damage!","enemyDrain":"%1 was drained of %2 %3!","enemyGain":"%1 gained %2 %3!","enemyLoss":"%1 lost %2 %3!","enemyNoDamage":"%1 took no damage!","enemyNoHit":"Miss! %1 took no damage!","enemyRecovery":"%1 recovered %2 %3!","escapeFailure":"However, it was unable to escape!","escapeStart":"%1 has started to escape!","evasion":"%1 evaded the attack!","expNext":"To Next %1","expTotal":"Current %1","file":"File","levelUp":"%1 is now %2 %3!","loadMessage":"Load which file?","magicEvasion":"%1 nullified the magic!","magicReflection":"%1 reflected the magic!","meVolume":"ME Volume","obtainExp":"%1 %2 received!","obtainGold":"%1\\G found!","obtainItem":"%1 found!","obtainSkill":"%1 learned!","partyName":"%1's Party","possession":"Possession","preemptive":"%1 got the upper hand!","saveMessage":"Save to which file?","seVolume":"SE Volume","substitute":"%1 protected %2!","surprise":"%1 was surprised!","useItem":"%1 uses %2!","victory":"%1 was victorious!"}},"testBattlers":[{"actorId":1,"equips":[1,1,2,3,0],"level":1},{"actorId":2,"equips":[2,1,2,3,0],"level":1},{"actorId":3,"equips":[3,0,2,3,4],"level":1},{"actorId":4,"equips":[4,0,2,3,4],"level":1}],"testTroopId":4,"title1Name":"Gates","title2Name":"","titleBgm":{"name":"Theme6","pan":0,"pitch":100,"volume":90},"variables":["","","","","","","","","","","","","","","","","","","","",""],"versionId":74349192,"victoryMe":{"name":"Victory1","pan":0,"pitch":100,"volume":90},"weaponTypes":["","Dagger","Sword","Flail","Axe","Whip","Cane","Bow","Crossbow","Gun","Claw","Glove","Spear"],"windowTone":[-255,-102,187,0]} \ No newline at end of file +{"airship":{"bgm":{"name":"Ship3","pan":0,"pitch":100,"volume":90},"characterIndex":3,"characterName":"Vehicle","startMapId":0,"startX":0,"startY":0},"armorTypes":["","General Armor","Magic Armor","Light Armor","Heavy Armor","Small Shield","Large Shield"],"attackMotions":[{"type":0,"weaponImageId":0},{"type":1,"weaponImageId":1},{"type":1,"weaponImageId":2},{"type":1,"weaponImageId":3},{"type":1,"weaponImageId":4},{"type":1,"weaponImageId":5},{"type":1,"weaponImageId":6},{"type":2,"weaponImageId":7},{"type":2,"weaponImageId":8},{"type":2,"weaponImageId":9},{"type":0,"weaponImageId":10},{"type":0,"weaponImageId":11},{"type":0,"weaponImageId":12}],"battleBgm":{"name":"Battle1","pan":0,"pitch":100,"volume":90},"battleback1Name":"Grassland","battleback2Name":"Grassland","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":"G","defeatMe":{"name":"Defeat1","pan":0,"pitch":100,"volume":90},"editMapId":4,"elements":["","Physical","Fire","Ice","Thunder","Water","Earth","Wind","Light","Darkness"],"equipTypes":["","Weapon","Shield","Head","Body","Accessory"],"gameTitle":"Superproject1","gameoverMe":{"name":"Gameover1","pan":0,"pitch":100,"volume":90},"locale":"en_US","magicSkills":[1],"menuCommands":[true,true,true,true,true,true],"optDisplayTp":true,"optDrawTitle":true,"optExtraExp":false,"optFloorDeath":false,"optFollowers":true,"optSideView":true,"optSlipDeath":false,"optTransparent":false,"partyMembers":[1],"ship":{"bgm":{"name":"Ship2","pan":0,"pitch":100,"volume":90},"characterIndex":1,"characterName":"Vehicle","startMapId":0,"startX":0,"startY":0},"skillTypes":["","Magic","Special"],"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":5,"startX":1,"startY":0,"switches":["","","","","","","","","","","","","","","","","","","","",""],"terms":{"basic":["Level","Lv","HP","HP","MP","MP","TP","TP","EXP","EXP"],"commands":["Fight","Escape","Attack","Guard","Item","Skill","Equip","Status","Formation","Save","Game End","Options","Weapon","Armor","Key Item","Equip","Optimize","Clear","New Game","Continue",null,"To Title","Cancel",null,"Buy","Sell"],"params":["Max HP","Max MP","Attack","Defense","M.Attack","M.Defense","Agility","Luck","Hit","Evasion"],"messages":{"actionFailure":"There was no effect on %1!","actorDamage":"%1 took %2 damage!","actorDrain":"%1 was drained of %2 %3!","actorGain":"%1 gained %2 %3!","actorLoss":"%1 lost %2 %3!","actorNoDamage":"%1 took no damage!","actorNoHit":"Miss! %1 took no damage!","actorRecovery":"%1 recovered %2 %3!","alwaysDash":"Always Dash","bgmVolume":"BGM Volume","bgsVolume":"BGS Volume","buffAdd":"%1's %2 went up!","buffRemove":"%1's %2 returned to normal!","commandRemember":"Command Remember","counterAttack":"%1 counterattacked!","criticalToActor":"A painful blow!!","criticalToEnemy":"An excellent hit!!","debuffAdd":"%1's %2 went down!","defeat":"%1 was defeated.","emerge":"%1 emerged!","enemyDamage":"%1 took %2 damage!","enemyDrain":"%1 was drained of %2 %3!","enemyGain":"%1 gained %2 %3!","enemyLoss":"%1 lost %2 %3!","enemyNoDamage":"%1 took no damage!","enemyNoHit":"Miss! %1 took no damage!","enemyRecovery":"%1 recovered %2 %3!","escapeFailure":"However, it was unable to escape!","escapeStart":"%1 has started to escape!","evasion":"%1 evaded the attack!","expNext":"To Next %1","expTotal":"Current %1","file":"File","levelUp":"%1 is now %2 %3!","loadMessage":"Load which file?","magicEvasion":"%1 nullified the magic!","magicReflection":"%1 reflected the magic!","meVolume":"ME Volume","obtainExp":"%1 %2 received!","obtainGold":"%1\\G found!","obtainItem":"%1 found!","obtainSkill":"%1 learned!","partyName":"%1's Party","possession":"Possession","preemptive":"%1 got the upper hand!","saveMessage":"Save to which file?","seVolume":"SE Volume","substitute":"%1 protected %2!","surprise":"%1 was surprised!","useItem":"%1 uses %2!","victory":"%1 was victorious!"}},"testBattlers":[{"actorId":1,"equips":[1,1,2,3,0],"level":1},{"actorId":2,"equips":[2,1,2,3,0],"level":1},{"actorId":3,"equips":[3,0,2,3,4],"level":1},{"actorId":4,"equips":[4,0,2,3,4],"level":1}],"testTroopId":4,"title1Name":"Gates","title2Name":"","titleBgm":{"name":"Theme6","pan":0,"pitch":100,"volume":90},"variables":["","","","","","","","","","","","","","","","","","","","",""],"versionId":54264961,"victoryMe":{"name":"Victory1","pan":0,"pitch":100,"volume":90},"weaponTypes":["","Dagger","Sword","Flail","Axe","Whip","Cane","Bow","Crossbow","Gun","Claw","Glove","Spear"],"windowTone":[-255,-102,187,0]} \ No newline at end of file diff --git a/data/Windows.json b/data/Windows.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/data/Windows.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/js/plugins.js b/js/plugins.js index f99bf9b..5c6f11b 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -12,12 +12,14 @@ var $plugins = {"name":"SimpleMsgSideView","status":true,"description":"at sideview battle, only display item/skill names.","parameters":{"displayAttack":"0","position":"1"}}, {"name":"TitleCommandPosition","status":true,"description":"Changes the position of the title command window.","parameters":{"Offset X":"0","Offset Y":"0","Width":"240","Background":"0"}}, {"name":"WeaponSkill","status":true,"description":"Change skill id of attack for each weapon.","parameters":{}}, -{"name":"SRD_BattlePopupCustomizer","status":true,"description":"Adds more options to the Battle Popups; customization over the attributes of the popups and the ability to add more.","parameters":{"== Global Options ==":"","Font":"GameFont","Font Size":"34","X Shift":"0","Y Shift":"34","Global Condition":"target.isAppeared()","== HP Damage ==":"","HP Damage Condition":"result.hpDamage > 0","HP Damage Text":"-%1 HP","HP Damage Location":"0, 0","HP Damage Colors":"#FF4D4D | #000000","HP Damage Animations":"default","HP Damage Duration":"120","HP Damage Flash":"0, 0, 0, 0, 0","== HP Heal ==":"","HP Heal Condition":"result.hpDamage < 0","HP Heal Text":"+%1 HP","HP Heal Location":"0, 0","HP Heal Colors":"#8CFF66 | #000000","HP Heal Animations":"default","HP Heal Duration":"120","HP Heal Flash":"0, 0, 0, 0, 0","== MP Damage ==":"","MP Damage Condition":"result.mpDamage > 0","MP Damage Text":"-%1 MP","MP Damage Location":"0, 0","MP Damage Colors":"#66B3FF | #000000","MP Damage Animations":"default","MP Damage Duration":"120","MP Damage Flash":"0, 0, 0, 0, 0","== MP Heal ==":"","MP Heal Condition":"result.mpDamage < 0","MP Heal Text":"+%1 MP","MP Heal Location":"0, 0","MP Heal Colors":"#FFFF99 | #000000","MP Heal Animations":"default","MP Heal Duration":"120","MP Heal Flash":"0, 0, 0, 0, 0","== TP Damage ==":"","TP Damage Condition":"result.tpDamage > 0","TP Damage Text":"-%1 TP","TP Damage Location":"0, 0","TP Damage Colors":"#FFB3FF | #000000","TP Damage Animations":"default","TP Damage Duration":"120","TP Damage Flash":"0, 0, 0, 0, 0","== TP Heal ==":"","TP Heal Condition":"result.tpDamage < 0","TP Heal Text":"+%1 TP","TP Heal Location":"0, 0","TP Heal Colors":"#99FF66 | #000000","TP Heal Animations":"default","TP Heal Duration":"120","TP Heal Flash":"0, 0, 0, 0, 0","== Miss ==":"","Miss Condition":"result.used && result.missed","Miss Text":"MISS","Miss Location":"24, this._sprite.height * (-1/3)","Miss Colors":"#FFFFFF | #000000","Miss Animations":"float","Miss Duration":"45","Miss Flash":"0, 0, 0, 0, 0","== Evade ==":"","Evade Condition":"result.evaded","Evade Text":"EVADE","Evade Location":"24, this._sprite.height * (-1/3)","Evade Colors":"#FFFFFF | #000000","Evade Animations":"float","Evade Duration":"45","Evade Flash":"0, 0, 0, 0, 0","== Critical ==":"","Critical Condition":"result.critical && result.used && !result.missed","Critical Text":"CRITICAL","Critical Location":"24, this._sprite.height * (-1/3)","Critical Colors":"#FFFFFF | #000000","Critical Animations":"float","Critical Duration":"60","Critical Flash":"255, 0, 0, 160, 60","== Guarded ==":"","Guarded Condition":"result.guarded && result.used && !result.missed","Guarded Text":"GUARDED","Guarded Location":"24, this._sprite.height * (-1/3)","Guarded Colors":"#FFFFFF | #000000","Guarded Animations":"float","Guarded Duration":"60","Guarded Flash":"0, 130, 130, 160, 60","== Custom 1 ==":"","Custom 1 Condition":"result.drain && result.used && !result.missed","Custom 1 Text":"DRAINED","Custom 1 Location":"24, this._sprite.height * (-1/3)","Custom 1 Colors":"#FFFFFF | #000000","Custom 1 Animations":"float","Custom 1 Duration":"60","Custom 1 Flash":"204, 153, 255, 160, 60","== Custom 2 ==":"","Custom 2 Condition":"false","Custom 2 Text":"","Custom 2 Location":"24, -48","Custom 2 Colors":"#FFFFFF | #000000","Custom 2 Animations":"float","Custom 2 Duration":"60","Custom 2 Flash":"0, 0, 0, 0, 0","== Custom 3 ==":"","Custom 3 Condition":"false","Custom 3 Text":"","Custom 3 Location":"24, -48","Custom 3 Colors":"#FFFFFF | #000000","Custom 3 Animations":"float","Custom 3 Duration":"60","Custom 3 Flash":"0, 0, 0, 0, 0","== Custom 4 ==":"","Custom 4 Condition":"false","Custom 4 Text":"","Custom 4 Location":"24, -48","Custom 4 Colors":"#FFFFFF | #000000","Custom 4 Animations":"float","Custom 4 Duration":"60","Custom 4 Flash":"0, 0, 0, 0, 0","== Custom 5 ==":"","Custom 5 Condition":"false","Custom 5 Text":"","Custom 5 Location":"24, -48","Custom 5 Colors":"#FFFFFF | #000000","Custom 5 Animations":"float","Custom 5 Duration":"60","Custom 5 Flash":"0, 0, 0, 0, 0","== Custom 6 ==":"","Custom 6 Condition":"false","Custom 6 Text":"","Custom 6 Location":"24, -48","Custom 6 Colors":"#FFFFFF | #000000","Custom 6 Animations":"float","Custom 6 Duration":"60","Custom 6 Flash":"0, 0, 0, 0, 0","== Custom 7 ==":"","Custom 7 Condition":"false","Custom 7 Text":"","Custom 7 Location":"24, -48","Custom 7 Colors":"#FFFFFF | #000000","Custom 7 Animations":"float","Custom 7 Duration":"60","Custom 7 Flash":"0, 0, 0, 0, 0","== Custom 8 ==":"","Custom 8 Condition":"false","Custom 8 Text":"","Custom 8 Location":"24, -48","Custom 8 Colors":"#FFFFFF | #000000","Custom 8 Animations":"float","Custom 8 Duration":"60","Custom 8 Flash":"0, 0, 0, 0, 0","== Custom 9 ==":"","Custom 9 Condition":"false","Custom 9 Text":"","Custom 9 Location":"24, -48","Custom 9 Colors":"#FFFFFF | #000000","Custom 9 Animations":"float","Custom 9 Duration":"60","Custom 9 Flash":"0, 0, 0, 0, 0","== Custom 10 ==":"","Custom 10 Condition":"false","Custom 10 Text":"","Custom 10 Location":"24, -48","Custom 10 Colors":"#FFFFFF | #000000","Custom 10 Animations":"float","Custom 10 Duration":"60","Custom 10 Flash":"0, 0, 0, 0, 0","== Custom 11 ==":"","Custom 11 Condition":"false","Custom 11 Text":"","Custom 11 Location":"24, -48","Custom 11 Colors":"#FFFFFF | #000000","Custom 11 Animations":"float","Custom 11 Duration":"60","Custom 11 Flash":"0, 0, 0, 0, 0","== Custom 12 ==":"","Custom 12 Condition":"false","Custom 12 Text":"","Custom 12 Location":"24, -48","Custom 12 Colors":"#FFFFFF | #000000","Custom 12 Animations":"float","Custom 12 Duration":"60","Custom 12 Flash":"0, 0, 0, 0, 0","== Custom 13 ==":"","Custom 13 Condition":"false","Custom 13 Text":"","Custom 13 Location":"24, -48","Custom 13 Colors":"#FFFFFF | #000000","Custom 13 Animations":"float","Custom 13 Duration":"60","Custom 13 Flash":"0, 0, 0, 0, 0","== Custom 14 ==":"","Custom 14 Condition":"false","Custom 14 Text":"","Custom 14 Location":"24, -48","Custom 14 Colors":"#FFFFFF | #000000","Custom 14 Animations":"float","Custom 14 Duration":"60","Custom 14 Flash":"0, 0, 0, 0, 0","== Custom 15 ==":"","Custom 15 Condition":"false","Custom 15 Text":"","Custom 15 Location":"24, -48","Custom 15 Colors":"#FFFFFF | #000000","Custom 15 Animations":"float","Custom 15 Duration":"60","Custom 15 Flash":"0, 0, 0, 0, 0","== Custom 16 ==":"","Custom 16 Condition":"false","Custom 16 Text":"","Custom 16 Location":"24, -48","Custom 16 Colors":"#FFFFFF | #000000","Custom 16 Animations":"float","Custom 16 Duration":"60","Custom 16 Flash":"0, 0, 0, 0, 0","== Custom 17 ==":"","Custom 17 Condition":"false","Custom 17 Text":"","Custom 17 Location":"24, -48","Custom 17 Colors":"#FFFFFF | #000000","Custom 17 Animations":"float","Custom 17 Duration":"60","Custom 17 Flash":"0, 0, 0, 0, 0","== Custom 18 ==":"","Custom 18 Condition":"false","Custom 18 Text":"","Custom 18 Location":"24, -48","Custom 18 Colors":"#FFFFFF | #000000","Custom 18 Animations":"float","Custom 18 Duration":"60","Custom 18 Flash":"0, 0, 0, 0, 0","== Custom 19 ==":"","Custom 19 Condition":"false","Custom 19 Text":"","Custom 19 Location":"24, -48","Custom 19 Colors":"#FFFFFF | #000000","Custom 19 Animations":"float","Custom 19 Duration":"60","Custom 19 Flash":"0, 0, 0, 0, 0","== Custom 20 ==":"","Custom 20 Condition":"false","Custom 20 Text":"","Custom 20 Location":"24, -48","Custom 20 Colors":"#FFFFFF | #000000","Custom 20 Animations":"float","Custom 20 Duration":"60","Custom 20 Flash":"0, 0, 0, 0, 0","== Custom 21 ==":"","Custom 21 Condition":"false","Custom 21 Text":"","Custom 21 Location":"24, -48","Custom 21 Colors":"#FFFFFF | #000000","Custom 21 Animations":"float","Custom 21 Duration":"60","Custom 21 Flash":"0, 0, 0, 0, 0","== Custom 22 ==":"","Custom 22 Condition":"false","Custom 22 Text":"","Custom 22 Location":"24, -48","Custom 22 Colors":"#FFFFFF | #000000","Custom 22 Animations":"float","Custom 22 Duration":"60","Custom 22 Flash":"0, 0, 0, 0, 0","== Custom 23 ==":"","Custom 23 Condition":"false","Custom 23 Text":"","Custom 23 Location":"24, -48","Custom 23 Colors":"#FFFFFF | #000000","Custom 23 Animations":"float","Custom 23 Duration":"60","Custom 23 Flash":"0, 0, 0, 0, 0","== Custom 24 ==":"","Custom 24 Condition":"false","Custom 24 Text":"","Custom 24 Location":"24, -48","Custom 24 Colors":"#FFFFFF | #000000","Custom 24 Animations":"float","Custom 24 Duration":"60","Custom 24 Flash":"0, 0, 0, 0, 0","== Custom 25 ==":"","Custom 25 Condition":"false","Custom 25 Text":"","Custom 25 Location":"24, -48","Custom 25 Colors":"#FFFFFF | #000000","Custom 25 Animations":"float","Custom 25 Duration":"60","Custom 25 Flash":"0, 0, 0, 0, 0","== Custom 26 ==":"","Custom 26 Condition":"false","Custom 26 Text":"","Custom 26 Location":"24, -48","Custom 26 Colors":"#FFFFFF | #000000","Custom 26 Animations":"float","Custom 26 Duration":"60","Custom 26 Flash":"0, 0, 0, 0, 0","== Custom 27 ==":"","Custom 27 Condition":"false","Custom 27 Text":"","Custom 27 Location":"24, -48","Custom 27 Colors":"#FFFFFF | #000000","Custom 27 Animations":"float","Custom 27 Duration":"60","Custom 27 Flash":"0, 0, 0, 0, 0","== Custom 28 ==":"","Custom 28 Condition":"false","Custom 28 Text":"","Custom 28 Location":"24, -48","Custom 28 Colors":"#FFFFFF | #000000","Custom 28 Animations":"float","Custom 28 Duration":"60","Custom 28 Flash":"0, 0, 0, 0, 0","== Custom 29 ==":"","Custom 29 Condition":"false","Custom 29 Text":"","Custom 29 Location":"24, -48","Custom 29 Colors":"#FFFFFF | #000000","Custom 29 Animations":"float","Custom 29 Duration":"60","Custom 29 Flash":"0, 0, 0, 0, 0","== Custom 30 ==":"","Custom 30 Condition":"false","Custom 30 Text":"","Custom 30 Location":"24, -48","Custom 30 Colors":"#FFFFFF | #000000","Custom 30 Animations":"float","Custom 30 Duration":"60","Custom 30 Flash":"0, 0, 0, 0, 0","== Custom 31 ==":"","Custom 31 Condition":"false","Custom 31 Text":"","Custom 31 Location":"24, -48","Custom 31 Colors":"#FFFFFF | #000000","Custom 31 Animations":"float","Custom 31 Duration":"60","Custom 31 Flash":"0, 0, 0, 0, 0","== Custom 32 ==":"","Custom 32 Condition":"false","Custom 32 Text":"","Custom 32 Location":"24, -48","Custom 32 Colors":"#FFFFFF | #000000","Custom 32 Animations":"float","Custom 32 Duration":"60","Custom 32 Flash":"0, 0, 0, 0, 0","== Custom 33 ==":"","Custom 33 Condition":"false","Custom 33 Text":"","Custom 33 Location":"24, -48","Custom 33 Colors":"#FFFFFF | #000000","Custom 33 Animations":"float","Custom 33 Duration":"60","Custom 33 Flash":"0, 0, 0, 0, 0","== Custom 34 ==":"","Custom 34 Condition":"false","Custom 34 Text":"","Custom 34 Location":"24, -48","Custom 34 Colors":"#FFFFFF | #000000","Custom 34 Animations":"float","Custom 34 Duration":"60","Custom 34 Flash":"0, 0, 0, 0, 0","== Custom 35 ==":"","Custom 35 Condition":"false","Custom 35 Text":"","Custom 35 Location":"24, -48","Custom 35 Colors":"#FFFFFF | #000000","Custom 35 Animations":"float","Custom 35 Duration":"60","Custom 35 Flash":"0, 0, 0, 0, 0","== Custom 36 ==":"","Custom 36 Condition":"false","Custom 36 Text":"","Custom 36 Location":"24, -48","Custom 36 Colors":"#FFFFFF | #000000","Custom 36 Animations":"float","Custom 36 Duration":"60","Custom 36 Flash":"0, 0, 0, 0, 0","== Custom 37 ==":"","Custom 37 Condition":"false","Custom 37 Text":"","Custom 37 Location":"24, -48","Custom 37 Colors":"#FFFFFF | #000000","Custom 37 Animations":"float","Custom 37 Duration":"60","Custom 37 Flash":"0, 0, 0, 0, 0","== Custom 38 ==":"","Custom 38 Condition":"false","Custom 38 Text":"","Custom 38 Location":"24, -48","Custom 38 Colors":"#FFFFFF | #000000","Custom 38 Animations":"float","Custom 38 Duration":"60","Custom 38 Flash":"0, 0, 0, 0, 0","== Custom 39 ==":"","Custom 39 Condition":"false","Custom 39 Text":"","Custom 39 Location":"24, -48","Custom 39 Colors":"#FFFFFF | #000000","Custom 39 Animations":"float","Custom 39 Duration":"60","Custom 39 Flash":"0, 0, 0, 0, 0","== Custom 40 ==":"","Custom 40 Condition":"false","Custom 40 Text":"","Custom 40 Location":"24, -48","Custom 40 Colors":"#FFFFFF | #000000","Custom 40 Animations":"float","Custom 40 Duration":"60","Custom 40 Flash":"0, 0, 0, 0, 0","== Custom 41 ==":"","Custom 41 Condition":"false","Custom 41 Text":"","Custom 41 Location":"24, -48","Custom 41 Colors":"#FFFFFF | #000000","Custom 41 Animations":"float","Custom 41 Duration":"60","Custom 41 Flash":"0, 0, 0, 0, 0","== Custom 42 ==":"","Custom 42 Condition":"false","Custom 42 Text":"","Custom 42 Location":"24, -48","Custom 42 Colors":"#FFFFFF | #000000","Custom 42 Animations":"float","Custom 42 Duration":"60","Custom 42 Flash":"0, 0, 0, 0, 0","== Custom 43 ==":"","Custom 43 Condition":"false","Custom 43 Text":"","Custom 43 Location":"24, -48","Custom 43 Colors":"#FFFFFF | #000000","Custom 43 Animations":"float","Custom 43 Duration":"60","Custom 43 Flash":"0, 0, 0, 0, 0","== Custom 44 ==":"","Custom 44 Condition":"false","Custom 44 Text":"","Custom 44 Location":"24, -48","Custom 44 Colors":"#FFFFFF | #000000","Custom 44 Animations":"float","Custom 44 Duration":"60","Custom 44 Flash":"0, 0, 0, 0, 0","== Custom 45 ==":"","Custom 45 Condition":"false","Custom 45 Text":"","Custom 45 Location":"24, -48","Custom 45 Colors":"#FFFFFF | #000000","Custom 45 Animations":"float","Custom 45 Duration":"60","Custom 45 Flash":"0, 0, 0, 0, 0","== Custom 46 ==":"","Custom 46 Condition":"false","Custom 46 Text":"","Custom 46 Location":"24, -48","Custom 46 Colors":"#FFFFFF | #000000","Custom 46 Animations":"float","Custom 46 Duration":"60","Custom 46 Flash":"0, 0, 0, 0, 0","== Custom 47 ==":"","Custom 47 Condition":"false","Custom 47 Text":"","Custom 47 Location":"24, -48","Custom 47 Colors":"#FFFFFF | #000000","Custom 47 Animations":"float","Custom 47 Duration":"60","Custom 47 Flash":"0, 0, 0, 0, 0","== Custom 48 ==":"","Custom 48 Condition":"false","Custom 48 Text":"","Custom 48 Location":"24, -48","Custom 48 Colors":"#FFFFFF | #000000","Custom 48 Animations":"float","Custom 48 Duration":"60","Custom 48 Flash":"0, 0, 0, 0, 0","== Custom 49 ==":"","Custom 49 Condition":"false","Custom 49 Text":"","Custom 49 Location":"24, -48","Custom 49 Colors":"#FFFFFF | #000000","Custom 49 Animations":"float","Custom 49 Duration":"60","Custom 49 Flash":"0, 0, 0, 0, 0","== Custom 50 ==":"","Custom 50 Condition":"false","Custom 50 Text":"","Custom 50 Location":"24, -48","Custom 50 Colors":"#FFFFFF | #000000","Custom 50 Animations":"float","Custom 50 Duration":"60","Custom 50 Flash":"0, 0, 0, 0, 0"}}, -{"name":"SRD_EnemyBulkDrops","status":true,"description":"Adds more Notetag options for YEP_ExtraEnemyDrops for bulk processing","parameters":{}}, +{"name":"--------------------","status":true,"description":"------------------------------------------------------------","parameters":{}}, +{"name":"SRD_BattlePopupCustomizer","status":false,"description":"Adds more options to the Battle Popups; customization over the attributes of the popups and the ability to add more.","parameters":{"== Global Options ==":"","Font":"GameFont","Font Size":"34","X Shift":"0","Y Shift":"34","Global Condition":"target.isAppeared()","== HP Damage ==":"","HP Damage Condition":"result.hpDamage > 0","HP Damage Text":"-%1 HP","HP Damage Location":"0, 0","HP Damage Colors":"#FF4D4D | #000000","HP Damage Animations":"default","HP Damage Duration":"120","HP Damage Flash":"0, 0, 0, 0, 0","== HP Heal ==":"","HP Heal Condition":"result.hpDamage < 0","HP Heal Text":"+%1 HP","HP Heal Location":"0, 0","HP Heal Colors":"#8CFF66 | #000000","HP Heal Animations":"default","HP Heal Duration":"120","HP Heal Flash":"0, 0, 0, 0, 0","== MP Damage ==":"","MP Damage Condition":"result.mpDamage > 0","MP Damage Text":"-%1 MP","MP Damage Location":"0, 0","MP Damage Colors":"#66B3FF | #000000","MP Damage Animations":"default","MP Damage Duration":"120","MP Damage Flash":"0, 0, 0, 0, 0","== MP Heal ==":"","MP Heal Condition":"result.mpDamage < 0","MP Heal Text":"+%1 MP","MP Heal Location":"0, 0","MP Heal Colors":"#FFFF99 | #000000","MP Heal Animations":"default","MP Heal Duration":"120","MP Heal Flash":"0, 0, 0, 0, 0","== TP Damage ==":"","TP Damage Condition":"result.tpDamage > 0","TP Damage Text":"-%1 TP","TP Damage Location":"0, 0","TP Damage Colors":"#FFB3FF | #000000","TP Damage Animations":"default","TP Damage Duration":"120","TP Damage Flash":"0, 0, 0, 0, 0","== TP Heal ==":"","TP Heal Condition":"result.tpDamage < 0","TP Heal Text":"+%1 TP","TP Heal Location":"0, 0","TP Heal Colors":"#99FF66 | #000000","TP Heal Animations":"default","TP Heal Duration":"120","TP Heal Flash":"0, 0, 0, 0, 0","== Miss ==":"","Miss Condition":"result.used && result.missed","Miss Text":"MISS","Miss Location":"24, this._sprite.height * (-1/3)","Miss Colors":"#FFFFFF | #000000","Miss Animations":"float","Miss Duration":"45","Miss Flash":"0, 0, 0, 0, 0","== Evade ==":"","Evade Condition":"result.evaded","Evade Text":"EVADE","Evade Location":"24, this._sprite.height * (-1/3)","Evade Colors":"#FFFFFF | #000000","Evade Animations":"float","Evade Duration":"45","Evade Flash":"0, 0, 0, 0, 0","== Critical ==":"","Critical Condition":"result.critical && result.used && !result.missed","Critical Text":"CRITICAL","Critical Location":"24, this._sprite.height * (-1/3)","Critical Colors":"#FFFFFF | #000000","Critical Animations":"float","Critical Duration":"60","Critical Flash":"255, 0, 0, 160, 60","== Guarded ==":"","Guarded Condition":"result.guarded && result.used && !result.missed","Guarded Text":"GUARDED","Guarded Location":"24, this._sprite.height * (-1/3)","Guarded Colors":"#FFFFFF | #000000","Guarded Animations":"float","Guarded Duration":"60","Guarded Flash":"0, 130, 130, 160, 60","== Custom 1 ==":"","Custom 1 Condition":"result.drain && result.used && !result.missed","Custom 1 Text":"DRAINED","Custom 1 Location":"24, this._sprite.height * (-1/3)","Custom 1 Colors":"#FFFFFF | #000000","Custom 1 Animations":"float","Custom 1 Duration":"60","Custom 1 Flash":"204, 153, 255, 160, 60","== Custom 2 ==":"","Custom 2 Condition":"false","Custom 2 Text":"","Custom 2 Location":"24, -48","Custom 2 Colors":"#FFFFFF | #000000","Custom 2 Animations":"float","Custom 2 Duration":"60","Custom 2 Flash":"0, 0, 0, 0, 0","== Custom 3 ==":"","Custom 3 Condition":"false","Custom 3 Text":"","Custom 3 Location":"24, -48","Custom 3 Colors":"#FFFFFF | #000000","Custom 3 Animations":"float","Custom 3 Duration":"60","Custom 3 Flash":"0, 0, 0, 0, 0","== Custom 4 ==":"","Custom 4 Condition":"false","Custom 4 Text":"","Custom 4 Location":"24, -48","Custom 4 Colors":"#FFFFFF | #000000","Custom 4 Animations":"float","Custom 4 Duration":"60","Custom 4 Flash":"0, 0, 0, 0, 0","== Custom 5 ==":"","Custom 5 Condition":"false","Custom 5 Text":"","Custom 5 Location":"24, -48","Custom 5 Colors":"#FFFFFF | #000000","Custom 5 Animations":"float","Custom 5 Duration":"60","Custom 5 Flash":"0, 0, 0, 0, 0","== Custom 6 ==":"","Custom 6 Condition":"false","Custom 6 Text":"","Custom 6 Location":"24, -48","Custom 6 Colors":"#FFFFFF | #000000","Custom 6 Animations":"float","Custom 6 Duration":"60","Custom 6 Flash":"0, 0, 0, 0, 0","== Custom 7 ==":"","Custom 7 Condition":"false","Custom 7 Text":"","Custom 7 Location":"24, -48","Custom 7 Colors":"#FFFFFF | #000000","Custom 7 Animations":"float","Custom 7 Duration":"60","Custom 7 Flash":"0, 0, 0, 0, 0","== Custom 8 ==":"","Custom 8 Condition":"false","Custom 8 Text":"","Custom 8 Location":"24, -48","Custom 8 Colors":"#FFFFFF | #000000","Custom 8 Animations":"float","Custom 8 Duration":"60","Custom 8 Flash":"0, 0, 0, 0, 0","== Custom 9 ==":"","Custom 9 Condition":"false","Custom 9 Text":"","Custom 9 Location":"24, -48","Custom 9 Colors":"#FFFFFF | #000000","Custom 9 Animations":"float","Custom 9 Duration":"60","Custom 9 Flash":"0, 0, 0, 0, 0","== Custom 10 ==":"","Custom 10 Condition":"false","Custom 10 Text":"","Custom 10 Location":"24, -48","Custom 10 Colors":"#FFFFFF | #000000","Custom 10 Animations":"float","Custom 10 Duration":"60","Custom 10 Flash":"0, 0, 0, 0, 0","== Custom 11 ==":"","Custom 11 Condition":"false","Custom 11 Text":"","Custom 11 Location":"24, -48","Custom 11 Colors":"#FFFFFF | #000000","Custom 11 Animations":"float","Custom 11 Duration":"60","Custom 11 Flash":"0, 0, 0, 0, 0","== Custom 12 ==":"","Custom 12 Condition":"false","Custom 12 Text":"","Custom 12 Location":"24, -48","Custom 12 Colors":"#FFFFFF | #000000","Custom 12 Animations":"float","Custom 12 Duration":"60","Custom 12 Flash":"0, 0, 0, 0, 0","== Custom 13 ==":"","Custom 13 Condition":"false","Custom 13 Text":"","Custom 13 Location":"24, -48","Custom 13 Colors":"#FFFFFF | #000000","Custom 13 Animations":"float","Custom 13 Duration":"60","Custom 13 Flash":"0, 0, 0, 0, 0","== Custom 14 ==":"","Custom 14 Condition":"false","Custom 14 Text":"","Custom 14 Location":"24, -48","Custom 14 Colors":"#FFFFFF | #000000","Custom 14 Animations":"float","Custom 14 Duration":"60","Custom 14 Flash":"0, 0, 0, 0, 0","== Custom 15 ==":"","Custom 15 Condition":"false","Custom 15 Text":"","Custom 15 Location":"24, -48","Custom 15 Colors":"#FFFFFF | #000000","Custom 15 Animations":"float","Custom 15 Duration":"60","Custom 15 Flash":"0, 0, 0, 0, 0","== Custom 16 ==":"","Custom 16 Condition":"false","Custom 16 Text":"","Custom 16 Location":"24, -48","Custom 16 Colors":"#FFFFFF | #000000","Custom 16 Animations":"float","Custom 16 Duration":"60","Custom 16 Flash":"0, 0, 0, 0, 0","== Custom 17 ==":"","Custom 17 Condition":"false","Custom 17 Text":"","Custom 17 Location":"24, -48","Custom 17 Colors":"#FFFFFF | #000000","Custom 17 Animations":"float","Custom 17 Duration":"60","Custom 17 Flash":"0, 0, 0, 0, 0","== Custom 18 ==":"","Custom 18 Condition":"false","Custom 18 Text":"","Custom 18 Location":"24, -48","Custom 18 Colors":"#FFFFFF | #000000","Custom 18 Animations":"float","Custom 18 Duration":"60","Custom 18 Flash":"0, 0, 0, 0, 0","== Custom 19 ==":"","Custom 19 Condition":"false","Custom 19 Text":"","Custom 19 Location":"24, -48","Custom 19 Colors":"#FFFFFF | #000000","Custom 19 Animations":"float","Custom 19 Duration":"60","Custom 19 Flash":"0, 0, 0, 0, 0","== Custom 20 ==":"","Custom 20 Condition":"false","Custom 20 Text":"","Custom 20 Location":"24, -48","Custom 20 Colors":"#FFFFFF | #000000","Custom 20 Animations":"float","Custom 20 Duration":"60","Custom 20 Flash":"0, 0, 0, 0, 0","== Custom 21 ==":"","Custom 21 Condition":"false","Custom 21 Text":"","Custom 21 Location":"24, -48","Custom 21 Colors":"#FFFFFF | #000000","Custom 21 Animations":"float","Custom 21 Duration":"60","Custom 21 Flash":"0, 0, 0, 0, 0","== Custom 22 ==":"","Custom 22 Condition":"false","Custom 22 Text":"","Custom 22 Location":"24, -48","Custom 22 Colors":"#FFFFFF | #000000","Custom 22 Animations":"float","Custom 22 Duration":"60","Custom 22 Flash":"0, 0, 0, 0, 0","== Custom 23 ==":"","Custom 23 Condition":"false","Custom 23 Text":"","Custom 23 Location":"24, -48","Custom 23 Colors":"#FFFFFF | #000000","Custom 23 Animations":"float","Custom 23 Duration":"60","Custom 23 Flash":"0, 0, 0, 0, 0","== Custom 24 ==":"","Custom 24 Condition":"false","Custom 24 Text":"","Custom 24 Location":"24, -48","Custom 24 Colors":"#FFFFFF | #000000","Custom 24 Animations":"float","Custom 24 Duration":"60","Custom 24 Flash":"0, 0, 0, 0, 0","== Custom 25 ==":"","Custom 25 Condition":"false","Custom 25 Text":"","Custom 25 Location":"24, -48","Custom 25 Colors":"#FFFFFF | #000000","Custom 25 Animations":"float","Custom 25 Duration":"60","Custom 25 Flash":"0, 0, 0, 0, 0","== Custom 26 ==":"","Custom 26 Condition":"false","Custom 26 Text":"","Custom 26 Location":"24, -48","Custom 26 Colors":"#FFFFFF | #000000","Custom 26 Animations":"float","Custom 26 Duration":"60","Custom 26 Flash":"0, 0, 0, 0, 0","== Custom 27 ==":"","Custom 27 Condition":"false","Custom 27 Text":"","Custom 27 Location":"24, -48","Custom 27 Colors":"#FFFFFF | #000000","Custom 27 Animations":"float","Custom 27 Duration":"60","Custom 27 Flash":"0, 0, 0, 0, 0","== Custom 28 ==":"","Custom 28 Condition":"false","Custom 28 Text":"","Custom 28 Location":"24, -48","Custom 28 Colors":"#FFFFFF | #000000","Custom 28 Animations":"float","Custom 28 Duration":"60","Custom 28 Flash":"0, 0, 0, 0, 0","== Custom 29 ==":"","Custom 29 Condition":"false","Custom 29 Text":"","Custom 29 Location":"24, -48","Custom 29 Colors":"#FFFFFF | #000000","Custom 29 Animations":"float","Custom 29 Duration":"60","Custom 29 Flash":"0, 0, 0, 0, 0","== Custom 30 ==":"","Custom 30 Condition":"false","Custom 30 Text":"","Custom 30 Location":"24, -48","Custom 30 Colors":"#FFFFFF | #000000","Custom 30 Animations":"float","Custom 30 Duration":"60","Custom 30 Flash":"0, 0, 0, 0, 0","== Custom 31 ==":"","Custom 31 Condition":"false","Custom 31 Text":"","Custom 31 Location":"24, -48","Custom 31 Colors":"#FFFFFF | #000000","Custom 31 Animations":"float","Custom 31 Duration":"60","Custom 31 Flash":"0, 0, 0, 0, 0","== Custom 32 ==":"","Custom 32 Condition":"false","Custom 32 Text":"","Custom 32 Location":"24, -48","Custom 32 Colors":"#FFFFFF | #000000","Custom 32 Animations":"float","Custom 32 Duration":"60","Custom 32 Flash":"0, 0, 0, 0, 0","== Custom 33 ==":"","Custom 33 Condition":"false","Custom 33 Text":"","Custom 33 Location":"24, -48","Custom 33 Colors":"#FFFFFF | #000000","Custom 33 Animations":"float","Custom 33 Duration":"60","Custom 33 Flash":"0, 0, 0, 0, 0","== Custom 34 ==":"","Custom 34 Condition":"false","Custom 34 Text":"","Custom 34 Location":"24, -48","Custom 34 Colors":"#FFFFFF | #000000","Custom 34 Animations":"float","Custom 34 Duration":"60","Custom 34 Flash":"0, 0, 0, 0, 0","== Custom 35 ==":"","Custom 35 Condition":"false","Custom 35 Text":"","Custom 35 Location":"24, -48","Custom 35 Colors":"#FFFFFF | #000000","Custom 35 Animations":"float","Custom 35 Duration":"60","Custom 35 Flash":"0, 0, 0, 0, 0","== Custom 36 ==":"","Custom 36 Condition":"false","Custom 36 Text":"","Custom 36 Location":"24, -48","Custom 36 Colors":"#FFFFFF | #000000","Custom 36 Animations":"float","Custom 36 Duration":"60","Custom 36 Flash":"0, 0, 0, 0, 0","== Custom 37 ==":"","Custom 37 Condition":"false","Custom 37 Text":"","Custom 37 Location":"24, -48","Custom 37 Colors":"#FFFFFF | #000000","Custom 37 Animations":"float","Custom 37 Duration":"60","Custom 37 Flash":"0, 0, 0, 0, 0","== Custom 38 ==":"","Custom 38 Condition":"false","Custom 38 Text":"","Custom 38 Location":"24, -48","Custom 38 Colors":"#FFFFFF | #000000","Custom 38 Animations":"float","Custom 38 Duration":"60","Custom 38 Flash":"0, 0, 0, 0, 0","== Custom 39 ==":"","Custom 39 Condition":"false","Custom 39 Text":"","Custom 39 Location":"24, -48","Custom 39 Colors":"#FFFFFF | #000000","Custom 39 Animations":"float","Custom 39 Duration":"60","Custom 39 Flash":"0, 0, 0, 0, 0","== Custom 40 ==":"","Custom 40 Condition":"false","Custom 40 Text":"","Custom 40 Location":"24, -48","Custom 40 Colors":"#FFFFFF | #000000","Custom 40 Animations":"float","Custom 40 Duration":"60","Custom 40 Flash":"0, 0, 0, 0, 0","== Custom 41 ==":"","Custom 41 Condition":"false","Custom 41 Text":"","Custom 41 Location":"24, -48","Custom 41 Colors":"#FFFFFF | #000000","Custom 41 Animations":"float","Custom 41 Duration":"60","Custom 41 Flash":"0, 0, 0, 0, 0","== Custom 42 ==":"","Custom 42 Condition":"false","Custom 42 Text":"","Custom 42 Location":"24, -48","Custom 42 Colors":"#FFFFFF | #000000","Custom 42 Animations":"float","Custom 42 Duration":"60","Custom 42 Flash":"0, 0, 0, 0, 0","== Custom 43 ==":"","Custom 43 Condition":"false","Custom 43 Text":"","Custom 43 Location":"24, -48","Custom 43 Colors":"#FFFFFF | #000000","Custom 43 Animations":"float","Custom 43 Duration":"60","Custom 43 Flash":"0, 0, 0, 0, 0","== Custom 44 ==":"","Custom 44 Condition":"false","Custom 44 Text":"","Custom 44 Location":"24, -48","Custom 44 Colors":"#FFFFFF | #000000","Custom 44 Animations":"float","Custom 44 Duration":"60","Custom 44 Flash":"0, 0, 0, 0, 0","== Custom 45 ==":"","Custom 45 Condition":"false","Custom 45 Text":"","Custom 45 Location":"24, -48","Custom 45 Colors":"#FFFFFF | #000000","Custom 45 Animations":"float","Custom 45 Duration":"60","Custom 45 Flash":"0, 0, 0, 0, 0","== Custom 46 ==":"","Custom 46 Condition":"false","Custom 46 Text":"","Custom 46 Location":"24, -48","Custom 46 Colors":"#FFFFFF | #000000","Custom 46 Animations":"float","Custom 46 Duration":"60","Custom 46 Flash":"0, 0, 0, 0, 0","== Custom 47 ==":"","Custom 47 Condition":"false","Custom 47 Text":"","Custom 47 Location":"24, -48","Custom 47 Colors":"#FFFFFF | #000000","Custom 47 Animations":"float","Custom 47 Duration":"60","Custom 47 Flash":"0, 0, 0, 0, 0","== Custom 48 ==":"","Custom 48 Condition":"false","Custom 48 Text":"","Custom 48 Location":"24, -48","Custom 48 Colors":"#FFFFFF | #000000","Custom 48 Animations":"float","Custom 48 Duration":"60","Custom 48 Flash":"0, 0, 0, 0, 0","== Custom 49 ==":"","Custom 49 Condition":"false","Custom 49 Text":"","Custom 49 Location":"24, -48","Custom 49 Colors":"#FFFFFF | #000000","Custom 49 Animations":"float","Custom 49 Duration":"60","Custom 49 Flash":"0, 0, 0, 0, 0","== Custom 50 ==":"","Custom 50 Condition":"false","Custom 50 Text":"","Custom 50 Location":"24, -48","Custom 50 Colors":"#FFFFFF | #000000","Custom 50 Animations":"float","Custom 50 Duration":"60","Custom 50 Flash":"0, 0, 0, 0, 0"}}, +{"name":"SRD_EnemyBulkDrops","status":false,"description":"Adds more Notetag options for YEP_ExtraEnemyDrops for bulk processing","parameters":{}}, {"name":"SRD_EquipCompareUpgrade","status":true,"description":"Allows for developers to customize all the visible parameters that can be seen on the Equip Screen.","parameters":{"Default Pos Color":"#80ff80","Default Neg Color":"#c08080","Window Width":"356","Font Size":"24","Line Padding":"8","== Stat 1 ==":"","Stat 1 Name":"Max HP","Stat 1 Eval":"actor.mhp","Stat 1 Format":"val","== Stat 2 ==":"","Stat 2 Name":"Max MP","Stat 2 Eval":"actor.mmp","Stat 2 Format":"val","== Stat 3 ==":"","Stat 3 Name":"Attack","Stat 3 Eval":"actor.atk","Stat 3 Format":"val","== Stat 4 ==":"","Stat 4 Name":"Defense","Stat 4 Eval":"actor.def","Stat 4 Format":"val","== Stat 5 ==":"","Stat 5 Name":"M. Attack","Stat 5 Eval":"actor.mat","Stat 5 Format":"val","== Stat 6 ==":"","Stat 6 Name":"M. Defense","Stat 6 Eval":"actor.mdf","Stat 6 Format":"val","== Stat 7 ==":"","Stat 7 Name":"Agility","Stat 7 Eval":"actor.agi","Stat 7 Format":"val","== Stat 8 ==":"","Stat 8 Name":"Luck","Stat 8 Eval":"actor.luk","Stat 8 Format":"val","== Stat 9 ==":"","Stat 9 Name":"Hit Rate","Stat 9 Eval":"Math.floor(actor.hit * 100)","Stat 9 Format":"val%","== Stat 10 ==":"","Stat 10 Name":"Evade Rate","Stat 10 Eval":"Math.floor(actor.eva * 100)","Stat 10 Format":"val%","== Stat 11 ==":"","Stat 11 Name":"Critical Rate","Stat 11 Eval":"Math.floor(actor.cri * 100)","Stat 11 Format":"val%","== Stat 12 ==":"","Stat 12 Name":"Critical Evade","Stat 12 Eval":"Math.floor(actor.cev * 100)","Stat 12 Format":"val%","== Stat 13 ==":"","Stat 13 Name":"M. Evasion","Stat 13 Eval":"Math.floor(actor.mev * 100)","Stat 13 Format":"val%","== Stat 14 ==":"","Stat 14 Name":"M. Reflect","Stat 14 Eval":"Math.floor(actor.mrf * 100)","Stat 14 Format":"val%","== Stat 15 ==":"","Stat 15 Name":"Counter Rate","Stat 15 Eval":"Math.floor(actor.cnt * 100)","Stat 15 Format":"val%","== Stat 16 ==":"","Stat 16 Name":"HP Regen","Stat 16 Eval":"Math.floor(actor.hrg * 100)","Stat 16 Format":"val%","== Stat 17 ==":"","Stat 17 Name":"MP Regen","Stat 17 Eval":"Math.floor(actor.mrg * 100)","Stat 17 Format":"val%","== Stat 18 ==":"","Stat 18 Name":"TP Regen","Stat 18 Eval":"Math.floor(actor.trg * 100)","Stat 18 Format":"val%","== Stat 19 ==":"","Stat 19 Name":"Target Rate","Stat 19 Eval":"Math.floor(actor.tgr * 100)","Stat 19 Format":"val%","== Stat 20 ==":"","Stat 20 Name":"Guard Effect","Stat 20 Eval":"Math.floor(actor.grd * 100)","Stat 20 Format":"val%","== Stat 21 ==":"","Stat 21 Name":"Recover Rate","Stat 21 Eval":"Math.floor(actor.rec * 100)","Stat 21 Format":"val%","== Stat 22 ==":"","Stat 22 Name":"Pharmacology","Stat 22 Eval":"Math.floor(actor.pha * 100)","Stat 22 Format":"val%","== Stat 23 ==":"","Stat 23 Name":"MP Cost Rate","Stat 23 Eval":"Math.floor(actor.mcr * 100)","Stat 23 Format":"val%","== Stat 24 ==":"","Stat 24 Name":"TP Cost Rate","Stat 24 Eval":"Math.floor(actor.tcr * 100)","Stat 24 Format":"val%","== Stat 25 ==":"","Stat 25 Name":"Damage Rate","Stat 25 Eval":"Math.floor(actor.pdr * 100)","Stat 25 Format":"val%","== Stat 26 ==":"","Stat 26 Name":"M. Damage Rate","Stat 26 Eval":"Math.floor(actor.mdr * 100)","Stat 26 Format":"val%","== Stat 27 ==":"","Stat 27 Name":"Floor Damage Rate","Stat 27 Eval":"Math.floor(actor.fdr * 100)","Stat 27 Format":"val%","== Stat 28 ==":"","Stat 28 Name":"EXP Rate","Stat 28 Eval":"Math.floor(actor.exr * 100)","Stat 28 Format":"val%","== Stat 29 ==":"","Stat 29 Name":"","Stat 29 Eval":"","Stat 29 Format":"val","== Stat 30 ==":"","Stat 30 Name":"","Stat 30 Eval":"","Stat 30 Format":"val","== Stat 31 ==":"","Stat 31 Name":"","Stat 31 Eval":"","Stat 31 Format":"val","== Stat 32 ==":"","Stat 32 Name":"","Stat 32 Eval":"","Stat 32 Format":"val","== Stat 33 ==":"","Stat 33 Name":"","Stat 33 Eval":"","Stat 33 Format":"val","== Stat 34 ==":"","Stat 34 Name":"","Stat 34 Eval":"","Stat 34 Format":"val","== Stat 35 ==":"","Stat 35 Name":"","Stat 35 Eval":"","Stat 35 Format":"val","== Stat 36 ==":"","Stat 36 Name":"","Stat 36 Eval":"","Stat 36 Format":"val","== Stat 37 ==":"","Stat 37 Name":"","Stat 37 Eval":"","Stat 37 Format":"val","== Stat 38 ==":"","Stat 38 Name":"","Stat 38 Eval":"","Stat 38 Format":"val","== Stat 39 ==":"","Stat 39 Name":"","Stat 39 Eval":"","Stat 39 Format":"val","== Stat 40 ==":"","Stat 40 Name":"","Stat 40 Eval":"","Stat 40 Format":"val","== Stat 41 ==":"","Stat 41 Name":"","Stat 41 Eval":"","Stat 41 Format":"val","== Stat 42 ==":"","Stat 42 Name":"","Stat 42 Eval":"","Stat 42 Format":"val","== Stat 43 ==":"","Stat 43 Name":"","Stat 43 Eval":"","Stat 43 Format":"val","== Stat 44 ==":"","Stat 44 Name":"","Stat 44 Eval":"","Stat 44 Format":"val","== Stat 45 ==":"","Stat 45 Name":"","Stat 45 Eval":"","Stat 45 Format":"val","== Stat 46 ==":"","Stat 46 Name":"","Stat 46 Eval":"","Stat 46 Format":"val","== Stat 47 ==":"","Stat 47 Name":"","Stat 47 Eval":"","Stat 47 Format":"val","== Stat 48 ==":"","Stat 48 Name":"","Stat 48 Eval":"","Stat 48 Format":"val","== Stat 49 ==":"","Stat 49 Name":"","Stat 49 Eval":"","Stat 49 Format":"val","== Stat 50 ==":"","Stat 50 Name":"","Stat 50 Eval":"","Stat 50 Format":"val","== Stat 51 ==":"","Stat 51 Name":"","Stat 51 Eval":"","Stat 51 Format":"val","== Stat 52 ==":"","Stat 52 Name":"","Stat 52 Eval":"","Stat 52 Format":"val","== Stat 53 ==":"","Stat 53 Name":"","Stat 53 Eval":"","Stat 53 Format":"val","== Stat 54 ==":"","Stat 54 Name":"","Stat 54 Eval":"","Stat 54 Format":"val","== Stat 55 ==":"","Stat 55 Name":"","Stat 55 Eval":"","Stat 55 Format":"val","== Stat 56 ==":"","Stat 56 Name":"","Stat 56 Eval":"","Stat 56 Format":"val","== Stat 57 ==":"","Stat 57 Name":"","Stat 57 Eval":"","Stat 57 Format":"val","== Stat 58 ==":"","Stat 58 Name":"","Stat 58 Eval":"","Stat 58 Format":"val","== Stat 59 ==":"","Stat 59 Name":"","Stat 59 Eval":"","Stat 59 Format":"val","== Stat 60 ==":"","Stat 60 Name":"","Stat 60 Eval":"","Stat 60 Format":"val","== Stat 61 ==":"","Stat 61 Name":"","Stat 61 Eval":"","Stat 61 Format":"val","== Stat 62 ==":"","Stat 62 Name":"","Stat 62 Eval":"","Stat 62 Format":"val","== Stat 63 ==":"","Stat 63 Name":"","Stat 63 Eval":"","Stat 63 Format":"val","== Stat 64 ==":"","Stat 64 Name":"","Stat 64 Eval":"","Stat 64 Format":"val","== Stat 65 ==":"","Stat 65 Name":"","Stat 65 Eval":"","Stat 65 Format":"val","== Stat 66 ==":"","Stat 66 Name":"","Stat 66 Eval":"","Stat 66 Format":"val","== Stat 67 ==":"","Stat 67 Name":"","Stat 67 Eval":"","Stat 67 Format":"val","== Stat 68 ==":"","Stat 68 Name":"","Stat 68 Eval":"","Stat 68 Format":"val","== Stat 69 ==":"","Stat 69 Name":"","Stat 69 Eval":"","Stat 69 Format":"val","== Stat 70 ==":"","Stat 70 Name":"","Stat 70 Eval":"","Stat 70 Format":"val","== Stat 71 ==":"","Stat 71 Name":"","Stat 71 Eval":"","Stat 71 Format":"val","== Stat 72 ==":"","Stat 72 Name":"","Stat 72 Eval":"","Stat 72 Format":"val","== Stat 73 ==":"","Stat 73 Name":"","Stat 73 Eval":"","Stat 73 Format":"val","== Stat 74 ==":"","Stat 74 Name":"","Stat 74 Eval":"","Stat 74 Format":"val","== Stat 75 ==":"","Stat 75 Name":"","Stat 75 Eval":"","Stat 75 Format":"val","== Stat 76 ==":"","Stat 76 Name":"","Stat 76 Eval":"","Stat 76 Format":"val","== Stat 77 ==":"","Stat 77 Name":"","Stat 77 Eval":"","Stat 77 Format":"val","== Stat 78 ==":"","Stat 78 Name":"","Stat 78 Eval":"","Stat 78 Format":"val","== Stat 79 ==":"","Stat 79 Name":"","Stat 79 Eval":"","Stat 79 Format":"val","== Stat 80 ==":"","Stat 80 Name":"","Stat 80 Eval":"","Stat 80 Format":"val","== Stat 81 ==":"","Stat 81 Name":"","Stat 81 Eval":"","Stat 81 Format":"val","== Stat 82 ==":"","Stat 82 Name":"","Stat 82 Eval":"","Stat 82 Format":"val","== Stat 83 ==":"","Stat 83 Name":"","Stat 83 Eval":"","Stat 83 Format":"val","== Stat 84 ==":"","Stat 84 Name":"","Stat 84 Eval":"","Stat 84 Format":"val","== Stat 85 ==":"","Stat 85 Name":"","Stat 85 Eval":"","Stat 85 Format":"val","== Stat 86 ==":"","Stat 86 Name":"","Stat 86 Eval":"","Stat 86 Format":"val","== Stat 87 ==":"","Stat 87 Name":"","Stat 87 Eval":"","Stat 87 Format":"val","== Stat 88 ==":"","Stat 88 Name":"","Stat 88 Eval":"","Stat 88 Format":"val","== Stat 89 ==":"","Stat 89 Name":"","Stat 89 Eval":"","Stat 89 Format":"val","== Stat 90 ==":"","Stat 90 Name":"","Stat 90 Eval":"","Stat 90 Format":"val","== Stat 91 ==":"","Stat 91 Name":"","Stat 91 Eval":"","Stat 91 Format":"val","== Stat 92 ==":"","Stat 92 Name":"","Stat 92 Eval":"","Stat 92 Format":"val","== Stat 93 ==":"","Stat 93 Name":"","Stat 93 Eval":"","Stat 93 Format":"val","== Stat 94 ==":"","Stat 94 Name":"","Stat 94 Eval":"","Stat 94 Format":"val","== Stat 95 ==":"","Stat 95 Name":"","Stat 95 Eval":"","Stat 95 Format":"val","== Stat 96 ==":"","Stat 96 Name":"","Stat 96 Eval":"","Stat 96 Format":"val","== Stat 97 ==":"","Stat 97 Name":"","Stat 97 Eval":"","Stat 97 Format":"val","== Stat 98 ==":"","Stat 98 Name":"","Stat 98 Eval":"","Stat 98 Format":"val","== Stat 99 ==":"","Stat 99 Name":"","Stat 99 Eval":"","Stat 99 Format":"val","== Stat 100 ==":"","Stat 100 Name":"","Stat 100 Eval":"","Stat 100 Format":"val"}}, -{"name":"SRD_StatDistribution","status":true,"description":"Allows players to distribute points to different stats of the Actors at his or her discretion.","parameters":{"Default Stats":"mhp, mmp, atk, def, mat, mdf, agi, luk","Default Formula":"Math.ceil(level / 10)","Show on Menu":"true","== Stat Reset ==":"","Allow Stat Resets":"true","Reset Gold Cost":"points * 100","== Custom Texts ==":"","Level Up Message":"Got %1 stat points!","Command Name":"Stat Boost","Points Text":"Stat Points:","Upgrade Text":"Upgrade Cost:","Spend Text":"Spend","Reset Text":"Reset","Finish Text":"Finish","== Gauge Options ==":"","Use Gauges":"true","Gauge Height":"14","== Points Label ==":"","Point Icon":"87","Point Text":"Points","Point Color":"#66ff66"}}, -{"name":"SRD_SummonCore","status":true,"description":"Allows developers to create skills that summon Actors into the player's party using various parameters.","parameters":{"Battlelog Message":"%1 has been summoned!","Max Summons":"4","Restrict Per Skill":"true","Restrict Per Position":"true","== Defaults ==":"","Default Actor ID":"1","Default Level":"1","Default Animation":"51","Default Exit Ani.":"51","Default Turns":"-1","Default X Pos":"master._homeX - 120","Default Y Pos":"master._homeY"}}, -{"name":"charcreator","status":true,"description":"Allows players to create their own custom characters.","parameters":{"Layers":"Tail Part2, Wing Part2, Body, Eyes, Eyebrows, Nose, Mouth, Rear Hair Part1, Front Hair Part2, Rear Hair Part2, Clothing, Accessory A, Glasses, Front Hair Part1, Beast Ears, Accessory B, Tail Part1, Wing Part1","Order":"Body, Eyes, Eyebrows, Nose, Mouth, Clothing, Front Hair, Rear Hair, Accessory A, Accessory B, Glasses, Beast Ears, Wing, Tail","Mandatory":"Body, Eyes, Eyebrows, Nose, Mouth","Mandatory Color":"#FFFF44","Print to Console":"false","== Visual Options ==":"","Use Fade Transition":"true","Use Piece Background":"true","Use Scene Background":"true","Background X Scroll":"1","Background Y Scroll":"0","Small Piece Cols":"3","Big Piece Cols":"1","== Dialogues ==":"","Leave Dialogue":"Are you sure you want\\n to save this character?","Mandatory Dialogue":"You need to have all the mandatory sections \\nfilled out before exiting.","== Size Options ==":"","Character Width":"48","Character Height":"48","SV Char Width":"64","SV Char Height":"64","Face Width":"144","Face Height":"144","== Localization ==":"","Yes Text":"Yes!","No Text":"Nope","Color Mouse/Touch Input":"true"}}, +{"name":"SRD_SuperToolsEngine","status":false,"description":"The heart of all maker-style plugins; it adds a playtesting editor that can be opened with F12.","parameters":{"Connect Editor":"true","Auto Open Window":"false","Auto Move Window":"true","Menu Editor Exempt List":"[\"Window_BattleLog\",\"Window_MapName\"]"}}, +{"name":"SRD_StatDistribution","status":false,"description":"Allows players to distribute points to different stats of the Actors at his or her discretion.","parameters":{"Default Stats":"mhp, mmp, atk, def, mat, mdf, agi, luk","Default Formula":"Math.ceil(level / 10)","Show on Menu":"true","== Stat Reset ==":"","Allow Stat Resets":"true","Reset Gold Cost":"points * 100","== Custom Texts ==":"","Level Up Message":"Got %1 stat points!","Command Name":"Stat Boost","Points Text":"Stat Points:","Upgrade Text":"Upgrade Cost:","Spend Text":"Spend","Reset Text":"Reset","Finish Text":"Finish","== Gauge Options ==":"","Use Gauges":"true","Gauge Height":"14","== Points Label ==":"","Point Icon":"87","Point Text":"Points","Point Color":"#66ff66"}}, +{"name":"SRD_SummonCore","status":false,"description":"Allows developers to create skills that summon Actors into the player's party using various parameters.","parameters":{"Battlelog Message":"%1 has been summoned!","Max Summons":"4","Restrict Per Skill":"true","Restrict Per Position":"true","== Defaults ==":"","Default Actor ID":"1","Default Level":"1","Default Animation":"51","Default Exit Ani.":"51","Default Turns":"-1","Default X Pos":"master._homeX - 120","Default Y Pos":"master._homeY"}}, +{"name":"charcreator","status":false,"description":"Allows players to create their own custom characters.","parameters":{"Layers":"Tail Part2, Wing Part2, Body, Eyes, Eyebrows, Nose, Mouth, Rear Hair Part1, Front Hair Part2, Rear Hair Part2, Clothing, Accessory A, Glasses, Front Hair Part1, Beast Ears, Accessory B, Tail Part1, Wing Part1","Order":"Body, Eyes, Eyebrows, Nose, Mouth, Clothing, Front Hair, Rear Hair, Accessory A, Accessory B, Glasses, Beast Ears, Wing, Tail","Mandatory":"Body, Eyes, Eyebrows, Nose, Mouth","Mandatory Color":"#FFFF44","Print to Console":"false","== Visual Options ==":"","Use Fade Transition":"true","Use Piece Background":"true","Use Scene Background":"true","Background X Scroll":"1","Background Y Scroll":"0","Small Piece Cols":"3","Big Piece Cols":"1","== Dialogues ==":"","Leave Dialogue":"Are you sure you want\\n to save this character?","Mandatory Dialogue":"You need to have all the mandatory sections \\nfilled out before exiting.","== Size Options ==":"","Character Width":"48","Character Height":"48","SV Char Width":"64","SV Char Height":"64","Face Width":"144","Face Height":"144","== Localization ==":"","Yes Text":"Yes!","No Text":"Nope","Color Mouse/Touch Input":"true"}}, {"name":"--------------------","status":true,"description":"------------------------------------------------------------","parameters":{}}, {"name":"YEP_AnimateTilesOption","status":true,"description":"v1.03 Because some computers and devices lag with animated\ntiles on the map, an option is added to disable them.","parameters":{"Command Name":"Animated Tiles","Default Setting":"auto"}}, {"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":"[]"}}, diff --git a/js/plugins/BatchText.js b/js/plugins/BatchText.js new file mode 100644 index 0000000..8194f18 --- /dev/null +++ b/js/plugins/BatchText.js @@ -0,0 +1,113 @@ +//=================== +// Batch Text for MV +//=================== + +/*: + * @plugindesc Allows you to implement sequenced dialogue through the use of batch input. + * @author JGreene + * + * @param Variable + * @desc The variable you want to reserve for this plugin's functions. + * @default 1 + * + * @param WindowPosition + * @desc Set this to the position you'd like to use. Refer to help for info. + * @default 2 + * + * @param Separator + * @desc Don't change this unless you know what you're doing! + * @default | + * + * @help Requires YEP_MessageCore to function properly. It is also compatible + with Galv's Message Background. Just place this below them in your load order. + + Each time you use the plugin command, the next message in the sequence will + be displayed. The parameters you set up will determine where the message + displays. + + Window Positions: + 0 = Top + 1 = Middle + 2 = Bottom + + All text codes are supported, except those that use the symbol reserved for + the separator. By default, use \. several times to make up for the loss of \| + Or, change the separator if you feel comfortable doing so. + + For long messages, insert at the beginning of the message. + + --- Important! --- + Be sure to place your messages in the order they need to appear in + your game! The plugin will do the rest! You can still use the engine's + default Show Text command separate from this plugin as normal. + + ===== SETUP Instructions ===== + + 1. Create a file in your project's data folder named messages.txt + 2. Input your text lines like so: + This is line 1. + |This is line 2! + |This is line 3, right? + |Etc. + +Note: Pressing enter will make a new line, as well as . Only use +one or the other. With word wrap, put the whole message on one line. The +separator | has to be the first character for each new message. + + 3. Load your plugin in the editor and set up your variable and position + 4. Use the plugin command batchtext in place of messages, and the plugin + will automatically keep track of which to play next. + +Keep in mind, this only works for direct sequences - much like a scripted +play or movie. However, with careful planning, you can jump to and from +sections in your script. Furthermore, your game will error and crash if +you use the plugin command after all the messages in your file have been +read through. Be careful! + +---------- Advanced ------------------ + +If you want to go out of order at any point, I would advise copying your script +into another file, numbering each message in order, and then dividing up +the sections by NPC/event. + +At that point, assign each NPC/event to the proper section. When you talk to +them, be sure the first thing that happens is a Control Variable X = Y. Where +X is your parameter variable, and Y is the line number that they should begin +with. Just plan accordingly so they don't end up speaking someone else's lines +(or crashing the game). + +-------------------------------------- + +Have any questions? Contact me --> jgreene on rpgmakerweb + +Enjoy! + +*/ + +(function() { + var parameters = PluginManager.parameters('BatchText'); + +var JG_Batch_aliasPluginCommand = Game_Interpreter.prototype.pluginCommand; + +Game_Interpreter.prototype.pluginCommand = function(command, args) +{ + JG_Batch_aliasPluginCommand.call(this,command,args); + if (command == "batchtext") + { + var xhr = new XMLHttpRequest(); + xhr.open("GET","data/messages.txt",false); + xhr.send(null); + var fileContent = xhr.responseText; + var x = parameters['Variable'] + var pos = parameters['WindowPosition'] + var dia = fileContent.split(parameters['Separator']) + var index = $gameVariables.value(x) + var msg = dia[index] + $gameMessage.setPositionType(pos); + $gameMessage.add(msg); + this.setWaitMode('message'); + $gameVariables.setValue(x, index+1); + } +} + +})(); \ No newline at end of file diff --git a/js/plugins/FROG_TriggerDistance.js b/js/plugins/FROG_TriggerDistance.js new file mode 100644 index 0000000..0ff4867 --- /dev/null +++ b/js/plugins/FROG_TriggerDistance.js @@ -0,0 +1,343 @@ +//============================================================================= +// Frogboy RMMV Plugin +// FrogTriggerDistance.js +//============================================================================= + +var Imported = Imported || {}; +Imported.FROG_TriggerDistance = true; + +var FROG = FROG || {}; +FROG.TriggerDistance = FROG.TriggerDistance || {}; + +//============================================================================= +/*: + * @plugindesc v1.21 Trigger Events at a distance based on Radius or X/Y Axis + * @author Frogboy + * + * @help + * TriggerDistance v1.21 + * Author Frogboy + * + * ============================================================================ + * Introduction + * ============================================================================ + * + * This plugin is mainly used to avoid duplicating the same Event multiple + * times in order to cover more than one square. By specifying your parameters + * in comment of an Event page, the Player Touch Trigger can be fired when + * your Player is at a specified distance from the Event and/or on a certain + * axis. I've also added functionality to list specific modes + * of travel that will trigger an event. Now you can fly your airship to a + * floating island but not walk or sail into it from the ground. Yay! + * + * This plugin now also supports Event Touch triggers at a distance. A moving + * event with an Event Touch trigger will activate if it steps within range of + * the Player. + * + * ============================================================================ + * How to Use + * ============================================================================ + * + * On an Event page that has a Player Touch trigger, create a Comment and enter + * it in this format: + * Parameters are separated by a space. + * + * The following parameters are supported. Each one is immediately followed by + * a number to specify the distance in squares/tiles that the Event sould fire. + * r# - Radius (Any square within # of Event) + * x# - X-Axis (Any square within # of Event on the X-Axis [left/right]) + * y# - Y-Axis (Any square within # of Event on the Y-Axis [up/down]) + * s# - Switch Binding (Will turn ON the specified Switch ID and not + * fire again while the Switch is on) + * combo - This tells the event to look for both Player and Event Touch + * conditions. + * + * If both x# and y# are specified, the trigger range will form a square or + * rectangular area as opposed to just covering the two axis. + * + * These can also be specified in the parameters to indicate which modes of + * travel this event will fire for. If you specify none then an Event Touch + * will always trigger. + * walk - Tagged Event Touch will trigger if you are walking + * boat - Tagged Event Touch will trigger if you are on your boat + * ship - Tagged Event Touch will trigger if you are on your ship + * airship - Tagged Event Touch will trigger if you are on your airship + * + * Examples: + * X-Axis + * + * Will cover the Event square and 5 tiles to the left and right of it. + * Great for spanning a hallway. + * #####E##### + * + * Y-Axis + * + * Will cover the Event square and 2 tiles above and below of it. + * # + * # + * E + * # + * # + * + * Radius + * + * Will cover the Event square and 3 tiles in all directions. + * # + * ### + * ##### + * ###E### + * ##### + * ### + * # + * + * Rectangle + * + * Will cover an area that spans 4 tiles along the x-axis and 2 tiles + * along the y-axis. + * ######### + * ######### + * ####E#### + * ######### + * ######### + * + * + * Will cover the the entire edge of the top or bottom of a map. + * It doesn't have to be the top or bottom edge but that's what it is + * typically used for. The number is set purposely large to cover any + * size map. + * + * + * Will cover the the entire edge of the left or right of a map. + * It doesn't have to be the left or right edge but that's what it is + * typically used for. The number is set purposely large to cover any + * size map. + * + * Radius with Switch + * + * Will cover the Event square and 2 tiles in all directions, will turn + * on Switch ID 12 and not fire an Event Toouch again while Switch 12 is + * ON. + * # + * ### + * ##E## + * ### + * # + * + * Touch only fires when you are in your airship + * + * No radius, x or y specified so this only covers the event tile + * E + * + * ============================================================================ + * Switch Property + * ============================================================================ + * + * The Switch property isn't all that useful any longer. It was a fix for + * issues I had when this plugin used the Note Tag to specify parameters and + * thus, didn't know which Event Page you were on. By entering the parameters + * into Comments that are specific to the page the Event is currently on, I + * don't really have a good use case for this any longer. I'm leaving it in + * just in case you find one. + * + * ============================================================================ + * Terms of Use + * ============================================================================ + * + * This plugin can be used in commercial or non-commercial projects. + * Credit Frogboy in your work + * + * ============================================================================ + * Changelog + * ============================================================================ + * + * Version 1.0 - Initial release + * Version 1.1 - Parameters now use Comments instead of Note Tag. + * Version 1.2 - Added ranged Event Touch Triggers. Bug fix. More Aliasing. + * Rectangular cover when specifying both x# and y#. + * Version 1.21 - Bug fix + * +*/ +//============================================================================= + +(function() { + // Setup Page Settings. Add _triggerDistance property. + FROG.TriggerDistance.GameEventSetupPageSettings = Game_Event.prototype.setupPageSettings; + Game_Event.prototype.setupPageSettings = function() { + FROG.TriggerDistance.GameEventSetupPageSettings.call(this); + this._triggerDistance = ""; + var page = this.page(); + + for (var i=0; i/i); + if (triggerDistance) { + this._triggerDistance = triggerDistance[1]; + break; + } + } + } + } + + // Exception added, otherwise solid objects would require touch from a tile away. + Game_Player.prototype.startMapEvent = function(x, y, triggers, normal) { + if (!$gameMap.isEventRunning()) { + $gameMap.eventsXy(x, y).forEach(function(event) { + if (event.isTriggerIn(triggers) && (event.isNormalPriority() === normal || event._triggerDistance)) { + event.start(); + } + }); + } + } + + // Check for Player Touch Trigger Distance + FROG.TriggerDistance.GameMapEventXy = Game_Map.prototype.eventsXy; + Game_Map.prototype.eventsXy = function(x, y) { + var return_events = FROG.TriggerDistance.GameMapEventXy.call(this, x, y); + + for (var i=0; i -1 && event._trigger === 2))) { + return_events = return_events.concat(FROG.TriggerDistance.checkTriggerDistance(event, x, y)); + } + else if (event._x == x && event._y == y) { + if (!$gamePlayer.isInAirship()) { + return_events.push(event); + } + } + } + + return return_events; + } + + // Disable Airship restriction on activating events + Game_Player.prototype.canStartLocalEvents = function() { + return true; + } + + // Check for Event Touch Trigger Distance but wait until the event stops moving to start it + FROG.TriggerDistance.GameCharacterBaseMoveStraight = Game_CharacterBase.prototype.moveStraight; + Game_CharacterBase.prototype.moveStraight = function (d) { + FROG.TriggerDistance.GameCharacterBaseMoveStraight.call(this, d); + + if (this._eventId && this.isMovementSucceeded() && this._triggerDistance && + (this._trigger === 2 || (this._triggerDistance.indexOf("combo") > -1 && this._trigger === 1))) + { + var return_events = FROG.TriggerDistance.checkTriggerDistance(this, $gamePlayer._x, $gamePlayer._y); + for (var i=0; i -1); + var walk = (arr.indexOf("walk") > -1); + var boat = (arr.indexOf("boat") > -1); + var ship = (arr.indexOf("ship") > -1); + var airship = (arr.indexOf("airship") > -1); + + for (var j=0; j -1 && distance <= tdr) { + if (tdSwitch > 0) { + $gameSwitches.setValue(tdSwitch, true); + } + return_events.push(event); + } + + // If both x and y are specified, the trigger distance will cover a square or rectangle + if (tdx > -1 && tdy > -1) { + if (Math.abs(event.deltaXFrom(x)) <= tdx && Math.abs(event.deltaYFrom(y)) <= tdy) { + return_events.push(event); + } + } + else { + // Check X-Axis Trigger + if (tdx > -1 && distance <= tdx && y === event.y) { + if (tdSwitch > 0) { + $gameSwitches.setValue(tdSwitch, true); + } + return_events.push(event); + } + + // Check Y-Axis Trigger + if (tdy > -1 && distance <= tdy && x === event.x) { + if (tdSwitch > 0) { + $gameSwitches.setValue(tdSwitch, true); + } + return_events.push(event); + } + } + } + + return return_events; + } +})(); \ No newline at end of file diff --git a/js/plugins/GALV_EventSpawnTimers.js b/js/plugins/GALV_EventSpawnTimers.js new file mode 100644 index 0000000..3798578 --- /dev/null +++ b/js/plugins/GALV_EventSpawnTimers.js @@ -0,0 +1,285 @@ +//----------------------------------------------------------------------------- +// Galv's Event Spawn Timers +//----------------------------------------------------------------------------- +// For: RPGMAKER MV +// GALV_EventSpawnTimers.js +//----------------------------------------------------------------------------- +// 2016-07-20 - Version 1.2 - fixed a bug causing too many move route updates +// 2016-03-26 - Version 1.1 - added script calls to modify timers. Fixed bugs. +// 2016-03-25 - Version 1.0 - release +//----------------------------------------------------------------------------- +// Terms can be found at: +// galvs-scripts.com +//----------------------------------------------------------------------------- + +var Imported = Imported || {}; +Imported.Galv_EventSpawnTimers = true; + +var Galv = Galv || {}; // Galv's main object +Galv.EST = Galv.EST || {}; // Galv's stuff + +//----------------------------------------------------------------------------- +/*: + * @plugindesc Enable psuedo-timers that can control event self-switches, switches and variables. + * + * @author Galv - galvs-scripts.com + * + * @help + * Galv's Event Spawn Timers + * ---------------------------------------------------------------------------- + * This plugin allows you to set multiple respawn timers for events and change + * switches or self switches when their timer expires. + * + * Just simply creating an event timer doesn't do anything until you call a + * script that checks if the timer is up and then modifies the switches in the + * way you specify. + * + * The timer checks can be made in event move routes, which means the switch + * effect activates once the player gets in range of the events. The reason for + * doing this is to allow many timers to exist without causing lag due to many + * countdowns running simultaneously. + * + * Timer checks can also be made using a script call any time you need to check + * and activate the results of any event timer in the game. + * ---------------------------------------------------------------------------- + * + * ---------------------------------------------------------------------------- + * SCRIPT call for MOVE ROUTE + * ---------------------------------------------------------------------------- + * + * this.doTimer(switch,status,forceEnd); + * + * switch = the ID number of the switch OR letter in quotes for self switch + * status = true to turn ON and false to turn OFF + * forceEnd = true or false - when using this, timer activates and ends even + * if it still had time left. You can leave this one out to not use. + * + * This is the command that checks if a timer is up and controls the specified + * switch to turn on or off for the event the move route belongs to. The + * frequency this check is done depends on the movement "Freq" of the event. + * EXAMPLES: + * this.doTimer("B",false); // turn self-switch B off once timer expires + * this.doTimer(5,true); // turn switch 1 on once timer expires + * this.doTimer("A",true,true); // turn switch 1 on forcibly NOW! + * ---------------------------------------------------------------------------- + * + * ---------------------------------------------------------------------------- + * SCRIPT calls for event commands + * ---------------------------------------------------------------------------- + * + * this.setSpawn(mapId,eventId,time); + * + * mapId = the map the event is on. Use 0 for the current map. + * eventId = the event. Use 0 for the event the script call is in. + * time = how many seconds until the timer is complete. + * + * This command will create a timer for an event. If it is used while a timer + * exists for an event, the latest time will overwrite the old one. + * EXAMPLES: + * this.setSpawn(12,5,80); // set timer for event 5 on map 12 for 80 seconds + * this.setSpawn(0,0,30); // set timer for this event, this map, 30 seconds + * ---------------------------------------------------------------------------- + * + * this.doTimer(mapId,eventId,switch,status,forceEnd); + * + * mapId = the map of the target event. Use 0 for the current map. + * eventId = the target event. Use 0 for the event the script call is in. + * switch = the ID number of the switch OR letter in quotes for self switch + * status = true to turn ON and false to turn OFF + * forceEnd = true or false - when using this, timer activates and ends even + * if it still had time left. You can leave this one out to not use. + * + * This command checks if a timer is up for an event on specified map and turns + * a switch or that event's self-switch on or off. This is used if you need to + * check and activate an event's timer from anywhere in the game. + * EXAMPLES: + * this.doTimer(4,7,"C",false); // Map 4, event 7, self switch C off + * this.doTimer(0,2,9,true); // This map, event 2, switch 9 on + * this.doTimer(0,2,9,true,true); // This map, event 2, switch 9 on, end timer + * ---------------------------------------------------------------------------- + * + * this.doMapTimers(mapId,switch,status,forceEnd); + * + * mapId = the map the event is on. Use 0 for the current map. + * + * This commend does the same as the above doTimer command, except it does it + * for all event timers currently running on the map. + * EXAMPLE: + * this.doMapTimers(2,"B",false); // turn self-switch B off when timer expires + * // for all timer-events on map 2 + * ---------------------------------------------------------------------------- + * + * this.purgeEventTimers(); // Remove ALL timers + * + * this.purgeEventTimers(mapId); // Remove all timers on map + * + * this.purgeEventTimers(mapId,eventId); // Remove specified event timer + * + * This command purges timers as above. + * ---------------------------------------------------------------------------- + * + * this.modEventTimers(mapId,eventId,amount); // mod specific timer + * + * this.modEventTimers(mapId,amount); // mod all timers on specified map + * + * this.modEventTimers(amount); // modify ALL timers + * + * mapId = the map of the target event. Use 0 for the current map. + * eventId = the target event. Use 0 for the event the script call is in. + * amount = change timer by this much. (negative reduce, positive increase) + * + * These commands change the time left on specified timers. + * EXAMPLES + * this.modEventTimers(2,7,-10); // decrease timer for map 2, event 7 by 10s + * this.modEventTimers(0,2); // increase all timers for the current map by 2s + * this.modEventTimers(-20); // decrease ALL timers by 20s + * ---------------------------------------------------------------------------- + * SCRIPT for CONTROL VARIABLES + * ---------------------------------------------------------------------------- + * + * this.respawnTime(mapId,eventId); + * + * mapId = the map of the target event. Use 0 for the current map. + * eventId = the target event. Use 0 for the event the script call is in. + * + * This command, used in Control Variables 'script' will return the amount of + * seconds the event timer has remaining. It will return 0 if no timer exists. + * ---------------------------------------------------------------------------- + */ + +//----------------------------------------------------------------------------- +// CODE STUFFS +//----------------------------------------------------------------------------- + + +(function() { + +Galv.EST.x = PluginManager.parameters('Galv_EventSpawnTimers')['X']; + +// Game_System +//----------------------------------------------------------------------------- +Galv.EST.Game_System_initialize = Game_System.prototype.initialize; +Game_System.prototype.initialize = function() { + this.purgeEventTimers(); + Galv.EST.Game_System_initialize.call(this); +}; + + +Game_System.prototype.purgeEventTimers = function(mapId,eventId) { + if (!mapId) { // Purge all + this.eventTimers = {}; + } else if (!eventId) { // Purge map + if (this.eventTimers) { + delete(this.eventTimers[mapId]); + }; + } else { // Purge event + if (this.eventTimers && this.eventTimers[mapId]) { + delete(this.eventTimers[mapId][eventId]); + }; + }; +}; + + +// Game_Interpreter +//----------------------------------------------------------------------------- +Game_Interpreter.prototype.setSpawn = function(mapId,eventId,time) { + if (mapId <= 0) mapId = this._mapId; + if (eventId <= 0) eventId = this._eventId; + $gameSystem.eventTimers[mapId] = $gameSystem.eventTimers[mapId] || {}; + $gameSystem.eventTimers[mapId][eventId] = $gameSystem.playtime() + time; +}; + +Game_Interpreter.prototype.respawnTime = function(mapId,eventId) { + if (mapId <= 0) mapId = this._mapId; + if (eventId <= 0) eventId = this._eventId; + + if ($gameSystem.eventTimers[mapId] && $gameSystem.eventTimers[mapId][eventId]) { + return $gameSystem.eventTimers[mapId][eventId] - $gameSystem.playtime(); + } else { + return 0; + }; +}; + +Game_Interpreter.prototype.doTimer = function(mapId,eventId,s,status,force) { + if (mapId <= 0) mapId = this._mapId; + if (eventId <= 0) eventId = this._eventId; + if ($gameSystem.eventTimers[mapId] && $gameSystem.eventTimers[mapId][eventId]) { + if (force || $gameSystem.playtime() >= $gameSystem.eventTimers[mapId][eventId]) { + if (isNaN(s)) { // If letter + $gameSelfSwitches.setValue(mapId + "," + eventId + "," + s,status); + } else { // If number + $gameSwitches.setValue(s,status); + }; + delete($gameSystem.eventTimers[mapId][eventId]); + }; + }; +}; + +Game_Interpreter.prototype.doMapTimers = function(mapId,s,status,force) { + if (mapId <= 0) mapId = this._mapId; + for (var e in $gameSystem.eventTimers[mapId]) { + var eventId = e; + this.doTimer(mapId,eventId,s,status,force); + }; +}; + +Game_Interpreter.prototype.purgeEventTimers = function(mapId,eventId) { + if (mapId != null && mapId <= 0) mapId = this._mapId; + if (eventId != null && eventId <= 0) eventId = this._eventId; + $gameSystem.purgeEventTimers(mapId,eventId); +}; + +Game_Interpreter.prototype.modEventTimers = function(mapId,eventId,amount) { + if (!eventId) { // all timers + // mapId field used as amount + amount = mapId; + + if ($gameSystem.eventTimers) { + for (var m in $gameSystem.eventTimers) { + var map = $gameSystem.eventTimers[m]; + for (var e in map) { + map[e] += amount; + }; + }; + }; + + } else if (!amount) { // all on map + // eventId field used as amount + if (mapId != null && mapId <= 0) mapId = this._mapId; + amount = eventId; + if ($gameSystem.eventTimers[mapId]) { + for (var e in $gameSystem.eventTimers[mapId]) { + $gameSystem.eventTimers[mapId][e] += amount; + }; + }; + + } else { // Singe event + if (mapId != null && mapId <= 0) mapId = this._mapId; + if (eventId != null && eventId <= 0) eventId = this._eventId; + if ($gameSystem.eventTimers && $gameSystem.eventTimers[mapId]) { + $gameSystem.eventTimers[mapId][eventId] += amount; + }; + }; +}; + + +// Game_Event +//----------------------------------------------------------------------------- +Game_Event.prototype.doTimer = function(s,status,force) { + var mapId = $gameMap._mapId; + var eventId = this._eventId; + if ($gameSystem.eventTimers[mapId] && $gameSystem.eventTimers[mapId][eventId]) { + if (force || $gameSystem.playtime() >= $gameSystem.eventTimers[mapId][eventId]) { + if (isNaN(s)) { // If letter + $gameSelfSwitches.setValue(mapId + "," + eventId + "," + s,status); + } else { // If number + $gameSwitches.setValue(s,status); + }; + delete($gameSystem.eventTimers[mapId][eventId]); + }; + }; + this.resetStopCount(); +}; + + +})(); \ No newline at end of file diff --git a/js/plugins/HIME_DisabledChoiceConditions.js b/js/plugins/HIME_DisabledChoiceConditions.js new file mode 100644 index 0000000..d93135e --- /dev/null +++ b/js/plugins/HIME_DisabledChoiceConditions.js @@ -0,0 +1,159 @@ +/*: +------------------------------------------------------------------------- +@title Disabled Choice Conditions +@author Hime --> HimeWorks (http://himeworks.com) +@version 1.3 +@date Jan 5, 2016 +@filename HIME_DisabledChoiceConditions.js +@url http://himeworks.com/2015/10/disabled-choice-conditions/ + +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.4Allows you to disable individual choices in a set of options +based on custom conditions +@help +------------------------------------------------------------------------- +== Description == + +RPG Maker does not come with a way to disable individual choices from +a list of choices. For example, if the player shouldn't be allowed to +select a particular option, but you still want to show it, there's +basically no way to do it. + +This plugin provides an easy way for you to disable each choice based +on your own custom conditions using tools that you are already +familiar with! + +== Terms of Use == + +- Free for use in non-commercial projects with credits +- Contact me for commercial use + +== Change Log == + +1.3 - Jan 5, 2016 + * Provided script call with interpreter scope +1.2 - Nov 2, 2015 + * rewrote input methods. You can either use a script call, or a + plugin command directly +1.1 - Nov 1, 2015 + * added support for plugin/conditional pair +1.0 - Oct 31, 2015 + * initial release + +== Usage == + +There are two ways to disable a choice + +1. Using a plugin command + +To disable a choice, simply use the plugin command + + disable_choice choiceNumber + +Where the choiceNumber is the number of the choice that +you wish to disable + +Use conditional branches and any other event commands as needed +to implement your logic. + +2. Using a script call + + this.disable_choice( choiceNumber, formula ) + +Where the choiceNumber is the number of the choice that +you wish to disable, and the formula is a valid Javascript formula. + +For example, to disable choice 3 if switch 4 is OFF, you can say + + this.disable_choice(3, "$gameSwitches.value(4) === false") + +-- When there are multiple sets of choices -- + +Disable conditions apply to the immediate set of choices, on the same +indentation level. + +As a rule of thumb, you should declare all disable conditions +immediately before your choices. To avoid breaking up messages +and choices, you can place the disable conditions before any +messages as well. + +------------------------------------------------------------------------- + */ +var Imported = Imported || {} +var TH = TH || {}; +Imported.DisabledChoiceConditions = 1; +TH.DisabledChoiceConditions = TH.DisabledChoiceConditions || {}; + +(function ($) { + + $.Regex = //i + + /* store all indices that are disabled */ + var TH_DisableChoiceConditions_GameMessage_Clear = Game_Message.prototype.clear; + Game_Message.prototype.clear = function() { + TH_DisableChoiceConditions_GameMessage_Clear.call(this); + this._DisabledChoiceConditions = {}; + }; + + /* Returns whether the specified choice is disabled */ + Game_Message.prototype.isChoiceDisabled = function(choiceNum) { + return this._DisabledChoiceConditions[choiceNum]; + } + + Game_Message.prototype.disableChoice = function(choiceNum, bool) { + this._DisabledChoiceConditions[choiceNum] = bool; + } + + /* After setting up choices, go and disable any that should be disabled */ + var TH_DisableChoiceConditions_WindowChoiceList_MakeCommandList = Window_ChoiceList.prototype.makeCommandList; + Window_ChoiceList.prototype.makeCommandList = function() { + TH_DisableChoiceConditions_WindowChoiceList_MakeCommandList.call(this); + for (var i = 0; i < this._list.length; i++) { + if ($gameMessage.isChoiceDisabled(i)) { + this._list[i].enabled = false; + } + } + }; + + /* Gray out disabled choices */ + var TH_DisableChoiceConditions_WindowChoiceList_DrawItem = Window_ChoiceList.prototype.drawItem + Window_ChoiceList.prototype.drawItem = function(index) { + this.changePaintOpacity(this.isCommandEnabled(index)); + TH_DisableChoiceConditions_WindowChoiceList_DrawItem.call(this, index); + }; + + /* Use a plugin command*/ + var TH_DisabledChoiceConditions_GameInterpreterPluginCommand = Game_Interpreter.prototype.pluginCommand; + Game_Interpreter.prototype.pluginCommand = function(command, args) { + TH_DisabledChoiceConditions_GameInterpreterPluginCommand.call(this, command, args); + if (command.toLowerCase() === "disable_choice") { + var choiceNum = Math.floor(args[0] - 1); + $gameMessage.disableChoice(choiceNum, true); + } + return true; + }; + + /* disable choice script call, with interpreter scope */ + Game_Interpreter.prototype.disable_choice = function(choiceNum, formula) { + var num = Math.floor(choiceNum) - 1; + $gameMessage.disableChoice(num, eval(formula)); + }; + + /* disable choice script call */ + disable_choice = function(choiceNum, formula) { + var num = Math.floor(choiceNum) - 1; + $gameMessage.disableChoice(num, eval(formula)); + }; +})(TH.DisabledChoiceConditions); \ No newline at end of file diff --git a/js/plugins/JIF_MoveStaling.js b/js/plugins/JIF_MoveStaling.js new file mode 100644 index 0000000..624b8aa --- /dev/null +++ b/js/plugins/JIF_MoveStaling.js @@ -0,0 +1,103 @@ +/*: + * @plugindesc (v.1) Adds the move staling mechanic into your game + * @author Jiffy + * + * @param damageDecreaseIncrement + * @desc The increment damage is decreased by (Ex. For a 10% decrease -> .1)| Default:.1 + * @default .1 + * + * @help + * Jiffy's Move Staling Plugin + * =========================================================================== + * Inspired by the mechanic by the same name from the Super Smash Bros. Series, + * staling will decrease the amount of damage a move does if it is used + * repeatedly. This will discourage the spamming of the same move and will + * add another layer of complexity to your combat system. + * =========================================================================== + * Parameter Explanation + * =========================================================================== + * damageDecreaseIncrement: + * This parameter changes the increment of which your damage is decreased by. + * For example: If I set this to .1, the damage will decrease by 10% each time + * time it is used in a row. + * =========================================================================== + * Thanks for reading! If you have any questions regarding this plugin, feel + * free to DM me on RPGMakerWeb! + * + * Thanks again + * - Jiffy +*/ + +//Param Setup +var JIF = JIF || {}; + var params = PluginManager.parameters('JIF_MoveStaling'); + + JIF.modifier = String(params['damageDecreaseIncrement']); +// + +JIF.arr = []; +JIF.tempCount = 0; + + +Game_Action.prototype.makeDamageValue = function(target, critical) { + var item = this.item(); + var baseValue = this.evalDamageFormula(target); + var value = baseValue * this.calcElementRate(target); + if (this.isPhysical()) { + value *= target.pdr; + } + if (this.isMagical()) { + value *= target.mdr; + } + if (baseValue < 0) { + value *= target.rec; + } + if (critical) { + value = this.applyCritical(value); + } + value = this.applyVariance(value, item.damage.variance); + value = this.applyGuard(value, target); + value = Math.round(value); + if(JIF.arr.length > 2) + { + if(JIF.arr[JIF.arr.length - 2].item().name !== this.item().name) + { + JIF.tempCount = 0; + for(var i = 0; i < JIF.arr.length; i++) + { + if(JIF.arr[i].item().name !== this.item().name) { + JIF.arr = JIF.arr.slice(i, 1); + } + } + } + } + JIF.tempCount = 0; + for(var i = 0; i < JIF.arr.length; i++) + { + if(JIF.arr[i].item().name === this.item().name) + { + JIF.tempCount++; + } + } + //console.log(tempCount); + //console.log(value - (value * (modifier * tempCount))); + JIF.arr.push(this); + return Math.floor(value - (value * (JIF.modifier * JIF.tempCount))); +}; + +BattleManager.startAction = function() { + var subject = this._subject; + var action = subject.currentAction(); + var targets = action.makeTargets(); + //console.log(action); + //console.log(subject); + + + this._phase = 'action'; + this._action = action; + this._targets = targets; + subject.useItem(action.item()); + this._action.applyGlobal(); + this.refreshStatus(); + this._logWindow.startAction(subject, action, targets); +}; \ No newline at end of file diff --git a/js/plugins/MOG_TrPopUpBattle.js b/js/plugins/MOG_TrPopUpBattle.js new file mode 100644 index 0000000..11e3adc --- /dev/null +++ b/js/plugins/MOG_TrPopUpBattle.js @@ -0,0 +1,356 @@ +//============================================================================= +// MOG_TrPopUpBattle.js +//============================================================================= + +/*: + * @plugindesc (v1.0) Apresenta os ícones dos tesouros após o inimigo morrer. + * @author Moghunter + * + * @param Drop Item Real Time + * @desc Ganhar o item em tempo real. + * @default true + * + * @param Animation Type + * @desc Tipo de animação. + * 0 - Bouncing 1 - Floating + * @default 0 + * + * @param Fade Duration + * @desc Tempo para fazer o item desaparecer. + * @default 20 + * + * @param Scale + * @desc Tamanho do ícone do tesouro. + * @default 0.8 + * + * @help + * ============================================================================= + * +++ MOG Treasure PopUp Battle (v1.0) +++ + * By Moghunter + * https://atelierrgss.wordpress.com/ + * ============================================================================= + * Apresenta os ícones dos tesouros após o inimigo morrer. + * + */ + +//============================================================================= +// ** PLUGIN PARAMETERS +//============================================================================= + +//============================================================================= +// ** PLUGIN PARAMETERS +//============================================================================= +  var Imported = Imported || {}; +  Imported.MOG_TrPopUpBattle = true; +  var Moghunter = Moghunter || {}; + +  Moghunter.parameters = PluginManager.parameters('MOG_TrPopUpBattle'); + Moghunter.trPopup_animation = Number(Moghunter.parameters['Animation Type'] || 0); + Moghunter.trPopup_scale = Number(Moghunter.parameters['Scale'] || 0.8); + Moghunter.trPopup_fadeDuration = Number(Moghunter.parameters['Fade Duration'] || 20); + Moghunter.trPopup_dropRealTime = String(Moghunter.parameters['Drop Item Real Time'] || 'false'); + +//============================================================================= +// ** Game Temp +//============================================================================= + +//============================== +// * Initialize +//============================== +var _mog_trPopBattle_tempInitialize = Game_Temp.prototype.initialize; +Game_Temp.prototype.initialize = function() { + _mog_trPopBattle_tempInitialize.call(this); + this._trBatNeedPopUp = false; + this._trBatRealTimeDrop = (Moghunter.trPopup_dropRealTime) == 'true' ? true : false; + this._trBatDropLock = false; +}; + +//============================================================================= +// ** Game Enemy +//============================================================================= +var _mog_trPopBattle_gEnemy_initMembers = Game_Enemy.prototype.initMembers; +Game_Enemy.prototype.initMembers = function() { + _mog_trPopBattle_gEnemy_initMembers.call(this); + this._treasure = {}; + this._treasure.needPopup = false; + this._treasure.checked = false; + this._treasure.item = []; +}; + +//============================== +// * make Drop Items +//============================== +Game_Enemy.prototype.makeDropItems = function() { + if (this._treasure.checked) { + return this._treasure.item; + } else { + return this.enemy().dropItems.reduce(function(r, di) { + if (di.kind > 0 && Math.random() * di.denominator < this.dropItemRate()) { + return r.concat(this.itemObject(di.kind, di.dataId)); + } else { + return r; + } + }.bind(this), []); + }; +}; + +//============================================================================= +// ** Battle Manager +//============================================================================= + +//============================== +// * gain Drip Items +//============================== +var _mog_BMangr_gainDropItems = BattleManager.gainDropItems; +BattleManager.gainDropItems = function() { + if ($gameTemp._trBatDropLock) {return}; + _mog_BMangr_gainDropItems.call(this); +}; + +//============================================================================= +// ** Scene Map +//============================================================================= + +//============================== +// * Initialize +//============================== +var _mog_trPopup_scMap_initialize = Scene_Map.prototype.initialize; +Scene_Map.prototype.initialize = function() { + $gameTemp._trBatDropLock = false; + _mog_trPopup_scMap_initialize.call(this) +}; + +//============================================================================= +// ** Sprite Enemy +//============================================================================= + +//============================== +// * Update Collapse +//============================== +var _mog_trPopBattle_sprEnemy_updateCollapse = Sprite_Enemy.prototype.updateCollapse; +Sprite_Enemy.prototype.updateCollapse = function() { + _mog_trPopBattle_sprEnemy_updateCollapse.call(this); + if (this._effectDuration === 0 && !this._enemy._treasure.checked) {this.checkTreasurePopup()}; +}; + +//============================== +// * Update Boss Collapse +//============================== +var _mog_trPopBattle_sprEnemy_updateBossCollapse = Sprite_Enemy.prototype.updateBossCollapse; +Sprite_Enemy.prototype.updateBossCollapse = function() { + _mog_trPopBattle_sprEnemy_updateBossCollapse.call(this); + if (this._effectDuration === 0 && !this._enemy._treasure.checked) {this.checkTreasurePopup()}; +}; + +//============================== +// * Update Instant Collapse +//============================== +var _mog_trPopBattle_sprEnemy_updateInstantCollapse = Sprite_Enemy.prototype.updateInstantCollapse; +Sprite_Enemy.prototype.updateInstantCollapse = function() { + _mog_trPopBattle_sprEnemy_updateInstantCollapse.call(this); + if (this._effectDuration === 0 && !this._enemy._treasure.checked) {this.checkTreasurePopup()}; +}; + +//============================== +// * check Treasure Popup +//============================== +Sprite_Enemy.prototype.checkTreasurePopup = function() { + this._enemy._treasure.item = this._enemy.makeDropItems(); + this._enemy._treasure.checked = true; + if (this._enemy._treasure.item) { + this._enemy._treasure.needPopup = true; + $gameTemp._trBatNeedPopUp = true; + }; +}; + +//============================================================================= +// ** Spriteset Battle +//============================================================================= + +//============================== +// * create Enemies +//============================== +var _mog_trPopupBat_sprBat_update = Spriteset_Battle.prototype.update; +Spriteset_Battle.prototype.update = function() { + _mog_trPopupBat_sprBat_update.call(this); + if ($gameTemp._trBatNeedPopUp) {this.treasurePopupR()}; +}; + +//============================== +// * create Enemies +//============================== +Spriteset_Battle.prototype.treasurePopupR = function() { + $gameTemp._trBatNeedPopUp = false; + if (!this._enemiesTreasure) {this._enemiesTreasure = []}; + for (var i = 0; i < this._enemySprites.length; i++) { + if (this._enemySprites[i]._enemy && this._enemySprites[i]._enemy._treasure.needPopup) { + this._enemySprites[i]._enemy._treasure.needPopup = false; + this._enemiesTreasure[i] = new SpriteEnemyTrP(this._enemySprites[i]); + this._enemiesTreasure[i].z = this._enemySprites[i].z ? this._enemySprites[i].z + 1 : 2; + this._battleField.addChild(this._enemiesTreasure[i]); + }; + }; +}; + +//============================================================================= +// * Sprite Enemy TrP +//============================================================================= +function SpriteEnemyTrP() { + this.initialize.apply(this, arguments); +}; + +SpriteEnemyTrP.prototype = Object.create(Sprite.prototype); +SpriteEnemyTrP.prototype.constructor = SpriteEnemyTrP; + +//============================== +// * Initialize +//============================== +SpriteEnemyTrP.prototype.initialize = function(sprite) { + Sprite.prototype.initialize.call(this); + this._sprite = sprite; + this._mode = Moghunter.trPopup_animation; + this.visible = false; + this._enemy = this._sprite._enemy; + this.createIcon(); + if ($gameTemp._trBatRealTimeDrop) { + $gameTemp._trBatDropLock = true; + this.gainDropItems(); + }; +}; + +//============================== +// * Initialize +//============================== +SpriteEnemyTrP.prototype.gainDropItems = function() { + var items = this._enemy._treasure.item; + items.forEach(function(item) { + $gameParty.gainItem(item, 1); + }); +}; + +//============================== +// * create Icon +//============================== +SpriteEnemyTrP.prototype.createIcon = function() { + this._iconImg = ImageManager.loadSystem("IconSet") + this._icons = []; + for (var i = 0; i < this._enemy._treasure.item.length; i++) { + var item = this._enemy._treasure.item[i]; + if (item) { + this._icons[i] = new Sprite(this._iconImg) + this._icons[i].item = item; + this._icons[i].index = i; + this._icons[i].anchor.x = 0.5; + this._icons[i].anchor.y = 1; + this.refreshIcons(this._icons[i]); + this.addChild(this._icons[i]); + }; + }; + this._icons.sort(function(a, b){return b.intY-a.intY}); + this.children.sort(function(a, b){return b.intY-a.intY}); + for (var i = 0; i < this._icons.length; i++) { + this.refreshWait(this._icons[i],i,this._icons.length); + }; +}; + +//============================== +// * refresh Wait +//============================== +SpriteEnemyTrP.prototype.refreshWait = function(sprite,index,maxv) { + var mv = maxv * 20; + var mvt = mv - (20 * index) + sprite.wait = Moghunter.trPopup_fadeDuration + mvt; +}; + +//============================== +// * refresh Icons +//============================== +SpriteEnemyTrP.prototype.refreshIcons = function(sprite) { + var w = Window_Base._iconWidth; + var h = Window_Base._iconHeight; + var iconindex = sprite.item.iconIndex; + var sx = iconindex % 16 * w; + var sy = Math.floor(iconindex / 16) * h; + var hr = Math.randomInt(h); + sprite.setFrame(sx,sy,w,h); + sprite.intY = ((this._sprite.height / 3) + hr) - h; + sprite.dr = 60; + sprite.dy = 15; + sprite.y = -40; + sprite.ry = sprite.y + sprite.intY; + var randx = (Math.random() * 0.5) + (sprite.index / 8); + var rands = Math.randomInt(2); + sprite.sx = rands === 0 ? randx : -randx; + sprite.scale.x = Moghunter.trPopup_scale; + sprite.scale.y = sprite.scale.x; +}; + +//============================== +// * Update Bounce +//============================== +SpriteEnemyTrP.prototype.updateBounce = function(sprite) { + sprite.dy += 0.6; + sprite.ry += sprite.dy; + if (sprite.ry >= 0) { + sprite.ry = 0; + sprite.dy *= -0.7; + }; + sprite.y = -sprite.intY + Math.round(sprite.ry); + if (sprite.y < -sprite.intY) {sprite.x += sprite.sx}; + if (sprite.y === -sprite.intY) {this.updateFade(sprite)}; +}; + +//============================== +// * Update Float +//============================== +SpriteEnemyTrP.prototype.updateFloat= function(sprite) { + sprite.wait--; + if (sprite.wait > 0) {return}; + sprite.y -= 3 + sprite.opacity -= 8; +}; + +//============================== +// * Update Animation +//============================== +SpriteEnemyTrP.prototype.updateAnimation= function(sprite) { + if (this._mode === 1) { + this.updateFloat(sprite); + } else { + this.updateBounce(sprite); + }; +}; + +//============================== +// * Update Fade +//============================== +SpriteEnemyTrP.prototype.updateFade = function(sprite) { + sprite.wait--; + if (sprite.wait > 0) {return}; + sprite.opacity -= 15; + sprite.scale.x -= 0.05 + sprite.scale.y += 0.15 +}; + +//============================== +// * Update Sprites +//============================== +SpriteEnemyTrP.prototype.updateSprites = function(sprite) { + this.visible = true; + this.updateAnimation(sprite); + if (sprite.opacity <= 0) {sprite.visible = false}; +}; + +//============================== +// * Update +//============================== +SpriteEnemyTrP.prototype.update = function() { + Sprite.prototype.update.call(this); + this.x = this._sprite.x; + this.y = this._sprite.y; + if (this._iconImg.isReady()) { + for (var i = 0; i < this._icons.length; i++) { + if (this._icons[i].visible) {this.updateSprites(this._icons[i])}; + }; + }; +}; \ No newline at end of file diff --git a/js/plugins/SRD_HUDMaker.js b/js/plugins/SRD_HUDMaker.js new file mode 100644 index 0000000..f6ac47f --- /dev/null +++ b/js/plugins/SRD_HUDMaker.js @@ -0,0 +1,3853 @@ +/*: + * @plugindesc Allows developers to create their own map-based HUD through an in-game GUI window! + * @author SumRndmDde + * + * @param Active Updating + * @desc If 'true', then HUD pieces will automatically update whenever properties are changed in the editor. + * @default false + * + * @param Show During Events + * @desc Sets what happens to the HUD during event processing. + * Choices are: hide - show - transparent + * @default transparent + * + * @param Map Global Condition + * @desc This is a condition that must be true for the map HUD to be visible and active. + * @default + * + * @param Battle Global Condition + * @desc This is a condition that must be true for the battle HUD to be visible and active. + * @default + * + * @param Disable Delete Key + * @desc If 'true', the Delete key will no longer delete the currently highlighted piece. + * @default true + * + * @help + * + * HUD Maker + * Version 1.43 + * SumRndmDde + * + * + * This plugin allows developers to create their own map-based HUD through + * an in-game GUI window! + * + * + * ============================================================================== + * Image Installation + * ============================================================================== + * + * All HUD images must be placed in: + * + * /img/SumRndmDde/hud/ + * + * + * They need to be segmented into four folders: + * - pictures + * - numbers + * - gauge_images + * - gauge_backs + * + * + * Each folder will be used to hold images for the corresponding pieces: + * - Picture + * - Image Numbers + * - Image Gauge + * + * + * ============================================================================== + * End of Help File + * ============================================================================== + * + * Welcome to the bottom of the Help file. + * + * + * Thanks for reading! + * If you have questions, or if you enjoyed this Plugin, please check + * out my YouTube channel! + * + * https://www.youtube.com/c/SumRndmDde + * + * + * Until next time, + * ~ SumRndmDde + * + */ + +var SRD = SRD || {}; +SRD.HUDMaker = SRD.HUDMaker || {}; +SRD.NotetagGetters = SRD.NotetagGetters || []; + +var Imported = Imported || {}; +Imported["SumRndmDde HUD Maker"] = 1.43; + +var $dataMapHUD = []; +var $dataBattleHUD = []; + +function MapHUD() { + this.initialize.apply(this, arguments); +} + +function BattleHUD() { + this.initialize.apply(this, arguments); +} + +function HUDManager() { + throw new Error('Lol, what are you doing? HUDManager is a static class. Noob.'); +} + +(function(_) { + +"use strict"; + +//----------------------------------------------------------------------------- +// SRD.HUDMaker +//----------------------------------------------------------------------------- + +_.isV150 = Utils.RPGMAKER_VERSION && Utils.RPGMAKER_VERSION >= '1.5.0'; + +_.alertNeedSuperToolsEngine = function(update) { + if(update) { + alert("The 'SRD_SuperToolsEngine' needs to be version 1.12 or greater to use the 'SRD_HUDMaker' plugin."); + } else { + alert("The 'SRD_SuperToolsEngine' plugin is required for using the 'SRD_HUDMaker' plugin."); + } + if(confirm("Do you want to open the download page to 'SRD_SuperToolsEngine'?")) { + window.open('http://sumrndm.site/super-tools-engine/'); + } +}; + +if(!Imported["SumRndmDde Super Tools Engine"]) { + _.alertNeedSuperToolsEngine(false); + return; +} else if(Imported["SumRndmDde Super Tools Engine"] < 1.12) { + _.alertNeedSuperToolsEngine(true); + return; +} + +const params = PluginManager.parameters('SRD_HUDMaker'); + +_.active = String(params['Active Updating']).trim().toLowerCase() === 'true'; + +_.duringEvents = String(params['Show During Events']).trim().toLowerCase(); + +_.mapCondition = String(params['Map Global Condition']); +_.battleCondition = String(params['Battle Global Condition']); + +_.deleteKey = !String(params['Disable Delete Key']).trim().toLowerCase() === 'true'; + +_.isPlaytest = SRD.SuperToolsEngine.isPlaytest; +_.mapFile = "MapHUD.json"; +_.battleFile = "BattleHUD.json"; + +_.trueColor = '#82f2be'; +_.falseColor = '#f18181'; + +_.relativeColor = '#3385ff'; +_.globalColor = '#e67300'; + +_.overlayColor = '#cc3399'; +_.surrondColor = '#669900'; + +_.pad = function(value) { + return (value < 10) ? "0" + value : value; +}; + +_.convertHex = function(hex, opacity){ + hex = hex.replace('#',''); + const r = parseInt(hex.substring(0,2), 16); + const g = parseInt(hex.substring(2,4), 16); + const b = parseInt(hex.substring(4,6), 16); + return 'rgba(' + r + ',' + g + ',' + b + ',' + opacity/255 + ')'; +}; + +_.blendNames = [ + "Normal", + "Add", + "Multiply", + "Screen", + "Overlay", + "Darken", + "Lighten", + "Color Dodge", + "Color Burn", + "Hard Light", + "Soft Light", + "Difference", + "Exclusion", + "Hue", + "Saturation", + "Color", + "Luminosity" +]; + +_.getPicture = function(filename, hue) { + return ImageManager.loadBitmap('img/SumRndmDde/hud/pictures/', filename, hue, false); +}; + +_.getGauge = function(filename, hue) { + return ImageManager.loadBitmap('img/SumRndmDde/hud/gauge_images/', filename, hue, false); +}; + +_.getGaugeBack = function(filename, hue) { + return ImageManager.loadBitmap('img/SumRndmDde/hud/gauge_backs/', filename, hue, false); +}; + +_.getNumbers = function(filename, hue) { + return ImageManager.loadBitmap('img/SumRndmDde/hud/numbers/', filename, hue, false); +}; + +_.saveData = function() { + if(SceneManager._scene.constructor === Scene_Map) { + FileManager.saveData($dataMapHUD, _.mapFile); + } else { + FileManager.saveData($dataBattleHUD, _.battleFile); + } +}; + +_.checkDataExists = function() { + if(!_.isPlaytest) return; + FileManager.checkDataExists(_.mapFile); + FileManager.checkDataExists(_.battleFile); +}; + +_.getFileList = function(folder) { + if(!_.isPlaytest) return ''; + return FileManager.getFileList('hud', folder); +}; + +_.getFirstFile = function(folder) { + if(!_.isPlaytest) return ''; + return FileManager.getFirstFile('hud', folder); +}; + +_.checkDataExists(); + +_.checkForCC = function() { + if(Imported["SumRndmDde Character Creator"] || Imported["SumRndmDde Character Creator EX"]) { + Sprite_HUDFace.prototype.refreshBitmap = function() { + this.bitmap.clear(); + const color = _.convertHex(this["Background Color"], parseInt(this["Background Alpha"])); + this.bitmap.fillRect(0, 0, this.bitmap.width, this.bitmap.height, color); + if(this._actor.hasSetImage()) { + this.drawCustomFace(this._actor, 0, 0, this.bitmap.width, this.bitmap.height); + } else { + this.drawFace(this._actor.faceIndex(), parseInt(this["Width"]), parseInt(this["Height"])); + } + this.setupSnaps(); + }; + + Sprite_HUDFace.prototype.drawCustomFace = function(actor, x, y, w, h) { + const width = Window_Base._faceWidth; + const height = Window_Base._faceHeight; + w = w || width; + h = h || height; + const bitmap = Window_Base.prototype.getCustomFace.call(this, actor); + this.bitmap.blt(bitmap, 0, 0, width, height, x, y, w, h); + }; + } +} + +SRD.NotetagGetters.push(_.checkForCC); + +//----------------------------------------------------------------------------- +// Bitmap +//----------------------------------------------------------------------------- + +Bitmap.prototype.drawOval = function(x, y, width, height, color) { + const context = this._context; + context.save(); + context.beginPath(); + context.ellipse(x, y, width, height, 0, 0, Math.PI*2); + context.fillStyle = color; + context.fill(); + context.restore(); + this._setDirty(); +}; + +//----------------------------------------------------------------------------- +// WindowLayer +//----------------------------------------------------------------------------- + +_.WindowLayer_update = WindowLayer.prototype.update; +WindowLayer.prototype.update = function() { + if($gameTemp.isManipulatingHud) return; + _.WindowLayer_update.apply(this, arguments); +}; + +//----------------------------------------------------------------------------- +// MapHUD +//----------------------------------------------------------------------------- + +MapHUD.prototype = Object.create(Stage.prototype); +MapHUD.prototype.constructor = MapHUD; + +Object.defineProperty(MapHUD.prototype, 'opacity', { + get: function() { + return this.alpha * 255; + }, + set: function(value) { + this.alpha = value.clamp(0, 255) / 255; + }, + configurable: true +}); + +MapHUD.prototype.initialize = function() { + Stage.prototype.initialize.call(this); + this._isActive = false; + this.createHighlight(); +}; + +MapHUD.prototype.createHighlight = function() { + this._highlight = new Sprite_HUDCursor(); + this.addChild(this._highlight); +}; + +MapHUD.prototype.getHighlight = function() { + return this._highlight; +}; + +MapHUD.prototype.update = function() { + this.updateActivity(); + if(this._isActive || $gameTemp.isManipulatingHud) { + this.updateChildren(); + if($gameMap && $gameTemp) { + this.updateVisibility(); + } + if($gameTemp.isManipulatingHud) { + this.updateEditor(); + } + } +}; + +MapHUD.prototype.updateActivity = function() { + try { + if(_.mapCondition) { + this._isActive = !!eval(_.mapCondition); + } else { + this._isActive = true; + } + } catch(e) { + this._isActive = true; + console.log("Map HUD ERROR:" + e); + } + this.visible = this._isActive || $gameTemp.isManipulatingHud; +}; + +MapHUD.prototype.updateVisibility = function() { + if($gameTemp.isManipulatingHud) return; + if($gameMap.isEventRunning()) { + switch(_.duringEvents) { + case 'transparent': + if(!this.cacheAsBitmap) this.cacheAsBitmap = true; + if(this.opacity > 150) this.opacity -= 10; + break; + case 'hide': + if(this.opacity > 0) this.opacity -= 10; + break; + } + } else { + switch(_.duringEvents) { + case 'transparent': + if(this.cacheAsBitmap) this.cacheAsBitmap = false; + case 'hide': + if(this.opacity < 255) this.opacity += 10; + break; + } + } +}; + +MapHUD.prototype.updateChildren = function() { + this.children.forEach(function(child) { + if (child.update) { + child.update(); + } + }); +}; + +MapHUD.prototype.updateEditor = function() { + if(TouchInput.isReleased()) { + this.refresh(); + } +}; + +MapHUD.prototype.refresh = function() { + this._sortChildren(); +}; + +MapHUD.prototype._sortChildren = function() { + this.children.sort(this._compareChildOrder.bind(this)); + this.removeChild(this._highlight); + this.addChildAt(this._highlight, this.children.indexOf(HUDManager.getSprite()) + 1); +}; + +MapHUD.prototype._compareChildOrder = function(a, b) { + if (a.z !== b.z) { + return a.z - b.z; + } else if (a.y !== b.y) { + return a.y - b.y; + } else { + return a.spriteId - b.spriteId; + } +}; + +//----------------------------------------------------------------------------- +// BattleHUD +//----------------------------------------------------------------------------- + +BattleHUD.prototype = Object.create(MapHUD.prototype); +BattleHUD.prototype.constructor = BattleHUD; + +BattleHUD.prototype.updateActivity = function() { + try { + if(_.battleCondition) { + this._isActive = !!eval(_.battleCondition); + } else { + this._isActive = true; + } + } catch(e) { + this._isActive = true; + console.log("Battle HUD ERROR:" + e); + } + this.visible = this._isActive || $gameTemp.isManipulatingHud; +}; + +BattleHUD.prototype.updateVisibility = function() { + if($gameTemp.isManipulatingHud) return; + if($gameTroop.isEventRunning()) { + switch(_.duringEvents) { + case 'transparent': + if(!this.cacheAsBitmap) this.cacheAsBitmap = true; + if(this.opacity > 150) this.opacity -= 10; + break; + case 'hide': + if(this.opacity > 0) this.opacity -= 10; + break; + } + } else { + switch(_.duringEvents) { + case 'transparent': + if(this.cacheAsBitmap) this.cacheAsBitmap = false; + case 'hide': + if(this.opacity < 255) this.opacity += 10; + break; + } + } +}; + +//----------------------------------------------------------------------------- +// DataManager +//----------------------------------------------------------------------------- + +DataManager._testExceptions.push(_.mapFile, _.battleFile); + +DataManager._databaseFiles.push( + {name: '$dataMapHUD', src: _.mapFile}, + {name: '$dataBattleHUD', src: _.battleFile} +); + +if(!SRD.DataManager_isDatabaseLoaded) { + +SRD.notetagsLoaded = false; +SRD.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded; +DataManager.isDatabaseLoaded = function() { + if(!SRD.DataManager_isDatabaseLoaded.apply(this, arguments)) return false; + if(!SRD.notetagsLoaded) { + SRD.NotetagGetters.forEach(function(func) { + func.call(this); + }, this); + SRD.notetagsLoaded = true; + } + return true; +}; + +} + +//----------------------------------------------------------------------------- +// SceneManager +//----------------------------------------------------------------------------- + +_.SceneManager_onKeyDown = SceneManager.onKeyDown; +SceneManager.onKeyDown = function(event) { + _.SceneManager_onKeyDown.apply(this, arguments); + if($gameTemp && $gameTemp.isManipulatingHud) { + this.onKeyDownHUDMaker(event); + } +}; + +SceneManager.onKeyDownHUDMaker = function(event) { + if(!event.ctrlKey && event.keyCode === 46) { + // Delete + if(_.deleteKey && HUDManager._currentId >= 0) { + HUDManager.onDelete(); + } + } else if(event.ctrlKey && event.keyCode === 83) { + // Save + if(!_.active && HUDManager._currentId >= 0) { + HUDManager.refreshSprite(); + } + } +}; + +//----------------------------------------------------------------------------- +// BattleManager +//----------------------------------------------------------------------------- + +_.BattleManager_isBusy = BattleManager.isBusy; +BattleManager.isBusy = function() { + return _.BattleManager_isBusy.apply(this, arguments) || $gameTemp.isManipulatingHud; +}; + +//----------------------------------------------------------------------------- +// MakerManager +//----------------------------------------------------------------------------- + +_.MakerManager_onFinish = MakerManager.onFinish; +MakerManager.onFinish = function() { + _.MakerManager_onFinish.apply(this, arguments); + if(this.mode === 'hud') { + HUDManager.onFinish(); + } +}; + +_.MakerManager_assignWindow = MakerManager.assignWindow; +MakerManager.assignWindow = function() { + _.MakerManager_assignWindow.apply(this, arguments); + this.window.window.HUDManager = HUDManager; +}; + +_.MakerManager_getLauncherButtonsRaw = MakerManager.getLauncherButtonsRaw; +MakerManager.getLauncherButtonsRaw = function() { + const result = _.MakerManager_getLauncherButtonsRaw.apply(this, arguments); + result.push(`${this.generateLauncherRow("HUD Maker", "Allows developers to create their own map-based HUD through an in-game GUI window.", "HUDManager.setupWindowHtml()", "#cca300")}`); + return result; +}; + +//----------------------------------------------------------------------------- +// HUDManager +//----------------------------------------------------------------------------- + +HUDManager.typeNames = []; +HUDManager.types = {}; +HUDManager.nextId = 1; +HUDManager.showPiecesType = true; + +HUDManager.setup = function(data, hud) { + this._sprites = []; + this._data = data; + this._hud = hud; + this._currentId = -1; + this.setupData(); + this.refreshLayers(); +}; + +HUDManager.setupData = function() { + for(let i = 0; i < this._data.length; i++) { + const data = this._data[i]; + if(!data) continue; + this.rebuildSprite(data, i); + if(data.id >= this.nextId) { + this.nextId = data.id + 1; + } + } +}; + +HUDManager.rebuildSprite = function(data, i) { + let sprite = this.getRebuildSprite(data); + sprite._originalX = data.x; + sprite._originalY = data.y; + sprite.setHighlight(this.getHighlight()); + this._hud.addChild(sprite); + this._sprites[i] = sprite; +}; + +HUDManager.getRebuildSprite = function(data) { + const type = this.types[data.type]; + if(type) { + return new type.class(data); + } else { + return null; + } +}; + +HUDManager.createWindow = function() { + this.initHudMaker(); + MakerManager.window.focus(); +}; + +HUDManager.getSprites = function() { + return this._sprites; +}; + +HUDManager.getSprite = function() { + return this._sprites[this._currentId]; +}; + +HUDManager.getData = function() { + return this._data[this._currentId]; +}; + +HUDManager.refreshLayers = function() { + this._hud.refresh(); +}; + +HUDManager.getSpritesOnLayer = function(layer) { + const result = []; + this._sprites.forEach(function(sprite) { + if(sprite.z === layer) { + result.push(sprite.y); + } + }, this); + return result; +}; + +HUDManager.refreshHighlightZ = function() { + const sprite = this.getSprite(); + if(sprite) { + this.getHighlight().z = sprite.z; + this.refreshLayers(); + } +}; + +HUDManager.initHudMaker = function() { + this._currentId = 0; + this.refreshChoices(); + this.onChange(); +}; + +HUDManager.onChange = function() { + if(!MakerManager.window) return; + const doc = MakerManager.document; + const id = parseInt(doc.getElementById('choices').value); + if(!id && id !== 0) { + doc.getElementById('settings').innerHTML = this.getBlankTableHtml(); + return; + } + this.onChangeProperties(id); + this._currentId = id; + this.refreshHighlight(); +}; + +HUDManager.onChangeProperties = function(id) { + const data = this._data[id]; + MakerManager.document.getElementById('settings').innerHTML = this.getTableHtml(data); +}; + +HUDManager.onAnimateChange = function() { + if(!MakerManager.window) return; + const id = parseInt(MakerManager.document.getElementById('choices').value); + this._currentId = id; + this.setupAnimator(); + this.refreshHighlight(); +}; + +HUDManager.getTableHtml = function(data) { + const type = this.types[data.type]; + if(type) { + return type.html(data); + } else { + return this.getBlankTableHtml(); + } +}; + +HUDManager.getHighlight = function() { + return this._hud.getHighlight(); +}; + +HUDManager.refreshHighlight = function() { + this._sprites.forEach(function(sprite) { + sprite.cancelAsTarget(); + }); + if(this._currentId || this._currentId === 0) { + const spr = this.getSprite(); + if(spr) { + spr.setAsTarget(); + this.getHighlight().setup(spr); + } else { + this.getHighlight().setup(null); + } + } + this.refreshHighlightZ(); +}; + +HUDManager.onCreate = function() { + if(!MakerManager.window) return; + const createType = String(MakerManager.document.getElementById('createSelect').value); + this.createNew(createType); + this.onChange(); +}; + +HUDManager.createNew = function(kind) { + const type = this.types[kind]; + if(!type) return; + const data = JsonEx.makeDeepCopy(type.data); + data.animateInfo = HUDManager.getAnimateInfo(); + const sprite = new type.class(data); + this._data.push(data); + this.setupNewSprite(sprite); + this.refreshChoices(); +}; + +HUDManager.getAnimateInfo = function() { + const data = {}; + data.x = { + spd: 0, + loop: false, + min: 0, + max: 0 + }; + data.y = { + spd: 0, + loop: false, + min: 0, + max: 0 + }; + data.s = { + spd: 0, + loop: false, + min: 1, + max: 1 + }; + data.r = { + spd: 0, + loop: false, + min: 0, + max: 0 + }; + return data; +}; + +HUDManager.setupNewSprite = function(sprite) { + sprite._originalX = Graphics.boxWidth / 2; + sprite._originalY = Graphics.boxHeight / 2; + sprite.setHighlight(this.getHighlight()); + this._hud.addChild(sprite); + this._sprites.push(sprite); + this._currentId = this._sprites.length - 1; + this.refreshCurrentId(); + this.getData().id = this.nextId; + this.nextId++; +}; + +HUDManager.refreshCurrentId = function() { + if(this._sprites.length > 0) { + for(let i = this._currentId; i >= 0; i--) { + const s = this._sprites[i]; + if(s && s._isActive) { + this._currentId = i; + return; + } + } + for(let i = this._currentId; i < this._sprites.length; i++) { + const s = this._sprites[i]; + if(s && s._isActive) { + this._currentId = i; + return; + } + } + for(let i = 0; i < this._sprites.length; i++) { + const s = this._sprites[i]; + if(s && s._isActive) { + this._currentId = i; + return; + } + } + } +}; + +HUDManager.refreshChoices = function() { + if(!MakerManager.window) return; + const doc = MakerManager.document; + let result = ''; + for(let i = 0; i < this._data.length; i++) { + const data = this._data[i]; + const sprite = this._sprites[i]; + if(!this.showPiecesType && !sprite._isActive) continue; + let value = ''; + const type = this.types[data.type]; + if(type) { + value = type.format(data); + } + result += ""; + } + doc.getElementById('choices').innerHTML = result; + doc.getElementById('choices').value = String(this._currentId); +}; + +HUDManager.refreshSprite = function() { + if(!MakerManager.window) return; + const sprite = this.getSprite(); + const data = this.getData(); + const tempActive = sprite._isActive; + this.refreshSpriteAndData(sprite, data); + sprite.refresh(true); + sprite.update(); + this.refreshHighlight(); + this.refreshChoices(); + if(!this.showPiecesType) { + if(this._sprites.length > 0) { + this.refreshCurrentId(); + } else { + this._currentId = null; + this.getHighlight().setup(null); + } + this.refreshChoices(); + this.onChange(); + } + this.refreshLayers(); +}; + +HUDManager.refreshSpriteAndData = function(sprite, data) { + const props = sprite.properties; + for(let i = 0; i < props.length; i++) { + const prop = props[i]; + const value = String(MakerManager.document.getElementById(prop).value); + sprite[prop] = value; + data[prop] = value; + } +}; + +HUDManager.onDelete = function() { + const sprites = []; + const datas = []; + for(let i = 0; i < this._sprites.length; i++) { + if(this._currentId === i) { + this._sprites[i].cancelAsTarget(); + this._hud.removeChild(this._sprites[i]) + continue; + } + sprites.push(this._sprites[i]); + datas.push(this._data[i]); + } + this._sprites = sprites; + this._data = datas; + if(!this._sprites[this._currentId] || !this._sprites[this._currentId]._isActive) { + if(this._sprites.length > 0) { + this.refreshCurrentId(); + } else if(!this.showPiecesType) { + this._currentId = null; + this.getHighlight().setup(null); + } + } + if(this._sprites.length === 0) { + this._currentId = null; + this.getHighlight().setup(null); + } + this.refreshChoices(); + this.onChange(); +}; + +HUDManager.onClone = function() { + const data = JsonEx.makeDeepCopy(this.getData()); + const type = data.type; + this._data.push(data); + const sprite = new this.types[type].class(data); + this.setupNewSprite(sprite); + this.refreshChoices(); + this.onChange(); +}; + +HUDManager.onSnapToggle = function() { + const container = MakerManager.document.getElementById('SnapButton'); + const button = MakerManager.document.getElementById('snapButtonToggle'); + if(!this.snapMode) { + container.innerHTML = ``; + this.snapMode = true; + this.getSprite().setupSnaps(); + } else { + container.innerHTML = ``; + this.snapMode = false; + this.getSprite().setupSnaps(); + } +}; + +HUDManager.onHighToggle = function() { + const container = MakerManager.document.getElementById('HighButton'); + const button = MakerManager.document.getElementById('highButtonToggle'); + if(!this.highlightType) { + container.innerHTML = ``; + this.highlightType = true; + this.getHighlight().refreshColor(); + } else { + container.innerHTML = ``; + this.highlightType = false; + this.getHighlight().refreshColor(); + } +}; + +HUDManager.onShowToggle = function() { + const container = MakerManager.document.getElementById('ShowButton'); + const button = MakerManager.document.getElementById('showButtonToggle'); + if(this.showPiecesType) { + container.innerHTML = ``; + this.showPiecesType = false; + } else { + container.innerHTML = ``; + this.showPiecesType = true; + } + if(this._sprites.length > 0) { + this.refreshCurrentId(); + } else { + this._currentId = null; + this.getHighlight().setup(null); + } + this.refreshChoices(); + this.onChange(); +}; + +HUDManager.forceUpdateOptions = function() { + const container1 = MakerManager.document.getElementById('SnapButton'); + const container2 = MakerManager.document.getElementById('HighButton'); + const container3 = MakerManager.document.getElementById('ShowButton'); + if(this.snapMode) { + container1.innerHTML = ``; + } else { + container1.innerHTML = ``; + } + if(this.highlightType) { + container2.innerHTML = ``; + } else { + container2.innerHTML = ``; + } + if(!this.showPiecesType) { + container3.innerHTML = ``; + } else { + container3.innerHTML = ``; + } +}; + +HUDManager.onFinish = function() { + this._spriteTarget = null; + this.getHighlight().setup(null); + this._sprites.forEach(function(sprite) { + sprite.cancelAsTarget(); + }); + this.save(); + SceneManager._scene.endHud(); +}; + +HUDManager.save = function() { + for(let i = 0; i < this._sprites.length; i++) { + const spr = this._sprites[i]; + if(!spr) continue; + this._data[i].x = spr._originalX; + this._data[i].y = spr._originalY; + } + if(SceneManager._scene.constructor === Scene_Map) { + $dataMapHUD = JsonEx.makeDeepCopy(this._data); + } else { + $dataBattleHUD = JsonEx.makeDeepCopy(this._data); + } + _.saveData(); +}; + +HUDManager.setupAnimator = function() { + const doc = MakerManager.document; + const data = this.getData().animateInfo; + doc.getElementById('X').innerHTML = this.getAnimatorSection('X', data.x, 'X Offset'); + doc.getElementById('Y').innerHTML = this.getAnimatorSection('Y', data.y, 'Y Offset'); + doc.getElementById('Scale').innerHTML = this.getAnimatorSection('Scale', data.s); + doc.getElementById('Rotation').innerHTML = this.getAnimatorSection('Rotation', data.r); +}; + +HUDManager.onAnimateRefresh = function() { + if(!MakerManager.window) return; + const sprite = this.getSprite(); + const data = this.getData(); + this.refreshAnimationSpriteAndData(sprite, data); +}; + +HUDManager.refreshAnimationSpriteAndData = function(sprite, data) { + const props = sprite.properties; + const doc = MakerManager.document; + const titles = ['X', 'Y', 'Scale', 'Rotation']; + const ends = ['spd', 'min', 'max', 'loop']; + for(let i = 0; i < titles.length; i++) { + for(let j = 0; j < ends.length; j++) { + const code = titles[i] + " " + ends[j]; + const info = doc.getElementById(code).value; + const dataCode = titles[i].substring(0, 1).toLowerCase(); + if(j === 3) { + data.animateInfo[dataCode][ends[j]] = !!doc.getElementById(code).checked; + } else { + data.animateInfo[dataCode][ends[j]] = parseFloat(info); + } + } + } + this.getSprite().setupAnimationInfo(data.animateInfo); + this.getSprite().refresh(true); +}; + +HUDManager.returnToMaker = function() { + this.onFinish(); + MakerManager.setupWindowHtml(); +}; + +//----------------------------------------------------------------------------- +// HUDManager +//----------------------------------------------------------------------------- +// +HUDManager.createTitle = function(id, type) { + return `

(ID: ${id}) ${type} Element

`; +}; + +HUDManager.createHeader = function() { + return ` + Property + Value + `; +}; + +HUDManager.createInput = function(id, value) { + if(_.active) { + return ` + ${id}: + + `; + } else { + return ` + ${id}: + + `; + } +}; + +HUDManager.createConditionInput = function(id, value) { + let bool = true; + try { + if(value.length > 0) { + bool = eval(value); + } + } catch(e) { + console.log(value + " \n" + e); + alert("There is an error with \"" + value + "\" Press F8 to see more!"); + value = ''; + } + const color = (bool) ? _.trueColor : _.falseColor; + if(_.active) { + return ` + ${id}: + + `; + } else { + return ` + ${id}: + + `; + } +}; + +HUDManager.createSelect = function(id) { + let result = ` + ${id}: + `; + if(_.active) { + result += ``; + } + for(let i = 1; i < arguments.length; i++) { + const info = arguments[i]; + result += ''; + } + result += ` + + `; + return result; +}; + +HUDManager.createSelectArray = function(id, options) { + let result = ` + ${id}: + `; + if(_.active) { + result += ``; + } + for(let i = 0; i < options.length; i++) { + const info = options[i]; + result += ''; + } + result += ` + + `; + return result; +}; + +HUDManager.createColor = function(id, value, id2, value2) { + if(_.active) { + return ` + ${id}: +
+ Opacity: + `; + } else { + return ` + ${id}: +
+ Opacity: + `; + } +}; + +HUDManager.createFilelist = function(id, folder, value, includeNone) { + const files = _.getFileList(folder); + let select = ''; + let result = ` + ${id}: + `; + if(_.active) { + result += ``; + } + if(includeNone) { + if(value === "N\n\nONE") select = 'selected'; + else select = ''; + result += ''; + } + for(let i = 0; i < files.length; i++) { + const file = files[i]; + if(file === value) select = 'selected'; + else select = ''; + result += ''; + } + result += ` + + `; + return result; +}; + +//----------------------------------------------------------------------------- +// HUDManager +//----------------------------------------------------------------------------- + +HUDManager.getMakerHtml = function() { + const create = this.getHtmlCreateChart(); + const focus = this.getHtmlFocusChart(); + const options = this.getHtmlOptionsChart(); + + return `
+

+

+
+ +

+ ${create} +

+ ${focus} +

+ ${options} +

`; +}; + +HUDManager.getHtmlCreateChart = function() { + const options = HUDManager.getHtmlCreateChartOptions(); + return ` + + + + + + + + + +
Create New Element
+ +
`; +}; + +HUDManager.getHtmlFocusChart = function() { + return ` + + + + + + + + + + + + +
Element Manager
`; +}; + +HUDManager.getHtmlOptionsChart = function() { + return ` + + + + + + + + + +
Options
`; +}; + +HUDManager.getHtmlCreateChartOptions = function() { + let result = ''; + let select = 'selected'; + HUDManager.typeNames.forEach(function(name) { + result += ''; + select = ''; + }, this); + return result; +}; + +//----------------------------------------------------------------------------- +// HUDManager +//----------------------------------------------------------------------------- + +HUDManager.createRefresh = function() { + if(_.active) return ''; + return ` + Refresh: + + `; +}; + +HUDManager.getBlankTableHtml = function() { + return `

No Elements Exist!

+ + ${this.createHeader()} + ${this.createRefresh()} +
`; +}; + +HUDManager.setupWindowHtml = function() { + const scene = SceneManager._scene; + if(!Utils.RPGMAKER_VERSION || Utils.RPGMAKER_VERSION < '1.3.0') { + alert("HUD Maker requires your project to be at v1.3.0 or greater!"); + } else if(scene.constructor === Scene_Map || scene.constructor === Scene_Battle) { + MakerManager.style.innerHTML = this.getStyle(); + MakerManager.window.title = "Super Tools Engine - HUD Maker | SumRndmDde"; + MakerManager.mode = 'hud'; + this.setupMakerHtml(); + scene.startHud(); + } else { + alert("You must be on a map or in battle to use HUD Maker!") + } +}; + +HUDManager.topBar = function(type) { + const active = ['', '', '', '']; + active[type] = 'class="active"'; + return ``; +}; + +HUDManager.setupMakerHtml = function() { + MakerManager.document.body.innerHTML = this.topBar(0) + this.getMakerHtml(); + this.forceUpdateOptions(); + this.refreshChoices(); + this.onChange(); +}; + +HUDManager.setupAnimatorHtml = function() { + MakerManager.document.body.innerHTML = this.topBar(1) + this.getAnimatorHtml(); + this.setupAnimator(); + this.refreshChoices(); +}; + +HUDManager.setupControlsHtml = function() { + MakerManager.document.body.innerHTML = this.topBar(2) + this.getControlsHtml(); +}; + +HUDManager.getAnimatorHtml = function() { + return `

+ Current Element:

+ +

+

+

+

+

+

+

+ +

+

+

+

+

+

`; +}; + +HUDManager.getAnimatorSection = function(type, data, name) { + name = name || type; + const chk = (data.loop) ? 'checked' : ''; + return `

${name}

+ + + + + + + + + + + + + + + + + + + + + +
PropertyValue
Speed:
Start:
End:
Loop:
`; +}; + +HUDManager.getControlsHtml = function() { + return `

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
InputDescription
Left-ClickWhile holding Left-Click, one can drag the HUD pieces around on the main screen.
CTRLWhile holding CTRL, all snapping will be disabled when moving HUD pieces.
ZWhile holding Z, the HUD piece will be locked to its current X coordinate.
XWhile holding X, the HUD piece will be locked to its current Y coordinate.
Arrow KeysCan be used to precisely place the HUD pieces in their desired locations; moves the selected piece 1 pixel in a specific direction.
Arrow Keys + SHIFTMoves the HUD pieces in intervals of 10 pixels.
DeleteDeletes the currently selected HUD piece.
CTRL + SSaves the current piece's settings and refreshes it on the main window.
+

`; +}; + +HUDManager.getStyle = function() { + const colors = MakerManager.colors; + const textColor = colors[0]; + const baseColor = colors[1]; + const hoverColor = colors[2]; + const borderColor = colors[3]; + const backgroundColor = colors[4]; + const topMenuHighlight = colors[6]; + const tableBorder = colors[8]; + const offgridColor = colors[9]; + const gridHoverColor = colors[10]; + const buttonShadow = colors[11]; + const pushedButtonShadow = colors[12]; + const inputBackground = colors[13]; + const inputBorder = colors[14]; + const inputHighlight = colors[17]; + return `table { + font-family: "Trebuchet MS", Arial; + border-collapse: collapse; + width: 100%; + } + + td { + border: 1px solid ${tableBorder}; + padding: 8px; + } + + tr:nth-child(even){background-color: ${offgridColor};} + + tr:hover {background-color: ${gridHoverColor};} + + th { + border: 1px solid ${tableBorder}; + padding: 8px; + padding-top: 12px; + padding-bottom: 12px; + text-align: center; + background-color: ${baseColor}; + color: white; + } + + button { + display: inline-block; + padding: 5px 10px; + font-size: 15px; + cursor: pointer; + text-align: center; + text-decoration: none; + outline: none; + color: #fff; + background-color: ${baseColor}; + border: none; + border-radius: 15px; + box-shadow: 0 4px ${buttonShadow}; + } + + button:hover {background-color: ${hoverColor}} + + button:active { + background-color: ${hoverColor}; + box-shadow: 0 2px ${pushedButtonShadow}; + transform: translateY(2px); + } + + ul { + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + border: 1px solid ${borderColor}; + background-color: ${backgroundColor}; + } + + li { + float: left; + } + + li a { + display: block; + color: #666; + text-align: center; + padding: 14px 16px; + text-decoration: none; + } + + li a:hover:not(.active) { + background-color: ${topMenuHighlight}; + } + + li a.active { + color: white; + background-color: ${baseColor}; + } + + textarea, select { + background-color: ${inputBackground}; + border-color: ${inputBorder}; + color: ${textColor}; + } + + input { + border: 1px solid ${inputBorder}; + background-color: ${inputBackground}; + color: ${textColor}; + } + + input[type=text]:focus, textarea:focus, select:focus { + box-shadow: 0 0 5px ${inputHighlight}; + border: 1px solid ${inputHighlight}; + } + + #scrollStuff::-webkit-scrollbar { + width: 1em; + } + + #scrollStuff::-webkit-scrollbar-track { + background-color: ${gridHoverColor}; + } + + #scrollStuff::-webkit-scrollbar-thumb { + background-color: ${borderColor}; + outline: 1px solid slategrey; + outline-offset: -1px; + } + + #scrollStuff::-webkit-scrollbar-corner { + background-color: ${gridHoverColor}; + }`; +}; + +//----------------------------------------------------------------------------- +// HUDManager +//----------------------------------------------------------------------------- + +HUDManager.checkInternet = function() { + if(!_.isPlaytest) return; + require('dns').lookup('www.google.com', function(err) { + if (err && err.code == "ENOTFOUND") { + this._internet = false; + } else { + this._internet = true; + } + this._checkComplete = true; + this.checkForUpdates(); + }.bind(this)); +}; + +HUDManager.checkForUpdates = function() { + if(!this._internet) return; + this.getLog('https://raw.githubusercontent.com/SumRndmDde/PluginUpdater/master/SRD_HUDMakerResources.json'); +}; + +HUDManager.getLog = function(url) { + const xhr = new XMLHttpRequest(); + xhr.open('GET', url); + xhr.overrideMimeType('application/json'); + xhr.onload = function() { + if(xhr.status < 400) { + this.storeLog(xhr.responseText); + } + }.bind(this); + xhr.onerror = function() {}; + xhr.send(); +}; + +HUDManager.storeLog = function(content) { + this._log = JSON.parse(content.replace(/QUOTEHERE/g,'\\"')); +}; + +HUDManager.openLink = function(url) { + require('nw.gui').Shell.openExternal(url); +}; + +//----------------------------------------------------------------------------- +// HUDManager +//----------------------------------------------------------------------------- + +HUDManager.setupCreditsHtml = function() { + if(!this._internet) { + alert("No internet connection detected. Please check your connection and try again later."); + return; + } + if(!this._checkComplete) { + alert("Update data has not finished loading. Please try again in a bit."); + return; + } + MakerManager.document.body.innerHTML = this.topBar(3) + this.getCreditsHtml(); +}; + +HUDManager.getCreditsHtml = function() { + return `

+


+ List of HUD Maker Packs +
+ Here is a list of assets provided by tons of awesome people before and after the release of HUD Maker! + Please be sure to download and enjoy if you wish! + Be sure to credit the asset creators if you choose to use their work. +
+
+
+ ${this.getLogList()} +
+
+

`; +}; + +HUDManager.getLogList = function() { + let result = ''; + this._log.forEach(function(info) { + result += `

${info[0]}
+ by ${info[1]}

+
${info[4]}
+
+ +
+

`; + }, this); + return result; +}; + +HUDManager.initManager = function() { + this.checkInternet(); +}; + +HUDManager.initManager(); + +//----------------------------------------------------------------------------- +// Game_Temp +//----------------------------------------------------------------------------- + +_.Game_Temp_initialize = Game_Temp.prototype.initialize; +Game_Temp.prototype.initialize = function() { + _.Game_Temp_initialize.apply(this, arguments); + this.isManipulatingHud = false; +}; + +//----------------------------------------------------------------------------- +// Game_Map +//----------------------------------------------------------------------------- + +_.Game_Map_isEventRunning = Game_Map.prototype.isEventRunning; +Game_Map.prototype.isEventRunning = function() { + return _.Game_Map_isEventRunning.apply(this, arguments) || $gameTemp.isManipulatingHud; +}; + +//----------------------------------------------------------------------------- +// Game_BattlerBase +//----------------------------------------------------------------------------- + +Object.defineProperties(Game_BattlerBase.prototype, { + // Max TP + mtp: { + get: function() { + return this.maxTp(); + }, + configurable: true + } +}); + +//----------------------------------------------------------------------------- +// Scene_Map +//----------------------------------------------------------------------------- + +_.Scene_Map_start = Scene_Map.prototype.start; +Scene_Map.prototype.start = function() { + _.Scene_Map_start.apply(this, arguments); + if(this._hud) { + HUDManager.setup($dataMapHUD, this._hud); + this._hud.refresh(); + this.createHudUpperLayer(); + } +}; + +_.Scene_Map_createMapNameWindow = Scene_Map.prototype.createMapNameWindow; +Scene_Map.prototype.createMapNameWindow = function() { + _.Scene_Map_createMapNameWindow.apply(this, arguments); + this.createHudLowerLayer(); +}; + +Scene_Map.prototype.createHudLowerLayer = function() { + if(_.isPlaytest) this.createHudBackground(); + this.createHud(); +}; + +Scene_Map.prototype.createHudUpperLayer = function() { + if(_.isPlaytest) this.addHudLines(); + if(this._fadeSprite) { + this.removeChild(this._fadeSprite); + this.addChild(this._fadeSprite); + } +}; + +Scene_Map.prototype.createHudBackground = function() { + this._hudBackground = new Sprite(new Bitmap(Graphics.boxWidth, Graphics.boxHeight)); + this._hudBackground.bitmap.fillRect(0, 0, Graphics.boxWidth, Graphics.boxHeight, 'rgba(0, 0, 0, 0.3)'); + this._hudBackground.opacity = 0; + this.addChild(this._hudBackground); +}; + +Scene_Map.prototype.createHud = function() { + this._hud = new MapHUD(); + this.addChild(this._hud); +}; + +Scene_Map.prototype.addHudLines = function() { + const highlight = HUDManager.getHighlight(); + this.addChild(highlight.getHorizontalLine()); + this.addChild(highlight.getVerticalLine()); +}; + +Scene_Map.prototype.startHud = function() { + if(this._mapLoaded) { + this._hudBackground.opacity = 255; + HUDManager.createWindow(); + $gameTemp.isManipulatingHud = true; + } +}; + +Scene_Map.prototype.endHud = function() { + this._hudBackground.opacity = 0; + $gameTemp.isManipulatingHud = false; +}; + +//----------------------------------------------------------------------------- +// Scene_Battle +//----------------------------------------------------------------------------- + +_.Scene_Battle_start = Scene_Battle.prototype.start; +Scene_Battle.prototype.start = function() { + _.Scene_Battle_start.apply(this, arguments); + if(this._hud) { + HUDManager.setup($dataBattleHUD, this._hud); + this._hud.refresh(); + this.createHudUpperLayer(); + } +}; + +_.Scene_Battle_createSpriteset = Scene_Battle.prototype.createSpriteset; +Scene_Battle.prototype.createSpriteset = function() { + _.Scene_Battle_createSpriteset.apply(this, arguments); + this.createHudLowerLayer(); +}; + +Scene_Battle.prototype.createHudLowerLayer = function() { + if(_.isPlaytest) this.createHudBackground(); + this.createHud(); +}; + +Scene_Battle.prototype.createHudUpperLayer = function() { + if(_.isPlaytest) this.addHudLines(); + if(this._fadeSprite) { + this.removeChild(this._fadeSprite); + this.addChild(this._fadeSprite); + } +}; + +Scene_Battle.prototype.createHudBackground = function() { + this._hudBackground = new Sprite(new Bitmap(Graphics.boxWidth, Graphics.boxHeight)); + this._hudBackground.bitmap.fillRect(0, 0, Graphics.boxWidth, Graphics.boxHeight, 'rgba(0, 0, 0, 0.3)'); + this._hudBackground.opacity = 0; + this.addChild(this._hudBackground); +}; + +Scene_Battle.prototype.createHud = function() { + this._hud = new BattleHUD(); + this.addChild(this._hud); +}; + +Scene_Battle.prototype.addHudLines = function() { + const highlight = HUDManager.getHighlight(); + this.addChild(highlight.getHorizontalLine()); + this.addChild(highlight.getVerticalLine()); +}; + +Scene_Battle.prototype.startHud = function() { + this._hudBackground.opacity = 255; + HUDManager.createWindow(); + $gameTemp.isManipulatingHud = true; +}; + +Scene_Battle.prototype.endHud = function() { + this._hudBackground.opacity = 0; + $gameTemp.isManipulatingHud = false; +}; + +//----------------------------------------------------------------------------- +// Sprite_HUDCursor +//----------------------------------------------------------------------------- + +function Sprite_HUDCursor() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDCursor.prototype = Object.create(Sprite.prototype); +Sprite_HUDCursor.prototype.constructor = Sprite_HUDCursor; + +Sprite_HUDCursor.prototype.initialize = function() { + Sprite.prototype.initialize.call(this); + this.bitmap = new Bitmap(1, 1); + this.anchor.set(0.5); + this._spriteTarget = null; + this._speed = 8; + this._size = 10; + this.mode = ''; + this.__isCursor = true; + this.createHudLines(); +}; + +Sprite_HUDCursor.prototype.drawSquare = function(color) { + const bit = this.bitmap; + bit.fillRect(0, 0, bit.width, this._size, color); + bit.fillRect(0, bit.height - this._size, bit.width, this._size, color); + bit.fillRect(0, 0, this._size, bit.height, color); + bit.fillRect(bit.width - this._size, 0, this._size, bit.height, color); +}; + +Sprite_HUDCursor.prototype.fillSquare = function(color) { + const bit = this.bitmap; + const size = this._size * 2; + bit.fillRect(this._size, this._size, bit.width - size, bit.height - size, color); +}; + +Sprite_HUDCursor.prototype.update = function() { + Sprite.prototype.update.apply(this, arguments); + if(this._spriteTarget) { + this.opacity += this._speed; + if(this.opacity <= 100 || this.opacity >= 250) this._speed *= (-1); + const ctrl = Input.isPressed('control'); + const shift = Input.isPressed('shift'); + if(ctrl && this.mode !== 'ctrl') { + this.mode = 'ctrl'; + this.refreshColor(); + } + if(!ctrl && this.mode !== '') { + this.mode = ''; + this.refreshColor(); + } + } +}; + +Sprite_HUDCursor.prototype.setup = function(spr) { + if(spr) { + if(!spr.bitmap.isReady() && spr.delayHilight) { + spr.bitmap.addLoadListener(this.setupSprite.bind(this, spr)); + } else { + this.setupSprite(spr); + } + } else { + this._spriteTarget = null; + this.bitmap.clear(); + } +}; + +Sprite_HUDCursor.prototype.setupSprite = function(spr) { + const bit = this.bitmap; + const w = (spr.width * spr._baseXScale) + (this._size * 2); + const h = (spr.height * spr._baseYScale) + (this._size * 2); + bit.resize(w, h); + this._frame.width = w; + this._frame.height = h; + this._refresh(); + this.refreshColor(); + this._spriteTarget = spr; +}; + +Sprite_HUDCursor.prototype.refreshColor = function() { + let color = '#f08080'; + if(this.mode === 'ctrl') { + color = '#80f080'; + } + this.bitmap.clear(); + if(!HUDManager.highlightType) { + this.drawSquare(color); + } else { + this.fillSquare(color); + } + +}; + +Sprite_HUDCursor.prototype.createHudLines = function() { + this.horzLine = new Sprite(new Bitmap(Graphics.boxWidth, 2)); + this.vertLine = new Sprite(new Bitmap(2, Graphics.boxHeight)); + const temp = [this.horzLine, this.vertLine]; + temp.forEach(function(sprite) { + sprite.anchor.set(0.5); + sprite.x = Graphics.boxWidth / 2; + sprite.y = Graphics.boxHeight / 2; + sprite.opacity = 0; + }.bind(this)); + this.horzLine.bitmap.fillRect(0, 0, Graphics.boxWidth, 2, "rgba(255, 0, 0, 0.7)"); + this.vertLine.bitmap.fillRect(0, 0, 2, Graphics.boxHeight, "rgba(255, 0, 0, 0.7)"); +}; + +Sprite_HUDCursor.prototype.getHorizontalLine = function() { + return this.horzLine; +}; + +Sprite_HUDCursor.prototype.getVerticalLine = function() { + return this.vertLine; +}; + +//----------------------------------------------------------------------------- +// Sprite_HUDObject +//----------------------------------------------------------------------------- + +function Sprite_HUDObject() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDObject.prototype = Object.create(Sprite.prototype); +Sprite_HUDObject.prototype.constructor = Sprite_HUDObject; + +Sprite_HUDObject.prototype.initialize = function(bitmap, data) { + Sprite.prototype.initialize.call(this, bitmap); + this.anchor.set(0.5); + this.cancelAsTarget(); + this.highlight = null; + this.snapRange = 24; + this.xSnaps = []; + this.ySnaps = []; + this._hasReset = true; + this._isActive = false; + this.setupAnimationInfo(data.animateInfo); +}; + +Sprite_HUDObject.prototype.setupAnimationInfo = function(aniInfo) { + //Dynamic Visibility + this._condition = ''; + this._isVisible = true; + + //X Animation + this._xSpeed = aniInfo.x.spd; + this._xLoop = aniInfo.x.loop; + this._xMin = aniInfo.x.min; + this._xMax = aniInfo.x.max; + this._xDir = 1; + this._xOffset = 0; + + //Y Animation + this._ySpeed = aniInfo.y.spd; + this._yLoop = aniInfo.y.loop; + this._yMin = aniInfo.y.min; + this._yMax = aniInfo.y.max; + this._yDir = 1; + this._yOffset = 0; + + //Scale Animation + this._sSpeed = (aniInfo.s.spd) / (100); + this._sLoop = aniInfo.s.loop; + this._sMin = aniInfo.s.min; + this._sMax = aniInfo.s.max; + this._sDir = 1; + this._scale = 1; + this._sCheck = 1; + this._baseXScale = 1; + this._baseYScale = 1; + + //Rotation Animation + this._rSpeed = (aniInfo.r.spd) / (360); + this._rLoop = aniInfo.r.loop; + this._rMin = (aniInfo.r.min) * (Math.PI / 180); + this._rMax = (aniInfo.r.max) * (Math.PI / 180); + this._rDir = 1; + + this.resetAnimations(); +}; + +Sprite_HUDObject.prototype.resetAnimations = function() { + this._xOffset = this._xMin; + this._yOffset = this._yMin; + this._scale = this._sMin; + this._sCheck = this._sMin; + this.scale.x = this._baseXScale + (this._sMin - 1); + this.scale.y = this._baseYScale + (this._sMin - 1); + this.rotation = this._rMin; + this.updatePosition(); +}; + +Sprite_HUDObject.prototype.update = function() { + Sprite.prototype.update.call(this); + this.updateActivity(); + this.updateCondition(); + if(this._isActive || ($gameTemp.isManipulatingHud && HUDManager.showPiecesType)) { + if(this.isTarget) { + this.updateMovement(); + this.updateSnapLines(); + this.updatePrecision(); + this.updateLayers(); + } + this.updateAnimations(); + this.updateHighlightPosition(); + } +}; + +Sprite_HUDObject.prototype.updateHighlightPosition = function() { + if(this.isTarget && this.highlight) { + this.highlight.x = this._originalX; + this.highlight.y = this._originalY; + } +}; + +Sprite_HUDObject.prototype.updateMovement = function() { + if(TouchInput.isPressed()) { + if(!Input.isPressed('ok')) this._originalX = TouchInput.x; + if(!Input.isPressed('cancel')) this._originalY = TouchInput.y; + if(!Input.isPressed('control')) this.updateSnap(); + } +}; + +Sprite_HUDObject.prototype.updateLayers = function() { + if(this.prevY !== this.y) { + for(let i = 0; i < this.layerPeers.length; i++) { + const y = this.layerPeers[i]; + const sign1 = this.prevY - y > 0; + const sign2 = this.y - y > 0; + if(sign1 !== sign2) { + HUDManager.refreshLayers(); + break; + } + } + this.prevY = this.y; + } +}; + +Sprite_HUDObject.prototype.updateSnapLines = function() { + if(!this.horzLine || !this.vertLine) return; + const xLock = Input.isPressed('ok'); + const yLock = Input.isPressed('cancel'); + if(xLock) { + this.vertLine.x = this._originalX; + this.vertLine.opacity = 255; + if(!this.vertLine.isLocked) { + this.vertLine.isLocked = true; + this.vertLine.setColorTone([255, 255, 0, 0]); + } + } else if(HUDManager.snapMode) { + if(this.xSnaps.contains(this._originalX)) { + this.vertLine.x = this._originalX; + this.vertLine.opacity = 255; + } else { + this.vertLine.opacity = 0; + } + if(this.vertLine.isLocked) { + this.vertLine.isLocked = false; + this.vertLine.setColorTone([0, 0, 0, 0]); + } + } else { + if(this._originalX === this.xSnaps[1]) { + this.vertLine.x = this.xSnaps[1]; + this.vertLine.opacity = 255; + } else { + this.vertLine.opacity = 0; + } + if(this.vertLine.isLocked) { + this.vertLine.isLocked = false; + this.vertLine.setColorTone([0, 0, 0, 0]); + } + } + if(yLock) { + this.horzLine.y = this._originalY; + this.horzLine.opacity = 255; + if(!this.horzLine.isLocked) { + this.horzLine.isLocked = true; + this.horzLine.setColorTone([255, 255, 0, 0]); + } + } else if(HUDManager.snapMode) { + if(this.ySnaps.contains(this._originalY)) { + this.horzLine.y = this._originalY; + this.horzLine.opacity = 255; + } else { + this.horzLine.opacity = 0; + } + if(this.horzLine.isLocked) { + this.horzLine.isLocked = false; + this.horzLine.setColorTone([0, 0, 0, 0]); + } + } else { + if(this._originalY === this.ySnaps[1]) { + this.horzLine.y = this.ySnaps[1]; + this.horzLine.opacity = 255; + } else { + this.horzLine.opacity = 0; + } + if(this.horzLine.isLocked) { + this.horzLine.isLocked = false; + this.horzLine.setColorTone([0, 0, 0, 0]); + } + } + if(!xLock && !yLock) { + if(this.horzLine.opacity > 0 || this.vertLine.opacity > 0) { + if(!TouchInput.isPressed() || Input.isPressed('control')) { + this.horzLine.opacity = 0; + this.vertLine.opacity = 0; + } + } + } +}; + +Sprite_HUDObject.prototype.updateSnap = function() { + for(let i = 0; i < this.xSnaps.length; i++) { + const snap = this.xSnaps[i]; + if(Math.abs(this._originalX - snap) < this.snapRange) { + this._originalX = snap; + break; + } + } + for(let i = 0; i < this.ySnaps.length; i++) { + const snap = this.ySnaps[i]; + if(Math.abs(this._originalY - snap) < this.snapRange) { + this._originalY = snap; + break; + } + } +}; + +Sprite_HUDObject.prototype.updatePrecision = function() { + const speed = (Input.isPressed('shift')) ? 10 : 1; + if(Input.isRepeated('up')) { + this._originalY -= speed; + } + if(Input.isRepeated('down')) { + this._originalY += speed; + } + if(Input.isRepeated('left')) { + this._originalX -= speed; + } + if(Input.isRepeated('right')) { + this._originalX += speed; + } +}; + +Sprite_HUDObject.prototype.updateAnimations = function() { + this.updateAnimation('_xOffset', this._xSpeed, this._xLoop, this._xMin, this._xMax, '_xDir'); + this.updateAnimation('_yOffset', this._ySpeed, this._yLoop, this._yMin, this._yMax, '_yDir'); + this.updateAnimation('_scale', this._sSpeed, this._sLoop, this._sMin, this._sMax, '_sDir'); + this.updateAnimation('rotation', this._rSpeed, this._rLoop, this._rMin, this._rMax, '_rDir'); + this.updatePosition(); + this.updateScale(); + if($gameTemp.isManipulatingHud) { + if(!TouchInput.isPressed()) { + if(this._hasReset) this._hasReset = false; + } else if(!this._hasReset) { + this._hasReset = true; + this.resetAnimations(); + } + } +}; + +Sprite_HUDObject.prototype.updateCondition = function() { + if(this._condition) { + this._isVisible = this._isActive || ($gameTemp.isManipulatingHud && HUDManager.showPiecesType); + if(this.opacity > 0 && !this._isVisible) { + this._originalOpacity = this.opacity; + this.opacity = 0; + } else if(this.opacity <= 0 && this._isVisible) { + this.opacity = this._originalOpacity; + this.refresh(true); + } + } +}; +// fix +Sprite_HUDObject.prototype.updateAnimation = function(mainVar, spd, loop, min, max, dirVar) { + if(spd) { + if(!loop) { + if(this[mainVar] <= min && this[dirVar] < 0) { + this[mainVar] = min; + this[dirVar] = 1; + } + if(this[mainVar] >= max && this[dirVar] > 0) { + this[mainVar] = max; + this[dirVar] = -1; + } + } else { + if(this[mainVar] >= max) { + this[mainVar] = min; + } + } + const newVal = this[mainVar] + (spd * this[dirVar]); + if(newVal < min) { + this[mainVar] = min; + } else if(newVal > max) { + this[mainVar] = max; + } else { + this[mainVar] = newVal; + } + } +}; + +Sprite_HUDObject.prototype.updatePosition = function() { + this.x = this._originalX + this._xOffset; + this.y = this._originalY + this._yOffset; +}; + +Sprite_HUDObject.prototype.updateScale = function() { + if(this._sCheck !== this._scale) { + this._sCheck = this._scale; + this.updateRealScale(); + } +}; + +Sprite_HUDObject.prototype.updateRealScale = function() { + this.scale.x = this._baseXScale + (this._sCheck - 1); + this.scale.y = this._baseYScale + (this._sCheck - 1); +}; + +Sprite_HUDObject.prototype.setHighlight = function(highlight) { + this.highlight = highlight; + this.horzLine = this.highlight.horzLine; + this.vertLine = this.highlight.vertLine; +}; + +Sprite_HUDObject.prototype.setAsTarget = function() { + this.isTarget = true; + this.setupSnaps(); + this.layerPeers = HUDManager.getSpritesOnLayer(this.z); + this.prevY = this.y; +}; + +Sprite_HUDObject.prototype.cancelAsTarget = function() { + this.isTarget = false; +}; + +Sprite_HUDObject.prototype.refresh = function(refreshProperties) { + if(!!refreshProperties) { + this.refreshProperties(); + } +}; + +Sprite_HUDObject.prototype.refreshProperties = function() { + this.updateRealScale(); + this._condition = this["Condition"]; + this.updateActivity(); + if(this.isTarget) { + this.updateConditionInput(); + } +}; + +Sprite_HUDObject.prototype.updateActivity = function() { + if(this._condition === '') { + this._isActive = true; + } else { + try { + this._isActive = !!eval(this._condition); + } catch(e) { + console.log(this._condition + " \n" + e); + alert("There is an error with \"" + this._condition + "\" Press F8 to see more!"); + this._condition = 'false'; + this._isActive = false; + } + } +}; + +Sprite_HUDObject.prototype.setProperty = function(property, value) { + this[property] = value; + this.refresh(true); +}; + +Sprite_HUDObject.prototype.setupSnaps = function() { + const width = this.width * this._baseXScale; + const height = this.height * this._baseYScale; + if(!HUDManager.snapMode) { + this.xSnaps = [width / 2, Graphics.boxWidth / 2, Graphics.boxWidth - (width / 2)]; + this.ySnaps = [height / 2, Graphics.boxHeight / 2, Graphics.boxHeight - (height / 2)]; + } else { + const sprites = HUDManager.getSprites(); + this.xSnaps = []; + this.ySnaps = []; + sprites.forEach(function(sprite) { + if(this !== sprite) { + if(!this.xSnaps.contains(sprite.x)) { + this.xSnaps.push(sprite.x); + } + if(!this.ySnaps.contains(sprite.y)) { + this.ySnaps.push(sprite.y); + } + } + }, this); + } +}; + +Sprite_HUDObject.prototype.updateConditionInput = function() { + if(MakerManager.window) { + const element = MakerManager.document.getElementById('Condition Bla'); + if(!element) return; + let result = true; + if(this._isActive) { + element.innerHTML = `Condition: + `; + } else { + element.innerHTML = `Condition: + `; + } + } +}; + +Sprite_HUDObject.prototype.postError = function(e) { + console.log(e); + alert('The "Image" input had an error. Check the console for more info.'); +}; + +Sprite_HUDObject.prototype.resizeBitmap = function(bit, width, height) { + if(bit.width !== width || bit.height !== height) { + bit.resize(width, height); + this._frame.width = 0; + this._frame.height = 0; + if(_.isV150) { + this._refreshFrame = true; + this._onBitmapLoad(bit); + } else { + this._onBitmapLoad(); + } + } +}; + +//----------------------------------------------------------------------------- +// Sprite_HUDText +//----------------------------------------------------------------------------- + +function Sprite_HUDText() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDText.prototype = Object.create(Sprite_HUDObject.prototype); +Sprite_HUDText.prototype.constructor = Sprite_HUDText; + +Sprite_HUDText._label = "Text"; + +/* + * Get HTML for Sprite_HUDText manipulation + */ +Sprite_HUDText.getHtml = function(data) { + const value = data["Value"]; + let condition = data["Condition"]; + const layer = data["Layer"]; + const font = data["Font"]; + const width = data["Max Width"]; + const align = data["Align"]; + const size = data["Font Size"]; + const color = data["Text Color"]; + const alpha = data["Text Alpha"]; + const outlineColor = data["Outline Color"]; + const outlineAlpha = data["Outline Alpha"]; + + const sele = ['', '', '']; + if(align === 'left') sele[0] = 'selected'; + else if(align === 'center') sele[1] = 'selected'; + else if(align === 'right') sele[2] = 'selected'; + + try { + eval(condition); + } catch(e) { + data["Condition"] = ''; + condition = ''; + } + + return `${HUDManager.createTitle(data.id, Sprite_HUDText._label)} + + ${HUDManager.createHeader()} + ${HUDManager.createInput("Value", value)} + ${HUDManager.createConditionInput("Condition", condition)} + ${HUDManager.createInput("Layer", layer)} + ${HUDManager.createInput("Font", font)} + ${HUDManager.createInput("Max Width", width)} + ${HUDManager.createSelect("Align", ["left", sele[0], "Left"], ["center", sele[1], "Center"], ["right", sele[2], "Right"])} + ${HUDManager.createInput("Font Size", size)} + ${HUDManager.createColor("Text Color", color, "Text Alpha", alpha)} + ${HUDManager.createColor("Outline Color", outlineColor, "Outline Alpha", outlineAlpha)} + ${HUDManager.createRefresh()} +
`; +}; + +//_.active + +/* + * Register Sprite_HUDText within the HUDManager + */ +HUDManager.typeNames.push(Sprite_HUDText._label); +HUDManager.types[Sprite_HUDText._label] = { + class: Sprite_HUDText, + html: Sprite_HUDText.getHtml, + data: { + "type": Sprite_HUDText._label, + "Value": "Gold: ${$gameParty.gold()}", + "Condition": "", + "Layer": "0", + "Font": "GameFont", + "Max Width": "150", + "Align": "left", + "Font Size": "30", + "Text Color": "#ffffff", + "Text Alpha": "255", + "Outline Color":"#000000", + "Outline Alpha":"127" + }, + format: function(data) { + let temp; + try { + temp = String(eval("`" + data["Value"] + "`")); + } catch(e) { + console.log('Error with Text\n' + e); + temp = "ERROR"; + } + if(temp.length > 15) temp = temp.substring(0, 15) + "..."; + return temp; + } +} + +Sprite_HUDText.prototype.initialize = function(info) { + Sprite_HUDObject.prototype.initialize.call(this, new Bitmap(1, 1), info); + this.properties = ["Layer", "Condition", "Max Width", "Font", "Align", "Font Size", "Text Color", "Text Alpha", + "Outline Color", "Outline Alpha", "Value"]; + for(let i = 0; i < this.properties.length; i++) { + const prop = this.properties[i]; + this[prop] = info[prop]; + } + this._value = this.getNewValue(); + this.refresh(true); +}; + +Sprite_HUDText.prototype.getNewValue = function() { + let result; + try { + result = eval("`" + this["Value"] + "`"); + } catch(e) { + console.log('Error with Text\n' + e); + result = "ERROR"; + } + return result; +}; + +Sprite_HUDText.prototype.update = function() { + Sprite_HUDObject.prototype.update.call(this); + if(!this._isActive) return; + const newValue = this.getNewValue(); + if(this._value !== newValue) { + this._value = newValue; + this.refresh(); + } +}; + +Sprite_HUDText.prototype.refresh = function(refreshProperties) { + Sprite_HUDObject.prototype.refresh.apply(this, arguments); + this.bitmap.addLoadListener(function() { + this.bitmap.clear(); + this.bitmap.drawText(this._value, 0, 0, this.bitmap.width, this.bitmap.height, this["Align"]); + this.setupSnaps(); + }.bind(this)); +}; + +Sprite_HUDText.prototype.refreshProperties = function() { + Sprite_HUDObject.prototype.refreshProperties.apply(this, arguments); + const bit = this.bitmap; + const width = parseInt(this["Max Width"]); + const height = parseInt(this["Font Size"]) + 12; + this.resizeBitmap(bit, width, height); + this.z = parseInt(this["Layer"]); + this.bitmap.fontFace = this["Font"]; + this.bitmap.fontSize = parseInt(this["Font Size"]); + this.bitmap.textColor = _.convertHex(this["Text Color"], parseInt(this["Text Alpha"])); + this.bitmap.outlineColor = _.convertHex(this["Outline Color"], parseInt(this["Outline Alpha"])); +}; + +//----------------------------------------------------------------------------- +// Sprite_HUDTextEx +//----------------------------------------------------------------------------- + +function Sprite_HUDTextEx() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDTextEx.prototype = Object.create(Sprite_HUDObject.prototype); +Sprite_HUDTextEx.prototype.constructor = Sprite_HUDTextEx; + +Sprite_HUDTextEx._label = "TextEx"; + +/* + * Get HTML for Sprite_HUDTextEx manipulation + */ +Sprite_HUDTextEx.getHtml = function(data) { + const value = data["Value"]; + let condition = data["Condition"]; + const layer = data["Layer"]; + const width = data["Width"]; + const height = data["Height"]; + + try { + eval(condition); + } catch(e) { + data["Condition"] = ''; + condition = ''; + } + + return `${HUDManager.createTitle(data.id, Sprite_HUDTextEx._label)} + + ${HUDManager.createHeader()} + ${HUDManager.createInput("Value", value)} + ${HUDManager.createConditionInput("Condition", condition)} + ${HUDManager.createInput("Layer", layer)} + ${HUDManager.createInput("Width", width)} + ${HUDManager.createInput("Height", height)} + ${HUDManager.createRefresh()} +
`; +}; + +/* + * Register Sprite_HUDTextEx within the HUDManager + */ +HUDManager.typeNames.push(Sprite_HUDTextEx._label); +HUDManager.types[Sprite_HUDTextEx._label] = { + class: Sprite_HUDTextEx, + html: Sprite_HUDTextEx.getHtml, + data: { + "type": Sprite_HUDTextEx._label, + "Value": "\\i[313] Icon", + "Condition": "", + "Layer": "0", + "Width": "150", + "Height": "36" + }, + format: function(data) { + let temp = String(data["Value"]); + if(temp.length > 15) temp = temp.substring(0, 15) + "..."; + return temp; + } +} + +Sprite_HUDTextEx.prototype.initialize = function(info) { + Sprite_HUDObject.prototype.initialize.call(this, new Bitmap(1, 1), info); + this.properties = ["Layer", "Condition", "Width", "Height", "Value"]; + for(let i = 0; i < this.properties.length; i++) { + const prop = this.properties[i]; + this[prop] = info[prop]; + } + this.contents = this.bitmap; + this._value = this.convertEscapeCharacters(this["Value"]); + this.refresh(true); +}; + +Sprite_HUDTextEx.prototype.update = function() { + Sprite_HUDObject.prototype.update.call(this); + if(!this._isActive) return; + const newValue = this.convertEscapeCharacters(this["Value"]); + if(this._value !== newValue) { + this._value = newValue; + this.refresh(); + } +}; + +Sprite_HUDTextEx.prototype.refresh = function(refreshProperties) { + Sprite_HUDObject.prototype.refresh.apply(this, arguments); + this.bitmap.addLoadListener(function() { + this.bitmap.clear(); + this.drawTextEx(this._value, 0, 0); + }.bind(this)); +}; + +Sprite_HUDTextEx.prototype.refreshProperties = function() { + Sprite_HUDObject.prototype.refreshProperties.apply(this, arguments); + const bit = this.bitmap; + const width = parseInt(this["Width"]); + const height = parseInt(this["Height"]); + this.resizeBitmap(bit, width, height); + this.z = parseInt(this["Layer"]); + this.setupSnaps(); +}; + +Sprite_HUDTextEx.prototype.resetFontSettings = function() { + this.contents.fontFace = "GameFont"; + this.contents.fontSize = 28; + this.contents.textColor = "#FFFFFF" +}; + +Sprite_HUDTextEx.prototype.textColor = function(n) { + if(this._textColorWin === undefined) this._textColorWin = new Window_Base(); + return this._textColorWin.textColor(n); +}; + +Sprite_HUDTextEx.prototype.drawTextEx = Window_Base.prototype.drawTextEx; +Sprite_HUDTextEx.prototype.convertEscapeCharacters = Window_Base.prototype.convertEscapeCharacters; +Sprite_HUDTextEx.prototype.actorName = Window_Base.prototype.actorName; +Sprite_HUDTextEx.prototype.textWidth = Window_Base.prototype.textWidth; +Sprite_HUDTextEx.prototype.partyMemberName = Window_Base.prototype.partyMemberName; +Sprite_HUDTextEx.prototype.processCharacter = Window_Base.prototype.processCharacter; +Sprite_HUDTextEx.prototype.processNormalCharacter = Window_Base.prototype.processNormalCharacter; +Sprite_HUDTextEx.prototype.processNewLine = Window_Base.prototype.processNewLine; +Sprite_HUDTextEx.prototype.processNewPage = Window_Base.prototype.processNewPage; +Sprite_HUDTextEx.prototype.obtainEscapeCode = Window_Base.prototype.obtainEscapeCode; +Sprite_HUDTextEx.prototype.obtainEscapeParam = Window_Base.prototype.obtainEscapeParam; +Sprite_HUDTextEx.prototype.processEscapeCharacter = Window_Base.prototype.processEscapeCharacter; +Sprite_HUDTextEx.prototype.processDrawIcon = Window_Base.prototype.processDrawIcon; +Sprite_HUDTextEx.prototype.makeFontBigger = Window_Base.prototype.makeFontBigger; +Sprite_HUDTextEx.prototype.makeFontSmaller = Window_Base.prototype.makeFontSmaller; +Sprite_HUDTextEx.prototype.calcTextHeight = Window_Base.prototype.calcTextHeight; +Sprite_HUDTextEx.prototype.drawIcon = Window_Base.prototype.drawIcon; +Sprite_HUDTextEx.prototype.changeTextColor = Window_Base.prototype.changeTextColor; + +_.setupYEPMessageCore = function() { + + Sprite_HUDTextEx.prototype.textWidthEx = Window_Base.prototype.textWidthEx; + Sprite_HUDTextEx.prototype.setWordWrap = Window_Base.prototype.setWordWrap; + Sprite_HUDTextEx.prototype.convertExtraEscapeCharacters = Window_Base.prototype.convertExtraEscapeCharacters; + Sprite_HUDTextEx.prototype.actorClassName = Window_Base.prototype.actorClassName; + Sprite_HUDTextEx.prototype.actorNickname = Window_Base.prototype.actorNickname; + Sprite_HUDTextEx.prototype.partyClassName = Window_Base.prototype.partyClassName; + Sprite_HUDTextEx.prototype.partyNickname = Window_Base.prototype.partyNickname; + Sprite_HUDTextEx.prototype.escapeIconItem = Window_Base.prototype.escapeIconItem; + Sprite_HUDTextEx.prototype.obtainEscapeString = Window_Base.prototype.obtainEscapeString; + Sprite_HUDTextEx.prototype.checkWordWrap = Window_Base.prototype.checkWordWrap; + Sprite_HUDTextEx.prototype.saveCurrentWindowSettings = Window_Base.prototype.saveCurrentWindowSettings; + Sprite_HUDTextEx.prototype.restoreCurrentWindowSettings = Window_Base.prototype.restoreCurrentWindowSettings; + Sprite_HUDTextEx.prototype.clearCurrentWindowSettings = Window_Base.prototype.clearCurrentWindowSettings; + Sprite_HUDTextEx.prototype.textWidthExCheck = Window_Base.prototype.textWidthExCheck; + +}; + +SRD.NotetagGetters.push(_.setupYEPMessageCore); + +//----------------------------------------------------------------------------- +// Sprite_HUDShape +//----------------------------------------------------------------------------- + +function Sprite_HUDShape() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDShape.prototype = Object.create(Sprite_HUDObject.prototype); +Sprite_HUDShape.prototype.constructor = Sprite_HUDShape; + +Sprite_HUDShape._label = "Shape"; + +/* + * Get HTML for Sprite_HUDText manipulation + */ +Sprite_HUDShape.getHtml = function(data) { + let condition = data["Condition"]; + const layer = data["Layer"]; + const shape = data["Shape"]; + const width = data["Width"]; + const height = data["Height"]; + const fill = data["Fill Style"]; + const blend = data["Blend"]; + const color1 = data["Color 1"]; + const color1A = data["Color 1 Alpha"]; + const color2 = data["Color 2"]; + const color2A = data["Color 2 Alpha"]; + const size = data["Outline Size"]; + const color3 = data["Outline Color"]; + const color3A = data["Color 3 Alpha"]; + + const sele = ['', '']; + if(shape === 'Rectangle') sele[0] = 'selected'; + else if(shape === 'Circle') sele[1] = 'selected'; + + const sele2 = ['', '', '', '', '']; + if(fill === 'solid') sele2[0] = 'selected'; + else if(fill === 'horizontal') sele2[1] = 'selected'; + else if(fill === 'vertical') sele2[2] = 'selected'; + else if(fill === 'radical') sele2[3] = 'selected'; + else if(fill === 'max radical') sele2[4] = 'selected'; + + const blendArray = []; + for(let i = 0; i <= 16; i++) { + blendArray.push([String(i), parseInt(blend) === i ? 'selected' : '', _.blendNames[i]]) + } + + try { + eval(condition); + } catch(e) { + data["Condition"] = ''; + condition = ''; + } + + return `${HUDManager.createTitle(data.id, Sprite_HUDShape._label)} + + ${HUDManager.createHeader()} +
+
+ + ${HUDManager.createConditionInput("Condition", condition)} + ${HUDManager.createInput("Layer", layer)} + ${HUDManager.createSelect("Shape", ["Rectangle", sele[0], "Rectangle"], ["Circle", sele[1], "Circle"])} + ${HUDManager.createInput("Width", width)} + ${HUDManager.createInput("Height", height)} + ${HUDManager.createSelect("Fill Style", ["solid", sele2[0], "Solid"], + ["horizontal", sele2[1], "Horizontal Gradient"], + ["vertical", sele2[2], "Vertical Gradient"], + ["radical", sele2[3], "Radial Gradient"], + ["max radical", sele2[4], "Max Radial Gradient"])} + ${HUDManager.createSelectArray("Blend", blendArray)} + ${HUDManager.createColor("Color 1", color1, "Color 1 Alpha", color1A)} + ${HUDManager.createColor("Color 2", color2, "Color 2 Alpha", color2A)} + ${HUDManager.createInput("Outline Size", size)} + ${HUDManager.createColor("Outline Color", color3, "Color 3 Alpha", color3A)} +
+
+ + ${HUDManager.createRefresh()} +
`; +}; + +/* + * Register Sprite_HUDShape within the HUDManager + */ +HUDManager.typeNames.push(Sprite_HUDShape._label); +HUDManager.types[Sprite_HUDShape._label] = { + class: Sprite_HUDShape, + html: Sprite_HUDShape.getHtml, + data: { + "type": Sprite_HUDShape._label, + "Layer": "0", + "Condition": "", + "Shape": "Circle", + "Width": "75", + "Height": "75", + "Fill Style": "solid", + "Blend": "0", + "Color 1": "#ffffff", + "Color 1 Alpha":"255", + "Color 2": "#000000", + "Color 2 Alpha":"255", + "Outline Size": "0", + "Outline Color":"#000000", + "Color 3 Alpha":"255" + }, + format: function(data) { + let temp = String(data["Shape"] + " " + data["Fill Style"]); + if(temp.length > 15) temp = temp.substring(0, 15) + "..."; + return temp; + } +} + +Sprite_HUDShape.prototype.initialize = function(info) { + Sprite_HUDObject.prototype.initialize.call(this, new Bitmap(1, 1), info); + this.properties = ["Layer", "Condition", "Shape", "Width", "Height", "Fill Style", "Blend", "Color 1", "Color 1 Alpha", + "Color 2", "Color 2 Alpha", "Outline Size", "Outline Color", "Color 3 Alpha"]; + for(let i = 0; i < this.properties.length; i++) { + const prop = this.properties[i]; + this[prop] = info[prop]; + } + this.refresh(true); +}; + +Sprite_HUDShape.prototype.update = function() { + Sprite_HUDObject.prototype.update.call(this); +}; + +Sprite_HUDShape.prototype.refresh = function(refreshProperties) { + Sprite_HUDObject.prototype.refresh.apply(this, arguments); + this.bitmap.addLoadListener(function() { + const shape = this["Shape"]; + const outline = parseInt(this["Outline Size"]); + const width = parseInt(this["Width"]); + const height = parseInt(this["Height"]); + const w2 = this.bitmap.width / 2; + const h2 = this.bitmap.height / 2; + const fill = this["Fill Style"]; + const color1 = _.convertHex(this["Color 1"], parseInt(this["Color 1 Alpha"])); + const color2 = _.convertHex(this["Color 2"], parseInt(this["Color 2 Alpha"])); + const color3 = _.convertHex(this["Outline Color"], parseInt(this["Color 3 Alpha"])); + let color = color1; + if(fill === 'vertical') { + color = this.bitmap._context.createLinearGradient(0, 0, 0, height); + } else if(fill === 'horizontal') { + color = this.bitmap._context.createLinearGradient(0, 0, width, 0); + } else if(fill === 'radical') { + const biggest = (width > height) ? width : height; + color = this.bitmap._context.createRadialGradient(w2, h2, 0, w2, h2, biggest); + } else if(fill === 'max radical') { + const smallest = (width < height) ? width : height; + color = this.bitmap._context.createRadialGradient(w2, h2, 0, w2, h2, smallest); + } + if(fill !== 'solid') { + color.addColorStop(0, color1); + color.addColorStop(1, color2); + } + this.bitmap.clear(); + if(shape === 'Rectangle') { + if(outline) { + this.bitmap.fillRect(0, 0, this.bitmap.width, this.bitmap.height, color3); + } + this.bitmap.fillRect(outline, outline, width, height, color); + } else if(shape === 'Circle') { + if(outline) { + this.bitmap.drawOval(w2, h2, this.bitmap.width / 2, this.bitmap.height / 2, color3); + } + this.bitmap.drawOval(w2, h2, width / 2, height / 2, color); + } + }.bind(this)); +}; + +Sprite_HUDShape.prototype.refreshProperties = function() { + Sprite_HUDObject.prototype.refreshProperties.apply(this, arguments); + const bit = this.bitmap; + const outlineSize = parseInt(this["Outline Size"]); + const width = parseInt(this["Width"]) + (outlineSize * 2); + const height = parseInt(this["Height"]) + (outlineSize * 2); + this.resizeBitmap(bit, width, height); + this.z = parseInt(this["Layer"]); + this.blendMode = parseInt(this["Blend"]); + this.setupSnaps(); +}; + +//----------------------------------------------------------------------------- +// Sprite_HUDImage +//----------------------------------------------------------------------------- + +function Sprite_HUDImage() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDImage.prototype = Object.create(Sprite_HUDObject.prototype); +Sprite_HUDImage.prototype.constructor = Sprite_HUDImage; + +Sprite_HUDImage._label = "Picture"; + +/* + * Get HTML for Sprite_HUDText manipulation + */ +Sprite_HUDImage.getHtml = function(data) { + const image = data["Image"]; + let condition = data["Condition"]; + const layer = data["Layer"]; + const scaleX = data["Scale X"]; + const scaleY = data["Scale Y"]; + const opacity = data["Opacity"]; + const hue = data["Hue"]; + const blend = data["Blend"]; + + try { + eval(condition); + } catch(e) { + data["Condition"] = ''; + condition = ''; + } + + const blendArray = []; + for(let i = 0; i <= 16; i++) { + blendArray.push([String(i), parseInt(blend) === i ? 'selected' : '', _.blendNames[i]]) + } + + return `${HUDManager.createTitle(data.id, Sprite_HUDImage._label)} + + ${HUDManager.createHeader()} + ${HUDManager.createFilelist("Image", 'pictures', image)} + ${HUDManager.createConditionInput("Condition", condition)} + ${HUDManager.createInput("Layer", layer)} + ${HUDManager.createInput("Scale X", scaleX)} + ${HUDManager.createInput("Scale Y", scaleY)} + ${HUDManager.createInput("Opacity", opacity)} + ${HUDManager.createInput("Hue", hue)} + ${HUDManager.createSelectArray("Blend", blendArray)} + ${HUDManager.createRefresh()} +
`; +}; + +/* + * Register Sprite_HUDImage within the HUDManager + */ +HUDManager.typeNames.push(Sprite_HUDImage._label); +HUDManager.types[Sprite_HUDImage._label] = { + class: Sprite_HUDImage, + html: Sprite_HUDImage.getHtml, + data: { + "type": Sprite_HUDImage._label, + "Condition": "", + "Layer": "0", + "Image": _.getFirstFile('pictures'), + "Scale X": "1", + "Scale Y": "1", + "Opacity": "255", + "Hue": "0", + "Blend": "0" + }, + format: function(data) { + let temp = String(data["Image"]); + if(temp.length > 15) temp = temp.substring(0, 15) + "..."; + return temp; + } +} + +Sprite_HUDImage.prototype.initialize = function(info) { + Sprite_HUDObject.prototype.initialize.call(this, new Bitmap(32, 32), info); + this.delayHilight = true; + this.properties = ["Layer", "Condition", "Image", "Scale X", "Scale Y", "Opacity", "Hue", "Blend"]; + for(let i = 0; i < this.properties.length; i++) { + const prop = this.properties[i]; + this[prop] = info[prop]; + } + this.refresh(true); +}; + +Sprite_HUDImage.prototype.update = function() { + Sprite_HUDObject.prototype.update.call(this); +}; + +Sprite_HUDImage.prototype.refresh = function(refreshProperties) { + Sprite_HUDObject.prototype.refresh.apply(this, arguments); + this.bitmap.addLoadListener(this.setupSnaps.bind(this)); +}; + +Sprite_HUDImage.prototype.refreshProperties = function() { + Sprite_HUDObject.prototype.refreshProperties.apply(this, arguments); + const image = this["Image"]; + if(image) { + try { + this.bitmap = _.getPicture(image, parseInt(this["Hue"])); + } catch(e) { + this.postError(e); + this["Image"] = ''; + this._value = ''; + this.bitmap = null; + return; + } + this.z = parseInt(this["Layer"]); + this._baseXScale = parseFloat(this["Scale X"]); + this._baseYScale = parseFloat(this["Scale Y"]); + this.updateRealScale(); + this.opacity = parseInt(this["Opacity"]); + this.blendMode = parseInt(this["Blend"]); + } +}; + +//----------------------------------------------------------------------------- +// Sprite_HUDCodeImage +//----------------------------------------------------------------------------- + +function Sprite_HUDCodeImage() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDCodeImage.prototype = Object.create(Sprite_HUDObject.prototype); +Sprite_HUDCodeImage.prototype.constructor = Sprite_HUDCodeImage; + +Sprite_HUDCodeImage._label = "Picture EX"; + +/* + * Get HTML for Sprite_HUDText manipulation + */ +Sprite_HUDCodeImage.getHtml = function(data) { + const image = data["Image"]; + let condition = data["Condition"]; + const layer = data["Layer"]; + const scaleX = data["Scale X"]; + const scaleY = data["Scale Y"]; + const opacity = data["Opacity"]; + const hue = data["Hue"]; + const blend = data["Blend"]; + + try { + eval(image); + } catch(e) { + data["Image"] = ''; + image = ''; + } + + try { + eval(condition); + } catch(e) { + data["Condition"] = ''; + condition = ''; + } + + const blendArray = []; + for(let i = 0; i <= 16; i++) { + blendArray.push([String(i), parseInt(blend) === i ? 'selected' : '', _.blendNames[i]]) + } + + return `${HUDManager.createTitle(data.id, Sprite_HUDCodeImage._label)} + + ${HUDManager.createHeader()} + ${HUDManager.createInput("Image", image)} + ${HUDManager.createConditionInput("Condition", condition)} + ${HUDManager.createInput("Layer", layer)} + ${HUDManager.createInput("Scale X", scaleX)} + ${HUDManager.createInput("Scale Y", scaleY)} + ${HUDManager.createInput("Opacity", opacity)} + ${HUDManager.createInput("Hue", hue)} + ${HUDManager.createSelectArray("Blend", blendArray)} + ${HUDManager.createRefresh()} +
`; +}; + +/* + * Register Sprite_HUDCodeImage within the HUDManager + */ +HUDManager.typeNames.push(Sprite_HUDCodeImage._label); +HUDManager.types[Sprite_HUDCodeImage._label] = { + class: Sprite_HUDCodeImage, + html: Sprite_HUDCodeImage.getHtml, + data: { + "type": Sprite_HUDCodeImage._label, + "Condition": "", + "Layer": "0", + "Image": "'Gold'", + "Scale X": "1", + "Scale Y": "1", + "Opacity": "255", + "Hue": "0", + "Blend": "0" + }, + format: function(data) { + let temp; + try { + temp = eval(data["Image"]); + } catch(e) { + temp = "ERROR"; + } + if(temp.length > 12) temp = temp.substring(0, 12) + "..."; + return temp; + } +} + +Sprite_HUDCodeImage.prototype.initialize = function(info) { + Sprite_HUDObject.prototype.initialize.call(this, new Bitmap(32, 32), info); + this.delayHilight = true; + this.properties = ["Layer", "Condition", "Image", "Scale X", "Scale Y", "Opacity", "Hue", "Blend"]; + for(let i = 0; i < this.properties.length; i++) { + const prop = this.properties[i]; + this[prop] = info[prop]; + } + this._value = this.getNewImage(); + this.refresh(true); +}; + +Sprite_HUDCodeImage.prototype.getNewImage = function() { + let result; + try { + result = eval(this["Image"]); + } catch(e) { + console.log('Error with Picture EX\n' + e); + result = ''; + } + return result; +}; + +Sprite_HUDCodeImage.prototype.update = function() { + Sprite_HUDObject.prototype.update.call(this); + if(!this._isActive) return; + let newValue = this._value; + newValue = this.getNewImage(); + if(this._value !== newValue) { + this._value = newValue; + this.refresh(true); + } +}; + +Sprite_HUDCodeImage.prototype.refresh = function(refreshProperties) { + Sprite_HUDObject.prototype.refresh.apply(this, arguments); + if(this.bitmap) { + this.bitmap.addLoadListener(this.setupSnaps.bind(this)); + } +}; + +Sprite_HUDCodeImage.prototype.refreshProperties = function() { + Sprite_HUDObject.prototype.refreshProperties.apply(this, arguments); + const image = this._value; + if(image) { + try { + this.bitmap = _.getPicture(image, parseInt(this["Hue"])); + } catch(e) { + this.postError(e); + this["Image"] = ''; + this._value = ''; + this.bitmap = null; + return; + } + this.z = parseInt(this["Layer"]); + this._baseXScale = parseFloat(this["Scale X"]); + this._baseYScale = parseFloat(this["Scale Y"]); + this.updateRealScale(); + this.opacity = parseInt(this["Opacity"]); + this.blendMode = parseInt(this["Blend"]); + } else { + this.bitmap = null; + } +}; + +//----------------------------------------------------------------------------- +// Sprite_HUDGauge +//----------------------------------------------------------------------------- + +function Sprite_HUDGauge() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDGauge.prototype = Object.create(Sprite_HUDObject.prototype); +Sprite_HUDGauge.prototype.constructor = Sprite_HUDGauge; + +Sprite_HUDGauge._label = "Gauge"; + +/* + * Get HTML for Sprite_HUDGauge manipulation + */ +Sprite_HUDGauge.getHtml = function(data) { + const value = data["Cur. Value"]; + const max = data["Max Value"]; + let condition = data["Condition"]; + const layer = data["Layer"]; + const width = data["Width"]; + const height = data["Height"]; + const fill = data["Style"]; + const color1 = data["Color 1"]; + const color1A = data["Color 1 Alpha"]; + const color2 = data["Color 2"]; + const color2A = data["Color 2 Alpha"]; + const size = data["Outline Size"]; + const color3 = data["Outline Color"]; + const color3A = data["Color 3 Alpha"]; + const color4 = data["Back Color"]; + const color4A = data["Color 4 Alpha"]; + + const sele2 = ['', '', '', '']; + if(fill === 'left') sele2[0] = 'selected'; + else if(fill === 'right') sele2[1] = 'selected'; + else if(fill === 'up') sele2[2] = 'selected'; + else if(fill === 'down') sele2[3] = 'selected'; + + try { + eval(condition); + } catch(e) { + data["Condition"] = ''; + condition = ''; + } + + return `${HUDManager.createTitle(data.id, Sprite_HUDGauge._label)} + + ${HUDManager.createHeader()} +
+
+ + ${HUDManager.createInput("Cur. Value", value)} + ${HUDManager.createInput("Max Value", max)} + ${HUDManager.createConditionInput("Condition", condition)} + ${HUDManager.createInput("Layer", layer)} + ${HUDManager.createInput("Width", width)} + ${HUDManager.createInput("Height", height)} + ${HUDManager.createSelect("Style", ["left", sele2[0], "Left"], + ["right", sele2[1], "Right"], + ["up", sele2[2], "Up"], + ["down", sele2[3], "Down"])} + ${HUDManager.createColor("Color 1", color1, "Color 1 Alpha", color1A)} + ${HUDManager.createColor("Color 2", color2, "Color 2 Alpha", color2A)} + ${HUDManager.createColor("Back Color", color4, "Color 4 Alpha", color4A)} + ${HUDManager.createInput("Outline Size", size)} + ${HUDManager.createColor("Outline Color", color3, "Color 3 Alpha", color3A)} +
+
+ + ${HUDManager.createRefresh()} +
`; +}; + +/* + * Register Sprite_HUDGauge within the HUDManager + */ +HUDManager.typeNames.push(Sprite_HUDGauge._label); +HUDManager.types[Sprite_HUDGauge._label] = { + class: Sprite_HUDGauge, + html: Sprite_HUDGauge.getHtml, + data: { + "type": Sprite_HUDGauge._label, + "Cur. Value": "$gameParty.leader().hp", + "Max Value": "$gameParty.leader().mhp", + "Condition": "", + "Layer": "0", + "Width": "150", + "Height": "30", + "Style": "left", + "Color 1": "#ff8000", + "Color 1 Alpha":"255", + "Color 2": "#ff0000", + "Color 2 Alpha":"255", + "Back Color": "#666666", + "Color 4 Alpha": "255", + "Outline Size": "1", + "Outline Color":"#222222", + "Color 3 Alpha":"255" + }, + format: function(data) { + let temp; + try { + temp = String(eval(data["Cur. Value"])); + temp += "/" + String(eval(data["Max Value"])); + } catch(e) { + temp = "ERROR"; + } + if(temp.length > 15) temp = temp.substring(0, 15) + "..."; + return temp; + } +} + +Sprite_HUDGauge.prototype.initialize = function(info) { + Sprite_HUDObject.prototype.initialize.call(this, new Bitmap(1, 1), info); + this.properties = ["Cur. Value", "Max Value", "Condition", "Layer", "Width", "Height", "Style", "Color 1", + "Color 1 Alpha", "Color 2", "Color 2 Alpha", "Back Color", "Color 4 Alpha", "Outline Size", "Outline Color", "Color 3 Alpha"]; + for(let i = 0; i < this.properties.length; i++) { + const prop = this.properties[i]; + this[prop] = info[prop]; + } + this._value = this.getCurrentValue(); + this._maxvalue = this.getMaxValue(); + this.refresh(true); +}; + +Sprite_HUDGauge.prototype.getCurrentValue = function() { + let result; + try { + result = eval(this["Cur. Value"]); + } catch(e) { + console.log('Error with Gauge\n' + e); + result = 0; + } + return result; +}; + +Sprite_HUDGauge.prototype.getMaxValue = function() { + let result; + try { + result = eval(this["Max Value"]); + } catch(e) { + console.log('Error with Gauge\n' + e); + result = 0; + } + return result; +}; + +Sprite_HUDGauge.prototype.update = function() { + Sprite_HUDObject.prototype.update.call(this); + if(!this._isActive) return; + const newValue = this.getCurrentValue(); + const newMax = this.getMaxValue(); + if(this._value !== newValue || this._maxvalue !== newMax) { + this._value = newValue; + this._maxvalue = newMax; + this.refresh(); + } +}; + +Sprite_HUDGauge.prototype.refresh = function(refreshProperties) { + Sprite_HUDObject.prototype.refresh.apply(this, arguments); + if((this._value || this._value === 0) && (this._maxvalue || this._maxvalue == 0)) { + this.bitmap.clear(); + const outline = parseInt(this["Outline Size"]); + const width = this["Width"]; + const height = this["Height"]; + const color1 = _.convertHex(this["Color 1"], parseInt(this["Color 1 Alpha"])); + const color2 = _.convertHex(this["Color 2"], parseInt(this["Color 2 Alpha"])); + const outlineCol = _.convertHex(this["Outline Color"], parseInt(this["Color 3 Alpha"])); + const backCol = _.convertHex(this["Back Color"], parseInt(this["Color 4 Alpha"])); + this.bitmap.fillRect(0, 0, width + (outline * 2), height + (outline * 2), outlineCol); + this.bitmap.fillRect(outline, outline, width, height, backCol); + const fillW = Math.floor(width * (this._value / this._maxvalue)) || 0; + const fillH = Math.floor(height * (this._value / this._maxvalue)) || 0; + const style = this["Style"]; + if(style === 'up') { + this.bitmap.gradientFillRect(outline, (height - fillH) + outline, width, fillH, color2, color1, true); + } else if(style === 'down') { + this.bitmap.gradientFillRect(outline, outline, width, fillH, color1, color2, true); + } else if(style === 'left') { + this.bitmap.gradientFillRect(outline, outline, fillW, height, color2, color1); + } else if(style === 'right') { + this.bitmap.gradientFillRect((width - fillW) + outline, outline, fillW, height, color1, color2); + } + } +}; + +Sprite_HUDGauge.prototype.refreshProperties = function() { + Sprite_HUDObject.prototype.refreshProperties.apply(this, arguments); + const bit = this.bitmap; + const outline = parseInt(this["Outline Size"]); + const width = parseInt(this["Width"]) + (outline * 2); + const height = parseInt(this["Height"]) + (outline * 2); + this.resizeBitmap(bit, width, height); + this.z = parseInt(this["Layer"]); + this.setupSnaps(); +}; + +//----------------------------------------------------------------------------- +// Sprite_HUDImageGauge +//----------------------------------------------------------------------------- + +function Sprite_HUDImageGauge() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDImageGauge.prototype = Object.create(Sprite_HUDObject.prototype); +Sprite_HUDImageGauge.prototype.constructor = Sprite_HUDImageGauge; + +Sprite_HUDImageGauge._label = "Image Gauge"; + +/* + * Get HTML for Sprite_HUDImageGauge manipulation + */ +Sprite_HUDImageGauge.getHtml = function(data) { + const value = data["Cur. Value"]; + const max = data["Max Value"]; + let condition = data["Condition"]; + const layer = data["Layer"]; + const scaleX = data["Scale X"]; + const scaleY = data["Scale Y"]; + const fill = data["Style"]; + const main = data["Main Image"]; + const back = data["Back Image"]; + + const sele2 = ['', '', '', '']; + if(fill === 'left') sele2[0] = 'selected'; + else if(fill === 'right') sele2[1] = 'selected'; + else if(fill === 'up') sele2[2] = 'selected'; + else if(fill === 'down') sele2[3] = 'selected'; + + try { + eval(condition); + } catch(e) { + data["Condition"] = ''; + condition = ''; + } + + return `${HUDManager.createTitle(data.id, Sprite_HUDImageGauge._label)} + + ${HUDManager.createHeader()} + ${HUDManager.createInput("Cur. Value", value)} + ${HUDManager.createInput("Max Value", max)} + ${HUDManager.createConditionInput("Condition", condition)} + ${HUDManager.createInput("Layer", layer)} + ${HUDManager.createFilelist("Main Image", 'gauge_images', main)} + ${HUDManager.createFilelist("Back Image", 'gauge_backs', back, true)} + ${HUDManager.createInput("Scale X", scaleX)} + ${HUDManager.createInput("Scale Y", scaleY)} + ${HUDManager.createSelect("Style", ["left", sele2[0], "Left"], + ["right", sele2[1], "Right"], + ["up", sele2[2], "Up"], + ["down", sele2[3], "Down"])} + ${HUDManager.createRefresh()} +
`; +}; + +/* + * Register Sprite_HUDImageGauge within the HUDManager + */ +HUDManager.typeNames.push(Sprite_HUDImageGauge._label); +HUDManager.types[Sprite_HUDImageGauge._label] = { + class: Sprite_HUDImageGauge, + html: Sprite_HUDImageGauge.getHtml, + data: { + "type": Sprite_HUDImageGauge._label, + "Cur. Value": "$gameParty.leader().hp", + "Max Value": "$gameParty.leader().mhp", + "Condition": "", + "Layer": "0", + "Scale X": "1", + "Scale Y": "1", + "Style": "left", + "Main Image": _.getFirstFile('gauge_images'), + "Back Image": _.getFirstFile('gauge_backs') + }, + format: function(data) { + let temp; + try { + temp = String(eval(data["Cur. Value"])); + temp += "/" + String(eval(data["Max Value"])); + } catch(e) { + temp = "ERROR"; + } + if(temp.length > 12) temp = temp.substring(0, 12) + "..."; + return temp; + } +} + +Sprite_HUDImageGauge.prototype.initialize = function(info) { + Sprite_HUDObject.prototype.initialize.call(this, new Bitmap(1, 1), info); + this.properties = ["Cur. Value", "Max Value", "Condition", "Layer", "Scale X", "Scale Y", "Style", + "Main Image", "Back Image"]; + for(let i = 0; i < this.properties.length; i++) { + const prop = this.properties[i]; + this[prop] = info[prop]; + } + this._value = this.getCurrentValue(); + this._maxvalue = this.getMaxValue(); + this._gauge = new Sprite(); + this._gauge.anchor.y = 0.5; + this.addChild(this._gauge); + this.refresh(true); +}; + +Sprite_HUDImageGauge.prototype.getCurrentValue = function() { + let result; + try { + result = eval(this["Cur. Value"]); + } catch(e) { + console.log('Error with Gauge\n' + e); + result = 0; + } + return result; +}; + +Sprite_HUDImageGauge.prototype.getMaxValue = function() { + let result; + try { + result = eval(this["Max Value"]); + } catch(e) { + console.log('Error with Gauge\n' + e); + result = 0; + } + return result; +}; + +Sprite_HUDImageGauge.prototype.update = function() { + Sprite_HUDObject.prototype.update.call(this); + if(!this._isActive) return; + const newValue = this.getCurrentValue(); + const newMax = this.getMaxValue(); + if(this._value !== newValue || this._maxvalue !== newMax) { + this._value = newValue; + this._maxvalue = newMax; + this.refresh(); + } +}; + +Sprite_HUDImageGauge.prototype.refresh = function(refreshProperties) { + Sprite_HUDObject.prototype.refresh.apply(this, arguments); + const style = this["Style"]; + const horizontal = Boolean(style === 'left' || style === 'right'); + if(this.bitmap) { + this.bitmap.addLoadListener(function() { + if($gameTemp.isManipulatingHud && this.highlight) this.highlight.setup(this); + if(horizontal) { + this._gauge.y = 0; + this._gauge.x = (this.bitmap.width / -2); + this._gauge.anchor.x = 0; + this._gauge.anchor.y = 0.5; + } else { + this._gauge.x = 0; + this._gauge.y = (this.bitmap.height / -2); + this._gauge.anchor.y = 0; + this._gauge.anchor.x = 0.5; + } + this.setupSnaps(); + }.bind(this)); + } + if((this._value || this._value === 0) && (this._maxvalue || this._maxvalue == 0)) { + this._gauge.bitmap.addLoadListener(function() { + if(horizontal) { + this._gauge._frame.height = this._gauge.bitmap.height; + this._gauge._frame.y = 0; + this._gauge._frame.width = this._gauge.bitmap.width * (this._value / this._maxvalue); + if(style === 'right') { + this._gauge._frame.x = this._gauge.bitmap.width - this._gauge._frame.width; + if(this.bitmap) this._gauge.x = (this.bitmap.width / -2) + this._gauge._frame.x; + } else if(style === 'left') { + this._gauge._frame.x = 0; + if(this.bitmap) this._gauge.x = (this.bitmap.width / -2); + } + this._gauge._refresh(); + if(!this.bitmap) { + this._gauge.x = (this._gauge.bitmap.width / -2); + this.setupSnaps2(); + } + } else { + this._gauge._frame.width = this._gauge.bitmap.width; + this._gauge._frame.x = 0; + this._gauge._frame.height = this._gauge.bitmap.height * (this._value / this._maxvalue); + if(style === 'down') { + this._gauge._frame.y = this._gauge.bitmap.height - this._gauge._frame.height; + this._gauge.y = (this.bitmap.height / -2) + this._gauge._frame.y; + } else if(style === 'up') { + this._gauge._frame.y = 0; + this._gauge.y = (this.bitmap.height / -2); + } + this._gauge._refresh(); + if(!this.bitmap) { + this._gauge.y = (this._gauge.bitmap.height / -2); + this.setupSnaps2(); + } + } + }.bind(this)); + } +}; + +Sprite_HUDImageGauge.prototype.refreshProperties = function() { + Sprite_HUDObject.prototype.refreshProperties.apply(this, arguments); + this.z = parseInt(this["Layer"]); + const front = this["Main Image"]; + const back = this["Back Image"]; + if(front) { + this._gauge.bitmap = _.getGauge(front); + this._baseXScale = parseFloat(this["Scale X"]); + this._baseYScale = parseFloat(this["Scale Y"]); + this.updateRealScale(); + } + if(back && back !== "N\n\nONE") { + this.bitmap = _.getGaugeBack(back); + } else { + this.bitmap = null; + } +}; + +Sprite_HUDImageGauge.prototype.setupSnaps2 = function() { + const width = this._gauge.width * this._baseXScale; + const height = this._gauge.height * this._baseYScale; + this.xSnaps = [width / 2, Graphics.boxWidth / 2, Graphics.boxWidth - (width / 2)]; + this.ySnaps = [height / 2, Graphics.boxHeight / 2, Graphics.boxHeight - (height / 2)]; +}; + +//----------------------------------------------------------------------------- +// Sprite_HUDImageText +//----------------------------------------------------------------------------- + +function Sprite_HUDImageText() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDImageText.prototype = Object.create(Sprite_HUDObject.prototype); +Sprite_HUDImageText.prototype.constructor = Sprite_HUDImageText; + +Sprite_HUDImageText._label = "Image Numbers"; + +/* + * Get HTML for Sprite_HUDText manipulation + */ +Sprite_HUDImageText.getHtml = function(data) { + const value = data["Value"]; + let condition = data["Condition"]; + const layer = data["Layer"]; + const image = data["Image"]; + const scaleX = data["Scale X"]; + const scaleY = data["Scale Y"]; + const opacity = data["Opacity"]; + const hue = data["Hue"]; + const blend = data["Blend"]; + + try { + eval(condition); + } catch(e) { + data["Condition"] = ''; + condition = ''; + } + + const blendArray = []; + for(let i = 0; i <= 16; i++) { + blendArray.push([String(i), parseInt(blend) === i ? 'selected' : '', _.blendNames[i]]) + } + + return `${HUDManager.createTitle(data.id, Sprite_HUDImageText._label)} + + ${HUDManager.createHeader()} + ${HUDManager.createInput("Value", value)} + ${HUDManager.createConditionInput("Condition", condition)} + ${HUDManager.createInput("Layer", layer)} + ${HUDManager.createFilelist("Image", 'numbers', image)} + ${HUDManager.createInput("Scale X", scaleX)} + ${HUDManager.createInput("Scale Y", scaleY)} + ${HUDManager.createInput("Opacity", opacity)} + ${HUDManager.createInput("Hue", hue)} + ${HUDManager.createSelectArray("Blend", blendArray)} + ${HUDManager.createRefresh()} +
`; +}; + +/* + * Register Sprite_HUDImageText within the HUDManager + */ +HUDManager.typeNames.push(Sprite_HUDImageText._label); +HUDManager.types[Sprite_HUDImageText._label] = { + class: Sprite_HUDImageText, + html: Sprite_HUDImageText.getHtml, + data: { + "type": Sprite_HUDImageText._label, + "Value": "$gameParty.gold()", + "Condition": "", + "Layer": "0", + "Image": _.getFirstFile('numbers'), + "Scale X": "1", + "Scale Y": "1", + "Opacity": "255", + "Hue": "0", + "Blend": "0" + }, + format: function(data) { + let temp; + try { + temp = String(eval(data["Value"])); + } catch(e) { + temp = "ERROR"; + } + if(temp.length > 12) temp = temp.substring(0, 12) + "..."; + return temp; + } +} + +Sprite_HUDImageText.prototype.initialize = function(info) { + Sprite_HUDObject.prototype.initialize.call(this, new Bitmap(1, 1), info); + this.properties = ["Value", "Layer", "Condition", "Image", "Scale X", "Scale Y", "Opacity", "Hue", "Blend"]; + for(let i = 0; i < this.properties.length; i++) { + const prop = this.properties[i]; + this[prop] = info[prop]; + } + this._value = this.getValue(); + this._textLength = String(this._value).length; + this._oBitmap = null; + this._numbers = []; + this.refresh(true); +}; + +Sprite_HUDImageText.prototype.getValue = function() { + let result; + try { + result = eval(this["Value"]); + } catch(e) { + console.log('Error with Image Text\n' + e); + result = 0; + } + return result; +}; + +Sprite_HUDImageText.prototype.update = function() { + Sprite_HUDObject.prototype.update.call(this); + if(!this._isActive) return; + const newValue = this.getValue(); + if(this._value !== newValue) { + this._value = newValue; + this.refresh(); + } +}; + +Sprite_HUDImageText.prototype.refresh = function(refreshProperties) { + Sprite_HUDObject.prototype.refresh.apply(this, arguments); + this._oBitmap.addLoadListener(function() { + const width = this._oBitmap.width / 10; + const height = this._oBitmap.height; + this._textLength = String(this._value).length; + this.bitmap = new Bitmap(width * this._textLength, height); + if(this._numbers.length !== this._textLength) { + this.clearNumbers(); + this.createNumbers(width); + } + this.applyNumbers(width, height); + if($gameTemp.isManipulatingHud && this.highlight) this.highlight.setup(this); + this.setupSnaps(); + }.bind(this)); +}; + +Sprite_HUDImageText.prototype.clearNumbers = function() { + this._numbers.forEach(function(number) { + this.removeChild(number); + }, this); + this._numbers = []; +}; + +Sprite_HUDImageText.prototype.createNumbers = function(width) { + for(let i = 0; i < this._textLength; i++) { + const sprite = new Sprite(this._oBitmap); + sprite.anchor.set(0.5); + sprite.blendMode = parseInt(this["Blend"]); + this.addChild(sprite); + this._numbers.push(sprite); + sprite.x = (i * width) - (this.bitmap.width / 2) + (width / 2); + } +}; + +Sprite_HUDImageText.prototype.applyNumbers = function(width, height) { + const strValue = String(this._value); + for(let i = 0; i < this._textLength; i++) { + const num = parseInt(strValue[i]); + this._numbers[i].setFrame(width * num, 0, width, height); + } +}; + +Sprite_HUDImageText.prototype.refreshProperties = function() { + Sprite_HUDObject.prototype.refreshProperties.apply(this, arguments); + this.z = parseInt(this["Layer"]); + this.clearNumbers(); + this._value = this.getValue(); + this._oBitmap = _.getNumbers(this["Image"], parseInt(this["Hue"])); + this._baseXScale = parseFloat(this["Scale X"]); + this._baseYScale = parseFloat(this["Scale Y"]); + this.updateRealScale(); + this.opacity = parseInt(this["Opacity"]); + this._numbers.forEach(function(sprite) { + sprite.blendMode = parseInt(this["Blend"]); + }, this); +}; + +//----------------------------------------------------------------------------- +// Sprite_HUDFace +//----------------------------------------------------------------------------- + +function Sprite_HUDFace() { + this.initialize.apply(this, arguments); +} + +Sprite_HUDFace.prototype = Object.create(Sprite_HUDObject.prototype); +Sprite_HUDFace.prototype.constructor = Sprite_HUDFace; + +Sprite_HUDFace._label = "Actor Face"; + +/* + * Get HTML for Sprite_HUDText manipulation + */ +Sprite_HUDFace.getHtml = function(data) { + const value = data["Actor ID"]; + let condition = data["Condition"]; + const layer = data["Layer"]; + const width = data["Width"]; + const height = data["Height"]; + const color = data["Background Color"]; + const alpha = data["Background Alpha"]; + const mask = data["Mask"]; + + const sele = ['', '']; + if(mask === '0') sele[0] = 'selected'; + else if(mask === '1') sele[1] = 'selected'; + + try { + eval(condition); + } catch(e) { + data["Condition"] = ''; + condition = ''; + } + + return `${HUDManager.createTitle(data.id, Sprite_HUDImageText._label)} + + ${HUDManager.createHeader()} + ${HUDManager.createInput("Actor ID", value)} + ${HUDManager.createConditionInput("Condition", condition)} + ${HUDManager.createInput("Layer", layer)} + ${HUDManager.createInput("Width", width)} + ${HUDManager.createInput("Height", height)} + ${HUDManager.createColor("Background Color", color, "Background Alpha", alpha)} + ${HUDManager.createSelect("Mask", ["0", sele[0], "None"], + ["1", sele[1], "Circle"])} + ${HUDManager.createRefresh()} +
`; +}; + +/* + * Register Sprite_HUDImageText within the HUDManager + */ +HUDManager.typeNames.push(Sprite_HUDFace._label); +HUDManager.types[Sprite_HUDFace._label] = { + class: Sprite_HUDFace, + html: Sprite_HUDFace.getHtml, + data: { + "type": Sprite_HUDFace._label, + "Actor ID": "$gameParty.leader().actorId()", + "Condition": "", + "Layer": "0", + "Width": "144", + "Height": "144", + "Background Color": '#FFFFFF', + "Background Alpha": "255", + "Mask": "1" + }, + format: function(data) { + let temp; + try { + temp = "Actor: " + String(eval(data["Actor ID"])); + } catch(e) { + temp = "ERROR"; + } + if(temp.length > 12) temp = temp.substring(0, 12) + "..."; + return temp; + } +} + +Sprite_HUDFace.prototype.initialize = function(info) { + Sprite_HUDObject.prototype.initialize.call(this, new Bitmap(1, 1), info); + this.properties = ["Actor ID", "Layer", "Condition", "Width", "Height", "Background Color", "Background Alpha", "Mask"]; + for(let i = 0; i < this.properties.length; i++) { + const prop = this.properties[i]; + this[prop] = info[prop]; + } + this._value = this.getActorId(); + this._actor = $gameActors.actor(this._value); + this._curFace = this._actor.faceName(); + this.refresh(true); +}; + +Sprite_HUDFace.prototype.getActorId = function() { + let result; + try { + result = eval(this["Actor ID"]); + } catch(e) { + console.log('Error with Actor Face\n' + e); + result = 1; + } + return result; +}; + +Sprite_HUDFace.prototype.update = function() { + Sprite_HUDObject.prototype.update.call(this); + if(!this._isActive) return; + const newValue = this.getActorId(); + if(this._value !== newValue || this._curFace !== this._actor.faceName()) { + this._value = newValue; + this.refresh(true); + } +}; + +Sprite_HUDFace.prototype.refresh = function(refreshProperties) { + Sprite_HUDObject.prototype.refresh.apply(this, arguments); + this._oBitmap.addLoadListener(this.refreshBitmap.bind(this)); +}; + +Sprite_HUDFace.prototype.refreshBitmap = function() { + this.bitmap.clear(); + const color = _.convertHex(this["Background Color"], parseInt(this["Background Alpha"])); + this.bitmap.fillRect(0, 0, this.bitmap.width, this.bitmap.height, color); + this.drawFace(this._actor.faceIndex(), parseInt(this["Width"]), parseInt(this["Height"])); + this.setupSnaps(); +}; + +Sprite_HUDFace.prototype.drawFace = function(faceIndex, width, height) { + width = width || Window_Base._faceWidth; + height = height || Window_Base._faceHeight; + var pw = Window_Base._faceWidth; + var ph = Window_Base._faceHeight; + var sx = faceIndex % 4 * pw + (pw - pw) / 2; + var sy = Math.floor(faceIndex / 4) * ph + (ph - ph) / 2; + this.bitmap.blt(this._oBitmap, sx, sy, pw, ph, 0, 0, width, height); +}; + +Sprite_HUDFace.prototype.refreshProperties = function() { + Sprite_HUDObject.prototype.refreshProperties.apply(this, arguments); + const bit = this.bitmap; + const width = parseInt(this["Width"]); + const height = parseInt(this["Height"]); + this.resizeBitmap(bit, width, height); + this.z = parseInt(this["Layer"]); + this._value = this.getActorId(); + this._actor = $gameActors.actor(this._value); + this._curFace = this._actor.faceName(); + this._oBitmap = ImageManager.loadFace(this._actor.faceName()); + this.refreshMask(width, height); +}; + +Sprite_HUDFace.prototype.refreshMask = function(width, height) { + if(this._maskSprite) this.removeChild(this._maskSprite); + this.createMask(); + this.refreshMaskBitmap(width, height); + this.redrawMask(); +}; + +Sprite_HUDFace.prototype.createMask = function() { + this._maskSprite = new Sprite(new Bitmap(1, 1)); + this._maskSprite.anchor.set(0.5); + this.mask = this._maskSprite; + this.addChild(this._maskSprite); +}; + +Sprite_HUDFace.prototype.refreshMaskBitmap = function(width, height) { + const spr = this._maskSprite; + spr.bitmap.resize(width, height); + spr._frame.width = 0; + spr._frame.height = 0; + if(_.isV150) { + spr._refreshFrame = true; + spr._onBitmapLoad(spr.bitmap); + } else { + spr._onBitmapLoad(); + } +}; + +Sprite_HUDFace.prototype.redrawMask = function() { + const bit = this._maskSprite.bitmap; + bit.clear(); + if(this["Mask"] === "0") { + bit.fillRect(0, 0, bit.width, bit.height, "#ffffff"); + } else { + bit.fillRect(0, 0, bit.width, bit.height, "#000000"); + const w2 = bit.width / 2, h2 = bit.height / 2; + bit.drawOval(w2, h2, w2, h2, "#ffffff"); + } +}; + +})(SRD.HUDMaker); \ No newline at end of file diff --git a/js/plugins/SRD_SuperToolsEngine.js b/js/plugins/SRD_SuperToolsEngine.js new file mode 100644 index 0000000..907dd9e --- /dev/null +++ b/js/plugins/SRD_SuperToolsEngine.js @@ -0,0 +1,3114 @@ +/*: + * @plugindesc The heart of all maker-style plugins; it adds a playtesting editor that can be opened with F12. + * @author SumRndmDde + * + * @param Connect Editor + * @type boolean + * @desc If ON, the Editor Window will be "connected" to the main window. + * @default true + * + * @param Auto Open Window + * @type boolean + * @desc If ON, the game window will automatically open the Editor Window is opened. + * @default false + * + * @param Auto Move Window + * @type boolean + * @desc If ON, the game window will automatically be moved to the side when Editor Window is opened. + * @default true + * + * @param Menu Editor Exempt List + * @type text[] + * @desc This is a list of all the windows that are not allowed to be manipulated using the Menu Editor + * @default ["Window_BattleLog","Window_MapName"] + * + * @help + * + * Super Tools Engine + * Version 1.31 + * SumRndmDde + * + * + * This plugin is the core of all maker-style plugins; it adds a playtest editor + * that can be opened with F12 while playtesting. Using this editor, various + * actions can be taken and different tools can be used to help test or + * build one's game. + * + * + * ============================================================================== + * Tool Kit + * ============================================================================== + * + * This is where lanuchers for the various tools will appear. By default, there + * are only three tools, but extension plugins will add more later. + * + * + * + * Database EX + * + * A tool that adds, edits, and upgrades various MV Database inputs. It can also + * have custom editors added to it through extension plugins. + * + * + * + * Debug Tool + * + * A tool containing various features for testing one's game. + * + * + * + * Menu Editor + * + * A tool that allows developers to edit the window setups for scenes. + * + * + * ============================================================================== + * Playtester + * ============================================================================== + * + * The functions here are to support general playtesting. They involve using + * quick and simple restarts, saves, and loads. + * + * + * + * Reload Game + * + * Restarts the game and reloads all data. Allows developers to apply edits + * to the game without closing the playtesting window. + * + * + * + * Quick Save + * + * Quickly saves the game so it can be loaded through "Quick Load". + * + * + * + * Quick Load + * + * Quickly loads the game from the last quick save. + * + * + * + * Quick Load + Reload + * + * Preforms the same function as "reload game", but loads the most recent quick + * save after loading. + * + * + * ============================================================================== + * Options + * ============================================================================== + * + * These allow developers to customize the design/mechanics of the playtesting + * editor. + * + * + * + * Theme + * + * Chooses the color scheme of the editor. + * "Absolute Randomness" generates random colors every time it is selected. + * + * + * + * Follow Mode + * + * If checked, then the playtesting editor will follow the game window on screen + * based off of its position. + * + * + * + * Follow X + * + * The relative X position for the playtesting editor while using "Follow Mode". + * + * + * + * Follow Y + * + * The relative Y position for the playtesting editor while using "Follow Mode". + * + * + * ============================================================================== + * End of Help File + * ============================================================================== + * + * Welcome to the bottom of the Help file. + * + * + * Thanks for reading! + * If you have questions, or if you enjoyed this Plugin, please check + * out my YouTube channel! + * + * https://www.youtube.com/c/SumRndmDde + * + * + * Until next time, + * ~ SumRndmDde + * + */ + +var SRD = SRD || {}; +SRD.SuperToolsEngine = SRD.SuperToolsEngine || {}; +SRD.NotetagGetters = SRD.NotetagGetters || []; + +var Imported = Imported || {}; +Imported["SumRndmDde Super Tools Engine"] = 1.31; + +var $dataWindows = {}; +var $dataBasicEX = {}; +var $dataNotes = {}; + +function MakerManager() { + throw new Error('You silly-billy, MakerManager is a static class! (。•̀ᴗ-)✧'); +} + +function FileManager() { + throw new Error('Hey, noob! FileManager is a static class! ヾ(о-ω・)ノ⌒★'); +} + +function DataManagerEX() { + throw new Error('It doesn\'t matter how extreme, DataManagerEX is a static class! (╬Ò^Ó)'); +} + +function DebugManager() { + throw new Error('Uh... DebugManager is a static class! (/ε\*)'); +} + +function WindowManager() { + throw new Error('Great job. WindowManager is a static class! ʕ·ᴥ· ʔ'); +} + +// Fix the flag check for 1.6 editor and 1.5 or below project +if(process.versions['node-webkit'] >= "0.13.0" && Utils.RPGMAKER_VERSION < "1.6.0") { + +Utils.isOptionValid = function(name) { + if (location.search.slice(1).split('&').contains(name)) {return 1;}; + if (typeof nw !== "undefined" && nw.App.argv.length > 0 && nw.App.argv[0].split('&').contains(name)) {return 1;}; + return 0; +}; + +} + +(function(_) { + +"use strict"; + +//----------------------------------------------------------------------------- +// SRD.SuperToolsEngine +//----------------------------------------------------------------------------- + +const params = PluginManager.parameters('SRD_SuperToolsEngine'); + +if(!params['Menu Editor Exempt List']) { + +alert('SRD_SuperToolsEngine has updated its parameter system!\nPlease reinstall the plugin or update the parameters!'); +return; + +} + +_.connect = String(params['Connect Editor']).trim().toLowerCase() === 'true'; +_.move = String(params['Auto Move Window']).trim().toLowerCase() === 'true'; +_.open = String(params['Auto Open Window']).trim().toLowerCase() === 'true'; +_.banList = JSON.parse(params['Menu Editor Exempt List']); + +_.isPlaytest = Utils.isOptionValid('test') && Utils.isNwjs(); +_.isNewNWjs = process.versions['node-webkit'] >= "0.13.0"; + +if(_.isPlaytest && _.isNewNWjs) { + if(!require('fs').existsSync("supertoolsengine.html")) require('fs').writeFileSync("supertoolsengine.html", ""); +} + +_.pad = function(value) { + return (value < 10) ? "0" + value : value; +}; + +_.capFirst = function(value) { + return value.substring(0, 1).toUpperCase() + value.substring(1); +}; + +_.loadNotetags = function() { + _.loadBasicData(); + _.loadNoteData(); + _.checkPartySystem(); +}; + +_.loadBasicData = function() { + Object.keys($dataBasicEX).forEach(function(key) { + const dataObj = window["$data" + key]; + const ids = $dataBasicEX[key]; + Object.keys(ids).forEach(function(id) { + const data = dataObj[parseInt(id)]; + if(data) { + const props = ids[id]; + Object.keys(props).forEach(function(prop) { + const type = props[prop].substring(0, 1); + const value = props[prop].substring(1); + if(type === '^') { + data[prop] = String(value); + } else if(type === '#') { + data[prop] = Number(value); + } else if(type === '$') { + Object.defineProperty(data, prop, { + get: function() { + try { + return eval(value); + } catch(e) { + alert('There was error. Please visit console.') + console.log(value + '\n' + e); + return ''; + } + }, + set: function(value) {}, + configurable: true + }); + } + }); + } + }); + }); +}; + +_.loadNoteData = function() { + Object.keys($dataNotes).forEach(function(key) { + const dataObj = window["$data" + key]; + const ids = $dataNotes[key]; + Object.keys(ids).forEach(function(id) { + const data = dataObj[parseInt(id)]; + const note = ids[id]; + if(data && note) { + if(data.note === undefined) data.note = ''; + data.note += '\n' + note; + } + }); + }); +}; + +_.checkPartySystem = function() { + if(Imported.YEP_PartySystem && Yanfly.Party.version < 1.12) { + alert('Please update YEP_PartySystem to version 1.12 or above!'); + } +}; + +SRD.NotetagGetters.push(_.loadNotetags); + +//----------------------------------------------------------------------------- +// DataManager +//----------------------------------------------------------------------------- + +DataManager._testExceptions = ["Windows.json", "DataEX.json", "Notes.json"]; + +DataManager._databaseFiles.push({name: '$dataWindows', src: "Windows.json"}); +DataManager._databaseFiles.push({name: '$dataBasicEX', src: "DataEX.json"}); +DataManager._databaseFiles.push({name: '$dataNotes', src: "Notes.json"}); + +if(!SRD.DataManager_isDatabaseLoaded) { + +SRD.notetagsLoaded = false; +SRD.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded; +DataManager.isDatabaseLoaded = function() { + if(!SRD.DataManager_isDatabaseLoaded.apply(this, arguments)) return false; + if(!SRD.notetagsLoaded) { + SRD.NotetagGetters.forEach(function(func) { + func.call(this); + }, this); + SRD.notetagsLoaded = true; + } + return true; +}; + +} + +DataManager.deleteGlobal = function(id) { + const globalInfo = this.loadGlobalInfo(); + if(!globalInfo) return; + delete globalInfo[id]; + const newGlobalInfo = []; + for(let i = 0; i < globalInfo.length; i++) { + if(globalInfo[i]) newGlobalInfo[i] = globalInfo[i]; + } + this.saveGlobalInfo(newGlobalInfo); +}; + +_.DataManager_loadDataFile = DataManager.loadDataFile; +DataManager.loadDataFile = function(name, src) { + if(src.substring(0, 5) === 'Test_') { + const oriSrc = src.substring(5); + if(this._testExceptions.contains(oriSrc)) { + src = oriSrc; + } + } + _.DataManager_loadDataFile.call(this, name, src); +}; + +//----------------------------------------------------------------------------- +// ConfigManager +//----------------------------------------------------------------------------- + +ConfigManager.STE_Theme = 0; +ConfigManager.STE_Follow = false; +ConfigManager.STE_FollowX = 6; +ConfigManager.STE_FollowY = 0; + +_.ConfigManager_makeData = ConfigManager.makeData; +ConfigManager.makeData = function() { + const config = _.ConfigManager_makeData.apply(this, arguments); + config.STE_Theme = this.STE_Theme; + config.STE_Follow = this.STE_Follow; + config.STE_FollowX = this.STE_FollowX; + config.STE_FollowY = this.STE_FollowY; + return config; +}; + +_.ConfigManager_applyData = ConfigManager.applyData; +ConfigManager.applyData = function(config) { + _.ConfigManager_applyData.apply(this, arguments); + this.STE_Theme = this.readSTECoord(config, 'STE_Theme'); + this.STE_Follow = this.readFlag(config, 'STE_Follow'); + this.STE_FollowX = this.readSTECoord(config, 'STE_FollowX', 6); + this.STE_FollowY = this.readSTECoord(config, 'STE_FollowY'); +}; + +ConfigManager.readSTECoord = function(config, name, def) { + const value = config[name]; + if (value !== undefined) { + return Number(value); + } else { + return def || 0; + } +}; + +//----------------------------------------------------------------------------- +// SceneManager +//----------------------------------------------------------------------------- + +_.SceneManager_onSceneStart = SceneManager.onSceneStart; +SceneManager.onSceneStart = function() { + _.SceneManager_onSceneStart.apply(this, arguments); + this._scene.initCustomWindowPositions(); +}; + +if(_.isPlaytest) { + +_.SceneManager_onKeyDown = SceneManager.onKeyDown; +SceneManager.onKeyDown = function(event) { + _.SceneManager_onKeyDown.apply(this, arguments); + if(event.keyCode === 123) { + this.openMaker(); + } +}; + +SceneManager.openMaker = function() { + if(MakerManager.window) { + MakerManager.closeMaker(); + } else { + MakerManager.openMaker(); + } +}; + +_.SceneManager_updateMain = SceneManager.updateMain; +SceneManager.updateMain = function() { + if(DebugManager.gameSpeed === 1) { + _.SceneManager_updateMain.apply(this, arguments); + } else { + for(let i = 0; i < DebugManager.gameSpeed; i++) { + this.updateInputData(); + this.changeScene(); + this.updateScene(); + if(i + 1 === DebugManager.gameSpeed) { + this.renderScene(); + this.requestUpdate(); + } + } + } +}; + +//----------------------------------------------------------------------------- +// MakerManager +//----------------------------------------------------------------------------- + +MakerManager._window = null; +MakerManager._styling = null; +MakerManager._mode = ''; + +Object.defineProperty(MakerManager, 'window', { + get: function() { + return this._window; + }, + configurable: true +}); + +Object.defineProperty(MakerManager, 'mainHTML', { + get: function() { + if(!this._document) return null; + return this._document.body.innerHTML + }, + set: function(value) { + if(!this._document) return; + this._document.body.innerHTML = value; + }, + configurable: true +}); + +Object.defineProperty(MakerManager, 'document', { + get: function() { + if(!this._window) return null; + if(!this._document) { + this._document = this._window.window.document; + } + return this._document; + }, + configurable: true +}); + +Object.defineProperty(MakerManager, 'style', { + get: function() { + return this._styling; + }, + configurable: true +}); + +Object.defineProperty(MakerManager, 'mode', { + get: function() { + return this._mode; + }, + set: function(value) { + return this._mode = value; + }, + configurable: true +}); + +Object.defineProperty(MakerManager, 'colors', { + get: function() { + return this._colors; + }, + configurable: true +}); + +MakerManager.initManager = function() { + this._listIndex = 0; + this.setupGameWindow(); + this.updateTheme(); +}; + +MakerManager.openMaker = function() { + if(this._window) this._window.close(true); + this.createWindow(); + if(!_.isNewNWjs) { + this.moveWindow(); + this.setupWindow(); + this._window.on('loaded', this.onWindowLoad.bind(this)); + } +}; + +MakerManager.closeMaker = function() { + this.onFinish(); + this._window.close(true); +}; + +MakerManager.deleteMaker = function() { + this._window = null; +}; + +MakerManager.createWindow = function() { + const gui = require('nw.gui'); + if(_.isNewNWjs) { + gui.Window.open('supertoolsengine.html', { + title: "Super Tools Engine - Core Editor | SumRndmDde", + width: 600, + height: 680, + resizable: false, + icon: "www/icon/icon.png" + }, function(newWindow) { + this._window = newWindow; + this._window.setShowInTaskbar(false); + this.moveWindow(); + this.setupWindow(); + this._window.on('loaded', this.onWindowLoad.bind(this)); + }.bind(this)); + } else { + this._window = gui.Window.open('', { + title: "Super Tools Engine - Core Editor | SumRndmDde", + width: 600, + height: 680, + resizable: false, + toolbar: false, + icon: "www/icon/icon.png" + }); + this._window.setShowInTaskbar(false); + } +}; + +MakerManager.moveWindow = function() { + if(_.move) { + window.moveBy(-300, 0); + this._window.moveTo(window.screenX + Graphics.boxWidth + 6, window.screenY); + } +}; + +MakerManager.setupWindow = function() { + this._window.on('closed', this.deleteMaker.bind(this)); + this._window.on('close', this.closeMaker.bind(this)); +}; + +MakerManager.onWindowLoad = function() { + this.buildWindow(); + this.assignWindow(); + this.focusWindow(); +}; + +MakerManager.buildWindow = function() { + this._document = this._window.window.document; + this._styling = this._document.createElement('style'); + this._document.head.appendChild(this._styling); + this._document.addEventListener('keydown', SceneManager.onKeyDown.bind(SceneManager)); + this.setupWindowHtml(); +}; + +MakerManager.assignWindow = function() { + this._window.window.MakerManager = this; + this._window.window.DataManagerEX = DataManagerEX; + this._window.window.DebugManager = DebugManager; + this._window.window.WindowManager = WindowManager; +}; + +MakerManager.focusWindow = function() { + this._window.focus(); +}; + +MakerManager.onFinish = function() { + if(this.mode === 'data') { + DataManagerEX.onFinish(); + } + if(this.mode === 'debug') { + DebugManager.onFinish(); + } + if(this.mode === 'window') { + WindowManager.onFinish(); + } + if(_.move) { + window.moveBy(300, 0); + } +}; + +if(Imported["SumRndmDde Game Upgrade"]) { + +MakerManager.onWindowClose = function() { + GameWindowManager.onWindowClose(); +}; + +_.GameWindowManager_closeGame = GameWindowManager.closeGame; +GameWindowManager.closeGame = function() { + if(_.isPlaytest && MakerManager.window) { + MakerManager.closeTheWindows.call(GameWindowManager.window); + } else { + _.GameWindowManager_closeGame.apply(this, arguments); + } +}; + +} else { + +MakerManager.onWindowClose = function() { + MakerManager.closeTheWindows.call(this); +}; + +} + +MakerManager.closeTheWindows = function() { + DebugManager.deleteQuickSave(); + if(MakerManager.window) { + if(window.confirm('Are you sure you wish to close the game while Editor Window is active? Your changes will not be saved.')) { + MakerManager.window.close(true); + this.close(true); + } + } else { + this.close(true); + } +}; + +MakerManager.setupGameWindow = function() { + const gui = require('nw.gui'); + const win = gui.Window.get(); + + //Set up closing + win.removeAllListeners('close'); + win.on('close', this.onWindowClose.bind(win)); + + //Set up connection + if(_.connect) { + win.removeAllListeners('restore'); + win.removeAllListeners('focus'); + win.removeAllListeners('minimize'); + + win.on('focus', function() { + if(MakerManager.window) { + MakerManager.window.setAlwaysOnTop(true); + //MakerManager.window.show(); + MakerManager.window.restore(); + MakerManager.window.setAlwaysOnTop(false); + } + }); + win.on('restore', function() { + if(MakerManager.window) { + MakerManager.window.restore(); + } + }); + win.on('minimize', function() { + if(MakerManager.window) { + MakerManager.window.minimize(); + } + }); + } + + //Set up movement + win.removeAllListeners('move'); + win.on('move', function(x, y) { + if(ConfigManager.STE_Follow && MakerManager.window) { + MakerManager.window.x = x + Graphics.width + ConfigManager.STE_FollowX; + MakerManager.window.y = y + ConfigManager.STE_FollowY; + } + }); +}; + +MakerManager.setupWindowHtml = function() { + this.updateStyle(); + MakerManager.window.title = "Super Tools Engine - Core Editor | SumRndmDde"; + MakerManager.mode = ''; + this.setLauncherPage(); +}; + +MakerManager.updateStyle = function() { + this.updateTheme(); + this._styling.innerHTML = this.getStyle(); + this._document.body.style.cssText = `background-color: ${this._colors[3]}`; + this._document.body.text = this._colors[0]; +}; + +MakerManager.setLauncherPage = function() { + this.mainHTML = this.topBar(0) + this.getLauncherHtml(); + this.refreshEverything(); +}; + +MakerManager.setPlaytesterPage = function() { + this.mainHTML = this.topBar(1) + this.getPlaytesterHtml(); +}; + +MakerManager.setOptionsPage = function() { + this.mainHTML = this.topBar(2) + this.getOptionsHtml(); +}; + +MakerManager.topBar = function(index) { + const active = ['', '', '']; + active[index] = 'class="active"'; + return ``; +}; + +MakerManager.getLauncherHtml = function() { + return `

+ +
+

+
+

`; +}; + +MakerManager.refreshTable = function() { + const table = this._document.getElementById('MainTable'); + table.innerHTML = ` + Launch Button + Description + + ${this.getLauncherTable()}`; +}; + +MakerManager.refreshPages = function() { + const pages = this._document.getElementById('PageControl'); + pages.innerHTML = this.getPageControl(); +}; + +MakerManager.refreshEverything = function() { + this.refreshTable(); + this.refreshPages(); +}; + +MakerManager.getLauncherTable = function() { + let result = ''; + const buttons = this.getLauncherButtons(); + const count = this.getLauncherTableCount(); + const max = Math.min((this._listIndex + 1) * 5, count); + for(let i = this._listIndex * 5; i < max; i++) { + result += buttons[i]; + } + return result; +}; + +MakerManager.getLauncherButtons = function() { + if(this._buttons === undefined) this._buttons = this.getLauncherButtonsRaw(); + return this._buttons; +}; + +MakerManager.getLauncherButtonsRaw = function() { + return [ + `${this.generateLauncherRow("Database EX", "A tool that adds, edits, and upgrades various MV Database inputs.", "DataManagerEX.setupWindowHtml()", "#f41f1f")}`, + `${this.generateLauncherRow("Debug Tool", "A tool containing various features for testing one's game.", "DebugManager.setupWindowHtml()", "#1f8af4")}`, + `${this.generateLauncherRow("Menu Editor", "A tool that allows developers to edit the window setups for scenes.", "WindowManager.setupWindowHtml()", "#8a1ff4")}` + ]; +}; + +MakerManager.getLauncherTableCount = function() { + return this.getLauncherButtons().length; +}; + +MakerManager.getLauncherTableMax = function() { + const count = this.getLauncherTableCount(); + return Math.ceil(count / 5); +}; + +MakerManager.generateLauncherRow = function(name, description, method, color) { + color = color || "#000000"; + return ` + + ${description} + `; +}; + +MakerManager.getPageControl = function() { + const count = this.getLauncherTableCount(); + if(count < 6) return ''; + const max = this.getLauncherTableMax(); + return `
+ +
+ Page: (${this._listIndex + 1}/${max}) +
+ +
`; +}; + +MakerManager.incrementPage = function() { + const max = this.getLauncherTableMax(); + this._listIndex++; + if(this._listIndex + 1 > max) { + this._listIndex = 0; + } + this.refreshEverything(); +}; + +MakerManager.decrementPage = function() { + const max = this.getLauncherTableMax(); + this._listIndex--; + if(this._listIndex < 0) { + this._listIndex = max - 1; + } + this.refreshEverything(); +}; + +MakerManager.getOptionsHtml = function() { + const selected = ['', '']; + selected[ConfigManager.STE_Theme] = 'selected'; + const selected2 = (ConfigManager.STE_Follow) ? 'checked' : ''; + const list = this.getOptionsList(selected); + return `

+ + + + + + + + + + + + + + + + + + + + +
OptionValue
Theme + +
Follow Mode + +
Follow X + +
Follow Y + +

`; +}; + +MakerManager.updateFollow = function() { + ConfigManager.STE_Follow = this._document.getElementById('Follow').checked; + ConfigManager.STE_FollowX = parseInt(this._document.getElementById('FollowX').value); + ConfigManager.STE_FollowY = parseInt(this._document.getElementById('FollowY').value); + ConfigManager.save(); + if(ConfigManager.STE_Follow && MakerManager.window) { + MakerManager.window.x = window.screenX + Graphics.width + ConfigManager.STE_FollowX; + MakerManager.window.y = window.screenY + ConfigManager.STE_FollowY; + } +}; + +MakerManager.getOptionsList = function(selected) { + return ` + + + + + + + + `; +}; + +MakerManager.getMakerTheme = function() { + const val = this._document.getElementById('Theme').value; + ConfigManager.STE_Theme = parseInt(val); + ConfigManager.save(); + this.updateStyle(); +}; + +MakerManager.updateTheme = function() { + switch(ConfigManager.STE_Theme) { + case 0: + this._colors = [ + '#000', // Text Color + '#3E8E41', // Base Color + '#275929', // Base Color 2 + 'white', // Background Color + '#E7E7E7', // Border Color + '#F3F3F3', // Background Color 2 + '#ddd', // Top Menu On-Mouse + '#eee', // Top Menu No Select + '#ddd', // Table Border + '#f2f2f2', // Off-grid Color + '#ddd', // Grid Hover Color + '#999', // Button Shadow + '#666', // Pushed Button Shadow + '#ffffff', // Input Background + '#888888', // Input Border + '#ffffff', // Select Background + '#888888', // Select Border + '#ff9900', // Input Highlight + '#666' // Top Menu Text Color + ]; + break; + case 1: + this._colors = [ + '#fff', // Text Color + '#4c4cae', // Base Color + '#3e3e8e', // Base Color 2 + '#222', // Background Color + '#1a1a1a', // Border Color + '#2d2d2d', // Background Color 2 + '#444', // Top Menu On-Mouse + '#333', // Top Menu No Select + '#444', // Table Border + '#2d2d2d', // Off-grid Color + '#444', // Grid Hover Color + '#333', // Button Shadow + '#000', // Pushed Button Shadow + '#444444', // Input Background + '#888888', // Input Border + '#444444', // Select Background + '#888888', // Select Border + '#0099ff', // Input Highlight + '#666' // Top Menu Text Color + ]; + break; + case 2: + this._colors = [ + '#000', // Text Color + '#4caeae', // Base Color + '#3e8e8e', // Base Color 2 + '#eeeeff', // Background Color + '#d6d6E7', // Border Color + '#e2e2F3', // Background Color 2 + '#ccccdd', // Top Menu On-Mouse + '#ddddee', // Top Menu No Select + '#ddd', // Table Border + '#e1e1f2', // Off-grid Color + '#ccccdd', // Grid Hover Color + '#999', // Button Shadow + '#666', // Pushed Button Shadow + '#ffffff', // Input Background + '#888888', // Input Border + '#ffffff', // Select Background + '#888888', // Select Border + '#0099ff', // Input Highlight + '#666' // Top Menu Text Color + ]; + break; + case 3: + this._colors = [ + '#000', // Text Color + '#ae4cae', // Base Color + '#8e3e8e', // Base Color 2 + '#fff0ff', // Background Color + '#e6d5e6', // Border Color + '#f3e2f3', // Background Color 2 + '#dccbdc', // Top Menu On-Mouse + '#eeddee', // Top Menu No Select + '#ddd', // Table Border + '#f3e2f3', // Off-grid Color + '#dccbdc', // Grid Hover Color + '#999', // Button Shadow + '#666', // Pushed Button Shadow + '#ffffff', // Input Background + '#888888', // Input Border + '#ffffff', // Select Background + '#888888', // Select Border + '#ff00ff', // Input Highlight + '#666' // Top Menu Text Color + ]; + break; + case 4: + this._colors = [ + '#fff', // Text Color + '#ae4c4c', // Base Color + '#8e3e3e', // Base Color 2 + '#222', // Background Color + '#1a1a1a', // Border Color + '#2d2d2d', // Background Color 2 + '#444', // Top Menu On-Mouse + '#333', // Top Menu No Select + '#444', // Table Border + '#2d2d2d', // Off-grid Color + '#444', // Grid Hover Color + '#333', // Button Shadow + '#000', // Pushed Button Shadow + '#444444', // Input Background + '#888888', // Input Border + '#444444', // Select Background + '#888888', // Select Border + '#ff0000', // Input Highlight + '#666' // Top Menu Text Color + ]; + break; + case 5: + this._colors = [ + '#fff', // Text Color + '#8e8e3e', // Base Color + '#595927', // Base Color 2 + '#222211', // Background Color + '#1a1a09', // Border Color + '#2d2d1c', // Background Color 2 + '#444433', // Top Menu On-Mouse + '#333322', // Top Menu No Select + '#444433', // Table Border + '#2d2d1c', // Off-grid Color + '#444433', // Grid Hover Color + '#333322', // Button Shadow + '#000', // Pushed Button Shadow + '#444433', // Input Background + '#888877', // Input Border + '#444433', // Select Background + '#888877', // Select Border + '#ffff00', // Input Highlight + '#666' // Top Menu Text Color + ]; + break; + case 6: + this._colors = [ + '#fff', // Text Color + '#ae7d4c', // Base Color + '#8e663e', // Base Color 2 + '#805300', // Background Color + '#ffd280', // Border Color + '#9c7d5e', // Background Color 2 + '#9c7d5e', // Top Menu On-Mouse + '#9c7d5e', // Top Menu No Select + '#67ccff', // Table Border + '#ffa600', // Off-grid Color + '#cc8500', // Grid Hover Color + '#333', // Button Shadow + '#000', // Pushed Button Shadow + '#444466', // Input Background + '#8888aa', // Input Border + '#444466', // Select Background + '#8888aa', // Select Border + 'orange', // Input Highlight + '#666' // Top Menu Text Color + ]; + break; + case 7: + this._colors = [ + '#fff', // Text Color + '#aeae4c', // Base Color + '#8e8e3e', // Base Color 2 + '#444', // Background Color + '#303030', // Border Color + '#4d4d4d', // Background Color 2 + '#666', // Top Menu On-Mouse + '#555', // Top Menu No Select + '#666', // Table Border + '#4d4d4d', // Off-grid Color + '#666', // Grid Hover Color + '#333', // Button Shadow + '#000', // Pushed Button Shadow + '#666666', // Input Background + '#aaaaaa', // Input Border + '#6666666', // Select Background + '#aaaaaa', // Select Border + '#ae4c4c', // Input Highlight + '#888', // Top Menu Text Color + '#ae4c4c', // Button Color 1 + '#8e3e3e' // Button Color 2 + ]; + break; + case 8: + this._colors = [(Math.random() > 0.5) ? "#000000" : "#ffffff"]; + for(let i = 0; i < 17; i++) { + this._colors.push(`rgba(${Math.randomInt(255)}, ${Math.randomInt(255)}, ${Math.randomInt(255)}, 255)`) + } + break; + } +}; + +MakerManager.getPlaytesterHtml = function() { + return `

+ + + + + + + + + + + + + + + + + + + + +
Playtest FeatureDescription
+ Once activated, the game will save, restart, and load quickly in order to reload any changed data. +
+ Quickly saves the game without the need to open any menus or activate any events. +
+ Quickly loads the most recent quick save. +
+ Preforms a game reload, then starts the player back at the most recent quick save. +

`; +}; + +MakerManager.getStyle = function() { + const textColor = this._colors[0]; + const baseColor = this._colors[1]; + const hoverColor = this._colors[2]; + const trueBackgroundColor = this._colors[3]; + const borderColor = this._colors[4]; + const backgroundColor = this._colors[5]; + const topMenuHighlight = this._colors[6]; + const topMenuNoSelect = this._colors[7]; + const tableBorder = this._colors[8]; + const scrollBack = this._colors[10]; + const buttonShadow = this._colors[11]; + const pushedButtonShadow = this._colors[12]; + const inputBackground = this._colors[13]; + const inputBorder = this._colors[14]; + const selectBackground = this._colors[15]; + const selectBorder = this._colors[16]; + const inputHighlight = this._colors[17]; + const topMenuText = this._colors[18]; + const buttonColor = this._colors[19] || baseColor; + const buttonColor2 = this._colors[20] || hoverColor; + return `a:link { + color: #33ccff; + } + + table { + border-collapse: collapse; + width: 100%; + } + + option { + text-align: center; + } + + th, td { + padding: 16px; + border-bottom: 1px solid ${tableBorder}; + background-color: ${trueBackgroundColor}; + } + + td { + text-align: left; + } + + th { + text-align: center; + } + + button { + display: inline-block; + padding: 5px 10px; + font-size: 15px; + cursor: pointer; + text-align: center; + text-decoration: none; + outline: none; + color: #fff; + background-color: ${buttonColor}; + border: none; + border-radius: 15px; + box-shadow: 0 4px ${buttonShadow}; + } + + button:hover {background-color: ${buttonColor2}} + + button:active { + background-color: ${buttonColor2}; + box-shadow: 0 2px ${pushedButtonShadow}; + transform: translateY(2px); + } + + ul { + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + border: 1px solid ${borderColor}; + background-color: ${backgroundColor}; + } + + li { + float: left; + background-color: ${topMenuNoSelect} + } + + li a { + display: block; + color: ${topMenuText}; + text-align: center; + padding: 14px 16px; + text-decoration: none; + } + + li a:hover:not(.active) { + background-color: ${topMenuHighlight}; + } + + li a.active { + color: white; + background-color: ${baseColor}; + } + + #LaunchButton { + display: inline-block; + border-radius: 4px; + border: none; + color: #FFFFFF; + font-size: 18px; + padding: 14px; + width: 200px; + height: 50px; + transition: all 0.5s; + cursor: pointer; + margin: 5px; + vertical-align:middle; + text-align: center; + } + + #LaunchButton span { + cursor: pointer; + display: inline-block; + position: relative; + transition: 0.5s; + } + + #LaunchButton span:after { + content: '\\21D2'; + position: absolute; + opacity: 0; + top: -4px; + right: -30px; + transition: 0.5s; + } + + #LaunchButton:hover span { + padding-right: 35px; + } + + #LaunchButton:hover span:after { + opacity: 1; + right: 0; + } + + .dropbtn { + display: inline-block; + color: white; + text-align: center; + padding: 14px 16px; + text-decoration: none; + } + + li.dropdown { + display: inline-block; + } + + .dropdown-content { + display: none; + position: absolute; + background-color: ${topMenuNoSelect}; + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; + } + + .dropdown-content a { + color: ${topMenuText}; + background-color: ${topMenuNoSelect}; + padding: 12px 16px; + text-decoration: none; + display: block; + text-align: left; + } + + .dropdown-content a:hover { + background-color: ${topMenuHighlight}; + } + + .dropdown:hover .dropdown-content { + display: block; + } + + textarea, select { + background-color: ${inputBackground}; + border-color: ${inputBorder}; + color: ${textColor}; + padding: 3px 0px 3px 3px; + margin: 5px 1px 3px 0px; + } + + input { + border: 1px solid ${inputBorder}; + background-color: ${inputBackground}; + color: ${textColor}; + padding: 1px 3px 1px 3px; + } + + input[type=text]:focus, textarea:focus, select:focus { + box-shadow: 0 0 5px ${inputHighlight}; + border: 1px solid ${inputHighlight}; + } + + #scrollStuff::-webkit-scrollbar { + width: 1em; + } + + #scrollStuff::-webkit-scrollbar-track { + background-color: ${scrollBack}; + } + + #scrollStuff::-webkit-scrollbar-thumb { + background-color: ${trueBackgroundColor}; + outline: 1px solid slategrey; + outline-offset: -1px; + } + + #scrollStuff::-webkit-scrollbar-corner { + background-color: ${scrollBack}; + }`; +}; + +MakerManager.initManager(); + +} + +//----------------------------------------------------------------------------- +// FileManager +//----------------------------------------------------------------------------- + +FileManager.filePath = function(location) { + if(!Utils.isNwjs()) return ''; + const path = require('path'); + const base = path.dirname(process.mainModule.filename); + return path.join(base, location); +}; + +FileManager.saveData = function(variable, filename) { + if(!Utils.isNwjs()) return; + if(this.dataPath === undefined) this.dataPath = this.filePath('data/'); + const fs = require('fs'); + const data = JSON.stringify(variable); + const filePath = this.dataPath + filename; + fs.writeFileSync(filePath, data); +}; + +FileManager.checkDataExists = function(filename, info) { + if(!Utils.isNwjs()) return; + info = info || "[]"; + if(this.dataPath === undefined) this.dataPath = this.filePath('data/'); + const fs = require('fs'); + const filePath = this.dataPath + filename; + if(!fs.existsSync(filePath)) { + fs.writeFileSync(filePath, info); + } +}; + +FileManager.getFileList = function(section, folder) { + if(!Utils.isNwjs()) return []; + const result = []; + const fs = require('fs'); + const location = this.filePath(`img/SumRndmDde/${section}/${folder}/`); + const files = fs.readdirSync(location); + for(let i = 0; i < files.length; i++) { + const file = location + files[i]; + const stat = fs.statSync(file); + if(!stat) continue; + if(!stat.isDirectory() && this.isImageFile(files[i])) { + const f = files[i].replace('.png', ''); + result.push(f); + } + } + return result; +}; + +FileManager.isImageFile = function(filename) { + return !!(filename.match(/\.png/i)); +}; + +FileManager.getFirstFile = function(section, folder) { + const result = this.getFileList(section, folder)[0]; + return (result) ? result : ''; +}; + +//----------------------------------------------------------------------------- +// DataManagerEX +//----------------------------------------------------------------------------- + +if(_.isPlaytest) { + +DataManagerEX._types = [ + 'Actors', + 'Classes', + 'Skills', + 'Items', + 'Weapons', + 'Armors', + 'Enemies', + 'Troops', + 'States', + 'Animations', + 'Tilesets', + 'CommonEvents', + 'System' +]; + +//Place # at the front to make it an input for a number +DataManagerEX._props = { + 'Actors': ['name', 'profile', '#initialLevel', '#maxLevel'], + 'Classes': ['name'], + 'Skills': ['name', '#iconIndex', 'description', '#mpCost', '#tpCost', '#speed', '#successRate', '#repeats', '#tpGain'], + 'Items': ['name', '#iconIndex', 'description', '#price', '#speed', '#successRate', '#repeats', '#tpGain'], + 'Weapons': ['name', '#iconIndex', 'description', '#price'], + 'Armors': ['name', '#iconIndex', 'description', '#price'], + 'Enemies': ['name', '#exp', '#gold'], + 'Troops': ['name'], + 'States': ['name', '#iconIndex', '#priority', '#minTurns', '#maxTurns', 'message1', 'message2', 'message3', 'message4'], + 'Animations': ['name'], + 'Tilesets': ['name'], + 'CommonEvents': ['name'], + 'System': ['currencyUnit'] +}; + +DataManagerEX.initManager = function() { + FileManager.checkDataExists("DataEX.json", "{}"); + FileManager.checkDataExists("Notes.json", "{}"); + this._listIndex = 0; +}; + +DataManagerEX.save = function() { + FileManager.saveData($dataBasicEX, "DataEX.json"); + FileManager.saveData($dataNotes, "Notes.json"); +}; + +DataManagerEX.setupWindowHtml = function() { + this.initOldDatas(); + MakerManager.window.title = "Super Tools Engine - Database EX | SumRndmDde"; + MakerManager.mode = 'data'; + this.resetTypeAndId(); + this.setBasicPage(); +}; + +DataManagerEX.initOldDatas = function() { + this._oldDataEx = JsonEx.stringify($dataBasicEX); + this._oldNotes = JsonEx.stringify($dataNotes); +}; + +DataManagerEX.resetTypeAndId = function() { + this._type = "Actors"; + this._id = "1"; +}; + +DataManagerEX.setBasicPage = function() { + this._customEditorName = 'Custom Editors'; + MakerManager.mainHTML = this.topBar(0) + this.getBasicHtml(); +}; + +DataManagerEX.setNotePage = function() { + this._customEditorName = 'Custom Editors'; + MakerManager.mainHTML = this.topBar(1) + this.getNoteHtml(); +}; + +DataManagerEX.setCustomPage = function(name, htmlFunction) { + this._customEditorName = name; + MakerManager.mainHTML = this.topBar(2) + htmlFunction.call(this); +}; + +DataManagerEX.topBar = function(index) { + const active = ['', '', '']; + active[index] = 'class="active"'; + let result = ''; + const allInfo = this.getCustomInfo(); + for(let i = 0; i < allInfo.length; i++) { + const info = allInfo[i]; + result += `${info[0]}\n`; + } + return ``; +}; + +/* + * Use the array to input custom menu pieces. + * Each piece will be a 2 length array. + * Example: ['Name', 'HTML Getting Function'] + */ +DataManagerEX.getCustomInfo = function() { + return [ + //['Custom Name', 'DataManagerEX.getCustomHtml'] + ]; +}; + +DataManagerEX.getBasicHtml = function() { + return `

+

+

+ Section:
+ +
+

+ Object:
+ +
+
+




+ + ${this.getProperties()} +
+
+ ${this.getPages()} +
+

`; +}; + +DataManagerEX.getProperties = function() { + return ` + Property + Eval + Input + + ${this.getPropertyList()}`; +}; + +DataManagerEX.getTypeList = function() { + let result = ''; + this._types.forEach(function(type) { + const selected = (this._type === type) ? 'selected' : ''; + result += ``; + }, this); + return result; +}; + +DataManagerEX.getObjectList = function() { + if(!$dataBasicEX[this._type]) $dataBasicEX[this._type] = {}; + const data = window['$data' + this._type]; + let result = ''; + for(let i = 1; i < data.length; i++) { + const obj = data[i]; + if(obj) { + const selected = (parseInt(this._id) === i) ? 'selected' : ''; + const changed = ($dataBasicEX[this._type][String(i)]) ? '*' : ''; + result += ``; + } + } + return result; +}; + +DataManagerEX.getPropertyList = function() { + const list = this._props[this._type]; + const data = $dataBasicEX[this._type][this._id]; + let result = ''; + for(let i = (this._listIndex * 6); i < Math.min((this._listIndex + 1) * 6, list.length); i++) { + const name = (list[i].substring(0, 1) === '#') ? list[i].substring(1) : list[i]; + let value = (data && data[name]) ? data[name] : ''; + const checked = (value.substring(0, 1) === '$') ? 'checked' : ''; + if(checked === 'checked') value = value.replace(/'/g, '\"'); + value = value.substring(1); + result += ` + ${_.capFirst(name)} + + + `; + } + return result; +}; + +DataManagerEX.getPages = function() { + const max = Math.ceil(this._props[this._type].length / 6); + if(max === 1) { + return `
+ +
`; + } + return `
+
+ +
+ Page: (${this._listIndex + 1}/${max}) +
+ +
+
+
+ +
`; +}; + +DataManagerEX.updateTypes = function() { + this._type = MakerManager.document.getElementById('SectionSelect').value; + this._id = MakerManager.document.getElementById('ObjectSelect').value; + this._listIndex = 0; + this.refreshObjects(); + this.refreshPages(); +}; + +DataManagerEX.updateObjects = function() { + this._id = MakerManager.document.getElementById('ObjectSelect').value; + this.refreshProperties(); +}; + +DataManagerEX.refreshObjects = function() { + MakerManager.document.getElementById('ObjectSelect').innerHTML = this.getObjectList(); + this.refreshProperties(); +}; + +DataManagerEX.refreshProperties = function() { + MakerManager.document.getElementById('PropertyList').innerHTML = this.getProperties(); +}; + +DataManagerEX.refreshPages = function() { + MakerManager.document.getElementById('PageControl').innerHTML = this.getPages(); +}; + +DataManagerEX.saveCurrent = function() { + if(!$dataBasicEX[this._type][this._id]) $dataBasicEX[this._type][this._id] = {}; + const list = this._props[this._type]; + const data = $dataBasicEX[this._type][this._id]; + for(let i = 0; i < list.length; i++) { + const element = MakerManager.document.getElementById(list[i]); + const chkElem = MakerManager.document.getElementById('check_' + list[i]); + const propName = (list[i].substring(0, 1) === '#') ? list[i].substring(1) : list[i]; + if(element && chkElem && element.value.trim().length > 0) { + let value = String(element.value).trim(); + if(chkElem.checked) { + value = '$' + value; //Eval + } else if(list[i].substring(0, 1) === '#') { + value = '#' + value; //Number + } else { + value = '^' + value; //String + } + $dataBasicEX[this._type][this._id][propName] = value; + } else if(typeof($dataBasicEX[this._type][this._id][propName]) !== "undefined") { + delete $dataBasicEX[this._type][this._id][propName]; + } + } + if(JSON.stringify($dataBasicEX[this._type][this._id]) === "{}") { + delete $dataBasicEX[this._type][this._id]; + } + this.updateTypes(); +}; + +DataManagerEX.incrementPageExists = function() { + return ((this._listIndex + 1) * 6) < this._props[this._type].length; +}; + +DataManagerEX.decrementPageExists = function() { + return this._listIndex > 0; +}; + +DataManagerEX.incrementPage = function() { + if(this.incrementPageExists()) { + this._listIndex++; + this.refreshProperties(); + this.refreshPages(); + } +}; + +DataManagerEX.decrementPage = function() { + if(this.decrementPageExists()) { + this._listIndex--; + this.refreshProperties(); + this.refreshPages(); + } +}; + +DataManagerEX.updateTypesNote = function() { + this._type = MakerManager.document.getElementById('SectionSelect').value; + this._id = MakerManager.document.getElementById('ObjectSelect').value; + this.refreshObjectsNote(); +}; + +DataManagerEX.updateObjectsNote = function() { + this._id = MakerManager.document.getElementById('ObjectSelect').value; + this.refreshBigNote(); +}; + +DataManagerEX.refreshObjectsNote = function() { + MakerManager.document.getElementById('ObjectSelect').innerHTML = this.getObjectListNote(); + this.refreshBigNote(); +}; + +DataManagerEX.refreshBigNote = function() { + MakerManager.document.getElementById('NoteInput').value = this.getCurrentNote(); +}; + +DataManagerEX.getNoteHtml = function() { + return `

+

+

+ Section:
+ +
+

+ Object:
+ +
+




+

+

+

`; +}; + +DataManagerEX.getObjectListNote = function() { + if(!$dataNotes[this._type]) $dataNotes[this._type] = {}; + const data = window['$data' + this._type]; + let result = ''; + for(let i = 1; i < data.length; i++) { + const obj = data[i]; + if(obj) { + const selected = (parseInt(this._id) === i) ? 'selected' : ''; + const changed = ($dataNotes[this._type][String(i)]) ? '*' : ''; + result += ``; + } + } + return result; +}; + +DataManagerEX.getCurrentNote = function() { + if($dataNotes[this._type] && $dataNotes[this._type][this._id]) { + return $dataNotes[this._type][this._id]; + } + return ''; +}; + +DataManagerEX.saveCurrentNote = function() { + this._type = MakerManager.document.getElementById('SectionSelect').value; + this._id = MakerManager.document.getElementById('ObjectSelect').value; + const note = MakerManager.document.getElementById('NoteInput').value; + if(!$dataNotes[this._type]) $dataNotes[this._type] = {}; + $dataNotes[this._type][this._id] = note; + if(typeof($dataNotes[this._type][this._id]) === "string" && $dataNotes[this._type][this._id] === '') { + delete $dataNotes[this._type][this._id]; + } + this.updateTypesNote(); +}; + +DataManagerEX.onFinish = function() { + this.save(); + this.requestRestart(); +}; + +DataManagerEX.requestRestart = function() { + if(this.requestRestartCondition()) { + if(window.confirm("Database EX changes are detected! Would you like to preform a SUPER RESTART to apply the changes?")) { + _.move = false; + DebugManager.restartGame(); + } + } +}; + +DataManagerEX.requestRestartCondition = function() { + return this._oldDataEx !== JsonEx.stringify($dataBasicEX) || this._oldNotes !== JsonEx.stringify($dataNotes); +}; + +DataManagerEX.returnToMaker = function() { + this.onFinish(); + MakerManager.setupWindowHtml(); +}; + +DataManagerEX.initManager(); + +//----------------------------------------------------------------------------- +// DebugManager +//----------------------------------------------------------------------------- + +DebugManager.gameSpeed = 1; +DebugManager.disableEncounters = false; +DebugManager.disableCollisions = false; + +DebugManager.isOnMap = function() { + return SceneManager._scene.constructor === Scene_Map && SceneManager._sceneStarted; +}; + +/* + * Player Transfer + */ + +DebugManager.preformPlayerTransfer = function() { + if(this.isOnMap()) { + const mapId = MakerManager.document.getElementById('mapId').value; + $gamePlayer.reserveTransfer(parseInt(mapId), 0, 0, 0, 2); + _._isSuperTransfer = true; + SoundManager.playLoad(); + } else { + alert("This feature can only be used while the player is on the map!"); + } +}; + +/* + * Game Speed + */ + +DebugManager.refreshGameSpeed = function() { + const speed = MakerManager.document.getElementById('gameSpd').value; + this.gameSpeed = parseInt(speed); + SoundManager.playLoad(); +}; + +/* + * Gold + */ + +DebugManager.setGold = function() { + const gold = MakerManager.document.getElementById('gold').value; + $gameParty._gold = parseInt(gold).clamp(0, $gameParty.maxGold()); + SoundManager.playLoad(); +}; + +/* + * Encounters/Collision + */ + +DebugManager.refreshCollisions = function() { + this.disableCollisions = !!MakerManager.document.getElementById('collision').checked; +}; + +DebugManager.refreshEncounters = function() { + this.disableEncounters = !!MakerManager.document.getElementById('encounter').checked; +}; + +/* + * Givers + */ + +DebugManager.giveActorSkill = function() { + const id = MakerManager.document.getElementById('actorId').value; + const skill = MakerManager.document.getElementById('skillId').value; + $gameActors.actor(parseInt(id)).learnSkill(parseInt(skill)); + SoundManager.playUseItem(); +}; + +DebugManager.givePartyItems = function() { + const id = MakerManager.document.getElementById('itemId').value; + const count = MakerManager.document.getElementById('itemCount').value; + $gameParty.gainItem($dataItems[parseInt(id)], parseInt(count)); + SoundManager.playUseItem(); +}; + +DebugManager.givePartyWeapons = function() { + const id = MakerManager.document.getElementById('weaponId').value; + const count = MakerManager.document.getElementById('weaponCount').value; + $gameParty.gainItem($dataWeapons[parseInt(id)], parseInt(count)); + SoundManager.playUseItem(); +}; + +DebugManager.givePartyArmors = function() { + const id = MakerManager.document.getElementById('armorId').value; + const count = MakerManager.document.getElementById('armorCount').value; + $gameParty.gainItem($dataArmors[parseInt(id)], parseInt(count)); + SoundManager.playUseItem(); +}; + +DebugManager.givePartyMembers = function() { + const id = MakerManager.document.getElementById('allActorId').value; + $gameParty.addActor(parseInt(id)); +}; + +DebugManager.takePartyMembers = function() { + const id = MakerManager.document.getElementById('allActorId').value; + $gameParty.removeActor(parseInt(id)); +}; + +/* + * Super Restart Functions + */ + +DebugManager.restartGame = function() { + if(!SceneManager._sceneStarted) setTimeout(this.restartGame.bind(this), 10); + if(!this.isOnMap()) { + if(SceneManager._scene.constructor === Scene_Title) { + this.restartGameForRealizies(); + return; + } + if(!SceneManager._stack[0] || SceneManager._stack[0] !== Scene_Map) { + alert("The game could not be restarted!"); + return; + } + } + if(DataManager.saveGame(999)) { + StorageManager.cleanBackup(999); + } + this.restartGameForRealizies(); +}; + +DebugManager.restartGameForRealizies = function() { + this.setToReopen(999); + location.reload(); + MakerManager.window.close(true); +}; + +DebugManager.localPath = function() { + const path = require('path'); + return path.dirname(process.mainModule.filename); +}; + +DebugManager.getReopenPath = function() { + return this.localPath() + "ShouldOpenSTE"; +}; + +DebugManager.setToReopen = function(id) { + const fs = require('fs'); + const filePath = this.getReopenPath(); + fs.writeFileSync(filePath, String(id)); +}; + +DebugManager.removeReopener = function() { + const fs = require('fs'); + const filePath = this.getReopenPath(); + if (fs.existsSync(filePath)) { + fs.unlinkSync(filePath); + } +}; + +DebugManager.isSetToReopen = function() { + const fs = require('fs'); + const filePath = this.getReopenPath(); + if(!fs.existsSync(filePath)) { + return false; + } else { + return fs.readFileSync(filePath, { encoding: 'utf8' }); + } +}; + +/* + * Quick Save/Load + */ + +DebugManager.quickSave = function() { + const id = DataManager.maxSavefiles() + 1; + if(DataManager.saveGame(id)) { + StorageManager.cleanBackup(id); + } +}; + +DebugManager.quickLoad = function() { + const id = DataManager.maxSavefiles() + 1; + if(StorageManager.exists(id)) { + DataManager.loadGame(id); + Scene_Load.prototype.reloadMapIfUpdated.call(this); + if(SceneManager._scene.constructor !== Scene_Map) SceneManager.goto(Scene_Map); + } else { + alert('No quick save file exists!'); + } +}; + +DebugManager.quickRestartLoad = function() { + const id = DataManager.maxSavefiles() + 1; + if(StorageManager.exists(id)) { + this.setToReopen(DataManager.maxSavefiles() + 1); + location.reload(); + MakerManager.window.close(true); + } else { + alert('No quick save file exists!'); + } +} + +DebugManager.deleteQuickSave = function() { + const id = DataManager.maxSavefiles() + 1; + if(StorageManager.exists(id)) { + StorageManager.remove(id); + DataManager.deleteGlobal(id); + } +}; + +/* + * Debug Tool Stuff + */ + +DebugManager.initManager = function() { + this.active = false; + this.mode = ''; + this._listIndex = 0; +}; + +DebugManager.setupWindowHtml = function() { + this.active = true; + this._listIndex = 0; + this._maxSwitches = $dataSystem.switches.length - 1; + this._maxVariables = $dataSystem.variables.length - 1; + MakerManager.window.title = "Super Tools Engine - Debug Tool | SumRndmDde"; + MakerManager.mode = 'debug'; + this.setBasicPage(); +}; + +DebugManager.setBasicPage = function() { + this.mode = 'basic'; + MakerManager.mainHTML = this.topBar(0) + this.getBasicHtml(); +}; + +DebugManager.setGiverPage = function() { + this.mode = 'give'; + MakerManager.mainHTML = this.topBar(1) + this.getGiverHtml(); +}; + +DebugManager.setGiver2Page = function() { + this.mode = 'give2'; + MakerManager.mainHTML = this.topBar(2) + this.getGiver2Html(); +}; + +DebugManager.setSwitchPage = function() { + this.mode = 'switch'; + this._listIndex = 0; + MakerManager.mainHTML = this.topBar(3) + this.getSwitchHtml(); + this.refreshSwitchTables(); +}; + +DebugManager.setVariablePage = function() { + this.mode = 'variable'; + this._listIndex = 0; + MakerManager.mainHTML = this.topBar(4) + this.getVariableHtml(); + this.refreshVariableTables(); +}; + +DebugManager.topBar = function(index) { + const active = ['', '', '']; + active[index] = 'class="active"'; + return ``; +}; + +DebugManager.getMapList = function() { + let result = ``; + return result; +}; + +DebugManager.getSkillList = function() { + let result = ``; + return result; +}; + +DebugManager.getActorList = function() { + let result = ``; + return result; +}; + +DebugManager.getEntireActorList = function() { + let result = ``; + return result; +}; + +DebugManager.getItemList = function() { + let result = ``; + return result; +}; + +DebugManager.getWeaponList = function() { + let result = ``; + return result; +}; + +DebugManager.getArmorList = function() { + let result = ``; + return result; +}; + +DebugManager.getBasicHtml = function() { + return `

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameControlDescription
+ Speed Master + + + + Allows the game to have its speed changed to make playtesting easier. +
+ Transfer + + ${this.getMapList()} + + Allows developers to immediately transfer to any map within their game. +
+ Gold Set + +
+ +
+ Sets the party's gold to whatever value is inputted. +
+ Disable Collisions + + + + When checked, the player will be able to walk around without collision. +
+ Disable Encounters + + + + When checked, all random enemy encounters will be disabled. +

`; +}; + +DebugManager.getGiverHtml = function() { + return `

+ + + + + + + + + + + + + + + + + + + + +
ControlDescription
+ ${this.getSkillList()}
+ ${this.getActorList()}     + +
+ Allows any Actor within the party to learn any Skill immediately. +
+ ${this.getItemList()}
+      + +
+ Allows the party to immediately obtain a specified amount of any item. +
+ ${this.getWeaponList()}
+      + +
+ Allows the party to immediately obtain a specified amount of any weapon. +
+ ${this.getArmorList()}
+      + +
+ Allows the party to immediately obtain a specified amount of any armor. +

`; +}; + +DebugManager.getGiver2Html = function() { + return `

+ + + + + + + + +
ControlDescription
+ ${this.getEntireActorList()}
+      + +
+ Allows developers to control the actors within the current party. +

`; +}; + +DebugManager.getSwitchHtml = function() { + let result = `

+

+
+
+
+
+
`; + if(this._maxSwitches > 40) { + result += `

+
+ +
+ +
+ +
+

`; + } + result += '

'; + return result; +}; + +DebugManager.refreshSwitchTables = function() { + let result1 = ''; + let result2 = ''; + const first = (this._listIndex * 40) + 1; + for(let i = first; i <= Math.min(first + 19, this._maxSwitches); i++) { + const value = $gameSwitches.value(i); + const str = $dataSystem.switches[i]; + result1 += ` + ${_.pad(i)} + ${str.length > 20 ? str.substring(0, 20) + '...' : str} + ${value ? 'ON' : 'OFF'} + + `; + } + for(let i = first + 20; i <= Math.min(first + 39, this._maxSwitches); i++) { + const value = $gameSwitches.value(i); + const str = $dataSystem.switches[i]; + result2 += ` + ${_.pad(i)} + ${str.length > 20 ? str.substring(0, 20) + '...' : str} + ${value ? 'ON' : 'OFF'} + + `; + } + MakerManager.document.getElementById('Col1').innerHTML = result1; + MakerManager.document.getElementById('Col2').innerHTML = result2; + MakerManager.document.getElementById('Page').innerHTML = `Page: (${this._listIndex + 1}/${Math.ceil(this._maxSwitches / 40)})`; +}; + +DebugManager.getVariableHtml = function() { + let result = `

+

+ + + + +
Tets
+
+
+
+
`; + if(this._maxVariables > 40) { + result += `

+
+ +
+ +
+ +
+

`; + } + result += '

'; + return result; +}; + +DebugManager.refreshVariableTables = function() { + let result1 = ''; + let result2 = ''; + const first = (this._listIndex * 40) + 1; + for(let i = first; i <= Math.min(first + 19, this._maxVariables); i++) { + const value = $gameVariables.value(i); + const str = $dataSystem.variables[i]; + result1 += ` + ${_.pad(i)} + ${str.length > 20 ? str.substring(0, 20) + '...' : str} + + `; + } + for(let i = first + 20; i <= Math.min(first + 39, this._maxVariables); i++) { + const value = $gameVariables.value(i); + const str = $dataSystem.variables[i]; + result2 += ` + ${_.pad(i)} + ${str.length > 20 ? str.substring(0, 20) + '...' : str} + + `; + } + MakerManager.document.getElementById('Col1').innerHTML = result1; + MakerManager.document.getElementById('Col2').innerHTML = result2; + MakerManager.document.getElementById('Page').innerHTML = `Page: (${this._listIndex + 1}/${Math.ceil(this._maxVariables / 40)})`; +}; + +DebugManager.incrementPageExists = function() { + const length = (this.mode === 'switch') ? this._maxSwitches : this._maxVariables; + return ((this._listIndex + 1) * 40) < length; +}; + +DebugManager.decrementPageExists = function() { + return this._listIndex > 0; +}; + +DebugManager.incrementPage = function() { + if(this.incrementPageExists()) { + this._listIndex++; + if(this.mode === 'switch') this.refreshSwitchTables(); + if(this.mode === 'variable') this.refreshVariableTables(); + } +}; + +DebugManager.decrementPage = function() { + if(this.decrementPageExists()) { + this._listIndex--; + if(this.mode === 'switch') this.refreshSwitchTables(); + if(this.mode === 'variable') this.refreshVariableTables(); + } +}; + +DebugManager.changeSwitch = function(id) { + const value = MakerManager.document.getElementById('Switch ' + id).checked; + $gameSwitches.setValue(id, value); + MakerManager.document.getElementById('Switch ' + id + ' Label').innerHTML = value ? 'ON' : 'OFF'; +}; + +DebugManager.changeVariable = function(id) { + const value = Number(MakerManager.document.getElementById('Variable ' + id).value); + $gameVariables.setValue(id, value); +}; + +DebugManager.returnToMaker = function() { + this.onFinish(); + MakerManager.setupWindowHtml(); +}; + +DebugManager.onFinish = function() { + this.active = false; + this.mode = ''; +}; + +//----------------------------------------------------------------------------- +// WindowManager +//----------------------------------------------------------------------------- + +WindowManager._focusWindow = null; + +WindowManager.initManager = function() { + FileManager.checkDataExists("Windows.json", "{}"); +}; + +WindowManager.save = function() { + FileManager.saveData($dataWindows, "Windows.json"); +}; + +WindowManager.setupWindowHtml = function() { + const scene = SceneManager._scene; + const cnstr = scene.constructor; + if(cnstr === Scene_Map) { + alert("This feature is not available on the map!"); + } else if(cnstr === Scene_Battle && Imported["SumRndmDde Battle GUI Core"]) { + alert("You cannot edit battles with SRD_BattleGUICore installed!"); + } else if(scene._windowLayer && scene._windowLayer.children && scene._windowLayer.children.length > 0) { + MakerManager.window.title = "Super Tools Engine - Menu Editor | SumRndmDde"; + MakerManager.mode = 'window'; + this._scene = scene; + this._scene.startWindowEditor(); + this.setupMakerHtml(); + } else { + alert("There are no windows detected on the current scene!"); + } +}; + +WindowManager.setupMakerHtml = function() { + MakerManager.mainHTML = this.topBar('main') + this.getMakerHtml(); + this.onWindowChange(); +}; + +WindowManager.returnToMaker = function() { + this.onFinish(); + MakerManager.setupWindowHtml(); +}; + +WindowManager.onFinish = function() { + this.save(); + this._scene.endWindowEditor(); +}; + +WindowManager.refreshProperties = function() { + this._scene.refreshEditWindowProperties(); +}; + +WindowManager.topBar = function(type) { + const active = {}; + active[type] = 'class="active"'; + return ``; +}; + +WindowManager.topBarCustoms = function(active) { + return ''; +}; + +WindowManager.getMakerHtml = function() { + const windowSelect = MakerManager.document.getElementById('WindowSelect'); + if(windowSelect) { + this._focusWindow = this._scene.getEditWindow(windowSelect.value); + } + return `

+


+ Target Window:
+ ${this.getWindowList()}

+

+ + + + + + ${this.getTableHtml()} +
PropertyValue

+

+ +

+

`; +}; + +WindowManager.refreshTable = function() { + const windowSelect = MakerManager.document.getElementById('WindowSelect'); + this._focusWindow = this._scene.getEditWindow(windowSelect.value); + MakerManager.document.getElementById('MainTable').innerHTML = ` + Property + Value + + ${(!!this._focusWindow) ? this.getTableHtml() : ''}`; +}; + +WindowManager.getTableHtml = function() { + const scene = this._scene.constructor.name; + const win = this._focusWindow.getWindowCode(); + if(!$dataWindows[scene]) $dataWindows[scene] = {}; + if(!$dataWindows[scene][win]) $dataWindows[scene][win] = {}; + const data = $dataWindows[scene][win]; + let result = ` + Opacity: + + + + Width: + + `; + if(!this._focusWindow._ste_isCommand) { + result += ` + Height: + + `; + } + if(this._focusWindow._ste_isSelectable) { + if(this._focusWindow._ste_isCommand || this._focusWindow.numVisibleRows) { + result += ` + Visible Rows: + + `; + } + result += ` + Max Columns: + + `; + } + if(this._focusWindow._ste_isCommand) { + result += ` + Line Height: + + `; + + const selected = {left: '', center: '', right: ''}; + selected[data.align || this._focusWindow.itemTextAlign()] = 'selected'; + result += ` + Text Align: + + + + `; + } + return result; +}; + +WindowManager.getWindowList = function() { + let result = ''; + return result; +}; + +WindowManager.windowMeetsConditions = function(window) { + return window && window.isOpen() && window.visible && window.backOpacity > 0 && window.contentsOpacity > 0 && this.windowConstructorMeetsConditions(window); +}; + +WindowManager.windowConstructorMeetsConditions = function(window) { + return window.constructor && window.constructor.name && !_.banList.contains(window.constructor.name); +}; + +WindowManager.onWindowChange = function() { + const name = MakerManager.document.getElementById('WindowSelect').value; + this.refreshTable(); + this._scene.setEditWindow(name); +}; + +WindowManager.resetScene = function() { + if(confirm('Would you like to reset all changes? The game will need to restart.')) { + $dataWindows[this._scene.constructor.name] = undefined; + this.save(); + DebugManager.restartGame(); + } +}; + +WindowManager.initManager(); + +//----------------------------------------------------------------------------- +// Game_Player +//----------------------------------------------------------------------------- + +_.Game_Player_performTransfer = Game_Player.prototype.performTransfer; +Game_Player.prototype.performTransfer = function() { + const isTransfer = this.isTransferring(); + _.Game_Player_performTransfer.apply(this, arguments); + if(_._isSuperTransfer && isTransfer) { + _._isSuperTransfer = false; + this.locate(Math.floor($dataMap.width / 2), Math.floor($dataMap.height / 2)); + this.refresh(); + } +}; + +} + +//----------------------------------------------------------------------------- +// Scene_Base +//----------------------------------------------------------------------------- + +_.Scene_Base_initialize = Scene_Base.prototype.initialize; +Scene_Base.prototype.initialize = function() { + _.Scene_Base_initialize.apply(this, arguments); + this.windowIds = {}; + this._isWindowEditting = false; + this._editWindow = null; + this._editWindowName = ''; +}; + +if(_.isPlaytest) { + +_.Scene_Base_update = Scene_Base.prototype.update; +Scene_Base.prototype.update = function() { + if(!this._isWindowEditting) { + _.Scene_Base_update.apply(this, arguments); + } else { + if(this._editWindow) { + if(TouchInput.isPressed()) { + let x = TouchInput.x; + let y = TouchInput.y; + let newX = -1; + let newY = -1; + for(let i = 0; i < this._editXSnaps.length; i++) { + if(Math.abs(this._editXSnaps[i] - x) < 24) { + if(newX >= 0) { + if(Math.abs(this._editXSnaps[i] - x) < Math.abs(newX - x)) { + newX = this._editXSnaps[i]; + } + } else { + newX = this._editXSnaps[i]; + } + } + } + for(let i = 0; i < this._editYSnaps.length; i++) { + if(Math.abs(this._editYSnaps[i] - y) < 24) { + if(newY >= 0) { + if(Math.abs(this._editYSnaps[i] - y) < Math.abs(newY - y)) { + newY = this._editYSnaps[i]; + } + } else { + newY = this._editYSnaps[i]; + } + } + } + if(newX >= 0) x = newX; + if(newY >= 0) y = newY; + $dataWindows[this.constructor.name][this._editWindowName].x = x; + $dataWindows[this.constructor.name][this._editWindowName].y = y; + this._editWindow.x = x; + this._editWindow.y = y; + } else { + if(Input.isTriggered('up')) this._editWindow.y--; + if(Input.isTriggered('down')) this._editWindow.y++; + if(Input.isTriggered('left')) this._editWindow.x--; + if(Input.isTriggered('right')) this._editWindow.x++; + $dataWindows[this.constructor.name][this._editWindowName].x = this._editWindow.x; + $dataWindows[this.constructor.name][this._editWindowName].y = this._editWindow.y; + } + } + } +}; + +Scene_Base.prototype.startWindowEditor = function() { + this._isWindowEditting = true; +}; + +Scene_Base.prototype.endWindowEditor = function() { + if(this._editWindow) this._editWindow.setMenuEditTarget(false); + this._isWindowEditting = false; +}; + +Scene_Base.prototype.getEditWindow = function(name) { + const children = this._windowLayer.children; + for(let i = 0; i < children.length; i++) { + const win = children[i]; + if(win && win.getWindowCode() === name) { + return win; + } + } +}; + +Scene_Base.prototype.setEditWindow = function(name) { + if(!$dataWindows[this.constructor.name]) $dataWindows[this.constructor.name] = {}; + if(this._editWindow) this._editWindow.setMenuEditTarget(false); + const children = this._windowLayer.children; + for(let i = 0; i < children.length; i++) { + const win = children[i]; + if(win && win.getWindowCode() === name) { + this._editWindow = win; + this._editWindowName = win.getWindowCode(); + if(!$dataWindows[this.constructor.name][this._editWindowName]) $dataWindows[this.constructor.name][this._editWindowName] = {}; + } + } + if(!this._editWindow) return; + this._editWindow.setMenuEditTarget(true); + this._windowLayer.removeChild(this._editWindow); + this.addWindow(this._editWindow); + this.refreshEditSnaps(); +}; + +Scene_Base.prototype.refreshEditSnaps = function() { + this._editXSnaps = [0, Graphics.boxWidth - this._editWindow.width]; + this._editYSnaps = [0, Graphics.boxHeight - this._editWindow.height]; + const children = this._windowLayer.children; + for(let i = 0; i < children.length; i++) { + const win = children[i]; + if(win && this._editWindow !== win) { + this._editXSnaps.push(win.x + win.width); + this._editXSnaps.push(win.x - this._editWindow.width); + this._editYSnaps.push(win.y + win.height); + this._editYSnaps.push(win.y - this._editWindow.height); + } + } + this._editXSnaps = this._editXSnaps.filter(function(value, index, array) { + return value >= 0 && value < Graphics.boxWidth && index == array.indexOf(value); + }); + this._editYSnaps = this._editYSnaps.filter(function(value, index, array) { + return value >= 0 && value < Graphics.boxHeight && index == array.indexOf(value); + }); +}; + +Scene_Base.prototype.refreshEditWindowProperties = function() { + if(!this._editWindow) return; + const data = $dataWindows[this.constructor.name][this._editWindowName]; + const doc = MakerManager.document; + const win = this._editWindow; + const opacity = doc.getElementById('Opacity'); + const width = doc.getElementById('Width'); + const height = doc.getElementById('Height'); + const rows = doc.getElementById('Rows'); + const cols = doc.getElementById('Cols'); + const lineHeight = doc.getElementById('lineHeight'); + const align = doc.getElementById('Text Align'); + const errorText = 'Error with ' + this.constructor.name + '\'s ' + this._editWindowName; + if(opacity) { + data.opacity = opacity.value; + try { + win.opacity = eval(opacity.value); + } catch(e) { + console.log(errorText + ' opacity input.\n' + e); + } + } + if(width) { + data.width = width.value; + try { + win.width = eval(width.value); + } catch(e) { + console.log(errorText + ' width input.\n' + e); + } + } + if(height) { + data.height = height.value; + try { + win.height = eval(height.value); + } catch(e) { + console.log(errorText + ' height input.\n' + e); + } + } + if(rows) { + data.rows = rows.value; + const errorCatch = win.numVisibleRows(); + win.numVisibleRows = function() { + try { + return eval(rows.value); + } catch(e) { + console.log(errorText + ' rows input.\n' + e); + return errorCatch; + } + }; + } + if(cols) { + data.cols = cols.value; + const errorCatch = win.maxCols(); + win.maxCols = function() { + try { + return eval(cols.value); + } catch(e) { + console.log(errorText + ' cols input.\n' + e); + return errorCatch; + } + }; + } + if(lineHeight) { + data.lineHeight = lineHeight.value; + const errorCatch = win.lineHeight(); + win.lineHeight = function() { + try { + return eval(lineHeight.value); + } catch(e) { + console.log(errorText + ' line height input.\n' + e); + return errorCatch; + } + }; + } + if(align) { + data.align = align.value; + const errorCatch = win.itemTextAlign(); + win.itemTextAlign = function() { + return align.value; + }; + } + if(win._ste_isCommand) { + win.height = win.windowHeight(); + } + if(win.createContents) win.createContents(); + if(win.refresh) { + try { + win.refresh(); + } catch(e) { + console.log(e); + } + } + if(win._refreshAllParts) win._refreshAllParts(); + if(win.updateCursor) win.updateCursor(); + this.refreshEditSnaps(); +}; + +} + +Scene_Base.prototype.initCustomWindowPositions = function() { + if(!$dataWindows[this.constructor.name]) return; + const children = this._windowLayer.children; + if(!children) return; + for(let i = 0; i < children.length; i++) { + const win = children[i]; + if(win && $dataWindows[this.constructor.name][win.getWindowCode()]) { + const info = $dataWindows[this.constructor.name][win.getWindowCode()]; + const errorText = 'Error with ' + this.constructor.name + '\'s ' + win.getWindowCode(); + if(info.x !== undefined) win.x = info.x; + if(info.y !== undefined) win.y = info.y; + if(info.opacity !== undefined) { + try { + win.opacity = eval(info.opacity); + } catch(e) { + console.log(errorText + ' opacity input.\n' + e); + } + } + if(info.width !== undefined) { + try { + win.width = eval(info.width); + } catch(e) { + console.log(errorText + ' width input.\n' + e); + } + } + if(info.height !== undefined) { + try { + win.height = eval(info.height); + } catch(e) { + console.log(errorText + ' height input.\n' + e); + } + } + if(info.rows !== undefined) { + const errorCatch = win.numVisibleRows(); + win.numVisibleRows = function() { + try { + return eval(info.rows); + } catch(e) { + console.log(errorText + ' rows input.\n' + e); + return errorCatch; + } + }; + } + if(info.cols !== undefined) { + const errorCatch = win.maxCols(); + win.maxCols = function() { + try { + return eval(info.cols); + } catch(e) { + console.log(errorText + ' cols input.\n' + e); + return errorCatch; + } + }; + } + if(info.lineHeight !== undefined) { + const errorCatch = win.lineHeight(); + win.lineHeight = function() { + try { + return eval(info.lineHeight); + } catch(e) { + console.log(errorText + ' line height input.\n' + e); + return errorCatch; + } + }; + } + if(info.align !== undefined) { + win.itemTextAlign = function() { + return info.align; + }; + } + if(win._ste_isCommand) { + win.height = win.windowHeight(); + } + if(win.createContents) win.createContents(); + if(win.refresh) { + try { + win.refresh(); + } catch(e) { + console.log(e); + } + } + if(win._refreshAllParts) win._refreshAllParts(); + if(win.updateCursor) win.updateCursor(); + } + } +}; + +//----------------------------------------------------------------------------- +// Scene_ItemBase +//----------------------------------------------------------------------------- + +_.Scene_ItemBase_showSubWindow = Scene_ItemBase.prototype.showSubWindow; +Scene_ItemBase.prototype.showSubWindow = function(window) { + let tempX = window.x; + _.Scene_ItemBase_showSubWindow.apply(this, arguments); + if($dataWindows[this.constructor.name] && $dataWindows[this.constructor.name][window.getWindowCode()]) { + window.x = tempX; + } +}; + +//----------------------------------------------------------------------------- +// Scene_Battle +//----------------------------------------------------------------------------- + +_.Scene_Battle_updateWindowPositions = Scene_Battle.prototype.updateWindowPositions; +Scene_Battle.prototype.updateWindowPositions = function() { + if(this.disableWindowPositionUpdates()) return; + _.Scene_Battle_updateWindowPositions.apply(this, arguments); +}; + +Scene_Battle.prototype.disableWindowPositionUpdates = function() { + return !!($dataWindows["Scene_Battle"] && $dataWindows["Scene_Battle"]["Window_BattleStatus"]); +}; + +//----------------------------------------------------------------------------- +// Scene_Boot +//----------------------------------------------------------------------------- + +if(_.isPlaytest) { + +_.Scene_Boot_start = Scene_Boot.prototype.start; +Scene_Boot.prototype.start = function() { + this._setReopener = DebugManager.isSetToReopen(); + if(this.isGameRestarting()) { + Scene_Base.prototype.start.apply(this, arguments); + this.restartGame(); + } else { + _.Scene_Boot_start.apply(this, arguments); + } + this.openMaker(); +}; + +Scene_Boot.prototype.isGameRestarting = function() { + return this._setReopener !== false && StorageManager.exists(parseInt(this._setReopener)); +}; + +Scene_Boot.prototype.restartGame = function() { + const id = parseInt(this._setReopener); + DataManager.loadGame(id); + if(id === 999) { + StorageManager.remove(id); + DataManager.deleteGlobal(id); + } + DataManager.selectSavefileForNewGame(); + Scene_Load.prototype.reloadMapIfUpdated.call(this); + SceneManager.goto(Scene_Map); +}; + +Scene_Boot.prototype.openMaker = function() { + if(this._setReopener) { + DebugManager.removeReopener(); + const temp = _.move; + _.move = false; + _.isReopening = true; + SceneManager.openMaker(); + if(temp && !_.isNewNWjs) MakerManager.window.moveTo(window.screenX + Graphics.boxWidth + 6, window.screenY); + _.move = temp; + return; + } + if(_.open) { + SceneManager.openMaker(); + } +}; + +//----------------------------------------------------------------------------- +// Game_Switches +//----------------------------------------------------------------------------- + +_.Game_Player_isDebugThrough = Game_Player.prototype.isDebugThrough; +Game_Player.prototype.isDebugThrough = function() { + return _.Game_Player_isDebugThrough.apply(this, arguments) || DebugManager.disableCollisions; +}; + +_.Game_Player_canEncounter = Game_Player.prototype.canEncounter; +Game_Player.prototype.canEncounter = function() { + return _.Game_Player_canEncounter.apply(this, arguments) && !DebugManager.disableEncounters; +}; + +//----------------------------------------------------------------------------- +// Game_Switches +//----------------------------------------------------------------------------- + +_.Game_Switches_setValue = Game_Switches.prototype.setValue; +Game_Switches.prototype.setValue = function(switchId, value) { + _.Game_Switches_setValue.apply(this, arguments); + if(DebugManager.active && DebugManager.mode === 'switch' && switchId > 0 && switchId < $dataSystem.switches.length) { + const val = this._data[switchId]; + MakerManager.document.getElementById('Switch ' + switchId).checked = val; + MakerManager.document.getElementById('Switch ' + switchId + ' Label').innerHTML = val ? 'ON' : 'OFF' + } +}; + +//----------------------------------------------------------------------------- +// Game_Variables +//----------------------------------------------------------------------------- + +_.Game_Variables_setValue = Game_Variables.prototype.setValue; +Game_Variables.prototype.setValue = function(variableId, value) { + _.Game_Variables_setValue.apply(this, arguments); + if(DebugManager.active && DebugManager.mode === 'variable' && variableId > 0 && variableId < $dataSystem.variables.length) { + const val = this._data[variableId]; + MakerManager.document.getElementById('Variable ' + variableId).value = val; + } +}; + +//----------------------------------------------------------------------------- +// Window_Base +//----------------------------------------------------------------------------- + +Window_Base.prototype.setMenuEditTarget = function(value) { + this._isMenuEditTarget = value; + this.updateTone(); +}; + +_.Window_Base_updateTone = Window_Base.prototype.updateTone; +Window_Base.prototype.updateTone = function() { + if(this._isMenuEditTarget) { + const tone = $gameSystem.windowTone(); + this.setTone(tone[0] + 100, tone[1], tone[2]); + } else { + _.Window_Base_updateTone.apply(this, arguments); + } +}; + +} + +_.Window_Base_initialize = Window_Base.prototype.initialize; +Window_Base.prototype.initialize = function(x, y, width, height) { + _.Window_Base_initialize.apply(this, arguments); + this.initWindowId(); + this._isMenuEditTarget = false; +}; + +Window_Base.prototype.initWindowId = function() { + const scene = SceneManager._scene; + const cnstr = this.constructor.name; + if(scene.windowIds[cnstr] === undefined) scene.windowIds[cnstr] = 1; + else scene.windowIds[cnstr] += 1; + this._menuEditorId = scene.windowIds[cnstr]; +}; + +Window_Base.prototype.getWindowCode = function() { + let result = this.constructor.name; + if(this._menuEditorId > 1) result += " " + this._menuEditorId; + return result; +}; + +//----------------------------------------------------------------------------- +// Window_Selectable +//----------------------------------------------------------------------------- + +_.Window_Selectable_initialize = Window_Selectable.prototype.initialize; +Window_Selectable.prototype.initialize = function(x, y, width, height) { + _.Window_Selectable_initialize.apply(this, arguments); + this._ste_isSelectable = true; +}; + +//----------------------------------------------------------------------------- +// Window_Command +//----------------------------------------------------------------------------- + +_.Window_Command_initialize = Window_Command.prototype.initialize; +Window_Command.prototype.initialize = function(x, y) { + _.Window_Command_initialize.apply(this, arguments); + this._ste_isCommand = true; +}; + +})(SRD.SuperToolsEngine); \ No newline at end of file diff --git a/js/plugins/TDDP_MouseSystemEx.js b/js/plugins/TDDP_MouseSystemEx.js new file mode 100644 index 0000000..75d7a6d --- /dev/null +++ b/js/plugins/TDDP_MouseSystemEx.js @@ -0,0 +1,928 @@ +//============================================================================= +// TDDP_MouseSystemEx.js +//============================================================================= + +var Imported = Imported || {}; +Imported.TDDP_MouseSystemEx = "1.8.2"; + +//============================================================================= +/*: + * @plugindesc 1.8.2 Custom mouse cursors, highlight menu items on hover, custom event mouse interaction and much more! See Help. id:TDDP_MouseSystemEx + * + * @author Tor Damian Design / Galenmereth + * + * @param ---Custom Cursor--- + * @desc This is a heading, no need to touch it. + * @default + * + * @param Use Custom Cursor? + * @desc Whether you want to use a custom mouse cursor image. + * true => ON false => OFF + * @default false + * + * @param Custom Cursor Image + * @desc The filename for the custom cursor. It looks for this in your project's Custom Cursor Folder. + * @default default.png + * + * @param Custom Cursors Folder + * @desc The folder you wish to store the custom cursors in. Must end with a forward slash. Default: img/cursors/ + * @default img/cursors/ + * + * @param ---Auto Change Cursors--- + * @desc Options for automatically changing the mouse cursor when hovering over events with the given event commands in them. + * @default + * + * @param Show Text Cursor + * @desc Automatically show this custom cursor image when hovering over events with Show Text commands in them. + * + * @param Transfer Cursor + * @desc Automatically show this custom cursor image when hovering over events with Transfer Player commands in them. + * + * @param Change Gold Cursor + * @desc Automatically show this custom cursor image when hovering over events with Change Gold commands in them. + * + * @param Change Items Cursor + * @desc Automatically show this custom cursor image when hovering over events with Change Items commands in them. + * + * @param Change Weapons Cursor + * @desc Automatically show this custom cursor image when hovering over events with Change Weapons commands in them. + * + * @param Change Armors Cursor + * @desc Automatically show this custom cursor image when hovering over events with Change Armors commands in them. + * + * @param Battle Processing Cursor + * @desc Automatically show this cursor when hovering over events with Battle Processing commands in them. + * + * @param ---Auto Change Icons--- + * @desc Options for automatically showing an icon when hovering over events with the given event commands in them. + * @default + * + * @param Show Text Icon + * @desc Automatically show this icon when hovering over events with Show Text commands in them. + * + * @param Transfer Icon + * @desc Automatically show this icon when hovering over events with Transfer Player commands in them. + * + * @param Change Gold Icon + * @desc Automatically show this icon when hovering over events with Change Gold commands in them. + * + * @param Change Items Icon + * @desc Automatically show this icon when hovering over events with Change Items commands in them. + * + * @param Change Weapons Icon + * @desc Automatically show this icon when hovering over events with Change Weapons commands in them. + * + * @param Change Armors Icon + * @desc Automatically show this icon when hovering over events with Change Armors commands in them. + * + * @param Battle Processing Icon + * @desc Automatically show this icon when hovering over events with Battle Processing commands in them. + * + * @param ---Hover Select--- + * @desc This is a heading, no need to touch it. + * @default + * + * @param Highlight On Hover + * @desc Highlight menu items when hovering over them with the mouse. + * true => ON false => OFF + * @default false + * + * @param Hover SE Cooldown + * @desc Audio cooldown (in frames) between playing Cursor SE when Highlight On Hover is set to true. Default 4. + * @default 4 + * + * @param ---Customizeable Notetags--- + * @desc These are options for activating events by mouse interaction instead of player character. + * @default + * + * @param No Auto Cursor Notetag + * @desc The notetag used to disable auto cursor switching on this event or event page. + * @default no_auto_cursor! + * + * @param No Auto Icon Notetag + * @desc The notetag used to disable auto icon switching on this event or event page. + * @default no_auto_icon! + * + * @param Click Notetag + * @desc The notetag used to trigger the event when it is clicked on. + * Default: click_activate! + * @default click_activate! + * + * @param Hover Notetag + * @desc The notetag used to trigger the event when the mouse is over it. + * Default: hover_activate! + * @default hover_activate! + * + * @param Leave Notetag + * @desc The notetag used to trigger the event when the mouse leaves it. + * Default: leave_activate! + * @default leave_activate! + * + * @param ---Mouse Icons--- + * @desc This is a heading, no need to touch it. + * @default + * + * @param Hide Cursor + * @desc Hide the default mouse cursor when an icon is shown. + * true => ON false => OFF + * @default false + * + * @param Icon Offset X + * @desc The icon's offset from the mouse horizontally. + * Default: 9 + * @default 9 + * + * @param Icon Offset Y + * @desc The icon's offset from the mouse vertically. + * Default: 14 + * @default 14 + * + * @param ---Mouse Icon Tags--- + * @desc This is a heading, no need to touch it. + * @default + * + * @param Icon Tag 1 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default quest: 191 + * + * @param Icon Tag 2 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default chest: 210 + * + * @param Icon Tag 3 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default door: 106 + * + * @param Icon Tag 4 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default world_map: 190 + * + * @param Icon Tag 5 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default potion: 176 + * + * @param Icon Tag 6 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default poison: 177 + * + * @param Icon Tag 7 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default four_leaf_clover: 182 + * + * @param Icon Tag 8 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default notebook: 187 + * + * @param Icon Tag 9 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default letter: 192 + * + * @param Icon Tag 10 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default key: 195 + * + * @param Icon Tag 11 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default key: 195 + * + * @param Icon Tag 12 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default key: 195 + * + * @param Icon Tag 13 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default key: 195 + * + * @param Icon Tag 14 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default key: 195 + * + * @param Icon Tag 15 + * @desc Set up an icon tag shortcut to be used with the Mouse Hover Icons notetag. See plugin Help for more information. + * @default key: 195 + * + * @help =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ + * Information + * =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ + * TDDP - MouseSystem is a collection of methods for modifying mouse-based + * interaction in your games. You can set custom mouse cursors, show icons beside + * the mouse when hovering over events, activate events by mouse, and more. + * + * For updates and easy to use documentation, please go to the plugin's website: + * http://mvplugins.tordamian.com/?p=26 + * + * There you can also download a PDF of the documentation for offline use, and + * having the documentation in one cleanly presented place means you can always + * be sure it's the most recent available. + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Terms & Conditions + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * This plugin is free for both non-commercial and commercial use. Please see + * http://mvplugins.tordamian.com/terms-of-use for the full terms of use. + * + * A big thank you to Degica for making this plugin free for commercial use for + * everyone! + */ +//============================================================================= +// All anonymous/helper functions are registered on this object for the convenience of other plugins. +var TDDP_MouseSystemEx = {}; +(function($) { + "use strict"; + /** + * Return .png if no file extension present in filename + */ + $._ext = function(filename) { + if (String(filename).split(".").length > 1) { + return filename; + } else { + // Default filetype extension + return filename + ".png"; + } + } + //============================================================================= + // Setting up parameters + //============================================================================= + var parameters = $plugins.filter(function(p){return p.description.contains("id:TDDP_MouseSystemEx")})[0].parameters; + // Auto change cursors + $.showTextCursor = String(parameters['Show Text Cursor']) || false; + $.changeGoldCursor = String(parameters['Change Gold Cursor']) || false; + $.changeItemCursor = String(parameters['Change Items Cursor']) || false; + $.changeWeaponCursor = String(parameters['Change Weapons Cursor']) || false; + $.changeArmorCursor = String(parameters['Change Armors Cursor']) || false; + $.transferPlayerCursor = String(parameters['Transfer Cursor']) || false; + $.battleProcessingCursor = String(parameters['Battle Processing Cursor']) || false; + // Auto change icons + $.showTextIcon = String(parameters['Show Text Icon']) || false; + $.changeGoldIcon = String(parameters['Change Gold Icon']) || false; + $.changeItemIcon = String(parameters['Change Items Icon']) || false; + $.changeWeaponIcon = String(parameters['Change Weapons Icon']) || false; + $.changeArmorIcon = String(parameters['Change Armors Icon']) || false; + $.transferPlayerIcon = String(parameters['Transfer Icon']) || false; + $.battleProcessingIcon = String(parameters['Battle Processing Icon']) || false; + // Settings + $.highlightOnHover = Boolean(parameters['Highlight On Hover'] === 'true' || false); + $.audioCooldownOnHover = Number(parameters['Hover SE Cooldown'] || 4) + $.hideCursor = Boolean(parameters['Hide Cursor'] === 'true' || false); + $.iconOffsetX = Number(parameters['Icon Offset X']) || 0; + $.iconOffsetY = Number(parameters['Icon Offset Y']) || 0; + $.noAutoCursorNotetag = String(parameters['No Auto Cursor Notetag']); + $.noAutoIconNotetag = String(parameters['No Auto Icon Notetag']); + $.clickToActivateNote = String(parameters['Click Notetag']); + $.hoverToActivateNote = String(parameters['Hover Notetag']); + $.leaveToActivateNote = String(parameters['Leave Notetag']); + $.useCustomCursor = Boolean(parameters['Use Custom Cursor?'] === 'true' || false); + $.cursorImage = $._ext(String(parameters['Custom Cursor Image'])); + $.defaultCursorImage = $.cursorImage; + $.customCursorPath = String(parameters['Custom Cursors Folder']); + + $._cursorFilenameInUse = null; // Helper to compare changes + $._lastUpdateFrame = 0; // Last frame cursor got updated + $._cssClassPrefix = "TDDP_customCursor_"; + $._indexFilename = "_index.json"; + + // Add all mouse icon tags + $.mouseIconTags = {} + for(var i = 1; i <= 15; ++i) { + var tag = parameters['Icon Tag ' + i] + if (!tag) continue; + tag = tag.split(":"); + var key = tag[0]; + var val = tag[1].replace(' ', ''); + $.mouseIconTags[key] = val; + } + /** + * Load and setup the custom cursor CSS additions + */ + $._loadAndSetupCustomCursorCSS = function() { + var xhr = new XMLHttpRequest(); + var url = this.customCursorPath + this._indexFilename; + xhr.open('GET', url); + xhr.overrideMimeType('application/json'); + xhr.onload = function() { + if (xhr.status < 400) { + var dummyContainerElement = document.createElement('div'); + dummyContainerElement.id = "TDD_MS_CursorDummies"; + document.body.appendChild(dummyContainerElement); + // Next we iterate the cached cursor list + var classPrefix = this._cssClassPrefix; + var cachedCursors = JSON.parse(xhr.responseText); + for (var i=0, max=cachedCursors.length; i 0) { + comments.forEach(function(comment) { + if (foundMatch) return; + matchInString(comment.parameters[0]); + }) + } + // If nothing found in page comment, check Note box + if (!foundMatch) { + if (game_event.event().note) { + matchInString(game_event.event().note); + } + } + if (foundMatch){ onMatch.call(game_event, result); } + } + /** + * Arrays of pairs of cursors/icons and filters to run to check if they should be used + */ + $.autoCursorFilters = [ + // The order is the priority; the first match stops further lookup + [$.battleProcessingCursor, $._filterBattleProcess], + [$.transferPlayerCursor, $._filterTransferPlayer], + [$.changeGoldCursor, $._filterChangeGold], + [$.changeItemCursor, $._filterChangeItems], + [$.changeWeaponCursor, $._filterChangeWeapons], + [$.changeArmorCursor, $._filterChangeArmors], + [$.showTextCursor, $._filterMessages], + ]; + $.autoIconFilters = [ + // The order is the priority; the first match stops further lookup + [$.battleProcessingIcon, $._filterBattleProcess], + [$.transferPlayerIcon, $._filterTransferPlayer], + [$.changeGoldIcon, $._filterChangeGold], + [$.changeItemIcon, $._filterChangeItems], + [$.changeWeaponIcon, $._filterChangeWeapons], + [$.changeArmorIcon, $._filterChangeArmors], + [$.showTextIcon, $._filterMessages], + ]; + /** + * Function to check whether conditions are prime to check for events under the mouse + */ + $.conditionsValidForMouseHoverCheck = function() { + return (SceneManager.isCurrentSceneStarted() && this._isSceneMap() && + $gameMap !== null && + $dataMap !== null && + !$gameMap._interpreter.isRunning()); + } + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // START - Highlight On Hover option + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if ($.highlightOnHover){ + //========================================================================= + // TouchInput modifications + //========================================================================= + /** + * Removing the check for whether _mousePressed is active to facilitate hover events + */ + TouchInput._onMouseMove = function(event) { + var x = Graphics.pageToCanvasX(event.pageX); + var y = Graphics.pageToCanvasY(event.pageY); + this._onMove(x, y); + }; + //========================================================================= + // Window_Selectable modifications + //========================================================================= + /** + * Aliased update function, adds processMouseMoved() call + */ + var _Window_Selectable_update = Window_Selectable.prototype.update; + Window_Selectable.prototype.update = function() { + this.processMouseMoved(); + _Window_Selectable_update.call(this); + }; + /** + * Check if conditions are right for calling onTouch when using mouse movement (for hover activation) + */ + Window_Selectable.prototype.processMouseMoved = function() { + if (this.isOpenAndActive() && TouchInput.isMoved() && this.cursorIsWithinWindow()) { + this.onTouch(false); + } + }; + /** + * Check if cursor is within window + */ + Window_Selectable.prototype.cursorIsWithinWindow = function() { + var _x = this.canvasToLocalX(TouchInput.x); + var _y = this.canvasToLocalY(TouchInput.y); + if (_x > this.padding && _x <= this.width - this.padding) { + if (_y > this.padding && _y < this.height - this.padding) { + return true; + } + } + return false; + } + + //============================================================================= + // SoundManager modifications + //============================================================================= + /* + * Static var to keep track of last played cursor SE frame + */ + SoundManager._lastPlayCursorFrame = 0; + /** + * Aliased function to add check for whether playCursor should play, based on cooldown setting + */ + var _SoundManager_playCursor = SoundManager.playCursor; + SoundManager.playCursor = function() { + var _canPlay = SoundManager._lastPlayCursorFrame > Graphics.frameCount + || Graphics.frameCount > SoundManager._lastPlayCursorFrame + $.audioCooldownOnHover; + + if (_canPlay) { + _SoundManager_playCursor.call(this); + SoundManager._lastPlayCursorFrame = Graphics.frameCount; + } + }; + } + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // END - Highlight On Hover option + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + //============================================================================= + // TouchInput modifications + //============================================================================= + /** + * Alias and extend initialize() with _setupCursorIconObject() + */ + var _TouchInput_initialize = TouchInput.initialize; + TouchInput.initialize = function() { + this._setupCursorIconObject(); + _TouchInput_initialize.call(this); + }; + /** + * Setup cursorIcon object + */ + TouchInput._setupCursorIconObject = function() { + this.cursorIcon = new Sprite(); + this.cursorIcon.drawIcon = Window_Base.prototype.drawIcon; + this.cursorIcon.bitmap = new Bitmap(Window_Base._iconWidth, Window_Base._iconHeight); + this.cursorIcon.contents = this.cursorIcon.bitmap; + this.cursorIcon.iconIndex = null; + } + /** + * Alias and extend _onMouseMove() to use new function _checkCursorStatus() + */ + var _TouchInput_onMouseMove = TouchInput._onMouseMove; + TouchInput._onMouseMove = function(event) { + _TouchInput_onMouseMove.call(this, event); + this._checkCursorStatus(event.pageX, event.pageY); + }; + /** + * Check cursor's status and whether to alter cursor + * @method _checkCursorStatus + * @param pageX {Number} Mouse page X coordinate + * @param pageY {Number} Mouse page Y coordinate + */ + TouchInput._checkCursorStatus = function(pageX, pageY) { + // Check for events under mouse and perform actions, and get event in result + var overEvents = this._checkForEventUnderMouse(pageX, pageY); + + // Update cursor icon position + if (this.cursorIcon.iconIndex) { + this.cursorIcon.x = Graphics.pageToCanvasX(pageX) + + (this.cursorIcon.customOffsetX !== null ? this.cursorIcon.customOffsetX : $.iconOffsetX); + this.cursorIcon.y = Graphics.pageToCanvasY(pageY) + + (this.cursorIcon.customOffsetY !== null ? this.cursorIcon.customOffsetY : $.iconOffsetY); + this.cursorIcon.visible = true; + } + + // Check if leave activate is to be triggered for a previously active event + this._activeEvents = this._activeEvents || []; + while (this._activeEvents.length > 0) { + var activeEvent = this._activeEvents.shift(); + if (activeEvent.TDDP_MS.leaveActivate) { + if (!overEvents || overEvents.length == 0 || overEvents.indexOf(activeEvent) == -1) { + activeEvent.start(); + } + } + } + // Reset active events if new over events + this._activeEvents = overEvents || this._activeEvents; + } + /** + * Alias and extend update() to store last event coords for checking if cursor has left an event + */ + var _TouchInput_update = TouchInput.update; + TouchInput.update = function() { + _TouchInput_update.call(this); + if (this._lastEventPageX == this._curEventPageX && this._lastEventPageY == this._curEventPageY) { + this._checkCursorStatus(this._lastEventPageX, this._lastEventPageY); + } + this._lastEventPageX = this._curEventPageX; + this._lastEventPageY = this._curEventPageY; + } + /** + * Perform check for event under mouse and perform functions depending on parsed notetag properties + * @method _checkForEventUnderMouse + * @param pageX {Number} Mouse page X coordinate + * @param pageY {Number} Mouse page Y coordinate + * @return {Array} of found events or {Boolean} false if none. + */ + TouchInput._checkForEventUnderMouse = function(pageX, pageY) { + this._curEventPageX = pageX; + this._curEventPageY = pageY; + if ($.conditionsValidForMouseHoverCheck()) { + var x = $gameMap.canvasToMapX(Graphics.pageToCanvasX(pageX)); + var y = $gameMap.canvasToMapY(Graphics.pageToCanvasY(pageY)); + var events = $._eventsXy(x, y); + events.reverse().forEach(function(game_event) { + if (game_event.TDDP_MS.hoverIcon) { + TouchInput._updateCursorIcon(game_event.TDDP_MS.hoverIcon); + if ($.hideCursor) $._hideMouseCursor(); + } else { + TouchInput._hideCursorIcon(); + }; + if (game_event.TDDP_MS.hoverActivate && !$gameMessage.isBusy()) { + game_event.start(); + }; + if (game_event.TDDP_MS.hideCursor) { + $._hideMouseCursor(); + }; + if (game_event.TDDP_MS.customOffsetX && game_event.TDDP_MS.customOffsetY) { + TouchInput.cursorIcon.customOffsetX = game_event.TDDP_MS.customOffsetX; + TouchInput.cursorIcon.customOffsetY = game_event.TDDP_MS.customOffsetY; + }; + if ($.useCustomCursor) { + if (game_event.TDDP_MS.customCursor) { + $._showCustomCursor(game_event.TDDP_MS.customCursor); + } else { + $._showCustomCursor(); + } + }; + if (game_event.TDDP_MS.hoverSwitch) { + var key = [$gameMap._mapId, game_event._eventId, game_event.TDDP_MS.hoverSwitch.key] + $gameSelfSwitches.setValue(key, game_event.TDDP_MS.hoverSwitch.val === 'true') + }; + }); + if (events && events.length > 0) return events; + } + // If no events found under cursor perform default actions + TouchInput._hideCursorIcon(); + $._showMouseCursor(); + return false; + }; + /** + * Update the cursor icon + * @method _updateCursorIcon + * @param iconIndex {Number} The icon index to show next to the cursor + */ + TouchInput._updateCursorIcon = function(iconIndex) { + if (this.cursorIcon.iconIndex != iconIndex) { + this.cursorIcon.iconIndex = iconIndex; + this.cursorIcon.contents.clear(); + this.cursorIcon.drawIcon(iconIndex, 0, 0); + this.cursorIcon.visible = false; + } + }; + /** + * Hide the cursor icon + * @method _hideCursorIcon + */ + TouchInput._hideCursorIcon = function() { + this.cursorIcon.iconIndex = null; + this.cursorIcon.visible = false; + this.cursorIcon.customOffsetX = null; + this.cursorIcon.customOffsetY = null; + } + /** + * Alias and extend _onTrigger() to only fire if we're not activating on click + */ + var _TouchInput_onTrigger = TouchInput._onTrigger; + TouchInput._onTrigger = function(x, y) { + if (TouchInput._activateClickEvents(x, y)) { + $gameTemp.clearDestination(); // Invalidate destination + } else { + _TouchInput_onTrigger.call(this, x, y); + } + }; + /** + * Activate click events if valid and return true if so + * @method _activateClickEvents + * @param x {Number} Map X coordinate + * @param y {Number} Map Y coordinate + */ + TouchInput._activateClickEvents = function(x, y) { + var found_click_event = false; + if ($.conditionsValidForMouseHoverCheck()) { + var x = $gameMap.canvasToMapX(x); + var y = $gameMap.canvasToMapY(y); + $._eventsXy(x, y).reverse().forEach(function(game_event) { + if (game_event.TDDP_MS.clickActivate) { + game_event.start(); + found_click_event = true; + }; + if (game_event.TDDP_MS.clickSwitch) { + var key = [$gameMap._mapId, game_event._eventId, game_event.TDDP_MS.clickSwitch.key] + $gameSelfSwitches.setValue(key, game_event.TDDP_MS.clickSwitch.val === 'true'); + found_click_event = true; + }; + }); + } + return found_click_event; + } + //============================================================================= + // Spriteset_Map modifications + //============================================================================= + /** + * Alias and extend createScreenSprites() to also create cursor icon holder sprite + */ + var _Spriteset_Map_createScreenSprites = Spriteset_Map.prototype.createScreenSprites; + Spriteset_Map.prototype.createScreenSprites = function() { + _Spriteset_Map_createScreenSprites.call(this); + this.createCursorIconSprite(); + }; + /** + * Create a container sprite for the cursor icon + */ + Spriteset_Map.prototype.createCursorIconSprite = function() { + this._cursorIconSprite = new Sprite(); + this._cursorIconSprite.setFrame(0, 0, Graphics.width, Graphics.height); + this._cursorIconSprite.addChild(TouchInput.cursorIcon); + this.addChild(this._cursorIconSprite); + }; + //============================================================================= + // Game_Event modifications + //============================================================================= + /** + * Alias and extend setupPage() to also setup mouse system properties + */ + var _Game_Event_setupPage = Game_Event.prototype.setupPage; + Game_Event.prototype.setupPage = function() { + _Game_Event_setupPage.call(this); + this.setupMouseSystemProperties(); + }; + /** + * Setup mouse system properties on events, for storing notetag parsing on page updates + */ + Game_Event.prototype.setupMouseSystemProperties = function() { + this.TDDP_MS = {}; + this.TDDP_MS.hoverIcon = false; + this.TDDP_MS.allowAutoCursor = true; + this.TDDP_MS.allowAutoIcon = true; + this.TDDP_MS.clickActivate = false; + this.TDDP_MS.hoverActivate = false; + this.TDDP_MS.leaveActivate = false; + this.TDDP_MS.hideCursor = false; + this.TDDP_MS.customOffsetX = false; + this.TDDP_MS.customOffsetY = false; + this.TDDP_MS.customCursor = false; + this.TDDP_MS.clickSwitch = false; + this.TDDP_MS.hoverSwitch = false; + $._findInEventNotetags(this, /hover_icon\s(.*?);/i, function(result) { + if (!result) return; + result = result[result.length - 1]; + if ($.mouseIconTags[result]) { + result = $.mouseIconTags[result]; + } + this.TDDP_MS.hoverIcon = Number(result); + }); + $._findInEventNotetags(this, $.noAutoCursorNotetag, function() { + this.TDDP_MS.allowAutoCursor = false; + }); + $._findInEventNotetags(this, $.noAutoIconNotetag, function() { + this.TDDP_MS.allowAutoIcon = false; + }); + $._findInEventNotetags(this, $.clickToActivateNote, function() { + this.TDDP_MS.clickActivate = true; + }); + $._findInEventNotetags(this, $.hoverToActivateNote, function() { + this.TDDP_MS.hoverActivate = true; + }); + $._findInEventNotetags(this, $.leaveToActivateNote, function() { + this.TDDP_MS.leaveActivate = true; + }); + $._findInEventNotetags(this, 'hide_cursor!', function() { + this.TDDP_MS.hideCursor = true; + }); + $._findInEventNotetags(this, /icon_offset\s(.*?)\s(.*?);/i, function(result) { + this.TDDP_MS.customOffsetX = Number(result[1]); + this.TDDP_MS.customOffsetY = Number(result[2]); + }); + $._findInEventNotetags(this, /hover_cursor\s(.*?);/i, function(result) { + this.TDDP_MS.customCursor = result[result.length - 1]; + }); + $._findInEventNotetags(this, /click_switch\s(.*?)\s(.*?);/i, function(result) { + this.TDDP_MS.clickSwitch = {}; + this.TDDP_MS.clickSwitch.key = String(result[1]); + this.TDDP_MS.clickSwitch.val = String(result[2]); + + }); + $._findInEventNotetags(this, /hover_switch\s(.*?)\s(.*?);/i, function(result) { + this.TDDP_MS.hoverSwitch = {}; + this.TDDP_MS.hoverSwitch.key = String(result[1]); + this.TDDP_MS.hoverSwitch.val = String(result[2]); + }); + // If no active event page, there's no event commands to go through + if (!this.page()) return; + // Auto cursor checks, only if there's a page and allowed + if (this.TDDP_MS.allowAutoCursor) { + for (var i=0, max=$.autoCursorFilters.length; i < max; i++) { + if (this.TDDP_MS.customCursor) break; + var entry = $.autoCursorFilters[i]; + var cursor = entry[0]; + var filter = entry[1]; + if (typeof cursor == "string") { + var matches = this.page().list.filter(filter); + if (matches.length > 0) { + this.TDDP_MS.customCursor = cursor; + } + } + } + } + // Auto icon checks + if (this.TDDP_MS.allowAutoIcon) { + for (var i=0, max=$.autoIconFilters.length; i < max; i++) { + if (this.TDDP_MS.hoverIcon) break; + var entry = $.autoIconFilters[i]; + var icon = entry[0]; + var filter = entry[1]; + if (typeof icon == "string") { + var matches = this.page().list.filter(filter); + if (matches.length > 0) { + if (isNaN(icon)) { + // Icon is a string, so let's look in Icon Tags + icon = $.mouseIconTags[icon] + } + this.TDDP_MS.hoverIcon = Number(icon); + } + } + } + } + } +})(TDDP_MouseSystemEx); diff --git a/js/plugins/YEP_EventMiniLabel.js b/js/plugins/YEP_EventMiniLabel.js new file mode 100644 index 0000000..7f9afeb --- /dev/null +++ b/js/plugins/YEP_EventMiniLabel.js @@ -0,0 +1,557 @@ +//============================================================================= +// Yanfly Engine Plugins - Event Mini Label +// YEP_EventMiniLabel.js +//============================================================================= + +var Imported = Imported || {}; +Imported.YEP_EventMiniLabel = true; + +var Yanfly = Yanfly || {}; +Yanfly.EML = Yanfly.EML || {}; +Yanfly.EML.version = 1.12 + +//============================================================================= + /*: + * @plugindesc v1.12 Creates miniature-sized labels over events to allow + * you to insert whatever text you'd like in them. + * @author Yanfly Engine Plugins + * + * @param Default Show + * @desc Show mini labels by default? + * @type boolean + * @on YES + * @off NO + * NO - false YES - true + * @default true + * + * @param Minimum Width + * @type number + * @min 1 + * @desc What is the minimum width in pixels for mini labels? + * @default 136 + * + * @param Font Size + * @type number + * @min 1 + * @desc What is the font size used for text inside a mini label? + * Default: 28 + * @default 20 + * + * @param X Buffer + * @type number + * @desc Alter the X position of the label by this much. + * @default 0 + * + * @param Y Buffer + * @type number + * @desc Alter the Y position of the label by this much. + * @default 36 + * + * @param Battle Transition + * @type boolean + * @on YES + * @off NO + * @desc Show Event Mini label during battle transition? + * NO - false YES - true + * @default false + * + * @help + * ============================================================================ + * Introduction + * ============================================================================ + * + * This plugin lets you place text above the heads of various events using a + * miniature label through a comment tag. + * + * ============================================================================ + * Comment Tags + * ============================================================================ + * + * Comment tags are 'notetags' used within the lines of an event's comments. + * The reason I'm using the comment tags instead of the notetags is because + * each page of an event can yield a different potential name. + * + * To use this, make a comment within the event you wish to make the mini + * label for and insert the following: + * + * + * This will display the 'text' above the event. You can use text codes for + * this comment tag and it will create dynamic messages. + * + * + * This will change the font size used for the mini label to x. If this tag + * isn't used, the font size will be the default value in the parameters. + * + * + * + * This will adjust the X buffer for the mini label by x value. If this tag + * isn't used, the X buffer will be the default value in the parameters. + * + * + * + * This will adjust the Y buffer for the mini label by x value. If this tag + * isn't used, the Y buffer will be the default value in the parameters. + * + * + * This will make the mini label to always be shown, even when the plugin + * command to hide mini labels is used. + * + * + * The player will have to be within x tiles of this event in order for the + * mini label to appear visibly. + * + * + * This will require the player to be facing the direction of the event in + * order for the mini label to appear. + * + * ============================================================================ + * Plugin Commands + * ============================================================================ + * + * If you would like to shut off the Event Mini Label mid-game or turn it on, + * you can use the following plugin commands: + * + * Plugin Command: + * + * HideMiniLabel + * Hides all Event Mini Label. + * + * ShowMiniLabel + * Shows all Event Mini Label. + * + * RefreshMiniLabel + * Refreshes all Event Mini Labels on the map. + * + * ============================================================================ + * Changelog + * ============================================================================ + * + * Version 1.12: + * - Updated for RPG Maker MV version 1.5.0. + * + * Version 1.11: + * - Added 'Battle Transition' plugin parameter. Enabling this will allow you + * to show the Event Mini Labels during the battle transition. Keeping it + * disabled will hide them during the transition. + * + * Version 1.10: + * - Mini Windows will now readjust their size to show at normal scale if the + * map is zoomed in. + * + * Version 1.09: + * - Fixed a bug that caused Mini Labels that started off as hidden to remain + * hidden even after turning the Mini Labels on. + * + * Version 1.08: + * - Added comment tag. + * - Moved the priority of the Mini Labels to be later added to the spriteset + * so they can stay on top of more effects. + * + * Version 1.07: + * - Added more padding space so text doesn't get cut off. + * + * Version 1.06: + * - Fixed a bug that caused some mini labels to show if the event was loaded + * onto the map without any currently active pages. + * + * Version 1.05: + * - Added 'X Buffer' plugin parameter and the and + * comment tags to alter the X position of the event + * mini label. + * + * Version 1.04: + * - Added 'RefreshMiniLabel' plugin command to allow you to manually refresh + * all mini labels on the map. + * + * Version 1.03: + * - Optimized updating performance to reduce lag on maps with many events. + * + * Version 1.01: + * - Fixed a bug that didn't update event labels under certain page conditions. + * - Added notetag. + * + * Version 1.00: + * - Finished Plugin! + */ +//============================================================================= + +//============================================================================= +// Parameter Variables +//============================================================================= + +Yanfly.Parameters = PluginManager.parameters('YEP_EventMiniLabel'); +Yanfly.Param = Yanfly.Param || {}; + +Yanfly.Param.EMWDefaultShow = eval(String(Yanfly.Parameters['Default Show'])); +Yanfly.Param.EMWMinWidth = Number(Yanfly.Parameters['Minimum Width']); +Yanfly.Param.EMWFontSize = Number(Yanfly.Parameters['Font Size']); +Yanfly.Param.EMWBufferX = Number(Yanfly.Parameters['X Buffer']); +Yanfly.Param.EMWBufferY = Number(Yanfly.Parameters['Y Buffer']); +Yanfly.Param.EMWBatTran = eval(String(Yanfly.Parameters['Battle Transition'])); + +//============================================================================= +// Game_System +//============================================================================= + +Yanfly.EML.Game_System_initialize = Game_System.prototype.initialize; +Game_System.prototype.initialize = function() { + Yanfly.EML.Game_System_initialize.call(this); + this.initEventMiniLabel(); +}; + +Game_System.prototype.initEventMiniLabel = function() { + this._showEventMiniLabel = Yanfly.Param.EMWDefaultShow; +}; + +Game_System.prototype.isShowEventMiniLabel = function() { + if (this._showEventMiniLabel === undefined) this.initEventMiniLabel(); + return this._showEventMiniLabel; +}; + +Game_System.prototype.setEventMiniLabel = function(value) { + this._showEventMiniLabel = value; + Game_Interpreter.prototype.refreshEventMiniLabel.call(this); +}; + +//============================================================================= +// Game_Interpreter +//============================================================================= + +Yanfly.EML.Game_Interpreter_pluginCommand = + Game_Interpreter.prototype.pluginCommand; +Game_Interpreter.prototype.pluginCommand = function(command, args) { + Yanfly.EML.Game_Interpreter_pluginCommand.call(this, command, args) + if (command === 'HideMiniLabel') $gameSystem.setEventMiniLabel(false); + if (command === 'ShowMiniLabel') $gameSystem.setEventMiniLabel(true); + if (command === 'RefreshMiniLabel') this.refreshEventMiniLabel(); +}; + +Game_Interpreter.prototype.refreshEventMiniLabel = function() { + if ($gameParty.inBattle()) return; + var scene = SceneManager._scene; + if (scene instanceof Scene_Map) { + scene.refreshAllMiniLabels(); + } +}; + +//============================================================================= +// Window_EventMiniLabel +//============================================================================= + +function Window_EventMiniLabel() { + this.initialize.apply(this, arguments); +} + +Window_EventMiniLabel.prototype = Object.create(Window_Base.prototype); +Window_EventMiniLabel.prototype.constructor = Window_EventMiniLabel; + +Window_EventMiniLabel.prototype.initialize = function() { + this._bufferX = Yanfly.Param.EMWBufferX; + this._bufferY = Yanfly.Param.EMWBufferY; + this._fontSize = Yanfly.Param.EMWFontSize; + this._alwaysShow = false; + var width = Yanfly.Param.EMWMinWidth; + var height = this.windowHeight(); + this._range = 500; + this._reqFacing = false; + Window_Base.prototype.initialize.call(this, 0, 0, width, height); + this.opacity = 0; + this.contentsOpacity = 0; + this._character = null; + this._page = 0; + this._text = ''; +}; + +Window_EventMiniLabel.prototype.standardFontSize = function() { + if (this._fontSize !== undefined) return this._fontSize; + return Yanfly.Param.EMWFontSize; +}; + +Window_EventMiniLabel.prototype.windowHeight = function() { + var height = this.fittingHeight(1) + height = Math.max(height, 36 + this.standardPadding() * 2); + return height; +}; + +Window_EventMiniLabel.prototype.lineHeight = function() { + return this.standardFontSize() + 8; +}; + +Window_EventMiniLabel.prototype.bufferX = function() { + if (this._bufferX !== undefined) return this._bufferX; + return Yanfly.Param.EMWBufferX; +}; + +Window_EventMiniLabel.prototype.bufferY = function() { + if (this._bufferY !== undefined) return this._bufferY; + return Yanfly.Param.EMWBufferY; +}; + +Window_EventMiniLabel.prototype.setCharacter = function(character) { + this.setText(''); + this._character = character; + if (character._eventId) this.gatherDisplayData(); +}; + +Window_EventMiniLabel.prototype.gatherDisplayData = function() { + this._page = this._character.page(); + this._pageIndex = this._character._pageIndex; + this._range = 500; + this._bufferY = Yanfly.Param.EMWBufferY; + this._fontSize = Yanfly.Param.EMWFontSize; + this._alwaysShow = false; + this._reqFacing = false; + if (!this._character.page()) { + return this.visible = false; + } + var list = this._character.list(); + var max = list.length; + var comment = ''; + for (var i = 0; i < max; ++i) { + var ev = list[i]; + if ([108, 408].contains(ev.code)) comment += ev.parameters[0] + '\n'; + } + this.extractNotedata(comment); +}; + +Window_EventMiniLabel.prototype.extractNotedata = function(comment) { + if (comment === '') return; + var tag1 = /<(?:MINI WINDOW|MINI LABEL):[ ](.*)>/i; + var tag2 = /<(?:MINI WINDOW FONT SIZE|MINI LABEL FONT SIZE):[ ](\d+)>/i; + var tag3 = /<(?:MINI WINDOW Y BUFFER|MINI LABEL Y BUFFER):[ ]([\+\-]\d+)>/i; + var tag4 = /<(?:ALWAYS SHOW MINI WINDOW|ALWAYS SHOW MINI LABEL)>/i; + var tag5 = /<(?:MINI WINDOW RANGE|MINI LABEL RANGE):[ ](\d+)>/i; + var tag6 = /<(?:MINI WINDOW X BUFFER|MINI LABEL X BUFFER):[ ]([\+\-]\d+)>/i; + var tag7 = /<(?:MINI WINDOW REQUIRE FACING|MINI LABEL REQUIRE FACING)>/i; + var notedata = comment.split(/[\r\n]+/); + var text = ''; + for (var i = 0; i < notedata.length; ++i) { + var line = notedata[i]; + if (line.match(tag1)) { + text = String(RegExp.$1); + } else if (line.match(tag2)) { + this._fontSize = parseInt(RegExp.$1); + } else if (line.match(tag3)) { + this._bufferY = parseInt(RegExp.$1); + } else if (line.match(tag4)) { + this._alwaysShow = true; + } else if (line.match(tag5)) { + this._range = parseInt(RegExp.$1); + } else if (line.match(tag6)) { + this._bufferX = parseInt(RegExp.$1); + } else if (line.match(tag7)) { + this._reqFacing = true; + } + } + this.setText(text); + if (this._text === '' || !$gameSystem.isShowEventMiniLabel()) { + this.visible = false; + this.contentsOpacity = 0; + } else { + this.visible = true; + if (this._reqFacing) { + this.contentsOpacity = 0; + } else { + this.contentsOpacity = 255; + } + } + +}; + +Window_EventMiniLabel.prototype.setText = function(text) { + if (this._text === text) return; + this._text = text; + this.refresh(); +}; + +Window_EventMiniLabel.prototype.refresh = function() { + if (Imported.YEP_SelfSwVar) { + $gameTemp.setSelfSwVarEvent(this._character._mapId, this._character._eventId); + } + this.contents.clear(); + var txWidth = this.textWidthEx(this._text); + txWidth += this.textPadding() * 2; + var width = txWidth; + this.width = Math.max(width, Yanfly.Param.EMWMinWidth); + this.width += this.standardPadding() * 2; + this.height = this.windowHeight(); + this.createContents(); + var wx = (this.contents.width - txWidth) / 2; + var wy = 0; + this.drawTextEx(this._text, wx + this.textPadding(), wy); + if (Imported.YEP_SelfSwVar) $gameTemp.clearSelfSwVarEvent(); +}; + +Window_EventMiniLabel.prototype.forceRefresh = function() { + this.refresh(); + this.updateOpacity(); +}; + +Window_EventMiniLabel.prototype.textWidthEx = function(text) { + return this.drawTextEx(text, 0, this.contents.height); +}; + +Window_EventMiniLabel.prototype.update = function() { + Window_Base.prototype.update.call(this); + if (!this._character) return; + if (!this._character._eventId) return; + this.updatePage(); + if (this._text === '') return; + this.updateOpacity(); +}; + +Window_EventMiniLabel.prototype.updatePage = function() { + if (this._pageIndex === this._character._pageIndex) return; + this._pageIndex = this._character._pageIndex; + this.contents.clear(); + this._text = ''; + this.gatherDisplayData(); +}; + +Window_EventMiniLabel.prototype.updateOpacity = function() { + if (this.showMiniLabel()) { + this.show(); + } else { + this.hide(); + } +}; + +Window_EventMiniLabel.prototype.show = function() { + if (this.contentsOpacity >= 255) return; + this.contentsOpacity += 16; + this.visible = true; +}; + +Window_EventMiniLabel.prototype.hide = function() { + if (this.contentsOpacity <= 0) { + if (this.visible) this.visible = false; + return; + } + this.contentsOpacity -= 16; +}; + +Window_EventMiniLabel.prototype.showMiniLabel = function() { + if (this._alwaysShow) return true; + if (!this.withinRange()) return false; + if (!this.meetsFacingRequirements()) return false; + if (!Yanfly.Param.EMWBatTran) { + if (SceneManager._scene._encounterEffectDuration > 0) { + this.contentsOpacity = 0; + return false; + } + } + return $gameSystem.isShowEventMiniLabel(); +}; + +Window_EventMiniLabel.prototype.withinRange = function() { + if (this._range >= 500) return true; + var player = $gamePlayer; + var chara = this._character; + if (this._range >= Math.abs(player.x - chara.x)) { + if (this._range >= Math.abs(player.y - chara.y)) { + return true; + } + } + return false; +}; + +Window_EventMiniLabel.prototype.meetsFacingRequirements = function() { + if (!this._character) return true; + if (!this._reqFacing) return true; + var direction = $gamePlayer.direction(); + var playerX = $gamePlayer.x; + var playerY = $gamePlayer.y; + var eventX = this._character.x; + var eventY = this._character.y; + switch (direction) { + case 1: + return playerX >= eventX && playerY <= eventY; + break; + case 2: + return playerY <= eventY; + break; + case 3: + return playerX <= eventX && playerY <= eventY; + break; + case 4: + return playerX >= eventX; + break; + case 6: + return playerX <= eventX; + break; + case 7: + return playerX >= eventX && playerY >= eventY; + break; + case 8: + return playerY >= eventY; + break; + case 9: + return playerX <= eventX && playerY >= eventY; + break; + default: + return true; + break; + } +}; + +//============================================================================= +// Sprite_Character +//============================================================================= + +Yanfly.EML.Sprite_Character_update = Sprite_Character.prototype.update; +Sprite_Character.prototype.update = function() { + Yanfly.EML.Sprite_Character_update.call(this); + this.updateMiniLabel(); + this.updateMiniLabelZoom(); +}; + +Sprite_Character.prototype.updateMiniLabel = function() { + this.setupMiniLabel(); + if (!this._miniLabel) return; + this.positionMiniLabel(); +}; + +Sprite_Character.prototype.setupMiniLabel = function() { + if (this._miniLabel) return; + if (!SceneManager._scene._spriteset) return; + this._miniLabel = new Window_EventMiniLabel(); + this._miniLabel.setCharacter(this._character); + //this.parent.parent.addChild(this._miniLabel); + SceneManager._scene._spriteset.addChild(this._miniLabel); +}; + +Sprite_Character.prototype.positionMiniLabel = function() { + var win = this._miniLabel; + var width = win.width * win.scale.x; + win.x = this.x + width / -2 + win.bufferX(); + var height = win.height * win.scale.y; + var buffer = win.bufferY() * win.scale.y; + win.y = this.y + (this.height * -1) - height + buffer; +}; + +Sprite_Character.prototype.updateMiniLabelZoom = function() { + if (!this._miniLabel) return; + var spriteset = SceneManager._scene._spriteset; + this._miniLabel.scale.x = 1 / spriteset.scale.x; + this._miniLabel.scale.y = 1 / spriteset.scale.y; +}; + +Sprite_Character.prototype.refreshMiniLabel = function() { + if (this._miniLabel) this._miniLabel.forceRefresh(); +}; + +//============================================================================= +// Scene_Map +//============================================================================= + +Scene_Map.prototype.refreshAllMiniLabels = function() { + var length = this._spriteset._characterSprites.length; + for (var i = 0; i < length; ++i) { + var sp = this._spriteset._characterSprites[i]; + sp.refreshMiniLabel(); + } +}; + +//============================================================================= +// End of File +//============================================================================= diff --git a/js/plugins/YEP_Extra_Enemy_Drops.js b/js/plugins/YEP_Extra_Enemy_Drops.js new file mode 100644 index 0000000..b2aaef7 --- /dev/null +++ b/js/plugins/YEP_Extra_Enemy_Drops.js @@ -0,0 +1,77 @@ +#Extra Enemy Drops v1.0 +#----------# +#Features: Let's you set, via notes, more than just three item drops +# from an enemy. Yay! +# +#Usage: Plug and play, customize as needed +# +# Enemy Notetags: +# +# type is 1 for item, 2 for weapon, 3 for armor +# id is the id of the item +# rate is the 1/rate of the item, 20 would be 1/20 chance +# +# A weapon of id 3 that drops 1 out of 5 times would be: +# +# +#----------# +#-- Script by: V.M of D.T +# +#- Questions or comments can be: +# given by email: sumptuaryspade@live.ca +# provided on facebook: http://www.facebook.com/DaimoniousTailsGames +# All my other scripts and projects can be found here: http://daimonioustails.weebly.com/ +# +#- Free to use in any project with credit given, donations always welcome! + +#Maximum number of items that can drop from one enemy in a battle +MAX_ENEMY_DROPS = 3 + +class RPG::Enemy + def add_drop(type,id,rate) + @drop_items.push(RPG::Enemy::DropItem.new) + @drop_items[-1].kind = type + @drop_items[-1].data_id = id + @drop_items[-1].denominator = rate + end + def add_drops + snote = self.note.clone + while snote.include?("/ + add_drop($1.to_i,$2.to_i,$3.to_i) + snote[snote.index(" 0 && rand * di.denominator < drop_item_rate && iter < MAX_ENEMY_DROPS + iter += 1 + r.push(item_object(di.kind, di.data_id)) + else + r + end + end + end +end \ No newline at end of file diff --git a/js/plugins/YEP_JobPoints.js b/js/plugins/YEP_JobPoints.js new file mode 100644 index 0000000..53e7f5b --- /dev/null +++ b/js/plugins/YEP_JobPoints.js @@ -0,0 +1,804 @@ +//============================================================================= +// 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 This plugin by itself doesn't do much, but it enables + * actors to acquire JP (job points) used for other plugins. + * @author Yanfly Engine Plugins + * + * @param ---General--- + * @default + * + * @param JP Text + * @parent ---General--- + * @desc This changes how you want JP to appear in the game. + * @default JP + * + * @param JP Icon + * @parent ---General--- + * @type number + * @min 0 + * @desc This is the icon used for JP. + * Use 0 if you wish to use no icon. + * @default 188 + * + * @param Max JP + * @parent ---General--- + * @type number + * @min 0 + * @desc This is the maximum JP an actor can have per class. + * Use 0 if you wish to have no limit. + * @default 0 + * + * @param JP Per Action + * @parent ---General--- + * @desc This is the amount of JP an actor gains for his/her + * current class whenever he/she performs an action. + * @default 10 + Math.randomInt(10) + * + * @param JP Per Level + * @parent ---General--- + * @desc This is the amount of JP an actor gains per level up. + * @default 100 + Math.randomInt(100) + * + * @param JP Per Enemy + * @parent ---General--- + * @desc This is the amount of JP given per defeated enemy. + * @default 50 + Math.randomInt(10) + * + * @param Show Results + * @parent ---General--- + * @type boolean + * @on Show + * @off Hide + * @desc Upon winning, show how much JP is earned for default? + * NO - false YES - true + * @default true + * + * @param JP Gained in Battle + * @parent ---General--- + * @desc Adjusts how the gained JP text is shown after battle. + * %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 Actors must be alive to receive JP earned from enemies. + * NO - false YES - true + * @default true + * + * @param ---Menu--- + * @default + * + * @param Show In Menu + * @parent ---Menu--- + * @type boolean + * @on Show + * @off Hide + * @desc Display JP in the main menu? + * NO - false YES - true + * @default true + * + * @param Menu Format + * @parent ---Menu--- + * @desc How the JP text format in the menu appears. + * %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 Enables Victory Aftermath windows. + * NO - false YES - true + * @default true + * + * @param Aftermath Text + * @parent ---Victory Aftermath--- + * @desc Text used to describe how much JP is earned. + * @default JP Earned + * + * @param Aftermath Format + * @parent ---Victory Aftermath--- + * @desc How the JP text format in the aftermath appears. + * %1 - Value %2 - Amount %3 - Icon + * @default +%1\c[4]%2\c[0]%3 + * + * @param Aftermath JP Earned + * @parent ---Victory Aftermath--- + * @desc Describes how much JP is earned per actor. + * @default JP Earned in Battle + * + * @help + * ============================================================================ + * Introduction + * ============================================================================ + * + * This plugin by itself will not change any major game functions, but instead, + * it works in combination with other plugins that make use of this plugin's + * functions should you decide to incorporate Job Points into your game. + * + * When Job Points are earned, they are given to the actor's current class. If + * the actor were to switch classes, then the Job Points will be changed to + * that class's Job Points until reverted back. + * + * ============================================================================ + * Victory Aftermath Compatibility + * ============================================================================ + * + * If you have the YEP_VictoryAftermath plugin installed and wish to make use + * of the JP windows, position this plugin lower than YEP_VictoryAftermath in + * the Plugin Manager. + * + * After that, if you wish to define the timing of the JP window to appear at + * a certain point instead of the plugin doing it automatically, insert "JP" in + * the "Victory Order" parameter within Victory Aftermath where you want the + * JP window to appear. + * + * ============================================================================ + * Notetags + * ============================================================================ + * + * Here are some notetags related to Job Points. + * + * Actor Notetags + * + * Sets the actor's starting JP value to be x for the actor's initial class. + * + * + * Sets the actor's starting JP value for class x to be y. + * + * + * This changes the rate of JP gained by x%. By default, all objects have a + * default rate of 100%. Increasing this to 200% will increase JP gained by + * twice as much while 50% will halve the amount of JP gained. + * + * Skill and Item Notetags + * + * This makes it so that the actor using this skill or item will gain x + * amount of JP instead of the default amount of JP found in the parameters. + * + * + * This makes it so that the target actor affected by this skill or item will + * gain x amount of JP. + * + * Class, Weapon, Armor, and State Notetag + * + * This changes the rate of JP gained by x%. By default, all objects have a + * default rate of 100%. Increasing this to 200% will increase JP gained by + * twice as much while 50% will halve the amount of JP gained. + * + * Enemy Notetag + * + * When the enemy is defeated, the party members present will gain x JP each. + * + * ============================================================================ + * Plugin Commands + * ============================================================================ + * + * For those wondering how to manually give, remove, or set JP for an actor, + * you can use the following Plugin Commands. + * + * Plugin Commands: + * + * gainJp actorId jp + * gainJp actorId jp classId + * Replace 'actorId' with the ID of the actor you wish to change the JP of. + * Replace 'jp' with the amount of JP you wish to alter. If you are using + * 'classId', replace it with the ID of the actor's class you wish to alter. + * This command will let the actor gain JP. + * + * loseJp actorId jp + * loseJp actorId jp classId + * Replace 'actorId' with the ID of the actor you wish to change the JP of. + * Replace 'jp' with the amount of JP you wish to alter. If you are using + * 'classId', replace it with the ID of the actor's class you wish to alter. + * This command will cause the actor to lose JP. + * + * setJp actorId jp + * setJp actorId jp classId + * Replace 'actorId' with the ID of the actor you wish to change the JP of. + * Replace 'jp' with the amount of JP you wish to alter. If you are using + * 'classId', replace it with the ID of the actor's class you wish to alter. + * This command will set the actor's JP to a particular value. + * + * ============================================================================ + * 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 +//============================================================================= + +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 +//============================================================================= + +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) { + 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() { + 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); + } + } +}; + +Game_Actor.prototype.setJp = function(value, classId) { + 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); + } +}; + +Game_Actor.prototype.jpRate = function() { + 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 +//============================================================================= diff --git a/save/config.rpgsave b/save/config.rpgsave new file mode 100644 index 0000000..dce2cac --- /dev/null +++ b/save/config.rpgsave @@ -0,0 +1 @@ +N4IghgNg7mCeDOARM8AWIBcAzS8CmANCAMYD2AtuWAHYAmASnuUwEZ4BOmOE+RLA5uQBqpCAFdmmAEwAGPv3gjxkjLKLMlEvNLkh8mlWvDUAllQAueAComIeeJnPsxhPbGrFUAMQAOD7LiuLGDm5nYAwmDM7GCOzq4hLADKPnh4tJgAjDIAvkAAA \ No newline at end of file diff --git a/supertoolsengine.html b/supertoolsengine.html new file mode 100644 index 0000000..fade6c2 --- /dev/null +++ b/supertoolsengine.html @@ -0,0 +1 @@ + \ No newline at end of file