查看: 6766|回复: 11

[交流讨论] CTR_Engine v2.00 for 3d

[复制链接]
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2019-2-9 18:40:20 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 tseyik 于 2019-2-10 22:27 编辑

https://forums.rpgmakerweb.com/i ... ric-tilemap.103237/
編輯
擷取.PNG
GAME
001.PNG
360゜轉動
003.PNG
渲染Bug(2.3己修正)
002.PNG
需要以下三個 Plugin
plugins.zip (85.21 KB, 下载次数: 127)
https://github.com/Jogo78/Jogo_CTR_Engine​

This Engine require pixi-spine.js:
https://github.com/pixijs/pixi-s ... r/bin/pixi-spine.js

And pixi-projection-spine.js:
https://github.com/pixijs/pixi-p ... projection-spine.js



Just add in \js\plugins and place above in plugins manager.

OR

Just add in \js/libs and add these lines in index.html:

<script type="text/javascript" src="js/libs/pixi-spine.js"></script>
<script type="text/javascript" src="js/libs/pixi-projection-spine.js"></script>

梦石
0
星屑
4891
在线时间
889 小时
注册时间
2014-12-3
回帖
44
发表于 2019-2-9 19:25:53 | 显示全部楼层
本帖最后由 a66294836 于 2019-2-9 19:46 编辑

太厉害了吧

MV版本要多少才能用阿

----------------------------------------------------

不知道有没有人能把3D插件跟光影插件整合

想看效果是不是很猛==
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
 楼主| 发表于 2019-2-10 19:15:40 | 显示全部楼层
本帖最后由 tseyik 于 2019-2-10 21:05 编辑

門事件 system
ScreenDoor&amp;Portal.png
ScreenDoor&amp;Portal1.png
ScreenDoor&amp;Portal2.png

portal system
giphy.gif
回复

使用道具 举报

梦石
0
星屑
5185
在线时间
611 小时
注册时间
2017-10-21
回帖
321
发表于 2019-2-10 19:18:00 | 显示全部楼层
牛掰啊大佬
回复

使用道具 举报

梦石
0
星屑
4891
在线时间
889 小时
注册时间
2014-12-3
回帖
44
发表于 2019-2-11 00:42:42 | 显示全部楼层
本帖最后由 a66294836 于 2019-2-11 00:44 编辑


太神啦 大佬有考虑要把那三个插件整合一下吗 版本太低好像不能用

按到回覆 不知道怎么删文哈哈==

点评

喔喔好 感谢大佬 赞叹大佬  发表于 2019-2-12 07:05
作者並沒説明MV版本  发表于 2019-2-11 08:25
回复

使用道具 举报

梦石
0
星屑
3930
在线时间
1198 小时
注册时间
2016-8-9
回帖
2355

开拓者

发表于 2019-2-11 14:24:37 | 显示全部楼层
楼主每次都能让我等萌渣看到新大陆
酸酸甜甜就④哇噢
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
 楼主| 发表于 2019-2-11 16:35:25 | 显示全部楼层
本帖最后由 tseyik 于 2019-2-11 16:41 编辑

CTR_Engine v2.30 for 3d(Bug修正
  1. //////////////////////////////////////////////////////////////////////////////
  2. //       CTR_Engine by Jogo v2.3                                            //
  3. //////////////////////////////////////////////////////////////////////////////
  4. /*:
  5. * @plugindesc Camera Translate Rotation ENGINE :
  6. * "Rotate Camera in 3d Tilemap or just isometric"
  7. * @author Jogo | Version: 2.3 | Date: 19.02.10
  8. *
  9. * @param CTR Engine
  10. *
  11. *
  12. * @param Galv_DiagonalMovement
  13. * @parent CTR Engine
  14. *
  15. *
  16. * @param Diagonal Graphics
  17. * @parent Galv_DiagonalMovement
  18. * @desc Enable diagonal graphics
  19. * @type Boolean
  20. * @on Enable
  21. * @off Disable
  22. * @default false
  23. *
  24. *
  25. * @param Wall
  26. * @parent CTR Engine
  27. *
  28. *
  29. * @param Tile Tall
  30. * @parent Wall
  31. * @desc 設置高度必須與tile高度和tile闊度相同。
  32. * @type Number
  33. * @default 48
  34. *
  35. *
  36. * @param Camera
  37. * @parent CTR Engine
  38. *
  39. *
  40. * @param Base
  41. * @parent Camera
  42. *
  43. *
  44. * @param Initial State B
  45. * @parent Base
  46. * @desc Tile : ['X','Y']. Pixel : ['X','Y',true].
  47. * Character : ['-1'] Follower1, ['0'] Player, ['1'] Event 1.
  48. * @default 0
  49. *
  50. * @param Speed Rate B
  51. * @parent Base
  52. * @desc 設置移動攝像機的速度。
  53. * @type Number
  54. * @decimals 2
  55. * @default 0.50
  56. *
  57. *
  58. * @param Horizontal
  59. * @parent Camera
  60. *
  61. *
  62. * @param Initial State H
  63. * @parent Horizontal
  64. * @desc 將攝像機的初始角度設置在0到360之間。
  65. * (In degrees)
  66. * @type Number
  67. * @min 0
  68. * @max 359
  69. * @default 45
  70. *
  71. * @param MIN H
  72. * @parent Horizontal
  73. * @desc Set the minimum angle of camera between 0 to 360.
  74. * (In degrees)
  75. * @type Number
  76. * @min 0
  77. * @max 360
  78. * @default 0
  79. *
  80. * @param MAX H
  81. * @parent Horizontal
  82. * @desc 將攝像機的最大角度設置在0到360之間。
  83. * (In degrees)
  84. * @type Number
  85. * @min 0
  86. * @max 359
  87. * @default 359
  88. *
  89. * @param Disable Input H
  90. * @parent Horizontal
  91. * @desc Disable camera rotation input.
  92. * @type Boolean
  93. * @on Disable
  94. * @off Enable
  95. * @default false
  96. *
  97. * @param Positive Input H
  98. * @parent Horizontal
  99. * @desc Set the positive rotation keys input list separate by ",".
  100. * Example: ok,escape,1,2 (Leave blank for not use.)
  101. * @default pageup
  102. *
  103. * @param Negative Input H
  104. * @parent Horizontal
  105. * @desc Set the negative rotation keys input list separate by ",".
  106. * Example: ok,escape,1,2 (Leave blank for not use.)
  107. * @default pagedown
  108. *
  109. * @param Input Move H
  110. * @parent Horizontal
  111. * @desc Set the rotation angle of camera by input.
  112. * (In degrees)
  113. * @type Number
  114. * @min 1
  115. * @max 360
  116. * @default 45.00
  117. *
  118. * @param Speed Rate H
  119. * @parent Horizontal
  120. * @desc Set the speed rate for rotate.
  121. * @type Number
  122. * @decimals 2
  123. * @default 0.50
  124. *
  125. * @param Reset Uninput H
  126. * @parent Horizontal
  127. * @desc Rese camera rotate when uninput.
  128. * @type Boolean
  129. * @on Enable
  130. * @off Disable
  131. * @default false
  132. *
  133. *
  134. * @param Vertical
  135. * @parent Camera
  136. *
  137. *
  138. * @param Initial State V
  139. * @parent Vertical
  140. * @desc Set the initial angle of camera between 0 to 80.
  141. * (In degrees)
  142. * @type Number
  143. * @min 0
  144. * @max 80
  145. * @default 60
  146. *
  147. * @param MIN V
  148. * @parent Vertical
  149. * @desc Set the minimum angle of camera between 0 to 80.
  150. * (In degrees)
  151. * @type Number
  152. * @min 0
  153. * @max 80
  154. * @default 0
  155. *
  156. * @param MAX V
  157. * @parent Vertical
  158. * @desc Set the maximum angle of camera between 0 to 80.
  159. * (In degrees)
  160. * @type Number
  161. * @min 0
  162. * @max 80
  163. * @default 80
  164. *
  165. * @param Disable Input V
  166. * @parent Vertical
  167. * @desc Disable camera rotation input.
  168. * @type Boolean
  169. * @on Disable
  170. * @off Enable
  171. * @default true
  172. *
  173. * @param Positive Input V
  174. * @parent Vertical
  175. * @desc Set the positive rotation keys input list separate by ",".
  176. * Example: ok,escape,1,2 (Leave blank for not use.)
  177. * @default
  178. *
  179. * @param Negative Input V
  180. * @parent Vertical
  181. * @desc Set the negative rotation keys input list separate by ",".
  182. * Example: ok,escape,1,2 (Leave blank for not use.)
  183. * @default
  184. *
  185. * @param Input Move V
  186. * @parent Vertical
  187. * @desc Set the rotation angle of camera by input.
  188. * (In degrees)
  189. * @type Number
  190. * @min 1
  191. * @max 80
  192. * @default 10
  193. *
  194. * @param Speed Rate V
  195. * @parent Vertical
  196. * @desc Set the speed rate for rotate.
  197. * @type Number
  198. * @decimals 2
  199. * @default 0.50
  200. *
  201. * @param Reset Uninput V
  202. * @parent Vertical
  203. * @desc Rese camera rotate when uninput.
  204. * @type Boolean
  205. * @on Enable
  206. * @off Disable
  207. * @default false
  208. *
  209. *
  210. * @param Scale
  211. * @parent Camera
  212. *
  213. *
  214. * @param Initial State S
  215. * @parent Scale
  216. * @desc Set the initial scale of camera.
  217. * @type Number
  218. * @decimals 2
  219. * @min 0.75
  220. * @default 1.00
  221. *
  222. * @param MIN S
  223. * @parent Scale
  224. * @desc Set the minimum scale of camera.
  225. * (Can it's negative)
  226. * @type Number
  227. * @decimals 2
  228. * @min 0.75
  229. * @default 1.00
  230. *
  231. * @param MAX S
  232. * @parent Scale
  233. * @desc Set the maximum scale of camera.
  234. * (Can it's negative)
  235. * @type Number
  236. * @decimals 2
  237. * @min 0.75
  238. * @default 1.25
  239. *
  240. * @param Disable Input S
  241. * @parent Scale
  242. * @desc Disable camera scale input.
  243. * @type Boolean
  244. * @on Disable
  245. * @off Enable
  246. * @default false
  247. *
  248. * @param Positive Input S
  249. * @parent Scale
  250. * @desc Set the positive scale keys input list separate by ",".
  251. * Example: ok,escape,1,2 (Leave blank for not use.)
  252. * @default down,left,right,up
  253. *
  254. * @param Negative Input S
  255. * @parent Scale
  256. * @desc Set the negative scale keys input list separate by ",".
  257. * Example: ok,escape,1,2 (Leave blank for not use.)
  258. * @default
  259. *
  260. * @param Input Move S
  261. * @parent Scale
  262. * @desc Set the scale of camera by input.
  263. * (Can it's negative)
  264. * @type Number
  265. * @decimals 2
  266. * @min -9999
  267. * @default 0.25
  268. *
  269. * @param Speed Rate S
  270. * @parent Scale
  271. * @desc Set the speed rate for scale.
  272. * @type Number
  273. * @decimals 2
  274. * @default 0.50
  275. *
  276. * @param Reset Uninput S
  277. * @parent Scale
  278. * @desc Rese camera scale when uninput.
  279. * @type Boolean
  280. * @on Enable
  281. * @off Disable
  282. * @default true
  283. *
  284. *
  285. * @param Shift X
  286. * @parent Camera
  287. *
  288. *
  289. * @param Initial State X
  290. * @parent Shift X
  291. * @desc Set the initial shift of camera.
  292. * (Can it's negative)
  293. * @type Number
  294. * @min -9999
  295. * @default 0
  296. *
  297. * @param MIN X
  298. * @parent Shift X
  299. * @desc Set the minimum shift of camera.
  300. * (Can it's negative)
  301. * @type Number
  302. * @min -9999
  303. * @default -144
  304. *
  305. * @param MAX X
  306. * @parent Shift X
  307. * @desc Set the maximum shift of camera.
  308. * (Can it's negative)
  309. * @type Number
  310. * @min -9999
  311. * @default 144
  312. *
  313. * @param Disable Input X
  314. * @parent Shift X
  315. * @desc Disable camera shift input.
  316. * @type Boolean
  317. * @on Disable
  318. * @off Enable
  319. * @default false
  320. *
  321. * @param Positive Input X
  322. * @parent Shift X
  323. * @desc Set the positive shift keys input list separate by ",".
  324. * Example: ok,escape,1,2 (Leave blank for not use.)
  325. * @default left
  326. *
  327. * @param Negative Input X
  328. * @parent Shift X
  329. * @desc Set the negative shift keys input list separate by ",".
  330. * Example: ok,escape,1,2 (Leave blank for not use.)
  331. * @default right
  332. *
  333. * @param Input Move X
  334. * @parent Shift X
  335. * @desc Set the shift of camera by input.
  336. * (Can it's negative)
  337. * @type Number
  338. * @min -9999
  339. * @default 288
  340. *
  341. * @param Speed Rate X
  342. * @parent Shift X
  343. * @desc Set the speed rate for shift.
  344. * @type Number
  345. * @decimals 2
  346. * @default 0.50
  347. *
  348. * @param Reset Uninput X
  349. * @parent Shift X
  350. * @desc Rese camera shift when uninput.
  351. * @type Boolean
  352. * @on Enable
  353. * @off Disable
  354. * @default true
  355. *
  356. *
  357. * @param Shift Y
  358. * @parent Camera
  359. *
  360. *
  361. * @param Initial State Y
  362. * @parent Shift Y
  363. * @desc Set the initial shift of camera.
  364. * (Can it's negative)
  365. * @type Number
  366. * @min -9999
  367. * @default 0
  368. *
  369. * @param MIN Y
  370. * @parent Shift Y
  371. * @desc Set the minimum shift of camera.
  372. * (Can it's negative)
  373. * @type Number
  374. * @min -9999
  375. * @default -144
  376. *
  377. * @param MAX Y
  378. * @parent Shift Y
  379. * @desc Set the maximum shift of camera.
  380. * (Can it's negative)
  381. * @type Number
  382. * @min -9999
  383. * @default 144
  384. *
  385. * @param Disable Input Y
  386. * @parent Shift Y
  387. * @desc Disable camera shift input.
  388. * @type Boolean
  389. * @on Disable
  390. * @off Enable
  391. * @default false
  392. *
  393. * @param Positive Input Y
  394. * @parent Shift Y
  395. * @desc Set the positive shift keys input list separate by ",".
  396. * Example: ok,escape,1,2 (Leave blank for not use.)
  397. * @default up
  398. *
  399. * @param Negative Input Y
  400. * @parent Shift Y
  401. * @desc Set the negative shift keys input list separate by ",".
  402. * Example: ok,escape,1,2 (Leave blank for not use.)
  403. * @default down
  404. *
  405. * @param Input Move Y
  406. * @parent Shift Y
  407. * @desc Set the shift of camera by input.
  408. * (Can it's negative)
  409. * @type Number
  410. * @min -9999
  411. * @default 288
  412. *
  413. * @param Speed Rate Y
  414. * @parent Shift Y
  415. * @desc Set the speed rate for shift.
  416. * @type Number
  417. * @decimals 2
  418. * @default 0.50
  419. *
  420. * @param Reset Uninput Y
  421. * @parent Shift Y
  422. * @desc Rese camera shift when uninput.
  423. * @type Boolean
  424. * @on Enable
  425. * @off Disable
  426. * @default true
  427. *
  428. *
  429. * @param Shift Z
  430. * @parent Camera
  431. *
  432. *
  433. * @param Initial State Z
  434. * @parent Shift Z
  435. * @desc Set the initial shift of camera.
  436. * (Can it's negative)
  437. * @type Number
  438. * @min -9999
  439. * @default 0
  440. *
  441. * @param MIN Z
  442. * @parent Shift Z
  443. * @desc Set the minimum shift of camera.
  444. * (Can it's negative)
  445. * @type Number
  446. * @min -9999
  447. * @default 0
  448. *
  449. * @param MAX Z
  450. * @parent Shift Z
  451. * @desc Set the maximum shift of camera.
  452. * (Can it's negative)
  453. * @type Number
  454. * @min -9999
  455. * @default 0
  456. *
  457. * @param Disable Input Z
  458. * @parent Shift Z
  459. * @desc Disable camera shift input.
  460. * @type Boolean
  461. * @on Enable
  462. * @off Disable
  463. * @default true
  464. *
  465. * @param Positive Input Z
  466. * @parent Shift Z
  467. * @desc Set the positive shift keys input list separate by ",".
  468. * Example: ok,escape,1,2 (Leave blank for not use.)
  469. * @default
  470. *
  471. * @param Negative Input Z
  472. * @parent Shift Z
  473. * @desc Set the negative shift keys input list separate by ",".
  474. * Example: ok,escape,1,2 (Leave blank for not use.)
  475. * @default
  476. *
  477. * @param Input Move Z
  478. * @parent Shift Z
  479. * @desc Set the shift of camera by input.
  480. * (Can it's negative)
  481. * @type Number
  482. * @min -9999
  483. * @default 0
  484. *
  485. * @param Speed Rate Z
  486. * @parent Shift Z
  487. * @desc Set the speed rate for shift.
  488. * @type Number
  489. * @decimals 2
  490. * @default 0.50
  491. *
  492. * @param Reset Uninput Z
  493. * @parent Shift Z
  494. * @desc Rese camera shift when uninput.
  495. * @type Boolean
  496. * @on Enable
  497. * @off Disable
  498. * @default false
  499. *
  500. * @help
  501. * //////////////////////////////////////////////////////////////////////////////
  502. * //        CTR_Engine                                                        //
  503. * //////////////////////////////////////////////////////////////////////////////
  504. *           
  505. *                             171321     11        11 121711111               
  506. *                             1332221  153        721  7111273                 
  507. *                             12322227255        13151  11 1 1111              
  508. *                              2322232337        13351713511  1               
  509. *                             2352332335          1323545711115711            
  510. *               110802      111589333531       100112233596371751              
  511. *              12358880021   1258885933     1758022725123022359232            
  512. *               13358888802110888888022  11730802237005000  13334              
  513. *                733000888853235532980738688880057359055653  11               
  514. *                125300888005532     610888888041223231   16231               
  515. *                 12550808865331 1    7     50801255355271155521               
  516. *                  1733569222351551 1  35 3  5088801083355690111               
  517. *                     173537235140845  90887 5088855465328047111               
  518. *                      58317755318001177729520088095532540511121               
  519. *                   1404411111177177777775882003532112115555115               
  520. *                 1904967111111117222277588888053711 1717511751               
  521. *                2800694123323372111122324888523211  1711131555               
  522. *              1580080832355217    1111111206959571  33111325506               
  523. *             16000000023535511            4609652711406535570880              
  524. *            1406944640322234711          134049455275643353358880            
  525. *           75046669960422774511          3690906653325044921888889            
  526. *          1504646996665727730717      11235099553333359080950888883           
  527. *         13809444009575222725511111111111138846555555400880000088881         
  528. *        120044466065 13322773632223355558088804555449606340946960000         
  529. *        15894696690  123227734555333335088880080496990212540664499991         
  530. *       120099694491   25227256555233500555988888889601  1330094466940         
  531. *       13800099404    733235595372338095532233355561     134000000660         
  532. *      125800000901    13572227777773888080000006461      1238000000007        
  533. *      130888809711111111223255454665088888888803771       730099900009        
  534. *      13888571             1227177111111111      111111      111249698        
  535. *      138011               1                                      1168        
  536. *      1331                11                                        18        
  537. *      27                  91                               1         3        
  538. *     131                 161                           113001        3        
  539. *    123             11   651             11173562      13571         0        
  540. *    132          1750051133111235401     73549002       1           92        
  541. *    757         1754540772311723560      57117352                 1301        
  542. *    732         1681731711735590485      28  1252                   7         
  543. *    735         5086 11   125906382      185 1357         11                  
  544. *    1351        58883     135904501       0811357       16031                 
  545. *    13551        125211  1259904001       4061357       98007                 
  546. *    123051                118000891       1802357       388081             2  
  547. *     133051                 1788831        000357       1888051        15552  
  548. *      7558871             11358803       1 088357       1888841     123552   
  549. *       7350043111       1177348881  1173599088651  1172268888021 1172211      
  550. *        123544453271117117723332272723222272227222772723088800617111         
  551. *          173322223333771171121    11712 121121 11777272233222771            
  552. *         13221  1 5 5 272 5 522122 373111 3 722 3 1 11 513 2 31111171         
  553. *       123 1271 1113131 7 1 32210213711 7111572  111 1122211 311 3222         
  554. *     172321 213 1  313722727222772223232722727772712727257715 31 1127211      
  555. *  1322723222222223355333333222222222222222222223333333335533227771377377225   
  556. * 173332232226651111111                              1111117223355327737721   
  557. *   133723350002                                             1736080063771     
  558. *   132223659431                                              7333355537771   
  559. *  15333221111                                                11172233532237   
  560. * 1111                                                               11111
  561. *   
  562. *
  563. * //////////////////////////////////////////////////////////////////////////////
  564. * //       /!\ Require WebGL (ShaderTilemap) /!\                              //
  565. * //////////////////////////////////////////////////////////////////////////////
  566. *
  567. *
  568. *
  569. * //////////////////////////////////////////////////////////////////////////////
  570. * //       PIXI                                                               //
  571. * //////////////////////////////////////////////////////////////////////////////
  572. *
  573. *This Engine require pixi-spine.js:
  574. *[url]https://github.com/pixijs/pixi-spine/blob/master/bin/pixi-spine.js[/url]
  575. *
  576. *And pixi-projection-spine.js:
  577. *[url]https://github.com/pixijs/pixi-projection/blob/master/dist/pixi-projection-spine.js[/url]
  578. *
  579. *Just add in \js\plugins and place above in plugins manager.
  580. *
  581. *OR
  582. *
  583. *Just add in \js/libs and add these lines in index.html:
  584. *
  585. *<script type="text/javascript" src="js/libs/pixi-spine.js"></script>
  586. *<script type="text/javascript" src="js/libs/pixi-projection-spine.js"></script>
  587. *
  588. *
  589. *
  590. * //////////////////////////////////////////////////////////////////////////////
  591. * //       Wall Tile                                                          //
  592. * //////////////////////////////////////////////////////////////////////////////
  593. *
  594. *The wall is tile A4 a line on two.
  595. *
  596. *First ligne is the tile to add in map editor and the wall auto create with [..
  597. *..]seconde line under the tile added.
  598. *
  599. *Set the terrain tag for high +1: 0 is 1 of high and 7 is 8 of high.
  600. *
  601. *
  602. *
  603. * //////////////////////////////////////////////////////////////////////////////
  604. * //       Wall Events Objects                                                //
  605. * //////////////////////////////////////////////////////////////////////////////
  606. *
  607. *For wall object or wall door add '!+' above a character name.
  608. *
  609. *
  610. *For middle door just add '+' above a character name, can be open and close [..
  611. *..]by plugin command.
  612. *
  613. *
  614. *For all the down character only it's display and not forgot change direction[..
  615. *..]for turn the sprite in good direction in the 3d world.
  616. *
  617. *
  618. *
  619. * //////////////////////////////////////////////////////////////////////////////
  620. * //       Galv_DiagonalMovement                                              //
  621. * //////////////////////////////////////////////////////////////////////////////
  622. *
  623. *[url]https://galvs-scripts.com/2015/12/12/mv-diagonal-movement/[/url]
  624. *
  625. *Galv_DiagonalMovement is compatible with this engine. Just place above.
  626. *
  627. *But if you want use diagonal graphic set enable on Diagonal Graphics and in[..
  628. *..]the Galv_DiagonalMovement set false on Diagonal Charset.
  629. *
  630. *
  631. *
  632. * //////////////////////////////////////////////////////////////////////////////
  633. * //       Setting Info                                                       //
  634. * //////////////////////////////////////////////////////////////////////////////
  635. *
  636. *Camera:
  637. *
  638. *
  639. *'B' => Is Base of camera (Tile : ['X','Y']. Pixel : ['X','Y',true]. Chara :[..
  640. *..]['-1'] Follower 1, ['0'] Player, ['1'] Event 1).
  641. *
  642. *'H' => Is Horizontal rotation (Angle between : 0 to 359, if 'MIN' 'H' != 0 [..
  643. *..]&& 'MAX' 'H' != 359 camera not move in the short rotation because is    [..
  644. *..]missing complete axis).
  645. *
  646. *'V' => Is Vertical rotation (Angle between : 0 to 80).
  647. *
  648. *'S' => Is Scale rate (Minimum : 0.75).
  649. *
  650. *'X' => Is Shift X (Can be negative).
  651. *
  652. *'Y' => Is Shift Y (Can be negative).
  653. *
  654. *'Z' => Is Shift Z (Can be negative).
  655. *
  656. *
  657. *
  658. *
  659. *Value:
  660. *
  661. *
  662. *'CB' => 'B','H','V','S','X','Y'and/or'Z' (Separate by ",").
  663. *
  664. *'C' => 'H','V','S','X','Y'and/or'Z' (Separate by ",").
  665. *
  666. *'n' => Is number.
  667. *
  668. *'nc' => Is number (Set 'CURRENT' to current value).
  669. *
  670. *'b' => Is bool ('true' or 'false').
  671. *
  672. *'sr' => Is speed rate (Set 'CURRENT' to current speed).
  673. *
  674. *'ki' => Input list separate by ',' (Refer to input list).
  675. *
  676. *
  677. *
  678. * //////////////////////////////////////////////////////////////////////////////
  679. * //       Plugin_Command                                                     //
  680. * //////////////////////////////////////////////////////////////////////////////
  681. *
  682. *Open/Close door system:
  683. *
  684. *
  685. *'CTR_ENGINE' 'DOOR' 'POSITIVE' 'OPEN' 'EventID'
  686. *
  687. *'CTR_ENGINE' 'DOOR' 'POSITIVE' 'CLOSE' 'EventID'
  688. *
  689. *
  690. *'CTR_ENGINE' 'DOOR' 'NEGATIVE' 'OPEN' 'EventID'
  691. *
  692. *'CTR_ENGINE' 'DOOR' 'NEGATIVE' 'CLOSE' 'EventID'
  693. *
  694. *
  695. *
  696. *
  697. *
  698. *Plugin param:
  699. *
  700. *
  701. *'CTR_ENGINE' 'INITIAL_STATE' 'CB' 'nc'
  702. *
  703. *'CTR_ENGINE' 'MIN' 'C' 'n'
  704. *
  705. *'CTR_ENGINE' 'MAX' 'C' 'n'
  706. *
  707. *'CTR_ENGINE' 'DISABLE_INPUT' 'C' 'b'
  708. *
  709. *'CTR_ENGINE' 'POSITIVE_INPUT' 'C' 'ki'
  710. *
  711. *'CTR_ENGINE' 'NEGATIVE_INPUT' 'C' 'ki'
  712. *
  713. *'CTR_ENGINE' 'INPUT_MOVE' 'C' 'n'
  714. *
  715. *'CTR_ENGINE' 'SPEED_RATE' 'CB' 'n'
  716. *
  717. *'CTR_ENGINE' 'RESET_UNINPUT' 'C' 'b'
  718. *
  719. *
  720. *
  721. *
  722. *Action command:
  723. *
  724. *
  725. *'CTR_ENGINE' 'SET' 'CB' 'n' :
  726. *Set current value.
  727. *
  728. *'CTR_ENGINE' 'MOVE' 'C' 'n' 'sr' :
  729. *Move current value.
  730. *
  731. *'CTR_ENGINE' 'MOVE_TO' 'CB' 'n' 'sr' :
  732. *Move current value to.
  733. *
  734. *'CTR_ENGINE' 'RESET' 'CB' :
  735. *Set current value to initial value.
  736. *
  737. *'CTR_ENGINE' 'RESET_TO' 'CB' 'sr' :
  738. *Move current value to initial value.
  739. *
  740. *'CTR_ENGINE' 'REINITIALIZE' 'Plugin param' 'CB' :
  741. *Set param value to plugin value.
  742. *
  743. *
  744. *
  745. * //////////////////////////////////////////////////////////////////////////////
  746. * //        Input List                                                        //
  747. * //////////////////////////////////////////////////////////////////////////////
  748. *
  749. * Rpg Maker key:
  750. *
  751. *
  752. *   ok: '13, 32, 90',
  753. *   escape: '27, 45, 88, 96',
  754. *
  755. *   left: '37, 100',
  756. *   up: '38, 104',
  757. *   right: '39, 102',
  758. *   down: '40, 98',
  759. *
  760. *   control: '17, 18',
  761. *   shift: '16',
  762. *   tab: '9',
  763. *
  764. *   pageup: '33, 81',
  765. *   pagedown: '34, 87',
  766. *
  767. *   debug: '120'.
  768. *
  769. *
  770. *
  771. *
  772. * Number key:
  773. *
  774. *
  775. *   14: '0E',
  776. *
  777. *    8: 'backspace',
  778. *    9: 'tab',
  779. *   13: 'enter',
  780. *   16: 'shift',
  781. *   17: 'ctrl',
  782. *   18: 'alt',
  783. *   27: 'esc',
  784. *   32: 'space',
  785. *   33: 'pageup',
  786. *   34: 'pagedown',
  787. *   37: 'left',
  788. *   38: 'up',
  789. *   39: 'right',
  790. *   40: 'down',
  791. *   45: 'escape',
  792. *
  793. *   48: '0',
  794. *   49: '1',
  795. *   50: '2',
  796. *   51: '3',
  797. *   52: '4',
  798. *   53: '5',
  799. *   54: '6',
  800. *   55: '7',
  801. *   56: '8',
  802. *   57: '9',
  803. *   
  804. *   96: 'num0',
  805. *   97: 'num1',
  806. *   98: 'num2',
  807. *   99: 'num3',
  808. *  100: 'num4',
  809. *  101: 'num5',
  810. *  102: 'num6',
  811. *  103: 'num7',
  812. *  104: 'num8',
  813. *  105: 'num9',
  814. *   
  815. *   65: 'a',
  816. *   66: 'b',
  817. *   67: 'c',
  818. *   68: 'd',
  819. *   69: 'e',
  820. *   70: 'f',
  821. *   71: 'g',
  822. *   72: 'h',
  823. *   73: 'i',
  824. *   74: 'j',
  825. *   75: 'k',
  826. *   76: 'l',
  827. *   77: 'm',
  828. *   78: 'n',
  829. *   79: 'o',
  830. *   80: 'p',
  831. *   81: 'q',
  832. *   82: 'r',
  833. *   83: 's',
  834. *   84: 't',
  835. *   85: 'u',
  836. *   86: 'v',
  837. *   87: 'w',
  838. *   88: 'x',
  839. *   89: 'y',
  840. *   90: 'z',
  841. *   
  842. *  112: 'f1',
  843. *  113: 'f2',
  844. *  114: 'f3',
  845. *  115: 'f4',
  846. *  116: 'f5',
  847. *  117: 'f6',
  848. *  118: 'f7',
  849. *  119: 'f8',
  850. *  120: 'f9',
  851. *  121: 'f10',
  852. *  122: 'f11',
  853. *  123: 'f12',
  854. *   
  855. *  186: 'semicolon',
  856. *  187: 'equal',
  857. *  188: 'comma',
  858. *  189: 'minus',
  859. *  190: 'period',
  860. *  191: 'slash',
  861. *  192: 'grave',
  862. *  219: 'openbracket',
  863. *  220: 'backslash',
  864. *  221: 'closedbracket',
  865. *  222: 'singlequote',
  866. *
  867. *
  868. *  Ect...
  869. *
  870. *
  871. *
  872. * //////////////////////////////////////////////////////////////////////////////
  873. * //        END                                                               //
  874. * //////////////////////////////////////////////////////////////////////////////
  875. */

  876. var Imported = Imported || {};
  877. Imported.CTR_Engine = true;

  878. var CTR_Engine = CTR_Engine || {};

  879. (function() {
  880. CTR_Engine.Wall = CTR_Engine.Wall || {};
  881.                        
  882.                        
  883.         CTR_Engine.Wall.Base = CTR_Engine.Wall.Base || {};
  884.                 CTR_Engine.Wall.Base.TileTall = Number(PluginManager.parameters('Jogo_CTR_Engine')["Tile Tall"]);
  885. })();


  886. ////////////////////////////////////////////////////////////////////////////////
  887. //       Plugin_Command                                                       //
  888. ////////////////////////////////////////////////////////////////////////////////

  889. CTR_Engine.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  890. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  891.         CTR_Engine.Game_Interpreter_pluginCommand.call(this, command, args);
  892.         if (command.toUpperCase() === 'CTR_ENGINE') {
  893.                 if (String(args[0]).toUpperCase() == "DOOR") $gameMap.event(Number(args[3]))._doorState = String(args[1]).toUpperCase() + "," + String(args[2]).toUpperCase();
  894.                 if (String(args[0]).toUpperCase() == "INITIAL_STATE") {
  895.                         for (var i = 0; i < args[1].split(',').length; i++) {
  896.                                 if (String(args[2]).toUpperCase() == "CURRENT") {
  897.                                         if (String(args[1].split(',')[i]).toUpperCase() == "B") $gameMap.B.InitialState = $gameMap._newCamera;
  898.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "H") $gameMap.H.InitialState = $gameMap._currentH;
  899.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "V") $gameMap.V.InitialState = $gameMap._currentV;
  900.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "S") $gameMap.S.InitialState = $gameMap._currentS;
  901.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap.X.InitialState = $gameMap._currentX;
  902.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.InitialState = $gameMap._currentY;
  903.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.InitialState = $gameMap._currentZ;
  904.                                 } else {
  905.                                         if (String(args[1].split(',')[i]).toUpperCase() == "B") $gameMap.B.InitialState = args[2].toLowerCase().split(',');
  906.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "H") $gameMap.H.InitialState = Number(args[2])/180*Math.PI;
  907.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "V") $gameMap.V.InitialState = Number(args[2])/180*Math.PI;
  908.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "S") $gameMap.S.InitialState = Number(args[2]);
  909.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap.X.InitialState = Number(args[2]);
  910.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.InitialState = Number(args[2]);
  911.                                         else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.InitialState = Number(args[2]);       
  912.                                 }
  913.                         }
  914.                 }
  915.                 if (String(args[0]).toUpperCase() == "MIN") {
  916.                         for (var i = 0; i < args[1].split(',').length; i++) {
  917.                                 if (String(args[1].split(',')[i]).toUpperCase() == "H") $gameMap.H.MIN = Number(args[2])/180*Math.PI;
  918.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "V") $gameMap.V.MIN = Number(args[2])/180*Math.PI;
  919.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "S") $gameMap.S.MIN = Number(args[2]);
  920.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap.X.MIN = Number(args[2]);
  921.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.MIN = Number(args[2]);
  922.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.MIN = Number(args[2]);
  923.                         }
  924.                 }
  925.                 if (String(args[0]).toUpperCase() == "MAX") {
  926.                         for (var i = 0; i < args[1].split(',').length; i++) {
  927.                                 if (String(args[1].split(',')[i]).toUpperCase() == "H") $gameMap.H.MAX = Number(args[2])/180*Math.PI;
  928.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "V") $gameMap.V.MAX = Number(args[2])/180*Math.PI;
  929.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "S") $gameMap.S.MAX = Number(args[2]);
  930.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap.X.MAX = Number(args[2]);
  931.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.MAX = Number(args[2]);
  932.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.MAX = Number(args[2]);
  933.                         }
  934.                 }
  935.                 if (String(args[0]).toUpperCase() == "DISABLE_INPUT") {
  936.                         for (var i = 0; i < args[1].split(',').length; i++) {
  937.                                 if (String(args[1].split(',')[i]).toUpperCase() == "H") $gameMap.H.DisableInput = eval(args[2]);
  938.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "V") $gameMap.V.DisableInput = eval(args[2]);
  939.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "S") $gameMap.S.DisableInput = eval(args[2]);
  940.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap.X.DisableInput = eval(args[2]);
  941.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.DisableInput = eval(args[2]);
  942.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.DisableInput = eval(args[2]);
  943.                         }
  944.                 }
  945.                 if (String(args[0]).toUpperCase() == "POSITIVE_INPUT") {
  946.                         for (var i = 0; i < args[1].split(',').length; i++) {
  947.                                 if (String(args[1].split(',')[i]).toUpperCase() == "H") $gameMap.H.PositiveInput = args[2].toLowerCase().split(',');
  948.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "V") $gameMap.V.PositiveInput = args[2].toLowerCase().split(',');
  949.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "S") $gameMap.S.PositiveInput = args[2].toLowerCase().split(',');
  950.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap.X.PositiveInput = args[2].toLowerCase().split(',');
  951.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.PositiveInput = args[2].toLowerCase().split(',');
  952.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.PositiveInput = args[2].toLowerCase().split(',');
  953.                         }
  954.                 }
  955.                 if (String(args[0]).toUpperCase() == "NEGATIVE_INPUT") {
  956.                         for (var i = 0; i < args[1].split(',').length; i++) {
  957.                                 if (String(args[1].split(',')[i]).toUpperCase() == "H") $gameMap.H.NegativeInput = args[2].toLowerCase().split(',');
  958.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "V") $gameMap.V.NegativeInput = args[2].toLowerCase().split(',');
  959.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "S") $gameMap.S.NegativeInput = args[2].toLowerCase().split(',');
  960.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap.X.NegativeInput = args[2].toLowerCase().split(',');
  961.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.NegativeInput = args[2].toLowerCase().split(',');
  962.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.NegativeInput = args[2].toLowerCase().split(',');
  963.                         }
  964.                 }
  965.                 if (String(args[0]).toUpperCase() == "INPUT_MOVE") {
  966.                         for (var i = 0; i < args[1].split(',').length; i++) {
  967.                                 if (String(args[1].split(',')[i]).toUpperCase() == "H") $gameMap.H.InputMove = Number(args[2])/180*Math.PI;
  968.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "V") $gameMap.V.InputMove = Number(args[2])/180*Math.PI;
  969.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "S") $gameMap.S.InputMove = Number(args[2]);
  970.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap.X.InputMove = Number(args[2]);
  971.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.InputMove = Number(args[2]);
  972.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.InputMove = Number(args[2]);
  973.                         }
  974.                 }
  975.                 if (String(args[0]).toUpperCase() == "SPEED_RATE") {
  976.                         for (var i = 0; i < args[1].split(',').length; i++) {
  977.                                 if (String(args[1].split(',')[i]).toUpperCase() == "B") $gameMap.B.SpeedRate = Number(args[2]);
  978.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "H") $gameMap.H.SpeedRate = Number(args[2]);
  979.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "V") $gameMap.V.SpeedRate = Number(args[2]);
  980.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "S") $gameMap.S.SpeedRate = Number(args[2]);
  981.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap.X.SpeedRate = Number(args[2]);
  982.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.SpeedRate = Number(args[2]);
  983.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.SpeedRate = Number(args[2]);
  984.                         }
  985.                 }
  986.                 if (String(args[0]).toUpperCase() == "RESET_UNINPUT") {
  987.                         for (var i = 0; i < args[1].split(',').length; i++) {
  988.                                 if (String(args[1].split(',')[i]).toUpperCase() == "H") $gameMap.H.ResetUninput = eval(args[2]);
  989.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "V") $gameMap.V.ResetUninput = eval(args[2]);
  990.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "S") $gameMap.S.ResetUninput = eval(args[2]);
  991.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap.X.ResetUninput = eval(args[2]);
  992.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.ResetUninput = eval(args[2]);
  993.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.ResetUninput = eval(args[2]);
  994.                         }
  995.                 }
  996.                 if (String(args[0]).toUpperCase() == "SET") {
  997.                         for (var i = 0; i < args[1].split(',').length; i++) {
  998.                                 if (String(args[1].split(',')[i]).toUpperCase() == "B") {
  999.                                         $gameMap._newCamera = args[2].toLowerCase().split(',');
  1000.                                         if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) === 0) var character = $gamePlayer;
  1001.                                         else if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) < 0) var character = $gamePlayer.followers()._data[Math.abs(Number($gameMap._newCamera[0]) + 1)];
  1002.                                         else if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) > 0) var character = $gameMap.event(Number($gameMap._newCamera[0]));
  1003.                                         if (character) $gameMap.setDisplayChara(character);
  1004.                                         else if ($gameMap._newCamera.length == 3) $gameMap.setDisplayPixelPos(Number($gameMap._newCamera[0]), Number($gameMap._newCamera[1]));
  1005.                                         else if ($gameMap._newCamera.length == 2) $gameMap.setDisplayPos(Number($gameMap._newCamera[0]), Number($gameMap._newCamera[1]));
  1006.                                         $gameMap._lastCamera = $gameMap._newCamera;
  1007.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "H") SceneManager._scene._spriteset._tilemap.euler.z = $gameMap._currentH = $gameMap._inputH = $gameMap._commandH = Number(args[2])/180*Math.PI;
  1008.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "V") SceneManager._scene._spriteset._tilemap.euler.x = $gameMap._currentV = $gameMap._inputV = $gameMap._commandV = Number(args[2])/180*Math.PI;
  1009.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "s") $gameScreen._zoomScale = $gameMap._currentS = $gameMap._inputS = $gameMap._commandS = Number(args[1]);
  1010.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap._currentX = $gameMap._inputX = $gameMap._commandX = Number(args[2]);
  1011.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap._currentY = $gameMap._inputY = $gameMap._commandY = Number(args[2]);
  1012.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap._currentZ = $gameMap._inputZ = $gameMap._commandZ = Number(args[2]);
  1013.                         }
  1014.                         SceneManager._scene._spriteset._tilemap.updateMargin();
  1015.                 }
  1016.                 if (String(args[0]).toUpperCase() == "MOVE") {
  1017.                         for (var i = 0; i < args[1].split(',').length; i++) {
  1018.                                 if (String(args[1].split(',')[i]).toUpperCase() == "H") {
  1019.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateH = $gameMap.H.SpeedRate;
  1020.                                         else $gameMap._moveSpeedRateH = Number(args[3]);
  1021.                                         $gameMap._commandH += Number(args[2])/180*Math.PI;
  1022.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "V") {
  1023.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateV = $gameMap.V.SpeedRate;
  1024.                                         else $gameMap._moveSpeedRateV = Number(args[3]);
  1025.                                         $gameMap._commandV += Number(args[2])/180*Math.PI;
  1026.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "S") {
  1027.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateS = $gameMap.S.SpeedRate;
  1028.                                         else $gameMap._moveSpeedRateS = Number(args[3]);
  1029.                                         $gameMap._commandS += Number(args[2]);
  1030.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "X") {
  1031.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateX = $gameMap.X.SpeedRate;
  1032.                                         else $gameMap._moveSpeedRateX = Number(args[3]);
  1033.                                         $gameMap._commandX += Number(args[2]);
  1034.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "Y") {
  1035.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateY = $gameMap.Y.SpeedRate;
  1036.                                         else $gameMap._moveSpeedRateY = Number(args[3]);
  1037.                                         $gameMap._commandY += Number(args[2]);
  1038.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "Z") {
  1039.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateZ = $gameMap.Z.SpeedRate;
  1040.                                         else $gameMap._moveSpeedRateZ = Number(args[3]);
  1041.                                         $gameMap._commandZ += Number(args[2]);
  1042.                                 }
  1043.                         }
  1044.                 }
  1045.                 if (String(args[0]).toUpperCase() == "MOVE_TO") {
  1046.                         for (var i = 0; i < args[1].split(',').length; i++) {
  1047.                                 if (String(args[1].split(',')[i]).toUpperCase() == "B") {
  1048.                                         if (String(args[3]).toUpperCase() != "CURRENT") $gameMap._moveSpeedRateB = Number(args[3]);
  1049.                                         $gameMap._newCamera = args[2].toLowerCase().split(',');
  1050.                                         if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) === 0) var character = $gamePlayer;
  1051.                                         else if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) < 0) var character = $gamePlayer.followers()._data[Math.abs(Number($gameMap._newCamera[0]) + 1)];
  1052.                                         else if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) > 0) var character = $gameMap.event(Number($gameMap._newCamera[0]));
  1053.                                         if (character) $gameMap.moveDisplayChara(character);
  1054.                                         else if ($gameMap._newCamera.length == 3) $gameMap.moveDisplayPixelPos(Number($gameMap._newCamera[0]), Number($gameMap._newCamera[1]));
  1055.                                         else if ($gameMap._newCamera.length == 2) $gameMap.moveDisplayPos(Number($gameMap._newCamera[0]), Number($gameMap._newCamera[1]));
  1056.                                         $gameMap._lastCamera = $gameMap._newCamera;
  1057.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "H") {
  1058.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateH = $gameMap.H.SpeedRate;
  1059.                                         else $gameMap._moveSpeedRateH = Number(args[3]);
  1060.                                         $gameMap._commandH += $gameMap.H.MIN == 0 && $gameMap.H.MAX == 359/180*Math.PI ? this.moveToCamera(Number(args[2]), $gameMap._currentH*180/Math.PI)/180*Math.PI : (Number(args[2])/180*Math.PI - $gameMap._currentH);
  1061.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "V") {
  1062.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateV = $gameMap.V.SpeedRate;
  1063.                                         else $gameMap._moveSpeedRateV = Number(args[3]);
  1064.                                         $gameMap._commandV += Number(args[2])/180*Math.PI - $gameMap._currentV;
  1065.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "S") {
  1066.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateS = $gameMap.S.SpeedRate;
  1067.                                         else $gameMap._moveSpeedRateS = Number(args[3]);
  1068.                                         $gameMap._commandS += Number(args[2]) - $gameMap._currentS;
  1069.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "X") {
  1070.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateX = $gameMap.X.SpeedRate;
  1071.                                         else $gameMap._moveSpeedRateX = Number(args[3]);
  1072.                                         $gameMap._commandX += Number(args[2]) - $gameMap._currentX;
  1073.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "Y") {
  1074.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateY = $gameMap.Y.SpeedRate;
  1075.                                         else $gameMap._moveSpeedRateY = Number(args[3]);
  1076.                                         $gameMap._commandY += Number(args[2]) - $gameMap._currentY;
  1077.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "Z") {
  1078.                                         if (String(args[3]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateZ = $gameMap.Z.SpeedRate;
  1079.                                         else $gameMap._moveSpeedRateZ = Number(args[3]);
  1080.                                         $gameMap._commandZ += Number(args[2]) - $gameMap._currentZ;
  1081.                                 }
  1082.                         }
  1083.                 }
  1084.                 if (String(args[0]).toUpperCase() == "RESET") {
  1085.                         for (var i = 0; i < args[1].split(',').length; i++) {
  1086.                                 if (String(args[1].split(',')[i]).toUpperCase() == "B") {
  1087.                                         $gameMap._newCamera = $gameMap.B.InitialState;
  1088.                                         if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) === 0) var character = $gamePlayer;
  1089.                                         else if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) < 0) var character = $gamePlayer.followers()._data[Math.abs(Number($gameMap._newCamera[0]) + 1)];
  1090.                                         else if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) > 0) var character = $gameMap.event(Number($gameMap._newCamera[0]));
  1091.                                         if (character) $gameMap.setDisplayChara(character);
  1092.                                         else if ($gameMap._newCamera.length == 3) $gameMap.setDisplayPixelPos(Number($gameMap._newCamera[0]), Number($gameMap._newCamera[1]));
  1093.                                         else if ($gameMap._newCamera.length == 2) $gameMap.setDisplayPos(Number($gameMap._newCamera[0]), Number($gameMap._newCamera[1]));
  1094.                                         $gameMap._lastCamera = $gameMap._newCamera;
  1095.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "H") SceneManager._scene._spriteset._tilemap.euler.z = $gameMap._currentH = $gameMap._inputH = $gameMap._commandH = $gameMap.H.InitialState;
  1096.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "V") SceneManager._scene._spriteset._tilemap.euler.x = $gameMap._currentV = $gameMap._inputV = $gameMap._commandV = $gameMap.V.InitialState;
  1097.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "s") $gameScreen._zoomScale = $gameMap._currentS = $gameMap._inputS = $gameMap._commandS = $gameMap.S.InitialState;
  1098.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "X") $gameMap._currentX = $gameMap._inputX = $gameMap._commandX = $gameMap.X.InitialState;
  1099.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Y") $gameMap._currentY = $gameMap._inputY = $gameMap._commandY = $gameMap.Y.InitialState;
  1100.                                 else if (String(args[1].split(',')[i]).toUpperCase() == "Z") $gameMap._currentZ = $gameMap._inputZ = $gameMap._commandZ = $gameMap.Z.InitialState;
  1101.                         }
  1102.                         SceneManager._scene._spriteset._tilemap.updateMargin();
  1103.                 }
  1104.                 if (String(args[0]).toUpperCase() == "RESET_TO") {
  1105.                         for (var i = 0; i < args[1].split(',').length; i++) {
  1106.                                 if (String(args[1].split(',')[i]).toUpperCase() == "B") {
  1107.                                         if (String(args[2]).toUpperCase() != "CURRENT") $gameMap._moveSpeedRateB = Number(args[2]);
  1108.                                         $gameMap._newCamera = $gameMap.B.InitialState;
  1109.                                         if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) === 0) var character = $gamePlayer;
  1110.                                         else if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) < 0) var character = $gamePlayer.followers()._data[Math.abs(Number($gameMap._newCamera[0]) + 1)];
  1111.                                         else if ($gameMap._newCamera.length == 1 && Number($gameMap._newCamera[0]) > 0) var character = $gameMap.event(Number($gameMap._newCamera[0]));
  1112.                                         if (character) $gameMap.moveDisplayChara(character);
  1113.                                         else if ($gameMap._newCamera.length == 3) $gameMap.moveDisplayPixelPos(Number($gameMap._newCamera[0]), Number($gameMap._newCamera[1]));
  1114.                                         else if ($gameMap._newCamera.length == 2) $gameMap.moveDisplayPos(Number($gameMap._newCamera[0]), Number($gameMap._newCamera[1]));
  1115.                                         $gameMap._lastCamera = $gameMap._newCamera;
  1116.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "H") {
  1117.                                         if (String(args[2]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateH = $gameMap.H.SpeedRate;
  1118.                                         else $gameMap._moveSpeedRateH = Number(args[2]);
  1119.                                         $gameMap._commandH += $gameMap.H.MIN == 0 && $gameMap.H.MAX == 359/180*Math.PI ? this.moveToCamera($gameMap.H.InitialState*180/Math.PI, $gameMap._currentH*180/Math.PI)/180*Math.PI : (Number(args[2])/180*Math.PI - $gameMap._currentH);
  1120.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "V") {
  1121.                                         if (String(args[2]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateV = $gameMap.V.SpeedRate;
  1122.                                         else $gameMap._moveSpeedRateV = Number(args[2]);
  1123.                                         $gameMap._commandV += $gameMap.V.InitialState - $gameMap._currentV;
  1124.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "S") {
  1125.                                         if (String(args[2]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateS = $gameMap.S.SpeedRate;
  1126.                                         else $gameMap._moveSpeedRateS = Number(args[2]);
  1127.                                         $gameMap._commandS += $gameMap.S.InitialState - $gameMap._currentS;
  1128.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "X") {
  1129.                                         if (String(args[2]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateX = $gameMap.X.SpeedRate;
  1130.                                         else $gameMap._moveSpeedRateX = Number(args[2]);
  1131.                                         $gameMap._commandX += $gameMap.X.InitialState - $gameMap._currentX;
  1132.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "Y") {
  1133.                                         if (String(args[2]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateY = $gameMap.Y.SpeedRate;
  1134.                                         else $gameMap._moveSpeedRateY = Number(args[2]);
  1135.                                         $gameMap._commandY += $gameMap.Y.InitialState - $gameMap._currentY;
  1136.                                 } else if (String(args[1].split(',')[i]).toUpperCase() == "Z") {
  1137.                                         if (String(args[2]).toUpperCase() == "CURRENT") $gameMap._moveSpeedRateZ = $gameMap.Z.SpeedRate;
  1138.                                         else $gameMap._moveSpeedRateZ = Number(args[2]);
  1139.                                         $gameMap._commandZ += $gameMap.Z.InitialState - $gameMap._currentZ;
  1140.                                 }
  1141.                         }
  1142.                 }
  1143.                 if (String(args[0]).toUpperCase() == "REINITIALIZE") {       
  1144.                         if (String(args[1]).toUpperCase() == "INITIAL_STATE") {
  1145.                                 for (var i = 0; i < args[2].split(',').length; i++) {
  1146.                                         if (String(args[2].split(',')[i]).toUpperCase() == "B") $gameMap.B.InitialState = PluginManager.parameters('Jogo_CTR_Engine')["Initial State B"].toLowerCase().split(',');
  1147.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "H") $gameMap.H.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State H"])/180*Math.PI;
  1148.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "V") $gameMap.V.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State V"])/180*Math.PI;
  1149.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "s") $gameMap.S.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State S"]);
  1150.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "X") $gameMap.X.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State X"]);
  1151.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State Y"]);
  1152.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State Z"]);
  1153.                                 }
  1154.                         } else if (String(args[1]).toUpperCase() == "MIN") {
  1155.                                 for (var i = 0; i < args[2].split(',').length; i++) {
  1156.                                         if (String(args[2].split(',')[i]).toUpperCase() == "H") $gameMap.H.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN H"])/180*Math.PI;
  1157.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "V") $gameMap.V.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN V"])/180*Math.PI;
  1158.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "s") $gameMap.S.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN S"]);
  1159.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "X") $gameMap.X.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN X"]);
  1160.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN Y"]);
  1161.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN Z"]);
  1162.                                 }
  1163.                         } else if (String(args[1]).toUpperCase() == "MAX") {
  1164.                                 for (var i = 0; i < args[2].split(',').length; i++) {
  1165.                                         if (String(args[2].split(',')[i]).toUpperCase() == "H") $gameMap.H.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX H"])/180*Math.PI;
  1166.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "V") $gameMap.V.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX V"])/180*Math.PI;
  1167.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "s") $gameMap.S.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX S"]);
  1168.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "X") $gameMap.X.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX X"]);
  1169.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX Y"]);
  1170.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX Z"]);
  1171.                                 }
  1172.                         } else if (String(args[1]).toUpperCase() == "DISABLE_INPUT") {
  1173.                                 for (var i = 0; i < args[2].split(',').length; i++) {
  1174.                                         if (String(args[2].split(',')[i]).toUpperCase() == "H") $gameMap.H.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input H"]);
  1175.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "V") $gameMap.V.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input V"]);
  1176.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "s") $gameMap.S.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input S"]);
  1177.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "X") $gameMap.X.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input X"]);
  1178.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input Y"]);
  1179.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input Z"]);
  1180.                                 }
  1181.                         } else if (String(args[1]).toUpperCase() == "POSITIVE_INPUT") {
  1182.                                 for (var i = 0; i < args[2].split(',').length; i++) {
  1183.                                         if (String(args[2].split(',')[i]).toUpperCase() == "H") $gameMap.H.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input H"].toLowerCase().split(',');
  1184.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "V") $gameMap.V.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input V"].toLowerCase().split(',');
  1185.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "s") $gameMap.S.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input S"].toLowerCase().split(',');
  1186.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "X") $gameMap.X.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input X"].toLowerCase().split(',');
  1187.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input Y"].toLowerCase().split(',');
  1188.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input Z"].toLowerCase().split(',');
  1189.                                 }
  1190.                         } else if (String(args[1]).toUpperCase() == "NEGATIVE_INPUT") {
  1191.                                 for (var i = 0; i < args[2].split(',').length; i++) {
  1192.                                         if (String(args[2].split(',')[i]).toUpperCase() == "H") $gameMap.H.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input H"].toLowerCase().split(',');
  1193.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "V") $gameMap.V.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input V"].toLowerCase().split(',');
  1194.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "s") $gameMap.S.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input S"].toLowerCase().split(',');
  1195.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "X") $gameMap.X.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input X"].toLowerCase().split(',');
  1196.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input Y"].toLowerCase().split(',');
  1197.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input Z"].toLowerCase().split(',');
  1198.                                 }
  1199.                         } else if (String(args[1]).toUpperCase() == "INPUT_MOVE") {
  1200.                                 for (var i = 0; i < args[2].split(',').length; i++) {
  1201.                                         if (String(args[2].split(',')[i]).toUpperCase() == "H") $gameMap.H.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move H"])/180*Math.PI;
  1202.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "V") $gameMap.V.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move V"])/180*Math.PI;
  1203.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "s") $gameMap.S.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move S"]);
  1204.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "X") $gameMap.X.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move X"]);
  1205.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move Y"]);
  1206.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move Z"]);
  1207.                                 }
  1208.                         } else if (String(args[1]).toUpperCase() == "SPEED_RATE") {
  1209.                                 for (var i = 0; i < args[2].split(',').length; i++) {
  1210.                                         if (String(args[2].split(',')[i]).toUpperCase() == "B") $gameMap.B.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate B"]);
  1211.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "H") $gameMap.H.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate H"]);
  1212.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "V") $gameMap.V.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate V"]);
  1213.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "s") $gameMap.S.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate S"]);
  1214.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "X") $gameMap.X.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate X"]);
  1215.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate Y"]);
  1216.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate Z"]);
  1217.                                 }
  1218.                         } else if (String(args[1]).toUpperCase() == "RESET_UNINPUT") {
  1219.                                 for (var i = 0; i < args[2].split(',').length; i++) {
  1220.                                         if (String(args[2].split(',')[i]).toUpperCase() == "H") $gameMap.H.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput H"]);
  1221.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "V") $gameMap.V.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput V"]);
  1222.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "s") $gameMap.S.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput S"]);
  1223.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "X") $gameMap.X.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput X"]);
  1224.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Y") $gameMap.Y.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput Y"]);
  1225.                                         else if (String(args[2].split(',')[i]).toUpperCase() == "Z") $gameMap.Z.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput Z"]);
  1226.                                 }
  1227.                         }
  1228.                 }
  1229.         }
  1230. };

  1231. Game_Interpreter.prototype.moveToCamera = function(moveVal, currentVal) {
  1232.         var result = moveVal - currentVal;
  1233.         var resultNeg = -360 + result;
  1234.         var resultPos = 360 + result;
  1235.         if (Math.abs(result) > Math.abs(resultNeg)) result = resultNeg;
  1236.         if (Math.abs(result) > Math.abs(resultPos)) result = resultPos;
  1237.         return result;
  1238.        
  1239. };

  1240. ////////////////////////////////////////////////////////////////////////////////
  1241. //       Graphics                                                             //
  1242. ////////////////////////////////////////////////////////////////////////////////

  1243. Graphics._setupEventHandlers = function() {
  1244.     window.addEventListener('resize', this._onWindowResize.bind(this));
  1245.     document.addEventListener('keydown', this._onKeyDown.bind(this));
  1246.     document.addEventListener('keyup', this._onKeyUp.bind(this));
  1247.     document.addEventListener('keydown', this._onTouchEnd.bind(this));
  1248.     document.addEventListener('mousedown', this._onTouchEnd.bind(this));
  1249.     document.addEventListener('touchend', this._onTouchEnd.bind(this));
  1250. };

  1251. CTR_Engine.Graphics_onKeyDown = Graphics._onKeyDown;
  1252. Graphics._onKeyDown = function(event) {
  1253.   CTR_Engine.Graphics_onKeyDown.call(this, event);
  1254.   if (!event.ctrlKey && !event.altKey) CTR_Engine.keyReset(event.keyCode);
  1255. };

  1256. Graphics._onKeyUp = function(event) {
  1257.         if (!event.ctrlKey && !event.altKey) CTR_Engine.keyReset(event.keyCode, true);
  1258. };

  1259. CTR_Engine.keyReset = function(code, value) {
  1260.         if (!$gameTemp) return;
  1261.         if (SceneManager._scene.constructor.name == "Scene_Map") {
  1262.                 for (var i = 0; i < $gameMap.H.PositiveInput.length; i++) {
  1263.                         if (Input.keyMapper[code] == $gameMap.H.PositiveInput[i] || code === Number($gameMap.H.PositiveInput[i])) {
  1264.                                 if (!value && $gameMap._currentH == $gameMap._commandH && $gameMap._currentH == $gameMap._inputH && !$gameMap.H.DisableInput)
  1265.                                         $gameMap._inputH += $gameMap.H.InputMove;
  1266.                                 $gameMap._resetH = value;
  1267.                         }
  1268.                 }
  1269.                 for (var i = 0; i < $gameMap.H.NegativeInput.length; i++) {
  1270.                         if (Input.keyMapper[code] == $gameMap.H.NegativeInput[i] || code === Number($gameMap.H.NegativeInput[i])) {
  1271.                                 if (!value && $gameMap._currentH == $gameMap._commandH && $gameMap._currentH == $gameMap._inputH && !$gameMap.H.DisableInput)
  1272.                                         $gameMap._inputH -= $gameMap.H.InputMove;
  1273.                                 $gameMap._resetH = value;
  1274.                         }
  1275.                 }
  1276.                 for (var i = 0; i < $gameMap.V.PositiveInput.length; i++) {
  1277.                         if (Input.keyMapper[code] == $gameMap.V.PositiveInput[i] || code === Number($gameMap.V.PositiveInput[i])) {
  1278.                                 if (!value && $gameMap._currentV == $gameMap._commandV && $gameMap._currentV == $gameMap._inputV && !$gameMap.V.DisableInput && $gameMap._currentV != $gameMap.V.MAX)
  1279.                                         $gameMap._inputV += $gameMap.V.InputMove;
  1280.                                 $gameMap._resetV = value;
  1281.                         }
  1282.                 }
  1283.                 for (var i = 0; i < $gameMap.V.NegativeInput.length; i++) {
  1284.                         if (Input.keyMapper[code] == $gameMap.V.NegativeInput[i] || code === Number($gameMap.V.NegativeInput[i])) {
  1285.                                 if (!value && $gameMap._currentV == $gameMap._commandV && $gameMap._currentV == $gameMap._inputV && !$gameMap.V.DisableInput && $gameMap._currentV != $gameMap.V.MIN)
  1286.                                         $gameMap._inputV -= $gameMap.V.InputMove;
  1287.                                 $gameMap._resetV = value;
  1288.                         }
  1289.                 }
  1290.                 for (var i = 0; i < $gameMap.S.PositiveInput.length; i++) {
  1291.                         if (Input.keyMapper[code] == $gameMap.S.PositiveInput[i] || code === Number($gameMap.S.PositiveInput[i])) {
  1292.                                 if (!value && $gameMap._currentS == $gameMap._commandS && $gameMap._currentS == $gameMap._inputS && !$gameMap.S.DisableInput && $gameMap._currentS != $gameMap.S.MAX)
  1293.                                         $gameMap._inputS += $gameMap.S.InputMove;
  1294.                                 $gameMap._resetS = value;
  1295.                         }
  1296.                 }
  1297.                 for (var i = 0; i < $gameMap.S.NegativeInput.length; i++) {
  1298.                         if (Input.keyMapper[code] == $gameMap.S.NegativeInput[i] || code === Number($gameMap.S.NegativeInput[i])) {
  1299.                                 if (!value && $gameMap._currentS == $gameMap._commandS && $gameMap._currentS == $gameMap._inputS && !$gameMap.S.DisableInput && $gameMap._currentS != $gameMap.S.MIN)
  1300.                                         $gameMap._inputS -= $gameMap.S.InputMove;
  1301.                                 $gameMap._resetS = value;
  1302.                         }
  1303.                 }
  1304.                 for (var i = 0; i < $gameMap.X.PositiveInput.length; i++) {
  1305.                         if (Input.keyMapper[code] == $gameMap.X.PositiveInput[i] || code === Number($gameMap.X.PositiveInput[i])) {
  1306.                                 if (!value && $gameMap._currentX == $gameMap._commandX && $gameMap._currentX == $gameMap._inputX && !$gameMap.X.DisableInput && $gameMap._currentX != $gameMap.X.MAX)
  1307.                                         $gameMap._inputX += $gameMap.X.InputMove;
  1308.                                 $gameMap._resetX = value;
  1309.                         }
  1310.                 }
  1311.                 for (var i = 0; i < $gameMap.X.NegativeInput.length; i++) {
  1312.                         if (Input.keyMapper[code] == $gameMap.X.NegativeInput[i] || code === Number($gameMap.X.NegativeInput[i])) {
  1313.                                 if (!value && $gameMap._currentX == $gameMap._commandX && $gameMap._currentX == $gameMap._inputX && !$gameMap.X.DisableInput && $gameMap._currentX != $gameMap.X.MIN)
  1314.                                         $gameMap._inputX -= $gameMap.X.InputMove;
  1315.                                 $gameMap._resetX = value;
  1316.                         }
  1317.                 }
  1318.                 for (var i = 0; i < $gameMap.Y.PositiveInput.length; i++) {
  1319.                         if (Input.keyMapper[code] == $gameMap.Y.PositiveInput[i] || code === Number($gameMap.Y.PositiveInput[i])) {
  1320.                                 if (!value && $gameMap._currentY == $gameMap._commandY && $gameMap._currentY == $gameMap._inputY && !$gameMap.Y.DisableInput && $gameMap._currentY != $gameMap.Y.MAX)
  1321.                                         $gameMap._inputY += $gameMap.Y.InputMove;
  1322.                                 $gameMap._resetY = value;
  1323.                         }
  1324.                 }
  1325.                 for (var i = 0; i < $gameMap.Y.NegativeInput.length; i++) {
  1326.                         if (Input.keyMapper[code] == $gameMap.Y.NegativeInput[i] || code === Number($gameMap.Y.NegativeInput[i])) {
  1327.                                 if (!value && $gameMap._currentY == $gameMap._commandY && $gameMap._currentY == $gameMap._inputY && !$gameMap.Y.DisableInput && $gameMap._currentY != $gameMap.Y.MIN)
  1328.                                         $gameMap._inputY -= $gameMap.Y.InputMove;
  1329.                                 $gameMap._resetY = value;
  1330.                         }
  1331.                 }
  1332.                 for (var i = 0; i < $gameMap.Z.PositiveInput.length; i++) {
  1333.                         if (Input.keyMapper[code] == $gameMap.Z.PositiveInput[i] || code === Number($gameMap.Z.PositiveInput[i])) {
  1334.                                 if (!value && $gameMap._currentZ == $gameMap._commandZ && $gameMap._currentZ == $gameMap._inputZ && !$gameMap.Z.DisableInput && $gameMap._currentZ != $gameMap.Z.MAX)
  1335.                                         $gameMap._inputZ += $gameMap.Z.InputMove;
  1336.                                 $gameMap._resetZ = value;
  1337.                         }
  1338.                 }
  1339.                 for (var i = 0; i < $gameMap.Z.NegativeInput.length; i++) {
  1340.                         if (Input.keyMapper[code] == $gameMap.Z.NegativeInput[i] || code === Number($gameMap.Z.NegativeInput[i])) {
  1341.                                 if (!value && $gameMap._currentZ == $gameMap._commandZ && $gameMap._currentZ == $gameMap._inputZ && !$gameMap.Z.DisableInput && $gameMap._currentZ != $gameMap.Z.MIN)
  1342.                                         $gameMap._inputZ -= $gameMap.Z.InputMove;
  1343.                                 $gameMap._resetZ = value;
  1344.                         }
  1345.                 }
  1346.         }
  1347. };


  1348. ////////////////////////////////////////////////////////////////////////////////
  1349. //       Tilemap                                                              //
  1350. ////////////////////////////////////////////////////////////////////////////////

  1351. Tilemap.prototype.updateMargin = function() {
  1352.         this._updateMargin = false;
  1353.         this._updateMarginTime = true;
  1354.         this.position3d.set(Graphics.width / 2 + $gameMap._currentX, Graphics.height / 2 + $gameMap._currentY, $gameMap._currentZ);
  1355.         this.pivot3d.set(Graphics.width / 2 + $gameMap._currentX, Graphics.height / 2 + $gameMap._currentY, $gameMap._currentZ);
  1356.         $gameScreen._zoomX = Graphics.width / 2 + $gameMap._currentX;
  1357.         $gameScreen._zoomY = Graphics.height / 2 + $gameMap._currentY + $gameMap._currentZ;
  1358.         var rateX = Math.abs($gameMap._currentX) / (Graphics.width / 2);
  1359.         var rateY = Math.abs($gameMap._currentY + $gameMap._currentZ) / (Graphics.height / 2);
  1360.         if (Graphics.width > Graphics.height) {
  1361.                 this._margin = (Graphics.width * ($gameMap._scale3dY / (2 - (rateX + rateY)))) / ($gameMap._currentS);
  1362.                 this._width = (Graphics.width + this._margin * 2) / $gameMap._currentS * 2;
  1363.                 this._height = (Graphics.width + this._margin * 2) / $gameMap._currentS * 2;
  1364.         } else {
  1365.                 this._margin = (Graphics.height * ($gameMap._scale3dY / (2 - (rateX + rateY)))) / ($gameMap._currentS);
  1366.                 this._width = (Graphics.height + this._margin * 2) / $gameMap._currentS * 2;
  1367.                 this._height = (Graphics.height + this._margin * 2) / $gameMap._currentS * 2;
  1368.         }
  1369.         this._needsRepaint = true;
  1370.         this.updateTransform();
  1371.         setTimeout(this._updateMarginTime = false, 6);
  1372. };


  1373. ////////////////////////////////////////////////////////////////////////////////
  1374. //       Spriteset_Map                                                        //
  1375. ////////////////////////////////////////////////////////////////////////////////

  1376. CTR_Engine.Spriteset_Map_update = Spriteset_Map.prototype.update;
  1377. Spriteset_Map.prototype.update = function() {
  1378.        
  1379.         if($gameMap._currentH === undefined) this._tilemap.euler.z = $gameMap._inputH = $gameMap._commandH = $gameMap._currentH = $gameMap.H.InitialState;
  1380.         else if ($gameMap._commandH != $gameMap._currentH) {
  1381.                 if (($gameMap._commandH > $gameMap._currentH) && ((Math.abs($gameMap._commandH - $gameMap._currentH)) < Math.abs($gameMap._moveSpeedRateH / 10))) $gameMap._currentH = $gameMap._commandH;
  1382.                 else if (($gameMap._commandH < $gameMap._currentH) && ((Math.abs($gameMap._currentH - $gameMap._commandH)) < Math.abs($gameMap._moveSpeedRateH / 10))) $gameMap._currentH = $gameMap._commandH;
  1383.                 else if ($gameMap._commandH > $gameMap._currentH) $gameMap._currentH += $gameMap._moveSpeedRateH / 10;
  1384.                 else $gameMap._currentH -= $gameMap._moveSpeedRateH / 10;
  1385.                 if ($gameMap._currentH > $gameMap.H.MAX) { $gameMap._currentH -= ($gameMap.H.MAX + 1 / 180 * Math.PI); $gameMap._commandH -= ($gameMap.H.MAX + 1 / 180 * Math.PI); }
  1386.                 else if ($gameMap._currentH < $gameMap.H.MIN) { $gameMap._currentH += ($gameMap.H.MAX + 1 / 180 * Math.PI); $gameMap._commandH += ($gameMap.H.MAX + 1 / 180 * Math.PI); }
  1387.                 this._tilemap.euler.z = $gameMap._inputH = $gameMap._currentH;
  1388.                 var checkH = $gameMap._currentH * 180 / Math.PI;
  1389.                 if (this._checkH != 0 && (checkH >= 90 && checkH <= 270)) { this._checkH = 0; this._tilemap._needsRepaint = true; }
  1390.                 else if (this._checkH != 1 && (checkH >= 180 && checkH <= 360)) { this._checkH = 1; this._tilemap._needsRepaint = true; }
  1391.                 else if (this._checkH != 2 && ((checkH >= 270 && checkH <= 360) || (checkH >= 2 && checkH <= 90))) { this._checkH = 0; this._tilemap._needsRepaint = true; }
  1392.                 else if (this._checkH != 3 && (checkH >= 0 && checkH <= 180)) { this._checkH = 3; this._tilemap._needsRepaint = true; }
  1393.         } else if ($gameMap._inputH != $gameMap._currentH) {
  1394.                 if (($gameMap._inputH > $gameMap._currentH) && ((Math.abs($gameMap._inputH - $gameMap._currentH)) < Math.abs($gameMap.H.SpeedRate / 10))) $gameMap._currentH = $gameMap._inputH;
  1395.                 else if (($gameMap._inputH < $gameMap._currentH) && ((Math.abs($gameMap._currentH - $gameMap._inputH)) < Math.abs($gameMap.H.SpeedRate / 10))) $gameMap._currentH = $gameMap._inputH;
  1396.                 else if ($gameMap._inputH > $gameMap._currentH) $gameMap._currentH += $gameMap.H.SpeedRate / 10;
  1397.                 else $gameMap._currentH -= $gameMap.H.SpeedRate / 10;
  1398.                 if ($gameMap._currentH > $gameMap.H.MAX) { $gameMap._currentH -= ($gameMap.H.MAX + 1 / 180 * Math.PI); $gameMap._inputH -= ($gameMap.H.MAX + 1 / 180 * Math.PI); }
  1399.                 else if ($gameMap._currentH < $gameMap.H.MIN) { $gameMap._currentH += ($gameMap.H.MAX + 1 / 180 * Math.PI); $gameMap._inputH += ($gameMap.H.MAX + 1 / 180 * Math.PI); }
  1400.                 this._tilemap.euler.z = $gameMap._commandH = $gameMap._currentH;
  1401.                 var checkH = $gameMap._currentH * 180 / Math.PI;
  1402.                 if (this._checkH != 0 && (checkH >= 90 && checkH <= 270)) { this._checkH = 0; this._tilemap._needsRepaint = true; }
  1403.                 else if (this._checkH != 1 && (checkH >= 180 && checkH <= 360)) { this._checkH = 1; this._tilemap._needsRepaint = true; }
  1404.                 else if (this._checkH != 2 && ((checkH >= 270 && checkH <= 360) || (checkH >= 2 && checkH <= 90))) { this._checkH = 0; this._tilemap._needsRepaint = true; }
  1405.                 else if (this._checkH != 3 && (checkH >= 0 && checkH <= 180)) { this._checkH = 3; this._tilemap._needsRepaint = true; }
  1406.                 console.log(checkH)
  1407.         } else if ($gameMap.H.ResetUninput && $gameMap._resetH) {
  1408.                 $gameMap._inputH = $gameMap.H.InitialState;
  1409.         }

  1410.         if (($gameMap._currentV === undefined) || ($gameMap._currentV != $gameMap._commandV) || ($gameMap._currentV != $gameMap._inputV)) {
  1411.                 if ($gameMap._currentV === undefined) this._tilemap.euler.x = $gameMap._inputV = $gameMap._commandV = $gameMap._currentV = $gameMap.V.InitialState;
  1412.                 else if ($gameMap._commandV != $gameMap._currentV) {
  1413.                         if (($gameMap._commandV > $gameMap._currentV) && ((Math.abs($gameMap._commandV - $gameMap._currentV)) < Math.abs($gameMap._moveSpeedRateV / 10))) $gameMap._currentV = $gameMap._commandV;
  1414.                         else if (($gameMap._commandV < $gameMap._currentV) && ((Math.abs($gameMap._currentV - $gameMap._commandV)) < Math.abs($gameMap._moveSpeedRateV / 10))) $gameMap._currentV = $gameMap._commandV;
  1415.                         else if ($gameMap._commandV > $gameMap._currentV) $gameMap._currentV += $gameMap._moveSpeedRateV / 10;
  1416.                         else $gameMap._currentV -= $gameMap._moveSpeedRateV / 10;
  1417.                         if ($gameMap._currentV > $gameMap.V.MAX) { $gameMap._currentV = $gameMap.V.MAX; $gameMap._commandV = $gameMap.V.MAX; }
  1418.                         else if ($gameMap._currentV < $gameMap.V.MIN) { $gameMap._currentV = $gameMap.V.MIN; $gameMap._commandV = $gameMap.V.MIN; }
  1419.                         this._tilemap.euler.x = $gameMap._inputV = $gameMap._currentV;
  1420.                 } else if ($gameMap._inputV != $gameMap._currentV) {
  1421.                         if (($gameMap._inputV > $gameMap._currentV) && ((Math.abs($gameMap._inputV - $gameMap._currentV)) < Math.abs($gameMap.V.SpeedRate / 10))) $gameMap._currentV = $gameMap._inputV;
  1422.                         else if (($gameMap._inputV < $gameMap._currentV) && ((Math.abs($gameMap._currentV - $gameMap._inputV)) < Math.abs($gameMap.V.SpeedRate / 10))) $gameMap._currentV = $gameMap._inputV;
  1423.                         else if ($gameMap._inputV > $gameMap._currentV) $gameMap._currentV += $gameMap.V.SpeedRate / 10;
  1424.                         else $gameMap._currentV -= $gameMap.V.SpeedRate / 10;
  1425.                         if ($gameMap._currentV > $gameMap.V.MAX) { $gameMap._currentV = $gameMap.V.MAX; $gameMap._inputV = $gameMap.V.MAX; }
  1426.                         else if ($gameMap._currentV < $gameMap.V.MIN) { $gameMap._currentV = $gameMap.V.MIN; $gameMap._inputV = $gameMap.V.MIN; }
  1427.                         this._tilemap.euler.x = $gameMap._commandV = $gameMap._currentV;
  1428.                 } else if ($gameMap.V.ResetUninput && $gameMap._resetV) {
  1429.                         $gameMap._inputV = $gameMap.V.InitialState;
  1430.                 }
  1431.                 if ($gameMap._currentV < 15/180*Math.PI) {
  1432.                         $gameMap._scale3dY = 1+$gameMap._currentV/10;
  1433.                 } else if ($gameMap._currentV < 30/180*Math.PI) {
  1434.                         $gameMap._scale3dY = 1.8+$gameMap._currentV*0.5/Math.PI - Math.pow($gameMap._currentV*1/Math.PI, $gameMap._currentV*1/Math.PI);

  1435.                 } else if ($gameMap._currentV < 45/180*Math.PI) {
  1436.                         $gameMap._scale3dY = 0.1 + $gameMap._currentV*0.5/Math.PI + Math.pow($gameMap._currentV*5.4/Math.PI, $gameMap._currentV*2.5/Math.PI);

  1437.                 } else if ($gameMap._currentV < 60/180*Math.PI) {
  1438.                         $gameMap._scale3dY = 0.2 + Math.pow($gameMap._currentV*5/Math.PI, $gameMap._currentV*3.4/Math.PI);
  1439.                        
  1440.                 } else if ($gameMap._currentV < 68/180*Math.PI) {
  1441.                         $gameMap._scale3dY = 0.4 + Math.pow($gameMap._currentV*3.8/Math.PI, $gameMap._currentV*6/Math.PI);

  1442.                 } else if ($gameMap._currentV < 69/180*Math.PI) {
  1443.                         $gameMap._scale3dY = -0.5 + Math.pow($gameMap._currentV*6/Math.PI, $gameMap._currentV*3.75/Math.PI);
  1444.                        
  1445.                 } else if ($gameMap._currentV < 74/180*Math.PI) {
  1446.                         $gameMap._scale3dY = -0.8 + Math.pow($gameMap._currentV*6/Math.PI, $gameMap._currentV*4/Math.PI);
  1447.                        
  1448.                 } else if ($gameMap._currentV < 76/180*Math.PI) {
  1449.                         $gameMap._scale3dY = -1 + Math.pow($gameMap._currentV*6/Math.PI, $gameMap._currentV*4.15/Math.PI);
  1450.                        
  1451.                 } else {
  1452.                         $gameMap._scale3dY = -3.7 + Math.pow($gameMap._currentV*9.1/Math.PI, $gameMap._currentV*3.61/Math.PI);

  1453.                 }
  1454.                 if (this._checkV != Math.floor($gameMap._currentV / 10)) {
  1455.                         this._checkV = Math.floor($gameMap._currentV / 10);
  1456.                         this._tilemap._updateMargin = true;
  1457.                 }
  1458.         }
  1459.        
  1460.         if($gameMap._currentS === undefined) $gameScreen._zoomScale = $gameMap._inputS = $gameMap._commandS = $gameMap._currentS = $gameMap.S.InitialState;
  1461.         else if ($gameMap._commandS != $gameMap._currentS) {
  1462.                 if (($gameMap._commandS > $gameMap._currentS) && ((Math.abs($gameMap._commandS - $gameMap._currentS)) < Math.abs($gameMap._moveSpeedRateS / 20))) $gameMap._currentS = $gameMap._commandS;
  1463.                 else if (($gameMap._commandS < $gameMap._currentS) && ((Math.abs($gameMap._currentS - $gameMap._commandS)) < Math.abs($gameMap._moveSpeedRateS / 20))) $gameMap._currentS = $gameMap._commandS;
  1464.                 else if ($gameMap._commandS > $gameMap._currentS) $gameMap._currentS += $gameMap._moveSpeedRateS / 20;
  1465.                 else $gameMap._currentS -= $gameMap._moveSpeedRateS / 20;
  1466.                 if ($gameMap._currentS > $gameMap.S.MAX) { $gameMap._currentS -= ($gameMap.S.MAX); $gameMap._commandS = ($gameMap.S.MAX); }
  1467.                 else if ($gameMap._currentS < $gameMap.S.MIN) { $gameMap._currentS += ($gameMap.S.MAX); $gameMap._commandS = ($gameMap.S.MIN); }
  1468.                 $gameScreen._zoomScale = $gameMap._inputS = $gameMap._currentS;
  1469.                 if (this._checkS != Math.floor($gameMap._currentS * 10)) {
  1470.                         this._checkS = Math.floor($gameMap._currentS * 10);
  1471.                         this._tilemap._updateMargin = true;
  1472.                 }
  1473.         } else if ($gameMap._inputS != $gameMap._currentS) {
  1474.                 if (($gameMap._inputS > $gameMap._currentS) && ((Math.abs($gameMap._inputS - $gameMap._currentS)) < Math.abs($gameMap.S.SpeedRate / 20))) $gameMap._currentS = $gameMap._inputS;
  1475.                 else if (($gameMap._inputS < $gameMap._currentS) && ((Math.abs($gameMap._currentS - $gameMap._inputS)) < Math.abs($gameMap.S.SpeedRate / 20))) $gameMap._currentS = $gameMap._inputS;
  1476.                 else if ($gameMap._inputS > $gameMap._currentS) $gameMap._currentS += $gameMap.S.SpeedRate / 20;
  1477.                 else $gameMap._currentS -= $gameMap.S.SpeedRate / 20;
  1478.                 if ($gameMap._currentS > $gameMap.S.MAX) { $gameMap._currentS = ($gameMap.S.MAX); $gameMap._inputS = ($gameMap.S.MAX); }
  1479.                 else if ($gameMap._currentS < $gameMap.S.MIN) { $gameMap._currentS = ($gameMap.S.MIN); $gameMap._inputS = ($gameMap.S.MIN); }
  1480.                 $gameScreen._zoomScale = $gameMap._commandS = $gameMap._currentS;
  1481.                 if (this._checkS != Math.floor($gameMap._currentS * 10)) {
  1482.                         this._checkS = Math.floor($gameMap._currentS * 10);
  1483.                         this._tilemap._updateMargin = true;
  1484.                 }
  1485.         } else if ($gameMap.S.ResetUninput && $gameMap._resetS) {
  1486.                 $gameMap._inputS = $gameMap.S.InitialState;
  1487.         }

  1488.         if ($gameMap._commandX != $gameMap._currentX) {
  1489.                 if (($gameMap._commandX > $gameMap._currentX) && ((Math.abs($gameMap._commandX - $gameMap._currentX)) < Math.abs($gameMap._moveSpeedRateX * 20))) $gameMap._currentX = $gameMap._commandX;
  1490.                 else if (($gameMap._commandX < $gameMap._currentX) && ((Math.abs($gameMap._currentX - $gameMap._commandX)) < Math.abs($gameMap._moveSpeedRateX * 20))) $gameMap._currentX = $gameMap._commandX;
  1491.                 else if ($gameMap._commandX > $gameMap._currentX) $gameMap._currentX += $gameMap._moveSpeedRateX * 20;
  1492.                 else $gameMap._currentX -= $gameMap._moveSpeedRateX * 20;
  1493.                 if ($gameMap._currentX > $gameMap.X.MAX) { $gameMap._currentX = $gameMap.X.MAX; $gameMap._commandX = $gameMap.X.MAX; }
  1494.                 else if ($gameMap._currentX < $gameMap.X.MIN) { $gameMap._currentX = $gameMap.X.MIN; $gameMap._commandX = $gameMap.X.MIN; }
  1495.                 $gameMap._inputX = $gameMap._currentX;
  1496.                 if (this._checkX != Math.floor($gameMap._currentX / 48)) {
  1497.                         this._checkX = Math.floor($gameMap._currentX / 48);
  1498.                         this._tilemap._updateMargin = true;
  1499.                 } else {
  1500.                         this._tilemap.position3d.x = Graphics.width / 2 + $gameMap._currentX;
  1501.                         this._tilemap.pivot3d.x = Graphics.width / 2 + $gameMap._currentX;
  1502.                         $gameScreen._zoomX = Graphics.width / 2 + $gameMap._currentX;
  1503.                 }
  1504.         } else if ($gameMap._inputX != $gameMap._currentX) {
  1505.                 if (($gameMap._inputX > $gameMap._currentX) && ((Math.abs($gameMap._inputX - $gameMap._currentX)) <= Math.abs($gameMap.X.SpeedRate * 20))) $gameMap._currentX = $gameMap._inputX;
  1506.                 else if (($gameMap._inputX < $gameMap._currentX) && ((Math.abs($gameMap._currentX - $gameMap._inputX)) <= Math.abs($gameMap.X.SpeedRate * 20))) $gameMap._currentX = $gameMap._inputX;
  1507.                 else if ($gameMap._inputX > $gameMap._currentX) $gameMap._currentX += $gameMap.X.SpeedRate * 20;
  1508.                 else $gameMap._currentX -= $gameMap.X.SpeedRate * 20;
  1509.                 if ($gameMap._currentX > $gameMap.X.MAX) { $gameMap._currentX = $gameMap.X.MAX; $gameMap._inputX = $gameMap.X.MAX; }
  1510.                 else if ($gameMap._currentX < $gameMap.X.MIN) { $gameMap._currentX = $gameMap.X.MIN; $gameMap._inputX = $gameMap.X.MIN; }
  1511.                 $gameMap._commandX = $gameMap._currentX;
  1512.                 if (this._checkX != Math.floor($gameMap._currentX / 48)) {
  1513.                         this._checkX = Math.floor($gameMap._currentX / 48);
  1514.                         this._tilemap._updateMargin = true;
  1515.                 } else {
  1516.                         this._tilemap.position3d.x = Graphics.width / 2 + $gameMap._currentX;
  1517.                         this._tilemap.pivot3d.x = Graphics.width / 2 + $gameMap._currentX;
  1518.                         $gameScreen._zoomX = Graphics.width / 2 + $gameMap._currentX;
  1519.                 }
  1520.         } else if ($gameMap.X.ResetUninput && $gameMap._resetX) {
  1521.                 $gameMap._inputX = $gameMap.X.InitialState;
  1522.         }
  1523.        
  1524.         if ($gameMap._commandY != $gameMap._currentY) {
  1525.                 if (($gameMap._commandY > $gameMap._currentY) && ((Math.abs($gameMap._commandY - $gameMap._currentY)) < Math.abs($gameMap._moveSpeedRateY * 20))) $gameMap._currentY = $gameMap._commandY;
  1526.                 else if (($gameMap._commandY < $gameMap._currentY) && ((Math.abs($gameMap._currentY - $gameMap._commandY)) < Math.abs($gameMap._moveSpeedRateY * 20))) $gameMap._currentY = $gameMap._commandY;
  1527.                 else if ($gameMap._commandY > $gameMap._currentY) $gameMap._currentY += $gameMap._moveSpeedRateY * 20;
  1528.                 else $gameMap._currentY -= $gameMap._moveSpeedRateY * 20;
  1529.                 if ($gameMap._currentY > $gameMap.Y.MAX) { $gameMap._currentY = $gameMap.Y.MAX; $gameMap._commandY = $gameMap.Y.MAX; }
  1530.                 else if ($gameMap._currentY < $gameMap.Y.MIN) { $gameMap._currentY = $gameMap.Y.MIN; $gameMap._commandY = $gameMap.Y.MIN; }
  1531.                 $gameMap._inputY = $gameMap._currentY;
  1532.                 if (this._checkY != Math.floor($gameMap._currentY / 48)) {
  1533.                         this._checkY = Math.floor($gameMap._currentY / 48);
  1534.                         this._tilemap._updateMargin = true;
  1535.                 } else {
  1536.                         this._tilemap.position3d.y = Graphics.height / 2 + $gameMap._currentY;
  1537.                         this._tilemap.pivot3d.y = Graphics.height / 2 + $gameMap._currentY;
  1538.                         $gameScreen._zoomY = Graphics.height / 2 + $gameMap._currentY + $gameMap._currentZ;
  1539.                 }
  1540.         } else if ($gameMap._inputY != $gameMap._currentY) {
  1541.                 if (($gameMap._inputY > $gameMap._currentY) && ((Math.abs($gameMap._inputY - $gameMap._currentY)) < Math.abs($gameMap.Y.SpeedRate * 20))) $gameMap._currentY = $gameMap._inputY;
  1542.                 else if (($gameMap._inputY < $gameMap._currentY) && ((Math.abs($gameMap._currentY - $gameMap._inputY)) < Math.abs($gameMap.Y.SpeedRate * 20))) $gameMap._currentY = $gameMap._inputY;
  1543.                 else if ($gameMap._inputY > $gameMap._currentY) $gameMap._currentY += $gameMap.Y.SpeedRate * 20;
  1544.                 else $gameMap._currentY -= $gameMap.Y.SpeedRate * 20;
  1545.                 if ($gameMap._currentY > $gameMap.Y.MAX) { $gameMap._currentY = $gameMap.Y.MAX; $gameMap._inputY = $gameMap.Y.MAX; }
  1546.                 else if ($gameMap._currentY < $gameMap.Y.MIN) { $gameMap._currentY = $gameMap.Y.MIN; $gameMap._inputY = $gameMap.Y.MIN; }
  1547.                 $gameMap._commandY = $gameMap._currentY;
  1548.                 if (this._checkY != Math.floor($gameMap._currentY / 48)) {
  1549.                         this._checkY = Math.floor($gameMap._currentY / 48);
  1550.                         this._tilemap._updateMargin = true;
  1551.                 } else {
  1552.                         this._tilemap.position3d.y = Graphics.height / 2 + $gameMap._currentY;
  1553.                         this._tilemap.pivot3d.y = Graphics.height / 2 + $gameMap._currentY;
  1554.                         $gameScreen._zoomY = Graphics.height / 2 + $gameMap._currentY + $gameMap._currentZ;
  1555.                 }
  1556.         } else if ($gameMap.Y.ResetUninput && $gameMap._resetY) {
  1557.                 $gameMap._inputY = $gameMap.Y.InitialState;
  1558.         }

  1559.         if ($gameMap._commandZ != $gameMap._currentZ) {
  1560.                 if (($gameMap._commandZ > $gameMap._currentZ) && ((Math.abs($gameMap._commandZ - $gameMap._currentZ)) < Math.abs($gameMap._moveSpeedRateZ * 20))) $gameMap._currentZ = $gameMap._commandZ;
  1561.                 else if (($gameMap._commandZ < $gameMap._currentZ) && ((Math.abs($gameMap._currentZ - $gameMap._commandZ)) < Math.abs($gameMap._moveSpeedRateZ * 20))) $gameMap._currentZ = $gameMap._commandZ;
  1562.                 else if ($gameMap._commandZ > $gameMap._currentZ) $gameMap._currentZ += $gameMap._moveSpeedRateZ * 20;
  1563.                 else $gameMap._currentZ -= $gameMap._moveSpeedRateZ * 20;
  1564.                 if ($gameMap._currentZ > $gameMap.Z.MAX) { $gameMap._currentZ = $gameMap.Z.MAX; $gameMap._commandZ = $gameMap.Z.MAX; }
  1565.                 else if ($gameMap._currentZ < $gameMap.Z.MIN) { $gameMap._currentZ = $gameMap.Z.MIN; $gameMap._commandZ = $gameMap.Z.MIN; }
  1566.                 $gameMap._inputZ = $gameMap._currentZ;
  1567.                 if (this._checkZ != Math.floor($gameMap._currentZ / 48)) {
  1568.                         this._checkZ = Math.floor($gameMap._currentZ / 48);
  1569.                         this._tilemap._updateMargin = true;
  1570.                 } else {
  1571.                         this._tilemap.position3d.z = $gameMap._currentZ;
  1572.                         this._tilemap.pivot3d.z = $gameMap._currentZ;
  1573.                         $gameScreen._zoomY = Graphics.height / 2 + $gameMap._currentY + $gameMap._currentZ;
  1574.                 }
  1575.         } else if ($gameMap._inputZ != $gameMap._currentZ) {
  1576.                 if (($gameMap._inputZ > $gameMap._currentZ) && ((Math.abs($gameMap._inputZ - $gameMap._currentZ)) < Math.abs($gameMap.Z.SpeedRate * 20))) $gameMap._currentZ = $gameMap._inputZ;
  1577.                 else if (($gameMap._inputZ < $gameMap._currentZ) && ((Math.abs($gameMap._currentZ - $gameMap._inputZ)) < Math.abs($gameMap.Z.SpeedRate * 20))) $gameMap._currentZ = $gameMap._inputZ;
  1578.                 else if ($gameMap._inputZ > $gameMap._currentZ) $gameMap._currentZ += $gameMap.Z.SpeedRate * 20;
  1579.                 else $gameMap._currentZ -= $gameMap.Z.SpeedRate * 20;
  1580.                 if ($gameMap._currentZ > $gameMap.Z.MAX) { $gameMap._currentZ = $gameMap.Z.MAX; $gameMap._inputZ = $gameMap.Z.MAX; }
  1581.                 else if ($gameMap._currentZ < $gameMap.Z.MIN) { $gameMap._currentZ = $gameMap.Z.MIN; $gameMap._inputZ = $gameMap.Z.MIN; }
  1582.                 $gameMap._commandZ = $gameMap._currentZ;
  1583.                 if (this._checkZ != Math.floor($gameMap._currentZ / 48)) {
  1584.                         this._checkZ = Math.floor($gameMap._currentZ / 48);
  1585.                         this._tilemap._updateMargin = true;
  1586.                 } else {
  1587.                         this._tilemap.position3d.z = $gameMap._currentZ;
  1588.                         this._tilemap.pivot3d.z = $gameMap._currentZ;
  1589.                         $gameScreen._zoomY = Graphics.height / 2 + $gameMap._currentY + $gameMap._currentZ;
  1590.                 }
  1591.         } else if ($gameMap.Z.ResetUninput && $gameMap._resetZ) {
  1592.                 $gameMap._inputZ = $gameMap.Z.InitialState;
  1593.         }

  1594.         if (this._tilemap._updateMargin && !this._tilemap._updateMarginTime) this._tilemap.updateMargin();
  1595.         CTR_Engine.Spriteset_Map_update.call(this);
  1596. };

  1597. CTR_Engine.Spriteset_Map_createTilemap = Spriteset_Map.prototype.createTilemap;
  1598. Spriteset_Map.prototype.createTilemap = function() {
  1599.         CTR_Engine.Spriteset_Map_createTilemap.call(this);
  1600.         this._tilemap.convertTo3d();
  1601.         this._tilemap.position3d.set(Graphics.width / 2 + $gameMap.X.InitialState, Graphics.height / 2 + $gameMap.Y.InitialState, $gameMap.Z.InitialState);
  1602.         this._tilemap.pivot3d.set(Graphics.width / 2 + $gameMap.X.InitialState, Graphics.height / 2 + $gameMap.Y.InitialState, $gameMap.Z.InitialState)
  1603.         $gameScreen._zoomX = Graphics.width / 2 + $gameMap.X.InitialState;
  1604.         $gameScreen._zoomY = Graphics.height / 2 + $gameMap.Y.InitialState + $gameMap.Z.InitialState;
  1605.         $gameScreen._zoomScale = $gameMap._currentS;
  1606.         if ($gameMap._currentX === undefined) $gameMap._currentX = $gameMap._inputX = $gameMap._commandX = $gameMap.X.InitialState;
  1607.         if ($gameMap._currentY === undefined) $gameMap._currentY = $gameMap._inputY = $gameMap._commandY = $gameMap.Y.InitialState;
  1608.         if ($gameMap._currentZ === undefined) $gameMap._currentZ = $gameMap._inputZ = $gameMap._commandZ = $gameMap.Z.InitialState;
  1609. };

  1610. CTR_Engine.Spriteset_Map_createCharacters = Spriteset_Map.prototype.createCharacters;
  1611. Spriteset_Map.prototype.createCharacters = function() {
  1612.         CTR_Engine.Spriteset_Map_createCharacters.call(this);
  1613.     for (var i = 0; i < this._characterSprites.length; i++) {
  1614.                 this._characterSprites[i].convertTo3d();
  1615.                 var shiftY = this._characterSprites[i]._character.shiftY();
  1616.                 var middle = !this._characterSprites[i]._character.isObjectCharacter();
  1617.                 if (this._characterSprites[i]._character.isWallCharacter()) {
  1618.                         this._characterSprites[i].euler.x = -0.5 * Math.PI;
  1619.                         if (this._characterSprites[i]._character.direction() == 2) {
  1620.                                 this._characterSprites[i].position3d.set(- $gameMap.tileWidth() / 2, middle ? - $gameMap.tileHeight() / 2 + shiftY : shiftY, 0);
  1621.                                 this._characterSprites[i].pivot3d.set(0, 0, 0);
  1622.                         } else if (this._characterSprites[i]._character.direction() == 4) {
  1623.                                 this._characterSprites[i].position3d.set(middle ? 0 : - $gameMap.tileWidth() / 2, - $gameMap.tileHeight() + shiftY, 0);
  1624.                                 this._characterSprites[i].pivot3d.set(0, 0, 0);
  1625.                                 this._characterSprites[i].euler.y = 1.5 * Math.PI;
  1626.                         } else if (this._characterSprites[i]._character.direction() == 6) {
  1627.                                 this._characterSprites[i].position3d.set(middle ? 0 : $gameMap.tileWidth() / 2, shiftY, 0);
  1628.                                 this._characterSprites[i].pivot3d.set(0, 0, 0);
  1629.                                 this._characterSprites[i].euler.y = 0.5 * Math.PI;
  1630.                         } else if (this._characterSprites[i]._character.direction() == 8) {
  1631.                                 this._characterSprites[i].position3d.set($gameMap.tileWidth() / 2, middle ? - $gameMap.tileHeight() / 2 + shiftY : - $gameMap.tileHeight() + shiftY, 0);
  1632.                                 this._characterSprites[i].pivot3d.set(0, 0, 0);
  1633.                                 this._characterSprites[i].euler.y = Math.PI;
  1634.                         }
  1635.                 } else if (!this._characterSprites[i]._character._tileId > 0) {
  1636.                         this._characterSprites[i].position3d.set(0, -$gameMap.tileHeight() / 2 + shiftY, 0);
  1637.                         this._characterSprites[i].pivot3d.set(0, -$gameMap.tileHeight() / 4 + shiftY, 0);
  1638.                 } else {
  1639.                         this._characterSprites[i].position3d.set(0, -$gameMap.tileHeight() / 4, 0);
  1640.                         this._characterSprites[i].pivot3d.set(0, -$gameMap.tileHeight() / 4 + shiftY, 0);
  1641.                 }
  1642.     }
  1643. };

  1644. CTR_Engine.Spriteset_Map_createDestination = Spriteset_Map.prototype.createDestination;
  1645. Spriteset_Map.prototype.createDestination = function() {
  1646.         CTR_Engine.Spriteset_Map_createDestination.call(this);
  1647.     this._destinationSprite.convertTo3d();
  1648.         this._destinationSprite.position3d.set(0, 0, 0);
  1649. };


  1650. ////////////////////////////////////////////////////////////////////////////////
  1651. //       Sprite_Character                                                     //
  1652. ////////////////////////////////////////////////////////////////////////////////

  1653. CTR_Engine.Sprite_Character_setCharacter = Sprite_Character.prototype.setCharacter;
  1654. Sprite_Character.prototype.setCharacter = function(character) {
  1655.         CTR_Engine.Sprite_Character_setCharacter.call(this, character);
  1656.         if (this._character.isWallCharacter()) {
  1657.                 this.anchor.x = 0;
  1658.                 this.anchor.y = 1;
  1659.         }
  1660. };

  1661. CTR_Engine.Sprite_Character_updatePosition = Sprite_Character.prototype.updatePosition;
  1662. Sprite_Character.prototype.updatePosition = function() {
  1663.         CTR_Engine.Sprite_Character_updatePosition.call(this);
  1664.         if (!this._character._tileId > 0 && !this._character.isWallCharacter()) {
  1665.                 this.euler.z = -$gameMap._currentH;
  1666.                 this.scale3d.y = $gameMap._scale3dY;
  1667.                 this.z += this.getDepth() / 1000 + this.adjustGetDepth();
  1668.         } else if (this._character.isWallCharacter()) {
  1669.                 var eulerZ = $gameMap._currentH*180/Math.PI;
  1670.                 var adjust = 0.025;
  1671.                 this.z += this.adjustGetDepth();
  1672.                 if (this._character.direction() == 2) {
  1673.                         if (this._character.isObjectCharacter() && (eulerZ >= 90 && eulerZ <= 270)) this.z = 0;
  1674.                         else if (eulerZ >= 0 && eulerZ <= 90) this.z += this.getDepth() / 1000 + adjust/1.5;
  1675.                         else if (eulerZ >= 90 && eulerZ <= 180) this.z += this.getDepth() / 1000 + adjust/1.5;
  1676.                         else this.z += this.getDepth() / 1000;
  1677.                         if (this._character._doorState && String(this._character._doorState.split(',')[0]).toUpperCase() == "POSITIVE") {
  1678.                                 if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "OPEN") && this.euler.y < 0.5 * Math.PI) this.euler.y += 1/180*Math.PI;
  1679.                                 else if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "CLOSE") && this.euler.y > 0) this.euler.y -= 1/180*Math.PI;
  1680.                         } else if (this._character._doorState && String(this._character._doorState.split(',')[0]).toUpperCase() == "NEGATIVE") {
  1681.                                 if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "OPEN") && this.euler.y > - 0.5 * Math.PI) this.euler.y -= 1/180*Math.PI;
  1682.                                 else if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "CLOSE") && this.euler.y < 0) this.euler.y += 1/180*Math.PI;
  1683.                         }
  1684.                 } else if (this._character.direction() == 4) {
  1685.                         if (this._character.isObjectCharacter() && (eulerZ >= 0 && eulerZ <= 180)) this.z = 0;
  1686.                         else if ((eulerZ >= 270 && eulerZ <= 360) || (eulerZ == 0)) this.z += this.getDepth() / 1000 + adjust;
  1687.                         else if (eulerZ >= 0 && eulerZ <= 90) this.z += this.getDepth() / 1000 + adjust/1.5;
  1688.                         else this.z += this.getDepth() / 1000;
  1689.                         if (this._character._doorState && String(this._character._doorState.split(',')[0]).toUpperCase() == "POSITIVE") {
  1690.                                 if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "OPEN") && this.euler.y < 2 * Math.PI) this.euler.y += 1/180*Math.PI;
  1691.                                 else if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "CLOSE") && this.euler.y > 1.5 * Math.PI) this.euler.y -= 1/180*Math.PI;
  1692.                         } else if (this._character._doorState && String(this._character._doorState.split(',')[0]).toUpperCase() == "NEGATIVE") {
  1693.                                 if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "OPEN") && this.euler.y > Math.PI) this.euler.y -= 1/180*Math.PI;
  1694.                                 else if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "CLOSE") && this.euler.y < 1.5 * Math.PI) this.euler.y += 1/180*Math.PI;
  1695.                         }
  1696.                 } else if (this._character.direction() == 6) {
  1697.                         if (this._character.isObjectCharacter() && (eulerZ >= 180 && eulerZ <= 360)) this.z = 0;
  1698.                         else if (this._character.isObjectCharacter() && (eulerZ >= 0 && eulerZ <= 90)) this.z += this.getDepth() / 1000 + adjust;
  1699.                         else if (eulerZ >= 90 && eulerZ <= 180) this.z += this.getDepth() / 1000 + adjust;
  1700.                         else if (eulerZ >= 180 && eulerZ <= 270) this.z += this.getDepth() / 1000 + adjust*1.5;
  1701.                         else if (eulerZ >= 0 && eulerZ <= 90) this.z += this.getDepth() / 1000 - adjust/2;
  1702.                         else this.z += this.getDepth() / 1000;
  1703.                         if (this._character._doorState && String(this._character._doorState.split(',')[0]).toUpperCase() == "POSITIVE") {
  1704.                                 if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "OPEN") && this.euler.y < Math.PI) this.euler.y += 1/180*Math.PI;
  1705.                                 else if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "CLOSE") && this.euler.y > 0.5 * Math.PI) this.euler.y -= 1/180*Math.PI;
  1706.                         } else if (this._character._doorState && String(this._character._doorState.split(',')[0]).toUpperCase() == "NEGATIVE") {
  1707.                                 if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "OPEN") && this.euler.y > 0) this.euler.y -= 1/180*Math.PI;
  1708.                                 else if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "CLOSE") && this.euler.y < 0.5 * Math.PI) this.euler.y += 1/180*Math.PI;
  1709.                         }
  1710.                 } else if (this._character.direction() == 8) {
  1711.                         if (this._character.isObjectCharacter() && ((eulerZ >= 270 && eulerZ <= 360) || (eulerZ >= 0 && eulerZ <= 90))) this.z = 0;
  1712.                         else if (eulerZ >= 180 && eulerZ <= 270) this.z += this.getDepth() / 1000 + adjust;
  1713.                         else if (eulerZ >= 270 && eulerZ <= 360) this.z += this.getDepth() / 1000 + adjust/1.5;
  1714.                         else if (eulerZ >= 0 && eulerZ <= 90) this.z += this.getDepth() / 1000 - adjust/2;
  1715.                         else this.z += this.getDepth() / 1000;
  1716.                         if (this._character._doorState && String(this._character._doorState.split(',')[0]).toUpperCase() == "POSITIVE") {
  1717.                                 if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "OPEN") && this.euler.y < 1.5 * Math.PI) this.euler.y += 1/180*Math.PI;
  1718.                                 else if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "CLOSE") && this.euler.y > Math.PI) this.euler.y -= 1/180*Math.PI;
  1719.                         } else if (this._character._doorState && String(this._character._doorState.split(',')[0]).toUpperCase() == "NEGATIVE") {
  1720.                                 if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "OPEN") && this.euler.y > 0.5 * Math.PI) this.euler.y -= 1/180*Math.PI;
  1721.                                 else if ((String(this._character._doorState.split(',')[1]).toUpperCase() == "CLOSE") && this.euler.y < Math.PI) this.euler.y += 1/180*Math.PI;
  1722.                         }
  1723.                 }
  1724.         }
  1725.         this._character._screenX = this.position.x;
  1726.         this._character._screenY = this.position.y;
  1727.         this._character._screenZ = this.position.z;
  1728. };

  1729. Sprite_Character.prototype.characterPatternY = function() {
  1730.         var direction = this._character.isWallCharacter() ? 2 : this._character.isObjectCharacter() ? this._character.direction() : this._character.modifiedDirection(this._character.direction());
  1731.         return (direction - 2) / 2;
  1732. };

  1733. Sprite_Character.prototype.adjustGetDepth = function() {
  1734.         var eulerZ = $gameMap._currentH*180/Math.PI;
  1735.         if (eulerZ > 0 && eulerZ <= 90) {
  1736.                 return this.position.y / 4800 + this.position.x / 4800;
  1737.         } else if (eulerZ > 90 && eulerZ <= 180) {
  1738.                 return  - this.position.y / 4800 - this.position.x / 4800;
  1739.         } else if (eulerZ > 180 && eulerZ <= 270) {
  1740.                 return - this.position.y / 4800 - this.position.x / 4800;
  1741.         } else return 0;
  1742. };

  1743. Sprite_Character.prototype.startBalloon = function() {
  1744.     if (!this._balloonSprite) {
  1745.         this._balloonSprite = new Sprite_Balloon();
  1746.     }
  1747.     this._balloonSprite.setup(this._character.balloonId());
  1748.     this.addChild(this._balloonSprite);
  1749. };

  1750. Sprite_Character.prototype.updateBalloon = function() {
  1751.     this.setupBalloon();
  1752.     if (this._balloonSprite) {
  1753.         this._balloonSprite.y = - this.height;
  1754.         if (!this._balloonSprite.isPlaying()) {
  1755.             this.endBalloon();
  1756.         }
  1757.     }
  1758. };

  1759. Sprite_Character.prototype.endBalloon = function() {
  1760.     if (this._balloonSprite) {
  1761.         this.removeChild(this._balloonSprite);
  1762.         this._balloonSprite = null;
  1763.     }
  1764. };

  1765. ////////////////////////////////////////////////////////////////////////////////
  1766. //       Game_Character                                                       //
  1767. ////////////////////////////////////////////////////////////////////////////////

  1768. Game_CharacterBase.prototype.isWallCharacter = function() {
  1769.     return this._isWallCharacter;
  1770. };

  1771. CTR_Engine.Game_CharacterBase_setImage = Game_CharacterBase.prototype.setImage;
  1772. Game_CharacterBase.prototype.setImage = function(characterName, characterIndex) {
  1773.         CTR_Engine.Game_CharacterBase_setImage.call(this, characterName, characterIndex);
  1774.     this._isWallCharacter = ImageManager.isWallCharacter(this._characterName);
  1775. };

  1776. Game_Character.prototype.modifiedDirection = function(direction) {
  1777.         var eulerZ = $gameMap._currentH*180/Math.PI;
  1778.         if (eulerZ > 225 && eulerZ <= 315) {
  1779.                 if (direction == 2) var modifiedDirection = 6;
  1780.                 else if (direction == 4) var modifiedDirection = 2;
  1781.                 else if (direction == 6) var modifiedDirection = 8;
  1782.                 else if (direction == 8) var modifiedDirection = 4;
  1783.         } else if (eulerZ > 135 && eulerZ <= 225) {
  1784.                 if (direction == 2) var modifiedDirection  = 8;
  1785.                 else if (direction == 4) var modifiedDirection = 6;
  1786.                 else if (direction == 6) var modifiedDirection = 4;
  1787.                 else if (direction == 8) var modifiedDirection = 2;
  1788.         } else if (eulerZ > 45 && eulerZ <= 135) {
  1789.                 if (direction == 2) var modifiedDirection = 4;
  1790.                 else if (direction == 4) var modifiedDirection = 8;
  1791.                 else if (direction == 6) var modifiedDirection = 2;
  1792.                 else if (direction == 8) var modifiedDirection = 6;
  1793.         } else {
  1794.                 return direction;
  1795.         }
  1796.     return modifiedDirection;
  1797. };

  1798. ////////////////////////////////////////////////////////////////////////////////
  1799. //       Game_Player                                                          //
  1800. ////////////////////////////////////////////////////////////////////////////////

  1801. Game_Player.prototype.locate = function(x, y) {
  1802.     Game_Character.prototype.locate.call(this, x, y);
  1803.     this.makeEncounterCount();
  1804.     if (this.isInVehicle()) {
  1805.         this.vehicle().refresh();
  1806.     }
  1807.     this._followers.synchronize(x, y, this.direction());
  1808. };

  1809. Game_Player.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
  1810. };

  1811. Game_Player.prototype.moveByInput = function() {
  1812.     if (!this.isMoving() && this.canMove()) {
  1813.         var direction = this.modifiedMove(this.getInputDirection());
  1814.         if (direction > 0) {
  1815.                         $gameTemp.clearDestination();
  1816.         } else if ($gameTemp.isDestinationValid()){
  1817.             var x = $gameTemp.destinationX();
  1818.             var y = $gameTemp.destinationY();
  1819.             direction = this.findDirectionTo(x, y);
  1820.         }
  1821.                 if (direction > 0) {
  1822.             this.executeMove(direction);
  1823.         }
  1824.     }
  1825. };

  1826. Game_Player.prototype.modifiedMove = function(direction) {
  1827.         var eulerZ = $gameMap._currentH*180/Math.PI;
  1828.         if (eulerZ > 225 && eulerZ <= 315) {
  1829.                 if (direction == 2) var modifiedMove = 4;
  1830.                 else if (direction == 4) var modifiedMove = 8;
  1831.                 else if (direction == 6) var modifiedMove = 2;
  1832.                 else if (direction == 8) var modifiedMove = 6;
  1833.         } else if (eulerZ > 135 && eulerZ <= 225) {
  1834.                 if (direction == 2) var modifiedMove  = 8;
  1835.                 else if (direction == 4) var modifiedMove = 6;
  1836.                 else if (direction == 6) var modifiedMove = 4;
  1837.                 else if (direction == 8) var modifiedMove = 2;
  1838.         } else if (eulerZ > 45 && eulerZ <= 135) {
  1839.                 if (direction == 2) var modifiedMove = 6;
  1840.                 else if (direction == 4) var modifiedMove = 2;
  1841.                 else if (direction == 6) var modifiedMove = 8;
  1842.                 else if (direction == 8) var modifiedMove = 4;
  1843.         } else {
  1844.                 return direction;
  1845.         }
  1846.     return modifiedMove;
  1847. };

  1848. ////////////////////////////////////////////////////////////////////////////////
  1849. //       Scene_Map                                                            //
  1850. ////////////////////////////////////////////////////////////////////////////////

  1851. CTR_Engine.Scene_Map_start = Scene_Map.prototype.start;
  1852. Scene_Map.prototype.start = function() {
  1853.         CTR_Engine.Scene_Map_start.call(this);
  1854.         this._spriteset._tilemap.euler.z = $gameMap._currentH;
  1855.         this._spriteset._tilemap.euler.x = $gameMap._currentV;
  1856.         this._spriteset._tilemap.updateMargin();
  1857. };

  1858. Scene_Map.prototype.processMapTouch = function() {
  1859.     if (TouchInput.isTriggered() || this._touchCount > 0) {
  1860.         if (TouchInput.isPressed()) {
  1861.             if (this._touchCount === 0 || this._touchCount >= 15) {
  1862.                                 var pos = new PIXI.Point()
  1863.                                 pos.x = TouchInput.x;
  1864.                                 pos.y = TouchInput.y;
  1865.                                 var point = this._spriteset._tilemap.worldTransform.applyInverse(pos, point);
  1866.                                 var x = $gameMap.canvasToMapX(point.x);
  1867.                                 var y = $gameMap.canvasToMapY(point.y);
  1868.                 $gameTemp.setDestination(x, y);
  1869.             }
  1870.             this._touchCount++;
  1871.         } else {
  1872.             this._touchCount = 0;
  1873.         }
  1874.     }
  1875. };


  1876. ////////////////////////////////////////////////////////////////////////////////
  1877. //       Game_Map                                                             //
  1878. ////////////////////////////////////////////////////////////////////////////////

  1879. Game_Map.prototype.tileTall = function() {
  1880.         return CTR_Engine.Wall.Base.TileTall;
  1881. };

  1882. Game_Map.prototype.isPassable = function(x, y, d) {
  1883.         var tileId = SceneManager._scene._spriteset._tilemap._readMapData(x, y, 0);
  1884.         if (Tilemap.isTileA4(tileId)) return false;
  1885.         else return this.checkPassage(x, y, (1 << (d / 2 - 1)) & 0x0f);
  1886. };

  1887. CTR_Engine.Game_Map_update = Game_Map.prototype.update;
  1888. Game_Map.prototype.update = function(sceneActive) {
  1889.         CTR_Engine.Game_Map_update.call(this, sceneActive);
  1890.     this.updateCTRScroll();
  1891. };

  1892. Game_Map.prototype.roundXWithDirection = function(x, d) {
  1893.     return this.roundX(x + (d === 6 || d === 3 || d === 9 ? 1 : d === 4 || d === 1 || d === 7 ? -1 : 0));
  1894. };

  1895. Game_Map.prototype.roundYWithDirection = function(y, d) {
  1896.     return this.roundY(y + (d === 2 || d === 3 || d === 1 ? 1 : d === 8 || d === 9 || d === 7 ? -1 : 0));
  1897. };

  1898. Game_Map.prototype.updateCTRScroll = function() {
  1899.         if (!this._initialized) {
  1900.                 if (this.B.InitialState.length == 1) {
  1901.                         this._newCamera = this.B.InitialState;
  1902.                         if (Number(this._newCamera[0]) === 0) var character = $gamePlayer;
  1903.                         else if (Number(this._newCamera[0]) < 0) var character = $gamePlayer.followers()._data[Math.abs(Number(this._newCamera[0]) + 1)];
  1904.                         else if (Number(this._newCamera[0]) > 0) var character = this.event(Number(this._newCamera[0]));       
  1905.                         if (character) this.setDisplayChara(character);
  1906.                         else this.setDisplayPixelPos(0, 0);
  1907.                         this._lastCamera = this._newCamera;
  1908.                 } else {
  1909.                         this._newCamera = this.B.InitialState;
  1910.                         if (this._newCamera.length == 3) this.setDisplayPixelPos(Number(this._newCamera[0]), Number(this._newCamera[1]));
  1911.                         else if (this._newCamera.length == 2) this.setDisplayPos(Number(this._newCamera[0]), Number(this._newCamera[1]));
  1912.                         else this.setDisplayPos(0, 0);
  1913.                         this._lastCamera = this._newCamera;
  1914.                 }
  1915.                 this._moveSpeedRateB = this.B.SpeedRate;
  1916.                 this._initialized = true;
  1917.         }
  1918.         if (this._moveDisplayX != this._displayX || this._moveDisplayY != this._displayY) {
  1919.                 var rad = Math.atan2(this._moveDisplayX - this._displayX, this._moveDisplayY - this._displayY);
  1920.                 this._displayX += Math.sin(rad) * this._moveSpeedRateB;
  1921.                 this._displayY += Math.cos(rad) * this._moveSpeedRateB;
  1922.                 if (Math.abs(this._moveDisplayX - this._displayX) < this._moveSpeedRateB) this._displayX = this._moveDisplayX;
  1923.                 if (Math.abs(this._moveDisplayY - this._displayY) < this._moveSpeedRateB) this._displayY = this._moveDisplayY;
  1924.                 return;
  1925.         }
  1926.         this._moveSpeedRateB = this.B.SpeedRate;
  1927.         if (this._newCamera === this._lastCamera && this._newCamera.length == 1) {
  1928.                 if (Number(this._lastCamera[0]) === 0) var character = $gamePlayer;
  1929.                 else if (Number(this._lastCamera[0]) < 0) var character = $gamePlayer.followers()._data[Math.abs(Number(this._lastCamera[0]) + 1)];
  1930.                 else if (Number(this._lastCamera[0]) > 0) var character = this.event(Number(this._lastCamera[0]));
  1931.                 if (character) this.setDisplayChara(character);
  1932.         } else {
  1933.                 if (this._newCamera.length == 1 && Number(this._newCamera[0]) === 0) var character = $gamePlayer;
  1934.                 else if (this._newCamera.length == 1 && Number(this._newCamera[0]) < 0) var character = $gamePlayer.followers()._data[Math.abs(Number(this._newCamera[0]) + 1)];
  1935.                 else if (this._newCamera.length == 1 && Number(this._newCamera[0]) > 0) var character = this.event(Number(this._newCamera[0]));
  1936.                 if (character) this.moveDisplayChara(character);
  1937.                 else if (this._newCamera.length == 3) this.moveDisplayPixelPos(Number(this._newCamera[0]), Number(this._newCamera[1]));
  1938.                 else if (this._newCamera.length == 2) this.moveDisplayPos(Number(this._newCamera[0]), Number(this._newCamera[1]));
  1939.                 this._lastCamera = this._newCamera;
  1940.         }
  1941. };

  1942. Game_Map.prototype.setDisplayPos = function(x, y) {
  1943.         this._moveDisplayX = x - (Graphics.width / 2 + this._currentX) / this.tileWidth() + 0.5;
  1944.         this._displayX = this._moveDisplayX;
  1945.         this._parallaxX = this._moveDisplayX;
  1946.         this._moveDisplayY = y - (Graphics.height / 2 + this._currentY) / this.tileHeight() + 0.5;
  1947.         this._displayY = this._moveDisplayY;
  1948.         this._parallaxY = this._moveDisplayY;
  1949. };

  1950. Game_Map.prototype.setDisplayPixelPos = function(px, py) {
  1951.         this._moveDisplayX = (px - Graphics.width / 2 - this._currentX) / this.tileWidth();
  1952.         this._displayX = this._moveDisplayX;
  1953.         this._parallaxX = this._moveDisplayX;
  1954.         this._moveDisplayY = (py - Graphics.height / 2 - this._currentY) / this.tileHeight();
  1955.         this._displayY = this._moveDisplayY;
  1956.         this._parallaxY = this._moveDisplayY;
  1957. };

  1958. Game_Map.prototype.moveDisplayPos = function(x, y) {
  1959.         this._moveDisplayX = x - (Graphics.width / 2 + this._currentX) / this.tileWidth() + 0.5;
  1960.         this._parallaxX = this._moveDisplayX;
  1961.         this._moveDisplayY = y - (Graphics.height / 2 + this._currentY) / this.tileHeight() + 0.5;
  1962.         this._parallaxY = this._moveDisplayY;
  1963. };

  1964. Game_Map.prototype.moveDisplayPixelPos = function(px, py) {
  1965.         this._moveDisplayX = (px - Graphics.width / 2 - this._currentX) / this.tileWidth();
  1966.         this._parallaxX = this._moveDisplayX;
  1967.         this._moveDisplayY = (py - Graphics.height / 2 - this._currentY) / this.tileHeight();
  1968.         this._parallaxY = this._moveDisplayY;
  1969. };

  1970. Game_Map.prototype.setDisplayChara = function(character) {
  1971.         var x1 = this._displayX + character._screenX / this.tileWidth();
  1972.         var y1 = this._displayY + (character._screenY - 18) / this.tileHeight() + character._screenZ / this.tileTall();

  1973.         var x2 = this._displayX + (Graphics.width / 2 + this._currentX) / this.tileWidth();
  1974.         var y2 = this._displayY + (Graphics.height / 2 + this._currentY) / this.tileHeight();
  1975.         if (y1 > y2) {
  1976.                 this.setScrollDown(y1 - y2);
  1977.         }
  1978.         if (x1 < x2) {
  1979.                 this.setScrollLeft(x2 - x1);
  1980.         }
  1981.         if (x1 > x2) {
  1982.                 this.setScrollRight(x1 - x2);
  1983.         }
  1984.         if (y1 < y2) {
  1985.                 this.setScrollUp(y2 - y1);
  1986.         }
  1987. };

  1988. Game_Map.prototype.moveDisplayChara = function(character) {
  1989.         var x1 = this._displayX + character._screenX / this.tileWidth();
  1990.         var y1 = this._displayY + (character._screenY - 18) / this.tileHeight() + character._screenZ / this.tileTall();

  1991.         var x2 = this._displayX + (Graphics.width / 2 + this._currentX) / this.tileWidth();
  1992.         var y2 = this._displayY + (Graphics.height / 2 + this._currentY) / this.tileHeight();
  1993.         if (y1 > y2) {
  1994.                 this.scrollDown(y1 - y2);
  1995.         }
  1996.         if (x1 < x2) {
  1997.                 this.scrollLeft(x2 - x1);
  1998.         }
  1999.         if (x1 > x2) {
  2000.                 this.scrollRight(x1 - x2);
  2001.         }
  2002.         if (y1 < y2) {
  2003.                 this.scrollUp(y2 - y1);
  2004.         }
  2005. };

  2006. Game_Map.prototype.setScrollDown = function(distance) {
  2007.     if (this.isLoopVertical()) {
  2008.         this._displayY += distance;
  2009.         this._moveDisplayY = this._displayY;
  2010.         this._displayY %= $dataMap.height;
  2011.         if (this._parallaxLoopY) {
  2012.             this._parallaxY += distance;
  2013.         }
  2014.     } else {
  2015.         var lastY = this._displayY;
  2016.         this._displayY += distance;
  2017.         this._moveDisplayY = this._displayY;
  2018.         this._parallaxY += this._displayY - lastY;
  2019.     }
  2020. };

  2021. Game_Map.prototype.setScrollLeft = function(distance) {
  2022.     if (this.isLoopHorizontal()) {
  2023.         this._displayX += $dataMap.width - distance;
  2024.         this._moveDisplayX = this._displayX;
  2025.         this._displayX %= $dataMap.width;
  2026.         if (this._parallaxLoopX) {
  2027.             this._parallaxX -= distance;
  2028.         }
  2029.     } else {
  2030.         var lastX = this._displayX;
  2031.         this._displayX -= distance;
  2032.         this._moveDisplayX = this._displayX;
  2033.         this._parallaxX += this._displayX - lastX;
  2034.     }
  2035. };

  2036. Game_Map.prototype.setScrollRight = function(distance) {
  2037.     if (this.isLoopHorizontal()) {
  2038.         this._displayX += distance;
  2039.         this._moveDisplayX = this._displayX;
  2040.         this._displayX %= $dataMap.width;
  2041.         if (this._parallaxLoopX) {
  2042.             this._parallaxX += distance;
  2043.         }
  2044.     } else {
  2045.         var lastX = this._displayX;
  2046.         this._displayX += distance;
  2047.         this._moveDisplayX = this._displayX;
  2048.         this._parallaxX += this._displayX - lastX;
  2049.     }
  2050. };

  2051. Game_Map.prototype.setScrollUp = function(distance) {
  2052.     if (this.isLoopVertical()) {
  2053.         this._displayY += $dataMap.height - distance;
  2054.         this._moveDisplayY = this._displayY;
  2055.         this._displayY %= $dataMap.height;
  2056.         if (this._parallaxLoopY) {
  2057.             this._parallaxY -= distance;
  2058.         }
  2059.     } else {
  2060.         var lastY = this._displayY;
  2061.         this._displayY -= distance;
  2062.         this._moveDisplayY = this._displayY;
  2063.         this._parallaxY += this._displayY - lastY;
  2064.     }
  2065. };

  2066. Game_Map.prototype.scrollDown = function(distance) {
  2067.     if (this.isLoopVertical()) {
  2068.         this._moveDisplayY += distance;
  2069.         this._moveDisplayY %= $dataMap.height;
  2070.         if (this._parallaxLoopY) {
  2071.             this._parallaxY += distance;
  2072.         }
  2073.     } else {
  2074.         var lastY = this._moveDisplayY;
  2075.         this._moveDisplayY += distance;
  2076.         this._parallaxY += this._moveDisplayY - lastY;
  2077.     }
  2078. };

  2079. Game_Map.prototype.scrollLeft = function(distance) {
  2080.     if (this.isLoopHorizontal()) {
  2081.         this._moveDisplayX += $dataMap.width - distance;
  2082.         this._moveDisplayX %= $dataMap.width;
  2083.         if (this._parallaxLoopX) {
  2084.             this._parallaxX -= distance;
  2085.         }
  2086.     } else {
  2087.         var lastX = this._moveDisplayX;
  2088.         this._moveDisplayX -= distance;
  2089.         this._parallaxX += this._moveDisplayX - lastX;
  2090.     }
  2091. };

  2092. Game_Map.prototype.scrollRight = function(distance) {
  2093.     if (this.isLoopHorizontal()) {
  2094.         this._moveDisplayX += distance;
  2095.         this._moveDisplayX %= $dataMap.width;
  2096.         if (this._parallaxLoopX) {
  2097.             this._parallaxX += distance;
  2098.         }
  2099.     } else {
  2100.         var lastX = this._moveDisplayX;
  2101.         this._moveDisplayX += distance
  2102.         this._parallaxX += this._moveDisplayX - lastX;
  2103.     }
  2104. };

  2105. Game_Map.prototype.scrollUp = function(distance) {
  2106.     if (this.isLoopVertical()) {
  2107.         this._moveDisplayY += $dataMap.height - distance;
  2108.         this._moveDisplayY %= $dataMap.height;
  2109.         if (this._parallaxLoopY) {
  2110.             this._parallaxY -= distance;
  2111.         }
  2112.     } else {
  2113.         var lastY = this._moveDisplayY;
  2114.         this._moveDisplayY -= distance;
  2115.         this._parallaxY += this._moveDisplayY - lastY;
  2116.     }
  2117. };

  2118. CTR_Engine.Game_Map_initialize = Game_Map.prototype.initialize;
  2119. Game_Map.prototype.initialize = function() {
  2120.         CTR_Engine.Game_Map_initialize.call(this);
  2121.         if (this._initializedValue) return;

  2122. this.B = this.B || {};
  2123.         this.B.InitialState = PluginManager.parameters('Jogo_CTR_Engine')["Initial State B"].toLowerCase().split(',');
  2124.         this.B.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate B"]);


  2125. this.H = this.H || {};
  2126.         this.H.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State H"])/180*Math.PI;
  2127.         this.H.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN H"])/180*Math.PI;
  2128.         this.H.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX H"])/180*Math.PI;
  2129.         this.H.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input H"]);
  2130.         this.H.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input H"].toLowerCase().split(',');
  2131.         this.H.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input H"].toLowerCase().split(',');
  2132.         this.H.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move H"])/180*Math.PI;
  2133.         this.H.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate H"]);
  2134.         this.H.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput H"]);
  2135.                
  2136. this.V = this.V || {};
  2137.         this.V.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State V"])/180*Math.PI;
  2138.         this.V.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN V"])/180*Math.PI;
  2139.         this.V.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX V"])/180*Math.PI;
  2140.         this.V.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input V"]);
  2141.         this.V.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input V"].toLowerCase().split(',');
  2142.         this.V.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input V"].toLowerCase().split(',');
  2143.         this.V.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move V"])/180*Math.PI;
  2144.         this.V.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate V"]);
  2145.         this.V.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput V"]);

  2146. this.S = this.S || {};
  2147.         this.S.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State S"]);
  2148.         this.S.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN S"]);
  2149.         this.S.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX S"]);
  2150.         this.S.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input S"]);
  2151.         this.S.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input S"].toLowerCase().split(',');
  2152.         this.S.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input S"].toLowerCase().split(',');
  2153.         this.S.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move S"]);
  2154.         this.S.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate S"]);
  2155.         this.S.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput S"]);

  2156. this.X = this.X || {};
  2157.         this.X.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State X"]);
  2158.         this.X.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN X"]);
  2159.         this.X.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX X"]);
  2160.         this.X.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input X"]);
  2161.         this.X.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input X"].toLowerCase().split(',');
  2162.         this.X.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input X"].toLowerCase().split(',');
  2163.         this.X.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move X"]);
  2164.         this.X.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate X"]);
  2165.         this.X.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput X"]);
  2166.        
  2167. this.Y = this.Y || {};
  2168.         this.Y.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State Y"]);
  2169.         this.Y.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN Y"]);
  2170.         this.Y.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX Y"]);
  2171.         this.Y.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input Y"]);
  2172.         this.Y.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input Y"].toLowerCase().split(',');
  2173.         this.Y.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input Y"].toLowerCase().split(',');
  2174.         this.Y.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move Y"]);
  2175.         this.Y.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate Y"]);
  2176.         this.Y.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput Y"]);

  2177. this.Z = this.Z || {};
  2178.         this.Z.InitialState = Number(PluginManager.parameters('Jogo_CTR_Engine')["Initial State Z"]);
  2179.         this.Z.MIN = Number(PluginManager.parameters('Jogo_CTR_Engine')["MIN Z"]);
  2180.         this.Z.MAX = Number(PluginManager.parameters('Jogo_CTR_Engine')["MAX Z"]);
  2181.         this.Z.DisableInput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Disable Input Z"]);
  2182.         this.Z.PositiveInput = PluginManager.parameters('Jogo_CTR_Engine')["Positive Input Z"].toLowerCase().split(',');
  2183.         this.Z.NegativeInput = PluginManager.parameters('Jogo_CTR_Engine')["Negative Input Z"].toLowerCase().split(',');
  2184.         this.Z.InputMove = Number(PluginManager.parameters('Jogo_CTR_Engine')["Input Move Z"]);
  2185.         this.Z.SpeedRate = Number(PluginManager.parameters('Jogo_CTR_Engine')["Speed Rate Z"]);
  2186.         this.Z.ResetUninput = eval(PluginManager.parameters('Jogo_CTR_Engine')["Reset Uninput Z"]);

  2187.         this._initializedValue = true;
  2188. };


  2189. ////////////////////////////////////////////////////////////////////////////////
  2190. //       ImageManager                                                         //
  2191. ////////////////////////////////////////////////////////////////////////////////

  2192. ImageManager.isWallCharacter = function(filename) {
  2193.     var sign = filename.match(/^[\!\$\+]+/);
  2194.     return sign && sign[0].contains('+');
  2195. };


  2196. ////////////////////////////////////////////////////////////////////////////////
  2197. //       ShaderTilemap                                                        //
  2198. ////////////////////////////////////////////////////////////////////////////////

  2199. ShaderTilemap.prototype._paintAllTiles = function(startX, startY) {
  2200.     this.lowerZLayer.clear();
  2201.     this.upperZLayer.clear();
  2202.         var eulerZ = Math.cos($gameMap._currentH*180/Math.PI/360/10);
  2203.         var childs = this.children;
  2204.     for (var i = childs.length-1; i >= 0; i--) {
  2205.         if (childs[i].isFloor || childs[i].isWall) {
  2206.             if (childs[i]._restart) { delete childs[i].children; this.removeChild(childs[i]); }
  2207.                         else {
  2208.                                 childs[i]._restart = true
  2209.                                 if (childs[i].isFloor) childs[i].z += eulerZ;
  2210.                                 else childs[i].z += eulerZ;
  2211.                         }
  2212.         } else if (childs[i].position3d && childs[i]._character) childs[i].z += eulerZ;
  2213.     }
  2214.     var tileCols = Math.ceil(this._width / this._tileWidth) + 1;
  2215.     var tileRows = Math.ceil(this._height / this._tileHeight) + 1;
  2216.     for (var y = 0; y < tileRows; y++) {
  2217.         for (var x = 0; x < tileCols; x++) {
  2218.             this._paintTiles(startX, startY, x, y);
  2219.         }
  2220.     }
  2221. };

  2222. ShaderTilemap.prototype._drawAutotile = function(layer, tileId, dx, dy) {
  2223.     var autotileTable = Tilemap.FLOOR_AUTOTILE_TABLE;
  2224.     var kind = Tilemap.getAutotileKind(tileId);
  2225.     var shape = Tilemap.getAutotileShape(tileId);
  2226.     var tx = kind % 8;
  2227.     var ty = Math.floor(kind / 8);
  2228.     var bx = 0;
  2229.     var by = 0;
  2230.     var setNumber = 0;
  2231.     var isTable = false;
  2232.     var animX = 0, animY = 0;

  2233.     if (Tilemap.isTileA1(tileId)) {
  2234.         setNumber = 0;
  2235.         if (kind === 0) {
  2236.             animX = 2;
  2237.             by = 0;
  2238.         } else if (kind === 1) {
  2239.             animX = 2;
  2240.             by = 3;
  2241.         } else if (kind === 2) {
  2242.             bx = 6;
  2243.             by = 0;
  2244.         } else if (kind === 3) {
  2245.             bx = 6;
  2246.             by = 3;
  2247.         } else {
  2248.             bx = Math.floor(tx / 4) * 8;
  2249.             by = ty * 6 + Math.floor(tx / 2) % 2 * 3;
  2250.             if (kind % 2 === 0) {
  2251.                 animX = 2;
  2252.             }
  2253.             else {
  2254.                 bx += 6;
  2255.                 autotileTable = Tilemap.WATERFALL_AUTOTILE_TABLE;
  2256.                 animY = 1;
  2257.             }
  2258.         }
  2259.     } else if (Tilemap.isTileA2(tileId)) {
  2260.         setNumber = 1;
  2261.         bx = tx * 2;
  2262.         by = (ty - 2) * 3;
  2263.         isTable = this._isTableTile(tileId);
  2264.     } else if (Tilemap.isTileA3(tileId)) {
  2265.         setNumber = 2;
  2266.         bx = tx * 2;
  2267.         by = (ty - 6) * 2;
  2268.         autotileTable = Tilemap.WALL_AUTOTILE_TABLE;
  2269.     } else if (Tilemap.isTileA4(tileId)) {
  2270.                 if (ty % 2 !== 1) return this.drawWall(tileId, autotileTable, dx, dy, tx, ty);
  2271.                 setNumber = 3;
  2272.         bx = tx * 2;
  2273.         by = Math.floor((ty - 10) * 2.5 + (ty % 2 === 1 ? 0.5 : 0));
  2274.         autotileTable = Tilemap.WALL_AUTOTILE_TABLE;
  2275.     }

  2276.     var table = autotileTable[shape];
  2277.     var w1 = this._tileWidth / 2;
  2278.     var h1 = this._tileHeight / 2;
  2279.     for (var i = 0; i < 4; i++) {
  2280.         var qsx = table[i][0];
  2281.         var qsy = table[i][1];
  2282.         var sx1 = (bx * 2 + qsx) * w1;
  2283.         var sy1 = (by * 2 + qsy) * h1;
  2284.         var dx1 = dx + (i % 2) * w1;
  2285.         var dy1 = dy + Math.floor(i / 2) * h1;
  2286.         if (isTable && (qsy === 1 || qsy === 5)) {
  2287.             var qsx2 = qsx;
  2288.             var qsy2 = 3;
  2289.             if (qsy === 1) {
  2290.                 //qsx2 = [0, 3, 2, 1][qsx];
  2291.                 qsx2 = (4-qsx)%4;
  2292.             }
  2293.             var sx2 = (bx * 2 + qsx2) * w1;
  2294.             var sy2 = (by * 2 + qsy2) * h1;
  2295.             layer.addRect(setNumber, sx2, sy2, dx1, dy1, w1, h1, animX, animY);
  2296.             layer.addRect(setNumber, sx1, sy1, dx1, dy1+h1/2, w1, h1/2, animX, animY);
  2297.         } else {
  2298.             layer.addRect(setNumber, sx1, sy1, dx1, dy1, w1, h1, animX, animY);
  2299.         }
  2300.     }
  2301. };

  2302. ShaderTilemap.prototype.drawWall = function(tileId, autotileTable, dx, dy, tx, ty) {
  2303.         var setNumber = 3;
  2304.         var tileset = $gameMap.tileset();
  2305.     if (tileset) var tilesetNames = tileset.tilesetNames;
  2306.     if (this.roundPixels) {
  2307.         var ox = Math.floor(this.origin.x);
  2308.         var oy = Math.floor(this.origin.y);
  2309.     } else {
  2310.         ox = this.origin.x;
  2311.         oy = this.origin.y;
  2312.     }
  2313.     var startX = Math.floor((ox - this._margin) / this._tileWidth);
  2314.     var startY = Math.floor((oy - this._margin) / this._tileHeight);
  2315.         var w1 = this._tileWidth / 2;
  2316.     var h1 = this._tileHeight / 2;

  2317.         var flags = $gameMap.tilesetFlags();
  2318.     var tag = flags[tileId] >> 12;
  2319.         if (!tag) var tag = 1;
  2320.         else tag += 1;

  2321.     var shape = Tilemap.getAutotileShape(tileId);
  2322.     var bx = tx * 2;
  2323.     var by = Math.floor((ty - 10) * 2.5 + (ty % 2 === 1 ? 0.5 : 0));
  2324.     var table = autotileTable[shape];

  2325.     var containerFloor = new WallAndFloorContainer(dx + startX * this._tileWidth, dy + startY * this._tileHeight, true);
  2326.     containerFloor.convertTo3d();
  2327.     containerFloor.position3d.set(w1, h1, tag*$gameMap.tileTall());
  2328.     containerFloor.pivot3d.set(w1, h1, 0);
  2329.         containerFloor.x = containerFloor.dx - ox;
  2330.         containerFloor.y = containerFloor.dy - oy;
  2331.     containerFloor.z = containerFloor.containerGetDepth();
  2332.     containerFloor.isFloor = true;
  2333.     this.addChild(containerFloor);
  2334.     for (var i = 0; i < 4; i++) {
  2335.         var qsx = table[i][0];
  2336.         var qsy = table[i][1];
  2337.         var sx1 = (bx * 2 + qsx) * w1;
  2338.         var sy1 = (by * 2 + qsy) * h1;
  2339.         var dx1 = (i % 2) * w1;
  2340.         var dy1 = Math.floor(i / 2) * h1;
  2341.                
  2342.                         var floor = new Sprite();
  2343.                         floor.bitmap = ImageManager.loadTileset(tilesetNames[setNumber]);
  2344.                         floor.x = dx1;
  2345.                         floor.y = dy1;
  2346.             floor.setFrame(sx1, sy1, w1, h1);
  2347.                         containerFloor.addChild(floor)
  2348.     }

  2349.         if ($gameMap._eulerX == 0) return;

  2350.     autotileTable = Tilemap.WALL_AUTOTILE_TABLE;

  2351.         var floorId = Math.trunc((tileId - Tilemap.TILE_ID_A4) / 48) * 48 + Tilemap.TILE_ID_A4;
  2352.         var wallId = floorId + 8 * 48;
  2353.     var currentFloor = tileId - floorId;

  2354.         var eulerZ = $gameMap._currentH*180/Math.PI;

  2355.         for (var j = 0; j < 4; j++) {
  2356.                 if (j == 0 && (eulerZ >= 90 && eulerZ <= 270)) continue;
  2357.                 else if (j == 1 && (eulerZ >= 180 && eulerZ <= 360)) continue;
  2358.                 else if (j == 2 && ((eulerZ >= 270 && eulerZ <= 360) || (eulerZ >= 0 && eulerZ <= 90))) continue;
  2359.                 else if (j == 3 && (eulerZ >= 0 && eulerZ <= 180)) continue;
  2360.                 var containerWall = new WallAndFloorContainer(dx + startX * this._tileWidth, dy + startY * this._tileHeight);
  2361.                 containerWall.convertTo3d();
  2362.                 containerWall.position3d.set((j == 1 || j == 2) ? this._tileWidth : 0, (j <= 1) ? this._tileHeight : 0, 0);
  2363.                 containerWall.euler.y = j / 2 * Math.PI;
  2364.                 containerWall.euler.x = 1.5 * Math.PI;
  2365.                 containerWall.x = containerWall.dx - ox;
  2366.                 containerWall.y = containerWall.dy - oy;       
  2367.                 containerWall.z = containerWall.containerGetDepth();
  2368.                 containerWall.isWall = true;
  2369.                 this.addChild(containerWall);
  2370.                 var thisWall = false;
  2371.                 for (var high = 1; high <= tag; high++) {
  2372.                         if (j == 0) {
  2373.                                 if (currentFloor == 46 || currentFloor == 44) { var thisWall = wallId; thisWall += (tag == 1) ? 15 : (high == 1) ? 13 : (high == tag) ? 7 : 5; }
  2374.                                 else if (currentFloor == 43 || currentFloor == 41 || currentFloor == 40) { var thisWall = wallId; thisWall += (tag == 1) ? 11 : (high == 1) ? 9 : (high == tag) ? 3 : 1; }
  2375.                                 else if (currentFloor == 45 || currentFloor == 39 || currentFloor == 38) { var thisWall = wallId; thisWall += (tag == 1) ? 14 : (high == 1) ? 12 : (high == tag) ? 6 : 4; }
  2376.                                 else if (currentFloor == 33 || currentFloor == 31 || currentFloor == 28) { var thisWall = wallId; thisWall += (tag == 1) ? 10 : (high == 1) ? 8 : (high == tag) ? 2 : 0; }
  2377.                         } else if (j == 1) {
  2378.                                 if (currentFloor == 46 || currentFloor == 45) { var thisWall = wallId; thisWall += (tag == 1) ? 15 : (high == 1) ? 13 : (high == tag) ? 7 : 5; }
  2379.                                 else if (currentFloor == 44 || currentFloor == 39 || currentFloor == 38) { var thisWall = wallId; thisWall += (tag == 1) ? 11 : (high == 1) ? 9 : (high == tag) ? 3 : 1; }
  2380.                                 else if (currentFloor == 42 || currentFloor == 37 || currentFloor == 36) { var thisWall = wallId; thisWall += (tag == 1) ? 14 : (high == 1) ? 12 : (high == tag) ? 6 : 4; }
  2381.                                 else if (currentFloor == 32 || currentFloor == 27 || currentFloor == 24) { var thisWall = wallId; thisWall += (tag == 1) ? 10 : (high == 1) ? 8 : (high == tag) ? 2 : 0; }
  2382.                         } else if (j == 2) {
  2383.                                 if (currentFloor == 46 || currentFloor == 42) { var thisWall = wallId; thisWall += (tag == 1) ? 15 : (high == 1) ? 13 : (high == tag) ? 7 : 5; }
  2384.                                 else if (currentFloor == 45 || currentFloor == 37 || currentFloor == 36) { var thisWall = wallId; thisWall += (tag == 1) ? 11 : (high == 1) ? 9 : (high == tag) ? 3 : 1; }
  2385.                                 else if (currentFloor == 43 || currentFloor == 35 || currentFloor == 34) { var thisWall = wallId; thisWall += (tag == 1) ? 14 : (high == 1) ? 12 : (high == tag) ? 6 : 4; }
  2386.                                 else if (currentFloor == 33 || currentFloor == 23 || currentFloor == 20) { var thisWall = wallId; thisWall += (tag == 1) ? 10 : (high == 1) ? 8 : (high == tag) ? 2 : 0; }
  2387.                         } else if (j == 3) {
  2388.                                 if (currentFloor == 46 || currentFloor == 43) { var thisWall = wallId; thisWall += (tag == 1) ? 15 : (high == 1) ? 13 : (high == tag) ? 7 : 5; }
  2389.                                 else if (currentFloor == 42 || currentFloor == 35 || currentFloor == 34) { var thisWall = wallId; thisWall += (tag == 1) ? 11 : (high == 1) ? 9 : (high == tag) ? 3 : 1; }
  2390.                                 else if (currentFloor == 44 || currentFloor == 41 || currentFloor == 40) { var thisWall = wallId; thisWall += (tag == 1) ? 14 : (high == 1) ? 12 : (high == tag) ? 6 : 4; }
  2391.                                 else if (currentFloor == 32 || currentFloor == 19 || currentFloor == 16) { var thisWall = wallId; thisWall += (tag == 1) ? 10 : (high == 1) ? 8 : (high == tag) ? 2 : 0; }
  2392.                         }
  2393.                         if (!thisWall) continue;
  2394.                         kind = Tilemap.getAutotileKind(thisWall);
  2395.                         shape = Tilemap.getAutotileShape(thisWall);
  2396.                         tx = kind % 8;
  2397.                         ty = Math.floor(kind / 8);
  2398.                         bx = tx * 2;
  2399.                         by = Math.floor((ty - 10) * 2.5 + (ty % 2 === 1 ? 0.5 : 0));
  2400.                         table = autotileTable[shape];
  2401.                         for (var i = 0; i < 4; i++) {
  2402.                                 var qsx = table[i][0];
  2403.                                 var qsy = table[i][1];
  2404.                                 var sx1 = (bx * 2 + qsx) * w1;
  2405.                                 var sy1 = (by * 2 + qsy) * h1;
  2406.                                 var dx1 = (i % 2) * w1;
  2407.                                 var dy1 = Math.floor(i / 2) * h1;
  2408.             
  2409.                                 var wall = new Sprite();
  2410.                                 wall.bitmap = ImageManager.loadTileset(tilesetNames[setNumber]);
  2411.                                 wall.x = dx1;
  2412.                                 wall.y = dy1 - high*$gameMap.tileTall();
  2413.                                 wall.setFrame(sx1, sy1, w1, h1);
  2414.                                 containerWall.addChild(wall)
  2415.                         }
  2416.                 }
  2417.         }
  2418. };


  2419. ////////////////////////////////////////////////////////////////////////////////
  2420. //       WallAndFloorContainer                                                //
  2421. ////////////////////////////////////////////////////////////////////////////////

  2422. function WallAndFloorContainer() {
  2423.     this.initialize.apply(this, arguments);
  2424. }

  2425. WallAndFloorContainer.prototype = Object.create(PIXI.Container.prototype);
  2426. WallAndFloorContainer.prototype.constructor = WallAndFloorContainer;

  2427. WallAndFloorContainer.prototype.initialize = function(dx, dy, isFloor) {
  2428.         this.dx = dx;
  2429.         this.dy = dy;
  2430.         this.isFloor = isFloor;
  2431.     PIXI.Container.call(this);
  2432. };

  2433. WallAndFloorContainer.prototype.update = function() {
  2434.         this.updateTransform();
  2435. };

  2436. WallAndFloorContainer.prototype.updateTransform = function() {
  2437.         if (!SceneManager._scene._spriteset) return;
  2438.         if (SceneManager._scene._spriteset._tilemap.roundPixels) {
  2439.                 var ox = Math.floor(SceneManager._scene._spriteset._tilemap.origin.x);
  2440.                 var oy = Math.floor(SceneManager._scene._spriteset._tilemap.origin.y);
  2441.         } else {
  2442.                 ox = SceneManager._scene._spriteset._tilemap.origin.x;
  2443.                 oy = SceneManager._scene._spriteset._tilemap.origin.y;
  2444.         }
  2445.         this.x = this.dx - ox;
  2446.         this.y = this.dy - oy;       
  2447.         this.z = this.containerGetDepth(this.isFloor);
  2448.     PIXI.Container.prototype.updateTransform.call(this);
  2449. };

  2450. WallAndFloorContainer.prototype.containerGetDepth = function(isFloor) {
  2451.         var eulerZ = $gameMap._currentH*180/Math.PI;
  2452.         if (eulerZ > 0 && eulerZ <= 90) {
  2453.                 if (isFloor) return 3 - this.position3d.z / 4800 + this.getDepth() / 1000 + this.position.y / 4800 + this.position.x / 4800;
  2454.                 else return 3 + this.getDepth() / 1000 + this.position.y / 4800 + this.position.x / 4800;
  2455.         } else if (eulerZ > 90 && eulerZ <= 180) {
  2456.                 if (isFloor) return 3 - this.position3d.z / 2400 + this.getDepth() / 1000 - this.position.y / 4800 - this.position.x / 4800;
  2457.                 else return 3 + this.getDepth() / 1000 - this.position.y / 4800 - this.position.x / 4800;
  2458.         } else if (eulerZ > 180 && eulerZ <= 270) {
  2459.                 if (isFloor) return 3 - this.position3d.z / 1800 + this.getDepth() / 1000 - this.position.y / 4800 - this.position.x / 4800;
  2460.                 else return 3 + this.getDepth() / 1000 - this.position.y / 4800 - this.position.x / 4800;
  2461.         } else {
  2462.                 if (isFloor) return 3 - this.position3d.z / 2400 + this.getDepth() / 1000;
  2463.                 else return 3 + this.getDepth() / 1000;
  2464.         }
  2465. };

  2466. ////////////////////////////////////////////////////////////////////////////////
  2467. //       Galv_DiagonalMovement                                                //
  2468. ////////////////////////////////////////////////////////////////////////////////

  2469. if (Imported.Galv_DiagonalMovement) {
  2470.        
  2471.         if (eval(PluginManager.parameters('Jogo_CTR_Engine')["Diagonal Graphics"])) {
  2472.                 Sprite_Character.prototype.characterPatternY = function() {
  2473.                         var direction = this._character.isWallCharacter() ? 2 : this._character.modifiedDirection(this._character.direction());
  2474.                         if (this._character.isDiag(direction)) return Galv.DM.diagRow[direction];
  2475.                         else return (direction - 2) / 2;
  2476.                 };

  2477.                 CTR_Engine.Sprite_Character_characterBlockX = Sprite_Character.prototype.characterBlockX;
  2478.                 Sprite_Character.prototype.characterBlockX = function() {
  2479.                         var direction = this._character.isWallCharacter() ? this._character.direction() : this._character.modifiedDirection(this._character.direction());
  2480.                         if (!this._isBigCharacter && this._character.isDiag(direction) && this._character.characterIndex() < 4) {
  2481.                                 var index = this._character.characterIndex() + 4;
  2482.                                 return index % 4 * 3;
  2483.                         } else {       
  2484.                                 return CTR_Engine.Sprite_Character_characterBlockX.call(this);
  2485.                         };
  2486.                 };

  2487.                 CTR_Engine.Sprite_Character_characterBlockY = Sprite_Character.prototype.characterBlockY;
  2488.                 Sprite_Character.prototype.characterBlockY = function() {
  2489.                         var direction = this._character.isWallCharacter() ? this._character.direction() : this._character.modifiedDirection(this._character.direction());
  2490.                         if (!this._isBigCharacter && this._character.isDiag(direction) && this._character.characterIndex() < 4) {
  2491.                                 var index = this._character.characterIndex() + 4;
  2492.                                 return Math.floor(index / 4) * 4;
  2493.                         } else {       
  2494.                                 return CTR_Engine.Sprite_Character_characterBlockY.call(this);
  2495.                         };
  2496.                 };

  2497.                 Game_Character.prototype.isDiag = function(direction) {
  2498.                         if (direction == 1 || direction == 3 || direction == 7 || direction == 9) return true;
  2499.                         else return false;
  2500.                 };

  2501.                 Game_Character.prototype.modifiedDirection = function(direction) {
  2502.                         var eulerZ = $gameMap._currentH*180/Math.PI;
  2503.                         if (eulerZ > 292.5 && eulerZ <= 337.5) {
  2504.                                 if (direction == 1) var modifiedDirection = 2;
  2505.                                 else if (direction == 2) var modifiedDirection = 3;
  2506.                                 else if (direction == 3) var modifiedDirection = 6;
  2507.                                 else if (direction == 4) var modifiedDirection = 1;
  2508.                                 else if (direction == 6) var modifiedDirection = 9;
  2509.                                 else if (direction == 7) var modifiedDirection = 4;
  2510.                                 else if (direction == 8) var modifiedDirection = 7;
  2511.                                 else if (direction == 9) var modifiedDirection = 8;
  2512.                         } else if (eulerZ > 247.5 && eulerZ <= 292.5) {
  2513.                                 if (direction == 1) var modifiedDirection = 3;
  2514.                                 else if (direction == 2) var modifiedDirection = 6;
  2515.                                 else if (direction == 3) var modifiedDirection = 9;
  2516.                                 else if (direction == 4) var modifiedDirection = 2;
  2517.                                 else if (direction == 6) var modifiedDirection = 8;
  2518.                                 else if (direction == 7) var modifiedDirection = 1;
  2519.                                 else if (direction == 8) var modifiedDirection = 4;
  2520.                                 else if (direction == 9) var modifiedDirection = 7;
  2521.                         } else if (eulerZ > 202.5 && eulerZ <= 247.5) {
  2522.                                 if (direction == 1) var modifiedDirection = 6;
  2523.                                 else if (direction == 2) var modifiedDirection = 9;
  2524.                                 else if (direction == 3) var modifiedDirection = 8;
  2525.                                 else if (direction == 4) var modifiedDirection = 3;
  2526.                                 else if (direction == 6) var modifiedDirection = 7;
  2527.                                 else if (direction == 7) var modifiedDirection = 2;
  2528.                                 else if (direction == 8) var modifiedDirection = 1;
  2529.                                 else if (direction == 9) var modifiedDirection = 4;
  2530.                         } else if (eulerZ > 157.5 && eulerZ <= 202.5) {
  2531.                                 if (direction == 1) var modifiedDirection = 9;
  2532.                                 else if (direction == 2) var modifiedDirection = 8;
  2533.                                 else if (direction == 3) var modifiedDirection = 7;
  2534.                                 else if (direction == 4) var modifiedDirection = 6;
  2535.                                 else if (direction == 6) var modifiedDirection = 4;
  2536.                                 else if (direction == 7) var modifiedDirection = 3;
  2537.                                 else if (direction == 8) var modifiedDirection = 2;
  2538.                                 else if (direction == 9) var modifiedDirection = 1;
  2539.                         } else if (eulerZ > 112.5 && eulerZ <= 157.5) {
  2540.                                 if (direction == 1) var modifiedDirection = 8;
  2541.                                 else if (direction == 2) var modifiedDirection = 7;
  2542.                                 else if (direction == 3) var modifiedDirection = 4;
  2543.                                 else if (direction == 4) var modifiedDirection = 9;
  2544.                                 else if (direction == 6) var modifiedDirection = 1;
  2545.                                 else if (direction == 7) var modifiedDirection = 6;
  2546.                                 else if (direction == 8) var modifiedDirection = 3;
  2547.                                 else if (direction == 9) var modifiedDirection = 2;
  2548.                         } else if (eulerZ > 67.5 && eulerZ <= 112.5) {
  2549.                                 if (direction == 1) var modifiedDirection = 7;
  2550.                                 else if (direction == 2) var modifiedDirection = 4;
  2551.                                 else if (direction == 3) var modifiedDirection = 1;
  2552.                                 else if (direction == 4) var modifiedDirection = 8;
  2553.                                 else if (direction == 6) var modifiedDirection = 2;
  2554.                                 else if (direction == 7) var modifiedDirection = 9;
  2555.                                 else if (direction == 8) var modifiedDirection = 6;
  2556.                                 else if (direction == 9) var modifiedDirection = 3;
  2557.                         } else if (eulerZ > 22.5 && eulerZ <= 67.5) {
  2558.                                 if (direction == 1) var modifiedDirection = 4;
  2559.                                 else if (direction == 2) var modifiedDirection = 1;
  2560.                                 else if (direction == 3) var modifiedDirection = 2;
  2561.                                 else if (direction == 4) var modifiedDirection = 7;
  2562.                                 else if (direction == 6) var modifiedDirection = 3;
  2563.                                 else if (direction == 7) var modifiedDirection = 8;
  2564.                                 else if (direction == 8) var modifiedDirection = 9;
  2565.                                 else if (direction == 9) var modifiedDirection = 6;
  2566.                         } else {
  2567.                                 return direction;
  2568.                         }
  2569.                         return modifiedDirection;
  2570.                 };
  2571.         };

  2572.         Game_CharacterBase.prototype.getDir = function(horz,vert) {
  2573.                 if (horz == 4 && vert == 2) return 2;
  2574.                 if (horz == 6 && vert == 2) return 4;
  2575.                 if (horz == 4 && vert == 8) return 6;
  2576.                 if (horz == 6 && vert == 8) return 8;
  2577.                 return 0;
  2578.         };

  2579.         Game_CharacterBase.prototype.moveDiagonally = function(horz, vert) {
  2580.                 var diag = this.canPassDiagonally(this._x, this._y, horz, vert);
  2581.                 var norm = this.canPass(this._x, this._y, horz) || this.canPass(this._x, this._y, vert);
  2582.                 if (eval(PluginManager.parameters('Jogo_CTR_Engine')["Diagonal Graphics"])) var direction = Galv.DM.getDir(horz,vert);
  2583.                 else var direction = this.getDir(horz,vert);
  2584.                 this.setDirection(direction);
  2585.                 if (diag) {
  2586.                         //this.setDirection(Galv.DM.getDir(horz,vert));
  2587.                         this._x = $gameMap.roundXWithDirection(this._x, horz);
  2588.                         this._y = $gameMap.roundYWithDirection(this._y, vert);
  2589.                         this._realX = $gameMap.xWithDirection(this._x, this.reverseDir(horz));
  2590.                         this._realY = $gameMap.yWithDirection(this._y, this.reverseDir(vert));
  2591.                         this.increaseSteps();
  2592.                 } else /*if (norm) */{
  2593.                         this._diagDir = false;
  2594.                         //this.moveStraight(this.getOtherdir(horz,vert));
  2595.                         this.checkEventTriggerTouchFront(direction);
  2596.                 };

  2597.                 this._diagStraigten = false;
  2598.                 if (this._direction === this.reverseDir(horz)) this.setDirection(horz);
  2599.                 if (this._direction === this.reverseDir(vert)) this.setDirection(vert);
  2600.                 this._diagStraigten = true;
  2601.         };

  2602.         Game_Player.prototype.modifiedMove = function(direction) {
  2603.                 var eulerZ = $gameMap._currentH*180/Math.PI;
  2604.                 if (eulerZ > 292.5 && eulerZ <= 337.5) {
  2605.                         if (direction == 1) var modifiedMove = 4;
  2606.                         else if (direction == 2) var modifiedMove = 1;
  2607.                         else if (direction == 3) var modifiedMove = 2;
  2608.                         else if (direction == 4) var modifiedMove = 7;
  2609.                         else if (direction == 6) var modifiedMove = 3;
  2610.                         else if (direction == 7) var modifiedMove = 8;
  2611.                         else if (direction == 8) var modifiedMove = 9;
  2612.                         else if (direction == 9) var modifiedMove = 6;
  2613.                 } else if (eulerZ > 247.5 && eulerZ <= 292.5) {
  2614.                         if (direction == 1) var modifiedMove = 7;
  2615.                         else if (direction == 2) var modifiedMove = 4;
  2616.                         else if (direction == 3) var modifiedMove = 1;
  2617.                         else if (direction == 4) var modifiedMove = 8;
  2618.                         else if (direction == 6) var modifiedMove = 2;
  2619.                         else if (direction == 7) var modifiedMove = 9;
  2620.                         else if (direction == 8) var modifiedMove = 6;
  2621.                         else if (direction == 9) var modifiedMove = 3;
  2622.                 } else if (eulerZ > 202.5 && eulerZ <= 247.5) {
  2623.                         if (direction == 1) var modifiedMove = 8;
  2624.                         else if (direction == 2) var modifiedMove = 7;
  2625.                         else if (direction == 3) var modifiedMove = 4;
  2626.                         else if (direction == 4) var modifiedMove = 9;
  2627.                         else if (direction == 6) var modifiedMove = 1;
  2628.                         else if (direction == 7) var modifiedMove = 6;
  2629.                         else if (direction == 8) var modifiedMove = 3;
  2630.                         else if (direction == 9) var modifiedMove = 2;
  2631.                 } else if (eulerZ > 157.5 && eulerZ <= 202.5) {
  2632.                         if (direction == 1) var modifiedMove = 9;
  2633.                         else if (direction == 2) var modifiedMove = 8;
  2634.                         else if (direction == 3) var modifiedMove = 7;
  2635.                         else if (direction == 4) var modifiedMove = 6;
  2636.                         else if (direction == 6) var modifiedMove = 4;
  2637.                         else if (direction == 7) var modifiedMove = 3;
  2638.                         else if (direction == 8) var modifiedMove = 2;
  2639.                         else if (direction == 9) var modifiedMove = 1;
  2640.                 } else if (eulerZ > 112.5 && eulerZ <= 157.5) {
  2641.                         if (direction == 1) var modifiedMove = 6;
  2642.                         else if (direction == 2) var modifiedMove = 9;
  2643.                         else if (direction == 3) var modifiedMove = 8;
  2644.                         else if (direction == 4) var modifiedMove = 3;
  2645.                         else if (direction == 6) var modifiedMove = 7;
  2646.                         else if (direction == 7) var modifiedMove = 2;
  2647.                         else if (direction == 8) var modifiedMove = 1;
  2648.                         else if (direction == 9) var modifiedMove = 4;
  2649.                 } else if (eulerZ > 67.5 && eulerZ <= 112.5) {
  2650.                         if (direction == 1) var modifiedMove = 3;
  2651.                         else if (direction == 2) var modifiedMove = 6;
  2652.                         else if (direction == 3) var modifiedMove = 9;
  2653.                         else if (direction == 4) var modifiedMove = 2;
  2654.                         else if (direction == 6) var modifiedMove = 8;
  2655.                         else if (direction == 7) var modifiedMove = 1;
  2656.                         else if (direction == 8) var modifiedMove = 4;
  2657.                         else if (direction == 9) var modifiedMove = 7;
  2658.                 } else if (eulerZ > 22.5 && eulerZ <= 67.5) {
  2659.                         if (direction == 1) var modifiedMove = 2;
  2660.                         else if (direction == 2) var modifiedMove = 3;
  2661.                         else if (direction == 3) var modifiedMove = 6;
  2662.                         else if (direction == 4) var modifiedMove = 1;
  2663.                         else if (direction == 6) var modifiedMove = 9;
  2664.                         else if (direction == 7) var modifiedMove = 4;
  2665.                         else if (direction == 8) var modifiedMove = 7;
  2666.                         else if (direction == 9) var modifiedMove = 8;
  2667.                 } else {
  2668.                         return direction;
  2669.                 }
  2670.                 return modifiedMove;
  2671.         };

  2672. };
复制代码
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
 楼主| 发表于 2019-2-11 16:54:13 | 显示全部楼层
本帖最后由 tseyik 于 2019-2-11 20:32 编辑

自己動手做
基本
先登録挿件
000.PNG
登録A4圖塊(牆圖塊);並在地形標記中設定高度0〜7(高1至8)
001.PNG
在地上畫牆(只用到單数行
002.PNG
用pageup: pagedown,移動鏡頭
003.PNG
回复

使用道具 举报

梦石
0
星屑
15309
在线时间
720 小时
注册时间
2011-7-16
回帖
1373

开拓者

发表于 2019-2-11 19:26:51 | 显示全部楼层
这。。。简直了,真棒啊,可以做3d的rpg了
RMMV网络插件,开源免费,内含服务器端,无需强制登录,云数据,弹幕,云存档,排名,兑换码,版本检测,可自由上架下架删除。q群399090587
免打包运行MV游戏,云游戏,安卓App雷神游戏厅,在线玩游戏,上传下载游戏
开源游戏:重装机兵之重装归来【RMMV制作】全球首款按照美剧分季分集的方式发布的游戏
体素画 -- MV画3D像素图的画板
RMMV显示3D模型和场景的插件
RMMV显示spine骨骼动画的插件
RMMV秘密通道插件
突破敌群数量上限8个的插件
在rmmv中显示gif动态图片的插件
一款可以在mv游戏界面的任意位置显示任意文字的插件
RMMV Toast 插件 带物品得失提示,可以设置开启关闭 兼容yep itemcore
制作一个改名卡道具插件、调整标题页面菜单的插件、在标题页面之前显示大段文字的插件、标题页面显示版本号的插件
物品得失自动提示自动上色自动换行插件
我的Q群 663889472
另外,我的插件、范例、游戏都在这里
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
 楼主| 发表于 2019-2-16 00:33:14 | 显示全部楼层
本帖最后由 tseyik 于 2019-2-16 00:44 编辑

CTR_Engine v2.4 DEMO
キャプチャ1.PNG
380M
DEMO
或另開新工程
把下面加入去(js;data)
CTR_Engine_v2.4 DEMO.zip (552.52 KB, 下载次数: 68)
把下面两圖象(!+Door1.png;+Door1.png)加到\img\characters
+Door1.png
!+Door1.png
把下面圖象(BloodCloudStudio.png )加到\img\system
BloodCloudStudio.png
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部